diff --git a/Hardware/4.5A_powerstage.kicad_sch b/Hardware/4.5A_powerstage.kicad_sch index 748d9bc..d6ee9b1 100644 --- a/Hardware/4.5A_powerstage.kicad_sch +++ b/Hardware/4.5A_powerstage.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/9A_powerstage.kicad_sch b/Hardware/9A_powerstage.kicad_sch index be8c7f5..3f3090f 100644 --- a/Hardware/9A_powerstage.kicad_sch +++ b/Hardware/9A_powerstage.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/ACU_DCDC.kicad_sch b/Hardware/ACU_DCDC.kicad_sch index efed5dc..03788fd 100644 --- a/Hardware/ACU_DCDC.kicad_sch +++ b/Hardware/ACU_DCDC.kicad_sch @@ -6,8 +6,8 @@ (paper "A3") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/DRS_DCDC.kicad_sch b/Hardware/DRS_DCDC.kicad_sch index f6c9af4..a905b88 100644 --- a/Hardware/DRS_DCDC.kicad_sch +++ b/Hardware/DRS_DCDC.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/EBS.kicad_sch b/Hardware/EBS.kicad_sch index 4cbc9f5..28a633e 100644 --- a/Hardware/EBS.kicad_sch +++ b/Hardware/EBS.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/EBSR.kicad_sch b/Hardware/EBSR.kicad_sch index 67c7523..7670c0a 100644 --- a/Hardware/EBSR.kicad_sch +++ b/Hardware/EBSR.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/FT25_PDU.kicad_pcb b/Hardware/FT25_PDU.kicad_pcb index 0c45a64..9797643 100644 --- a/Hardware/FT25_PDU.kicad_pcb +++ b/Hardware/FT25_PDU.kicad_pcb @@ -9,8 +9,8 @@ (paper "A3") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FasTTUBe Electronics") ) @@ -5390,6 +5390,108 @@ ) ) ) + (footprint "brain:heart" + (layer "F.Cu") + (uuid "0af8e8d1-032e-44a9-94a6-4e4b9ab7b14b") + (at 117.6 220.05) + (property "Reference" "G***" + (at 0 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "7d09762f-5c84-4cb2-a9d5-03c360322e01") + (effects + (font + (size 1.5 1.5) + (thickness 0.3) + ) + ) + ) + (property "Value" "LOGO" + (at 0.75 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "df9d792e-7e6b-4aea-ae64-1aab59ae3155") + (effects + (font + (size 1.5 1.5) + (thickness 0.3) + ) + ) + ) + (property "Footprint" "brain:heart" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "e9f71299-f28c-45a9-911b-f68370632297") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "074b2488-5959-4478-b6d6-1a55ba393a10") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "807268df-dd09-45ae-a203-b36f31525804") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (attr board_only exclude_from_pos_files exclude_from_bom) + (fp_poly + (pts + (xy 0.494225 -0.80869) (xy 0.560131 -0.795643) (xy 0.62442 -0.773307) (xy 0.685896 -0.741897) (xy 0.730386 -0.711799) + (xy 0.778049 -0.669228) (xy 0.819844 -0.618777) (xy 0.855302 -0.56173) (xy 0.883953 -0.49937) (xy 0.905326 -0.432981) + (xy 0.918953 -0.363846) (xy 0.924361 -0.293248) (xy 0.921083 -0.222471) (xy 0.91803 -0.199393) (xy 0.906174 -0.141614) + (xy 0.888346 -0.084542) (xy 0.86413 -0.027574) (xy 0.83311 0.029887) (xy 0.794867 0.088445) (xy 0.748987 0.148698) + (xy 0.695051 0.211247) (xy 0.632643 0.276694) (xy 0.561346 0.345638) (xy 0.502453 0.399409) (xy 0.47372 0.424925) + (xy 0.440913 0.453773) (xy 0.404869 0.485239) (xy 0.366425 0.518611) (xy 0.326416 0.553175) (xy 0.285678 0.588219) + (xy 0.245047 0.62303) (xy 0.20536 0.656895) (xy 0.167453 0.689103) (xy 0.132162 0.718938) (xy 0.100322 0.74569) + (xy 0.07277 0.768646) (xy 0.050342 0.787092) (xy 0.033875 0.800315) (xy 0.024204 0.807604) (xy 0.022251 0.808774) + (xy 0.00593 0.812984) (xy -0.008789 0.8109) (xy -0.025836 0.801779) (xy -0.030079 0.798901) (xy -0.04397 0.788556) + (xy -0.064928 0.772006) (xy -0.092015 0.750046) (xy -0.124291 0.723469) (xy -0.160818 0.693069) + (xy -0.200657 0.65964) (xy -0.242867 0.623976) (xy -0.286512 0.586871) (xy -0.33065 0.549118) (xy -0.374344 0.511513) + (xy -0.416654 0.474847) (xy -0.456641 0.439916) (xy -0.493366 0.407514) (xy -0.499812 0.401785) + (xy -0.580049 0.328096) (xy -0.650882 0.258083) (xy -0.71268 0.191233) (xy -0.765814 0.127032) (xy -0.810651 0.064965) + (xy -0.847563 0.004518) (xy -0.876919 -0.054822) (xy -0.899087 -0.113571) (xy -0.914438 -0.172241) + (xy -0.915237 -0.176211) (xy -0.918693 -0.201619) (xy -0.920868 -0.234349) (xy -0.921788 -0.271469) + (xy -0.921484 -0.310045) (xy -0.919981 -0.347146) (xy -0.917309 -0.379837) (xy -0.913494 -0.405186) + (xy -0.913039 -0.407257) (xy -0.891293 -0.481377) (xy -0.861585 -0.549392) (xy -0.824359 -0.610811) + (xy -0.780063 -0.665149) (xy -0.729141 -0.711916) (xy -0.67204 -0.750626) (xy -0.609205 -0.780789) + (xy -0.555642 -0.798299) (xy -0.515154 -0.806076) (xy -0.46884 -0.810184) (xy -0.420449 -0.810618) + (xy -0.373726 -0.807376) (xy -0.332422 -0.800456) (xy -0.32456 -0.798474) (xy -0.261649 -0.776067) + (xy -0.201138 -0.743961) (xy -0.144116 -0.703007) (xy -0.091673 -0.65406) (xy -0.044899 -0.597972) + (xy -0.018418 -0.558685) (xy -0.008485 -0.542875) (xy -0.000921 -0.531366) (xy 0.002769 -0.52644) + (xy 0.002866 -0.526398) (xy 0.006152 -0.53055) (xy 0.014114 -0.541867) (xy 0.025571 -0.558638) (xy 0.03934 -0.579153) + (xy 0.039858 -0.57993) (xy 0.086216 -0.641852) (xy 0.136459 -0.694024) (xy 0.190927 -0.736723) (xy 0.249964 -0.770227) + (xy 0.298737 -0.789929) (xy 0.362333 -0.806049) (xy 0.427894 -0.81223) + ) + (stroke + (width 0) + (type solid) + ) + (fill solid) + (layer "B.SilkS") + (uuid "3a9dfcbf-a5f2-491e-94ce-5da7a5d52a14") + ) + ) (footprint "Resistor_SMD:R_0603_1608Metric" (layer "F.Cu") (uuid "0b039b1a-2217-4135-b5bd-438d2eb131c8") @@ -6159,11 +6261,11 @@ (footprint "5025:5025" (layer "F.Cu") (uuid "0bddf93f-a635-48ee-bd54-dcab4bcb33bb") - (at 114.96 217.59) + (at 147.190001 216.99 90) (descr "5025-1") (tags "Test Point") (property "Reference" "TP13" - (at 1.2 -1.6 0) + (at 4.030001 1.049999 180) (layer "F.SilkS") (uuid "73595639-0f13-491d-8647-62afb53a3414") (effects @@ -6174,7 +6276,7 @@ ) ) (property "Value" "test-pad" - (at 1.5 -3.5 0) + (at 1.5 -3.5 90) (layer "F.SilkS") (hide yes) (uuid "222faf8e-8054-4204-b1dd-9d54f5b26ccd") @@ -6186,7 +6288,7 @@ ) ) (property "Footprint" "5025:5025" - (at 0 0 0) + (at 0 0 90) (unlocked yes) (layer "F.Fab") (hide yes) @@ -6199,7 +6301,7 @@ ) ) (property "Datasheet" "" - (at 0 0 0) + (at 0 0 90) (unlocked yes) (layer "F.Fab") (hide yes) @@ -6212,7 +6314,7 @@ ) ) (property "Description" "test point" - (at 0 0 0) + (at 0 0 90) (unlocked yes) (layer "F.Fab") (hide yes) @@ -6229,16 +6331,6 @@ (sheetname "DRS-DCDC (24V->7.2V)") (sheetfile "DRS_DCDC.kicad_sch") (attr through_hole) - (fp_line - (start -1.3 0) - (end -1.3 0) - (stroke - (width 0.1) - (type solid) - ) - (layer "F.SilkS") - (uuid "923c23cb-6bb1-4119-8588-1855e4ecd55a") - ) (fp_line (start -1.2 0) (end -1.2 0) @@ -6249,20 +6341,19 @@ (layer "F.SilkS") (uuid "407f0d42-404e-4ed8-adc5-918ddffc27dd") ) - (fp_arc + (fp_line (start -1.3 0) - (mid -1.25 -0.05) - (end -1.2 0) + (end -1.3 0) (stroke (width 0.1) (type solid) ) (layer "F.SilkS") - (uuid "7793005d-555d-40ae-8e45-ed5897bd7006") + (uuid "923c23cb-6bb1-4119-8588-1855e4ecd55a") ) (fp_arc (start -1.2 0) - (mid -1.25 0.05) + (mid -1.249999 0.049999) (end -1.3 0) (stroke (width 0.1) @@ -6271,25 +6362,16 @@ (layer "F.SilkS") (uuid "717b8865-3dbe-4d12-bd7c-94c6d0dff9c7") ) - (fp_line - (start -0.85 -0.85) - (end 3.35 -0.85) + (fp_arc + (start -1.3 0) + (mid -1.249999 -0.050001) + (end -1.2 0) (stroke (width 0.1) (type solid) ) - (layer "F.CrtYd") - (uuid "b934c698-8fbd-4d8b-a840-2ff334a6fc79") - ) - (fp_line - (start -0.85 0.85) - (end -0.85 -0.85) - (stroke - (width 0.1) - (type solid) - ) - (layer "F.CrtYd") - (uuid "8ed3739d-fe84-4132-acb8-e2041709a3bc") + (layer "F.SilkS") + (uuid "7793005d-555d-40ae-8e45-ed5897bd7006") ) (fp_line (start 3.35 -0.85) @@ -6301,6 +6383,16 @@ (layer "F.CrtYd") (uuid "b88f6b78-b9ea-47fa-9e98-c78f83d72cf8") ) + (fp_line + (start -0.85 -0.85) + (end 3.35 -0.85) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.CrtYd") + (uuid "b934c698-8fbd-4d8b-a840-2ff334a6fc79") + ) (fp_line (start 3.35 0.85) (end -0.85 0.85) @@ -6312,28 +6404,18 @@ (uuid "686fb1b7-9960-410c-9ada-bbb2fe04f67f") ) (fp_line - (start -0.02 -0.51) - (end 2.52 -0.51) + (start -0.85 0.85) + (end -0.85 -0.85) (stroke (width 0.1) (type solid) ) - (layer "F.Fab") - (uuid "0833450b-aea2-440d-9864-7f3c6534d37b") + (layer "F.CrtYd") + (uuid "8ed3739d-fe84-4132-acb8-e2041709a3bc") ) (fp_line - (start -0.02 0.51) - (end -0.02 -0.51) - (stroke - (width 0.1) - (type solid) - ) - (layer "F.Fab") - (uuid "b6cbd896-2655-42bd-b625-dcc494dc943f") - ) - (fp_line - (start 2.52 -0.51) - (end 2.52 0.51) + (start 2.520001 -0.51) + (end 2.520001 0.51) (stroke (width 0.1) (type solid) @@ -6342,8 +6424,18 @@ (uuid "e6863a6b-d4d1-4410-a12e-0bf2132c7cbd") ) (fp_line - (start 2.52 0.51) - (end -0.02 0.51) + (start -0.020001 -0.51) + (end 2.520001 -0.51) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "0833450b-aea2-440d-9864-7f3c6534d37b") + ) + (fp_line + (start 2.520001 0.51) + (end -0.020001 0.51) (stroke (width 0.1) (type solid) @@ -6351,8 +6443,18 @@ (layer "F.Fab") (uuid "04ce799c-e003-4415-ade6-0aa1d746d58d") ) + (fp_line + (start -0.020001 0.51) + (end -0.020001 -0.51) + (stroke + (width 0.1) + (type solid) + ) + (layer "F.Fab") + (uuid "b6cbd896-2655-42bd-b625-dcc494dc943f") + ) (fp_text user "${REFERENCE}" - (at 1.25 0 0) + (at 1.249999 0 90) (layer "F.Fab") (uuid "618fcd5a-09ca-4c71-abf9-dc632d052f11") (effects @@ -6363,7 +6465,7 @@ ) ) (pad "1" thru_hole rect - (at 0 0) + (at 0 0 90) (size 1.5 1.5) (drill 1) (layers "*.Cu" "*.Mask") @@ -6374,7 +6476,7 @@ (uuid "01fc0e4d-3110-4c45-814c-9b20ef551325") ) (pad "1" thru_hole circle - (at 2.5 0) + (at 2.5 0 90) (size 1.5 1.5) (drill 1) (layers "*.Cu" "*.Mask") @@ -13999,7 +14101,7 @@ (footprint "Resistor_SMD:R_0603_1608Metric" (layer "F.Cu") (uuid "201d07d5-76e3-44fa-8b59-068656cd427f") - (at 122.875 135.165) + (at 124.175 135.165) (descr "Resistor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator") (tags "resistor") (property "Reference" "R142" @@ -29080,13 +29182,13 @@ (descr "43045-04(00,01,02,10)") (tags "Connector") (property "Reference" "J9" - (at -1.3 7 0) + (at -7.5 8 0) (layer "F.SilkS") (uuid "1e9dd7d6-ab68-49e3-8e44-6cb52f70e7c0") (effects (font - (size 1.27 1.27) - (thickness 0.254) + (size 1 1) + (thickness 0.15) ) ) ) @@ -34641,13 +34743,13 @@ (descr "43045-04(00,01,02,10)") (tags "Connector") (property "Reference" "J11" - (at -1.3 7.3 0) + (at 5 8.2 0) (layer "F.SilkS") (uuid "adf33f35-d377-447f-8978-f46a5b8a3cf5") (effects (font - (size 1.27 1.27) - (thickness 0.254) + (size 1 1) + (thickness 0.15) ) ) ) @@ -88797,6 +88899,108 @@ ) ) ) + (footprint "brain:heart" + (layer "F.Cu") + (uuid "c439a31a-82dd-4354-9214-d9b3e644691f") + (at 131.3 220) + (property "Reference" "G***" + (at 0 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "7d09762f-5c84-4cb2-a9d5-03c360322e01") + (effects + (font + (size 1.5 1.5) + (thickness 0.3) + ) + ) + ) + (property "Value" "LOGO" + (at 0.75 0 0) + (layer "F.SilkS") + (hide yes) + (uuid "df9d792e-7e6b-4aea-ae64-1aab59ae3155") + (effects + (font + (size 1.5 1.5) + (thickness 0.3) + ) + ) + ) + (property "Footprint" "brain:heart" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "e9f71299-f28c-45a9-911b-f68370632297") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Datasheet" "" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "074b2488-5959-4478-b6d6-1a55ba393a10") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (property "Description" "" + (at 0 0 0) + (layer "F.Fab") + (hide yes) + (uuid "807268df-dd09-45ae-a203-b36f31525804") + (effects + (font + (size 1.27 1.27) + (thickness 0.15) + ) + ) + ) + (attr board_only exclude_from_pos_files exclude_from_bom) + (fp_poly + (pts + (xy 0.494225 -0.80869) (xy 0.560131 -0.795643) (xy 0.62442 -0.773307) (xy 0.685896 -0.741897) (xy 0.730386 -0.711799) + (xy 0.778049 -0.669228) (xy 0.819844 -0.618777) (xy 0.855302 -0.56173) (xy 0.883953 -0.49937) (xy 0.905326 -0.432981) + (xy 0.918953 -0.363846) (xy 0.924361 -0.293248) (xy 0.921083 -0.222471) (xy 0.91803 -0.199393) (xy 0.906174 -0.141614) + (xy 0.888346 -0.084542) (xy 0.86413 -0.027574) (xy 0.83311 0.029887) (xy 0.794867 0.088445) (xy 0.748987 0.148698) + (xy 0.695051 0.211247) (xy 0.632643 0.276694) (xy 0.561346 0.345638) (xy 0.502453 0.399409) (xy 0.47372 0.424925) + (xy 0.440913 0.453773) (xy 0.404869 0.485239) (xy 0.366425 0.518611) (xy 0.326416 0.553175) (xy 0.285678 0.588219) + (xy 0.245047 0.62303) (xy 0.20536 0.656895) (xy 0.167453 0.689103) (xy 0.132162 0.718938) (xy 0.100322 0.74569) + (xy 0.07277 0.768646) (xy 0.050342 0.787092) (xy 0.033875 0.800315) (xy 0.024204 0.807604) (xy 0.022251 0.808774) + (xy 0.00593 0.812984) (xy -0.008789 0.8109) (xy -0.025836 0.801779) (xy -0.030079 0.798901) (xy -0.04397 0.788556) + (xy -0.064928 0.772006) (xy -0.092015 0.750046) (xy -0.124291 0.723469) (xy -0.160818 0.693069) + (xy -0.200657 0.65964) (xy -0.242867 0.623976) (xy -0.286512 0.586871) (xy -0.33065 0.549118) (xy -0.374344 0.511513) + (xy -0.416654 0.474847) (xy -0.456641 0.439916) (xy -0.493366 0.407514) (xy -0.499812 0.401785) + (xy -0.580049 0.328096) (xy -0.650882 0.258083) (xy -0.71268 0.191233) (xy -0.765814 0.127032) (xy -0.810651 0.064965) + (xy -0.847563 0.004518) (xy -0.876919 -0.054822) (xy -0.899087 -0.113571) (xy -0.914438 -0.172241) + (xy -0.915237 -0.176211) (xy -0.918693 -0.201619) (xy -0.920868 -0.234349) (xy -0.921788 -0.271469) + (xy -0.921484 -0.310045) (xy -0.919981 -0.347146) (xy -0.917309 -0.379837) (xy -0.913494 -0.405186) + (xy -0.913039 -0.407257) (xy -0.891293 -0.481377) (xy -0.861585 -0.549392) (xy -0.824359 -0.610811) + (xy -0.780063 -0.665149) (xy -0.729141 -0.711916) (xy -0.67204 -0.750626) (xy -0.609205 -0.780789) + (xy -0.555642 -0.798299) (xy -0.515154 -0.806076) (xy -0.46884 -0.810184) (xy -0.420449 -0.810618) + (xy -0.373726 -0.807376) (xy -0.332422 -0.800456) (xy -0.32456 -0.798474) (xy -0.261649 -0.776067) + (xy -0.201138 -0.743961) (xy -0.144116 -0.703007) (xy -0.091673 -0.65406) (xy -0.044899 -0.597972) + (xy -0.018418 -0.558685) (xy -0.008485 -0.542875) (xy -0.000921 -0.531366) (xy 0.002769 -0.52644) + (xy 0.002866 -0.526398) (xy 0.006152 -0.53055) (xy 0.014114 -0.541867) (xy 0.025571 -0.558638) (xy 0.03934 -0.579153) + (xy 0.039858 -0.57993) (xy 0.086216 -0.641852) (xy 0.136459 -0.694024) (xy 0.190927 -0.736723) (xy 0.249964 -0.770227) + (xy 0.298737 -0.789929) (xy 0.362333 -0.806049) (xy 0.427894 -0.81223) + ) + (stroke + (width 0) + (type solid) + ) + (fill solid) + (layer "B.SilkS") + (uuid "3a9dfcbf-a5f2-491e-94ce-5da7a5d52a14") + ) + ) (footprint "Resistor_SMD:R_0603_1608Metric" (layer "F.Cu") (uuid "c5219590-6d12-4a5b-8624-6a22a8efdde1") @@ -104727,7 +104931,7 @@ (footprint "Capacitor_SMD:C_0603_1608Metric" (layer "F.Cu") (uuid "e497494b-9e74-45cd-a4ef-4d45cf48b44d") - (at 122.875 136.625) + (at 124.175 136.625) (descr "Capacitor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 76, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator") (tags "capacitor") (property "Reference" "C76" @@ -117886,6 +118090,117 @@ (uuid "14732409-b986-40d2-b4d7-bf6e9689092c") ) ) + (gr_line + (start 235.8 129.2) + (end 234.7 130.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "00c78e80-3a01-4533-8beb-bc442742dc07") + ) + (gr_line + (start 167.3 214.9) + (end 167.6 214.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "0127d8d6-ee72-436e-964c-9a0afeccf805") + ) + (gr_line + (start 240 129.2) + (end 232.8 136.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "0169b3c6-c2d7-4754-8730-d9c200891631") + ) + (gr_line + (start 242.8 132.2) + (end 236.5 138.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "01c36b05-c46c-4363-b626-066db3108b45") + ) + (gr_rect + (start 115.05 212.65) + (end 133.85 221.2) + (stroke + (width 0.15) + (type default) + ) + (fill none) + (layer "B.SilkS") + (uuid "034b30aa-f423-45af-beea-b597a729e30e") + ) + (gr_line + (start 170.7 218.9) + (end 170.8 219) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "0619dc56-63ec-4374-9533-514050cd1288") + ) + (gr_line + (start 148.3 189.8) + (end 151.6 193.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "0772b2d7-d573-4361-8ae4-9c8571e45ee7") + ) + (gr_line + (start 231.6 146.4) + (end 240.7 137.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "0777006e-2c7e-4c02-9efd-e0130521bb1e") + ) + (gr_line + (start 241.5 140.5) + (end 241.5 141.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "078fbe4f-f929-4859-b328-24932f6e92d3") + ) + (gr_line + (start 151.9 192.6) + (end 153.7 192.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "083bddae-d17a-44c6-b8ce-182309444ac3") + ) + (gr_line + (start 167.6 214.9) + (end 172 219.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "09f03379-d055-4380-85d8-63c7281b7431") + ) (gr_line (start 223.4 118.4) (end 232 127) @@ -117906,6 +118221,116 @@ (layer "B.SilkS") (uuid "0ac6c28f-d1cd-46cc-9b40-f4838c080cbc") ) + (gr_line + (start 115.05 216.45) + (end 133.85 216.45) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "0b873f77-3436-4d63-830a-5c67b40d06f5") + ) + (gr_line + (start 236.2 146.5) + (end 236 146.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "12ef0cfa-a528-4302-aa3a-7bd1e872bd3c") + ) + (gr_line + (start 236 148.2) + (end 231.7 152.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "17629133-d9be-4dfa-8aa6-1ca556bbbd17") + ) + (gr_line + (start 155.8 204.3) + (end 166.9 215.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "192b16ea-4580-44bf-8d84-d527f057e629") + ) + (gr_line + (start 142.1 179.3) + (end 149.3 186.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "1a91e458-bab1-4df7-8ac8-ae775d39f426") + ) + (gr_line + (start 148.8 189.5) + (end 151.9 192.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "1b694179-8c2c-4a46-b66f-19d584ebef33") + ) + (gr_line + (start 231.7 156.9) + (end 242.8 145.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "1bcb22ab-0c5f-4075-90e9-77cd28a4c608") + ) + (gr_line + (start 238.5 129.2) + (end 242.8 129.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "1d4227a7-783c-4d9a-a71c-a63cb248dcb8") + ) + (gr_line + (start 119.8 179.3) + (end 142.1 179.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "2081df5b-b506-439f-8475-d388e26b779e") + ) + (gr_line + (start 119.2 180.3) + (end 141.5 180.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "21c910f1-e77a-4f4a-bf38-83794e75f1d9") + ) + (gr_line + (start 242.8 197.8) + (end 233.1 197.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "24e29bfc-fe56-40d3-a908-264ab2dd1727") + ) (gr_line (start 223.4 113) (end 223.4 96.6) @@ -117916,6 +118341,86 @@ (layer "B.SilkS") (uuid "26a25f1f-fe89-44d4-a79f-faf65f3da287") ) + (gr_line + (start 233.3 141.7) + (end 234.1 140.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "27d3894a-fcc8-441c-9f6f-6558724b6481") + ) + (gr_line + (start 153.4 193.1) + (end 155.3 195) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "2855a5e0-d497-4adf-a4bb-7e35924dfc17") + ) + (gr_line + (start 232.8 130.8) + (end 234.4 129.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "290d76a4-bef1-4b1b-af75-73b1a051d841") + ) + (gr_line + (start 231.6 146.5) + (end 231.6 142.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "2b020d93-6f5f-472e-8264-bab5f9fbb683") + ) + (gr_line + (start 167 215.5) + (end 167.3 215.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "2b171b4c-aada-4fca-bf11-44357f6ecc6b") + ) + (gr_line + (start 234.7 146.5) + (end 240.7 140.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "2e697404-626b-4b19-82aa-74207a3e8264") + ) + (gr_line + (start 242.8 177.5) + (end 231.7 188.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "2e9b4578-d228-49e3-9e64-d0f65f5af725") + ) + (gr_line + (start 231.7 193) + (end 242.8 181.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "2ea5c7da-ed82-4011-b675-0e21dc435f69") + ) (gr_line (start 236.4 130.4) (end 245.1 121.7) @@ -117926,6 +118431,16 @@ (layer "B.SilkS") (uuid "318f0cd5-8d10-42bf-99fb-ede72f623127") ) + (gr_line + (start 242.8 192.9) + (end 242.1 193.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "327d4920-235d-4026-9ead-3647eee53fb8") + ) (gr_line (start 243 140.5) (end 248.5 146) @@ -117936,6 +118451,156 @@ (layer "B.SilkS") (uuid "33235c18-ecc6-4089-9be6-f5e893920878") ) + (gr_line + (start 234.7 197.8) + (end 235.5 197) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "33a8c601-f263-4cc6-86f9-12aa75fc906e") + ) + (gr_line + (start 117.3 149.2) + (end 117.3 178.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "35dc2f34-a918-4599-b7fd-201478b727ea") + ) + (gr_line + (start 242.8 168.5) + (end 231.7 179.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "364563d7-4c3a-4161-8654-f29d9b2068cc") + ) + (gr_line + (start 122.7 133.7) + (end 122.7 145.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "37370e1e-7d09-4a84-bb4f-fe971a9bd029") + ) + (gr_line + (start 231.7 187) + (end 242.8 175.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "399b83cc-58a4-4c67-bd06-c1701377318a") + ) + (gr_line + (start 242.8 162.4) + (end 238.2 167) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "3aee7971-d6df-432f-8056-94b95bb895f8") + ) + (gr_line + (start 232.8 132.2) + (end 233.3 131.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "3b348e00-461e-4fed-b274-c216cc423708") + ) + (gr_line + (start 121.1 134.2) + (end 121.1 145.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "3b65ef1a-1248-40b6-8be6-ecd943a72a47") + ) + (gr_line + (start 149.3 186.5) + (end 149.3 189.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "3c6ca28c-2caa-4352-91c8-f1ede55c72f4") + ) + (gr_line + (start 231.7 161.5) + (end 236.6 156.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "3d976253-82bb-42a7-bb69-402f4b3a9194") + ) + (gr_line + (start 118.3 149.8) + (end 118.3 177.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "40f7d770-ae34-494b-851c-b34ec3143325") + ) + (gr_line + (start 239.5 197.8) + (end 240.3 197) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "412df558-59b8-467c-86b5-95918e85a0cb") + ) + (gr_line + (start 124.45 212.65) + (end 124.45 216.45) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "440246cd-c37b-45eb-b777-df313e36b717") + ) + (gr_line + (start 231.7 164.5) + (end 236.6 159.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "44593882-e8fa-4178-a9f0-fa5e085de493") + ) + (gr_line + (start 155.3 195) + (end 155.3 204.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "44f707ad-2374-4cb9-a409-449b74a6d8e0") + ) (gr_line (start 270.2 136.9) (end 270.2 127.8) @@ -117956,6 +118621,36 @@ (layer "B.SilkS") (uuid "4731e46e-607f-4370-b103-fd8ebc98981a") ) + (gr_line + (start 231.7 190) + (end 242.8 178.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "4765d7f9-5a69-42e4-ac5e-c86c09a2a89c") + ) + (gr_line + (start 242.8 150.4) + (end 237.9 155.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "478fd66c-ba37-4565-900f-c6ca1b3d309d") + ) + (gr_line + (start 231.7 170.3) + (end 236.7 165.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "4ad6c626-fba5-4307-a838-490e1a8efb66") + ) (gr_line (start 248.5 146) (end 261 146) @@ -117966,6 +118661,106 @@ (layer "B.SilkS") (uuid "50742428-971e-4ff5-b3a4-b2a7e79377c8") ) + (gr_line + (start 233.3 141.5) + (end 231.6 141.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "51d269ce-56c2-41d1-9901-c8243b94b67e") + ) + (gr_line + (start 231.7 166.1) + (end 237.25 160.55) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "52ed378a-1927-4780-9683-74be3e51f1ec") + ) + (gr_line + (start 231.6 140.4) + (end 233.3 138.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "54a84273-c824-4d5c-9a43-8944106acb0d") + ) + (gr_line + (start 148.8 186.8) + (end 148.8 189.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "5504a2b2-2e8c-4584-a317-89401b877da4") + ) + (gr_line + (start 231.7 168.9) + (end 236.7 163.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "57291f95-f198-43b1-92c3-6ecd44377a81") + ) + (gr_line + (start 242.8 144.4) + (end 231.7 155.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "57d721d6-3647-469b-ad6a-d42c7027b4ad") + ) + (gr_line + (start 231.7 173.5) + (end 236.7 168.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "57fbae0a-b96d-424d-bf48-e918f19cb7b9") + ) + (gr_line + (start 117.3 178.4) + (end 119.2 180.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "58c62dad-5a17-4e88-b962-f1de55c2bf3f") + ) + (gr_line + (start 242.8 153.4) + (end 238.3 157.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "5911fc50-642d-4a20-ac8d-dce24716e660") + ) + (gr_line + (start 122.7 145.4) + (end 118.3 149.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "59229fad-14e9-45f6-a543-877aa64ccdf5") + ) (gr_line (start 245.1 121.7) (end 257.2 121.7) @@ -117976,6 +118771,96 @@ (layer "B.SilkS") (uuid "5a150d18-7b20-40c4-97bb-04898919143f") ) + (gr_line + (start 242.8 180.5) + (end 231.7 191.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "5bbbc6dd-4cb8-4158-a328-88758d2722ba") + ) + (gr_line + (start 242.8 147.4) + (end 231.7 158.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "5c1f27a2-f76d-4ab6-beb9-0137112748b7") + ) + (gr_line + (start 240.7 140.5) + (end 241.5 140.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "5f0a1079-9805-4506-a3e1-19051173e0fc") + ) + (gr_line + (start 240.7 136.7) + (end 240.7 140.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "5f2c41e8-7d0a-42a5-a642-6d90347a491a") + ) + (gr_line + (start 166.9 215.4) + (end 167 215.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "60231999-1722-4409-8226-c2fa4d8ea357") + ) + (gr_line + (start 241.5 142.4) + (end 242.8 142.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "615eaa41-57e5-4742-a092-9e69e0a238a0") + ) + (gr_line + (start 242.8 188.1) + (end 237.3 193.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "64407676-c451-455d-a52c-2376c1167496") + ) + (gr_line + (start 242.8 164) + (end 238.3 168.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "65c961ed-7f02-4b15-816c-0e54defe90cf") + ) + (gr_line + (start 231.7 147.6) + (end 236 147.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "689f13c2-066c-449f-befc-9d5f0ed13f48") + ) (gr_line (start 223.4 96.6) (end 223.4 95.4) @@ -117986,6 +118871,16 @@ (layer "B.SilkS") (uuid "6902fed5-fe58-4643-9a9a-43b6fe2d58c1") ) + (gr_line + (start 149.3 189.3) + (end 152.1 192.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "6e778808-33c1-409b-a7bb-d91224ea5ecd") + ) (gr_line (start 232 127) (end 232 137.3) @@ -118006,6 +118901,56 @@ (layer "B.SilkS") (uuid "6ef9b866-a837-4b52-b1d7-afd6aba8bd7e") ) + (gr_line + (start 232.8 137.5) + (end 232.8 129.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "70e80bca-7cce-4ab6-99b3-63b283704adb") + ) + (gr_line + (start 232.8 133.6) + (end 233.5 132.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "753dc6a8-f12b-436a-b8a2-4795a48fee1a") + ) + (gr_line + (start 232.8 129.2) + (end 236.7 129.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "763bbd39-005b-4113-877b-2e768142c010") + ) + (gr_line + (start 241.4 129.2) + (end 231.6 139) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "7753c132-2068-4681-a54b-8d289354e623") + ) + (gr_line + (start 231.7 175.1) + (end 237 169.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "77d3c0ab-f216-470d-985c-d3892e52be11") + ) (gr_line (start 266.4 113) (end 223.4 113) @@ -118016,6 +118961,146 @@ (layer "B.SilkS") (uuid "79afadcc-97d1-46f3-9ded-cdcc59d6e1e0") ) + (gr_line + (start 233.1 197.8) + (end 235.5 195.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "8215f5d0-8572-4e57-ac7e-731e9fa45583") + ) + (gr_line + (start 231.6 138.8) + (end 232.8 137.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "83c553d9-2694-427a-a4ac-07a93ef96455") + ) + (gr_line + (start 242.8 152) + (end 238.3 156.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "847b20eb-8913-452d-a461-49f3db88b496") + ) + (gr_line + (start 153.7 192.6) + (end 155.8 194.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "85064f68-274e-423d-b105-1bdeaa2377c3") + ) + (gr_line + (start 236 147.6) + (end 236 146.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "8510e69e-8c99-4ab7-a1b4-2858e16f87ee") + ) + (gr_line + (start 231.6 142.6) + (end 233.3 142.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "86bede64-0e5e-4a99-a611-aec28265593b") + ) + (gr_line + (start 238.6 129.2) + (end 236.6 131.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "89f9953d-b609-4053-96bf-9b81f4f497e1") + ) + (gr_line + (start 168.9 224.1) + (end 169.9 225.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "8adbabbf-ccf3-4f19-9649-9b560db94200") + ) + (gr_line + (start 155.8 194.7) + (end 155.8 204.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "8b414fe6-0d1c-4891-ac47-808677825d1e") + ) + (gr_line + (start 233.3 142.6) + (end 233.3 141.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "8bfb5e64-6903-48c3-8971-1885a642fc34") + ) + (gr_line + (start 231.7 153.9) + (end 242.8 142.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "8c372dc4-18ee-43a8-8d81-ae9b42fc7127") + ) + (gr_line + (start 141.5 180.3) + (end 148.3 187.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "8c578505-2649-4d02-b2c3-9355afbff99d") + ) + (gr_line + (start 232 141.5) + (end 233.4 140.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "90eba0e9-64bb-490e-93ca-e05a134ce667") + ) + (gr_line + (start 242.8 189.7) + (end 238.9 193.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "92641280-b9da-4dd1-a19e-39f2f6cd09b9") + ) (gr_line (start 243 138.5) (end 243 140.5) @@ -118026,6 +119111,266 @@ (layer "B.SilkS") (uuid "97168ee1-b119-4e81-be2d-2c69fa5dbd94") ) + (gr_line + (start 242.8 159.2) + (end 238.3 163.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "974c1f6a-8727-4cf7-8b5c-d4286a2c2649") + ) + (gr_line + (start 231.7 171.9) + (end 236.8 166.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "98761bd2-f666-475f-bf7f-15cdb4f54a8d") + ) + (gr_line + (start 167.3 215.5) + (end 170.7 218.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "9a23c455-8df8-43b5-8b78-4930e27c4945") + ) + (gr_line + (start 236.3 197.8) + (end 237.1 197) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "9c9a2a9a-5f01-4dae-aea9-8f0c19e7b9fb") + ) + (gr_line + (start 241.5 141.2) + (end 241.5 142.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "9d906d3d-1434-4562-a747-db4894ed5421") + ) + (gr_line + (start 117.8 149.5) + (end 117.8 178) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "9e665b27-5a1c-48a4-b661-6b471e21ebfa") + ) + (gr_line + (start 231.6 141.5) + (end 231.6 138.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "9f32c87f-b2dd-4433-a871-5933be116780") + ) + (gr_line + (start 121.1 145.4) + (end 117.3 149.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "a2e00a41-1bf9-4fbe-9890-bc1b4fb1d85b") + ) + (gr_line + (start 242.8 155) + (end 238.2 159.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "a3cb1b95-d8b1-42f1-9767-4c9f1af91434") + ) + (gr_line + (start 242.8 133.8) + (end 231.6 145) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "a505e26d-f8a8-4782-986b-d69d2c4829fd") + ) + (gr_line + (start 231.7 196) + (end 242.8 184.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "a7150768-0ab9-438f-96c1-587910966b17") + ) + (gr_line + (start 118.3 177.8) + (end 119.8 179.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "a7276b86-b1a5-4e95-9ff4-00212c02205c") + ) + (gr_line + (start 117.8 178) + (end 117.8 178.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "a93db3c0-36b3-4fd9-b5d8-ef5adf3d42eb") + ) + (gr_line + (start 236.2 146.5) + (end 241.5 141.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "aea8caba-6df5-41b2-9d60-fbb28fdc2b04") + ) + (gr_line + (start 155.3 204.6) + (end 168.9 218.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "af781ba1-518b-42f9-979d-b10266a4019d") + ) + (gr_line + (start 156.3 203.9) + (end 167.3 214.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "af7be144-9cda-44e5-b562-5b627654c113") + ) + (gr_line + (start 168.9 218.2) + (end 168.9 224.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "b04dd116-6151-4ee6-aeeb-74eb266f23fa") + ) + (gr_line + (start 231.7 163.1) + (end 236.6 158.2) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "b0accd7b-339c-4050-8cfc-188c3f4a5e30") + ) + (gr_line + (start 154 192.1) + (end 156.3 194.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "b10d7d67-1790-46b2-9fc7-0d39ad608936") + ) + (gr_line + (start 242.8 129.2) + (end 234.4 137.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "b18322c1-9062-49e5-9dcd-6e2eb6fcb990") + ) + (gr_line + (start 242.8 134.6) + (end 240.7 136.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "b3c8bfdd-358f-4c12-bcd4-db1be515a65e") + ) + (gr_line + (start 170.8 219) + (end 170.8 221.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "b5b7844e-45a8-4080-be5c-07518395bbc8") + ) + (gr_line + (start 242.8 165.6) + (end 231.7 176.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "b7077b8e-8880-4c0b-bada-c9658c45f877") + ) + (gr_line + (start 231.7 167.5) + (end 236.7 162.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "ba770188-6d5d-4ba7-aea2-81aecf1faa5f") + ) + (gr_line + (start 231.7 184) + (end 242.8 172.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "baf878f8-4fa3-4eda-a689-4c5739eca53a") + ) + (gr_line + (start 233.1 197.8) + (end 231.7 196.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "bca48e41-f920-4b71-8f30-daec4216fbbd") + ) (gr_line (start 223.4 95.4) (end 224.5 94.3) @@ -118036,6 +119381,16 @@ (layer "B.SilkS") (uuid "bcb47902-8ea0-4042-a053-3656af5508fc") ) + (gr_line + (start 152.1 192.1) + (end 154 192.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "beb40e88-6ce6-45cb-89d2-b7ac39efa48b") + ) (gr_line (start 242.5 137.9) (end 243 138.5) @@ -118046,6 +119401,36 @@ (layer "B.SilkS") (uuid "c1c3a4ca-e300-486f-92a9-c4d0f3636729") ) + (gr_line + (start 231.7 196.4) + (end 231.7 147.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "c48d0f83-d49d-46c6-a12e-75b85751d370") + ) + (gr_line + (start 121.9 139.2) + (end 121.9 138.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "c63debea-3030-4a45-af82-a66d347134f2") + ) + (gr_line + (start 231.7 150.9) + (end 235 147.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "cc9e2485-23b0-43f1-9515-6dd0009bd7f1") + ) (gr_line (start 261 146) (end 270.2 136.9) @@ -118056,6 +119441,46 @@ (layer "B.SilkS") (uuid "cecf08be-709c-4166-a89c-c99d80b94071") ) + (gr_line + (start 231.7 149.3) + (end 233.4 147.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "cf64ff1c-09da-46c0-99e3-e269ae103baa") + ) + (gr_line + (start 232.8 135) + (end 234.3 133.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "cf797bfd-6753-4138-b01d-64cffd9561ab") + ) + (gr_line + (start 242.8 156.4) + (end 238.3 160.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "cf96c9ae-778c-4816-abe6-c68844f601b8") + ) + (gr_line + (start 119.5 179.8) + (end 141.8 179.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "d0361f2b-cdb2-4572-b7c6-6900ee0294bc") + ) (gr_line (start 271.5 121.7) (end 271.5 118) @@ -118066,6 +119491,296 @@ (layer "B.SilkS") (uuid "d050e91c-3adc-408c-8ff8-053a51e80bf5") ) + (gr_line + (start 231.7 159.9) + (end 242.8 148.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "d1e100aa-dd97-4169-8501-74973e7d9109") + ) + (gr_line + (start 117.8 178.1) + (end 119.5 179.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "d4b3330b-a24e-4e3a-a373-dc3fa1d2d34d") + ) + (gr_line + (start 156.3 194.4) + (end 156.3 203.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "d689c44f-9bd5-467f-bc7a-0583a0252dc3") + ) + (gr_line + (start 121.9 145.4) + (end 117.8 149.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "d95223b3-0af7-4463-80b1-451f34eac30c") + ) + (gr_line + (start 121.9 139.2) + (end 121.9 145.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "dc0cf369-5258-48a7-bbc0-3261d75ef672") + ) + (gr_line + (start 231.7 178.1) + (end 242.8 167) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "dc9fb66b-5c0a-419f-9127-575ba82d5003") + ) + (gr_line + (start 242.8 174.5) + (end 231.7 185.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "df579724-5051-4545-8af0-288133baa759") + ) + (gr_line + (start 242.8 183.5) + (end 231.7 194.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "e263bce9-6d93-4ce1-a823-09db98952a68") + ) + (gr_line + (start 236 148.2) + (end 241.8 142.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "e31eeadd-f338-43b2-8891-732e3969bfa3") + ) + (gr_line + (start 237.9 197.8) + (end 238.7 197) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "e498708c-64eb-4a5b-8c2a-9e1b827860ff") + ) + (gr_line + (start 141.8 179.8) + (end 148.8 186.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "e4a90fe8-14d1-44d4-9658-384b7cb7e038") + ) + (gr_line + (start 242.8 142.4) + (end 242.8 197.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "e520ec12-8bbb-4803-9041-a582b0e0d64b") + ) + (gr_line + (start 241.1 197.8) + (end 242.8 196.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "e7d1cb4a-d331-4d7e-8bf8-49f7d15ef6eb") + ) + (gr_line + (start 242.8 157.8) + (end 238.3 162.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "e874cb66-15ca-4dc0-9605-c10e3ae59197") + ) + (gr_line + (start 242.8 160.8) + (end 238.2 165.4) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "ef606990-1be0-4f70-96d8-99510840e85d") + ) + (gr_line + (start 242.8 130.7) + (end 235.8 137.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f0799a91-8194-4440-ad23-ff8642332c22") + ) + (gr_line + (start 231.7 147.7) + (end 231.8 147.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f238347a-2dbe-49f8-9714-04e960a20c72") + ) + (gr_line + (start 242.8 191.3) + (end 240.5 193.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f25fb475-a83e-4f9f-bdb7-200bfbc3668d") + ) + (gr_line + (start 172 223.6) + (end 173.1 224.7) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f2e94e88-cd70-43d5-b1ec-cefe7691698b") + ) + (gr_line + (start 242.8 186.5) + (end 232.3 197) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f372197e-2ab9-4caf-8864-81535aef88e3") + ) + (gr_line + (start 242.8 171.5) + (end 231.7 182.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f4a24993-b1ac-4fc9-888e-43f03e15a489") + ) + (gr_line + (start 172 219.3) + (end 172 223.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f4bc4da7-0937-40fb-a74f-25647d7ebc99") + ) + (gr_line + (start 148.3 187.1) + (end 148.3 189.8) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f63da5a6-4e52-4cd9-abc8-48e5e6a227cf") + ) + (gr_line + (start 151.6 193.1) + (end 153.4 193.1) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f653a6ec-1efb-44f2-ad94-fda942cc8dae") + ) + (gr_line + (start 236 146.5) + (end 231.6 146.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f793e336-1610-4fa6-b742-e3c8abc41d07") + ) + (gr_line + (start 240.7 138.9) + (end 233.1 146.5) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "f9b23451-5e80-42a5-9533-5cf787bc23e3") + ) + (gr_line + (start 126 128.9) + (end 121.6 133.3) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "fb7bea49-00e5-4117-b230-4d3544d2327b") + ) + (gr_line + (start 231.7 181) + (end 242.8 169.9) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "fdb22391-5f5b-4e56-9037-86210778a0b8") + ) + (gr_line + (start 242.8 129.2) + (end 242.8 134.6) + (stroke + (width 0.15) + (type default) + ) + (layer "B.SilkS") + (uuid "fdd1e84e-167d-42b2-b1a8-83de7e7071c6") + ) (gr_line (start 232 126.4) (end 235.3 123.1) @@ -118606,6 +120321,16 @@ (layer "F.SilkS") (uuid "28652457-48c8-4eb3-a9db-ced30d474d65") ) + (gr_line + (start 122.75 128.05) + (end 122.05 128.75) + (stroke + (width 0.15) + (type default) + ) + (layer "F.SilkS") + (uuid "2a1d5a59-a13d-4f89-ad41-368aaddaff4a") + ) (gr_line (start 229.2 137.7) (end 225.1 133.6) @@ -119786,6 +121511,16 @@ (layer "F.SilkS") (uuid "6d02fc95-3ec1-4949-9a76-2b2c746659e7") ) + (gr_line + (start 123.25 132.8) + (end 124.75 131.3) + (stroke + (width 0.15) + (type default) + ) + (layer "F.SilkS") + (uuid "6de21e82-0954-4c0c-bd1e-e2a17f449800") + ) (gr_line (start 227.7 126.2) (end 232.7 121.2) @@ -119886,6 +121621,16 @@ (layer "F.SilkS") (uuid "71e4bd84-e74b-4181-bcba-f4fbb82311f8") ) + (gr_line + (start 126.9 128.45) + (end 127.3 128.45) + (stroke + (width 0.15) + (type default) + ) + (layer "F.SilkS") + (uuid "74586ad6-4b29-46fb-b6ea-97f03c59f80d") + ) (gr_line (start 258.2 102.3) (end 268.2 108.1) @@ -120116,6 +121861,16 @@ (layer "F.SilkS") (uuid "8a8133f3-5508-44d9-9589-5d8f18ea884b") ) + (gr_line + (start 127.3 128.45) + (end 127.3 128.05) + (stroke + (width 0.15) + (type default) + ) + (layer "F.SilkS") + (uuid "8a9b2987-d531-47fc-87bf-5328075051af") + ) (gr_line (start 223.9 129.4) (end 224.6 130.1) @@ -120726,6 +122481,16 @@ (layer "F.SilkS") (uuid "b469b1a1-4bd8-4c10-8bbf-891fa2a53fae") ) + (gr_line + (start 124.75 131.3) + (end 124.75 128.05) + (stroke + (width 0.15) + (type default) + ) + (layer "F.SilkS") + (uuid "b50791df-4ffe-4b88-bf7c-9026b3efb8cc") + ) (gr_line (start 244 166) (end 262 147) @@ -120986,6 +122751,16 @@ (layer "F.SilkS") (uuid "c42fa26e-be22-4660-abf0-ebbbde532ef9") ) + (gr_line + (start 122.05 128.75) + (end 122.05 135.95) + (stroke + (width 0.15) + (type default) + ) + (layer "F.SilkS") + (uuid "c48cdf53-a115-4861-8720-88266ef9a817") + ) (gr_line (start 213 123) (end 214.8 121.2) @@ -121256,6 +123031,16 @@ (layer "F.SilkS") (uuid "d62932b8-3791-40dd-90e7-b394bd893c58") ) + (gr_line + (start 122.05 135.95) + (end 121.9 136.1) + (stroke + (width 0.15) + (type default) + ) + (layer "F.SilkS") + (uuid "d650ec2e-0728-4018-8c11-fb8de37d91e1") + ) (gr_line (start 262.9 106.6) (end 263.9 105.6) @@ -121486,6 +123271,16 @@ (layer "F.SilkS") (uuid "e19b40be-f9a5-47ec-a4cd-586a86995c27") ) + (gr_line + (start 121.9 136.1) + (end 121.9 137.55) + (stroke + (width 0.15) + (type default) + ) + (layer "F.SilkS") + (uuid "e355d66a-2464-42ad-96c9-ba32d05533ba") + ) (gr_line (start 207.5 133.9) (end 211.8 133.9) @@ -122030,6 +123825,71 @@ (layer "Edge.Cuts") (uuid "f271511b-f9bf-47d4-b2e5-c420f5320461") ) + (gr_text "V 1.2" + (at 118.05 215.65 0) + (layer "B.SilkS") + (uuid "10dcca2c-22e2-44de-a049-a05ca63f13f6") + (effects + (font + (face "Impact") + (size 1.5 1.5) + (thickness 0.3) + (bold yes) + (italic yes) + ) + (justify right bottom mirror) + ) + (render_cache "V 1.2" 0 + (polygon + (pts + (xy 120.290683 213.706793) (xy 120.860746 215.395) (xy 121.525331 215.395) (xy 121.422749 213.706793) + (xy 120.951604 213.706793) (xy 120.959912 213.793518) (xy 120.968348 213.878664) (xy 120.976913 213.962229) + (xy 120.985607 214.044214) (xy 120.99443 214.12462) (xy 121.003382 214.203446) (xy 121.012462 214.280691) + (xy 121.021671 214.356357) (xy 121.031009 214.430443) (xy 121.045258 214.538609) (xy 121.059796 214.64322) + (xy 121.074624 214.744276) (xy 121.089742 214.841778) (xy 121.099982 214.904804) (xy 121.07633 214.810702) + (xy 121.05291 214.71895) (xy 121.029721 214.629549) (xy 121.006765 214.542498) (xy 120.98404 214.457799) + (xy 120.961547 214.375449) (xy 120.939287 214.295451) (xy 120.917257 214.217802) (xy 120.89546 214.142505) + (xy 120.873895 214.069558) (xy 120.859647 214.022233) (xy 120.763293 213.706793) + ) + ) + (polygon + (pts + (xy 119.216503 213.706793) (xy 119.56748 215.395) (xy 119.998691 215.395) (xy 119.807815 214.476891) + (xy 119.792165 214.399531) (xy 119.777865 214.322377) (xy 119.768586 214.249556) (xy 119.768614 214.24718) + (xy 119.801587 214.193691) (xy 119.876892 214.178702) (xy 119.95473 214.175809) (xy 119.97158 214.175739) + (xy 120.026168 214.175739) (xy 119.984036 213.972407) (xy 119.907729 213.954072) (xy 119.835063 213.931489) + (xy 119.766038 213.904658) (xy 119.684876 213.865147) (xy 119.609403 213.818999) (xy 119.539618 213.766214) + (xy 119.475522 213.706793) + ) + ) + (polygon + (pts + (xy 119.052738 215.04329) (xy 119.125645 215.395) (xy 119.456838 215.395) (xy 119.383931 215.04329) + ) + ) + (polygon + (pts + (xy 118.078575 215.137079) (xy 118.132065 215.395) (xy 119.051639 215.395) (xy 119.009507 215.190568) + (xy 118.943112 215.105055) (xy 118.880123 215.023729) (xy 118.82054 214.946591) (xy 118.764364 214.87364) + (xy 118.711593 214.804877) (xy 118.662228 214.740301) (xy 118.616269 214.679912) (xy 118.553718 214.597181) + (xy 118.49883 214.523871) (xy 118.451605 214.459983) (xy 118.40056 214.389455) (xy 118.355913 214.324849) + (xy 118.312479 214.256245) (xy 118.273444 214.18647) (xy 118.24305 214.118976) (xy 118.228052 214.068761) + (xy 118.221393 213.993576) (xy 118.226953 213.971308) (xy 118.27861 213.941266) (xy 118.345712 213.973929) + (xy 118.347487 213.976071) (xy 118.378872 214.044008) (xy 118.398412 214.121151) (xy 118.434315 214.292976) + (xy 118.822661 214.292976) (xy 118.807274 214.219337) (xy 118.790997 214.146371) (xy 118.770552 214.069471) + (xy 118.747557 214.000983) (xy 118.712314 213.930879) (xy 118.669381 213.871459) (xy 118.643509 213.841981) + (xy 118.585171 213.788589) (xy 118.519518 213.746017) (xy 118.471684 213.723646) (xy 118.400223 213.700701) + (xy 118.322354 213.687281) (xy 118.246004 213.683346) (xy 118.171967 213.686539) (xy 118.092592 213.698801) + (xy 118.013044 213.724729) (xy 117.947555 213.763175) (xy 117.896126 213.814138) (xy 117.854154 213.883816) + (xy 117.830089 213.962057) (xy 117.82372 214.037544) (xy 117.831061 214.119587) (xy 117.835676 214.144232) + (xy 117.855872 214.219634) (xy 117.885318 214.297097) (xy 117.918673 214.366568) (xy 117.959109 214.437617) + (xy 117.971963 214.458206) (xy 118.022951 214.532416) (xy 118.069937 214.5955) (xy 118.127319 214.669471) + (xy 118.177178 214.732094) (xy 118.232884 214.800843) (xy 118.294437 214.875715) (xy 118.361838 214.956712) + (xy 118.410021 215.014112) (xy 118.460802 215.074235) (xy 118.514183 215.137079) + ) + ) + ) + ) (gr_text "RES bypass" (at 258.7 148.1 0) (layer "B.SilkS" knockout) @@ -122043,6 +123903,19 @@ (justify left bottom mirror) ) ) + (gr_text "EBS Power x3" + (at 115.45 173.55 -90) + (layer "B.SilkS" knockout) + (uuid "56bb7218-ef40-4f75-84bc-61c5a6cfb72f") + (effects + (font + (size 1 1) + (thickness 0.25) + (bold yes) + ) + (justify left bottom mirror) + ) + ) (gr_text "SDC start" (at 232.4 111.4 0) (layer "B.SilkS" knockout) @@ -122056,6 +123929,124 @@ (justify left bottom mirror) ) ) + (gr_text "PDU FT25" + (at 125.35 215.65 0) + (layer "B.SilkS") + (uuid "b185de1f-615c-4b08-8ed5-2ac8415e12c5") + (effects + (font + (face "Impact") + (size 1.5 1.5) + (thickness 0.3) + (bold yes) + (italic yes) + ) + (justify right bottom mirror) + ) + (render_cache "PDU FT25" 0 + (polygon + (pts + (xy 132.9821 215.395) (xy 132.534036 215.395) (xy 132.39262 214.715027) (xy 132.288206 214.715027) + (xy 132.270703 214.714873) (xy 132.196264 214.710352) (xy 132.121846 214.697987) (xy 132.050069 214.67546) + (xy 132.02091 214.662131) (xy 131.956148 214.619522) (xy 131.904256 214.560788) (xy 131.892235 214.54069) + (xy 131.861774 214.471782) (xy 131.839685 214.400527) (xy 131.822191 214.325949) (xy 131.792149 214.182334) + (xy 131.776503 214.100861) (xy 131.770467 214.059559) (xy 132.152779 214.059559) (xy 132.160345 214.133607) + (xy 132.188555 214.269528) (xy 132.199467 214.314296) (xy 132.232885 214.3842) (xy 132.239817 214.390297) + (xy 132.312386 214.410212) (xy 132.329239 214.409846) (xy 132.24644 214.011608) (xy 132.234177 214.011795) + (xy 132.161444 214.032857) (xy 132.152779 214.059559) (xy 131.770467 214.059559) (xy 131.76544 214.025156) + (xy 131.761008 213.950059) (xy 131.769303 213.887448) (xy 131.800575 213.8189) (xy 131.802985 213.815469) + (xy 131.85972 213.765242) (xy 131.928803 213.735369) (xy 131.959139 213.727137) (xy 132.032154 213.714858) + (xy 132.111939 213.708579) (xy 132.19405 213.706793) (xy 132.631123 213.706793) + ) + ) + (polygon + (pts + (xy 131.928436 215.395) (xy 131.379256 215.395) (xy 131.298647 215.393637) (xy 131.22254 215.388929) + (xy 131.144783 215.37778) (xy 131.139741 215.376655) (xy 131.068488 215.353509) (xy 131.001535 215.315865) + (xy 130.997644 215.313062) (xy 130.942105 215.259458) (xy 130.901517 215.194232) (xy 130.8747 215.123388) + (xy 130.853783 215.049949) (xy 130.834504 214.970551) (xy 130.817253 214.891249) (xy 130.696353 214.308363) + (xy 130.67933 214.224635) (xy 130.66367 214.140691) (xy 130.651606 214.064731) (xy 131.09972 214.064731) + (xy 131.108565 214.132909) (xy 131.122801 214.205415) (xy 131.25799 214.856078) (xy 131.26866 214.904519) + (xy 131.288767 214.982243) (xy 131.319172 215.055746) (xy 131.342632 215.075353) (xy 131.416992 215.090184) + (xy 131.192777 214.011608) (xy 131.118405 214.024064) (xy 131.09972 214.064731) (xy 130.651606 214.064731) + (xy 130.651311 214.062873) (xy 130.643963 213.987428) (xy 130.643829 213.977087) (xy 130.65468 213.902995) + (xy 130.686461 213.83502) (xy 130.705472 213.810458) (xy 130.76626 213.764066) (xy 130.836671 213.736468) + (xy 130.86606 213.729513) (xy 130.944004 213.718385) (xy 131.019232 213.712473) (xy 131.092902 213.70914) + (xy 131.176554 213.707257) (xy 131.250662 213.706793) (xy 131.577459 213.706793) + ) + ) + (polygon + (pts + (xy 129.428366 213.706793) (xy 129.661008 214.826036) (xy 129.67765 214.90327) (xy 129.695424 214.97853) + (xy 129.715775 215.05309) (xy 129.728785 215.092383) (xy 129.763186 215.161185) (xy 129.807631 215.221497) + (xy 129.835031 215.252117) (xy 129.892022 215.303654) (xy 129.956199 215.345925) (xy 130.020778 215.376315) + (xy 130.090902 215.398533) (xy 130.166178 215.412522) (xy 130.246607 215.418282) (xy 130.263311 215.418447) + (xy 130.34353 215.414448) (xy 130.416853 215.40245) (xy 130.490233 215.379738) (xy 130.517201 215.367889) + (xy 130.581662 215.32945) (xy 130.638307 215.274534) (xy 130.662648 215.235631) (xy 130.688904 215.162421) + (xy 130.696508 215.086406) (xy 130.695254 215.064173) (xy 130.685122 214.989662) (xy 130.672239 214.915322) + (xy 130.657401 214.837064) (xy 130.64236 214.761596) (xy 130.628576 214.694511) (xy 130.423045 213.706793) + (xy 129.974982 213.706793) (xy 130.235467 214.959759) (xy 130.248974 215.032065) (xy 130.253052 215.089452) + (xy 130.223377 215.113632) (xy 130.173551 215.084323) (xy 130.149194 215.011479) (xy 130.13142 214.933014) + (xy 129.87643 213.706793) + ) + ) + (polygon + (pts + (xy 128.900069 213.706793) (xy 128.157449 213.706793) (xy 128.230722 214.058503) (xy 128.525279 214.058503) + (xy 128.583897 214.33987) (xy 128.32158 214.33987) (xy 128.394487 214.69158) (xy 128.656803 214.69158) + (xy 128.802983 215.395) (xy 129.251046 215.395) + ) + ) + (polygon + (pts + (xy 127.186217 213.706793) (xy 127.25949 214.058503) (xy 127.511549 214.058503) (xy 127.789253 215.395) + (xy 128.237316 215.395) (xy 127.959612 214.058503) (xy 128.210572 214.058503) (xy 128.137299 213.706793) + ) + ) + (polygon + (pts + (xy 126.505512 215.137079) (xy 126.559002 215.395) (xy 127.478576 215.395) (xy 127.436444 215.190568) + (xy 127.370049 215.105055) (xy 127.30706 215.023729) (xy 127.247477 214.946591) (xy 127.1913 214.87364) + (xy 127.13853 214.804877) (xy 127.089165 214.740301) (xy 127.043206 214.679912) (xy 126.980655 214.597181) + (xy 126.925766 214.523871) (xy 126.878542 214.459983) (xy 126.827497 214.389455) (xy 126.78285 214.324849) + (xy 126.739416 214.256245) (xy 126.700381 214.18647) (xy 126.669987 214.118976) (xy 126.654989 214.068761) + (xy 126.64833 213.993576) (xy 126.65389 213.971308) (xy 126.705547 213.941266) (xy 126.772648 213.973929) + (xy 126.774424 213.976071) (xy 126.805809 214.044008) (xy 126.825348 214.121151) (xy 126.861252 214.292976) + (xy 127.249598 214.292976) (xy 127.234211 214.219337) (xy 127.217934 214.146371) (xy 127.197489 214.069471) + (xy 127.174493 214.000983) (xy 127.139251 213.930879) (xy 127.096318 213.871459) (xy 127.070446 213.841981) + (xy 127.012108 213.788589) (xy 126.946455 213.746017) (xy 126.898621 213.723646) (xy 126.827159 213.700701) + (xy 126.749291 213.687281) (xy 126.672941 213.683346) (xy 126.598904 213.686539) (xy 126.519529 213.698801) + (xy 126.43998 213.724729) (xy 126.374492 213.763175) (xy 126.323063 213.814138) (xy 126.281091 213.883816) + (xy 126.257026 213.962057) (xy 126.250657 214.037544) (xy 126.257997 214.119587) (xy 126.262613 214.144232) + (xy 126.282809 214.219634) (xy 126.312255 214.297097) (xy 126.345609 214.366568) (xy 126.386046 214.437617) + (xy 126.3989 214.458206) (xy 126.449888 214.532416) (xy 126.496874 214.5955) (xy 126.554256 214.669471) + (xy 126.604114 214.732094) (xy 126.65982 214.800843) (xy 126.721374 214.875715) (xy 126.788775 214.956712) + (xy 126.836958 215.014112) (xy 126.887739 215.074235) (xy 126.941119 215.137079) + ) + ) + (polygon + (pts + (xy 125.14337 213.706793) (xy 125.196859 213.964713) (xy 125.701709 213.964713) (xy 125.754832 214.220069) + (xy 125.690117 214.171963) (xy 125.62184 214.1439) (xy 125.544058 214.13027) (xy 125.506437 214.128845) + (xy 125.425814 214.135164) (xy 125.350823 214.157382) (xy 125.28701 214.200831) (xy 125.262805 214.229961) + (xy 125.233941 214.300952) (xy 125.225436 214.375683) (xy 125.227857 214.453327) (xy 125.236723 214.527615) + (xy 125.251814 214.610614) (xy 125.301273 214.849117) (xy 125.317339 214.922562) (xy 125.3354 214.995594) + (xy 125.357525 215.070527) (xy 125.372714 215.112166) (xy 125.406681 215.178933) (xy 125.45262 215.241709) + (xy 125.477861 215.269337) (xy 125.536044 215.318727) (xy 125.604531 215.358638) (xy 125.655914 215.379979) + (xy 125.726403 215.400265) (xy 125.80369 215.413037) (xy 125.879061 215.418109) (xy 125.905408 215.418447) + (xy 125.982619 215.414829) (xy 126.062256 215.40211) (xy 126.134242 215.380233) (xy 126.177983 215.360561) + (xy 126.239664 215.318837) (xy 126.288669 215.260131) (xy 126.317934 215.188004) (xy 126.327687 215.113995) + (xy 126.32609 215.03225) (xy 126.316766 214.948401) (xy 126.302886 214.867378) (xy 126.297051 214.838492) + (xy 126.276535 214.738475) (xy 125.84569 214.738475) (xy 125.871336 214.861939) (xy 125.886769 214.939883) + (xy 125.900522 215.019024) (xy 125.909438 215.09568) (xy 125.872011 215.159513) (xy 125.859612 215.160526) + (xy 125.814183 215.142575) (xy 125.788171 215.102274) (xy 125.77068 215.0256) (xy 125.753762 214.948922) + (xy 125.742009 214.895279) (xy 125.668736 214.544668) (xy 125.65671 214.468563) (xy 125.658844 214.41754) + (xy 125.70464 214.386765) (xy 125.74897 214.403984) (xy 125.778646 214.44172) (xy 125.798771 214.515243) + (xy 125.806489 214.550896) (xy 126.23367 214.550896) (xy 126.04023 213.706793) + ) + ) + ) + ) (gr_text "AS actuator supply" (at 257 120.6 0) (layer "B.SilkS" knockout) @@ -122069,6 +124060,534 @@ (justify left bottom mirror) ) ) + (gr_text "made by Janek Herm" + (at 115.75 218.85 0) + (layer "B.SilkS") + (uuid "cf47c5c5-fdf5-4a1c-ada6-ff2c05a58914") + (effects + (font + (face "Impact") + (size 1.5 1.5) + (thickness 0.3) + (bold yes) + (italic yes) + ) + (justify right bottom mirror) + ) + (render_cache "made by Janek Herm" 0 + (polygon + (pts + (xy 132.477459 217.211608) (xy 132.502738 217.30613) (xy 132.446353 217.258102) (xy 132.39576 217.228461) + (xy 132.327188 217.200912) (xy 132.25483 217.18879) (xy 132.233461 217.188161) (xy 132.154738 217.197205) + (xy 132.083364 217.229003) (xy 132.030189 217.283694) (xy 132.004849 217.332875) (xy 131.951725 217.281153) + (xy 131.891729 217.238828) (xy 131.873325 217.228461) (xy 131.801808 217.199534) (xy 131.727394 217.188318) + (xy 131.717253 217.188161) (xy 131.642618 217.195786) (xy 131.572474 217.223956) (xy 131.547993 217.242383) + (xy 131.501373 217.302466) (xy 131.483147 217.374274) (xy 131.486342 217.452138) (xy 131.497605 217.532523) + (xy 131.512128 217.60966) (xy 131.514288 217.620104) (xy 131.716887 218.595) (xy 132.136008 218.595) + (xy 131.948063 217.69008) (xy 131.932355 217.612204) (xy 131.919547 217.53901) (xy 131.914357 217.481618) + (xy 131.948429 217.446081) (xy 132.00375 217.48345) (xy 132.027381 217.555075) (xy 132.046429 217.63463) + (xy 132.059438 217.695209) (xy 132.246283 218.595) (xy 132.665404 218.595) (xy 132.481856 217.713161) + (xy 132.465902 217.633747) (xy 132.451264 217.554983) (xy 132.441551 217.482055) (xy 132.441556 217.479787) + (xy 132.474528 217.446081) (xy 132.518126 217.464766) (xy 132.546336 217.51166) (xy 132.563148 217.58387) + (xy 132.574912 217.638789) (xy 132.773482 218.595) (xy 133.19187 218.595) (xy 132.904274 217.211608) + ) + ) + (polygon + (pts + (xy 130.90518 217.191299) (xy 130.983925 217.20257) (xy 131.056259 217.222039) (xy 131.129971 217.25374) + (xy 131.137643 217.257859) (xy 131.200604 217.29673) (xy 131.257712 217.343728) (xy 131.308391 217.405415) + (xy 131.324904 217.433922) (xy 131.354657 217.501242) (xy 131.377702 217.573576) (xy 131.395219 217.647215) + (xy 131.416835 217.750896) (xy 131.011269 217.750896) (xy 130.980495 217.601786) (xy 130.967035 217.541765) + (xy 130.944225 217.469162) (xy 130.895498 217.446081) (xy 130.86106 217.472093) (xy 130.861743 217.52494) + (xy 130.874616 217.599221) (xy 130.883134 217.636064) (xy 130.909787 217.705101) (xy 130.931013 217.721152) + (xy 131.000204 217.754364) (xy 131.068352 217.782216) (xy 131.141695 217.810247) (xy 131.202294 217.833306) + (xy 131.275321 217.864206) (xy 131.341907 217.897545) (xy 131.408042 217.943604) (xy 131.415535 217.951273) + (xy 131.455927 218.013578) (xy 131.483605 218.086829) (xy 131.501831 218.159392) (xy 131.525278 218.272965) + (xy 131.536187 218.336512) (xy 131.541181 218.413186) (xy 131.529982 218.490694) (xy 131.489375 218.553234) + (xy 131.447037 218.581765) (xy 131.376575 218.609276) (xy 131.297766 218.618447) (xy 131.287249 218.618298) + (xy 131.212293 218.607693) (xy 131.14426 218.580345) (xy 131.109049 218.559463) (xy 131.053035 218.511102) + (xy 131.070254 218.595) (xy 130.650401 218.595) (xy 130.516838 217.952397) (xy 130.947888 217.952397) + (xy 131.002477 218.213614) (xy 131.014056 218.26562) (xy 131.03838 218.339277) (xy 131.084909 218.360526) + (xy 131.121179 218.334515) (xy 131.118324 218.275211) (xy 131.105059 218.201891) (xy 131.086947 218.12845) + (xy 131.060362 218.059375) (xy 131.05696 218.053204) (xy 131.008516 217.997977) (xy 130.947888 217.952397) + (xy 130.516838 217.952397) (xy 130.506786 217.904036) (xy 130.494205 217.84256) (xy 130.479325 217.766803) + (xy 130.463767 217.682088) (xy 130.45159 217.608465) (xy 130.44144 217.534757) (xy 130.435345 217.454141) + (xy 130.441997 217.394188) (xy 130.474129 217.322635) (xy 130.526936 217.265464) (xy 130.539029 217.256103) + (xy 130.604852 217.221452) (xy 130.679029 217.200919) (xy 130.756031 217.190878) (xy 130.831018 217.188161) + ) + ) + (polygon + (pts + (xy 129.724598 217.284515) (xy 129.746255 217.259941) (xy 129.809961 217.217836) (xy 129.874441 217.19558) + (xy 129.948447 217.188161) (xy 129.985747 217.189964) (xy 130.062323 217.206243) (xy 130.133094 217.239452) + (xy 130.148263 217.249214) (xy 130.207808 217.298601) (xy 130.251064 217.35852) (xy 130.253215 217.362822) + (xy 130.280917 217.434896) (xy 130.301897 217.510744) (xy 130.318475 217.5842) (xy 130.450366 218.219476) + (xy 130.463784 218.290368) (xy 130.473988 218.364556) (xy 130.476011 218.441493) (xy 130.45577 218.507347) + (xy 130.407501 218.564958) (xy 130.391267 218.577494) (xy 130.32019 218.609619) (xy 130.245568 218.618447) + (xy 130.172753 218.610387) (xy 130.100121 218.586207) (xy 130.041307 218.556384) (xy 129.98032 218.5133) + (xy 129.997173 218.595) (xy 129.566329 218.595) (xy 129.335835 217.486318) (xy 129.771029 217.486318) + (xy 129.781751 217.559288) (xy 129.914008 218.195662) (xy 129.929558 218.263189) (xy 129.954675 218.334881) + (xy 130.0045 218.360526) (xy 130.034909 218.34001) (xy 130.035259 218.310167) (xy 130.023551 218.237794) + (xy 129.883234 217.564417) (xy 129.877116 217.536952) (xy 129.852093 217.465865) (xy 129.806297 217.446081) + (xy 129.772592 217.466231) (xy 129.771029 217.486318) (xy 129.335835 217.486318) (xy 129.215352 216.906793) + (xy 129.646196 216.906793) + ) + ) + (polygon + (pts + (xy 128.72973 217.189529) (xy 128.806614 217.19889) (xy 128.880194 217.217118) (xy 128.95047 217.244214) + (xy 128.965474 217.251413) (xy 129.034482 217.293158) (xy 129.093473 217.344492) (xy 129.142445 217.405415) + (xy 129.179404 217.470323) (xy 129.207878 217.538044) (xy 129.23223 217.615198) (xy 129.250156 217.690446) + (xy 129.332588 218.086852) (xy 129.347442 218.167165) (xy 129.357217 218.243215) (xy 129.359333 218.321325) + (xy 129.358544 218.331443) (xy 129.343233 218.404226) (xy 129.311339 218.471535) (xy 129.296701 218.492334) + (xy 129.242485 218.542864) (xy 129.174685 218.579612) (xy 129.10579 218.601722) (xy 129.028062 218.614654) + (xy 128.949738 218.618447) (xy 128.941325 218.618409) (xy 128.861168 218.613858) (xy 128.788239 218.601722) + (xy 128.716364 218.579612) (xy 128.668736 218.557607) (xy 128.602791 218.515584) (xy 128.54344 218.462742) + (xy 128.525368 218.443474) (xy 128.476359 218.382907) (xy 128.438293 218.316929) (xy 128.419717 218.268457) + (xy 128.39856 218.195368) (xy 128.381873 218.122023) (xy 128.358426 218.008817) (xy 128.768021 218.008817) + (xy 128.807222 218.197861) (xy 128.821327 218.258153) (xy 128.848255 218.329019) (xy 128.909071 218.360526) + (xy 128.943876 218.339277) (xy 128.943601 218.300717) (xy 128.931053 218.227536) (xy 128.870603 217.938475) + (xy 128.343405 217.938475) (xy 128.304204 217.749431) (xy 128.289034 217.666123) (xy 128.280071 217.59123) + (xy 128.277426 217.515942) (xy 128.2819 217.472459) (xy 128.687787 217.472459) (xy 128.692736 217.532973) + (xy 128.706838 217.608014) (xy 128.726988 217.704002) (xy 128.822243 217.704002) (xy 128.803192 217.613143) + (xy 128.787406 217.542331) (xy 128.764724 217.469895) (xy 128.715265 217.446081) (xy 128.687787 217.472459) + (xy 128.2819 217.472459) (xy 128.285519 217.437288) (xy 128.307408 217.371321) (xy 128.349255 217.308758) + (xy 128.409717 217.256671) (xy 128.457479 217.229976) (xy 128.529243 217.205288) (xy 128.602814 217.192443) + (xy 128.685589 217.188161) + ) + ) + (polygon + (pts + (xy 127.983635 218.595) (xy 127.581001 218.595) (xy 127.538869 218.502676) (xy 127.511111 218.539373) + (xy 127.45314 218.584741) (xy 127.395088 218.608934) (xy 127.320149 218.618447) (xy 127.269706 218.614989) + (xy 127.197904 218.596837) (xy 127.130739 218.563126) (xy 127.104848 218.545241) (xy 127.04917 218.494218) + (xy 127.008007 218.431967) (xy 127.005768 218.427177) (xy 126.979682 218.358252) (xy 126.959045 218.284679) + (xy 126.941329 218.205921) (xy 126.813834 217.594459) (xy 126.803023 217.541239) (xy 126.790225 217.472826) + (xy 127.23039 217.472826) (xy 127.233082 217.527488) (xy 127.246877 217.603984) (xy 127.367044 218.183206) + (xy 127.384715 218.260847) (xy 127.408443 218.332316) (xy 127.456071 218.360526) (xy 127.488677 218.335247) + (xy 127.484775 218.276039) (xy 127.471091 218.201891) (xy 127.347993 217.609113) (xy 127.332703 217.541717) + (xy 127.309525 217.470994) (xy 127.264096 217.446081) (xy 127.23039 217.472826) (xy 126.790225 217.472826) + (xy 126.789471 217.468796) (xy 126.779396 217.395157) (xy 126.779863 217.367899) (xy 126.800278 217.295872) + (xy 126.822861 217.260478) (xy 126.88271 217.216371) (xy 126.953033 217.194359) (xy 127.027791 217.188161) + (xy 127.101705 217.195854) (xy 127.173237 217.218935) (xy 127.221134 217.242738) (xy 127.280582 217.285614) + (xy 127.201814 216.906793) (xy 127.632658 216.906793) + ) + ) + (polygon + (pts + (xy 125.727564 217.211608) (xy 126.053628 218.208852) (xy 126.080813 218.291314) (xy 126.105217 218.363394) + (xy 126.130171 218.434368) (xy 126.156691 218.504857) (xy 126.166468 218.528688) (xy 126.202382 218.598481) + (xy 126.249421 218.660965) (xy 126.259891 218.671936) (xy 126.319246 218.718835) (xy 126.385684 218.750552) + (xy 126.401308 218.755833) (xy 126.476939 218.772131) (xy 126.558541 218.779966) (xy 126.635981 218.782474) + (xy 126.65703 218.782578) (xy 126.918248 218.782578) (xy 126.869888 218.548105) (xy 126.795175 218.546492) + (xy 126.742393 218.539678) (xy 126.711252 218.503775) (xy 126.707985 218.425214) (xy 126.707222 218.363457) + (xy 126.692934 217.211608) (xy 126.299092 217.211608) (xy 126.373464 218.162323) (xy 126.122505 217.211608) + ) + ) + (polygon + (pts + (xy 124.677564 216.906793) (xy 124.912037 218.033363) (xy 124.92742 218.107335) (xy 124.943872 218.18465) + (xy 124.960298 218.259059) (xy 124.978595 218.33586) (xy 124.984211 218.356863) (xy 125.013062 218.426472) + (xy 125.059315 218.489487) (xy 125.115483 218.537422) (xy 125.181632 218.569257) (xy 125.191207 218.572285) + (xy 125.264601 218.586992) (xy 125.343706 218.59358) (xy 125.411025 218.595) (xy 125.637805 218.595) + (xy 125.574057 218.286521) (xy 125.509577 218.290184) (xy 125.439968 218.269668) (xy 125.402232 218.218377) + (xy 125.383625 218.145601) (xy 125.372191 218.092714) (xy 125.125627 216.906793) + ) + ) + (polygon + (pts + (xy 124.219765 217.191299) (xy 124.29851 217.20257) (xy 124.370844 217.222039) (xy 124.444556 217.25374) + (xy 124.452228 217.257859) (xy 124.515189 217.29673) (xy 124.572297 217.343728) (xy 124.622976 217.405415) + (xy 124.639489 217.433922) (xy 124.669242 217.501242) (xy 124.692287 217.573576) (xy 124.709804 217.647215) + (xy 124.731419 217.750896) (xy 124.325854 217.750896) (xy 124.29508 217.601786) (xy 124.28162 217.541765) + (xy 124.25881 217.469162) (xy 124.210083 217.446081) (xy 124.175645 217.472093) (xy 124.176327 217.52494) + (xy 124.1892 217.599221) (xy 124.197718 217.636064) (xy 124.224371 217.705101) (xy 124.245598 217.721152) + (xy 124.314789 217.754364) (xy 124.382937 217.782216) (xy 124.45628 217.810247) (xy 124.516878 217.833306) + (xy 124.589906 217.864206) (xy 124.656492 217.897545) (xy 124.722627 217.943604) (xy 124.73012 217.951273) + (xy 124.770512 218.013578) (xy 124.798189 218.086829) (xy 124.816416 218.159392) (xy 124.839863 218.272965) + (xy 124.850772 218.336512) (xy 124.855766 218.413186) (xy 124.844567 218.490694) (xy 124.80396 218.553234) + (xy 124.761622 218.581765) (xy 124.691159 218.609276) (xy 124.612351 218.618447) (xy 124.601834 218.618298) + (xy 124.526878 218.607693) (xy 124.458844 218.580345) (xy 124.423634 218.559463) (xy 124.36762 218.511102) + (xy 124.384839 218.595) (xy 123.964985 218.595) (xy 123.831423 217.952397) (xy 124.262473 217.952397) + (xy 124.317061 218.213614) (xy 124.328641 218.26562) (xy 124.352965 218.339277) (xy 124.399493 218.360526) + (xy 124.435763 218.334515) (xy 124.432908 218.275211) (xy 124.419643 218.201891) (xy 124.401531 218.12845) + (xy 124.374947 218.059375) (xy 124.371545 218.053204) (xy 124.3231 217.997977) (xy 124.262473 217.952397) + (xy 123.831423 217.952397) (xy 123.821371 217.904036) (xy 123.80879 217.84256) (xy 123.793909 217.766803) + (xy 123.778351 217.682088) (xy 123.766174 217.608465) (xy 123.756025 217.534757) (xy 123.74993 217.454141) + (xy 123.756582 217.394188) (xy 123.788713 217.322635) (xy 123.841521 217.265464) (xy 123.853614 217.256103) + (xy 123.919437 217.221452) (xy 123.993614 217.200919) (xy 124.070616 217.190878) (xy 124.145603 217.188161) + ) + ) + (polygon + (pts + (xy 123.104762 217.211608) (xy 123.126744 217.296971) (xy 123.067963 217.249382) (xy 123.02636 217.226263) + (xy 122.954243 217.198914) (xy 122.876652 217.18831) (xy 122.865893 217.188161) (xy 122.790794 217.195683) + (xy 122.72102 217.223472) (xy 122.696999 217.24165) (xy 122.651386 217.301367) (xy 122.633984 217.374274) + (xy 122.637058 217.448016) (xy 122.647005 217.521851) (xy 122.661344 217.600814) (xy 122.668056 217.63366) + (xy 122.867724 218.595) (xy 123.298569 218.595) (xy 123.0989 217.634759) (xy 123.083852 217.558946) + (xy 123.072426 217.48423) (xy 123.072156 217.470994) (xy 123.104762 217.446081) (xy 123.157519 217.477955) + (xy 123.180934 217.55177) (xy 123.198151 217.625937) (xy 123.205879 217.662236) (xy 123.399685 218.595) + (xy 123.83053 218.595) (xy 123.542934 217.211608) + ) + ) + (polygon + (pts + (xy 122.036987 217.189529) (xy 122.113871 217.19889) (xy 122.187451 217.217118) (xy 122.257728 217.244214) + (xy 122.272732 217.251413) (xy 122.34174 217.293158) (xy 122.40073 217.344492) (xy 122.449703 217.405415) + (xy 122.486662 217.470323) (xy 122.515135 217.538044) (xy 122.539487 217.615198) (xy 122.557414 217.690446) + (xy 122.639846 218.086852) (xy 122.6547 218.167165) (xy 122.664474 218.243215) (xy 122.66659 218.321325) + (xy 122.665802 218.331443) (xy 122.650491 218.404226) (xy 122.618597 218.471535) (xy 122.603958 218.492334) + (xy 122.549742 218.542864) (xy 122.481943 218.579612) (xy 122.413047 218.601722) (xy 122.33532 218.614654) + (xy 122.256995 218.618447) (xy 122.248582 218.618409) (xy 122.168426 218.613858) (xy 122.095496 218.601722) + (xy 122.023621 218.579612) (xy 121.975994 218.557607) (xy 121.910048 218.515584) (xy 121.850697 218.462742) + (xy 121.832625 218.443474) (xy 121.783616 218.382907) (xy 121.745551 218.316929) (xy 121.726975 218.268457) + (xy 121.705817 218.195368) (xy 121.689131 218.122023) (xy 121.665683 218.008817) (xy 122.075278 218.008817) + (xy 122.114479 218.197861) (xy 122.128584 218.258153) (xy 122.155512 218.329019) (xy 122.216329 218.360526) + (xy 122.251133 218.339277) (xy 122.250859 218.300717) (xy 122.238311 218.227536) (xy 122.17786 217.938475) + (xy 121.650662 217.938475) (xy 121.611461 217.749431) (xy 121.596292 217.666123) (xy 121.587329 217.59123) + (xy 121.584684 217.515942) (xy 121.589158 217.472459) (xy 121.995045 217.472459) (xy 121.999993 217.532973) + (xy 122.014096 217.608014) (xy 122.034246 217.704002) (xy 122.1295 217.704002) (xy 122.110449 217.613143) + (xy 122.094664 217.542331) (xy 122.071981 217.469895) (xy 122.022522 217.446081) (xy 121.995045 217.472459) + (xy 121.589158 217.472459) (xy 121.592777 217.437288) (xy 121.614666 217.371321) (xy 121.656512 217.308758) + (xy 121.716974 217.256671) (xy 121.764736 217.229976) (xy 121.836501 217.205288) (xy 121.910071 217.192443) + (xy 121.992847 217.188161) + ) + ) + (polygon + (pts + (xy 120.467672 217.211608) (xy 120.754902 217.776908) (xy 120.707641 218.595) (xy 121.12383 218.595) + (xy 121.117236 217.997459) (xy 121.229343 218.595) (xy 121.660188 218.595) (xy 121.309211 216.906793) + (xy 120.878366 216.906793) (xy 121.040299 217.627431) (xy 120.836235 217.211608) + ) + ) + (polygon + (pts + (xy 118.924912 216.906793) (xy 119.275889 218.595) (xy 119.723953 218.595) (xy 119.577773 217.89158) + (xy 119.681088 217.89158) (xy 119.827267 218.595) (xy 120.275331 218.595) (xy 119.924354 216.906793) + (xy 119.47629 216.906793) (xy 119.608181 217.53987) (xy 119.504867 217.53987) (xy 119.372976 216.906793) + ) + ) + (polygon + (pts + (xy 118.426101 217.189529) (xy 118.502985 217.19889) (xy 118.576565 217.217118) (xy 118.646842 217.244214) + (xy 118.661845 217.251413) (xy 118.730854 217.293158) (xy 118.789844 217.344492) (xy 118.838817 217.405415) + (xy 118.875776 217.470323) (xy 118.904249 217.538044) (xy 118.928601 217.615198) (xy 118.946528 217.690446) + (xy 119.02896 218.086852) (xy 119.043813 218.167165) (xy 119.053588 218.243215) (xy 119.055704 218.321325) + (xy 119.054916 218.331443) (xy 119.039605 218.404226) (xy 119.00771 218.471535) (xy 118.993072 218.492334) + (xy 118.938856 218.542864) (xy 118.871057 218.579612) (xy 118.802161 218.601722) (xy 118.724434 218.614654) + (xy 118.646109 218.618447) (xy 118.637696 218.618409) (xy 118.557539 218.613858) (xy 118.48461 218.601722) + (xy 118.412735 218.579612) (xy 118.365108 218.557607) (xy 118.299162 218.515584) (xy 118.239811 218.462742) + (xy 118.221739 218.443474) (xy 118.17273 218.382907) (xy 118.134664 218.316929) (xy 118.116089 218.268457) + (xy 118.094931 218.195368) (xy 118.078244 218.122023) (xy 118.054797 218.008817) (xy 118.464392 218.008817) + (xy 118.503593 218.197861) (xy 118.517698 218.258153) (xy 118.544626 218.329019) (xy 118.605442 218.360526) + (xy 118.640247 218.339277) (xy 118.639972 218.300717) (xy 118.627424 218.227536) (xy 118.566974 217.938475) + (xy 118.039776 217.938475) (xy 118.000575 217.749431) (xy 117.985406 217.666123) (xy 117.976442 217.59123) + (xy 117.973798 217.515942) (xy 117.978272 217.472459) (xy 118.384158 217.472459) (xy 118.389107 217.532973) + (xy 118.403209 217.608014) (xy 118.423359 217.704002) (xy 118.518614 217.704002) (xy 118.499563 217.613143) + (xy 118.483778 217.542331) (xy 118.461095 217.469895) (xy 118.411636 217.446081) (xy 118.384158 217.472459) + (xy 117.978272 217.472459) (xy 117.98189 217.437288) (xy 118.003779 217.371321) (xy 118.045626 217.308758) + (xy 118.106088 217.256671) (xy 118.15385 217.229976) (xy 118.225614 217.205288) (xy 118.299185 217.192443) + (xy 118.38196 217.188161) + ) + ) + (polygon + (pts + (xy 117.329396 217.211608) (xy 117.401936 217.419337) (xy 117.361355 217.355996) (xy 117.308289 217.29321) + (xy 117.250458 217.24485) (xy 117.176965 217.206662) (xy 117.096986 217.188109) (xy 117.085031 217.187062) + (xy 117.192375 217.704002) (xy 117.266372 217.707378) (xy 117.339261 217.721443) (xy 117.366765 217.732578) + (xy 117.425339 217.780025) (xy 117.444434 217.812812) (xy 117.467174 217.8849) (xy 117.485496 217.959977) + (xy 117.50175 218.033918) (xy 117.506716 218.057543) (xy 117.618457 218.595) (xy 118.049302 218.595) + (xy 117.761706 217.211608) + ) + ) + (polygon + (pts + (xy 116.583112 217.211608) (xy 116.608391 217.30613) (xy 116.552005 217.258102) (xy 116.501412 217.228461) + (xy 116.432841 217.200912) (xy 116.360482 217.18879) (xy 116.339113 217.188161) (xy 116.260391 217.197205) + (xy 116.189016 217.229003) (xy 116.135841 217.283694) (xy 116.110502 217.332875) (xy 116.057378 217.281153) + (xy 115.997381 217.238828) (xy 115.978977 217.228461) (xy 115.907461 217.199534) (xy 115.833047 217.188318) + (xy 115.822906 217.188161) (xy 115.748271 217.195786) (xy 115.678126 217.223956) (xy 115.653646 217.242383) + (xy 115.607026 217.302466) (xy 115.588799 217.374274) (xy 115.591994 217.452138) (xy 115.603257 217.532523) + (xy 115.61778 217.60966) (xy 115.61994 217.620104) (xy 115.822539 218.595) (xy 116.24166 218.595) + (xy 116.053715 217.69008) (xy 116.038007 217.612204) (xy 116.025199 217.53901) (xy 116.02001 217.481618) + (xy 116.054082 217.446081) (xy 116.109403 217.48345) (xy 116.133033 217.555075) (xy 116.152081 217.63463) + (xy 116.16509 217.695209) (xy 116.351936 218.595) (xy 116.771057 218.595) (xy 116.587508 217.713161) + (xy 116.571555 217.633747) (xy 116.556917 217.554983) (xy 116.547203 217.482055) (xy 116.547208 217.479787) + (xy 116.580181 217.446081) (xy 116.623778 217.464766) (xy 116.651988 217.51166) (xy 116.668801 217.58387) + (xy 116.680565 217.638789) (xy 116.879134 218.595) (xy 117.297522 218.595) (xy 117.009926 217.211608) + ) + ) + ) + ) + (gr_text "feat. PCB-Review" + (at 129.36 220.75 0) + (layer "B.SilkS") + (uuid "d8d2066d-b11b-4491-999f-a85b10805486") + (effects + (font + (face "Impact") + (size 1 1) + (thickness 0.25) + (bold yes) + (italic yes) + ) + (justify left bottom mirror) + ) + (render_cache "feat. PCB-Review" 0 + (polygon + (pts + (xy 128.717397 219.454528) (xy 128.749881 219.610844) (xy 128.801922 219.611594) (xy 128.850617 219.616425) + (xy 128.852707 219.617194) (xy 128.873468 219.655296) (xy 128.877131 219.67337) (xy 128.76307 219.67337) + (xy 128.79531 219.829685) (xy 128.85979 219.829685) (xy 129.015861 220.58) (xy 129.303091 220.58) + (xy 129.14702 219.829685) (xy 129.202951 219.829685) (xy 129.170711 219.67337) (xy 129.11478 219.67337) + (xy 129.103406 219.622565) (xy 129.089664 219.573005) (xy 129.084738 219.559553) (xy 129.057522 219.518271) + (xy 129.041995 219.50411) (xy 128.99786 219.478254) (xy 128.965059 219.467229) (xy 128.915424 219.458547) + (xy 128.864356 219.455136) (xy 128.826329 219.454528) + ) + ) + (polygon + (pts + (xy 128.444695 219.643019) (xy 128.495951 219.64926) (xy 128.545005 219.661412) (xy 128.591856 219.679476) + (xy 128.601858 219.684275) (xy 128.647864 219.712105) (xy 128.687191 219.746328) (xy 128.719839 219.786943) + (xy 128.744478 219.830215) (xy 128.763461 219.875362) (xy 128.779695 219.926798) (xy 128.791646 219.976964) + (xy 128.846601 220.241235) (xy 128.856504 220.294777) (xy 128.86302 220.345476) (xy 128.864431 220.39755) + (xy 128.863905 220.404295) (xy 128.853698 220.452817) (xy 128.832435 220.49769) (xy 128.822676 220.511556) + (xy 128.786532 220.545242) (xy 128.741332 220.569741) (xy 128.695402 220.584481) (xy 128.643584 220.593103) + (xy 128.591367 220.595631) (xy 128.585758 220.595606) (xy 128.532321 220.592572) (xy 128.483701 220.584481) + (xy 128.435785 220.569741) (xy 128.404033 220.555071) (xy 128.360069 220.527056) (xy 128.320502 220.491828) + (xy 128.308454 220.478982) (xy 128.275781 220.438604) (xy 128.250404 220.394619) (xy 128.23802 220.362305) + (xy 128.223915 220.313578) (xy 128.212791 220.264682) (xy 128.197159 220.189211) (xy 128.470223 220.189211) + (xy 128.496357 220.31524) (xy 128.50576 220.355435) (xy 128.523712 220.402679) (xy 128.564256 220.423684) + (xy 128.587459 220.409518) (xy 128.587276 220.383811) (xy 128.578911 220.335024) (xy 128.538611 220.142316) + (xy 128.187145 220.142316) (xy 128.161011 220.016287) (xy 128.150898 219.960748) (xy 128.144923 219.91082) + (xy 128.14316 219.860628) (xy 128.146143 219.831639) (xy 128.416734 219.831639) (xy 128.420033 219.871982) + (xy 128.429434 219.922009) (xy 128.442868 219.986001) (xy 128.506371 219.986001) (xy 128.49367 219.925429) + (xy 128.483146 219.87822) (xy 128.468025 219.82993) (xy 128.435052 219.814054) (xy 128.416734 219.831639) + (xy 128.146143 219.831639) (xy 128.148555 219.808192) (xy 128.163148 219.764214) (xy 128.191045 219.722505) + (xy 128.231353 219.68778) (xy 128.263195 219.669984) (xy 128.311038 219.653525) (xy 128.360085 219.644962) + (xy 128.415268 219.642107) + ) + ) + (polygon + (pts + (xy 127.747612 219.644199) (xy 127.800109 219.651713) (xy 127.848332 219.664693) (xy 127.897473 219.685826) + (xy 127.902588 219.688572) (xy 127.944562 219.714487) (xy 127.982634 219.745819) (xy 128.01642 219.786943) + (xy 128.027428 219.805948) (xy 128.047264 219.850828) (xy 128.062627 219.89905) (xy 128.074305 219.948143) + (xy 128.088715 220.017264) (xy 127.818339 220.017264) (xy 127.797822 219.917857) (xy 127.788849 219.877843) + (xy 127.773642 219.829441) (xy 127.741158 219.814054) (xy 127.718199 219.831395) (xy 127.718654 219.866626) + (xy 127.727236 219.916147) (xy 127.732915 219.940709) (xy 127.750683 219.986734) (xy 127.764834 219.997435) + (xy 127.810962 220.019576) (xy 127.856394 220.038144) (xy 127.905289 220.056831) (xy 127.945688 220.072204) + (xy 127.994373 220.092804) (xy 128.038764 220.11503) (xy 128.082854 220.145736) (xy 128.087849 220.150849) + (xy 128.114777 220.192385) (xy 128.133229 220.241219) (xy 128.14538 220.289595) (xy 128.161011 220.36531) + (xy 128.168284 220.407674) (xy 128.171613 220.45879) (xy 128.164147 220.510463) (xy 128.137076 220.552156) + (xy 128.10885 220.571176) (xy 128.061875 220.589517) (xy 128.009337 220.595631) (xy 128.002325 220.595532) + (xy 127.952354 220.588462) (xy 127.906999 220.57023) (xy 127.883525 220.556309) (xy 127.846182 220.524068) + (xy 127.857662 220.58) (xy 127.577759 220.58) (xy 127.488717 220.151598) (xy 127.776085 220.151598) + (xy 127.812477 220.325743) (xy 127.820196 220.360413) (xy 127.836413 220.409518) (xy 127.867431 220.423684) + (xy 127.891612 220.406343) (xy 127.889708 220.366807) (xy 127.880865 220.317927) (xy 127.86879 220.268967) + (xy 127.851067 220.222916) (xy 127.848799 220.218802) (xy 127.816503 220.181985) (xy 127.776085 220.151598) + (xy 127.488717 220.151598) (xy 127.482016 220.119357) (xy 127.473629 220.078373) (xy 127.463709 220.027869) + (xy 127.453337 219.971392) (xy 127.445219 219.92231) (xy 127.438453 219.873171) (xy 127.434389 219.819427) + (xy 127.438824 219.779459) (xy 127.460245 219.731757) (xy 127.49545 219.693642) (xy 127.503512 219.687402) + (xy 127.547394 219.664301) (xy 127.596845 219.650612) (xy 127.64818 219.643919) (xy 127.698171 219.642107) + ) + ) + (polygon + (pts + (xy 126.968618 219.532686) (xy 126.997927 219.67337) (xy 126.924654 219.67337) (xy 126.956894 219.829685) + (xy 127.030167 219.829685) (xy 127.13226 220.320614) (xy 127.142112 220.371708) (xy 127.145694 220.416357) + (xy 127.097215 220.423333) (xy 127.069002 220.423684) (xy 127.101486 220.58) (xy 127.217257 220.58) + (xy 127.270475 220.579189) (xy 127.320484 220.576074) (xy 127.350614 220.571695) (xy 127.39676 220.551119) + (xy 127.416315 220.532616) (xy 127.439256 220.488754) (xy 127.442205 220.463007) (xy 127.436521 220.410047) + (xy 127.427091 220.355955) (xy 127.416631 220.303038) (xy 127.41314 220.286175) (xy 127.318129 219.829685) + (xy 127.376503 219.829685) (xy 127.344263 219.67337) (xy 127.285889 219.67337) (xy 127.25658 219.532686) + ) + ) + (polygon + (pts + (xy 126.775177 220.345526) (xy 126.823782 220.58) (xy 127.044577 220.58) (xy 126.995973 220.345526) + ) + ) + (polygon + (pts + (xy 126.50822 220.58) (xy 126.209511 220.58) (xy 126.115233 220.126685) (xy 126.045624 220.126685) + (xy 126.033956 220.126582) (xy 125.984329 220.123568) (xy 125.934717 220.115325) (xy 125.886866 220.100307) + (xy 125.867427 220.091421) (xy 125.824252 220.063015) (xy 125.789658 220.023859) (xy 125.781643 220.01046) + (xy 125.761336 219.964521) (xy 125.74661 219.917018) (xy 125.734947 219.867299) (xy 125.714919 219.771556) + (xy 125.704489 219.717241) (xy 125.700465 219.689706) (xy 125.955339 219.689706) (xy 125.960383 219.739071) + (xy 125.97919 219.829685) (xy 125.986465 219.859531) (xy 126.008743 219.906133) (xy 126.013365 219.910198) + (xy 126.061744 219.923475) (xy 126.072979 219.92323) (xy 126.01778 219.657739) (xy 126.009604 219.657863) + (xy 125.961116 219.671905) (xy 125.955339 219.689706) (xy 125.700465 219.689706) (xy 125.697114 219.66677) + (xy 125.694159 219.616706) (xy 125.699688 219.574965) (xy 125.720537 219.529267) (xy 125.722143 219.526979) + (xy 125.759967 219.493495) (xy 125.806022 219.473579) (xy 125.826246 219.468091) (xy 125.874923 219.459905) + (xy 125.928113 219.455719) (xy 125.982854 219.454528) (xy 126.274235 219.454528) + ) + ) + (polygon + (pts + (xy 124.999532 219.954738) (xy 125.298241 219.954738) (xy 125.256964 219.755924) (xy 125.247393 219.704473) + (xy 125.244263 219.658715) (xy 125.272595 219.642107) (xy 125.316315 219.664577) (xy 125.333065 219.712012) + (xy 125.345063 219.763355) (xy 125.346113 219.768381) (xy 125.451381 220.273963) (xy 125.460575 220.324293) + (xy 125.463838 220.372149) (xy 125.43404 220.392421) (xy 125.393496 220.370195) (xy 125.376485 220.323355) + (xy 125.364493 220.273502) (xy 125.361011 220.25711) (xy 125.330725 220.111053) (xy 125.032016 220.111053) + (xy 125.043007 220.16381) (xy 125.054387 220.215639) (xy 125.068263 220.271395) (xy 125.082379 220.320127) + (xy 125.099153 220.368104) (xy 125.118722 220.411228) (xy 125.148843 220.455411) (xy 125.185168 220.492157) + (xy 125.224789 220.522421) (xy 125.253056 220.540188) (xy 125.302027 220.564444) (xy 125.354417 220.58177) + (xy 125.403063 220.591245) (xy 125.454327 220.595414) (xy 125.469455 220.595631) (xy 125.522282 220.593387) + (xy 125.576474 220.585327) (xy 125.62407 220.571405) (xy 125.669734 220.548736) (xy 125.709586 220.515945) + (xy 125.738987 220.47183) (xy 125.752592 220.424413) (xy 125.753265 220.419288) (xy 125.755322 220.366514) + (xy 125.752166 220.316706) (xy 125.74615 220.267911) (xy 125.737077 220.213483) (xy 125.72933 220.174068) + (xy 125.662651 219.85411) (xy 125.652153 219.805066) (xy 125.640612 219.755828) (xy 125.626874 219.704499) + (xy 125.617711 219.675324) (xy 125.597675 219.630696) (xy 125.568709 219.587305) (xy 125.544438 219.559064) + (xy 125.505219 219.52344) (xy 125.464155 219.495962) (xy 125.41794 219.47316) (xy 125.413035 219.471137) + (xy 125.362169 219.454135) (xy 125.313982 219.444218) (xy 125.263516 219.439401) (xy 125.240355 219.438897) + (xy 125.187159 219.441316) (xy 125.132689 219.450006) (xy 125.084967 219.465015) (xy 125.039344 219.489455) + (xy 124.999549 219.52331) (xy 124.96999 219.566116) (xy 124.955324 219.614752) (xy 124.952781 219.669415) + (xy 124.956758 219.724378) (xy 124.96462 219.780659) (xy 124.974615 219.834984) (xy 124.976573 219.844584) + ) + ) + (polygon + (pts + (xy 125.031039 220.58) (xy 124.694228 220.58) (xy 124.673168 220.579919) (xy 124.615185 220.578717) + (xy 124.564999 220.576073) (xy 124.510212 220.570302) (xy 124.461221 220.559483) (xy 124.439139 220.550461) + (xy 124.396891 220.522431) (xy 124.362302 220.482791) (xy 124.350818 220.463817) (xy 124.329923 220.417353) + (xy 124.313484 220.365829) (xy 124.300753 220.312309) (xy 124.27926 220.20875) (xy 124.276579 220.195047) + (xy 124.269633 220.144603) (xy 124.269568 220.125636) (xy 124.563514 220.125636) (xy 124.571374 220.174556) + (xy 124.593112 220.278848) (xy 124.601961 220.314635) (xy 124.624619 220.359448) (xy 124.640479 220.368411) + (xy 124.689832 220.376545) (xy 124.628283 220.080034) (xy 124.615887 220.08063) (xy 124.566734 220.0942) + (xy 124.563514 220.125636) (xy 124.269568 220.125636) (xy 124.269452 220.09138) (xy 124.281702 220.041933) + (xy 124.29053 220.025573) (xy 124.325525 219.990043) (xy 124.371584 219.970614) (xy 124.360151 219.967821) + (xy 124.312079 219.948774) (xy 124.270223 219.917369) (xy 124.241377 219.875186) (xy 124.223411 219.829353) + (xy 124.210383 219.77815) (xy 124.208549 219.769129) (xy 124.20002 219.718216) (xy 124.19896 219.706111) + (xy 124.47696 219.706111) (xy 124.48418 219.755191) (xy 124.489209 219.778612) (xy 124.500916 219.826244) + (xy 124.518862 219.872672) (xy 124.522716 219.87708) (xy 124.570642 219.891479) (xy 124.589204 219.891723) + (xy 124.5406 219.657739) (xy 124.493705 219.663112) (xy 124.478073 219.685826) (xy 124.47696 219.706111) + (xy 124.19896 219.706111) (xy 124.19543 219.665784) (xy 124.197254 219.61505) (xy 124.210139 219.565415) + (xy 124.22745 219.534671) (xy 124.262003 219.499202) (xy 124.306859 219.47651) (xy 124.349775 219.465884) + (xy 124.403511 219.458736) (xy 124.452785 219.45558) (xy 124.508604 219.454528) (xy 124.797055 219.454528) + ) + ) + (polygon + (pts + (xy 123.800788 220.017264) (xy 123.843042 220.220474) (xy 124.215757 220.220474) (xy 124.173503 220.017264) + ) + ) + (polygon + (pts + (xy 123.845973 220.58) (xy 123.547264 220.58) (xy 123.443217 220.07979) (xy 123.434724 220.079947) + (xy 123.388262 220.09762) (xy 123.387024 220.101525) (xy 123.389153 220.150469) (xy 123.39852 220.201912) + (xy 123.477166 220.58) (xy 123.198485 220.58) (xy 123.136448 220.281535) (xy 123.13472 220.273179) + (xy 123.12422 220.220382) (xy 123.114807 220.167132) (xy 123.109337 220.114961) (xy 123.113012 220.090586) + (xy 123.133028 220.04584) (xy 123.152571 220.02126) (xy 123.196287 219.997236) (xy 123.186223 219.995912) + (xy 123.138997 219.978406) (xy 123.099567 219.945701) (xy 123.079173 219.917063) (xy 123.058565 219.872147) + (xy 123.042322 219.820932) (xy 123.029713 219.767404) (xy 123.027882 219.758427) (xy 123.019479 219.707731) + (xy 123.017687 219.685445) (xy 123.297979 219.685445) (xy 123.301556 219.735163) (xy 123.314501 219.796957) + (xy 123.324265 219.83563) (xy 123.348939 219.880244) (xy 123.35538 219.883692) (xy 123.404382 219.892212) + (xy 123.355533 219.657739) (xy 123.353117 219.657752) (xy 123.303998 219.67166) (xy 123.297979 219.685445) + (xy 123.017687 219.685445) (xy 123.015274 219.655445) (xy 123.017854 219.604734) (xy 123.032156 219.554912) + (xy 123.050734 219.524199) (xy 123.087359 219.490264) (xy 123.134494 219.470893) (xy 123.184161 219.462982) + (xy 123.237137 219.45862) (xy 123.292535 219.456127) (xy 123.345745 219.454928) (xy 123.405359 219.454528) + (xy 123.611988 219.454528) + ) + ) + (polygon + (pts + (xy 122.6366 219.643019) (xy 122.687856 219.64926) (xy 122.73691 219.661412) (xy 122.783761 219.679476) + (xy 122.793763 219.684275) (xy 122.839769 219.712105) (xy 122.879096 219.746328) (xy 122.911744 219.786943) + (xy 122.936384 219.830215) (xy 122.955366 219.875362) (xy 122.9716 219.926798) (xy 122.983551 219.976964) + (xy 123.038506 220.241235) (xy 123.048409 220.294777) (xy 123.054925 220.345476) (xy 123.056336 220.39755) + (xy 123.05581 220.404295) (xy 123.045603 220.452817) (xy 123.02434 220.49769) (xy 123.014581 220.511556) + (xy 122.978437 220.545242) (xy 122.933237 220.569741) (xy 122.887307 220.584481) (xy 122.835489 220.593103) + (xy 122.783272 220.595631) (xy 122.777664 220.595606) (xy 122.724226 220.592572) (xy 122.675606 220.584481) + (xy 122.62769 220.569741) (xy 122.595938 220.555071) (xy 122.551974 220.527056) (xy 122.512407 220.491828) + (xy 122.500359 220.478982) (xy 122.467687 220.438604) (xy 122.442309 220.394619) (xy 122.429925 220.362305) + (xy 122.41582 220.313578) (xy 122.404696 220.264682) (xy 122.389064 220.189211) (xy 122.662128 220.189211) + (xy 122.688262 220.31524) (xy 122.697665 220.355435) (xy 122.715617 220.402679) (xy 122.756161 220.423684) + (xy 122.779364 220.409518) (xy 122.779181 220.383811) (xy 122.770816 220.335024) (xy 122.730516 220.142316) + (xy 122.37905 220.142316) (xy 122.352916 220.016287) (xy 122.342804 219.960748) (xy 122.336828 219.91082) + (xy 122.335065 219.860628) (xy 122.338048 219.831639) (xy 122.608639 219.831639) (xy 122.611938 219.871982) + (xy 122.621339 219.922009) (xy 122.634773 219.986001) (xy 122.698276 219.986001) (xy 122.685575 219.925429) + (xy 122.675052 219.87822) (xy 122.65993 219.82993) (xy 122.626957 219.814054) (xy 122.608639 219.831639) + (xy 122.338048 219.831639) (xy 122.34046 219.808192) (xy 122.355053 219.764214) (xy 122.38295 219.722505) + (xy 122.423258 219.68778) (xy 122.4551 219.669984) (xy 122.502943 219.653525) (xy 122.55199 219.644962) + (xy 122.607173 219.642107) + ) + ) + (polygon + (pts + (xy 121.615547 219.657739) (xy 121.936482 220.58) (xy 122.304556 220.58) (xy 122.251311 219.657739) + (xy 121.992658 219.657739) (xy 122.06642 220.342595) (xy 122.054794 220.293041) (xy 122.040271 220.23598) + (xy 122.024955 220.178144) (xy 122.010598 220.125143) (xy 121.994371 220.066158) (xy 121.980973 220.017993) + (xy 121.966524 219.966461) (xy 121.952374 219.917064) (xy 121.938164 219.868096) (xy 121.923895 219.819558) + (xy 121.909566 219.771449) (xy 121.895177 219.723769) (xy 121.880729 219.676518) (xy 121.874933 219.657739) + ) + ) + (polygon + (pts + (xy 121.244542 219.454528) (xy 121.277027 219.610844) (xy 121.572316 219.610844) (xy 121.539832 219.454528) + ) + ) + (polygon + (pts + (xy 121.286796 219.657739) (xy 121.478527 220.58) (xy 121.773817 220.58) (xy 121.582086 219.657739) + ) + ) + (polygon + (pts + (xy 120.926901 219.643019) (xy 120.978156 219.64926) (xy 121.02721 219.661412) (xy 121.074061 219.679476) + (xy 121.084063 219.684275) (xy 121.130069 219.712105) (xy 121.169396 219.746328) (xy 121.202044 219.786943) + (xy 121.226684 219.830215) (xy 121.245666 219.875362) (xy 121.2619 219.926798) (xy 121.273852 219.976964) + (xy 121.328806 220.241235) (xy 121.338709 220.294777) (xy 121.345225 220.345476) (xy 121.346636 220.39755) + (xy 121.34611 220.404295) (xy 121.335903 220.452817) (xy 121.31464 220.49769) (xy 121.304881 220.511556) + (xy 121.268737 220.545242) (xy 121.223538 220.569741) (xy 121.177607 220.584481) (xy 121.125789 220.593103) + (xy 121.073572 220.595631) (xy 121.067964 220.595606) (xy 121.014526 220.592572) (xy 120.965906 220.584481) + (xy 120.91799 220.569741) (xy 120.886238 220.555071) (xy 120.842274 220.527056) (xy 120.802707 220.491828) + (xy 120.790659 220.478982) (xy 120.757987 220.438604) (xy 120.732609 220.394619) (xy 120.720226 220.362305) + (xy 120.706121 220.313578) (xy 120.694996 220.264682) (xy 120.679364 220.189211) (xy 120.952428 220.189211) + (xy 120.978562 220.31524) (xy 120.987965 220.355435) (xy 121.005917 220.402679) (xy 121.046461 220.423684) + (xy 121.069665 220.409518) (xy 121.069481 220.383811) (xy 121.061116 220.335024) (xy 121.020816 220.142316) + (xy 120.669351 220.142316) (xy 120.643217 220.016287) (xy 120.633104 219.960748) (xy 120.627128 219.91082) + (xy 120.625365 219.860628) (xy 120.628348 219.831639) (xy 120.898939 219.831639) (xy 120.902238 219.871982) + (xy 120.911639 219.922009) (xy 120.925073 219.986001) (xy 120.988576 219.986001) (xy 120.975875 219.925429) + (xy 120.965352 219.87822) (xy 120.95023 219.82993) (xy 120.917257 219.814054) (xy 120.898939 219.831639) + (xy 120.628348 219.831639) (xy 120.63076 219.808192) (xy 120.645353 219.764214) (xy 120.673251 219.722505) + (xy 120.713558 219.68778) (xy 120.7454 219.669984) (xy 120.793243 219.653525) (xy 120.84229 219.644962) + (xy 120.897473 219.642107) + ) + ) + (polygon + (pts + (xy 119.590286 219.657739) (xy 119.89217 220.58) (xy 120.201137 220.58) (xy 120.1971 220.522385) + (xy 120.193003 220.472464) (xy 120.188136 220.419139) (xy 120.182497 220.36241) (xy 120.176088 220.302277) + (xy 120.168907 220.238739) (xy 120.163016 220.188852) (xy 120.156691 220.13705) (xy 120.154487 220.119357) + (xy 120.166525 220.169255) (xy 120.17956 220.218379) (xy 120.19359 220.26673) (xy 120.208617 220.314309) + (xy 120.22464 220.361115) (xy 120.230202 220.376545) (xy 120.303475 220.58) (xy 120.612442 220.58) + (xy 120.537704 219.657739) (xy 120.287599 219.657739) (xy 120.29314 219.706358) (xy 120.299875 219.766156) + (xy 120.307074 219.830283) (xy 120.313531 219.88788) (xy 120.320893 219.953622) (xy 120.329161 220.027508) + (xy 120.335177 220.08129) (xy 120.341595 220.138692) (xy 120.348415 220.199713) (xy 120.336962 220.150237) + (xy 120.320251 220.091212) (xy 120.301765 220.029781) (xy 120.284915 219.975419) (xy 120.265506 219.91395) + (xy 120.243539 219.845376) (xy 120.227472 219.795713) (xy 120.210268 219.742892) (xy 120.191927 219.686912) + (xy 120.18233 219.657739) (xy 119.942972 219.657739) (xy 120.007941 220.199713) (xy 119.993031 220.137389) + (xy 119.980711 220.08963) (xy 119.967417 220.040998) (xy 119.953148 219.991496) (xy 119.937904 219.941121) + (xy 119.921686 219.889875) (xy 119.904494 219.837758) (xy 119.886326 219.784769) (xy 119.867184 219.730908) + (xy 119.847068 219.676176) (xy 119.840146 219.657739) + ) + ) + ) + ) + (gr_text "AS actuator supply" + (at 237 169.9 -90) + (layer "B.SilkS" knockout) + (uuid "e1629b33-d612-49a1-9934-a28819ace9c4") + (effects + (font + (size 1 1) + (thickness 0.25) + (bold yes) + ) + (justify left bottom mirror) + ) + ) (gr_text "Acc Cooling" (at 139.73 58.97 0) (layer "F.SilkS" knockout) @@ -122334,7 +124853,7 @@ ) ) (gr_text "7.2V" - (at 114.5 220 0) + (at 149.6 217.65 90) (layer "F.SilkS" knockout) (uuid "4953bae4-33f0-4ec2-a0e4-83bbc3b45a29") (effects @@ -122530,424 +125049,6 @@ (justify left bottom) ) ) - (gr_text "PDU FT25 | V1.2 | made by Janek Herm" - (at 163.84 172.43 0) - (layer "F.SilkS") - (uuid "7aefbadc-bd70-41f6-8584-9dd7907bc8e7") - (effects - (font - (face "Impact") - (size 1.5 1.5) - (thickness 0.3) - (bold yes) - (italic yes) - ) - (justify left bottom) - ) - (render_cache "PDU FT25 | V1.2 | made by Janek Herm" 0 - (polygon - (pts - (xy 164.792226 170.488579) (xy 164.872011 170.494858) (xy 164.945026 170.507137) (xy 164.975362 170.515369) - (xy 165.044445 170.545242) (xy 165.10118 170.595469) (xy 165.10359 170.5989) (xy 165.134862 170.667448) - (xy 165.143157 170.730059) (xy 165.138725 170.805156) (xy 165.127662 170.880861) (xy 165.112016 170.962334) - (xy 165.081974 171.105949) (xy 165.06448 171.180527) (xy 165.042391 171.251782) (xy 165.01193 171.32069) - (xy 164.999909 171.340788) (xy 164.948017 171.399522) (xy 164.883255 171.442131) (xy 164.854096 171.45546) - (xy 164.782319 171.477987) (xy 164.707901 171.490352) (xy 164.633462 171.494873) (xy 164.615959 171.495027) - (xy 164.511545 171.495027) (xy 164.370129 172.175) (xy 163.922065 172.175) (xy 164.126878 171.189846) - (xy 164.574926 171.189846) (xy 164.591779 171.190212) (xy 164.664348 171.170297) (xy 164.67128 171.1642) - (xy 164.704698 171.094296) (xy 164.71561 171.049528) (xy 164.74382 170.913607) (xy 164.751386 170.839559) - (xy 164.742721 170.812857) (xy 164.669988 170.791795) (xy 164.657725 170.791608) (xy 164.574926 171.189846) - (xy 164.126878 171.189846) (xy 164.273042 170.486793) (xy 164.710115 170.486793) - ) - ) - (polygon - (pts - (xy 165.727611 170.487257) (xy 165.811263 170.48914) (xy 165.884933 170.492473) (xy 165.960161 170.498385) - (xy 166.038105 170.509513) (xy 166.067494 170.516468) (xy 166.137905 170.544066) (xy 166.198693 170.590458) - (xy 166.217704 170.61502) (xy 166.249485 170.682995) (xy 166.260336 170.757087) (xy 166.260202 170.767428) - (xy 166.252854 170.842873) (xy 166.240495 170.920691) (xy 166.224835 171.004635) (xy 166.207812 171.088363) - (xy 166.086912 171.671249) (xy 166.069661 171.750551) (xy 166.050382 171.829949) (xy 166.029465 171.903388) - (xy 166.002648 171.974232) (xy 165.96206 172.039458) (xy 165.906521 172.093062) (xy 165.90263 172.095865) - (xy 165.835677 172.133509) (xy 165.764424 172.156655) (xy 165.759382 172.15778) (xy 165.681625 172.168929) - (xy 165.605518 172.173637) (xy 165.524909 172.175) (xy 164.975729 172.175) (xy 165.0391 171.870184) - (xy 165.487173 171.870184) (xy 165.561533 171.855353) (xy 165.584993 171.835746) (xy 165.615398 171.762243) - (xy 165.635505 171.684519) (xy 165.646175 171.636078) (xy 165.781364 170.985415) (xy 165.7956 170.912909) - (xy 165.804445 170.844731) (xy 165.78576 170.804064) (xy 165.711388 170.791608) (xy 165.487173 171.870184) - (xy 165.0391 171.870184) (xy 165.326706 170.486793) (xy 165.653503 170.486793) - ) - ) - (polygon - (pts - (xy 167.475799 170.486793) (xy 167.243157 171.606036) (xy 167.226515 171.68327) (xy 167.208741 171.75853) - (xy 167.18839 171.83309) (xy 167.17538 171.872383) (xy 167.140979 171.941185) (xy 167.096534 172.001497) - (xy 167.069134 172.032117) (xy 167.012143 172.083654) (xy 166.947966 172.125925) (xy 166.883387 172.156315) - (xy 166.813263 172.178533) (xy 166.737987 172.192522) (xy 166.657558 172.198282) (xy 166.640854 172.198447) - (xy 166.560635 172.194448) (xy 166.487312 172.18245) (xy 166.413932 172.159738) (xy 166.386964 172.147889) - (xy 166.322503 172.10945) (xy 166.265858 172.054534) (xy 166.241517 172.015631) (xy 166.215261 171.942421) - (xy 166.207657 171.866406) (xy 166.208911 171.844173) (xy 166.219043 171.769662) (xy 166.231926 171.695322) - (xy 166.246764 171.617064) (xy 166.261805 171.541596) (xy 166.275589 171.474511) (xy 166.48112 170.486793) - (xy 166.929183 170.486793) (xy 166.668698 171.739759) (xy 166.655191 171.812065) (xy 166.651113 171.869452) - (xy 166.680788 171.893632) (xy 166.730614 171.864323) (xy 166.754971 171.791479) (xy 166.772745 171.713014) - (xy 167.027735 170.486793) - ) - ) - (polygon - (pts - (xy 168.004096 170.486793) (xy 168.746716 170.486793) (xy 168.673443 170.838503) (xy 168.378886 170.838503) - (xy 168.320268 171.11987) (xy 168.582585 171.11987) (xy 168.509678 171.47158) (xy 168.247362 171.47158) - (xy 168.101182 172.175) (xy 167.653119 172.175) - ) - ) - (polygon - (pts - (xy 169.717948 170.486793) (xy 169.644675 170.838503) (xy 169.392616 170.838503) (xy 169.114912 172.175) - (xy 168.666849 172.175) (xy 168.944553 170.838503) (xy 168.693593 170.838503) (xy 168.766866 170.486793) - ) - ) - (polygon - (pts - (xy 170.398653 171.917079) (xy 170.345163 172.175) (xy 169.425589 172.175) (xy 169.467721 171.970568) - (xy 169.534116 171.885055) (xy 169.597105 171.803729) (xy 169.656688 171.726591) (xy 169.712865 171.65364) - (xy 169.765635 171.584877) (xy 169.815 171.520301) (xy 169.860959 171.459912) (xy 169.92351 171.377181) - (xy 169.978399 171.303871) (xy 170.025623 171.239983) (xy 170.076668 171.169455) (xy 170.121315 171.104849) - (xy 170.164749 171.036245) (xy 170.203784 170.96647) (xy 170.234178 170.898976) (xy 170.249176 170.848761) - (xy 170.255835 170.773576) (xy 170.250275 170.751308) (xy 170.198618 170.721266) (xy 170.131517 170.753929) - (xy 170.129741 170.756071) (xy 170.098356 170.824008) (xy 170.078817 170.901151) (xy 170.042913 171.072976) - (xy 169.654567 171.072976) (xy 169.669954 170.999337) (xy 169.686231 170.926371) (xy 169.706676 170.849471) - (xy 169.729672 170.780983) (xy 169.764914 170.710879) (xy 169.807847 170.651459) (xy 169.833719 170.621981) - (xy 169.892057 170.568589) (xy 169.95771 170.526017) (xy 170.005544 170.503646) (xy 170.077006 170.480701) - (xy 170.154874 170.467281) (xy 170.231224 170.463346) (xy 170.305261 170.466539) (xy 170.384636 170.478801) - (xy 170.464185 170.504729) (xy 170.529673 170.543175) (xy 170.581102 170.594138) (xy 170.623074 170.663816) - (xy 170.647139 170.742057) (xy 170.653508 170.817544) (xy 170.646168 170.899587) (xy 170.641552 170.924232) - (xy 170.621356 170.999634) (xy 170.59191 171.077097) (xy 170.558556 171.146568) (xy 170.518119 171.217617) - (xy 170.505265 171.238206) (xy 170.454277 171.312416) (xy 170.407291 171.3755) (xy 170.349909 171.449471) - (xy 170.300051 171.512094) (xy 170.244345 171.580843) (xy 170.182791 171.655715) (xy 170.11539 171.736712) - (xy 170.067207 171.794112) (xy 170.016426 171.854235) (xy 169.963046 171.917079) - ) - ) - (polygon - (pts - (xy 171.760795 170.486793) (xy 171.707306 170.744713) (xy 171.202456 170.744713) (xy 171.149333 171.000069) - (xy 171.214048 170.951963) (xy 171.282325 170.9239) (xy 171.360107 170.91027) (xy 171.397728 170.908845) - (xy 171.478351 170.915164) (xy 171.553342 170.937382) (xy 171.617155 170.980831) (xy 171.64136 171.009961) - (xy 171.670224 171.080952) (xy 171.678729 171.155683) (xy 171.676308 171.233327) (xy 171.667442 171.307615) - (xy 171.652351 171.390614) (xy 171.602892 171.629117) (xy 171.586826 171.702562) (xy 171.568765 171.775594) - (xy 171.54664 171.850527) (xy 171.531451 171.892166) (xy 171.497484 171.958933) (xy 171.451545 172.021709) - (xy 171.426304 172.049337) (xy 171.368121 172.098727) (xy 171.299634 172.138638) (xy 171.248251 172.159979) - (xy 171.177762 172.180265) (xy 171.100475 172.193037) (xy 171.025104 172.198109) (xy 170.998757 172.198447) - (xy 170.921546 172.194829) (xy 170.841909 172.18211) (xy 170.769923 172.160233) (xy 170.726182 172.140561) - (xy 170.664501 172.098837) (xy 170.615496 172.040131) (xy 170.586231 171.968004) (xy 170.576478 171.893995) - (xy 170.578075 171.81225) (xy 170.587399 171.728401) (xy 170.601279 171.647378) (xy 170.607114 171.618492) - (xy 170.62763 171.518475) (xy 171.058475 171.518475) (xy 171.032829 171.641939) (xy 171.017396 171.719883) - (xy 171.003643 171.799024) (xy 170.994727 171.87568) (xy 171.032154 171.939513) (xy 171.044553 171.940526) - (xy 171.089982 171.922575) (xy 171.115994 171.882274) (xy 171.133485 171.8056) (xy 171.150403 171.728922) - (xy 171.162156 171.675279) (xy 171.235429 171.324668) (xy 171.247455 171.248563) (xy 171.245321 171.19754) - (xy 171.199525 171.166765) (xy 171.155195 171.183984) (xy 171.125519 171.22172) (xy 171.105394 171.295243) - (xy 171.097676 171.330896) (xy 170.670495 171.330896) (xy 170.863935 170.486793) - ) - ) - (polygon - (pts - (xy 172.811528 170.486793) (xy 173.054061 170.486793) (xy 172.644466 172.456367) (xy 172.401933 172.456367) - ) - ) - (polygon - (pts - (xy 175.066866 170.486793) (xy 174.496803 172.175) (xy 173.832219 172.175) (xy 173.934801 170.486793) - (xy 174.405945 170.486793) (xy 174.397637 170.573518) (xy 174.389201 170.658664) (xy 174.380636 170.742229) - (xy 174.371942 170.824214) (xy 174.363119 170.90462) (xy 174.354167 170.983446) (xy 174.345087 171.060691) - (xy 174.335878 171.136357) (xy 174.32654 171.210443) (xy 174.312291 171.318609) (xy 174.297753 171.42322) - (xy 174.282925 171.524276) (xy 174.267807 171.621778) (xy 174.257568 171.684804) (xy 174.28122 171.590702) - (xy 174.30464 171.49895) (xy 174.327828 171.409549) (xy 174.350784 171.322498) (xy 174.373509 171.237799) - (xy 174.396002 171.155449) (xy 174.418263 171.075451) (xy 174.440292 170.997802) (xy 174.462089 170.922505) - (xy 174.483654 170.849558) (xy 174.497903 170.802233) (xy 174.594256 170.486793) - ) - ) - (polygon - (pts - (xy 175.771751 170.486793) (xy 175.420774 172.175) (xy 174.989563 172.175) (xy 175.180439 171.256891) - (xy 175.196089 171.179531) (xy 175.210389 171.102377) (xy 175.219668 171.029556) (xy 175.21964 171.02718) - (xy 175.186667 170.973691) (xy 175.111362 170.958702) (xy 175.033524 170.955809) (xy 175.016674 170.955739) - (xy 174.962086 170.955739) (xy 175.004218 170.752407) (xy 175.080525 170.734072) (xy 175.153191 170.711489) - (xy 175.222216 170.684658) (xy 175.303378 170.645147) (xy 175.378851 170.598999) (xy 175.448636 170.546214) - (xy 175.512732 170.486793) - ) - ) - (polygon - (pts - (xy 175.935516 171.82329) (xy 175.862609 172.175) (xy 175.531416 172.175) (xy 175.604323 171.82329) - ) - ) - (polygon - (pts - (xy 176.909678 171.917079) (xy 176.856189 172.175) (xy 175.936615 172.175) (xy 175.978747 171.970568) - (xy 176.045142 171.885055) (xy 176.108131 171.803729) (xy 176.167714 171.726591) (xy 176.22389 171.65364) - (xy 176.276661 171.584877) (xy 176.326026 171.520301) (xy 176.371985 171.459912) (xy 176.434536 171.377181) - (xy 176.489424 171.303871) (xy 176.536649 171.239983) (xy 176.587694 171.169455) (xy 176.632341 171.104849) - (xy 176.675775 171.036245) (xy 176.71481 170.96647) (xy 176.745204 170.898976) (xy 176.760202 170.848761) - (xy 176.766861 170.773576) (xy 176.761301 170.751308) (xy 176.709644 170.721266) (xy 176.642542 170.753929) - (xy 176.640767 170.756071) (xy 176.609382 170.824008) (xy 176.589842 170.901151) (xy 176.553939 171.072976) - (xy 176.165593 171.072976) (xy 176.18098 170.999337) (xy 176.197257 170.926371) (xy 176.217702 170.849471) - (xy 176.240697 170.780983) (xy 176.27594 170.710879) (xy 176.318873 170.651459) (xy 176.344745 170.621981) - (xy 176.403083 170.568589) (xy 176.468736 170.526017) (xy 176.51657 170.503646) (xy 176.588031 170.480701) - (xy 176.6659 170.467281) (xy 176.74225 170.463346) (xy 176.816287 170.466539) (xy 176.895662 170.478801) - (xy 176.97521 170.504729) (xy 177.040699 170.543175) (xy 177.092128 170.594138) (xy 177.1341 170.663816) - (xy 177.158165 170.742057) (xy 177.164534 170.817544) (xy 177.157193 170.899587) (xy 177.152578 170.924232) - (xy 177.132382 170.999634) (xy 177.102936 171.077097) (xy 177.069581 171.146568) (xy 177.029145 171.217617) - (xy 177.01629 171.238206) (xy 176.965303 171.312416) (xy 176.918317 171.3755) (xy 176.860935 171.449471) - (xy 176.811076 171.512094) (xy 176.75537 171.580843) (xy 176.693817 171.655715) (xy 176.626416 171.736712) - (xy 176.578233 171.794112) (xy 176.527452 171.854235) (xy 176.474071 171.917079) - ) - ) - (polygon - (pts - (xy 177.826322 170.486793) (xy 178.068855 170.486793) (xy 177.65926 172.456367) (xy 177.416727 172.456367) - ) - ) - (polygon - (pts - (xy 179.030195 170.791608) (xy 179.004916 170.88613) (xy 179.061302 170.838102) (xy 179.111894 170.808461) - (xy 179.180466 170.780912) (xy 179.252824 170.76879) (xy 179.274193 170.768161) (xy 179.352916 170.777205) - (xy 179.424291 170.809003) (xy 179.477466 170.863694) (xy 179.502805 170.912875) (xy 179.555929 170.861153) - (xy 179.615925 170.818828) (xy 179.63433 170.808461) (xy 179.705846 170.779534) (xy 179.78026 170.768318) - (xy 179.790401 170.768161) (xy 179.865036 170.775786) (xy 179.93518 170.803956) (xy 179.959661 170.822383) - (xy 180.006281 170.882466) (xy 180.024508 170.954274) (xy 180.021312 171.032138) (xy 180.010049 171.112523) - (xy 179.995526 171.18966) (xy 179.993367 171.200104) (xy 179.790767 172.175) (xy 179.371646 172.175) - (xy 179.559591 171.27008) (xy 179.575299 171.192204) (xy 179.588108 171.11901) (xy 179.593297 171.061618) - (xy 179.559225 171.026081) (xy 179.503904 171.06345) (xy 179.480273 171.135075) (xy 179.461225 171.21463) - (xy 179.448217 171.275209) (xy 179.261371 172.175) (xy 178.84225 172.175) (xy 179.025799 171.293161) - (xy 179.041752 171.213747) (xy 179.05639 171.134983) (xy 179.066104 171.062055) (xy 179.066099 171.059787) - (xy 179.033126 171.026081) (xy 178.989528 171.044766) (xy 178.961318 171.09166) (xy 178.944506 171.16387) - (xy 178.932742 171.218789) (xy 178.734173 172.175) (xy 178.315785 172.175) (xy 178.603381 170.791608) - ) - ) - (polygon - (pts - (xy 180.751623 170.770878) (xy 180.828625 170.780919) (xy 180.902802 170.801452) (xy 180.968625 170.836103) - (xy 180.980718 170.845464) (xy 181.033526 170.902635) (xy 181.065657 170.974188) (xy 181.072309 171.034141) - (xy 181.066214 171.114757) (xy 181.056064 171.188465) (xy 181.043887 171.262088) (xy 181.02833 171.346803) - (xy 181.013449 171.42256) (xy 181.000868 171.484036) (xy 180.857254 172.175) (xy 180.4374 172.175) - (xy 180.454619 172.091102) (xy 180.398605 172.139463) (xy 180.363394 172.160345) (xy 180.295361 172.187693) - (xy 180.220405 172.198298) (xy 180.209888 172.198447) (xy 180.131079 172.189276) (xy 180.060617 172.161765) - (xy 180.018279 172.133234) (xy 179.977672 172.070694) (xy 179.966473 171.993186) (xy 179.971467 171.916512) - (xy 179.97181 171.914515) (xy 180.386475 171.914515) (xy 180.422745 171.940526) (xy 180.469274 171.919277) - (xy 180.493598 171.84562) (xy 180.505177 171.793614) (xy 180.559766 171.532397) (xy 180.499139 171.577977) - (xy 180.450694 171.633204) (xy 180.447292 171.639375) (xy 180.420708 171.70845) (xy 180.402595 171.781891) - (xy 180.38933 171.855211) (xy 180.386475 171.914515) (xy 179.97181 171.914515) (xy 179.982376 171.852965) - (xy 180.005823 171.739392) (xy 180.02405 171.666829) (xy 180.051727 171.593578) (xy 180.092119 171.531273) - (xy 180.099612 171.523604) (xy 180.165747 171.477545) (xy 180.232333 171.444206) (xy 180.30536 171.413306) - (xy 180.365959 171.390247) (xy 180.439302 171.362216) (xy 180.50745 171.334364) (xy 180.576641 171.301152) - (xy 180.597868 171.285101) (xy 180.624521 171.216064) (xy 180.633039 171.179221) (xy 180.645911 171.10494) - (xy 180.646594 171.052093) (xy 180.612156 171.026081) (xy 180.563429 171.049162) (xy 180.540619 171.121765) - (xy 180.527159 171.181786) (xy 180.496385 171.330896) (xy 180.090819 171.330896) (xy 180.112435 171.227215) - (xy 180.129952 171.153576) (xy 180.152997 171.081242) (xy 180.18275 171.013922) (xy 180.199263 170.985415) - (xy 180.249942 170.923728) (xy 180.30705 170.87673) (xy 180.370011 170.837859) (xy 180.377683 170.83374) - (xy 180.451395 170.802039) (xy 180.523729 170.78257) (xy 180.602474 170.771299) (xy 180.676636 170.768161) - ) - ) - (polygon - (pts - (xy 181.941325 172.175) (xy 181.510481 172.175) (xy 181.527334 172.0933) (xy 181.466347 172.136384) - (xy 181.407533 172.166207) (xy 181.334901 172.190387) (xy 181.262086 172.198447) (xy 181.187464 172.189619) - (xy 181.116388 172.157494) (xy 181.100153 172.144958) (xy 181.051885 172.087347) (xy 181.031643 172.021493) - (xy 181.033666 171.944556) (xy 181.041147 171.890167) (xy 181.472395 171.890167) (xy 181.472745 171.92001) - (xy 181.503154 171.940526) (xy 181.552979 171.914881) (xy 181.578096 171.843189) (xy 181.593646 171.775662) - (xy 181.725903 171.139288) (xy 181.736625 171.066318) (xy 181.735062 171.046231) (xy 181.701357 171.026081) - (xy 181.655561 171.045865) (xy 181.630538 171.116952) (xy 181.62442 171.144417) (xy 181.484103 171.817794) - (xy 181.472395 171.890167) (xy 181.041147 171.890167) (xy 181.04387 171.870368) (xy 181.057288 171.799476) - (xy 181.18918 171.1642) (xy 181.205758 171.090744) (xy 181.226738 171.014896) (xy 181.25444 170.942822) - (xy 181.256591 170.93852) (xy 181.299846 170.878601) (xy 181.359392 170.829214) (xy 181.37456 170.819452) - (xy 181.445331 170.786243) (xy 181.521907 170.769964) (xy 181.559207 170.768161) (xy 181.633213 170.77558) - (xy 181.697693 170.797836) (xy 181.761399 170.839941) (xy 181.783056 170.864515) (xy 181.861458 170.486793) - (xy 182.292302 170.486793) - ) - ) - (polygon - (pts - (xy 182.904841 170.772443) (xy 182.978411 170.785288) (xy 183.050175 170.809976) (xy 183.097937 170.836671) - (xy 183.158399 170.888758) (xy 183.200246 170.951321) (xy 183.222135 171.017288) (xy 183.230228 171.095942) - (xy 183.227583 171.17123) (xy 183.21862 171.246123) (xy 183.20345 171.329431) (xy 183.164249 171.518475) - (xy 182.637051 171.518475) (xy 182.576601 171.807536) (xy 182.564053 171.880717) (xy 182.563778 171.919277) - (xy 182.598583 171.940526) (xy 182.659399 171.909019) (xy 182.686327 171.838153) (xy 182.700432 171.777861) - (xy 182.739633 171.588817) (xy 183.149228 171.588817) (xy 183.125781 171.702023) (xy 183.109094 171.775368) - (xy 183.087937 171.848457) (xy 183.069361 171.896929) (xy 183.031295 171.962907) (xy 182.982286 172.023474) - (xy 182.964214 172.042742) (xy 182.904863 172.095584) (xy 182.838918 172.137607) (xy 182.79129 172.159612) - (xy 182.719415 172.181722) (xy 182.646486 172.193858) (xy 182.56633 172.198409) (xy 182.557916 172.198447) - (xy 182.479592 172.194654) (xy 182.401865 172.181722) (xy 182.332969 172.159612) (xy 182.26517 172.122864) - (xy 182.210953 172.072334) (xy 182.196315 172.051535) (xy 182.164421 171.984226) (xy 182.14911 171.911443) - (xy 182.148321 171.901325) (xy 182.150437 171.823215) (xy 182.160212 171.747165) (xy 182.175066 171.666852) - (xy 182.254679 171.284002) (xy 182.685411 171.284002) (xy 182.780666 171.284002) (xy 182.800816 171.188014) - (xy 182.814918 171.112973) (xy 182.819867 171.052459) (xy 182.79239 171.026081) (xy 182.74293 171.049895) - (xy 182.720248 171.122331) (xy 182.704462 171.193143) (xy 182.685411 171.284002) (xy 182.254679 171.284002) - (xy 182.257498 171.270446) (xy 182.275425 171.195198) (xy 182.299776 171.118044) (xy 182.32825 171.050323) - (xy 182.365209 170.985415) (xy 182.414181 170.924492) (xy 182.473172 170.873158) (xy 182.54218 170.831413) - (xy 182.557184 170.824214) (xy 182.62746 170.797118) (xy 182.70104 170.77889) (xy 182.777924 170.769529) - (xy 182.822065 170.768161) - ) - ) - (polygon - (pts - (xy 184.227072 170.865614) (xy 184.28652 170.822738) (xy 184.334417 170.798935) (xy 184.405949 170.775854) - (xy 184.479863 170.768161) (xy 184.554621 170.774359) (xy 184.624944 170.796371) (xy 184.684793 170.840478) - (xy 184.707376 170.875872) (xy 184.727791 170.947899) (xy 184.728258 170.975157) (xy 184.718183 171.048796) - (xy 184.704631 171.121239) (xy 184.69382 171.174459) (xy 184.566325 171.785921) (xy 184.548609 171.864679) - (xy 184.527972 171.938252) (xy 184.501886 172.007177) (xy 184.499647 172.011967) (xy 184.458484 172.074218) - (xy 184.402806 172.125241) (xy 184.376915 172.143126) (xy 184.30975 172.176837) (xy 184.237949 172.194989) - (xy 184.187505 172.198447) (xy 184.112566 172.188934) (xy 184.054515 172.164741) (xy 183.996543 172.119373) - (xy 183.968785 172.082676) (xy 183.926653 172.175) (xy 183.524019 172.175) (xy 183.578021 171.915247) - (xy 184.018977 171.915247) (xy 184.051584 171.940526) (xy 184.099211 171.912316) (xy 184.122939 171.840847) - (xy 184.14061 171.763206) (xy 184.260778 171.183984) (xy 184.274572 171.107488) (xy 184.277264 171.052826) - (xy 184.243558 171.026081) (xy 184.198129 171.050994) (xy 184.174951 171.121717) (xy 184.159661 171.189113) - (xy 184.036563 171.781891) (xy 184.022879 171.856039) (xy 184.018977 171.915247) (xy 183.578021 171.915247) - (xy 183.874996 170.486793) (xy 184.30584 170.486793) - ) - ) - (polygon - (pts - (xy 185.78009 170.791608) (xy 185.454026 171.788852) (xy 185.426841 171.871314) (xy 185.402437 171.943394) - (xy 185.377483 172.014368) (xy 185.350963 172.084857) (xy 185.341186 172.108688) (xy 185.305272 172.178481) - (xy 185.258233 172.240965) (xy 185.247763 172.251936) (xy 185.188408 172.298835) (xy 185.12197 172.330552) - (xy 185.106346 172.335833) (xy 185.030715 172.352131) (xy 184.949113 172.359966) (xy 184.871673 172.362474) - (xy 184.850624 172.362578) (xy 184.589406 172.362578) (xy 184.637766 172.128105) (xy 184.712479 172.126492) - (xy 184.765261 172.119678) (xy 184.796402 172.083775) (xy 184.799669 172.005214) (xy 184.800432 171.943457) - (xy 184.81472 170.791608) (xy 185.208562 170.791608) (xy 185.13419 171.742323) (xy 185.38515 170.791608) - ) - ) - (polygon - (pts - (xy 186.83009 170.486793) (xy 186.595617 171.613363) (xy 186.580234 171.687335) (xy 186.563782 171.76465) - (xy 186.547356 171.839059) (xy 186.529059 171.91586) (xy 186.523443 171.936863) (xy 186.494592 172.006472) - (xy 186.448339 172.069487) (xy 186.392171 172.117422) (xy 186.326022 172.149257) (xy 186.316448 172.152285) - (xy 186.243053 172.166992) (xy 186.163948 172.17358) (xy 186.096629 172.175) (xy 185.869849 172.175) - (xy 185.933597 171.866521) (xy 185.998077 171.870184) (xy 186.067686 171.849668) (xy 186.105422 171.798377) - (xy 186.124029 171.725601) (xy 186.135464 171.672714) (xy 186.382027 170.486793) - ) - ) - (polygon - (pts - (xy 187.437038 170.770878) (xy 187.51404 170.780919) (xy 187.588217 170.801452) (xy 187.654041 170.836103) - (xy 187.666133 170.845464) (xy 187.718941 170.902635) (xy 187.751072 170.974188) (xy 187.757725 171.034141) - (xy 187.751629 171.114757) (xy 187.74148 171.188465) (xy 187.729303 171.262088) (xy 187.713745 171.346803) - (xy 187.698864 171.42256) (xy 187.686284 171.484036) (xy 187.542669 172.175) (xy 187.122815 172.175) - (xy 187.140034 172.091102) (xy 187.08402 172.139463) (xy 187.04881 172.160345) (xy 186.980776 172.187693) - (xy 186.90582 172.198298) (xy 186.895303 172.198447) (xy 186.816495 172.189276) (xy 186.746033 172.161765) - (xy 186.703695 172.133234) (xy 186.663088 172.070694) (xy 186.651888 171.993186) (xy 186.656882 171.916512) - (xy 186.657225 171.914515) (xy 187.071891 171.914515) (xy 187.108161 171.940526) (xy 187.154689 171.919277) - (xy 187.179014 171.84562) (xy 187.190593 171.793614) (xy 187.245181 171.532397) (xy 187.184554 171.577977) - (xy 187.136109 171.633204) (xy 187.132707 171.639375) (xy 187.106123 171.70845) (xy 187.088011 171.781891) - (xy 187.074746 171.855211) (xy 187.071891 171.914515) (xy 186.657225 171.914515) (xy 186.667791 171.852965) - (xy 186.691238 171.739392) (xy 186.709465 171.666829) (xy 186.737142 171.593578) (xy 186.777534 171.531273) - (xy 186.785027 171.523604) (xy 186.851162 171.477545) (xy 186.917749 171.444206) (xy 186.990776 171.413306) - (xy 187.051374 171.390247) (xy 187.124717 171.362216) (xy 187.192866 171.334364) (xy 187.262057 171.301152) - (xy 187.283283 171.285101) (xy 187.309936 171.216064) (xy 187.318454 171.179221) (xy 187.331327 171.10494) - (xy 187.332009 171.052093) (xy 187.297571 171.026081) (xy 187.248845 171.049162) (xy 187.226034 171.121765) - (xy 187.212575 171.181786) (xy 187.1818 171.330896) (xy 186.776235 171.330896) (xy 186.79785 171.227215) - (xy 186.815367 171.153576) (xy 186.838412 171.081242) (xy 186.868165 171.013922) (xy 186.884678 170.985415) - (xy 186.935357 170.923728) (xy 186.992465 170.87673) (xy 187.055426 170.837859) (xy 187.063098 170.83374) - (xy 187.13681 170.802039) (xy 187.209144 170.78257) (xy 187.28789 170.771299) (xy 187.362051 170.768161) - ) - ) - (polygon - (pts - (xy 188.402892 170.791608) (xy 188.38091 170.876971) (xy 188.439692 170.829382) (xy 188.481294 170.806263) - (xy 188.553411 170.778914) (xy 188.631002 170.76831) (xy 188.641762 170.768161) (xy 188.71686 170.775683) - (xy 188.786634 170.803472) (xy 188.810655 170.82165) (xy 188.856268 170.881367) (xy 188.87367 170.954274) - (xy 188.870596 171.028016) (xy 188.86065 171.101851) (xy 188.84631 171.180814) (xy 188.839598 171.21366) - (xy 188.63993 172.175) (xy 188.209085 172.175) (xy 188.408754 171.214759) (xy 188.423802 171.138946) - (xy 188.435228 171.06423) (xy 188.435498 171.050994) (xy 188.402892 171.026081) (xy 188.350136 171.057955) - (xy 188.32672 171.13177) (xy 188.309503 171.205937) (xy 188.301775 171.242236) (xy 188.107969 172.175) - (xy 187.677124 172.175) (xy 187.96472 170.791608) - ) - ) - (polygon - (pts - (xy 189.597583 170.772443) (xy 189.671154 170.785288) (xy 189.742918 170.809976) (xy 189.79068 170.836671) - (xy 189.851142 170.888758) (xy 189.892989 170.951321) (xy 189.914877 171.017288) (xy 189.92297 171.095942) - (xy 189.920326 171.17123) (xy 189.911362 171.246123) (xy 189.896193 171.329431) (xy 189.856992 171.518475) - (xy 189.329794 171.518475) (xy 189.269344 171.807536) (xy 189.256796 171.880717) (xy 189.256521 171.919277) - (xy 189.291325 171.940526) (xy 189.352142 171.909019) (xy 189.37907 171.838153) (xy 189.393175 171.777861) - (xy 189.432376 171.588817) (xy 189.841971 171.588817) (xy 189.818524 171.702023) (xy 189.801837 171.775368) - (xy 189.780679 171.848457) (xy 189.762103 171.896929) (xy 189.724038 171.962907) (xy 189.675029 172.023474) - (xy 189.656957 172.042742) (xy 189.597606 172.095584) (xy 189.53166 172.137607) (xy 189.484033 172.159612) - (xy 189.412158 172.181722) (xy 189.339229 172.193858) (xy 189.259072 172.198409) (xy 189.250659 172.198447) - (xy 189.172334 172.194654) (xy 189.094607 172.181722) (xy 189.025711 172.159612) (xy 188.957912 172.122864) - (xy 188.903696 172.072334) (xy 188.889057 172.051535) (xy 188.857163 171.984226) (xy 188.841852 171.911443) - (xy 188.841064 171.901325) (xy 188.84318 171.823215) (xy 188.852954 171.747165) (xy 188.867808 171.666852) - (xy 188.947421 171.284002) (xy 189.378154 171.284002) (xy 189.473408 171.284002) (xy 189.493558 171.188014) - (xy 189.507661 171.112973) (xy 189.512609 171.052459) (xy 189.485132 171.026081) (xy 189.435673 171.049895) - (xy 189.41299 171.122331) (xy 189.397205 171.193143) (xy 189.378154 171.284002) (xy 188.947421 171.284002) - (xy 188.95024 171.270446) (xy 188.968167 171.195198) (xy 188.992519 171.118044) (xy 189.020992 171.050323) - (xy 189.057951 170.985415) (xy 189.106924 170.924492) (xy 189.165914 170.873158) (xy 189.234922 170.831413) - (xy 189.249926 170.824214) (xy 189.320203 170.797118) (xy 189.393783 170.77889) (xy 189.470667 170.769529) - (xy 189.514808 170.768161) - ) - ) - (polygon - (pts - (xy 191.039982 170.791608) (xy 190.752752 171.356908) (xy 190.800013 172.175) (xy 190.383824 172.175) - (xy 190.390418 171.577459) (xy 190.278311 172.175) (xy 189.847466 172.175) (xy 190.198443 170.486793) - (xy 190.629288 170.486793) (xy 190.467355 171.207431) (xy 190.67142 170.791608) - ) - ) - (polygon - (pts - (xy 192.582742 170.486793) (xy 192.231765 172.175) (xy 191.783702 172.175) (xy 191.929881 171.47158) - (xy 191.826566 171.47158) (xy 191.680387 172.175) (xy 191.232323 172.175) (xy 191.5833 170.486793) - (xy 192.031364 170.486793) (xy 191.899473 171.11987) (xy 192.002787 171.11987) (xy 192.134678 170.486793) - ) - ) - (polygon - (pts - (xy 193.208469 170.772443) (xy 193.28204 170.785288) (xy 193.353804 170.809976) (xy 193.401566 170.836671) - (xy 193.462028 170.888758) (xy 193.503875 170.951321) (xy 193.525764 171.017288) (xy 193.533857 171.095942) - (xy 193.531212 171.17123) (xy 193.522248 171.246123) (xy 193.507079 171.329431) (xy 193.467878 171.518475) - (xy 192.94068 171.518475) (xy 192.88023 171.807536) (xy 192.867682 171.880717) (xy 192.867407 171.919277) - (xy 192.902212 171.940526) (xy 192.963028 171.909019) (xy 192.989956 171.838153) (xy 193.004061 171.777861) - (xy 193.043262 171.588817) (xy 193.452857 171.588817) (xy 193.42941 171.702023) (xy 193.412723 171.775368) - (xy 193.391566 171.848457) (xy 193.37299 171.896929) (xy 193.334924 171.962907) (xy 193.285915 172.023474) - (xy 193.267843 172.042742) (xy 193.208492 172.095584) (xy 193.142547 172.137607) (xy 193.094919 172.159612) - (xy 193.023044 172.181722) (xy 192.950115 172.193858) (xy 192.869958 172.198409) (xy 192.861545 172.198447) - (xy 192.783221 172.194654) (xy 192.705493 172.181722) (xy 192.636598 172.159612) (xy 192.568798 172.122864) - (xy 192.514582 172.072334) (xy 192.499944 172.051535) (xy 192.46805 171.984226) (xy 192.452738 171.911443) - (xy 192.45195 171.901325) (xy 192.454066 171.823215) (xy 192.463841 171.747165) (xy 192.478695 171.666852) - (xy 192.558308 171.284002) (xy 192.98904 171.284002) (xy 193.084295 171.284002) (xy 193.104445 171.188014) - (xy 193.118547 171.112973) (xy 193.123496 171.052459) (xy 193.096018 171.026081) (xy 193.046559 171.049895) - (xy 193.023876 171.122331) (xy 193.008091 171.193143) (xy 192.98904 171.284002) (xy 192.558308 171.284002) - (xy 192.561127 171.270446) (xy 192.579053 171.195198) (xy 192.603405 171.118044) (xy 192.631878 171.050323) - (xy 192.668838 170.985415) (xy 192.71781 170.924492) (xy 192.776801 170.873158) (xy 192.845809 170.831413) - (xy 192.860812 170.824214) (xy 192.931089 170.797118) (xy 193.004669 170.77889) (xy 193.081553 170.769529) - (xy 193.125694 170.768161) - ) - ) - (polygon - (pts - (xy 194.178258 170.791608) (xy 194.105718 170.999337) (xy 194.146299 170.935996) (xy 194.199365 170.87321) - (xy 194.257196 170.82485) (xy 194.330689 170.786662) (xy 194.410668 170.768109) (xy 194.422623 170.767062) - (xy 194.315279 171.284002) (xy 194.241282 171.287378) (xy 194.168393 171.301443) (xy 194.140889 171.312578) - (xy 194.082315 171.360025) (xy 194.06322 171.392812) (xy 194.04048 171.4649) (xy 194.022158 171.539977) - (xy 194.005904 171.613918) (xy 194.000938 171.637543) (xy 193.889197 172.175) (xy 193.458353 172.175) - (xy 193.745949 170.791608) - ) - ) - (polygon - (pts - (xy 194.924542 170.791608) (xy 194.899263 170.88613) (xy 194.955649 170.838102) (xy 195.006242 170.808461) - (xy 195.074813 170.780912) (xy 195.147172 170.76879) (xy 195.168541 170.768161) (xy 195.247264 170.777205) - (xy 195.318638 170.809003) (xy 195.371813 170.863694) (xy 195.397152 170.912875) (xy 195.450277 170.861153) - (xy 195.510273 170.818828) (xy 195.528677 170.808461) (xy 195.600193 170.779534) (xy 195.674607 170.768318) - (xy 195.684748 170.768161) (xy 195.759384 170.775786) (xy 195.829528 170.803956) (xy 195.854009 170.822383) - (xy 195.900628 170.882466) (xy 195.918855 170.954274) (xy 195.91566 171.032138) (xy 195.904397 171.112523) - (xy 195.889874 171.18966) (xy 195.887714 171.200104) (xy 195.685115 172.175) (xy 195.265994 172.175) - (xy 195.453939 171.27008) (xy 195.469647 171.192204) (xy 195.482455 171.11901) (xy 195.487644 171.061618) - (xy 195.453572 171.026081) (xy 195.398251 171.06345) (xy 195.374621 171.135075) (xy 195.355573 171.21463) - (xy 195.342564 171.275209) (xy 195.155718 172.175) (xy 194.736598 172.175) (xy 194.920146 171.293161) - (xy 194.936099 171.213747) (xy 194.950737 171.134983) (xy 194.960451 171.062055) (xy 194.960446 171.059787) - (xy 194.927473 171.026081) (xy 194.883876 171.044766) (xy 194.855666 171.09166) (xy 194.838853 171.16387) - (xy 194.82709 171.218789) (xy 194.62852 172.175) (xy 194.210132 172.175) (xy 194.497728 170.791608) - ) - ) - ) - ) (gr_text "Power" (at 233.45 229.72 0) (layer "F.SilkS" knockout) @@ -123345,13 +125446,71 @@ (justify left bottom) ) ) - (segment - (start 123.7 135.165) - (end 123.7 134.095358) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "00ae8dff-242a-4ce8-ac01-08ad068841fb") + (dimension + (type aligned) + (layer "Dwgs.User") + (uuid "27edcfca-f615-4c42-986b-7680719619a5") + (pts + (xy 112 234) (xy 277 234) + ) + (height 9.4) + (gr_text "165.0000 mm" + (at 194.5 242.25 0) + (layer "Dwgs.User") + (uuid "27edcfca-f615-4c42-986b-7680719619a5") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (format + (prefix "") + (suffix "") + (units 2) + (units_format 1) + (precision 4) + ) + (style + (thickness 0.15) + (arrow_length 1.27) + (text_position_mode 0) + (extension_height 0.58642) + (extension_offset 0.5) keep_text_aligned) + ) + (dimension + (type aligned) + (layer "Dwgs.User") + (uuid "bb6d42b7-de18-4881-aab5-0d82ecb2be25") + (pts + (xy 112 234) (xy 112 54) + ) + (height -9.8) + (gr_text "180.0000 mm" + (at 101.05 144 90) + (layer "Dwgs.User") + (uuid "bb6d42b7-de18-4881-aab5-0d82ecb2be25") + (effects + (font + (size 1 1) + (thickness 0.15) + ) + ) + ) + (format + (prefix "") + (suffix "") + (units 2) + (units_format 1) + (precision 4) + ) + (style + (thickness 0.15) + (arrow_length 1.27) + (text_position_mode 0) + (extension_height 0.58642) + (extension_offset 0.5) keep_text_aligned) ) (segment (start 252.529356 87.429356) @@ -123425,14 +125584,6 @@ (net 1) (uuid "0482c04e-c458-4c5b-a756-3f5797ae7a9b") ) - (segment - (start 127.642501 222.242501) - (end 127.01 221.61) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "0488b56c-e1e0-4d48-9c65-3b0df32f06cf") - ) (segment (start 217.79 71.994999) (end 217.79 71) @@ -123977,14 +126128,6 @@ (net 1) (uuid "2b5d9ce7-8b8f-4cc3-93b4-1eba3ec793ce") ) - (segment - (start 119.180477 118.297452) - (end 118.808025 117.925) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "2cb6edd5-8269-41a4-ba02-b5f7dfc7373f") - ) (segment (start 147.41 149.41) (end 145.506016 149.41) @@ -124209,14 +126352,6 @@ (net 1) (uuid "3c95f199-89ee-47fe-9d23-88ab339896a2") ) - (segment - (start 114.875 117.925) - (end 113.6 119.2) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "3e21b3f0-fe73-42fd-bc72-5ec196f2b1e7") - ) (segment (start 216.433 227.769008) (end 217.427008 226.775) @@ -124265,14 +126400,6 @@ (net 1) (uuid "411404be-1ca8-455f-8b7c-7d4d37ee2602") ) - (segment - (start 123.7 134.095358) - (end 123.560197 133.955555) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "422ba023-9da0-4d56-aaae-beebf1011259") - ) (segment (start 156.69 66.595) (end 157.895 66.595) @@ -124409,14 +126536,6 @@ (net 1) (uuid "4996d185-bbd0-4f58-924c-8afe07acb33f") ) - (segment - (start 127.642501 223.095) - (end 127.642501 222.242501) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "4a5781c3-702d-44e9-bae2-635c06c84279") - ) (segment (start 230.345 69.085) (end 229.64 68.38) @@ -124465,14 +126584,6 @@ (net 1) (uuid "4bd873a3-77e8-47cf-bd8c-c62ba42c6edc") ) - (segment - (start 123.65 136.625) - (end 123.65 135.215) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "4c9139e2-9daf-4000-99bd-68730f7b052e") - ) (segment (start 123.66 141.485) (end 123.475 141.3) @@ -124513,14 +126624,6 @@ (net 1) (uuid "5129a992-589b-453d-8b7f-fa818dc2baa4") ) - (segment - (start 118.808025 117.925) - (end 114.875 117.925) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "521b8aed-fad1-4518-a7e4-eafd3f646376") - ) (segment (start 232.765 201.093162) (end 234.852089 199.006073) @@ -124529,14 +126632,6 @@ (net 1) (uuid "52c89ec7-6d2f-4238-9350-4955259d79ca") ) - (segment - (start 123.65 135.215) - (end 123.7 135.165) - (width 0.25) - (layer "F.Cu") - (net 1) - (uuid "53152a1f-b93d-4719-9c86-2c34137e36b3") - ) (segment (start 166.425 199.07) (end 166.975 198.52) @@ -124593,6 +126688,14 @@ (net 1) (uuid "5a5e313b-e4e7-41a4-a4c5-cfa73ea0bc2c") ) + (segment + (start 125 135.165) + (end 125 135.1) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "5a8e5a9c-76cf-4f43-b7bf-ffe47b27268b") + ) (segment (start 183.584732 141.314606) (end 184.180655 141.910529) @@ -124913,6 +127016,14 @@ (net 1) (uuid "6f07c9b6-cc6d-4a87-b099-7bcc587796bf") ) + (segment + (start 125 136.575) + (end 124.95 136.625) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "7033c80a-cbe2-4da3-a854-4c4d5f681e4b") + ) (segment (start 223.07785 154.826637) (end 222.326213 154.075) @@ -125209,6 +127320,14 @@ (net 1) (uuid "87da49ea-119c-44d6-bf9f-5caefdf1a891") ) + (segment + (start 125 135.165) + (end 125 136.575) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "88199d75-1a83-441a-8d6a-8f56d41e2740") + ) (segment (start 262.42 217.38) (end 263.3 216.5) @@ -125873,6 +127992,14 @@ (net 1) (uuid "c579141a-74d2-44b5-a52d-ad90079858a2") ) + (segment + (start 118.808025 117.925) + (end 115.225 117.925) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "c6548e30-9290-42ef-b689-42ff33c71791") + ) (segment (start 196.541194 147.2) (end 196.9 147.2) @@ -125913,6 +128040,14 @@ (net 1) (uuid "c89c83ac-36ae-43f4-a5b8-ece2592be11b") ) + (segment + (start 125 135.1) + (end 123.9 134) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "ca28a06d-17b3-4eef-b6be-392ed0bb3fa6") + ) (segment (start 163.012503 188.25) (end 162.95 188.25) @@ -125961,6 +128096,14 @@ (net 1) (uuid "ccfba2f0-dbcc-4d43-986d-619f3643e882") ) + (segment + (start 119.180477 118.297452) + (end 118.808025 117.925) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "cdfd3073-1a85-4fa3-93c8-4c6550933083") + ) (segment (start 260.63 202.595) (end 260.63 201.28) @@ -126041,6 +128184,14 @@ (net 1) (uuid "d4e6137a-bd3c-4dd6-8901-680c1b0d0686") ) + (segment + (start 129.047501 224.5) + (end 129.1 224.5) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "d4e666b6-1d02-448b-b47d-61d51af89fcb") + ) (segment (start 248.77 230.3) (end 249.475 230.3) @@ -126433,6 +128584,14 @@ (net 1) (uuid "ee9179b2-019b-4797-94f5-93a880aae39a") ) + (segment + (start 115.225 117.925) + (end 113.5 119.65) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "ef9e9608-c3e3-4d1c-99bf-01f4fa9e6a4c") + ) (segment (start 185.469707 136.930293) (end 185.469707 136.136032) @@ -126577,6 +128736,14 @@ (net 1) (uuid "fe2923d1-2865-4117-80c4-3fdecdfbbc95") ) + (segment + (start 127.642501 223.095) + (end 129.047501 224.5) + (width 0.25) + (layer "F.Cu") + (net 1) + (uuid "fe5be897-6f56-4ac6-bced-d68ae077621b") + ) (segment (start 219.26 89.265) (end 219.4625 89.0625) @@ -126682,6 +128849,15 @@ (net 1) (uuid "02f62ea3-10aa-4d56-91d5-2582810ae362") ) + (via + (at 113.5 213.9) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "033b5025-3c50-4ae0-bcdd-9b9f5b3bf864") + ) (via (at 157.55 56.75) (size 0.8) @@ -126699,6 +128875,15 @@ (net 1) (uuid "036e8dd2-b968-4794-b0bf-e9e2b98446b4") ) + (via + (at 113.5 126.899999) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "0374cfdc-d98d-443c-89e1-74515ddf6c19") + ) (via (at 244.5 212.4) (size 0.8) @@ -126725,6 +128910,15 @@ (net 1) (uuid "03e863f7-aaa5-4cb3-89e4-6e54041a4fb1") ) + (via + (at 112.811253 126.175) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "03ed5603-19d6-4931-abd6-f4958b4c7ccd") + ) (via (at 202.07 141.1) (size 0.8) @@ -126777,6 +128971,15 @@ (net 1) (uuid "056de6d1-4175-4cda-81c9-5a7cc6a1f63d") ) + (via + (at 112.811252 163.875) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "058cbdbb-2b7e-49ac-beeb-7fc03319509a") + ) (via (at 148.9 233.2) (size 0.8) @@ -126829,6 +129032,15 @@ (net 1) (uuid "06e23a15-4a10-435f-8598-07da2a596ada") ) + (via + (at 113.5 228.5) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "07310cce-97b3-4495-bbb8-268d8684be7d") + ) (via (at 258.975 54.811252) (size 0.8) @@ -126838,6 +129050,24 @@ (net 1) (uuid "07de34fc-a6c8-448b-a096-ba8c9bf7a5fb") ) + (via + (at 112.811252 118.925) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "0872dd5f-4031-4f92-8aaf-40cf34b08f25") + ) + (via + (at 112.811253 133.425) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "08c9011e-0853-47cc-826b-ecf953c05d30") + ) (via (at 133.298 139.97) (size 0.8) @@ -126932,6 +129162,15 @@ (net 1) (uuid "0ae6e5df-9059-4a8b-98b4-e3af79f78ea1") ) + (via + (at 113.5 171.85) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "0b075e97-28a1-40b1-91f9-00823cc0c446") + ) (via (at 213.425 232.511252) (size 0.8) @@ -126941,6 +129180,24 @@ (net 1) (uuid "0c0ec804-a274-4ef9-a5ea-7c4f2b9eb0cf") ) + (via + (at 112.811252 166.775) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "0c18b8af-9fe9-4062-b0cd-f54195fcc291") + ) + (via + (at 112.811253 134.875) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "0c3fdee6-e92e-43aa-97ea-d7444ac0d2f8") + ) (via (at 235.175 232.511252) (size 0.8) @@ -126993,6 +129250,15 @@ (net 1) (uuid "0d2c6e9d-8c65-4754-b22a-e6830f1d9d41") ) + (via + (at 113.5 182) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "0e658ce5-eb9a-44bf-92a8-7f6ec80685f2") + ) (via (at 270.15 90.373218) (size 0.8) @@ -127292,6 +129558,15 @@ (net 1) (uuid "17ee295a-2dae-41f1-b9f4-ea2d711aa92d") ) + (via + (at 113.5 203.750001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "18095d5c-b701-4733-8f57-407a75ac2dbe") + ) (via (at 269.299999 90.9) (size 0.8) @@ -127337,6 +129612,15 @@ (net 1) (uuid "19b332d8-38ac-4248-8ada-7c8ff45b880d") ) + (via + (at 112.811252 127.625) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "1a7d2494-075e-4e5c-8d70-e569aaf2503b") + ) (via (at 159.35 220.5) (size 0.8) @@ -127372,6 +129656,15 @@ (net 1) (uuid "1b508e30-8e54-47bc-aa72-cde4917362c1") ) + (via + (at 113.5 135.599999) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "1b58f203-a3f6-47ad-aa59-d63a546bffc7") + ) (via (at 179.2 54.8) (size 0.8) @@ -127479,6 +129772,15 @@ (net 1) (uuid "1daba0f6-31d9-4fca-8d79-1fa61d97510b") ) + (via + (at 113.5 141.4) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "1df8ce09-891a-4ad2-aede-092c80fd8665") + ) (via (at 223.575 232.511252) (size 0.8) @@ -127515,6 +129817,15 @@ (net 1) (uuid "1f4ee715-9ef1-4f5c-bf6e-0523bd5d7b78") ) + (via + (at 113.5 161.7) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "1f5a98d5-40df-4202-95c8-b10839d02319") + ) (via (at 244.48 218.64) (size 0.8) @@ -127614,12 +129925,13 @@ (uuid "20ec47b6-6d74-4560-be55-37a26a2be6db") ) (via - (at 123.560197 133.955555) + (at 112.811252 165.325) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") + (free yes) (net 1) - (uuid "22466d19-c986-45cf-82e6-4b7946d3610e") + (uuid "22239a67-d504-4363-ab63-ed9255be4d2b") ) (via (at 219.075 55.488748) @@ -127682,6 +129994,15 @@ (net 1) (uuid "23827e00-663a-4b4e-b162-47cf2fa93de4") ) + (via + (at 112.811252 149.375) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "238f096d-4922-456e-9339-4014356f1101") + ) (via (at 183.5 206.17) (size 0.8) @@ -127699,6 +130020,42 @@ (net 1) (uuid "24146c3c-87c9-456a-9b6a-3117456e95dc") ) + (via + (at 112.811252 207.375) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "2427acbf-4387-4cd7-a796-6c8a9e7dcbee") + ) + (via + (at 112.811252 198.675) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "248125ec-586c-428d-a613-751521d5d9a4") + ) + (via + (at 113.5 166.05) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "24ceafa1-e71e-4179-baf7-987522ee77cf") + ) + (via + (at 112.811252 147.925) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "24fab354-a9cd-4333-bcdc-8c6f4e1d1e15") + ) (via (at 183.55 54.8) (size 0.8) @@ -127770,6 +130127,15 @@ (net 1) (uuid "277d239c-7cdb-4da8-a1fa-121be88f1bf9") ) + (via + (at 113.5 152.999999) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "277f6d55-79ab-42ab-b823-883ca847262d") + ) (via (at 230.825 232.511252) (size 0.8) @@ -127884,6 +130250,15 @@ (net 1) (uuid "2b4421be-29fe-48c4-8d82-746a38c8f2bc") ) + (via + (at 113.5 124) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "2b66428c-23e0-4605-8ed2-e5cb33ec09a4") + ) (via (at 128.350001 54.8) (size 0.8) @@ -127902,6 +130277,15 @@ (net 1) (uuid "2bb02bb0-3661-47fc-b7bd-798d419e80a0") ) + (via + (at 113.5 231.4) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "2bb3fec2-725d-40c1-9f4d-c168b845f56b") + ) (via (at 202.4 54.8) (size 0.8) @@ -127911,6 +130295,15 @@ (net 1) (uuid "2bef19fa-1746-444d-8643-33b9b41026b6") ) + (via + (at 113.5 128.35) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "2c663668-215c-48b4-b7c8-e04adccfa74a") + ) (via (at 200.225 55.488748) (size 0.8) @@ -127972,6 +130365,15 @@ (net 1) (uuid "2df7e0fa-8e71-4faf-bd9e-26ee1c740ebe") ) + (via + (at 112.811252 146.475) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "2e19feb5-8828-429f-9589-bad1cb36106e") + ) (via (at 143.075 233.188748) (size 0.8) @@ -127981,6 +130383,15 @@ (net 1) (uuid "2ede9023-4cb6-4f8c-bb46-f10f3bedf665") ) + (via + (at 113.5 211) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "2f324ae4-6c01-4c25-8dd6-de5fcae7ca96") + ) (via (at 155.425 232.511252) (size 0.8) @@ -128008,6 +130419,15 @@ (net 1) (uuid "305d2b9d-9615-487b-a75f-3ce9e70a649c") ) + (via + (at 113.5 173.3) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "30b15d57-2140-4b70-b260-108fe4cd3d7c") + ) (via (at 125 58.5) (size 0.8) @@ -128053,6 +130473,15 @@ (net 1) (uuid "3185caea-e621-4d93-844e-8eb81272519e") ) + (via + (at 113.5 147.2) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "31e9a6c6-f66e-4093-a91a-241b96ef115e") + ) (via (at 134.400001 101.079999) (size 0.8) @@ -128061,6 +130490,15 @@ (net 1) (uuid "329fb700-8a03-4432-abc3-3b68c85ee3c1") ) + (via + (at 113.5 131.25) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "32a2ce4d-76e3-4b8e-8e02-bbf622ba576f") + ) (via (at 272.699999 90.9) (size 0.8) @@ -128086,6 +130524,15 @@ (net 1) (uuid "334ed0db-450a-472e-baf9-70080e12c467") ) + (via + (at 112.811253 185.625) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "335d4d9d-5a48-4a2a-9a6c-47d0e4ca05eb") + ) (via (at 195.149999 54.8) (size 0.8) @@ -128131,6 +130578,15 @@ (net 1) (uuid "33e33061-7354-4c6a-b70e-cbfbaeda4478") ) + (via + (at 112.811252 184.175) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "340ba190-071d-4864-9be8-78be0e2b815d") + ) (via (at 227.775 55.488748) (size 0.8) @@ -128176,6 +130632,24 @@ (net 1) (uuid "34e416bb-594a-4db6-b919-eecac87ab87e") ) + (via + (at 113.5 197.95) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "352fa163-f16c-4ebb-9df4-de87dae20185") + ) + (via + (at 112.811253 168.225) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "35c67b5b-b335-4937-86b6-5f03f3ef54be") + ) (via (at 217.16 75.5) (size 0.8) @@ -128273,6 +130747,15 @@ (net 1) (uuid "37d69c8c-8c4a-4b2b-b6b0-28def18ac4df") ) + (via + (at 113.5 215.35) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "3830dd17-a49d-465e-be98-a9ef4db95433") + ) (via (at 182.25 233.2) (size 0.8) @@ -128291,6 +130774,15 @@ (net 1) (uuid "3864914a-0070-41ac-b22c-faaba9fb9da2") ) + (via + (at 112.811252 216.075) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "390f08c3-10f2-4056-b7a8-96c138546d2d") + ) (via (at 114.7 93.1) (size 0.8) @@ -128318,6 +130810,15 @@ (net 1) (uuid "39b7f8d1-1f23-4a2c-9526-1c54cc878dfb") ) + (via + (at 112.811253 194.325) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "39bb9629-ddfb-4f35-8f06-a0784837d8c3") + ) (via (at 172.825 232.511252) (size 0.8) @@ -128422,6 +130923,14 @@ (net 1) (uuid "3d10301d-4a69-4ed8-aa82-4368fbd897c7") ) + (via + (at 123.9 134) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (net 1) + (uuid "3d148601-bb26-41f4-aac5-14b0fb6473f7") + ) (via (at 212.7 233.2) (size 0.8) @@ -128474,6 +130983,15 @@ (net 1) (uuid "3e9f11f4-57de-422e-94c5-32f400ad4326") ) + (via + (at 113.5 208.1) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "3ee90297-0ebc-4cb7-b09f-3686b8503c81") + ) (via (at 211.100001 54.8) (size 0.8) @@ -128483,6 +131001,15 @@ (net 1) (uuid "3f125de1-be41-470c-b7e0-0445eeebdf04") ) + (via + (at 113.5 134.150001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "3fd68483-3cc9-414d-8306-e4777966ecfb") + ) (via (at 113.4 58.5) (size 0.8) @@ -128535,6 +131062,24 @@ (net 1) (uuid "40a14627-75eb-487c-a234-a879aa33ac01") ) + (via + (at 113.5 225.6) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "40a79634-8b5d-454e-98b6-b4e8e267cbbb") + ) + (via + (at 113.5 200.85) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "40c0ca68-3a50-4036-8406-dedef2b7cef8") + ) (via (at 116.17 127.46) (size 0.8) @@ -128543,6 +131088,15 @@ (net 1) (uuid "41ad0a5d-c953-4b18-900b-aa6e8a3c5f9b") ) + (via + (at 112.811252 221.975) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "41d0e6b7-3db2-4044-9645-b96c807b1b91") + ) (via (at 242.25 219.38) (size 0.8) @@ -128587,6 +131141,24 @@ (net 1) (uuid "42c46fdf-ed6c-4a3c-b41c-7be67e1d4b34") ) + (via + (at 113.5 216.9) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "42c871d5-80b8-409f-998a-f9244e8260c7") + ) + (via + (at 113.5 132.7) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "431c28ff-44a8-42a6-80a0-631e3ba01b93") + ) (via (at 252.8 164.2) (size 0.8) @@ -128720,6 +131292,15 @@ (net 1) (uuid "4771730a-670b-4dd6-b34a-99fb8d0f6c2f") ) + (via + (at 112.811252 197.225) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "479f6c94-5267-4bd3-bd63-9375ed2b5709") + ) (via (at 271.8 172) (size 0.8) @@ -128824,6 +131405,24 @@ (net 1) (uuid "4ae5d2ba-dfb8-47a3-886d-fc4f21f15ac7") ) + (via + (at 113.5 196.5) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "4ae9aef7-b2f7-43b0-9f6f-0b09b4bf1d8d") + ) + (via + (at 112.811253 142.125) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "4b0f478d-5b04-44c7-a3fb-3a97365136e2") + ) (via (at 229.949999 54.8) (size 0.8) @@ -128876,6 +131475,15 @@ (net 1) (uuid "4e0421a5-2003-4774-b12e-5f3799c5d2a6") ) + (via + (at 112.811252 130.525) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "4ea27546-8b58-4d32-9b4b-7fdcc4d5d563") + ) (via (at 265 233.2) (size 0.8) @@ -128903,6 +131511,15 @@ (net 1) (uuid "4ef42b00-a7c7-4e7a-9a80-f3f111e00a97") ) + (via + (at 112.811252 230.675) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "4fcee57a-150b-4f32-9893-64360b0e431b") + ) (via (at 251.5 172) (size 0.8) @@ -129019,6 +131636,15 @@ (net 1) (uuid "546e2a0f-96aa-46bc-a309-b133d6f20090") ) + (via + (at 112.811253 217.625) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "54b643e0-6d9e-4ac0-8fbb-948911bdfd22") + ) (via (at 271.3 55.5) (size 0.8) @@ -129090,6 +131716,15 @@ (net 1) (uuid "58c2ee5c-383b-4407-92d7-e672ca74a576") ) + (via + (at 113.5 155.9) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "58dbcf66-b284-4d59-b689-5cb070de6fa8") + ) (via (at 159.05 233.2) (size 0.8) @@ -129108,6 +131743,15 @@ (net 1) (uuid "595185cc-7433-4250-8ea9-0a7961e73bbc") ) + (via + (at 112.811252 153.725) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "595da161-8683-4628-a0c7-04961a30ff00") + ) (via (at 163.25 54.8) (size 0.8) @@ -129126,6 +131770,15 @@ (net 1) (uuid "59949139-4987-4af5-adb4-f6750a45a2df") ) + (via + (at 112.811252 171.125) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "59b0a40d-7b3d-447c-bcd6-d69c1bb96001") + ) (via (at 260.24 200.89) (size 0.8) @@ -129343,6 +131996,15 @@ (net 1) (uuid "610d4767-d9cb-41f2-9e6f-34410a9c6dcf") ) + (via + (at 113.5 119.65) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "617f0e17-2e26-4993-9961-ccdac26cab98") + ) (via (at 257.8 208.7) (size 0.8) @@ -129379,6 +132041,15 @@ (net 1) (uuid "62d3c0ff-6fd7-4c82-aac3-b85dc60b8242") ) + (via + (at 112.811252 123.275) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "62d87962-72cc-44c0-acb5-07c1f7a4e2e0") + ) (via (at 205.45 233.2) (size 0.8) @@ -129433,6 +132104,15 @@ (net 1) (uuid "649ae6de-5c94-4de8-be58-dbdfedcc34bf") ) + (via + (at 113.5 179.1) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "6535b7ca-b47f-49b5-998c-17690c7cc5c7") + ) (via (at 244.6 233.2) (size 0.8) @@ -129460,6 +132140,15 @@ (net 1) (uuid "666492c7-2e76-472d-9c1b-33c63a054474") ) + (via + (at 112.811252 174.025) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "668dc02c-abdd-470f-9e72-09759fd34454") + ) (via (at 251.125 232.511252) (size 0.8) @@ -129469,6 +132158,15 @@ (net 1) (uuid "66ad3ae0-e9d3-4fd4-8710-28424b2f9eba") ) + (via + (at 113.5 137.05) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "66dafbcd-caef-4ab8-85df-556fd75a6b35") + ) (via (at 204.43 149.675) (size 0.8) @@ -129513,6 +132211,15 @@ (net 1) (uuid "68749767-d476-4e3e-879a-576020369655") ) + (via + (at 113.5 150.1) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "68990e48-694d-4b81-9c61-457c984838d1") + ) (via (at 202.55 233.2) (size 0.8) @@ -129531,6 +132238,15 @@ (net 1) (uuid "691ad321-279f-4097-80ba-83ed540da2ad") ) + (via + (at 113.296104 206.473648) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "6999882f-ba71-4234-8a64-4a0a2d83b047") + ) (via (at 117.41 195.8) (size 0.8) @@ -129540,6 +132256,15 @@ (net 1) (uuid "69d1f17e-6279-462a-80a0-9bcb03fed827") ) + (via + (at 112.811253 160.975) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "6a667a82-e47f-4436-9a08-294138faf30b") + ) (via (at 274.4 90.9) (size 0.8) @@ -129591,6 +132316,15 @@ (net 1) (uuid "6ce73fe7-2620-46f2-a42d-6a4ccf74f218") ) + (via + (at 112.811252 113.125) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "6d366e5f-c50e-4fd0-99fa-16fc0821f468") + ) (via (at 175.725 232.511252) (size 0.8) @@ -129634,6 +132368,15 @@ (net 1) (uuid "6e16cded-c793-4c26-ac77-8a24df7c7db5") ) + (via + (at 113.5 209.55) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "6e49fa6f-042f-41cb-9089-2ead8ecc128f") + ) (via (at 123.475 141.3) (size 0.8) @@ -129703,6 +132446,15 @@ (net 1) (uuid "6fff7151-43af-4e4c-bf93-1bb3987961fa") ) + (via + (at 113.5 199.4) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "703e4457-9f86-4f99-8c94-1badd047e1d0") + ) (via (at 130.75 232.5) (size 0.8) @@ -129739,6 +132491,15 @@ (net 1) (uuid "71ad393f-3c2f-45ee-bcc0-432d4b8606fc") ) + (via + (at 113.5 157.35) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "71d243c1-09bb-4560-abda-262c686b2e9c") + ) (via (at 156 54.8) (size 0.8) @@ -129792,6 +132553,15 @@ (net 1) (uuid "72cb621b-56ee-4ce0-9927-aecb82212411") ) + (via + (at 113.5 139.95) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "72ddd39c-566b-423e-8da6-67db8a2d666d") + ) (via (at 121.6 100) (size 0.8) @@ -129854,6 +132624,15 @@ (net 1) (uuid "74c6c02f-03e6-4415-8ea8-09a70a5ba570") ) + (via + (at 112.811253 159.525) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "74fda607-d1b1-40cf-9344-d1541abc4e6b") + ) (via (at 161.225 232.511252) (size 0.8) @@ -129872,6 +132651,15 @@ (net 1) (uuid "75d5c4f6-0cf7-47da-b724-4a8eccf576a5") ) + (via + (at 113.5 170.4) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "76cfbc92-b066-4321-9ac4-3be2f3c6759a") + ) (via (at 266.95 55.5) (size 0.8) @@ -129916,6 +132704,15 @@ (net 1) (uuid "78439e61-61c5-438b-95ce-f9e0a08b2d13") ) + (via + (at 113.5 110.95) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "78b3a3bd-3a7f-42b3-b2e1-426075933fbd") + ) (via (at 184.425 232.511252) (size 0.8) @@ -129988,6 +132785,15 @@ (net 1) (uuid "7afc691f-e955-4ebd-b218-010d44ae42b6") ) + (via + (at 112.811252 111.675) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "7b6db350-dfcd-4fcf-88f9-035a05348120") + ) (via (at 125.096643 176.305057) (size 0.8) @@ -130005,6 +132811,15 @@ (net 1) (uuid "7c3a8394-367b-48a6-88b0-bc638fb795e7") ) + (via + (at 113.5 115.3) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "7c4a568f-a3f4-4f63-b813-540233900d7a") + ) (via (at 169.049999 54.8) (size 0.8) @@ -130023,6 +132838,15 @@ (net 1) (uuid "7dd0475a-2a14-4dc2-8f67-864f503498c8") ) + (via + (at 113.5 112.4) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "7df72732-ba97-483e-bd8a-d45d5675995e") + ) (via (at 170.65 233.2) (size 0.8) @@ -130236,6 +133060,15 @@ (net 1) (uuid "828040e2-aa03-4ec5-98f7-06fac1b3dd8b") ) + (via + (at 112.811252 172.575) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "8287dad3-68ba-469f-88ce-b69f89cdd282") + ) (via (at 132.2 232.5) (size 0.8) @@ -130280,6 +133113,15 @@ (net 1) (uuid "8360c9fe-79ed-40de-9a78-c00be97428c2") ) + (via + (at 113.5 164.6) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "839c8d08-0060-474d-9c87-3a2d6c5ddda9") + ) (via (at 262.825 232.511252) (size 0.8) @@ -130359,6 +133201,15 @@ (net 1) (uuid "84fcb4ee-96fc-4d0e-a529-a2c33fa01d85") ) + (via + (at 113.5 174.75) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "8535fcb7-d0b8-430b-babb-8fedd4239807") + ) (via (at 275.1 164.2) (size 0.8) @@ -130403,6 +133254,24 @@ (net 1) (uuid "86a9504c-1940-4d78-9486-9f1397b661ac") ) + (via + (at 112.811252 129.075) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "8744d190-8dd8-463d-97a6-3208425c1d15") + ) + (via + (at 112.811252 139.225) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "87d5c2ab-746a-4b94-a258-fc7961116a85") + ) (via (at 121.02 193.06) (size 0.8) @@ -130475,6 +133344,15 @@ (net 1) (uuid "88d5e803-0d03-4a17-9d17-d5f1c6a15036") ) + (via + (at 112.811252 114.575) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "89203e83-9366-4e17-9fc3-3747cc16f0a9") + ) (via (at 271.8 173.3) (size 0.8) @@ -130528,6 +133406,15 @@ (net 1) (uuid "8b061015-cc56-467c-ae62-33e88a856e91") ) + (via + (at 112.811253 195.775) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "8bf75235-f8de-4a41-bcef-492e7fa77335") + ) (via (at 122.775 233.188748) (size 0.8) @@ -130617,6 +133504,15 @@ (net 1) (uuid "8fca5f70-f0fa-4d18-bd63-d1063e7b1b33") ) + (via + (at 113.5 177.650001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "8fdcd7c2-9e64-4719-9c40-65cf40872012") + ) (via (at 252.45 55.5) (size 0.8) @@ -130668,6 +133564,15 @@ (net 1) (uuid "920e1fd0-bc82-4a09-b31b-7de450f41f55") ) + (via + (at 113.5 151.550001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "9225404b-ecee-44a8-9b70-fb24de18ac43") + ) (via (at 212.9 155.475) (size 0.8) @@ -130676,6 +133581,24 @@ (net 1) (uuid "92657205-60ee-4701-a84c-8575be1efd93") ) + (via + (at 112.811252 214.625) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "92917ff2-bb99-4627-953a-852b98621d45") + ) + (via + (at 112.811252 131.975) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "92ae04ba-0314-4fb9-b253-cebebe0b8e40") + ) (via (at 180.65 54.8) (size 0.8) @@ -130694,6 +133617,15 @@ (net 1) (uuid "93e02704-1414-419c-a23a-01bc654a64e6") ) + (via + (at 113.5 218.350001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "93e4100f-a079-4407-91e5-85bb300a4fa2") + ) (via (at 191.675 232.511252) (size 0.8) @@ -130774,6 +133706,15 @@ (net 1) (uuid "96071e34-461e-48c5-9e13-2a9dccbdd2ed") ) + (via + (at 112.811252 162.425) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "9648ddd4-8548-4606-a48d-5dbfba2c4b56") + ) (via (at 242.23 221.97) (size 0.8) @@ -130799,6 +133740,15 @@ (net 1) (uuid "97414df7-3b5a-4d89-94f4-283422355097") ) + (via + (at 113.5 154.45) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "97f94218-3e16-4906-b07f-8231c6e31ef6") + ) (via (at 219.800001 54.8) (size 0.8) @@ -130853,6 +133803,15 @@ (net 1) (uuid "996d0e80-b533-483f-bb1e-6468545b074b") ) + (via + (at 112.811252 116.025001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "9a0b528c-a857-4a90-807e-432e9e7d567d") + ) (via (at 116.15 136.04) (size 0.8) @@ -130870,6 +133829,15 @@ (net 1) (uuid "9a3b9470-b451-4cf4-99f2-0f364e7525a0") ) + (via + (at 112.811253 226.325) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "9ab6fe34-6af7-427c-a6b1-3d092352bd38") + ) (via (at 261.15 55.5) (size 0.8) @@ -130931,6 +133899,24 @@ (net 1) (uuid "9e6b0c85-8572-49c8-8718-f955451a9dea") ) + (via + (at 112.811253 124.725) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "9e7b1651-8065-4baa-8c51-a06c1abc7cf2") + ) + (via + (at 112.811252 201.575) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "9f116112-9e33-4bc1-9f6b-fcac8f396127") + ) (via (at 245.175 55.488748) (size 0.8) @@ -130940,6 +133926,24 @@ (net 1) (uuid "9f6dd95e-bffe-4e15-a27b-f742bb50003d") ) + (via + (at 112.811252 181.275) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "9fb2b8d0-33b7-4e67-b635-f5f526786ea5") + ) + (via + (at 112.811252 120.375) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "9fbad149-8829-47d3-97fd-28c406c38abd") + ) (via (at 168.475 232.511252) (size 0.8) @@ -130967,6 +133971,24 @@ (net 1) (uuid "a0d14c38-d0f1-4404-a632-e01b9c3fa55e") ) + (via + (at 112.811252 137.775) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a0d952a4-b3b3-4afe-8b99-0f9167f9d30b") + ) + (via + (at 112.811252 229.225) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a16ecd96-ce81-496e-ba23-9c46ad217632") + ) (via (at 206.75 54.8) (size 0.8) @@ -130976,6 +133998,15 @@ (net 1) (uuid "a1749832-e7ae-4d44-a8b7-47b88bea05fc") ) + (via + (at 112.811253 117.475) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a1ada848-7480-472f-84ee-7c58b106d618") + ) (via (at 167.6 124.5) (size 0.8) @@ -131002,6 +134033,42 @@ (net 1) (uuid "a2d7988e-b4b0-4907-b7e7-f6d08dc2f64c") ) + (via + (at 113.5 148.65) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a2e2a230-066a-4395-bc3e-c87da276ea17") + ) + (via + (at 112.811252 224.875) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a308095b-e173-46f9-9513-d013245b3ca5") + ) + (via + (at 112.811253 169.675) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a32f101a-69fb-4bfd-9556-3a1b5f586447") + ) + (via + (at 113.5 176.2) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a33e655a-366a-4017-9b99-530de2e717db") + ) (via (at 271.8 165.5) (size 0.8) @@ -131046,6 +134113,15 @@ (net 1) (uuid "a509504f-630d-4c6e-ad97-26c02301d303") ) + (via + (at 113.5 158.8) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a57b599a-bdf8-422b-81fb-2d1215b0b689") + ) (via (at 258.9 208.7) (size 0.8) @@ -131064,6 +134140,15 @@ (net 1) (uuid "a5caceee-1b50-4ab9-b0af-35cc6e67a6fb") ) + (via + (at 112.811253 211.725) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "a60ae0ff-e064-4292-a0ea-195c4e391206") + ) (via (at 194.425 55.488747) (size 0.8) @@ -131144,6 +134229,15 @@ (net 1) (uuid "a9e11fa9-7a2f-4b3c-b495-b938d8bc7579") ) + (via + (at 112.811252 192.875) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "aa36fc6c-2218-4b50-9535-5ebc435b3da6") + ) (via (at 177.81 136.46) (size 0.8) @@ -131249,6 +134343,15 @@ (net 1) (uuid "accba975-a02a-44e6-b5bf-af3dabc92ae1") ) + (via + (at 112.811253 213.175) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "acf01f0f-8a55-4b3b-a5be-91908f3dd2c1") + ) (via (at 271.8 166.8) (size 0.8) @@ -131258,6 +134361,15 @@ (net 1) (uuid "ad667f85-c8db-4b22-8cca-3281c56aab25") ) + (via + (at 113.5 183.45) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "af33eea8-5f18-4120-a5dd-c97aec88acbe") + ) (via (at 228.500001 54.8) (size 0.8) @@ -131267,6 +134379,24 @@ (net 1) (uuid "af45afbe-1195-4460-955d-56e805116793") ) + (via + (at 113.5 168.950001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "af55ad91-8244-4ac1-8c4c-dd128205926d") + ) + (via + (at 113.5 167.5) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "af5e6267-e1c5-440a-bd33-d8d63691c42e") + ) (via (at 138 232.5) (size 0.8) @@ -131310,6 +134440,15 @@ (net 1) (uuid "af916e73-42eb-440e-8598-b76f689b7af5") ) + (via + (at 112.811252 179.825) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "b0077268-bab8-4ca0-80a5-9e9e6a73f382") + ) (via (at 158.175 55.488748) (size 0.8) @@ -131398,6 +134537,24 @@ (net 1) (uuid "b3eb1024-8e85-4c66-b72b-18412dff8fd8") ) + (via + (at 113.5 129.8) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "b4018632-a30a-41e2-a751-451a44ece47e") + ) + (via + (at 113.5 224.15) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "b44ff574-606d-4a25-b136-3a215f4466ad") + ) (via (at 124.95 232.5) (size 0.8) @@ -131486,6 +134643,15 @@ (net 1) (uuid "b804b3db-c84b-43dc-9edd-d54312d8840e") ) + (via + (at 112.811252 158.075) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "b860ee5a-7bb6-40bf-8559-a5a7ee06e07e") + ) (via (at 274.926782 88.15) (size 0.8) @@ -131522,6 +134688,15 @@ (net 1) (uuid "b9dafc57-84b0-4d96-84c3-19bfd6e42824") ) + (via + (at 113.5 222.7) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "ba6a216f-37fe-45df-8c41-fe836caa3470") + ) (via (at 197.475 232.511252) (size 0.8) @@ -131549,6 +134724,15 @@ (net 1) (uuid "bbc10746-2a4b-4c7a-b6bb-a1273491bcd8") ) + (via + (at 112.811252 140.675) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "bc1d1bc9-1e2e-4994-95fe-e024f0f0d48e") + ) (via (at 237.35 233.2) (size 0.8) @@ -131558,6 +134742,15 @@ (net 1) (uuid "bc55e8b6-e68b-46a4-8bdd-4d3b37267ca1") ) + (via + (at 113.5 195.050001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "bc590d19-0301-4ac6-87db-68b2bc99368b") + ) (via (at 235.97 69.88) (size 0.8) @@ -131601,7 +134794,7 @@ (uuid "bd7744cb-2d48-416f-98dc-536cefc2a7e6") ) (via - (at 127.01 221.61) + (at 129.1 224.5) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -131733,6 +134926,15 @@ (net 1) (uuid "c079d8d0-943c-44e4-bb56-d437452a2a29") ) + (via + (at 112.811252 121.825) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c0cece4d-d6b8-45c4-ae0d-b9752d687508") + ) (via (at 217.16 70.37) (size 0.8) @@ -131750,6 +134952,42 @@ (net 1) (uuid "c0f90ce3-baf6-4aa5-b318-c43b8763ad31") ) + (via + (at 112.811252 205.925) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c12f0602-bfa9-4143-be57-af76b2fa46bb") + ) + (via + (at 113.5 184.9) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c18f99b8-a43d-4d18-be3b-672b0ab5fd5d") + ) + (via + (at 113.5 202.3) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c18fea5a-bb91-4940-8fa9-fc634931dfea") + ) + (via + (at 113.5 138.5) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c1c5fb28-f418-49e0-8f56-252fcb26483b") + ) (via (at 260.65 233.2) (size 0.8) @@ -131786,6 +135024,24 @@ (net 1) (uuid "c2cdcfc0-4fa2-4ba1-b889-a5c37565ac1c") ) + (via + (at 112.811253 150.825) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c2ee67a7-f417-47f5-a0f5-7d8d91514fc8") + ) + (via + (at 112.811252 110.225) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c2fff3b9-d89c-4f32-83db-7541ba9917fe") + ) (via (at 232.85 54.8) (size 0.8) @@ -131848,6 +135104,15 @@ (net 1) (uuid "c407394e-54a8-4497-835b-5541ffcf77cd") ) + (via + (at 112.811253 187.075) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c4686eb3-53c9-4bfe-abfe-e6d0209a5a86") + ) (via (at 271 82.7) (size 0.8) @@ -131918,6 +135183,15 @@ (net 1) (uuid "c5eec6bd-161e-42e3-a842-f09a0e7bfd64") ) + (via + (at 113.5 219.8) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c60c6573-28d9-4b9b-b18f-ffef60950555") + ) (via (at 140.9 232.5) (size 0.8) @@ -131944,6 +135218,15 @@ (net 1) (uuid "c7562e20-83a4-46e2-8852-9095f13456c1") ) + (via + (at 112.811253 227.775) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c7677520-b8ca-4f7c-9a19-7b304485795f") + ) (via (at 214.875 232.511252) (size 0.8) @@ -131980,6 +135263,15 @@ (net 1) (uuid "c84eb5be-aa39-4c51-99e3-fff798a835ef") ) + (via + (at 112.811252 220.525) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c8855fa0-44ef-446d-9f37-83742e8b8508") + ) (via (at 252.8 165.5) (size 0.8) @@ -131989,6 +135281,15 @@ (net 1) (uuid "c90904ba-4aac-4d9d-9f1e-91a6ba5eab73") ) + (via + (at 112.811253 152.275) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "c961b88e-06b8-4c85-917a-ec72f89b93ce") + ) (via (at 204.725 232.511252) (size 0.8) @@ -132070,6 +135371,15 @@ (net 1) (uuid "cd1cb987-7a4f-40ba-b6d7-ac1393a9166f") ) + (via + (at 113.5 118.199999) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "cda5afec-bfc0-43ce-b12e-24cf0e93f208") + ) (via (at 176.45 233.2) (size 0.8) @@ -132176,6 +135486,15 @@ (net 1) (uuid "d04ed2c2-13c0-4ed7-a248-9696b66bb62d") ) + (via + (at 113.5 122.55) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "d0561941-46e6-46f4-b604-c92abf2ee022") + ) (via (at 163.975 55.488748) (size 0.8) @@ -132239,6 +135558,15 @@ (net 1) (uuid "d1e42adc-af84-41e4-a189-fd86f25f5180") ) + (via + (at 113.5 163.15) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "d2475adb-83a1-4c07-a96d-dc4730c501a1") + ) (via (at 190.95 233.2) (size 0.8) @@ -132292,6 +135620,15 @@ (net 1) (uuid "d3b084e8-e492-43c3-9815-f828771c5127") ) + (via + (at 113.5 227.050001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "d40ff104-ab1c-4457-9298-2a89fd9701ab") + ) (via (at 153.975 232.511252) (size 0.8) @@ -132337,6 +135674,15 @@ (net 1) (uuid "d7cdee63-4773-4952-b97e-28512afb8885") ) + (via + (at 112.811252 136.325) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "d7d11ddb-08b9-4871-b619-67f60aa49a19") + ) (via (at 204 233.2) (size 0.8) @@ -132450,6 +135796,15 @@ (net 1) (uuid "dad50d51-63ca-4a47-aa66-20b35865f7e0") ) + (via + (at 112.811252 223.425) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "dae45cdf-22c3-4ef9-80d7-eba9c5058773") + ) (via (at 140.7 79.75) (size 0.8) @@ -132529,6 +135884,15 @@ (net 1) (uuid "ddfbc105-f23d-4a45-82ec-f6bfb7701de4") ) + (via + (at 112.811253 176.925) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "de29b9c8-ffe1-4660-ab4a-379dd1a169ef") + ) (via (at 179.35 233.2) (size 0.8) @@ -132556,6 +135920,15 @@ (net 1) (uuid "deed4d8a-f335-4dc9-882c-a202a0073b82") ) + (via + (at 112.811252 182.725) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "df063c04-f3c8-4ec9-aa20-0b65bbab508d") + ) (via (at 113.4 61.1) (size 0.8) @@ -132565,6 +135938,15 @@ (net 1) (uuid "df107b08-8d9c-44c6-9213-f01d777ef9bc") ) + (via + (at 112.811252 175.475) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "df321bb5-293d-4e60-9557-6383185d9b6f") + ) (via (at 132.19 198.7) (size 0.8) @@ -132583,6 +135965,15 @@ (net 1) (uuid "df82969f-ca84-468d-a014-763796fa22bc") ) + (via + (at 113.5 193.6) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e07ca8a6-be2f-40ca-9aa8-a7581fe3c352") + ) (via (at 137.41 194.86) (size 0.8) @@ -132619,6 +136010,15 @@ (net 1) (uuid "e1587040-0463-468f-a7ea-3fab36823a33") ) + (via + (at 113.5 221.25) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e1af3e31-9e95-4ba3-893c-70c2f91aef23") + ) (via (at 142 80.2) (size 0.8) @@ -132637,6 +136037,15 @@ (net 1) (uuid "e1d78bf1-d239-4b0d-ae80-d726da0c8729") ) + (via + (at 112.811253 204.475) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e1f45c6a-9482-491c-9877-846dd09ccbd8") + ) (via (at 125 61.1) (size 0.8) @@ -132717,6 +136126,15 @@ (net 1) (uuid "e4d8cffd-014f-4fea-8d52-52717c59f251") ) + (via + (at 112.811253 178.375) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e51227cb-a9a8-4e53-b609-0a383af2308a") + ) (via (at 126.3 63.8) (size 0.8) @@ -132744,6 +136162,15 @@ (net 1) (uuid "e5e2ac5d-8fd0-4d0e-8067-272679d9dec9") ) + (via + (at 113.5 212.449999) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e5ea74c2-0c7f-4c89-84fd-27d69d7f997e") + ) (via (at 226.325 55.488748) (size 0.8) @@ -132753,6 +136180,15 @@ (net 1) (uuid "e61f5c5b-b44d-49f7-b944-b2990977bd7c") ) + (via + (at 112.811252 155.175) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e638e636-6711-4123-aebc-f942111229ef") + ) (via (at 269.85 55.5) (size 0.8) @@ -132770,6 +136206,15 @@ (net 1) (uuid "e7308981-dc53-4ad2-bae7-52572eb855ec") ) + (via + (at 113.5 121.1) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e75ce08c-5f8f-462e-b0fb-44e59895a3ec") + ) (via (at 195.875 55.488747) (size 0.8) @@ -132822,6 +136267,15 @@ (net 1) (uuid "e8d42e86-7fd8-4af3-9520-8136c608f21c") ) + (via + (at 113.5 180.55) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e8e6d46f-f543-4f90-84bd-8af11b399ce8") + ) (via (at 133.43 199.4) (size 0.8) @@ -132831,6 +136285,24 @@ (net 1) (uuid "e97b8b1d-01a5-4678-b52b-f1868088d095") ) + (via + (at 113.5 113.85) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e9a52ecd-09a1-4ced-9b50-a9da3d7effc1") + ) + (via + (at 113.404485 205.157028) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "e9b056a9-997a-4f2e-bfde-ba50340d5e34") + ) (via (at 247.03 62.725) (size 0.8) @@ -132892,6 +136364,15 @@ (net 1) (uuid "eb3e9d00-9217-4fd4-91a7-d989feb24cb6") ) + (via + (at 113.5 229.95) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "eb9012cd-c879-452f-9b64-b2e4d0e9f4bb") + ) (via (at 234.3 54.8) (size 0.8) @@ -132935,6 +136416,15 @@ (net 1) (uuid "ed0661c0-ad6e-43b0-9b23-f1e5552565cf") ) + (via + (at 112.811252 156.625) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "ed8a95cd-b476-4562-801a-cc503ca45bdf") + ) (via (at 164.65 57.9) (size 0.8) @@ -132971,6 +136461,15 @@ (net 1) (uuid "ee5b8722-a9e1-4976-8201-1f4324a484f6") ) + (via + (at 113.5 116.750001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "eed15f0f-76d5-4d0d-9ad9-02a4a34f6c6c") + ) (via (at 199.5 54.8) (size 0.8) @@ -132999,12 +136498,13 @@ (uuid "ef5f773b-bcb9-4b8f-9053-93aa347a29b9") ) (via - (at 113.6 119.2) + (at 112.811253 203.025) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") + (free yes) (net 1) - (uuid "ef83669c-b363-4a86-895b-a9b46241cf43") + (uuid "ef8e067d-d85c-455c-9360-82545ac78866") ) (via (at 173.4 54.8) @@ -133042,6 +136542,15 @@ (net 1) (uuid "f148de4b-d356-45d8-9d09-48d516c18298") ) + (via + (at 113.5 186.350001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "f1b87d60-74f4-41b4-a28d-37e89f55f8ed") + ) (via (at 121.096643 164.655057) (size 0.8) @@ -133075,6 +136584,15 @@ (net 1) (uuid "f31ec9bd-b51c-48a8-a4b6-fffc198e3988") ) + (via + (at 112.811252 208.825) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "f34b5b6f-c350-4c7f-bd56-def7b7263e32") + ) (via (at 140.175 233.188748) (size 0.8) @@ -133102,6 +136620,15 @@ (net 1) (uuid "f3dc8e63-a95d-423b-81e9-5b83888869c5") ) + (via + (at 112.811252 200.125) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "f5036609-5346-4a50-8d3b-e9ee47c790c3") + ) (via (at 135.7 54.8) (size 0.8) @@ -133111,6 +136638,15 @@ (net 1) (uuid "f5b12b7b-9a04-4118-ae56-53b09db150c4") ) + (via + (at 113.5 160.250001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "f5dfe0a0-b787-4ce1-aab9-5575d79cbdab") + ) (via (at 219.95 233.2) (size 0.8) @@ -133138,6 +136674,15 @@ (net 1) (uuid "f625b0ab-b728-4cb3-ad53-31aafb32dddc") ) + (via + (at 113.5 125.450001) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "f76d94f4-5816-419e-b114-5889bbf66c4d") + ) (via (at 137.275 233.188748) (size 0.8) @@ -133165,6 +136710,15 @@ (net 1) (uuid "f83461aa-64ff-4965-8fb5-d91c354c2d1f") ) + (via + (at 112.811252 210.275) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "f83a5414-326c-4dd3-b9e8-7646c52441b1") + ) (via (at 274.4 82.7) (size 0.8) @@ -133278,6 +136832,15 @@ (net 1) (uuid "fc8376fc-4851-4f15-afb6-b9798daeeefd") ) + (via + (at 112.811253 219.075) + (size 0.8) + (drill 0.4) + (layers "F.Cu" "B.Cu") + (free yes) + (net 1) + (uuid "fde788f7-c76d-410e-967c-0610c6fd8340") + ) (via (at 140.06 89.97) (size 0.8) @@ -133390,6 +136953,22 @@ (net 2) (uuid "05f03fcf-bac7-425c-98e8-9c92f3cb4c9b") ) + (segment + (start 135.3 145.4) + (end 134.9 145) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "06bd3782-ef1d-4209-b2ea-0cca8792ed39") + ) + (segment + (start 134.95 144.95) + (end 135.1 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "086d9907-4433-4179-bd3e-0e54d331ba82") + ) (segment (start 199.75 99.75) (end 201.199997 101.199997) @@ -133422,6 +137001,14 @@ (net 2) (uuid "0ef4e814-ca6b-4872-9f03-ae28f9cebf8e") ) + (segment + (start 135.3 145) + (end 135.3 145.4) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "0fc108cd-c842-4b94-be9e-ed94a6877607") + ) (segment (start 236.154998 59.275001) (end 236.299999 59.13) @@ -133447,12 +137034,28 @@ (uuid "1add38db-81e2-4e5e-abca-f07b31a48fdc") ) (segment - (start 126.6 144.8) - (end 135.5 144.8) + (start 134.95 145.05) + (end 134.95 144.95) (width 0.25) (layer "F.Cu") (net 2) - (uuid "1d2cecf9-a3ee-4730-a65e-213869b419ed") + (uuid "1bc6f1bd-42dc-4622-97dd-ec36e1f13f38") + ) + (segment + (start 135.7 145.3) + (end 135.75 145.35) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "1c904f84-5208-49bd-954b-c82e0fcb9e4d") + ) + (segment + (start 134.9 145) + (end 134.7 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "1d310394-e01a-4249-a2f4-6231afd1dab0") ) (segment (start 195.931297 145.882997) @@ -133462,6 +137065,14 @@ (net 2) (uuid "1de6e3c8-9f90-497b-9f9a-cca94e996d07") ) + (segment + (start 135.75 145.05) + (end 136 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "2194b323-b7ad-46dd-8375-ad850309fc22") + ) (segment (start 139.6 157.6) (end 164.699992 157.6) @@ -133470,6 +137081,14 @@ (net 2) (uuid "245e732d-7624-4fa6-aff0-de59252b0660") ) + (segment + (start 134.7 144.8) + (end 134.6 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "257d329e-3918-4619-adb1-cea96f10198e") + ) (segment (start 156.74 68.065) (end 157.865 68.065) @@ -133486,6 +137105,14 @@ (net 2) (uuid "28d9d02c-6d1d-46aa-8978-7c4b0eea53f0") ) + (segment + (start 135.1 144.8) + (end 135.3 145) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "2944a7e1-884f-4cd9-a243-5bd862182970") + ) (segment (start 188.138 57.17) (end 188.283001 57.025) @@ -133534,6 +137161,14 @@ (net 2) (uuid "2dd99f66-e822-4655-89db-c210de994780") ) + (segment + (start 136.8 144.8) + (end 144.8 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "319f8a0c-fad1-45c6-8175-e5ec702ba10c") + ) (segment (start 129.37 115.375) (end 133.7 115.375) @@ -133566,6 +137201,14 @@ (net 2) (uuid "376d248b-dc6a-4ab1-81f0-48e83497ee6f") ) + (segment + (start 134.9 145) + (end 135 145.1) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "389ca1f9-48c6-4931-992d-8437d471d444") + ) (segment (start 234.607 60.093) (end 233.5 61.2) @@ -133574,6 +137217,14 @@ (net 2) (uuid "39e43eef-6b63-4079-9a59-b5fb6eea271e") ) + (segment + (start 136.3 144.8) + (end 136.8 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "3b1431f1-6a3a-475c-a372-7ae5c4de3aed") + ) (segment (start 164.295 93.825) (end 164.25 93.87) @@ -133582,6 +137233,14 @@ (net 2) (uuid "3b3e3348-a660-48c3-8cfa-a73ff026ea7c") ) + (segment + (start 134.6 144.8) + (end 135.1 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "3dc923b0-2a27-44d1-9776-be3938fff0f1") + ) (segment (start 252.475 59.969999) (end 250.705001 58.2) @@ -133598,6 +137257,14 @@ (net 2) (uuid "43b43611-dbd8-42a0-9b73-d21a8c7d5835") ) + (segment + (start 135.5 144.8) + (end 135.6 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "4c5bf5a2-c50b-4f9b-85c3-85fb43be1727") + ) (segment (start 220.600008 226) (end 225.100008 230.5) @@ -133607,12 +137274,12 @@ (uuid "4d4766b5-d716-47f5-9fa2-f8643d56048f") ) (segment - (start 155.805 195.899999) - (end 155.805 188.535) + (start 135.5 144.8) + (end 135.5 145.3) (width 0.25) (layer "F.Cu") (net 2) - (uuid "54166a6c-b2fc-413b-bc25-4ffc86e93c0f") + (uuid "5166cb41-9f7a-423f-8708-fe3759812f74") ) (segment (start 214.883 228.025) @@ -133686,6 +137353,14 @@ (net 2) (uuid "6714339a-58f9-4fbd-815c-3676fdfd665f") ) + (segment + (start 135.75 144.95) + (end 135.6 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "6d5e4757-f943-4a67-b11b-5bd5af30ff88") + ) (segment (start 145.465 142.575) (end 145.61 142.43) @@ -133710,6 +137385,14 @@ (net 2) (uuid "6e60fe5a-a25b-44fd-a6b9-1f9a570364b4") ) + (segment + (start 136 144.8) + (end 136.8 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "6f6dce80-ff0d-492b-a789-b7370e7471c1") + ) (segment (start 205.69414 67.79414) (end 204.2 66.3) @@ -133734,6 +137417,14 @@ (net 2) (uuid "72414f5e-0622-4414-bbd2-07d50d82da44") ) + (segment + (start 135.75 145.35) + (end 136.05 145.05) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "745ef1c5-3913-4f66-874a-3dcb99cb3e11") + ) (segment (start 247.950001 226.049999) (end 245.5 228.5) @@ -133742,6 +137433,14 @@ (net 2) (uuid "74fd7b8a-f55a-4bff-8a18-1749f089cd21") ) + (segment + (start 134.95 145.05) + (end 135.75 145.05) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "77c42a31-f243-45a0-86af-df2aadd0455e") + ) (segment (start 126.913001 142.430001) (end 125.354999 142.430001) @@ -133830,6 +137529,14 @@ (net 2) (uuid "9aed6f54-e879-471e-a7e9-002be11147b6") ) + (segment + (start 126.6 144.8) + (end 134.6 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "9b41b908-696b-4a40-a2fe-0b5e392e83f5") + ) (segment (start 130.035 195.96) (end 130.035 189.77) @@ -133879,12 +137586,12 @@ (uuid "adf1a029-2fb1-4f7e-b959-d684a8acf129") ) (segment - (start 155.805 188.535) - (end 155.83 188.51) + (start 136.05 145.05) + (end 136.3 144.8) (width 0.25) (layer "F.Cu") (net 2) - (uuid "afe495bc-3dff-4679-807c-beac40df20e5") + (uuid "b03f599c-249c-4a95-940e-a595cfcc7e66") ) (segment (start 189.045 198.115) @@ -133894,6 +137601,14 @@ (net 2) (uuid "b095ee68-cb83-4b09-91ce-943335c5c391") ) + (segment + (start 135.5 145.3) + (end 135.7 145.3) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "b269a980-2f93-41fa-b069-eb427daf5aa8") + ) (segment (start 214.737999 228.17) (end 214.883 228.024999) @@ -133926,6 +137641,14 @@ (net 2) (uuid "b90c4911-c47c-4e96-9280-5a159eaec590") ) + (segment + (start 135.5 145.6) + (end 135.3 145.4) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "bad26e68-62e3-48df-bdca-fa78e2e04b24") + ) (segment (start 186.59 57.17) (end 188.138 57.17) @@ -133934,6 +137657,22 @@ (net 2) (uuid "bb019389-dbda-41cf-acdc-88223beaf16e") ) + (segment + (start 135.6 144.8) + (end 136 144.8) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "bb2027fe-17b8-48d1-810e-d438dd851a54") + ) + (segment + (start 155.805 195.899999) + (end 155.805 191.7) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "bba1d108-a301-46ed-add1-4508ed8e78b2") + ) (segment (start 124.88 74.645) (end 126.205 74.645) @@ -133942,14 +137681,6 @@ (net 2) (uuid "ca6ea634-f8d2-4008-8d93-7f8bf2197bc6") ) - (segment - (start 135.5 144.8) - (end 144.8 144.8) - (width 0.25) - (layer "F.Cu") - (net 2) - (uuid "cc522e6a-0d82-4abe-828f-00b8c57777e6") - ) (segment (start 204.425 140.305) (end 204.285 140.165) @@ -133990,6 +137721,22 @@ (net 2) (uuid "da9f9f36-883c-4046-a328-062a9f0a2c77") ) + (segment + (start 135.75 145.35) + (end 135.75 144.95) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "db94ebd1-5a6d-42ba-b873-2500537e6b91") + ) + (segment + (start 135.5 145.3) + (end 135.5 145.6) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "dcbb90ab-256d-4b87-88b0-4e11140a9c9a") + ) (segment (start 197.354288 56.225) (end 204.2 63.070712) @@ -133998,6 +137745,30 @@ (net 2) (uuid "ded97773-d10c-4fe6-9cad-94878186e548") ) + (segment + (start 136 145.1) + (end 136.05 145.05) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "e0bf6118-4762-4e48-b82d-2d899bbe5a7c") + ) + (segment + (start 134.9 145) + (end 134.95 145.05) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "e1a56929-8a6e-4272-95fb-029ac13a7365") + ) + (segment + (start 135.5 145.6) + (end 135.5 153.5) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "e205be3e-e587-4765-befd-5c564c0648b0") + ) (segment (start 144.8 144.8) (end 143.917 143.917) @@ -134015,12 +137786,12 @@ (uuid "ea9c7af2-3584-42d4-802f-0589e471a624") ) (segment - (start 135.5 144.8) - (end 135.5 153.5) + (start 135.1 144.8) + (end 135.5 144.8) (width 0.25) (layer "F.Cu") (net 2) - (uuid "eccc04a7-7bdc-4dd9-84b2-0507309f6abf") + (uuid "ed08876e-4348-497f-9363-91fba8a11d2a") ) (segment (start 187.038546 151.189754) @@ -134038,6 +137809,14 @@ (net 2) (uuid "ee417fb8-5b17-4197-8600-5e556a29fcea") ) + (segment + (start 135 145.1) + (end 136 145.1) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "ee8223a1-c9dc-46a1-82fa-f4e8f9150cf1") + ) (segment (start 122.051642 170.940057) (end 122.026642 170.965056) @@ -134086,6 +137865,14 @@ (net 2) (uuid "ff64b076-fde7-4e53-bcf8-2279fa58b539") ) + (segment + (start 135.5 145.6) + (end 135.75 145.35) + (width 0.25) + (layer "F.Cu") + (net 2) + (uuid "ffc13742-2c7b-445e-b27e-470be709c3bc") + ) (via (at 185.6 132.4) (size 0.8) @@ -134268,7 +138055,7 @@ (uuid "38545b82-2dd2-43bc-8557-e54185155dc2") ) (via - (at 155.83 188.51) + (at 155.805 191.7) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -134674,7 +138461,7 @@ (uuid "a4a2b729-31fc-4275-9a65-99b48574f6ba") ) (via - (at 188.45 153.65) + (at 188.4 153.65) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -134953,7 +138740,7 @@ (uuid "f8e62943-8768-4e31-9a03-ef52993754d0") ) (via - (at 188.4 155.3) + (at 188.399998 155.3) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -135069,22 +138856,6 @@ (net 2) (uuid "1ae6f1f1-bedd-45aa-91f8-d198f608cf11") ) - (segment - (start 155.83 188.51) - (end 157.39 186.95) - (width 0.25) - (layer "B.Cu") - (net 2) - (uuid "1b36dadc-4f8a-4ca2-a85c-066661e91024") - ) - (segment - (start 157.39 186.95) - (end 181.21 186.95) - (width 0.25) - (layer "B.Cu") - (net 2) - (uuid "1f9d6191-0792-492b-a829-3e527800ab9c") - ) (segment (start 130.035 189.77) (end 133.535 186.27) @@ -135093,6 +138864,14 @@ (net 2) (uuid "25ab4268-dc5c-4103-ad66-3a255d2b5f4e") ) + (segment + (start 162.505 198.4) + (end 155.805 191.7) + (width 0.25) + (layer "B.Cu") + (net 2) + (uuid "2d19e2ae-feb4-4cad-a75b-d6a827b58bad") + ) (segment (start 133.535 186.27) (end 146 186.27) @@ -135141,14 +138920,6 @@ (net 2) (uuid "404bedba-3a0c-4e44-b7c0-2e95e78ec42a") ) - (segment - (start 161.4 194.7) - (end 165.1 198.4) - (width 0.25) - (layer "B.Cu") - (net 2) - (uuid "48f58744-86b9-447b-9406-e56ef514d7b0") - ) (segment (start 157.78 102.38) (end 156.085 100.685) @@ -135213,14 +138984,6 @@ (net 2) (uuid "663fd417-19cf-4cac-a470-a5737c1aaacc") ) - (segment - (start 155.83 188.51) - (end 155.83 191.119418) - (width 0.25) - (layer "B.Cu") - (net 2) - (uuid "7234172c-8604-4a65-b5c4-5ff780fc7881") - ) (segment (start 194.062314 123.660425) (end 201.199997 116.522742) @@ -135229,6 +138992,14 @@ (net 2) (uuid "74b911f1-cf05-4bd6-87af-afbaeec7b1a4") ) + (segment + (start 165.1 187.95) + (end 166.1 186.95) + (width 0.25) + (layer "B.Cu") + (net 2) + (uuid "774293a5-edd7-42fb-a323-f22caa1bf021") + ) (segment (start 157.865 68.065) (end 157.865 95.005582) @@ -135405,14 +139176,6 @@ (net 2) (uuid "b446c025-6d8f-45b8-935d-e8b18ce343f3") ) - (segment - (start 159.410582 194.7) - (end 161.4 194.7) - (width 0.25) - (layer "B.Cu") - (net 2) - (uuid "b6249af4-6261-4b48-a6a4-5b0672eb7307") - ) (segment (start 189.06 180.08) (end 197.76 171.38) @@ -135421,6 +139184,14 @@ (net 2) (uuid "bbc80e89-704e-47c4-80d0-70105e7b811f") ) + (segment + (start 165.1 198.4) + (end 162.505 198.4) + (width 0.25) + (layer "B.Cu") + (net 2) + (uuid "bdb615e3-3d4c-41bb-b538-7e5f7bbe0ff6") + ) (segment (start 141.043198 115.375) (end 161.518198 135.85) @@ -135437,6 +139208,14 @@ (net 2) (uuid "cdad9f70-b603-4e3a-8756-f1d2e327cf58") ) + (segment + (start 165.1 198.4) + (end 165.1 187.95) + (width 0.25) + (layer "B.Cu") + (net 2) + (uuid "ce288e29-f4e9-4653-b300-faf0517266d6") + ) (segment (start 161.518198 135.85) (end 164.73 135.85) @@ -135501,14 +139280,6 @@ (net 2) (uuid "e7d7d4c4-fb2e-4170-b018-891bf4b80860") ) - (segment - (start 155.83 191.119418) - (end 159.410582 194.7) - (width 0.25) - (layer "B.Cu") - (net 2) - (uuid "eba2fd4a-0d62-4ff2-b785-42f07819b42d") - ) (segment (start 232.015 222.385) (end 232.015 223.585008) @@ -135541,6 +139312,14 @@ (net 2) (uuid "f438fdce-a1e3-4045-a7ea-7043f1230430") ) + (segment + (start 166.1 186.95) + (end 181.21 186.95) + (width 0.25) + (layer "B.Cu") + (net 2) + (uuid "f5a18435-e75c-4f82-93c0-840cd1ed9914") + ) (segment (start 136.97 78.36) (end 136.97 83.11) @@ -137446,20 +141225,12 @@ (uuid "fe2a0dba-6961-4db9-a029-66c66cc73f33") ) (segment - (start 129.4 142.9) - (end 136.6 142.9) + (start 119.4 152.9) + (end 129.4 142.9) (width 0.25) (layer "B.Cu") (net 29) - (uuid "2014f1f3-a3e2-4642-b7cb-a5df7db2ef21") - ) - (segment - (start 119.9 172.4) - (end 118.8 171.3) - (width 0.25) - (layer "B.Cu") - (net 29) - (uuid "52f712ab-d445-4a7f-beb5-5115a011636e") + (uuid "4484070a-b9e6-42e5-b1a1-43fece703d55") ) (segment (start 136.6 142.9) @@ -137467,31 +141238,31 @@ (width 0.25) (layer "B.Cu") (net 29) - (uuid "78e99cbb-5c79-4e84-94ef-0a5fcfe4b8cd") + (uuid "95698921-056e-40fd-a8de-9c6a27e021f1") ) (segment - (start 118.8 153.5) - (end 129.4 142.9) + (start 129.4 142.9) + (end 136.6 142.9) (width 0.25) (layer "B.Cu") (net 29) - (uuid "7df1b5fb-d7d4-4cd4-be6c-6d2dff634873") + (uuid "b871df1e-428e-4684-b2af-1dfa081813b1") ) (segment - (start 118.8 171.3) - (end 118.8 153.5) + (start 119.4 171.2) + (end 119.4 152.9) (width 0.25) (layer "B.Cu") (net 29) - (uuid "e6c6f5a6-19c1-43ea-b0e5-0df5b37515af") + (uuid "b8ccc16e-432a-43f1-8806-534f8252e146") ) (segment (start 120.6 172.4) - (end 119.9 172.4) + (end 119.4 171.2) (width 0.25) (layer "B.Cu") (net 29) - (uuid "fe08128a-e658-4e83-9a0a-ffffbacbd764") + (uuid "e8e93481-2aa7-4df4-a6d2-c62eebdd591b") ) (segment (start 255.68 202.063604) @@ -138086,7 +141857,7 @@ (uuid "c8958859-3fd6-4eb1-b08d-2e6679919753") ) (via - (at 113.93 204.89) + (at 117.1 206) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -138101,29 +141872,29 @@ (net 39) (uuid "edfc6e9b-3153-4d57-9de7-c2f350667132") ) - (segment - (start 115.55 204.89) - (end 113.93 204.89) - (width 0.25) - (layer "B.Cu") - (net 39) - (uuid "45d84919-cae3-4aa7-8c9a-e0e11814c732") - ) (segment (start 129.61 190.83) - (end 115.55 204.89) + (end 130.83 190.83) (width 0.25) (layer "B.Cu") (net 39) - (uuid "ba02165e-6792-47c0-8047-a2f3362ff597") + (uuid "14b0c9ab-a537-404e-9baf-a7b6a6076e00") ) (segment - (start 130.83 190.83) + (start 117.1 203.34) (end 129.61 190.83) (width 0.25) (layer "B.Cu") (net 39) - (uuid "bb5185f9-9b6a-4d7a-8557-cb9bad674ce5") + (uuid "27772631-bea4-4688-a2c0-bc4c23f33b50") + ) + (segment + (start 117.1 206) + (end 117.1 203.34) + (width 0.25) + (layer "B.Cu") + (net 39) + (uuid "cd4f0326-e212-4ddb-9d21-b0f2752c5858") ) (segment (start 226.7 219.215) @@ -139749,6 +143520,14 @@ (net 81) (uuid "b1f1b926-346d-4d90-a891-e1903ffaca58") ) + (segment + (start 114.0575 107.795) + (end 114.0575 108.4025) + (width 0.25) + (layer "F.Cu") + (net 83) + (uuid "675bb912-b0c3-4cb0-afc3-602f5405cedf") + ) (segment (start 137.91 88.685) (end 138.16 88.435) @@ -139766,23 +143545,15 @@ (uuid "6fc30c45-e150-4438-a1c5-a49d1b1f1215") ) (segment - (start 113.46 108.3925) - (end 114.0575 107.795) + (start 114.0575 108.4025) + (end 113.46 109) (width 0.25) (layer "F.Cu") (net 83) - (uuid "99b176b8-f5f1-40fc-a3c7-c6e23d287036") - ) - (segment - (start 113.46 109.31) - (end 113.46 108.3925) - (width 0.25) - (layer "F.Cu") - (net 83) - (uuid "c1fd81e9-0514-48a1-8484-5a3fb74cfaec") + (uuid "922f7ef7-d60d-4ee7-8459-4f6a96d60fd1") ) (via - (at 113.46 109.31) + (at 113.46 109) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -139798,20 +143569,20 @@ (uuid "79b27a03-da5c-4845-aef8-4918b250d8a8") ) (segment - (start 118.42 109.31) - (end 137.91 89.82) + (start 118.73 109) + (end 113.46 109) (width 0.25) (layer "B.Cu") (net 83) - (uuid "b0d00d4e-3b97-4586-9093-c939a04d7759") + (uuid "247818fd-3070-43fa-a6cc-4c6e1bb795c2") ) (segment - (start 113.46 109.31) - (end 118.42 109.31) + (start 137.91 89.82) + (end 118.73 109) (width 0.25) (layer "B.Cu") (net 83) - (uuid "db4464e6-b58a-4fe9-92ba-13b0f7cf9d73") + (uuid "518b30e7-3d05-442d-addc-67601d195192") ) (segment (start 126.099143 167.170059) @@ -140758,20 +144529,28 @@ (uuid "ad48998e-76f5-4d79-a824-a85b2f8b0f4d") ) (segment - (start 170.75 225.3642) - (end 170.75 224.0642) + (start 170.1642 225.3642) + (end 168.9 224.1) (width 0.3) (layer "B.Cu") (net 91) - (uuid "2dbb56be-d774-41c8-8480-ac24c1f982d3") + (uuid "0d7e4fcb-b73a-426f-948e-215e959230ea") ) (segment - (start 148.3 189.8) - (end 148.3 187.1) + (start 119.2 180.3) + (end 117.3 178.4) (width 0.3) (layer "B.Cu") (net 91) - (uuid "41aa322f-fc5d-41da-a13e-a8e10fa43b1c") + (uuid "21181834-41f7-4a55-b620-b6f0cd3ba81b") + ) + (segment + (start 151.6 193.1) + (end 148.3 189.8) + (width 0.3) + (layer "B.Cu") + (net 91) + (uuid "26e34814-3138-459c-9583-9d933283a499") ) (segment (start 148.3 187.1) @@ -140779,7 +144558,7 @@ (width 0.3) (layer "B.Cu") (net 91) - (uuid "4ad04f84-5e9e-477e-81a3-38ca5d79bf42") + (uuid "31911a52-2732-4a3e-a8d5-ce6a4742ec5e") ) (segment (start 126.41 128.49) @@ -140790,12 +144569,28 @@ (uuid "5e26f467-6dd7-48e9-bcec-8796e3d15b77") ) (segment - (start 141.5 180.3) - (end 119.2 180.3) + (start 153.4 193.1) + (end 151.6 193.1) (width 0.3) (layer "B.Cu") (net 91) - (uuid "61911d25-756f-4d04-b11a-c2151e603727") + (uuid "681da02a-c091-4342-90d1-6975199bd51c") + ) + (segment + (start 168.9 218.2) + (end 155.3 204.6) + (width 0.3) + (layer "B.Cu") + (net 91) + (uuid "69bdf1af-93a4-48e9-8401-8db5205c98e5") + ) + (segment + (start 155.3 204.6) + (end 155.3 195) + (width 0.3) + (layer "B.Cu") + (net 91) + (uuid "71ff6879-b229-4a51-94d6-a1eca301150b") ) (segment (start 121.125 145.375) @@ -140803,15 +144598,15 @@ (width 0.3) (layer "B.Cu") (net 91) - (uuid "6f6c84e8-e6ec-4482-8d3f-3da510686643") + (uuid "7d584166-9d03-4452-a1e7-a131ecd91fd6") ) (segment - (start 170.75 224.0642) - (end 155.3 208.6142) + (start 170.75 225.3642) + (end 170.1642 225.3642) (width 0.3) (layer "B.Cu") (net 91) - (uuid "76939472-d4f0-45de-b828-7e6675726df7") + (uuid "882728c0-8c78-4028-9a1c-71b3cefbea40") ) (segment (start 117.3 149.2) @@ -140819,31 +144614,7 @@ (width 0.3) (layer "B.Cu") (net 91) - (uuid "7fae55ad-4cb7-46ea-b313-5b8f204518e9") - ) - (segment - (start 119.2 180.3) - (end 117.3 178.4) - (width 0.3) - (layer "B.Cu") - (net 91) - (uuid "80208106-b180-45d8-b4b7-db05c98fa51e") - ) - (segment - (start 155.3 208.6142) - (end 155.3 195) - (width 0.3) - (layer "B.Cu") - (net 91) - (uuid "bf6633f2-fd08-4514-9e9f-c87762844117") - ) - (segment - (start 151.6 193.1) - (end 148.3 189.8) - (width 0.3) - (layer "B.Cu") - (net 91) - (uuid "c3b6c3ce-fb59-4bdb-b405-19b483009a15") + (uuid "8e3398a7-4869-4c6c-b5cf-9db4e33a3fcd") ) (segment (start 121.125 133.671052) @@ -140851,23 +144622,23 @@ (width 0.3) (layer "B.Cu") (net 91) - (uuid "c49eeaa1-689d-46c1-b584-6da0a1bffcac") + (uuid "90746772-36b9-4af3-b6db-befad466c288") ) (segment - (start 153.4 193.1) - (end 151.6 193.1) + (start 141.5 180.3) + (end 119.2 180.3) (width 0.3) (layer "B.Cu") (net 91) - (uuid "c61f0bfe-c811-4bb1-a5dc-b7e5a4db1bc7") + (uuid "a912f092-e6d7-48c8-84b1-de2edb93cca6") ) (segment - (start 155.3 195) - (end 153.4 193.1) + (start 168.9 224.1) + (end 168.9 218.2) (width 0.3) (layer "B.Cu") (net 91) - (uuid "d14b1948-072d-4c9e-be81-2191d0aa0a70") + (uuid "d0513187-cd32-4e68-88e4-916e180ea051") ) (segment (start 126.41 128.46) @@ -140885,13 +144656,29 @@ (net 91) (uuid "d857ae6f-0447-4330-b298-5854eeb44096") ) + (segment + (start 148.3 189.8) + (end 148.3 187.1) + (width 0.3) + (layer "B.Cu") + (net 91) + (uuid "e25dd8f7-fb0f-46d5-bc51-82da8c7c6101") + ) (segment (start 117.3 178.4) (end 117.3 149.2) (width 0.3) (layer "B.Cu") (net 91) - (uuid "f18fd15e-4317-4ada-8771-bb48f19510bd") + (uuid "e30089b3-0edb-41a1-a690-c88866c27746") + ) + (segment + (start 155.3 195) + (end 153.4 193.1) + (width 0.3) + (layer "B.Cu") + (net 91) + (uuid "f75c05a3-f946-4718-b02b-ce071c920a83") ) (segment (start 226.75 223.7575) @@ -144336,12 +148123,12 @@ (uuid "d263fc66-a378-41cf-8e37-e2284e7d7a5c") ) (segment - (start 201.038631 159.902649) - (end 221.247345 159.902649) + (start 200.835982 159.7) + (end 221.449994 159.7) (width 0.25) (layer "B.Cu") (net 177) - (uuid "02be3c17-dae7-4325-9beb-dd4bd7b48961") + (uuid "3452a182-dc26-4192-b065-c6c8391b04f6") ) (segment (start 182.482009 151.682009) @@ -144352,12 +148139,12 @@ (uuid "3654720b-6773-4b40-bc14-a3011ea6138b") ) (segment - (start 221.247345 159.902649) - (end 221.449994 159.7) + (start 195.967991 154.832009) + (end 200.835982 159.7) (width 0.25) (layer "B.Cu") (net 177) - (uuid "519cf944-7b9e-46c8-b8f4-98ba3f9560c6") + (uuid "53081ce7-f34c-4571-86cc-d268c6f729c8") ) (segment (start 177.5 146.7) @@ -144383,14 +148170,6 @@ (net 177) (uuid "785ee85a-b708-4edc-811c-17b009b1dea2") ) - (segment - (start 195.967991 154.832009) - (end 201.038631 159.902649) - (width 0.25) - (layer "B.Cu") - (net 177) - (uuid "dc6f5187-eac9-4e9b-95e0-edcafae94028") - ) (segment (start 193.50013 136.949996) (end 194.349996 136.949996) @@ -146207,6 +149986,14 @@ (net 198) (uuid "33a983ff-c88b-4404-a9f6-6f3ae6899d3e") ) + (segment + (start 175.2 162.6) + (end 177.2 164.6) + (width 0.25) + (layer "F.Cu") + (net 198) + (uuid "35b9209d-9360-422e-bba5-f819ec4cec08") + ) (segment (start 203.1 228) (end 205.442 228) @@ -146215,14 +150002,6 @@ (net 198) (uuid "39688211-3866-4171-ab46-508d56602db7") ) - (segment - (start 177.2 164.6) - (end 175.2 162.6) - (width 0.25) - (layer "F.Cu") - (net 198) - (uuid "49792eec-e2f4-4396-bacd-48ebccc5f35b") - ) (segment (start 179.8 151.663604) (end 183.05 148.413604) @@ -146240,20 +150019,12 @@ (uuid "5c158447-9031-45c0-9ad7-d40bda36a926") ) (segment - (start 184.4 164.6) - (end 177.2 164.6) + (start 175.2 159.8) + (end 175.2 162.6) (width 0.25) (layer "F.Cu") (net 198) - (uuid "60fd79e3-6a0c-4018-bf39-6614c2ee5bfd") - ) - (segment - (start 189.8 170) - (end 184.4 164.6) - (width 0.25) - (layer "F.Cu") - (net 198) - (uuid "93d4a277-dce2-4894-9a76-0eb09f30e6cb") + (uuid "777950fc-fff4-43cf-8606-6047aa320253") ) (segment (start 183.05 148.107234) @@ -146288,12 +150059,20 @@ (uuid "a65d902c-8c38-481b-9a42-287f65517a9c") ) (segment - (start 175.2 162.6) - (end 175.2 159.8) + (start 184.4 164.6) + (end 189.1 169.3) (width 0.25) (layer "F.Cu") (net 198) - (uuid "e5b6b919-6616-40f7-b522-292be2e7f3ec") + (uuid "cee57a00-c964-4eb9-84da-67980b062fd4") + ) + (segment + (start 177.2 164.6) + (end 184.4 164.6) + (width 0.25) + (layer "F.Cu") + (net 198) + (uuid "fa7640ca-00c9-4b3d-87f4-721acdff1bdc") ) (via (at 179.8 152.1) @@ -146336,7 +150115,7 @@ (uuid "c1794e88-805e-4827-8358-cda91dba3780") ) (via - (at 189.8 170) + (at 189.1 169.3) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -146351,14 +150130,6 @@ (net 198) (uuid "1b7ca4e0-3417-4a8d-acc5-99af6e270525") ) - (segment - (start 187.725 178.325) - (end 187.725 172.075) - (width 0.25) - (layer "B.Cu") - (net 198) - (uuid "2deb8290-e8cc-4cee-ab60-1d5e07f25474") - ) (segment (start 175.2 156.8) (end 178.3 153.7) @@ -146367,6 +150138,22 @@ (net 198) (uuid "3d5a43ad-37a8-4f8d-b75e-bacf67774140") ) + (segment + (start 187.725 178.325) + (end 187.725 170.675) + (width 0.25) + (layer "B.Cu") + (net 198) + (uuid "495b0765-c9d6-4006-b274-15a7e249741c") + ) + (segment + (start 187.8 178.4) + (end 187.725 178.325) + (width 0.25) + (layer "B.Cu") + (net 198) + (uuid "816a0bfe-f37f-4395-8500-6c894d2f8c36") + ) (segment (start 175.2 159.8) (end 175.2 156.8) @@ -146383,14 +150170,6 @@ (net 198) (uuid "aa26cf1d-c844-404b-be3d-a267a907d15a") ) - (segment - (start 187.725 172.075) - (end 189.8 170) - (width 0.25) - (layer "B.Cu") - (net 198) - (uuid "ac12388a-e3ed-415b-bdf6-585727acd8b1") - ) (segment (start 179.8 152.2) (end 179.8 152.1) @@ -146399,6 +150178,14 @@ (net 198) (uuid "b08cc411-a16e-4277-a4c3-fe04245c8281") ) + (segment + (start 187.725 170.675) + (end 189.1 169.3) + (width 0.25) + (layer "B.Cu") + (net 198) + (uuid "b90869a3-2291-4b07-b61b-31e334c8bb5b") + ) (segment (start 200.6 214) (end 200.6 186.2) @@ -146407,14 +150194,6 @@ (net 198) (uuid "d70c19a7-764f-4777-be1f-ce711221cf44") ) - (segment - (start 187.8 178.4) - (end 187.725 178.325) - (width 0.25) - (layer "B.Cu") - (net 198) - (uuid "d8a95761-15b6-4d9a-a32c-08c05b8f1c27") - ) (segment (start 192.875 178.475) (end 192.8 178.475) @@ -146439,6 +150218,22 @@ (net 198) (uuid "fcd2ccec-4463-4c25-be92-2fd9f385dbef") ) + (segment + (start 190.9 169.3) + (end 190.653984 169.3) + (width 0.25) + (layer "F.Cu") + (net 199) + (uuid "16b514c9-a18f-4f73-8c75-ff6a8219cd30") + ) + (segment + (start 176.3 161.3) + (end 176 161) + (width 0.25) + (layer "F.Cu") + (net 199) + (uuid "2b3c64ca-851f-4c0c-8c1a-ce050b8a5ac7") + ) (segment (start 220.515 229.485) (end 220.6 229.4) @@ -146447,14 +150242,6 @@ (net 199) (uuid "2da9b530-8902-491b-b951-eeb6e4e1772b") ) - (segment - (start 190.9 169.3) - (end 187.525 165.925) - (width 0.25) - (layer "F.Cu") - (net 199) - (uuid "32d2c10a-96d4-4f06-9b63-6eaaf5e630e7") - ) (segment (start 184.291839 147.537147) (end 184.304493 147.524493) @@ -146471,14 +150258,6 @@ (net 199) (uuid "4f5382fd-ae2d-43a2-8ca0-acf5932be498") ) - (segment - (start 187.525 165.925) - (end 187.525 163.199695) - (width 0.25) - (layer "F.Cu") - (net 199) - (uuid "5137a31a-3234-4efe-be07-e1631f572633") - ) (segment (start 183.5 149.9) (end 183.5 148.36434) @@ -146487,6 +150266,14 @@ (net 199) (uuid "51515f5b-bb46-4da7-8daa-5590b0509b82") ) + (segment + (start 187.525 163.199695) + (end 185.625305 161.3) + (width 0.25) + (layer "F.Cu") + (net 199) + (uuid "55e8a434-61cd-4c31-9831-4f42b3d92f16") + ) (segment (start 181.168421 151.9) (end 181.5 151.9) @@ -146496,12 +150283,28 @@ (uuid "6458b659-6cd6-4c22-946c-44fb50656168") ) (segment - (start 176.3 161.3) - (end 176 161) + (start 187.525 166.171016) + (end 187.525 163.199695) (width 0.25) (layer "F.Cu") (net 199) - (uuid "7c61bc92-5024-4e30-8992-5ec8caf36bc1") + (uuid "75daeccb-6893-4b38-ac9e-1cbce3c9d6c5") + ) + (segment + (start 185.625305 161.3) + (end 176.3 161.3) + (width 0.25) + (layer "F.Cu") + (net 199) + (uuid "763756cc-a856-40a1-b5ab-32e7c8f81d32") + ) + (segment + (start 190.653984 169.3) + (end 187.525 166.171016) + (width 0.25) + (layer "F.Cu") + (net 199) + (uuid "95a90bb2-0775-4f1a-a162-b40ecd2960f3") ) (segment (start 184.304493 147.524493) @@ -146511,22 +150314,6 @@ (net 199) (uuid "994ed1a2-7b64-4ae0-8a3d-b11f8f0a6fa0") ) - (segment - (start 187.525 163.199695) - (end 185.625305 161.3) - (width 0.25) - (layer "F.Cu") - (net 199) - (uuid "a6826532-120d-48b1-9266-3e9b9f9ac4ae") - ) - (segment - (start 185.625305 161.3) - (end 176.3 161.3) - (width 0.25) - (layer "F.Cu") - (net 199) - (uuid "bc463a5a-ce9c-4b81-9c20-cb8c8f33e0a8") - ) (segment (start 183.5 148.36434) (end 184.291839 147.572501) @@ -149287,14 +153074,6 @@ (net 215) (uuid "ecc2de18-ed38-49dc-b352-cbc989e4dc4d") ) - (segment - (start 190.65 167.65) - (end 190.196181 167.196181) - (width 0.25) - (layer "F.Cu") - (net 216) - (uuid "0995b64f-e9e2-406d-b48c-7fcc1cfde440") - ) (segment (start 154.33 189.73) (end 154.33 187.93) @@ -149304,12 +153083,12 @@ (uuid "2b4dab80-884e-47fa-ad82-de4fcf0ddf11") ) (segment - (start 190.196181 167.196181) - (end 190.196181 150.754481) + (start 190.196181 167.646177) + (end 190.200004 167.65) (width 0.25) (layer "F.Cu") (net 216) - (uuid "480694df-d8c6-4e19-8dd4-90c769e9f57b") + (uuid "382add59-5cb4-448b-9d16-5119e6ddc976") ) (segment (start 156.8 185.46) @@ -149319,6 +153098,14 @@ (net 216) (uuid "7b1ea58c-1615-471c-a6ec-e968fac23d89") ) + (segment + (start 190.196181 150.754481) + (end 190.196181 167.646177) + (width 0.25) + (layer "F.Cu") + (net 216) + (uuid "7d21f47e-4808-4772-9abf-633113ceeb19") + ) (segment (start 157.265 195.9) (end 157.265 194.435) @@ -149368,7 +153155,7 @@ (uuid "88d1c055-3778-4f5b-842f-2680199a9d96") ) (via - (at 190.65 167.65) + (at 190.200004 167.65) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -149376,12 +153163,20 @@ (uuid "c57304af-0527-4366-a628-f4444e672131") ) (segment - (start 156.8 185.45) - (end 163.55 178.7) + (start 188.55 167.65) + (end 190.200004 167.65) (width 0.25) (layer "B.Cu") (net 216) - (uuid "23374e28-d7a9-438c-bfe4-5e826d311d45") + (uuid "16e92452-b0b6-4655-8815-5d55b85f6cde") + ) + (segment + (start 177.5 178.7) + (end 188.55 167.65) + (width 0.25) + (layer "B.Cu") + (net 216) + (uuid "1da8184d-07c6-4bc9-8d8b-5943b259eb1c") ) (segment (start 154.33 189.73) @@ -149401,19 +153196,19 @@ ) (segment (start 163.55 178.7) - (end 179.6 178.7) + (end 177.5 178.7) (width 0.25) (layer "B.Cu") (net 216) - (uuid "6a9420b2-4f2f-408b-aabd-7ebc7e607cb0") + (uuid "5f2a30c8-7fc2-421e-8735-75da975f160b") ) (segment - (start 179.6 178.7) - (end 190.65 167.65) + (start 156.8 185.45) + (end 163.55 178.7) (width 0.25) (layer "B.Cu") (net 216) - (uuid "718d0952-84ec-47ee-9ff1-0744e4fe6b02") + (uuid "94099ff8-0eed-4dcd-807c-f04f34d45cd1") ) (segment (start 157.3 194.3) @@ -150063,6 +153858,14 @@ (net 221) (uuid "8e24f5d0-12f9-46a9-8727-e427662d5efb") ) + (segment + (start 119.18 116.835) + (end 114.85 116.835) + (width 0.25) + (layer "F.Cu") + (net 221) + (uuid "c849288a-f870-481e-9f9e-9f7455b5a3a5") + ) (segment (start 183.475 152.63198) (end 186.413159 149.693821) @@ -150079,14 +153882,6 @@ (net 221) (uuid "e1f56aea-39b6-4e0b-8dd5-a0213933e43a") ) - (segment - (start 119.18 116.835) - (end 114.535 116.835) - (width 0.25) - (layer "F.Cu") - (net 221) - (uuid "ed981ef5-7629-4552-a218-e3e35cb79208") - ) (segment (start 175.8 155.4) (end 182.068808 155.4) @@ -150095,16 +153890,8 @@ (net 221) (uuid "f2d9ef2e-890c-4925-8c7f-d2f15b8823b0") ) - (segment - (start 114.535 116.835) - (end 114.5 116.8) - (width 0.25) - (layer "F.Cu") - (net 221) - (uuid "fde976ae-b6e7-4a9a-a898-a3e27dd2032f") - ) (via - (at 114.5 116.8) + (at 114.85 116.835) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -150127,6 +153914,22 @@ (net 221) (uuid "3bb6b2ce-aeb9-4c3f-b761-4e003c40845a") ) + (segment + (start 114.75 122.45) + (end 114.75 116.935) + (width 0.25) + (layer "B.Cu") + (net 221) + (uuid "3e96f5d8-0c3e-48b3-8f56-e6dd734bde06") + ) + (segment + (start 114.75 116.935) + (end 114.85 116.835) + (width 0.25) + (layer "B.Cu") + (net 221) + (uuid "4954b11a-1ff4-4e78-9802-7a63a263b453") + ) (segment (start 153.975 140.955) (end 160.504418 140.955) @@ -150135,6 +153938,14 @@ (net 221) (uuid "4d62807f-d55f-4425-ae98-f080e2568c1a") ) + (segment + (start 115.4 123.1) + (end 114.75 122.45) + (width 0.25) + (layer "B.Cu") + (net 221) + (uuid "58b4f0e2-1092-4b59-b3fc-a55231f536e2") + ) (segment (start 145.12 132.1) (end 153.975 140.955) @@ -150151,22 +153962,6 @@ (net 221) (uuid "81b61cb4-18cb-48ec-9762-3e1d3c5bd587") ) - (segment - (start 145.12 128.6) - (end 139.62 123.1) - (width 0.25) - (layer "B.Cu") - (net 221) - (uuid "8350efc1-bae6-4f5a-9199-c7f2d8a1980a") - ) - (segment - (start 139.62 123.1) - (end 115.4 123.1) - (width 0.25) - (layer "B.Cu") - (net 221) - (uuid "9845ec3b-4e1a-4156-b57e-d5da98788203") - ) (segment (start 160.504418 140.955) (end 163.875 144.325582) @@ -150192,12 +153987,12 @@ (uuid "b52f535f-ba26-4e85-b872-d4ef3b43841b") ) (segment - (start 114.5 122.2) - (end 114.5 116.8) + (start 145.12 128.6) + (end 139.62 123.1) (width 0.25) (layer "B.Cu") (net 221) - (uuid "d4a460de-9620-43ca-8c13-cd716e842d44") + (uuid "c26ead2d-cb96-434e-a983-56aae5e3f42b") ) (segment (start 163.875 151.075) @@ -150208,12 +154003,12 @@ (uuid "dfcd9b7b-f4a1-4557-83dd-043df6ab271a") ) (segment - (start 115.4 123.1) - (end 114.5 122.2) + (start 139.62 123.1) + (end 115.4 123.1) (width 0.25) (layer "B.Cu") (net 221) - (uuid "f2dba88c-d7c7-4d2e-95f6-d8f031eb847a") + (uuid "f6986f26-cfeb-4b56-9188-f1533c31d7f6") ) (segment (start 233.75 201.5) @@ -151463,6 +155258,14 @@ (net 240) (uuid "13c3abba-6b13-48d4-a442-2d7fee3d8e49") ) + (segment + (start 114.85 115.365) + (end 119.18 115.365) + (width 0.25) + (layer "F.Cu") + (net 240) + (uuid "1640cbb6-128a-4f48-90ad-e14a277eb40a") + ) (segment (start 186.886227 143.986227) (end 186.5 143.6) @@ -151487,14 +155290,6 @@ (net 240) (uuid "6a2f4084-40d7-4476-934f-0d59d0031ca1") ) - (segment - (start 119.18 115.365) - (end 114.465 115.365) - (width 0.25) - (layer "F.Cu") - (net 240) - (uuid "7651a00d-ae14-481d-b10c-312029072945") - ) (segment (start 163.325 139.025) (end 157.475 139.025) @@ -151511,14 +155306,6 @@ (net 240) (uuid "878e666e-83b4-4e97-824b-978e145b1e23") ) - (segment - (start 114.465 115.365) - (end 114.4 115.3) - (width 0.25) - (layer "F.Cu") - (net 240) - (uuid "9c30f9b4-c46c-4f3f-822f-8082ca898afd") - ) (segment (start 193.024608 140.253946) (end 189.292327 143.986227) @@ -151576,7 +155363,7 @@ (uuid "53a55775-eb8c-4140-b55d-b2b87634556b") ) (via - (at 114.4 115.3) + (at 114.85 115.365) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") @@ -151647,6 +155434,14 @@ (net 240) (uuid "0c02d95e-415b-47aa-b09c-96fb079ecee6") ) + (segment + (start 114.85 115.365) + (end 114.85 115.65) + (width 0.25) + (layer "B.Cu") + (net 240) + (uuid "182277ee-bf55-4b79-977b-7e437d628530") + ) (segment (start 141.695963 139.1) (end 141.9 139.1) @@ -151679,6 +155474,14 @@ (net 240) (uuid "7d133698-525f-49cc-a75a-19b81d31e42c") ) + (segment + (start 116.7 117.5) + (end 116.7 120.600008) + (width 0.25) + (layer "B.Cu") + (net 240) + (uuid "84dac9d2-df1f-4ccd-a640-6f52c4e723a5") + ) (segment (start 118.8 127.5) (end 130.095963 127.5) @@ -151695,6 +155498,14 @@ (net 240) (uuid "88d6756c-c33e-4c9b-aef6-545dd18e41eb") ) + (segment + (start 114.85 115.65) + (end 116.7 117.5) + (width 0.25) + (layer "B.Cu") + (net 240) + (uuid "94121645-d669-44e5-8700-05e5011d6370") + ) (segment (start 186.5 143.6) (end 185.03571 145.06429) @@ -151703,22 +155514,6 @@ (net 240) (uuid "9eab2f45-5e2a-4c7d-94ab-cfdb823e93c0") ) - (segment - (start 116.7 120.600008) - (end 116.7 117.5) - (width 0.25) - (layer "B.Cu") - (net 240) - (uuid "d5cef58f-44ed-44e6-8299-571512639f2e") - ) - (segment - (start 116.7 117.5) - (end 114.5 115.3) - (width 0.25) - (layer "B.Cu") - (net 240) - (uuid "ea0b0f02-6483-43cd-b274-677baff0f1e5") - ) (segment (start 154.7 139.1) (end 157.4 139.1) @@ -151727,14 +155522,6 @@ (net 240) (uuid "eb3a32c6-0e18-4e12-87f4-e5c63a3b85b1") ) - (segment - (start 114.5 115.3) - (end 114.4 115.3) - (width 0.25) - (layer "B.Cu") - (net 240) - (uuid "ed243648-1f77-4bf8-9600-ce6913e36469") - ) (segment (start 185.03571 145.06429) (end 178.939693 145.06429) @@ -152415,6 +156202,38 @@ (net 252) (uuid "77674c58-9c06-407f-8e8e-ed4ce0d426ae") ) + (segment + (start 122.9 137.425) + (end 122.5875 137.1125) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "05b20f86-0d65-4aa6-a7fe-2bf3fb9dfb5b") + ) + (segment + (start 122.2 137.8) + (end 122.3 137.7) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "07959816-7c6a-4224-bb3e-d1966aced1f1") + ) + (segment + (start 122.05 135.9) + (end 122.05 136.575) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "0a2aa715-7594-495a-b3fa-cfb9067430a6") + ) + (segment + (start 123.4 135.215) + (end 123.35 135.165) + (width 0.25) + (layer "F.Cu") + (net 253) + (uuid "0fdc45b3-7464-4cda-a343-8b683c6dd115") + ) (segment (start 119.749999 129.555) (end 121.685 129.555) @@ -152423,29 +156242,21 @@ (net 253) (uuid "10181451-e4de-4cca-bd90-dd3f58f3ce40") ) - (segment - (start 122.05 135.165) - (end 122.05 136.575) - (width 0.3) - (layer "F.Cu") - (net 253) - (uuid "14375205-6aa8-4778-a3c0-2b3db2e97e6f") - ) - (segment - (start 122.3 137.7) - (end 123.175 137.7) - (width 0.3) - (layer "F.Cu") - (net 253) - (uuid "18bcd2a0-3ee9-4711-932b-4201dca26a98") - ) (segment (start 121.9 138.1) - (end 122.3 137.7) + (end 121.9 136.05) + (width 0.25) + (layer "F.Cu") + (net 253) + (uuid "3666ae55-9c31-4061-8408-357d0d653e45") + ) + (segment + (start 122.4875 137.0125) + (end 122.1 136.625) (width 0.3) (layer "F.Cu") (net 253) - (uuid "1c11a071-64d4-43be-b0a1-54974236d689") + (uuid "3a705897-d2d6-4a1b-8334-959af27f990b") ) (segment (start 122.784999 127.9945) @@ -152463,6 +156274,22 @@ (net 253) (uuid "578a330c-e0d9-461a-a84f-b1ecad5974ee") ) + (segment + (start 122.5875 137.1125) + (end 122.4875 137.0125) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "596f7a33-ee3d-48a9-aecc-2be07b72f61b") + ) + (segment + (start 121.9 138.1) + (end 122.2 137.8) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "59c29b57-6996-41d2-a584-03cc12cbb29e") + ) (segment (start 122.05 135.165) (end 122.05 129.19) @@ -152479,6 +156306,38 @@ (net 253) (uuid "70ff60e0-a367-4390-9694-4d07a5dfa091") ) + (segment + (start 122.1 137) + (end 122.1 137.7) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "76793cd1-a7e0-48c5-a09a-e7bcb0cdf85a") + ) + (segment + (start 123.4 135.9) + (end 123.4 135.215) + (width 0.25) + (layer "F.Cu") + (net 253) + (uuid "828a0983-ce33-450d-885e-3375e52f2495") + ) + (segment + (start 122.8 137.525) + (end 122.9 137.425) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "87625f88-feb6-413d-91c7-e0c21759d98a") + ) + (segment + (start 122.1 136.625) + (end 122.1 137) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "8c57f404-33ab-4888-ab35-21670415e944") + ) (segment (start 123.175 137.7) (end 122.9 137.425) @@ -152495,6 +156354,62 @@ (net 253) (uuid "9c546106-8163-4262-979a-6489381a8241") ) + (segment + (start 123.4 135.9) + (end 122.05 135.9) + (width 0.25) + (layer "F.Cu") + (net 253) + (uuid "a0ba921a-506e-471e-a42a-c75bb38d1996") + ) + (segment + (start 122.6 137.7) + (end 122.8 137.7) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "a3879c46-7783-4a0f-9184-1d8d0f37076c") + ) + (segment + (start 122.6 137.7) + (end 122.5875 137.6875) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "ac3cb073-2013-4b59-b42a-9913264ef8ff") + ) + (segment + (start 123.4 136.625) + (end 123.4 135.9) + (width 0.25) + (layer "F.Cu") + (net 253) + (uuid "b0414314-a20d-43bd-b0a6-47fe4a6c038f") + ) + (segment + (start 122.1 137.7) + (end 122.2 137.8) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "b1b70b4f-2765-4226-b276-cb9762c1f46c") + ) + (segment + (start 122.3 137.2) + (end 122.1 137) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "bf129ace-c4c1-44fd-a906-dbe6ac6c4410") + ) + (segment + (start 122.05 135.165) + (end 122.05 135.9) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "cc6470f0-e360-46db-b198-030eaa2a5d20") + ) (segment (start 140.085 137.7) (end 123.175 137.7) @@ -152503,6 +156418,14 @@ (net 253) (uuid "cda4abfc-fb52-4915-820a-f8118d7d2a68") ) + (segment + (start 122.5875 137.6875) + (end 122.5875 137.1125) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "d2200e35-f864-46b2-8db9-446ef7b116a8") + ) (segment (start 122.05 128.729499) (end 122.784999 127.9945) @@ -152512,12 +156435,52 @@ (uuid "d48b2ddb-f700-43d4-b853-e7a5ca8b2e80") ) (segment - (start 122.9 137.425) - (end 122.1 136.625) + (start 122.3 137.7) + (end 122.6 137.7) (width 0.3) (layer "F.Cu") (net 253) - (uuid "fd0c41d4-208e-4316-9af9-cd0f3adf5132") + (uuid "d49a8309-d214-44dd-9646-18883c6712c4") + ) + (segment + (start 122.8 137.7) + (end 123.175 137.7) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "dd84880c-7473-4d1c-a0da-f31c63dbc749") + ) + (segment + (start 122.8 137.7) + (end 122.8 137.525) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "eacf3e0b-d359-4807-a19f-888fce708dc7") + ) + (segment + (start 122.3 137.7) + (end 122.3 137.2) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "efab4d8a-7c0b-4d51-a4d4-5a06fc8f4d30") + ) + (segment + (start 121.9 136.05) + (end 122.05 135.9) + (width 0.25) + (layer "F.Cu") + (net 253) + (uuid "f676168b-5a02-476b-a9e6-5b474c19546b") + ) + (segment + (start 122.3 137.2) + (end 122.4875 137.0125) + (width 0.3) + (layer "F.Cu") + (net 253) + (uuid "f94ab8eb-1aa0-4e88-ba63-b12a5f6102f9") ) (segment (start 140.64 137.145) @@ -152536,44 +156499,20 @@ (uuid "6ab95397-3d07-47fd-9b4d-130ea52dde46") ) (segment - (start 119.5 179.8) - (end 141.8 179.8) + (start 148.8 186.8) + (end 148.8 189.528469) (width 0.3) (layer "B.Cu") (net 253) - (uuid "033cdbdb-4520-432d-a7d5-087f025b8e0c") + (uuid "0237edbb-21c4-4715-a06c-0b75b770e5dd") ) (segment - (start 117.8 178.1) - (end 119.5 179.8) + (start 167.2642 215.4642) + (end 170.8 219) (width 0.3) (layer "B.Cu") (net 253) - (uuid "0a2f09df-10c7-40c7-84b4-6b5b76837ed1") - ) - (segment - (start 167.75 215.4642) - (end 170.0642 215.4642) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "13907e87-ad40-4808-8351-2a4c73d57f17") - ) - (segment - (start 148.8 189.528469) - (end 151.871531 192.6) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "2b6e5183-d6f9-463e-97ec-81f9ab974fcd") - ) - (segment - (start 170.0642 215.4642) - (end 170.8 216.2) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "40971a1c-fa03-4174-8a34-eed85fb765ab") + (uuid "34c56d13-1a65-459c-a285-e77bf5e27dc8") ) (segment (start 121.9 138.1) @@ -152581,23 +156520,7 @@ (width 0.3) (layer "B.Cu") (net 253) - (uuid "44786354-a00a-4487-8232-24ef62bcf64c") - ) - (segment - (start 170.8 216.2) - (end 170.8 222.3142) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "51f5c10b-9c05-43e6-b2b2-d0f0d2f06a4b") - ) - (segment - (start 170.8 222.3142) - (end 170.75 222.3642) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "58791fb3-7eb0-4445-af21-ade55b57d4f3") + (uuid "3776e405-6aa9-4d2b-acdf-105d0042c273") ) (segment (start 117.8 149.5) @@ -152605,47 +156528,15 @@ (width 0.3) (layer "B.Cu") (net 253) - (uuid "5c35b000-323d-4e9b-b8a9-f39a470f0303") + (uuid "3964c419-8d50-476d-b922-32b71f31bc95") ) (segment - (start 148.8 186.8) - (end 148.8 189.528469) + (start 170.8 222.3142) + (end 170.75 222.3642) (width 0.3) (layer "B.Cu") (net 253) - (uuid "60b811c3-b6d4-4d26-b102-eb73c64ebda5") - ) - (segment - (start 153.6577 192.6) - (end 155.8 194.7423) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "6232e31d-ab8c-4e8e-bf0e-fc4dc0cd976f") - ) - (segment - (start 155.8 203.5142) - (end 167.75 215.4642) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "6b992873-b77d-4858-a7b4-fcb3a499b2ed") - ) - (segment - (start 141.8 179.8) - (end 148.8 186.8) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "72a746b2-9773-416b-bb6e-b7222349d05c") - ) - (segment - (start 155.8 194.7423) - (end 155.8 203.5142) - (width 0.3) - (layer "B.Cu") - (net 253) - (uuid "737ed009-f517-4618-99c1-5e93db16d6e6") + (uuid "410c002f-560b-473f-a865-aa046af0a019") ) (segment (start 121.9 145.4) @@ -152653,7 +156544,55 @@ (width 0.3) (layer "B.Cu") (net 253) - (uuid "fc010348-f04f-4186-9c56-04abffa295a1") + (uuid "44af1b0c-6659-41ae-bd49-715b0f5ee57f") + ) + (segment + (start 153.6577 192.6) + (end 155.8 194.7423) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "52b43c85-af39-41e0-b628-65800c80d95d") + ) + (segment + (start 155.8 204.3) + (end 166.9642 215.4642) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "6b80437c-c381-4273-b6b5-fc1fef8eb7ab") + ) + (segment + (start 141.8 179.8) + (end 148.8 186.8) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "79319907-6acb-43b7-a8dc-c0e760a9c064") + ) + (segment + (start 155.8 194.7423) + (end 155.8 204.3) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "927d482b-3fd5-41a1-b118-09ea2216c5f9") + ) + (segment + (start 119.5 179.8) + (end 141.8 179.8) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "9c487e43-5e95-4b91-ac75-c0b4c50b4cd4") + ) + (segment + (start 148.8 189.528469) + (end 151.871531 192.6) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "b3361bd1-4339-4f15-84be-b5f72ba7d81c") ) (segment (start 151.871531 192.6) @@ -152661,7 +156600,31 @@ (width 0.3) (layer "B.Cu") (net 253) - (uuid "fd7900f3-1aa2-4c5b-baef-2f7c559a8307") + (uuid "b930bf0c-b555-460f-b374-75fc9323b017") + ) + (segment + (start 170.8 219) + (end 170.8 222.3142) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "c92016e5-8572-405c-b3a6-40f773dd70f4") + ) + (segment + (start 166.9642 215.4642) + (end 167.2642 215.4642) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "ef159227-c569-4a12-896a-7c370ecdc9c8") + ) + (segment + (start 117.8 178.1) + (end 119.5 179.8) + (width 0.3) + (layer "B.Cu") + (net 253) + (uuid "f45a3ad7-98dd-4f9e-9ac8-0f719c204a03") ) (segment (start 119.749999 131.855) @@ -152808,44 +156771,12 @@ (uuid "df5c99b0-8945-4889-9504-b4d1ee8e8142") ) (segment - (start 172 216.6) - (end 172 223.6142) + (start 172 223.6142) + (end 173.75 225.3642) (width 0.3) (layer "B.Cu") (net 254) - (uuid "0a2691db-995f-41eb-9289-2c85316d99ea") - ) - (segment - (start 122.7 145.4) - (end 118.3 149.8) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "37150c1f-c8fc-413d-bec6-917ddc035153") - ) - (segment - (start 118.3 177.8) - (end 119.8 179.3) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "38371968-810c-489f-aac7-4d06a4c67be1") - ) - (segment - (start 149.3 189.3) - (end 152.1 192.1) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "4dd0fe89-2739-4d5f-b537-8275ae4f4fe4") - ) - (segment - (start 170.3 214.9) - (end 172 216.6) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "5fa1a5d5-66ad-43bd-8516-c60463635edc") + (uuid "03f0c33f-9390-4d44-b129-abffee3a7aae") ) (segment (start 149.3 186.55962) @@ -152853,7 +156784,15 @@ (width 0.3) (layer "B.Cu") (net 254) - (uuid "6521f516-2809-4d4a-977a-582b8a4d5db6") + (uuid "09058b63-88d2-474d-a652-84c2cbb9d935") + ) + (segment + (start 172 219.3) + (end 172 223.6142) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "1570fdbf-bcd1-4a8a-bf5d-85d60c456f00") ) (segment (start 122.7 133.332169) @@ -152861,63 +156800,7 @@ (width 0.3) (layer "B.Cu") (net 254) - (uuid "675c35aa-d03f-4e70-88be-374f88733696") - ) - (segment - (start 156.3 202.877804) - (end 168.322196 214.9) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "7702e5b3-5db2-4092-ab57-c0b69fc0722a") - ) - (segment - (start 154 192.1) - (end 156.3 194.4) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "82077b20-8708-48bf-afbd-0218aca83ff1") - ) - (segment - (start 122.85 133.182169) - (end 122.7 133.332169) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "8246677f-9eff-4540-a94d-a824c411489c") - ) - (segment - (start 119.8 179.3) - (end 142.04038 179.3) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "8d18c154-4916-4792-8851-469291c9149b") - ) - (segment - (start 156.3 194.4) - (end 156.3 202.877804) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "93e07e76-1f5d-459e-852b-ae20db079dcc") - ) - (segment - (start 152.1 192.1) - (end 154 192.1) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "9dbabda2-97e5-429c-9c2f-f4a3df766b5f") - ) - (segment - (start 142.04038 179.3) - (end 149.3 186.55962) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "a3982c67-0a4b-4c09-8358-34576e41d11f") + (uuid "2991abb8-72d0-4901-b524-bda3fcfa80a3") ) (segment (start 118.3 149.8) @@ -152925,7 +156808,95 @@ (width 0.3) (layer "B.Cu") (net 254) - (uuid "ad6d8b57-d6a2-4c9f-81fa-cc47fcdccb64") + (uuid "37819b91-7449-4c87-8158-8897528f9d53") + ) + (segment + (start 167.3 214.9) + (end 167.6 214.9) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "5853b2a1-7d0f-4c6d-8f30-4c52dac65556") + ) + (segment + (start 156.3 194.4) + (end 156.3 203.9) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "58887018-01cf-43ea-8eb3-a51e9f92c656") + ) + (segment + (start 149.3 189.3) + (end 152.1 192.1) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "5a8cbb24-1f54-4ac9-b44b-8068d676aef5") + ) + (segment + (start 142.04038 179.3) + (end 149.3 186.55962) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "64625769-c900-4f41-9a8a-81800f1d8d53") + ) + (segment + (start 119.8 179.3) + (end 142.04038 179.3) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "6ebf34e9-921b-4696-a278-6c8cce79b36d") + ) + (segment + (start 156.3 203.9) + (end 167.3 214.9) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "6f83f0ec-0047-490d-8c88-08fb7dc4a9af") + ) + (segment + (start 167.6 214.9) + (end 172 219.3) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "749ed2c3-c5c2-45c9-bc2a-f5e31ff59d7a") + ) + (segment + (start 154 192.1) + (end 156.3 194.4) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "7ed39785-d419-4494-8125-86d3b8949966") + ) + (segment + (start 152.1 192.1) + (end 154 192.1) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "89350f72-0134-4093-9f82-96df5141149b") + ) + (segment + (start 122.7 145.4) + (end 118.3 149.8) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "a763cfaf-b719-4c47-bdba-38e83909882d") + ) + (segment + (start 122.85 133.182169) + (end 122.7 133.332169) + (width 0.3) + (layer "B.Cu") + (net 254) + (uuid "d8720b41-fa29-4a66-b7af-d98c13628a8c") ) (segment (start 121.6 131.73) @@ -152936,20 +156907,12 @@ (uuid "e48eec25-2557-44ee-92c4-f03fc2df1784") ) (segment - (start 168.322196 214.9) - (end 170.3 214.9) + (start 118.3 177.8) + (end 119.8 179.3) (width 0.3) (layer "B.Cu") (net 254) - (uuid "f5bec326-b6eb-40a6-a9c2-2e2b9a0981e0") - ) - (segment - (start 172 223.6142) - (end 173.75 225.3642) - (width 0.3) - (layer "B.Cu") - (net 254) - (uuid "f7b04e41-150a-4381-9241-25f59947c4a9") + (uuid "f369d0d6-8d04-4e4a-b15d-b3f81eec7ffe") ) (segment (start 121.22 131.73) @@ -154275,8 +158238,9 @@ (xy 153.878249 60.180899) (xy 153.878257 60.180928) (xy 153.928079 60.345171) (xy 153.936523 60.368772) (xy 153.936524 60.368775) (xy 153.945826 60.391231) (xy 153.95655 60.413905) (xy 153.956557 60.413919) (xy 154.03743 60.56522) (xy 154.037456 60.565267) (xy 154.050331 60.586747) (xy 154.063807 60.606917) - (xy 154.063853 60.606983) (xy 154.078761 60.627082) (xy 154.078773 60.627098) (xy 154.1 60.652963) - (xy 154.1 60.9) (xy 154.347037 60.9) (xy 154.372901 60.921226) (xy 154.372916 60.921237) (xy 154.393015 60.936145) + (xy 154.063853 60.606983) (xy 154.078761 60.627082) (xy 154.078773 60.627098) (xy 154.148844 60.71248) + (xy 154.187644 60.759758) (xy 154.204473 60.778326) (xy 154.221672 60.795525) (xy 154.24024 60.812354) + (xy 154.240245 60.812358) (xy 154.372901 60.921226) (xy 154.372916 60.921237) (xy 154.393015 60.936145) (xy 154.393081 60.936191) (xy 154.413251 60.949667) (xy 154.434731 60.962542) (xy 154.434747 60.962551) (xy 154.434759 60.962558) (xy 154.434778 60.962568) (xy 154.586079 61.043441) (xy 154.586093 61.043448) (xy 154.586097 61.04345) (xy 154.586101 61.043452) (xy 154.608762 61.05417) (xy 154.63122 61.063473) @@ -154305,22 +158269,25 @@ (xy 161.229001 69.627424) (xy 161.206543 69.618121) (xy 161.055201 69.537227) (xy 161.034989 69.523722) (xy 160.902333 69.414854) (xy 160.885145 69.397666) (xy 160.776277 69.26501) (xy 160.762772 69.244798) (xy 160.681878 69.093456) (xy 160.672575 69.070998) (xy 160.624641 68.912978) (xy 160.622757 68.906769) - (xy 160.618018 68.882941) (xy 160.600597 68.706061) (xy 160.6 68.693907) (xy 160.6 67.000003) (xy 160.6 67) - (xy 160.6 66) (xy 159.6 66) (xy 159.599997 66) (xy 158.191645 66) (xy 158.134018 65.985796) (xy 158.127363 65.982303) - (xy 157.973986 65.9445) (xy 157.973985 65.9445) (xy 157.816015 65.9445) (xy 157.816014 65.9445) - (xy 157.662636 65.982303) (xy 157.655982 65.985796) (xy 157.598355 66) (xy 157.28886 66) (xy 157.221821 65.980315) - (xy 157.21455 65.975267) (xy 157.145229 65.923374) (xy 157.145228 65.923373) (xy 157.145226 65.923372) - (xy 157.017114 65.875588) (xy 157.017112 65.875587) (xy 157.01711 65.875587) (xy 156.960493 65.8695) - (xy 156.419518 65.8695) (xy 156.419509 65.869501) (xy 156.362885 65.875587) (xy 156.244991 65.919561) - (xy 156.234774 65.923372) (xy 156.234773 65.923372) (xy 156.23477 65.923374) (xy 156.16545 65.975267) - (xy 156.099986 65.999684) (xy 156.09114 66) (xy 155.73886 66) (xy 155.671821 65.980315) (xy 155.66455 65.975267) - (xy 155.595229 65.923374) (xy 155.595228 65.923373) (xy 155.595226 65.923372) (xy 155.467114 65.875588) - (xy 155.467112 65.875587) (xy 155.46711 65.875587) (xy 155.410493 65.8695) (xy 154.869518 65.8695) - (xy 154.869509 65.869501) (xy 154.812885 65.875587) (xy 154.694991 65.919561) (xy 154.684774 65.923372) - (xy 154.684773 65.923372) (xy 154.68477 65.923374) (xy 154.61545 65.975267) (xy 154.549986 65.999684) - (xy 154.54114 66) (xy 151.623047 66) (xy 151.611229 65.999436) (xy 151.439193 65.982965) (xy 151.415987 65.97848) - (xy 151.255915 65.931348) (xy 151.233981 65.922541) (xy 151.192895 65.901295) (xy 151.1 65.853256) - (xy 151.1 59) (xy 153.143907 59) + (xy 160.618018 68.882941) (xy 160.600597 68.706061) (xy 160.6 68.693907) (xy 160.6 67.000003) (xy 160.590416 66.902699) + (xy 160.580785 66.80491) (xy 160.52388 66.617317) (xy 160.43147 66.44443) (xy 160.393648 66.398344) + (xy 160.307107 66.292892) (xy 160.155571 66.168531) (xy 160.155564 66.168526) (xy 159.98269 66.076123) + (xy 159.982687 66.076122) (xy 159.982686 66.076121) (xy 159.982683 66.07612) (xy 159.79509 66.019215) + (xy 159.795088 66.019214) (xy 159.79509 66.019214) (xy 159.644494 66.004382) (xy 159.6 66) (xy 159.599997 66) + (xy 158.191645 66) (xy 158.134018 65.985796) (xy 158.127363 65.982303) (xy 157.973986 65.9445) (xy 157.973985 65.9445) + (xy 157.816015 65.9445) (xy 157.816014 65.9445) (xy 157.662636 65.982303) (xy 157.655982 65.985796) + (xy 157.598355 66) (xy 157.28886 66) (xy 157.221821 65.980315) (xy 157.21455 65.975267) (xy 157.145229 65.923374) + (xy 157.145228 65.923373) (xy 157.145226 65.923372) (xy 157.017114 65.875588) (xy 157.017112 65.875587) + (xy 157.01711 65.875587) (xy 156.960493 65.8695) (xy 156.419518 65.8695) (xy 156.419509 65.869501) + (xy 156.362885 65.875587) (xy 156.244991 65.919561) (xy 156.234774 65.923372) (xy 156.234773 65.923372) + (xy 156.23477 65.923374) (xy 156.16545 65.975267) (xy 156.099986 65.999684) (xy 156.09114 66) (xy 155.73886 66) + (xy 155.671821 65.980315) (xy 155.66455 65.975267) (xy 155.595229 65.923374) (xy 155.595228 65.923373) + (xy 155.595226 65.923372) (xy 155.467114 65.875588) (xy 155.467112 65.875587) (xy 155.46711 65.875587) + (xy 155.410493 65.8695) (xy 154.869518 65.8695) (xy 154.869509 65.869501) (xy 154.812885 65.875587) + (xy 154.694991 65.919561) (xy 154.684774 65.923372) (xy 154.684773 65.923372) (xy 154.68477 65.923374) + (xy 154.61545 65.975267) (xy 154.549986 65.999684) (xy 154.54114 66) (xy 151.623047 66) (xy 151.611229 65.999436) + (xy 151.439193 65.982965) (xy 151.415987 65.97848) (xy 151.255915 65.931348) (xy 151.233981 65.922541) + (xy 151.192895 65.901295) (xy 151.1 65.853256) (xy 151.1 59) (xy 153.143907 59) ) ) ) @@ -154367,7 +158334,8 @@ (xy 255.219079 73.178254) (xy 255.219057 73.17826) (xy 255.054824 73.228079) (xy 255.031222 73.236524) (xy 255.031204 73.236531) (xy 255.008781 73.24582) (xy 255.008773 73.245823) (xy 254.986107 73.256543) (xy 254.834765 73.337437) (xy 254.813236 73.350341) (xy 254.79306 73.363822) (xy 254.793034 73.36384) - (xy 254.772891 73.37878) (xy 254.747035 73.4) (xy 254.5 73.4) (xy 254.5 73.647034) (xy 254.47878 73.672891) + (xy 254.772891 73.37878) (xy 254.640234 73.487651) (xy 254.640218 73.487665) (xy 254.621654 73.504489) + (xy 254.604489 73.521654) (xy 254.587665 73.540218) (xy 254.587651 73.540234) (xy 254.47878 73.672891) (xy 254.46384 73.693034) (xy 254.463822 73.69306) (xy 254.450341 73.713236) (xy 254.437437 73.734765) (xy 254.366909 73.866715) (xy 254.366898 73.866737) (xy 254.354593 73.893316) (xy 254.344161 73.919726) (xy 254.34346 73.921521) (xy 254.326374 74.019732) (xy 254.326373 74.019739) (xy 254.327701 74.074806) @@ -154377,67 +158345,74 @@ (xy 254.337692 74.525977) (xy 254.325705 74.562864) (xy 254.297874 74.617486) (xy 254.297747 74.617709) (xy 254.294944 74.623236) (xy 254.294841 74.62344) (xy 254.282743 74.647183) (xy 254.282794 74.64884) (xy 254.276271 74.666772) (xy 254.276272 74.666773) (xy 254.276259 74.666807) (xy 254.274874 74.670615) - (xy 254.274539 74.671321) (xy 254.254849 74.738375) (xy 254.254848 74.738378) (xy 254.2445 74.810355) - (xy 254.2445 74.933089) (xy 254.224815 75.000128) (xy 254.172011 75.045883) (xy 254.104316 75.056028) - (xy 254.041406 75.047746) (xy 254.024792 75.046109) (xy 254.008591 75.045047) (xy 254.004654 75.044918) - (xy 253.991874 75.0445) (xy 253.991861 75.0445) (xy 253.0795 75.0445) (xy 253.012461 75.024815) - (xy 252.966706 74.972011) (xy 252.9555 74.9205) (xy 252.9555 74.74639) (xy 252.955499 74.746388) - (xy 252.936052 74.648621) (xy 252.936052 74.64862) (xy 252.936051 74.648619) (xy 252.936051 74.648617) - (xy 252.927201 74.635372) (xy 252.919828 74.622792) (xy 252.919601 74.622347) (xy 252.919602 74.622347) - (xy 252.889294 74.562865) (xy 252.877305 74.525958) (xy 252.876525 74.52103) (xy 252.875 74.501645) - (xy 252.875 74.19834) (xy 252.876526 74.178944) (xy 252.87825 74.168058) (xy 252.887107 74.137783) - (xy 252.88801 74.135718) (xy 252.898127 74.10825) (xy 252.8991 74.105562) (xy 252.91354 74.006922) - (xy 252.909979 73.937143) (xy 252.895974 73.86578) (xy 252.895973 73.865778) (xy 252.895972 73.865771) - (xy 252.866556 73.781705) (xy 252.866546 73.78168) (xy 252.855589 73.755228) (xy 252.845732 73.734759) - (xy 252.843539 73.730205) (xy 252.829679 73.705128) (xy 252.749235 73.577102) (xy 252.732652 73.553731) - (xy 252.732647 73.553725) (xy 252.732644 73.55372) (xy 252.715347 73.532031) (xy 252.715342 73.532026) - (xy 252.715339 73.532022) (xy 252.7 73.514857) (xy 252.7 73.4) (xy 252.585143 73.4) (xy 252.567981 73.384663) - (xy 252.56797 73.384654) (xy 252.567962 73.384647) (xy 252.546288 73.367362) (xy 252.546267 73.367346) - (xy 252.522911 73.350773) (xy 252.522908 73.350771) (xy 252.522898 73.350764) (xy 252.394871 73.27032) - (xy 252.394858 73.270313) (xy 252.369806 73.256466) (xy 252.344779 73.244413) (xy 252.3183 73.233446) - (xy 252.175591 73.18351) (xy 252.175568 73.183502) (xy 252.148055 73.175576) (xy 252.148036 73.175571) - (xy 252.120972 73.169396) (xy 252.092733 73.164598) (xy 252.092714 73.164595) (xy 251.942499 73.147671) - (xy 251.94247 73.147668) (xy 251.913899 73.146064) (xy 251.913881 73.146064) (xy 251.886119 73.146064) - (xy 251.8861 73.146064) (xy 251.857518 73.147669) (xy 251.70728 73.164595) (xy 251.707245 73.1646) - (xy 251.679022 73.169396) (xy 251.679006 73.169399) (xy 251.651979 73.175567) (xy 251.651963 73.175571) - (xy 251.65196 73.175571) (xy 251.651955 73.175573) (xy 251.642775 73.178217) (xy 251.6244 73.183511) - (xy 251.624397 73.183512) (xy 251.481708 73.233442) (xy 251.481705 73.233443) (xy 251.455212 73.244417) - (xy 251.430216 73.256454) (xy 251.430187 73.256469) (xy 251.405139 73.270313) (xy 251.277097 73.350767) - (xy 251.277087 73.350774) (xy 251.253727 73.367349) (xy 251.253715 73.367358) (xy 251.246709 73.372946) - (xy 251.182022 73.399355) (xy 251.169395 73.4) (xy 247.106093 73.4) (xy 247.093939 73.399403) (xy 246.917065 73.381982) - (xy 246.893224 73.37724) (xy 246.729001 73.327424) (xy 246.706543 73.318121) (xy 246.555201 73.237227) - (xy 246.534989 73.223722) (xy 246.402333 73.114854) (xy 246.385145 73.097666) (xy 246.276277 72.96501) - (xy 246.262772 72.944798) (xy 246.181878 72.793456) (xy 246.172575 72.770998) (xy 246.122757 72.606769) - (xy 246.118018 72.582941) (xy 246.100597 72.406061) (xy 246.1 72.393907) (xy 246.1 71.755448) (xy 246.119685 71.688409) - (xy 246.172489 71.642654) (xy 246.241647 71.63271) (xy 246.248192 71.633831) (xy 246.282723 71.6407) - (xy 246.282726 71.6407) (xy 246.839276 71.6407) (xy 246.839277 71.640699) (xy 246.91234 71.626166) - (xy 246.995201 71.570801) (xy 247.050566 71.48794) (xy 247.0651 71.414874) (xy 247.0651 69.909426) - (xy 247.0651 69.909423) (xy 247.05292 69.848192) (xy 247.059147 69.7786) (xy 247.10201 69.723423) - (xy 247.167899 69.700178) (xy 247.174537 69.7) (xy 247.217463 69.7) (xy 247.284502 69.719685) (xy 247.330257 69.772489) - (xy 247.340201 69.841647) (xy 247.33908 69.848192) (xy 247.3269 69.909423) (xy 247.3269 71.414878) - (xy 247.341432 71.487935) (xy 247.341433 71.487939) (xy 247.341434 71.48794) (xy 247.396799 71.570801) - (xy 247.47966 71.626166) (xy 247.479664 71.626167) (xy 247.552721 71.640699) (xy 247.552724 71.6407) - (xy 247.552726 71.6407) (xy 248.109276 71.6407) (xy 248.109277 71.640699) (xy 248.18234 71.626166) - (xy 248.265201 71.570801) (xy 248.320566 71.48794) (xy 248.3351 71.414874) (xy 248.3351 69.909426) - (xy 248.3351 69.909423) (xy 248.32292 69.848192) (xy 248.329147 69.7786) (xy 248.37201 69.723423) - (xy 248.437899 69.700178) (xy 248.444537 69.7) (xy 252.297463 69.7) (xy 252.364502 69.719685) (xy 252.410257 69.772489) - (xy 252.420201 69.841647) (xy 252.41908 69.848192) (xy 252.4069 69.909423) (xy 252.4069 71.414878) - (xy 252.421432 71.487935) (xy 252.421433 71.487939) (xy 252.421434 71.48794) (xy 252.476799 71.570801) - (xy 252.55966 71.626166) (xy 252.559664 71.626167) (xy 252.632721 71.640699) (xy 252.632724 71.6407) - (xy 252.632726 71.6407) (xy 253.189276 71.6407) (xy 253.189277 71.640699) (xy 253.26234 71.626166) - (xy 253.345201 71.570801) (xy 253.400566 71.48794) (xy 253.4151 71.414874) (xy 253.4151 69.909426) - (xy 253.4151 69.909423) (xy 253.40292 69.848192) (xy 253.409147 69.7786) (xy 253.45201 69.723423) - (xy 253.517899 69.700178) (xy 253.524537 69.7) (xy 253.567463 69.7) (xy 253.634502 69.719685) (xy 253.680257 69.772489) - (xy 253.690201 69.841647) (xy 253.68908 69.848192) (xy 253.6769 69.909423) (xy 253.6769 71.414878) - (xy 253.691432 71.487935) (xy 253.691433 71.487939) (xy 253.691434 71.48794) (xy 253.746799 71.570801) - (xy 253.82966 71.626166) (xy 253.829664 71.626167) (xy 253.902721 71.640699) (xy 253.902724 71.6407) - (xy 253.902726 71.6407) (xy 254.459276 71.6407) (xy 254.459277 71.640699) (xy 254.53234 71.626166) - (xy 254.615201 71.570801) (xy 254.670566 71.48794) (xy 254.6851 71.414874) (xy 254.6851 70.104305) - (xy 254.704785 70.037266) (xy 254.757589 69.991511) (xy 254.826747 69.981567) (xy 254.890303 70.010592) - (xy 254.9 70.024069) (xy 254.9 70.2) (xy 257.8 70.2) (xy 257.800001 70.2) (xy 258.1 70.2) (xy 258.1 69.9) - (xy 258.115339 69.822885) (xy 258.147722 69.760977) (xy 258.174948 69.739696) (xy 258.225564 69.710474) - (xy 258.293561 69.642476) (xy 258.35488 69.608994) (xy 258.356982 69.608556) (xy 258.372589 69.605452) - (xy 258.388028 69.602382) (xy 258.412214 69.6) (xy 260.793907 69.6) + (xy 254.274539 74.671321) (xy 254.274536 74.67133) (xy 254.274535 74.671333) (xy 254.258787 74.724964) + (xy 254.254849 74.738375) (xy 254.254848 74.738378) (xy 254.2445 74.810355) (xy 254.2445 74.933089) + (xy 254.224815 75.000128) (xy 254.172011 75.045883) (xy 254.104316 75.056028) (xy 254.041406 75.047746) + (xy 254.024792 75.046109) (xy 254.008591 75.045047) (xy 254.004654 75.044918) (xy 253.991874 75.0445) + (xy 253.991861 75.0445) (xy 253.621315 75.0445) (xy 253.607432 75.04372) (xy 253.536197 75.035694) + (xy 253.536196 75.035693) (xy 253.524215 75.034343) (xy 253.470828 75.028328) (xy 253.443758 75.022149) + (xy 253.334249 74.98383) (xy 253.309232 74.971783) (xy 253.210998 74.910059) (xy 253.189289 74.892746) + (xy 253.107249 74.810706) (xy 253.089937 74.788998) (xy 253.061898 74.744375) (xy 253.061897 74.744374) + (xy 253.061896 74.744372) (xy 253.01794 74.691721) (xy 252.990683 74.666807) (xy 252.969244 74.64721) + (xy 252.969243 74.647209) (xy 252.955317 74.637561) (xy 252.938255 74.623316) (xy 252.915118 74.600179) + (xy 252.892311 74.568786) (xy 252.889292 74.56286) (xy 252.877305 74.525961) (xy 252.876525 74.521034) + (xy 252.875 74.501645) (xy 252.875 74.19834) (xy 252.876526 74.178944) (xy 252.87825 74.168058) + (xy 252.887107 74.137783) (xy 252.88801 74.135718) (xy 252.898127 74.10825) (xy 252.8991 74.105562) + (xy 252.91354 74.006922) (xy 252.909979 73.937143) (xy 252.895974 73.86578) (xy 252.895973 73.865778) + (xy 252.895972 73.865771) (xy 252.866556 73.781705) (xy 252.866546 73.78168) (xy 252.855589 73.755228) + (xy 252.845732 73.734759) (xy 252.843539 73.730205) (xy 252.829679 73.705128) (xy 252.749235 73.577102) + (xy 252.732652 73.553731) (xy 252.732647 73.553725) (xy 252.732644 73.55372) (xy 252.715347 73.532031) + (xy 252.715342 73.532026) (xy 252.715339 73.532022) (xy 252.69625 73.510661) (xy 252.589338 73.403749) + (xy 252.567981 73.384663) (xy 252.56797 73.384654) (xy 252.567962 73.384647) (xy 252.546288 73.367362) + (xy 252.546267 73.367346) (xy 252.522911 73.350773) (xy 252.522908 73.350771) (xy 252.522898 73.350764) + (xy 252.394871 73.27032) (xy 252.394858 73.270313) (xy 252.369806 73.256466) (xy 252.344779 73.244413) + (xy 252.3183 73.233446) (xy 252.175591 73.18351) (xy 252.175568 73.183502) (xy 252.148055 73.175576) + (xy 252.148036 73.175571) (xy 252.120972 73.169396) (xy 252.092733 73.164598) (xy 252.092714 73.164595) + (xy 251.942499 73.147671) (xy 251.94247 73.147668) (xy 251.913899 73.146064) (xy 251.913881 73.146064) + (xy 251.886119 73.146064) (xy 251.8861 73.146064) (xy 251.857518 73.147669) (xy 251.70728 73.164595) + (xy 251.707245 73.1646) (xy 251.679022 73.169396) (xy 251.679006 73.169399) (xy 251.651979 73.175567) + (xy 251.651963 73.175571) (xy 251.65196 73.175571) (xy 251.651955 73.175573) (xy 251.642775 73.178217) + (xy 251.6244 73.183511) (xy 251.624397 73.183512) (xy 251.481708 73.233442) (xy 251.481705 73.233443) + (xy 251.455212 73.244417) (xy 251.430216 73.256454) (xy 251.430187 73.256469) (xy 251.405139 73.270313) + (xy 251.277097 73.350767) (xy 251.277087 73.350774) (xy 251.253727 73.367349) (xy 251.253715 73.367358) + (xy 251.246709 73.372946) (xy 251.182022 73.399355) (xy 251.169395 73.4) (xy 247.106093 73.4) (xy 247.093939 73.399403) + (xy 246.917065 73.381982) (xy 246.893224 73.37724) (xy 246.729001 73.327424) (xy 246.706543 73.318121) + (xy 246.555201 73.237227) (xy 246.534989 73.223722) (xy 246.402333 73.114854) (xy 246.385145 73.097666) + (xy 246.276277 72.96501) (xy 246.262772 72.944798) (xy 246.181878 72.793456) (xy 246.172575 72.770998) + (xy 246.122757 72.606769) (xy 246.118018 72.582941) (xy 246.100597 72.406061) (xy 246.1 72.393907) + (xy 246.1 71.755448) (xy 246.119685 71.688409) (xy 246.172489 71.642654) (xy 246.241647 71.63271) + (xy 246.248192 71.633831) (xy 246.282723 71.6407) (xy 246.282726 71.6407) (xy 246.839276 71.6407) + (xy 246.839277 71.640699) (xy 246.91234 71.626166) (xy 246.995201 71.570801) (xy 247.050566 71.48794) + (xy 247.0651 71.414874) (xy 247.0651 69.909426) (xy 247.0651 69.909423) (xy 247.05292 69.848192) + (xy 247.059147 69.7786) (xy 247.10201 69.723423) (xy 247.167899 69.700178) (xy 247.174537 69.7) + (xy 247.217463 69.7) (xy 247.284502 69.719685) (xy 247.330257 69.772489) (xy 247.340201 69.841647) + (xy 247.33908 69.848192) (xy 247.3269 69.909423) (xy 247.3269 71.414878) (xy 247.341432 71.487935) + (xy 247.341433 71.487939) (xy 247.341434 71.48794) (xy 247.396799 71.570801) (xy 247.47966 71.626166) + (xy 247.479664 71.626167) (xy 247.552721 71.640699) (xy 247.552724 71.6407) (xy 247.552726 71.6407) + (xy 248.109276 71.6407) (xy 248.109277 71.640699) (xy 248.18234 71.626166) (xy 248.265201 71.570801) + (xy 248.320566 71.48794) (xy 248.3351 71.414874) (xy 248.3351 69.909426) (xy 248.3351 69.909423) + (xy 248.32292 69.848192) (xy 248.329147 69.7786) (xy 248.37201 69.723423) (xy 248.437899 69.700178) + (xy 248.444537 69.7) (xy 252.297463 69.7) (xy 252.364502 69.719685) (xy 252.410257 69.772489) (xy 252.420201 69.841647) + (xy 252.41908 69.848192) (xy 252.4069 69.909423) (xy 252.4069 71.414878) (xy 252.421432 71.487935) + (xy 252.421433 71.487939) (xy 252.421434 71.48794) (xy 252.476799 71.570801) (xy 252.55966 71.626166) + (xy 252.559664 71.626167) (xy 252.632721 71.640699) (xy 252.632724 71.6407) (xy 252.632726 71.6407) + (xy 253.189276 71.6407) (xy 253.189277 71.640699) (xy 253.26234 71.626166) (xy 253.345201 71.570801) + (xy 253.400566 71.48794) (xy 253.4151 71.414874) (xy 253.4151 69.909426) (xy 253.4151 69.909423) + (xy 253.40292 69.848192) (xy 253.409147 69.7786) (xy 253.45201 69.723423) (xy 253.517899 69.700178) + (xy 253.524537 69.7) (xy 253.567463 69.7) (xy 253.634502 69.719685) (xy 253.680257 69.772489) (xy 253.690201 69.841647) + (xy 253.68908 69.848192) (xy 253.6769 69.909423) (xy 253.6769 71.414878) (xy 253.691432 71.487935) + (xy 253.691433 71.487939) (xy 253.691434 71.48794) (xy 253.746799 71.570801) (xy 253.82966 71.626166) + (xy 253.829664 71.626167) (xy 253.902721 71.640699) (xy 253.902724 71.6407) (xy 253.902726 71.6407) + (xy 254.459276 71.6407) (xy 254.459277 71.640699) (xy 254.53234 71.626166) (xy 254.615201 71.570801) + (xy 254.670566 71.48794) (xy 254.6851 71.414874) (xy 254.6851 70.104305) (xy 254.704785 70.037266) + (xy 254.757589 69.991511) (xy 254.826747 69.981567) (xy 254.890303 70.010592) (xy 254.909537 70.037324) + (xy 254.912244 70.035516) (xy 254.943069 70.081648) (xy 254.973223 70.126777) (xy 254.999643 70.14443) + (xy 255.054328 70.18097) (xy 255.149995 70.199999) (xy 255.149999 70.2) (xy 257.8 70.2) (xy 257.800001 70.2) + (xy 257.800002 70.199999) (xy 257.838612 70.192319) (xy 257.914802 70.177165) (xy 257.914802 70.177164) + (xy 257.914805 70.177164) (xy 258.012132 70.112132) (xy 258.077164 70.014805) (xy 258.1 69.9) (xy 258.115339 69.822885) + (xy 258.147722 69.760977) (xy 258.174948 69.739696) (xy 258.225564 69.710474) (xy 258.293561 69.642476) + (xy 258.35488 69.608994) (xy 258.356982 69.608556) (xy 258.372589 69.605452) (xy 258.388028 69.602382) + (xy 258.412214 69.6) (xy 260.793907 69.6) ) ) ) @@ -154475,24 +158450,35 @@ (xy 185.193453 211.081877) (xy 185.31518 211.146941) (xy 185.344798 211.162772) (xy 185.365008 211.176276) (xy 185.405356 211.209388) (xy 185.497666 211.285145) (xy 185.514854 211.302333) (xy 185.623722 211.434989) (xy 185.637227 211.455201) (xy 185.718121 211.606543) (xy 185.727424 211.629001) (xy 185.77724 211.793224) - (xy 185.781982 211.817065) (xy 185.799403 211.993938) (xy 185.8 212.006092) (xy 185.8 213.2) (xy 186.398929 213.2) - (xy 186.452721 213.2107) (xy 186.452724 213.210701) (xy 186.452726 213.210701) (xy 187.009275 213.210701) - (xy 187.034833 213.205616) (xy 187.051091 213.202382) (xy 187.075283 213.2) (xy 187.399996 213.2) - (xy 187.4 213.2) (xy 187.668929 213.2) (xy 187.722721 213.2107) (xy 187.722724 213.210701) (xy 187.722726 213.210701) - (xy 188.279276 213.210701) (xy 188.279277 213.2107) (xy 188.333071 213.2) (xy 188.4 213.2) (xy 188.4 213.164322) - (xy 188.435201 213.140802) (xy 188.490566 213.057941) (xy 188.5051 212.984875) (xy 188.5051 211.594158) - (xy 188.519741 211.535706) (xy 188.562775 211.455195) (xy 188.576272 211.434995) (xy 188.685149 211.302328) - (xy 188.702328 211.285149) (xy 188.834995 211.176272) (xy 188.855195 211.162775) (xy 188.88482 211.14694) - (xy 188.94327 211.132301) (xy 192.25673 211.132301) (xy 192.315181 211.146941) (xy 192.344798 211.162772) - (xy 192.365008 211.176276) (xy 192.405356 211.209388) (xy 192.497666 211.285145) (xy 192.514854 211.302333) - (xy 192.555943 211.3524) (xy 192.583256 211.41671) (xy 192.581708 211.455255) (xy 192.5769 211.479427) - (xy 192.5769 212.984879) (xy 192.591432 213.057936) (xy 192.591433 213.05794) (xy 192.591434 213.057941) - (xy 192.646799 213.140802) (xy 192.72966 213.196167) (xy 192.729664 213.196168) (xy 192.802721 213.2107) - (xy 192.802724 213.210701) (xy 192.802726 213.210701) (xy 193.359276 213.210701) (xy 193.359277 213.2107) - (xy 193.413071 213.2) (xy 194.006717 213.2) (xy 194.030908 213.202382) (xy 194.047166 213.205616) - (xy 194.072725 213.210701) (xy 194.072726 213.210701) (xy 194.629275 213.210701) (xy 194.654833 213.205616) - (xy 194.671091 213.202382) (xy 194.695283 213.2) (xy 197 213.2) (xy 197 218.4) (xy 190.8 218.4) - (xy 190.8 219.1) (xy 190.8 219.100001) (xy 190.784014 219.241881) (xy 190.777835 219.268952) (xy 190.735293 219.390529) + (xy 185.781982 211.817065) (xy 185.799403 211.993938) (xy 185.8 212.006092) (xy 185.8 212.2) (xy 185.806324 212.264207) + (xy 185.819214 212.395088) (xy 185.825881 212.417065) (xy 185.87612 212.582683) (xy 185.876121 212.582686) + (xy 185.876122 212.582687) (xy 185.876123 212.58269) (xy 185.968526 212.755564) (xy 185.968531 212.755571) + (xy 186.092892 212.907107) (xy 186.20026 212.995221) (xy 186.235619 213.04713) (xy 186.236761 213.046658) + (xy 186.239032 213.052141) (xy 186.239594 213.052966) (xy 186.239965 213.054393) (xy 186.241434 213.05794) + (xy 186.241434 213.057941) (xy 186.296799 213.140802) (xy 186.363827 213.185588) (xy 186.37966 213.196167) + (xy 186.379664 213.196168) (xy 186.452721 213.2107) (xy 186.452724 213.210701) (xy 186.452726 213.210701) + (xy 187.009275 213.210701) (xy 187.034833 213.205616) (xy 187.051091 213.202382) (xy 187.075283 213.2) + (xy 187.399996 213.2) (xy 187.4 213.2) (xy 187.578433 213.182425) (xy 187.637495 213.193626) (xy 187.638379 213.191494) + (xy 187.649657 213.196165) (xy 187.64966 213.196167) (xy 187.649663 213.196167) (xy 187.649664 213.196168) + (xy 187.722721 213.2107) (xy 187.722724 213.210701) (xy 187.722726 213.210701) (xy 188.279276 213.210701) + (xy 188.279277 213.2107) (xy 188.35234 213.196167) (xy 188.435201 213.140802) (xy 188.490566 213.057941) + (xy 188.5051 212.984875) (xy 188.5051 211.594158) (xy 188.519741 211.535706) (xy 188.562775 211.455195) + (xy 188.576272 211.434995) (xy 188.685149 211.302328) (xy 188.702328 211.285149) (xy 188.834995 211.176272) + (xy 188.855195 211.162775) (xy 188.88482 211.14694) (xy 188.94327 211.132301) (xy 192.25673 211.132301) + (xy 192.315181 211.146941) (xy 192.344798 211.162772) (xy 192.365008 211.176276) (xy 192.405356 211.209388) + (xy 192.497666 211.285145) (xy 192.514854 211.302333) (xy 192.555943 211.3524) (xy 192.583256 211.41671) + (xy 192.581708 211.455255) (xy 192.5769 211.479427) (xy 192.5769 212.984879) (xy 192.591432 213.057936) + (xy 192.591433 213.05794) (xy 192.591434 213.057941) (xy 192.646799 213.140802) (xy 192.713827 213.185588) + (xy 192.72966 213.196167) (xy 192.729664 213.196168) (xy 192.802721 213.2107) (xy 192.802724 213.210701) + (xy 192.802726 213.210701) (xy 193.359276 213.210701) (xy 193.359277 213.2107) (xy 193.43234 213.196167) + (xy 193.453292 213.182167) (xy 193.519967 213.161289) (xy 193.558176 213.166608) (xy 193.604907 213.180784) + (xy 193.604909 213.180785) (xy 193.653682 213.185588) (xy 193.8 213.2) (xy 194.006717 213.2) (xy 194.030908 213.202382) + (xy 194.047166 213.205616) (xy 194.072725 213.210701) (xy 194.072726 213.210701) (xy 194.629275 213.210701) + (xy 194.654833 213.205616) (xy 194.671091 213.202382) (xy 194.695283 213.2) (xy 196 213.2) (xy 197 213.2) + (xy 197 218.4) (xy 191.499993 218.4) (xy 191.344242 218.417548) (xy 191.344233 218.41755) (xy 191.196281 218.469321) + (xy 191.196278 218.469323) (xy 191.063556 218.552718) (xy 190.952718 218.663556) (xy 190.869323 218.796278) + (xy 190.869321 218.796281) (xy 190.81755 218.944233) (xy 190.817548 218.944242) (xy 190.8 219.1) + (xy 190.8 219.100001) (xy 190.784014 219.241881) (xy 190.777835 219.268952) (xy 190.735293 219.390529) (xy 190.723246 219.415546) (xy 190.654714 219.524614) (xy 190.637401 219.546323) (xy 190.546323 219.637401) (xy 190.524614 219.654714) (xy 190.415546 219.723246) (xy 190.390529 219.735293) (xy 190.268952 219.777835) (xy 190.241881 219.784014) (xy 190.146062 219.79481) (xy 190.106921 219.79922) (xy 190.09304 219.8) @@ -154507,12 +158493,14 @@ (xy 185.500257 219.001261) (xy 185.500252 219.00127) (xy 185.442926 219.139669) (xy 185.442924 219.139677) (xy 185.413701 219.286592) (xy 185.413701 219.436407) (xy 185.442924 219.583322) (xy 185.442926 219.58333) (xy 185.461656 219.628548) (xy 185.469125 219.698016) (xy 185.43785 219.760495) (xy 185.377762 219.796148) - (xy 185.347095 219.8) (xy 178.6 219.8) (xy 178.6 212.606092) (xy 178.600597 212.593938) (xy 178.601705 212.582687) - (xy 178.618018 212.417056) (xy 178.622757 212.393232) (xy 178.672577 212.228994) (xy 178.681875 212.206549) - (xy 178.762775 212.055195) (xy 178.776272 212.034995) (xy 178.885149 211.902328) (xy 178.902328 211.885149) - (xy 179.034995 211.776272) (xy 179.055195 211.762775) (xy 179.206549 211.681875) (xy 179.228994 211.672577) - (xy 179.393232 211.622757) (xy 179.417056 211.618018) (xy 179.593939 211.600597) (xy 179.606093 211.6) - (xy 183.300001 211.6) (xy 183.6 211.6) (xy 183.6 211.3) (xy 183.618025 211.209379) (xy 183.636534 211.164693) + (xy 185.347095 219.8) (xy 179.6 219.8) (xy 178.6 219.8) (xy 178.6 212.606092) (xy 178.600597 212.593938) + (xy 178.601705 212.582687) (xy 178.618018 212.417056) (xy 178.622757 212.393232) (xy 178.672577 212.228994) + (xy 178.681875 212.206549) (xy 178.762775 212.055195) (xy 178.776272 212.034995) (xy 178.885149 211.902328) + (xy 178.902328 211.885149) (xy 179.034995 211.776272) (xy 179.055195 211.762775) (xy 179.206549 211.681875) + (xy 179.228994 211.672577) (xy 179.393232 211.622757) (xy 179.417056 211.618018) (xy 179.593939 211.600597) + (xy 179.606093 211.6) (xy 183.300001 211.6) (xy 183.300002 211.599999) (xy 183.338612 211.592319) + (xy 183.414802 211.577165) (xy 183.414802 211.577164) (xy 183.414805 211.577164) (xy 183.512132 211.512132) + (xy 183.577164 211.414805) (xy 183.6 211.3) (xy 183.618025 211.209379) (xy 183.636534 211.164693) (xy 183.674168 211.10837) (xy 183.70837 211.074168) (xy 183.764693 211.036534) (xy 183.809379 211.018025) (xy 183.888028 211.002381) (xy 183.912211 211) (xy 184.793907 211) ) @@ -154558,32 +158546,47 @@ (xy 130.490925 70.887703) (xy 130.315385 70.981531) (xy 130.315378 70.981535) (xy 130.161511 71.107811) (xy 130.035235 71.261678) (xy 130.035231 71.261685) (xy 129.941403 71.437225) (xy 129.883621 71.627704) (xy 129.864111 71.8258) (xy 129.867858 71.863847) (xy 129.854839 71.932493) (xy 129.806774 71.983203) - (xy 129.744455 72) (xy 121.6 72) (xy 121.6 73) (xy 121.6 73.000003) (xy 121.6 74.2826) (xy 121.580315 74.349639) - (xy 121.563681 74.370281) (xy 121.194438 74.739525) (xy 121.124526 74.809436) (xy 121.075091 74.895059) - (xy 121.075091 74.89506) (xy 121.07509 74.895062) (xy 121.0495 74.990565) (xy 121.0495 74.990567) - (xy 121.0495 78.718099) (xy 121.029815 78.785138) (xy 121.013181 78.805781) (xy 120.8789 78.940061) - (xy 120.827213 78.97104) (xy 120.806777 78.977239) (xy 120.782938 78.981981) (xy 120.618067 78.99822) - (xy 120.60606 78.999403) (xy 120.593907 79) (xy 120.006093 79) (xy 119.993939 78.999403) (xy 119.817065 78.981982) - (xy 119.793224 78.97724) (xy 119.629001 78.927424) (xy 119.606543 78.918121) (xy 119.455201 78.837227) - (xy 119.434989 78.823722) (xy 119.302333 78.714854) (xy 119.285145 78.697666) (xy 119.176277 78.56501) - (xy 119.162772 78.544798) (xy 119.081878 78.393456) (xy 119.072575 78.370998) (xy 119.022757 78.206769) - (xy 119.018018 78.182941) (xy 119.000597 78.006061) (xy 119 77.993907) (xy 119 73.200003) (xy 119 73.2) - (xy 119 72.2) (xy 118 72.2) (xy 117.999997 72.2) (xy 113.606093 72.2) (xy 113.593939 72.199403) - (xy 113.417065 72.181982) (xy 113.393224 72.17724) (xy 113.229001 72.127424) (xy 113.206543 72.118121) - (xy 113.055201 72.037227) (xy 113.034989 72.023722) (xy 112.902333 71.914854) (xy 112.885145 71.897666) - (xy 112.776277 71.76501) (xy 112.762772 71.744798) (xy 112.681878 71.593456) (xy 112.672575 71.570998) - (xy 112.631996 71.437225) (xy 112.622757 71.406769) (xy 112.618018 71.382941) (xy 112.600597 71.206061) - (xy 112.6 71.193907) (xy 112.6 69.206092) (xy 112.600597 69.193938) (xy 112.618018 69.017056) (xy 112.622757 68.993232) + (xy 129.744455 72) (xy 122.6 72) (xy 122.551844 72.004743) (xy 122.404911 72.019214) (xy 122.294149 72.052813) + (xy 122.217317 72.07612) (xy 122.217314 72.076121) (xy 122.217312 72.076122) (xy 122.217309 72.076123) + (xy 122.044435 72.168526) (xy 122.044428 72.168531) (xy 121.892892 72.292892) (xy 121.768531 72.444428) + (xy 121.768526 72.444435) (xy 121.676123 72.617309) (xy 121.676122 72.617312) (xy 121.676121 72.617314) + (xy 121.67612 72.617317) (xy 121.667894 72.644435) (xy 121.619214 72.804911) (xy 121.6 73.000003) + (xy 121.6 74.2826) (xy 121.580315 74.349639) (xy 121.563681 74.370281) (xy 121.194438 74.739525) + (xy 121.124526 74.809436) (xy 121.075091 74.895059) (xy 121.075091 74.89506) (xy 121.07509 74.895062) + (xy 121.0495 74.990565) (xy 121.0495 74.990567) (xy 121.0495 78.718099) (xy 121.029815 78.785138) + (xy 121.013181 78.805781) (xy 120.8789 78.940061) (xy 120.827213 78.97104) (xy 120.806777 78.977239) + (xy 120.782938 78.981981) (xy 120.618067 78.99822) (xy 120.60606 78.999403) (xy 120.593907 79) (xy 120.006093 79) + (xy 119.993939 78.999403) (xy 119.817065 78.981982) (xy 119.793224 78.97724) (xy 119.629001 78.927424) + (xy 119.606543 78.918121) (xy 119.455201 78.837227) (xy 119.434989 78.823722) (xy 119.302333 78.714854) + (xy 119.285145 78.697666) (xy 119.176277 78.56501) (xy 119.162772 78.544798) (xy 119.081878 78.393456) + (xy 119.072575 78.370998) (xy 119.022757 78.206769) (xy 119.018018 78.182941) (xy 119.000597 78.006061) + (xy 119 77.993907) (xy 119 73.200003) (xy 118.980785 73.004911) (xy 118.979296 73.000003) (xy 118.92388 72.817317) + (xy 118.917249 72.804911) (xy 118.831473 72.644435) (xy 118.831471 72.644433) (xy 118.83147 72.64443) + (xy 118.793648 72.598344) (xy 118.707107 72.492892) (xy 118.555571 72.368531) (xy 118.555564 72.368526) + (xy 118.38269 72.276123) (xy 118.382687 72.276122) (xy 118.382686 72.276121) (xy 118.382683 72.27612) + (xy 118.19509 72.219215) (xy 118.195088 72.219214) (xy 118.19509 72.219214) (xy 118.044494 72.204382) + (xy 118 72.2) (xy 117.999997 72.2) (xy 113.606093 72.2) (xy 113.593939 72.199403) (xy 113.417065 72.181982) + (xy 113.393224 72.17724) (xy 113.229001 72.127424) (xy 113.206543 72.118121) (xy 113.055201 72.037227) + (xy 113.034989 72.023722) (xy 112.902333 71.914854) (xy 112.885145 71.897666) (xy 112.776277 71.76501) + (xy 112.762772 71.744798) (xy 112.681878 71.593456) (xy 112.672575 71.570998) (xy 112.631996 71.437225) + (xy 112.622757 71.406769) (xy 112.618018 71.382941) (xy 112.600597 71.206061) (xy 112.6 71.193907) + (xy 112.6 69.206092) (xy 112.600597 69.193938) (xy 112.618018 69.017056) (xy 112.622757 68.993232) (xy 112.672577 68.828994) (xy 112.681875 68.806549) (xy 112.762775 68.655195) (xy 112.776272 68.634995) (xy 112.885149 68.502328) (xy 112.902328 68.485149) (xy 113.034995 68.376272) (xy 113.055195 68.362775) (xy 113.206549 68.281875) (xy 113.228994 68.272577) (xy 113.393232 68.222757) (xy 113.417056 68.218018) - (xy 113.593939 68.200597) (xy 113.606093 68.2) (xy 121.799997 68.2) (xy 121.8 68.2) (xy 122.8 68.2) - (xy 122.8 67.49519) (xy 122.843452 67.413898) (xy 122.85417 67.391237) (xy 122.863473 67.368779) - (xy 122.871922 67.345165) (xy 122.921738 67.180942) (xy 122.927831 67.156618) (xy 122.932573 67.132777) - (xy 122.936252 67.107978) (xy 122.953673 66.931105) (xy 122.954595 66.918596) (xy 122.955192 66.906442) - (xy 122.9555 66.893907) (xy 122.9555 65.504674) (xy 122.975185 65.437635) (xy 122.983641 65.426016) - (xy 123.085149 65.302328) (xy 123.102328 65.285149) (xy 123.234995 65.176272) (xy 123.255195 65.162775) - (xy 123.406549 65.081875) (xy 123.429003 65.072575) (xy 123.467694 65.060839) (xy 123.503687 65.0555) + (xy 113.593939 68.200597) (xy 113.606093 68.2) (xy 121.799997 68.2) (xy 121.8 68.2) (xy 121.99509 68.180785) + (xy 122.182683 68.12388) (xy 122.35557 68.03147) (xy 122.507107 67.907107) (xy 122.63147 67.75557) + (xy 122.655003 67.711541) (xy 122.668497 67.691348) (xy 122.721226 67.627098) (xy 122.736164 67.606957) + (xy 122.749669 67.586745) (xy 122.762558 67.56524) (xy 122.843452 67.413898) (xy 122.85417 67.391237) + (xy 122.863473 67.368779) (xy 122.871922 67.345165) (xy 122.921738 67.180942) (xy 122.927831 67.156618) + (xy 122.932573 67.132777) (xy 122.936252 67.107978) (xy 122.953673 66.931105) (xy 122.954595 66.918596) + (xy 122.955192 66.906442) (xy 122.9555 66.893907) (xy 122.9555 65.818647) (xy 122.956097 65.806494) + (xy 122.96982 65.667148) (xy 122.97456 65.643314) (xy 123.009774 65.52723) (xy 123.019064 65.504801) + (xy 123.076242 65.397829) (xy 123.089743 65.377626) (xy 123.166682 65.283873) (xy 123.183873 65.266682) + (xy 123.277626 65.189743) (xy 123.297829 65.176242) (xy 123.404798 65.119066) (xy 123.427236 65.109772) + (xy 123.468318 65.097311) (xy 123.468317 65.09731) (xy 123.470503 65.096646) (xy 123.535505 65.07693) + (xy 123.535534 65.07692) (xy 123.543303 65.074563) (xy 123.567142 65.06982) (xy 123.676886 65.059013) + (xy 123.676888 65.059013) (xy 123.696845 65.057047) (xy 123.706499 65.056097) (xy 123.718648 65.0555) (xy 126.993887 65.0555) (xy 126.993907 65.0555) (xy 127.006442 65.055192) (xy 127.018596 65.054595) (xy 127.031105 65.053673) (xy 127.207978 65.036252) (xy 127.232777 65.032573) (xy 127.256618 65.027831) (xy 127.280942 65.021738) (xy 127.335003 65.005339) (xy 127.370997 65) (xy 130.606622 65) @@ -154622,142 +158625,154 @@ (xy 265.941205 129.367045) (xy 265.954834 129.371922) (xy 266.119057 129.421738) (xy 266.143381 129.427831) (xy 266.167222 129.432573) (xy 266.185462 129.435278) (xy 266.19202 129.436252) (xy 266.209984 129.438021) (xy 266.368895 129.453673) (xy 266.381404 129.454595) (xy 266.393558 129.455192) (xy 266.406093 129.4555) - (xy 271.117175 129.4555) (xy 271.184214 129.475185) (xy 271.195828 129.483637) (xy 271.197655 129.485136) - (xy 271.214845 129.502322) (xy 271.216347 129.504153) (xy 271.243665 129.568459) (xy 271.2445 129.582824) - (xy 271.2445 139.542217) (xy 271.244663 139.55133) (xy 271.244979 139.560179) (xy 271.244979 139.560183) - (xy 271.260925 139.640345) (xy 271.285341 139.705808) (xy 271.304998 139.746896) (xy 271.371611 139.821056) - (xy 271.371615 139.82106) (xy 271.371618 139.821062) (xy 271.407749 139.84811) (xy 271.44962 139.904043) - (xy 271.454604 139.973735) (xy 271.440826 140.009375) (xy 271.396895 140.085466) (xy 271.396893 140.085471) - (xy 271.299053 140.321677) (xy 271.29905 140.321687) (xy 271.232874 140.568661) (xy 271.1995 140.822149) - (xy 271.1995 141.07785) (xy 271.224202 141.26547) (xy 271.232874 141.33134) (xy 271.286401 141.531105) - (xy 271.29905 141.578312) (xy 271.299053 141.578322) (xy 271.396894 141.814531) (xy 271.396899 141.814542) - (xy 271.440058 141.889295) (xy 271.456531 141.957195) (xy 271.433678 142.023222) (xy 271.40938 142.047452) - (xy 271.409776 142.047909) (xy 271.352371 142.097649) (xy 271.320743 142.130426) (xy 271.274534 142.218763) - (xy 271.274533 142.218763) (xy 271.254851 142.285795) (xy 271.254848 142.285807) (xy 271.2445 142.357784) - (xy 271.2445 145.345721) (xy 271.224815 145.41276) (xy 271.209327 145.432241) (xy 271.029344 145.617022) - (xy 271.029322 145.617048) (xy 256.6048 160.426222) (xy 256.596445 160.435225) (xy 256.58848 160.444232) - (xy 256.580558 160.453641) (xy 256.564018 160.474275) (xy 256.506728 160.51427) (xy 256.463189 160.515936) - (xy 256.472749 160.547216) (xy 256.453802 160.614468) (xy 256.452537 160.616442) (xy 256.443689 160.629971) - (xy 256.443663 160.630013) (xy 256.431203 160.651235) (xy 256.352874 160.800723) (xy 256.35287 160.800731) - (xy 256.342515 160.823052) (xy 256.342506 160.823071) (xy 256.333522 160.845169) (xy 256.333504 160.845215) - (xy 256.325334 160.868469) (xy 256.325325 160.868497) (xy 256.305857 160.933833) (xy 256.267848 160.992459) - (xy 256.235574 161.01252) (xy 255.789841 161.202194) (xy 255.72045 161.210331) (xy 255.657672 161.179659) - (xy 255.621443 161.119916) (xy 255.617291 161.088095) (xy 255.617291 160.7745) (xy 255.636976 160.707461) - (xy 255.68978 160.661706) (xy 255.741291 160.6505) (xy 255.878999 160.6505) (xy 256.032379 160.612696) - (xy 256.172252 160.539284) (xy 256.172251 160.539284) (xy 256.172254 160.539283) (xy 256.26653 160.455762) - (xy 256.329762 160.426041) (xy 256.350183 160.428748) (xy 256.345295 160.419044) (xy 256.352586 160.349556) - (xy 256.365215 160.32628) (xy 256.380234 160.304523) (xy 256.436251 160.156818) (xy 256.455292 160) - (xy 256.436251 159.843182) (xy 256.380234 159.695477) (xy 256.290497 159.56547) (xy 256.172254 159.460717) - (xy 256.172252 159.460716) (xy 256.172251 159.460715) (xy 256.032379 159.387303) (xy 255.879 159.3495) - (xy 255.878999 159.3495) (xy 255.721029 159.3495) (xy 255.721028 159.3495) (xy 255.567648 159.387303) - (xy 255.427776 159.460715) (xy 255.30953 159.565471) (xy 255.219795 159.695475) (xy 255.219794 159.695476) - (xy 255.163777 159.843181) (xy 255.144736 160) (xy 255.15091 160.050853) (xy 255.139449 160.119776) - (xy 255.115496 160.153478) (xy 255.011229 160.257747) (xy 255.011229 160.257748) (xy 254.941316 160.327661) - (xy 254.891882 160.413282) (xy 254.891882 160.413283) (xy 254.891881 160.413285) (xy 254.866291 160.508788) - (xy 254.866291 160.50879) (xy 254.866291 161.399912) (xy 254.846606 161.466951) (xy 254.801721 161.508742) - (xy 254.795846 161.51195) (xy 254.687819 161.592818) (xy 254.621781 161.681034) (xy 254.571067 161.720822) - (xy 254.464355 161.766231) (xy 254.39496 161.774368) (xy 254.332183 161.743695) (xy 254.307799 161.707575) - (xy 254.305876 161.708626) (xy 254.301626 161.700844) (xy 254.301625 161.70084) (xy 254.286923 161.6812) - (xy 254.220762 161.592819) (xy 254.197844 161.575663) (xy 254.112739 161.511954) (xy 254.112736 161.511952) - (xy 253.986313 161.464799) (xy 253.930433 161.45879) (xy 253.930419 161.45879) (xy 253.403159 161.45879) - (xy 253.403144 161.45879) (xy 253.347264 161.464799) (xy 253.220841 161.511952) (xy 253.220838 161.511954) - (xy 253.112817 161.592818) (xy 253.031953 161.700839) (xy 253.031951 161.700842) (xy 252.984798 161.827265) - (xy 252.978789 161.883145) (xy 252.978789 162.038807) (xy 252.959104 162.105846) (xy 252.94247 162.126488) - (xy 252.459263 162.609693) (xy 252.420136 162.636111) (xy 252.257238 162.70543) (xy 252.17695 162.739595) - (xy 252.128399 162.749496) (xy 252.121014 162.749496) (xy 251.967634 162.787299) (xy 251.827762 162.860711) - (xy 251.788808 162.895221) (xy 251.73665 162.941429) (xy 251.709516 162.965467) (xy 251.621487 163.093) - (xy 251.610844 163.10635) (xy 250.962845 163.813259) (xy 250.96284 163.813265) (xy 250.7 164.1) - (xy 250.7 175.2) (xy 250.700072 175.2059) (xy 250.789634 182.550063) (xy 250.789635 182.550071) - (xy 250.8 183.4) (xy 251.65 183.4) (xy 251.825254 183.419746) (xy 251.852326 183.425924) (xy 252.005615 183.479562) - (xy 252.030632 183.49161) (xy 252.168138 183.578011) (xy 252.189846 183.595323) (xy 252.304676 183.710153) - (xy 252.321989 183.731862) (xy 252.408389 183.869367) (xy 252.420437 183.894384) (xy 252.474075 184.047673) - (xy 252.480253 184.074744) (xy 252.49922 184.243076) (xy 252.5 184.25696) (xy 252.5 200.993907) - (xy 252.499403 201.006061) (xy 252.481982 201.182934) (xy 252.47724 201.206775) (xy 252.427424 201.370998) - (xy 252.418121 201.393456) (xy 252.337227 201.544798) (xy 252.323722 201.56501) (xy 252.214854 201.697666) - (xy 252.197666 201.714854) (xy 252.06501 201.823722) (xy 252.044798 201.837227) (xy 251.893456 201.918121) - (xy 251.870998 201.927424) (xy 251.706775 201.97724) (xy 251.682934 201.981982) (xy 251.506061 201.999403) - (xy 251.493907 202) (xy 245.206093 202) (xy 245.193939 201.999403) (xy 245.017065 201.981982) (xy 244.993224 201.97724) - (xy 244.829001 201.927424) (xy 244.806543 201.918121) (xy 244.655201 201.837227) (xy 244.634989 201.823722) - (xy 244.502333 201.714854) (xy 244.485145 201.697666) (xy 244.376277 201.56501) (xy 244.362772 201.544798) - (xy 244.283249 201.396021) (xy 244.269512 201.352518) (xy 244.256237 201.243182) (xy 244.218468 201.143594) - (xy 244.21101 201.111787) (xy 244.200597 201.00606) (xy 244.2 200.993907) (xy 244.2 194.102155) - (xy 244.815 194.102155) (xy 244.815 195.1) (xy 245.752639 195.1) (xy 245.745743 195.116649) (xy 245.715 195.271207) - (xy 245.715 195.428793) (xy 245.745743 195.583351) (xy 245.752639 195.6) (xy 244.815 195.6) (xy 244.815 196.597844) - (xy 244.821401 196.657372) (xy 244.821403 196.657379) (xy 244.871645 196.792086) (xy 244.871649 196.792093) - (xy 244.957809 196.907187) (xy 244.957812 196.90719) (xy 245.072906 196.99335) (xy 245.072913 196.993354) - (xy 245.20762 197.043596) (xy 245.207627 197.043598) (xy 245.267155 197.049999) (xy 245.267172 197.05) - (xy 246.265 197.05) (xy 246.265 196.11236) (xy 246.281649 196.119257) (xy 246.436207 196.15) (xy 246.593793 196.15) - (xy 246.748351 196.119257) (xy 246.765 196.11236) (xy 246.765 197.05) (xy 247.762828 197.05) (xy 247.762844 197.049999) - (xy 247.822372 197.043598) (xy 247.822379 197.043596) (xy 247.957086 196.993354) (xy 247.957093 196.99335) - (xy 248.072187 196.90719) (xy 248.07219 196.907187) (xy 248.15835 196.792093) (xy 248.158354 196.792086) - (xy 248.208596 196.657379) (xy 248.208598 196.657372) (xy 248.214999 196.597844) (xy 248.215 196.597827) - (xy 248.215 196.268288) (xy 248.234685 196.201249) (xy 248.287489 196.155494) (xy 248.356647 196.14555) - (xy 248.420203 196.174575) (xy 248.446387 196.206288) (xy 248.506454 196.310327) (xy 248.506461 196.310338) - (xy 248.548452 196.362991) (xy 248.548453 196.362992) (xy 249.199152 195.712292) (xy 249.206049 195.728942) - (xy 249.293599 195.85997) (xy 249.40503 195.971401) (xy 249.536058 196.058951) (xy 249.552705 196.065846) - (xy 248.901813 196.716738) (xy 249.062616 196.826371) (xy 249.062624 196.826376) (xy 249.292176 196.936921) - (xy 249.292174 196.936921) (xy 249.535652 197.012024) (xy 249.535658 197.012026) (xy 249.787595 197.049999) - (xy 249.787604 197.05) (xy 250.042396 197.05) (xy 250.042404 197.049999) (xy 250.294341 197.012026) - (xy 250.294347 197.012024) (xy 250.537824 196.936921) (xy 250.767376 196.826376) (xy 250.767377 196.826375) - (xy 250.928185 196.716738) (xy 250.277294 196.065846) (xy 250.293942 196.058951) (xy 250.42497 195.971401) - (xy 250.536401 195.85997) (xy 250.623951 195.728942) (xy 250.630846 195.712294) (xy 251.281544 196.362992) - (xy 251.281546 196.362991) (xy 251.323544 196.31033) (xy 251.450941 196.089671) (xy 251.544026 195.852494) - (xy 251.544031 195.852477) (xy 251.600726 195.604079) (xy 251.619767 195.350004) (xy 251.619767 195.349995) - (xy 251.600726 195.09592) (xy 251.544031 194.847522) (xy 251.544026 194.847505) (xy 251.450941 194.610328) - (xy 251.450942 194.610328) (xy 251.323545 194.389672) (xy 251.281545 194.337006) (xy 250.630846 194.987705) - (xy 250.623951 194.971058) (xy 250.536401 194.84003) (xy 250.42497 194.728599) (xy 250.293942 194.641049) - (xy 250.277293 194.634152) (xy 250.928185 193.98326) (xy 250.767384 193.873628) (xy 250.767376 193.873623) - (xy 250.537823 193.763078) (xy 250.537825 193.763078) (xy 250.294347 193.687975) (xy 250.294341 193.687973) - (xy 250.042404 193.65) (xy 249.787595 193.65) (xy 249.535658 193.687973) (xy 249.535652 193.687975) - (xy 249.292175 193.763078) (xy 249.062622 193.873625) (xy 249.062609 193.873632) (xy 248.901813 193.983259) - (xy 249.552706 194.634152) (xy 249.536058 194.641049) (xy 249.40503 194.728599) (xy 249.293599 194.84003) - (xy 249.206049 194.971058) (xy 249.199152 194.987706) (xy 248.548452 194.337006) (xy 248.506459 194.389664) - (xy 248.446387 194.493712) (xy 248.39582 194.541927) (xy 248.327212 194.555149) (xy 248.262348 194.529181) - (xy 248.22182 194.472267) (xy 248.215 194.431711) (xy 248.215 194.102172) (xy 248.214999 194.102155) - (xy 248.208598 194.042627) (xy 248.208596 194.04262) (xy 248.158354 193.907913) (xy 248.15835 193.907906) - (xy 248.07219 193.792812) (xy 248.072187 193.792809) (xy 247.957093 193.706649) (xy 247.957086 193.706645) - (xy 247.822379 193.656403) (xy 247.822372 193.656401) (xy 247.762844 193.65) (xy 246.765 193.65) - (xy 246.765 194.587639) (xy 246.748351 194.580743) (xy 246.593793 194.55) (xy 246.436207 194.55) - (xy 246.281649 194.580743) (xy 246.265 194.587639) (xy 246.265 193.65) (xy 245.267155 193.65) (xy 245.207627 193.656401) - (xy 245.20762 193.656403) (xy 245.072913 193.706645) (xy 245.072906 193.706649) (xy 244.957812 193.792809) - (xy 244.957809 193.792812) (xy 244.871649 193.907906) (xy 244.871645 193.907913) (xy 244.821403 194.04262) - (xy 244.821401 194.042627) (xy 244.815 194.102155) (xy 244.2 194.102155) (xy 244.2 192.399996) (xy 244.2 191.6) - (xy 243.400001 191.6) (xy 243.4 191.6) (xy 243.235869 191.581506) (xy 243.208798 191.575328) (xy 243.066078 191.525388) + (xy 270.481355 129.4555) (xy 270.493507 129.456097) (xy 270.519451 129.458651) (xy 270.519451 129.458652) + (xy 270.632845 129.469819) (xy 270.656676 129.474558) (xy 270.772757 129.509771) (xy 270.795206 129.51907) + (xy 270.902162 129.576239) (xy 270.922371 129.589743) (xy 271.016124 129.666682) (xy 271.033315 129.683872) + (xy 271.091741 129.755066) (xy 271.091751 129.755079) (xy 271.110255 129.777628) (xy 271.123758 129.797836) + (xy 271.180926 129.904788) (xy 271.190229 129.927247) (xy 271.225436 130.043309) (xy 271.230178 130.067149) + (xy 271.243903 130.206496) (xy 271.2445 130.218651) (xy 271.2445 139.542217) (xy 271.244663 139.55133) + (xy 271.244979 139.560179) (xy 271.244979 139.560183) (xy 271.260925 139.640345) (xy 271.285341 139.705808) + (xy 271.304998 139.746896) (xy 271.371611 139.821056) (xy 271.371615 139.82106) (xy 271.371618 139.821062) + (xy 271.407749 139.84811) (xy 271.44962 139.904043) (xy 271.454604 139.973735) (xy 271.440826 140.009375) + (xy 271.396895 140.085466) (xy 271.396893 140.085471) (xy 271.299053 140.321677) (xy 271.29905 140.321687) + (xy 271.232874 140.568661) (xy 271.1995 140.822149) (xy 271.1995 141.07785) (xy 271.224202 141.26547) + (xy 271.232874 141.33134) (xy 271.286401 141.531105) (xy 271.29905 141.578312) (xy 271.299053 141.578322) + (xy 271.396894 141.814531) (xy 271.396899 141.814542) (xy 271.440058 141.889295) (xy 271.456531 141.957195) + (xy 271.433678 142.023222) (xy 271.40938 142.047452) (xy 271.409776 142.047909) (xy 271.352371 142.097649) + (xy 271.320743 142.130426) (xy 271.274534 142.218763) (xy 271.274533 142.218763) (xy 271.254851 142.285795) + (xy 271.254848 142.285807) (xy 271.2445 142.357784) (xy 271.2445 145.075134) (xy 271.243923 145.087085) + (xy 271.230652 145.224135) (xy 271.226066 145.247594) (xy 271.192007 145.361896) (xy 271.183005 145.384038) + (xy 271.127654 145.489672) (xy 271.114572 145.509676) (xy 271.028452 145.617113) (xy 271.020526 145.626077) + (xy 256.6048 160.426222) (xy 256.596445 160.435225) (xy 256.58848 160.444232) (xy 256.580558 160.453641) + (xy 256.564018 160.474275) (xy 256.506728 160.51427) (xy 256.463189 160.515936) (xy 256.472749 160.547216) + (xy 256.453802 160.614468) (xy 256.452537 160.616442) (xy 256.443689 160.629971) (xy 256.443663 160.630013) + (xy 256.431203 160.651235) (xy 256.352874 160.800723) (xy 256.35287 160.800731) (xy 256.342515 160.823052) + (xy 256.342506 160.823071) (xy 256.333522 160.845169) (xy 256.333504 160.845215) (xy 256.325334 160.868469) + (xy 256.325325 160.868497) (xy 256.305857 160.933833) (xy 256.267848 160.992459) (xy 256.235574 161.012521) + (xy 255.789844 161.202194) (xy 255.72045 161.210331) (xy 255.657672 161.179659) (xy 255.621443 161.119916) + (xy 255.617291 161.088095) (xy 255.617291 160.7745) (xy 255.636976 160.707461) (xy 255.68978 160.661706) + (xy 255.741291 160.6505) (xy 255.878999 160.6505) (xy 256.032379 160.612696) (xy 256.172252 160.539284) + (xy 256.172251 160.539284) (xy 256.172254 160.539283) (xy 256.26653 160.455762) (xy 256.329762 160.426041) + (xy 256.350183 160.428748) (xy 256.345295 160.419044) (xy 256.352586 160.349556) (xy 256.365215 160.32628) + (xy 256.380234 160.304523) (xy 256.436251 160.156818) (xy 256.455292 160) (xy 256.436251 159.843182) + (xy 256.380234 159.695477) (xy 256.290497 159.56547) (xy 256.172254 159.460717) (xy 256.172252 159.460716) + (xy 256.172251 159.460715) (xy 256.032379 159.387303) (xy 255.879 159.3495) (xy 255.878999 159.3495) + (xy 255.721029 159.3495) (xy 255.721028 159.3495) (xy 255.567648 159.387303) (xy 255.427776 159.460715) + (xy 255.30953 159.565471) (xy 255.219795 159.695475) (xy 255.219794 159.695476) (xy 255.163777 159.843181) + (xy 255.144736 160) (xy 255.15091 160.050853) (xy 255.139449 160.119776) (xy 255.115496 160.153478) + (xy 255.011229 160.257747) (xy 255.011229 160.257748) (xy 254.941316 160.327661) (xy 254.891882 160.413282) + (xy 254.891882 160.413283) (xy 254.891881 160.413285) (xy 254.866291 160.508788) (xy 254.866291 160.50879) + (xy 254.866291 161.399912) (xy 254.846606 161.466951) (xy 254.801721 161.508742) (xy 254.795846 161.51195) + (xy 254.687819 161.592818) (xy 254.621781 161.681034) (xy 254.571067 161.720822) (xy 254.464355 161.766231) + (xy 254.39496 161.774368) (xy 254.332183 161.743695) (xy 254.307799 161.707575) (xy 254.305876 161.708626) + (xy 254.301626 161.700844) (xy 254.301625 161.70084) (xy 254.286923 161.6812) (xy 254.220762 161.592819) + (xy 254.197844 161.575663) (xy 254.112739 161.511954) (xy 254.112736 161.511952) (xy 253.986313 161.464799) + (xy 253.930433 161.45879) (xy 253.930419 161.45879) (xy 253.403159 161.45879) (xy 253.403144 161.45879) + (xy 253.347264 161.464799) (xy 253.220841 161.511952) (xy 253.220838 161.511954) (xy 253.112817 161.592818) + (xy 253.031953 161.700839) (xy 253.031951 161.700842) (xy 252.984798 161.827265) (xy 252.978789 161.883145) + (xy 252.978789 162.038807) (xy 252.959104 162.105846) (xy 252.94247 162.126488) (xy 252.459263 162.609693) + (xy 252.420136 162.636111) (xy 252.238671 162.713331) (xy 252.17695 162.739595) (xy 252.128399 162.749496) + (xy 252.121014 162.749496) (xy 251.967634 162.787299) (xy 251.827762 162.860711) (xy 251.788808 162.895221) + (xy 251.73665 162.941429) (xy 251.709516 162.965467) (xy 251.621487 163.093) (xy 251.610844 163.10635) + (xy 250.962845 163.813259) (xy 250.962835 163.813272) (xy 250.850872 163.960795) (xy 250.768026 164.126458) + (xy 250.768022 164.126467) (xy 250.717154 164.304551) (xy 250.717152 164.304559) (xy 250.70269 164.46006) + (xy 250.700921 164.479088) (xy 250.7 164.488986) (xy 250.7 175.194096) (xy 250.700018 175.199927) + (xy 250.700019 175.2) (xy 250.700072 175.205985) (xy 250.750288 179.323737) (xy 250.789634 182.550063) + (xy 250.789634 182.55007) (xy 250.8 183.4) (xy 251.5 183.4) (xy 251.65 183.4) (xy 251.825254 183.419746) + (xy 251.852326 183.425924) (xy 252.005615 183.479562) (xy 252.030632 183.49161) (xy 252.168138 183.578011) + (xy 252.189846 183.595323) (xy 252.304676 183.710153) (xy 252.321989 183.731862) (xy 252.408389 183.869367) + (xy 252.420437 183.894384) (xy 252.474075 184.047673) (xy 252.480253 184.074744) (xy 252.49922 184.243076) + (xy 252.5 184.25696) (xy 252.5 200.993907) (xy 252.499403 201.006061) (xy 252.481982 201.182934) + (xy 252.47724 201.206775) (xy 252.427424 201.370998) (xy 252.418121 201.393456) (xy 252.337227 201.544798) + (xy 252.323722 201.56501) (xy 252.214854 201.697666) (xy 252.197666 201.714854) (xy 252.06501 201.823722) + (xy 252.044798 201.837227) (xy 251.893456 201.918121) (xy 251.870998 201.927424) (xy 251.706775 201.97724) + (xy 251.682934 201.981982) (xy 251.506061 201.999403) (xy 251.493907 202) (xy 245.206093 202) (xy 245.193939 201.999403) + (xy 245.017065 201.981982) (xy 244.993224 201.97724) (xy 244.829001 201.927424) (xy 244.806543 201.918121) + (xy 244.655201 201.837227) (xy 244.634989 201.823722) (xy 244.502333 201.714854) (xy 244.485145 201.697666) + (xy 244.376277 201.56501) (xy 244.362772 201.544798) (xy 244.283249 201.396021) (xy 244.269512 201.352518) + (xy 244.256237 201.243182) (xy 244.218468 201.143594) (xy 244.21101 201.111787) (xy 244.200597 201.00606) + (xy 244.2 200.993907) (xy 244.2 194.102155) (xy 244.815 194.102155) (xy 244.815 195.1) (xy 245.752639 195.1) + (xy 245.745743 195.116649) (xy 245.715 195.271207) (xy 245.715 195.428793) (xy 245.745743 195.583351) + (xy 245.752639 195.6) (xy 244.815 195.6) (xy 244.815 196.597844) (xy 244.821401 196.657372) (xy 244.821403 196.657379) + (xy 244.871645 196.792086) (xy 244.871649 196.792093) (xy 244.957809 196.907187) (xy 244.957812 196.90719) + (xy 245.072906 196.99335) (xy 245.072913 196.993354) (xy 245.20762 197.043596) (xy 245.207627 197.043598) + (xy 245.267155 197.049999) (xy 245.267172 197.05) (xy 246.265 197.05) (xy 246.265 196.11236) (xy 246.281649 196.119257) + (xy 246.436207 196.15) (xy 246.593793 196.15) (xy 246.748351 196.119257) (xy 246.765 196.11236) + (xy 246.765 197.05) (xy 247.762828 197.05) (xy 247.762844 197.049999) (xy 247.822372 197.043598) + (xy 247.822379 197.043596) (xy 247.957086 196.993354) (xy 247.957093 196.99335) (xy 248.072187 196.90719) + (xy 248.07219 196.907187) (xy 248.15835 196.792093) (xy 248.158354 196.792086) (xy 248.208596 196.657379) + (xy 248.208598 196.657372) (xy 248.214999 196.597844) (xy 248.215 196.597827) (xy 248.215 196.268288) + (xy 248.234685 196.201249) (xy 248.287489 196.155494) (xy 248.356647 196.14555) (xy 248.420203 196.174575) + (xy 248.446387 196.206288) (xy 248.506454 196.310327) (xy 248.506461 196.310338) (xy 248.548452 196.362991) + (xy 248.548453 196.362992) (xy 249.199152 195.712292) (xy 249.206049 195.728942) (xy 249.293599 195.85997) + (xy 249.40503 195.971401) (xy 249.536058 196.058951) (xy 249.552705 196.065846) (xy 248.901813 196.716738) + (xy 249.062616 196.826371) (xy 249.062624 196.826376) (xy 249.292176 196.936921) (xy 249.292174 196.936921) + (xy 249.535652 197.012024) (xy 249.535658 197.012026) (xy 249.787595 197.049999) (xy 249.787604 197.05) + (xy 250.042396 197.05) (xy 250.042404 197.049999) (xy 250.294341 197.012026) (xy 250.294347 197.012024) + (xy 250.537824 196.936921) (xy 250.767376 196.826376) (xy 250.767377 196.826375) (xy 250.928185 196.716738) + (xy 250.277294 196.065846) (xy 250.293942 196.058951) (xy 250.42497 195.971401) (xy 250.536401 195.85997) + (xy 250.623951 195.728942) (xy 250.630846 195.712294) (xy 251.281544 196.362992) (xy 251.281546 196.362991) + (xy 251.323544 196.31033) (xy 251.450941 196.089671) (xy 251.544026 195.852494) (xy 251.544031 195.852477) + (xy 251.600726 195.604079) (xy 251.619767 195.350004) (xy 251.619767 195.349995) (xy 251.600726 195.09592) + (xy 251.544031 194.847522) (xy 251.544026 194.847505) (xy 251.450941 194.610328) (xy 251.450942 194.610328) + (xy 251.323545 194.389672) (xy 251.281545 194.337006) (xy 250.630846 194.987705) (xy 250.623951 194.971058) + (xy 250.536401 194.84003) (xy 250.42497 194.728599) (xy 250.293942 194.641049) (xy 250.277293 194.634152) + (xy 250.928185 193.98326) (xy 250.767384 193.873628) (xy 250.767376 193.873623) (xy 250.537823 193.763078) + (xy 250.537825 193.763078) (xy 250.294347 193.687975) (xy 250.294341 193.687973) (xy 250.042404 193.65) + (xy 249.787595 193.65) (xy 249.535658 193.687973) (xy 249.535652 193.687975) (xy 249.292175 193.763078) + (xy 249.062622 193.873625) (xy 249.062609 193.873632) (xy 248.901813 193.983259) (xy 249.552706 194.634152) + (xy 249.536058 194.641049) (xy 249.40503 194.728599) (xy 249.293599 194.84003) (xy 249.206049 194.971058) + (xy 249.199152 194.987706) (xy 248.548452 194.337006) (xy 248.506459 194.389664) (xy 248.446387 194.493712) + (xy 248.39582 194.541927) (xy 248.327212 194.555149) (xy 248.262348 194.529181) (xy 248.22182 194.472267) + (xy 248.215 194.431711) (xy 248.215 194.102172) (xy 248.214999 194.102155) (xy 248.208598 194.042627) + (xy 248.208596 194.04262) (xy 248.158354 193.907913) (xy 248.15835 193.907906) (xy 248.07219 193.792812) + (xy 248.072187 193.792809) (xy 247.957093 193.706649) (xy 247.957086 193.706645) (xy 247.822379 193.656403) + (xy 247.822372 193.656401) (xy 247.762844 193.65) (xy 246.765 193.65) (xy 246.765 194.587639) (xy 246.748351 194.580743) + (xy 246.593793 194.55) (xy 246.436207 194.55) (xy 246.281649 194.580743) (xy 246.265 194.587639) + (xy 246.265 193.65) (xy 245.267155 193.65) (xy 245.207627 193.656401) (xy 245.20762 193.656403) + (xy 245.072913 193.706645) (xy 245.072906 193.706649) (xy 244.957812 193.792809) (xy 244.957809 193.792812) + (xy 244.871649 193.907906) (xy 244.871645 193.907913) (xy 244.821403 194.04262) (xy 244.821401 194.042627) + (xy 244.815 194.102155) (xy 244.2 194.102155) (xy 244.2 192.399996) (xy 244.199999 192.399995) (xy 244.179943 192.221988) + (xy 244.179942 192.221986) (xy 244.179942 192.221983) (xy 244.120775 192.052893) (xy 244.025465 191.901208) + (xy 243.898792 191.774535) (xy 243.747108 191.679225) (xy 243.578011 191.620056) (xy 243.400001 191.6) + (xy 243.4 191.6) (xy 243.235869 191.581506) (xy 243.208798 191.575328) (xy 243.066078 191.525388) (xy 243.041061 191.51334) (xy 242.913036 191.432897) (xy 242.891327 191.415584) (xy 242.784415 191.308672) (xy 242.767103 191.286964) (xy 242.742633 191.248021) (xy 242.723632 191.180784) (xy 242.73827 191.123591) (xy 242.743452 191.113898) (xy 242.75417 191.091237) (xy 242.763473 191.068779) (xy 242.771922 191.045165) (xy 242.821738 190.880942) (xy 242.827831 190.856618) (xy 242.832573 190.832777) (xy 242.836252 190.807978) (xy 242.853673 190.631105) (xy 242.854595 190.618596) (xy 242.855192 190.606442) (xy 242.8555 190.593907) - (xy 242.8555 164.243863) (xy 242.875185 164.176824) (xy 242.886661 164.161662) (xy 242.891204 164.156531) - (xy 243.04097 163.987382) (xy 243.040986 163.987366) (xy 243.042581 163.985564) (xy 243.042594 163.985551) - (xy 255.541293 149.869374) (xy 268.03628 135.757386) (xy 268.043737 135.748569) (xy 268.05077 135.739863) - (xy 268.057851 135.730679) (xy 268.15505 135.598512) (xy 268.167899 135.579272) (xy 268.179499 135.560074) - (xy 268.190555 135.539751) (xy 268.259873 135.397323) (xy 268.269046 135.376082) (xy 268.276999 135.355103) - (xy 268.284213 135.333117) (xy 268.326731 135.180534) (xy 268.331925 135.157996) (xy 268.335968 135.135929) - (xy 268.339103 135.112998) (xy 268.353944 134.949619) (xy 268.35473 134.938063) (xy 268.355238 134.926845) - (xy 268.3555 134.915287) (xy 268.3555 133.206092) (xy 268.355192 133.193557) (xy 268.354595 133.181403) - (xy 268.353673 133.168894) (xy 268.336252 132.992021) (xy 268.332573 132.967222) (xy 268.327831 132.943381) - (xy 268.321738 132.919057) (xy 268.271922 132.754834) (xy 268.263473 132.73122) (xy 268.25417 132.708762) - (xy 268.243452 132.686101) (xy 268.243448 132.686093) (xy 268.243441 132.686079) (xy 268.162568 132.534778) - (xy 268.162558 132.534759) (xy 268.162551 132.534747) (xy 268.162542 132.534731) (xy 268.149667 132.513251) - (xy 268.136191 132.493081) (xy 268.136145 132.493015) (xy 268.121237 132.472916) (xy 268.121226 132.472901) - (xy 268.1 132.447037) (xy 268.1 132.2) (xy 267.852963 132.2) (xy 267.827098 132.178773) (xy 267.827082 132.178761) - (xy 267.806983 132.163853) (xy 267.806917 132.163807) (xy 267.786747 132.150331) (xy 267.765267 132.137456) - (xy 267.765221 132.13743) (xy 267.658746 132.080519) (xy 267.658745 132.080518) (xy 267.613899 132.056548) - (xy 267.613881 132.056539) (xy 267.591237 132.045829) (xy 267.568809 132.036538) (xy 267.568784 132.036528) - (xy 267.545177 132.02808) (xy 267.441518 131.996636) (xy 267.380936 131.978259) (xy 267.380927 131.978256) - (xy 267.380899 131.978249) (xy 267.356627 131.972169) (xy 267.356612 131.972166) (xy 267.356608 131.972165) - (xy 267.33278 131.967426) (xy 267.332756 131.967421) (xy 267.308009 131.963751) (xy 267.307985 131.963748) - (xy 267.307984 131.963748) (xy 267.30798 131.963747) (xy 267.307958 131.963745) (xy 267.131086 131.946325) - (xy 267.118618 131.945406) (xy 267.10645 131.944808) (xy 267.10286 131.94472) (xy 267.093907 131.9445) - (xy 265.947096 131.9445) (xy 265.945947 131.944528) (xy 265.934448 131.944813) (xy 265.922177 131.94542) - (xy 265.909544 131.946361) (xy 265.810161 131.95625) (xy 265.741502 131.943299) (xy 265.719219 131.928712) - (xy 265.702333 131.914854) (xy 265.685145 131.897666) (xy 265.576277 131.76501) (xy 265.562772 131.744798) - (xy 265.481878 131.593456) (xy 265.472575 131.570998) (xy 265.422757 131.406769) (xy 265.418018 131.382941) - (xy 265.400597 131.206061) (xy 265.4 131.193907) (xy 265.4 130.206092) (xy 265.400597 130.193938) - (xy 265.418018 130.017056) (xy 265.422757 129.993232) (xy 265.472577 129.828994) (xy 265.481875 129.806549) - (xy 265.562775 129.655195) (xy 265.576272 129.634995) (xy 265.685152 129.502326) (xy 265.702328 129.485149) - (xy 265.820773 129.387944) (xy 265.885082 129.360633) + (xy 242.8555 164.496287) (xy 242.856008 164.485071) (xy 242.8677 164.356344) (xy 242.871741 164.334282) + (xy 242.901803 164.2264) (xy 242.909754 164.205428) (xy 242.958758 164.104737) (xy 242.97036 164.085536) + (xy 243.001508 164.043182) (xy 243.046939 163.981406) (xy 243.05397 163.9727) (xy 255.541293 149.869374) + (xy 268.036271 135.757399) (xy 268.043753 135.748551) (xy 268.050787 135.739841) (xy 268.057842 135.73069) + (xy 268.155049 135.598514) (xy 268.167899 135.579272) (xy 268.179499 135.560074) (xy 268.190555 135.539751) + (xy 268.259873 135.397323) (xy 268.269046 135.376082) (xy 268.276999 135.355103) (xy 268.284213 135.333117) + (xy 268.326731 135.180534) (xy 268.331925 135.157996) (xy 268.335968 135.135929) (xy 268.339103 135.112998) + (xy 268.353944 134.949619) (xy 268.35473 134.938063) (xy 268.355238 134.926845) (xy 268.3555 134.915287) + (xy 268.3555 133.206092) (xy 268.355192 133.193557) (xy 268.354595 133.181403) (xy 268.353673 133.168894) + (xy 268.336252 132.992021) (xy 268.332573 132.967222) (xy 268.327831 132.943381) (xy 268.321738 132.919057) + (xy 268.271922 132.754834) (xy 268.263473 132.73122) (xy 268.25417 132.708762) (xy 268.243452 132.686101) + (xy 268.243448 132.686093) (xy 268.243441 132.686079) (xy 268.162568 132.534778) (xy 268.162558 132.534759) + (xy 268.162551 132.534747) (xy 268.162542 132.534731) (xy 268.149667 132.513251) (xy 268.136191 132.493081) + (xy 268.136145 132.493015) (xy 268.121237 132.472916) (xy 268.121226 132.472901) (xy 268.012358 132.340245) + (xy 268.012354 132.34024) (xy 267.995525 132.321672) (xy 267.978326 132.304473) (xy 267.959758 132.287644) + (xy 267.852963 132.2) (xy 267.827098 132.178773) (xy 267.827082 132.178761) (xy 267.806983 132.163853) + (xy 267.806917 132.163807) (xy 267.786747 132.150331) (xy 267.765267 132.137456) (xy 267.765221 132.13743) + (xy 267.658746 132.080519) (xy 267.658745 132.080518) (xy 267.613899 132.056548) (xy 267.613881 132.056539) + (xy 267.591237 132.045829) (xy 267.568809 132.036538) (xy 267.568784 132.036528) (xy 267.545177 132.02808) + (xy 267.441518 131.996636) (xy 267.380936 131.978259) (xy 267.380927 131.978256) (xy 267.380899 131.978249) + (xy 267.356627 131.972169) (xy 267.356612 131.972166) (xy 267.356608 131.972165) (xy 267.33278 131.967426) + (xy 267.332756 131.967421) (xy 267.308009 131.963751) (xy 267.307985 131.963748) (xy 267.307984 131.963748) + (xy 267.30798 131.963747) (xy 267.307958 131.963745) (xy 267.131086 131.946325) (xy 267.118618 131.945406) + (xy 267.10645 131.944808) (xy 267.10286 131.94472) (xy 267.093907 131.9445) (xy 265.947096 131.9445) + (xy 265.945947 131.944528) (xy 265.934448 131.944813) (xy 265.922177 131.94542) (xy 265.909544 131.946361) + (xy 265.810161 131.95625) (xy 265.741502 131.943299) (xy 265.719219 131.928712) (xy 265.702333 131.914854) + (xy 265.685145 131.897666) (xy 265.576277 131.76501) (xy 265.562772 131.744798) (xy 265.481878 131.593456) + (xy 265.472575 131.570998) (xy 265.422757 131.406769) (xy 265.418018 131.382941) (xy 265.400597 131.206061) + (xy 265.4 131.193907) (xy 265.4 130.206092) (xy 265.400597 130.193938) (xy 265.418018 130.017056) + (xy 265.422757 129.993232) (xy 265.472577 129.828994) (xy 265.481875 129.806549) (xy 265.562775 129.655195) + (xy 265.576272 129.634995) (xy 265.685149 129.502328) (xy 265.702328 129.485149) (xy 265.820773 129.387944) + (xy 265.885082 129.360633) ) ) ) @@ -154890,28 +158905,38 @@ (xy 149.281982 64.417065) (xy 149.299403 64.593938) (xy 149.3 64.606092) (xy 149.3 67.977601) (xy 149.280315 68.04464) (xy 149.263681 68.065282) (xy 149.039526 68.289436) (xy 148.990091 68.375059) (xy 148.990091 68.37506) (xy 148.99009 68.375062) (xy 148.9645 68.470565) (xy 148.9645 68.470567) (xy 148.9645 68.875959) - (xy 148.944815 68.942998) (xy 148.892011 68.988753) (xy 148.8599 68.998431) (xy 148.85 69) (xy 148.4 69) - (xy 148.4 69.45) (xy 148.4 70.708977) (xy 148.380315 70.776016) (xy 148.327511 70.821771) (xy 148.323458 70.823536) - (xy 148.322263 70.82403) (xy 148.239399 70.879398) (xy 148.184033 70.962259) (xy 148.184032 70.962263) - (xy 148.1695 71.03532) (xy 148.1695 71.473741) (xy 148.149815 71.54078) (xy 148.097011 71.586535) - (xy 148.027853 71.596479) (xy 148.026105 71.596215) (xy 148.015105 71.594473) (xy 147.951969 71.564545) - (xy 147.915037 71.505234) (xy 147.9105 71.471999) (xy 147.9105 71.035322) (xy 147.910499 71.03532) - (xy 147.895967 70.962263) (xy 147.895966 70.962259) (xy 147.894456 70.959999) (xy 147.840601 70.879398) - (xy 147.75774 70.824033) (xy 147.757739 70.824032) (xy 147.75511 70.822276) (xy 147.710304 70.768663) - (xy 147.7 70.719173) (xy 147.7 70.704165) (xy 147.719685 70.637126) (xy 147.75511 70.601062) (xy 147.762737 70.595965) - (xy 147.76274 70.595965) (xy 147.845601 70.5406) (xy 147.900966 70.457739) (xy 147.9155 70.384673) - (xy 147.9155 69.735325) (xy 147.9155 69.735322) (xy 147.915499 69.73532) (xy 147.900967 69.662263) - (xy 147.900966 69.662259) (xy 147.845601 69.579398) (xy 147.76274 69.524033) (xy 147.762739 69.524032) - (xy 147.762735 69.524031) (xy 147.7 69.511552) (xy 147.7 69) (xy 146.7 69) (xy 146.699997 69) (xy 145.349993 69) - (xy 144.5 69) (xy 144.5 69.849993) (xy 144.5 69.943038) (xy 144.49922 69.956922) (xy 144.48276 70.103005) - (xy 144.476582 70.130075) (xy 144.430341 70.262225) (xy 144.418293 70.287243) (xy 144.343806 70.405788) - (xy 144.326493 70.427497) (xy 144.227497 70.526493) (xy 144.205788 70.543806) (xy 144.087243 70.618293) - (xy 144.062225 70.630341) (xy 143.930075 70.676582) (xy 143.903004 70.68276) (xy 143.763883 70.698435) - (xy 143.736117 70.698435) (xy 143.596995 70.68276) (xy 143.569924 70.676582) (xy 143.437774 70.630341) - (xy 143.412756 70.618293) (xy 143.294211 70.543806) (xy 143.272502 70.526493) (xy 143.173506 70.427497) - (xy 143.156193 70.405788) (xy 143.081706 70.287243) (xy 143.069658 70.262225) (xy 143.023417 70.130075) - (xy 143.017239 70.103004) (xy 143.00078 69.956921) (xy 143 69.943038) (xy 143 67.201425) (xy 143 67.201389) - (xy 143 67.2) (xy 142.992801 64.608854) (xy 142.993367 64.596696) (xy 142.993632 64.593938) (xy 143.010357 64.419472) + (xy 148.944815 68.942998) (xy 148.892011 68.988753) (xy 148.8599 68.998431) (xy 148.85 69) (xy 148.849999 69) + (xy 148.710944 69.022023) (xy 148.585498 69.085941) (xy 148.585491 69.085946) (xy 148.485946 69.185491) + (xy 148.485941 69.185498) (xy 148.422023 69.310944) (xy 148.4 69.45) (xy 148.4 70.708977) (xy 148.380315 70.776016) + (xy 148.327511 70.821771) (xy 148.323458 70.823536) (xy 148.322263 70.82403) (xy 148.239399 70.879398) + (xy 148.184033 70.962259) (xy 148.184032 70.962263) (xy 148.1695 71.03532) (xy 148.1695 71.473741) + (xy 148.149815 71.54078) (xy 148.097011 71.586535) (xy 148.027853 71.596479) (xy 148.026105 71.596215) + (xy 148.015105 71.594473) (xy 147.951969 71.564545) (xy 147.915037 71.505234) (xy 147.9105 71.471999) + (xy 147.9105 71.035322) (xy 147.910499 71.03532) (xy 147.895967 70.962263) (xy 147.895966 70.962259) + (xy 147.894456 70.959999) (xy 147.840601 70.879398) (xy 147.75774 70.824033) (xy 147.757739 70.824032) + (xy 147.75511 70.822276) (xy 147.710304 70.768663) (xy 147.7 70.719173) (xy 147.7 70.704165) (xy 147.719685 70.637126) + (xy 147.75511 70.601062) (xy 147.762737 70.595965) (xy 147.76274 70.595965) (xy 147.845601 70.5406) + (xy 147.900966 70.457739) (xy 147.9155 70.384673) (xy 147.9155 69.735325) (xy 147.9155 69.735322) + (xy 147.915499 69.73532) (xy 147.900967 69.662263) (xy 147.900966 69.662259) (xy 147.900027 69.660854) + (xy 147.845601 69.579398) (xy 147.76274 69.524033) (xy 147.762739 69.524032) (xy 147.762735 69.524031) + (xy 147.689677 69.509499) (xy 147.689674 69.509499) (xy 147.640573 69.509499) (xy 147.573534 69.489814) + (xy 147.535764 69.448883) (xy 147.534853 69.449493) (xy 147.531469 69.444428) (xy 147.407107 69.292892) + (xy 147.255571 69.168531) (xy 147.255564 69.168526) (xy 147.08269 69.076123) (xy 147.082687 69.076122) + (xy 147.082686 69.076121) (xy 147.082683 69.07612) (xy 146.89509 69.019215) (xy 146.895088 69.019214) + (xy 146.89509 69.019214) (xy 146.744494 69.004382) (xy 146.7 69) (xy 146.699997 69) (xy 145.349993 69) + (xy 145.160858 69.02131) (xy 145.160857 69.02131) (xy 145.071599 69.052542) (xy 145.030651 69.0595) + (xy 145.00952 69.0595) (xy 145.009508 69.059501) (xy 144.952885 69.065587) (xy 144.824773 69.113372) + (xy 144.715313 69.195313) (xy 144.633373 69.304771) (xy 144.585587 69.432889) (xy 144.580243 69.482592) + (xy 144.573996 69.510288) (xy 144.521311 69.660854) (xy 144.521309 69.660862) (xy 144.5 69.849993) + (xy 144.5 69.943038) (xy 144.49922 69.956922) (xy 144.48276 70.103005) (xy 144.476582 70.130075) + (xy 144.430341 70.262225) (xy 144.418293 70.287243) (xy 144.343806 70.405788) (xy 144.326493 70.427497) + (xy 144.227497 70.526493) (xy 144.205788 70.543806) (xy 144.087243 70.618293) (xy 144.062225 70.630341) + (xy 143.930075 70.676582) (xy 143.903004 70.68276) (xy 143.763883 70.698435) (xy 143.736117 70.698435) + (xy 143.596995 70.68276) (xy 143.569924 70.676582) (xy 143.437774 70.630341) (xy 143.412756 70.618293) + (xy 143.294211 70.543806) (xy 143.272502 70.526493) (xy 143.173506 70.427497) (xy 143.156193 70.405788) + (xy 143.081706 70.287243) (xy 143.069658 70.262225) (xy 143.023417 70.130075) (xy 143.017239 70.103004) + (xy 143.00078 69.956921) (xy 143 69.943038) (xy 143 67.201425) (xy 142.999999 67.200066) (xy 142.999996 67.198649) + (xy 142.999996 67.198611) (xy 142.992801 64.608855) (xy 142.993366 64.596717) (xy 143.010357 64.419472) (xy 143.015049 64.395582) (xy 143.064582 64.230956) (xy 143.073851 64.208445) (xy 143.154605 64.056668) (xy 143.168092 64.036408) (xy 143.27695 63.90334) (xy 143.294135 63.886107) (xy 143.415556 63.786213) (xy 143.47983 63.758824) @@ -154950,163 +158975,171 @@ (xy 164.656922 199.300779) (xy 164.825254 199.319746) (xy 164.852326 199.325924) (xy 165.005615 199.379562) (xy 165.030632 199.39161) (xy 165.168138 199.478011) (xy 165.189846 199.495323) (xy 165.304676 199.610153) (xy 165.321989 199.631862) (xy 165.408389 199.769367) (xy 165.420437 199.794384) (xy 165.474075 199.947673) - (xy 165.480253 199.974744) (xy 165.489329 200.05529) (xy 165.5 200.15) (xy 165.5 201) (xy 168.003317 201) + (xy 165.480253 199.974744) (xy 165.5 200.149999) (xy 165.5 200.15) (xy 165.521309 200.339137) (xy 165.52131 200.339142) + (xy 165.570443 200.479554) (xy 165.584176 200.518801) (xy 165.685443 200.679966) (xy 165.820034 200.814557) + (xy 165.82665 200.818714) (xy 165.834976 200.824433) (xy 165.835311 200.824684) (xy 165.835313 200.824686) + (xy 165.944774 200.906627) (xy 166.072886 200.954411) (xy 166.085506 200.955767) (xy 166.113203 200.962014) + (xy 166.160857 200.978689) (xy 166.160861 200.978689) (xy 166.160863 200.97869) (xy 166.16086 200.97869) + (xy 166.30423 200.994843) (xy 166.349994 200.999999) (xy 166.349997 201) (xy 166.35 201) (xy 168.003317 201) (xy 168.070356 201.019685) (xy 168.077184 201.024403) (xy 168.093042 201.036164) (xy 168.093059 201.036175) (xy 168.093081 201.036191) (xy 168.113251 201.049667) (xy 168.134731 201.062542) (xy 168.134747 201.062551) (xy 168.134759 201.062558) (xy 168.134778 201.062568) (xy 168.286079 201.143441) (xy 168.286093 201.143448) (xy 168.286097 201.14345) (xy 168.286101 201.143452) (xy 168.308762 201.15417) (xy 168.33122 201.163473) (xy 168.354834 201.171922) (xy 168.519057 201.221738) (xy 168.543381 201.227831) (xy 168.567222 201.232573) (xy 168.585462 201.235278) (xy 168.59202 201.236252) (xy 168.609984 201.238021) (xy 168.768895 201.253673) - (xy 168.781404 201.254595) (xy 168.793558 201.255192) (xy 168.806093 201.2555) (xy 175.517175 201.2555) - (xy 175.584214 201.275185) (xy 175.595828 201.283637) (xy 175.597655 201.285136) (xy 175.614845 201.302322) - (xy 175.616347 201.304153) (xy 175.643665 201.368459) (xy 175.6445 201.382824) (xy 175.6445 201.5) - (xy 175.645411 201.513898) (xy 175.646686 201.533353) (xy 175.661593 201.646577) (xy 175.668109 201.679343) - (xy 175.66811 201.679346) (xy 175.668111 201.67935) (xy 175.676489 201.710618) (xy 175.686947 201.741425) - (xy 175.687236 201.742274) (xy 175.687236 201.742275) (xy 175.724681 201.832675) (xy 175.724689 201.832693) - (xy 175.739473 201.862673) (xy 175.755659 201.890708) (xy 175.774214 201.918478) (xy 175.774223 201.918489) - (xy 175.82671 201.986893) (xy 175.826815 201.987029) (xy 175.833819 201.996156) (xy 175.83382 201.996157) - (xy 175.855837 202.021262) (xy 175.855841 202.021266) (xy 175.855842 202.021267) (xy 175.863678 202.029103) - (xy 175.897165 202.090422) (xy 175.9 202.116787) (xy 175.9 207.984084) (xy 175.880315 208.051123) - (xy 175.827511 208.096878) (xy 175.758353 208.106822) (xy 175.694797 208.077797) (xy 175.663876 208.03406) - (xy 175.662953 208.034505) (xy 175.660942 208.030328) (xy 175.533545 207.809672) (xy 175.491545 207.757006) - (xy 174.840846 208.407705) (xy 174.833951 208.391058) (xy 174.746401 208.26003) (xy 174.63497 208.148599) - (xy 174.503942 208.061049) (xy 174.487293 208.054152) (xy 175.138185 207.40326) (xy 174.977384 207.293628) - (xy 174.977376 207.293623) (xy 174.747823 207.183078) (xy 174.747825 207.183078) (xy 174.504347 207.107975) - (xy 174.504341 207.107973) (xy 174.252404 207.07) (xy 173.997595 207.07) (xy 173.745658 207.107973) - (xy 173.745652 207.107975) (xy 173.502175 207.183078) (xy 173.272622 207.293625) (xy 173.272609 207.293632) - (xy 173.111813 207.403259) (xy 173.762706 208.054152) (xy 173.746058 208.061049) (xy 173.61503 208.148599) - (xy 173.503599 208.26003) (xy 173.416049 208.391058) (xy 173.409152 208.407706) (xy 172.758452 207.757006) - (xy 172.716457 207.809667) (xy 172.589058 208.030328) (xy 172.540428 208.154236) (xy 172.497612 208.20945) - (xy 172.431742 208.232751) (xy 172.363732 208.21674) (xy 172.315173 208.166502) (xy 172.309572 208.154236) - (xy 172.260941 208.030328) (xy 172.260942 208.030328) (xy 172.133545 207.809672) (xy 172.091545 207.757006) - (xy 171.440846 208.407705) (xy 171.433951 208.391058) (xy 171.346401 208.26003) (xy 171.23497 208.148599) - (xy 171.103942 208.061049) (xy 171.087293 208.054152) (xy 171.738185 207.40326) (xy 171.577384 207.293628) - (xy 171.577376 207.293623) (xy 171.347823 207.183078) (xy 171.347825 207.183078) (xy 171.104347 207.107975) - (xy 171.104341 207.107973) (xy 170.852404 207.07) (xy 170.597595 207.07) (xy 170.345658 207.107973) - (xy 170.345652 207.107975) (xy 170.102175 207.183078) (xy 169.872622 207.293625) (xy 169.872609 207.293632) - (xy 169.711813 207.403259) (xy 170.362706 208.054152) (xy 170.346058 208.061049) (xy 170.21503 208.148599) - (xy 170.103599 208.26003) (xy 170.016049 208.391058) (xy 170.009152 208.407706) (xy 169.358452 207.757006) - (xy 169.316457 207.809667) (xy 169.189058 208.030328) (xy 169.095973 208.267505) (xy 169.095968 208.267522) - (xy 169.039273 208.51592) (xy 169.020233 208.769995) (xy 169.020233 208.770004) (xy 169.039273 209.024079) - (xy 169.095968 209.272477) (xy 169.095973 209.272494) (xy 169.189058 209.509671) (xy 169.189057 209.509671) - (xy 169.316454 209.730327) (xy 169.316461 209.730338) (xy 169.358452 209.782991) (xy 169.358453 209.782992) - (xy 170.009152 209.132292) (xy 170.016049 209.148942) (xy 170.103599 209.27997) (xy 170.21503 209.391401) - (xy 170.346058 209.478951) (xy 170.362705 209.485846) (xy 169.711813 210.136738) (xy 169.872616 210.246371) - (xy 169.872624 210.246376) (xy 170.102176 210.356921) (xy 170.102174 210.356921) (xy 170.345652 210.432024) - (xy 170.345658 210.432026) (xy 170.597595 210.469999) (xy 170.597604 210.47) (xy 170.852396 210.47) - (xy 170.852404 210.469999) (xy 171.104341 210.432026) (xy 171.104347 210.432024) (xy 171.347824 210.356921) - (xy 171.577376 210.246376) (xy 171.577377 210.246375) (xy 171.738185 210.136738) (xy 171.087294 209.485846) - (xy 171.103942 209.478951) (xy 171.23497 209.391401) (xy 171.346401 209.27997) (xy 171.433951 209.148942) - (xy 171.440846 209.132294) (xy 172.091544 209.782992) (xy 172.091546 209.782991) (xy 172.133544 209.73033) - (xy 172.260941 209.509671) (xy 172.309572 209.385763) (xy 172.352387 209.330549) (xy 172.418257 209.307248) - (xy 172.486268 209.323259) (xy 172.534827 209.373496) (xy 172.540428 209.385763) (xy 172.589058 209.509671) - (xy 172.716454 209.730327) (xy 172.716461 209.730338) (xy 172.758452 209.782991) (xy 172.758453 209.782992) - (xy 173.409152 209.132292) (xy 173.416049 209.148942) (xy 173.503599 209.27997) (xy 173.61503 209.391401) - (xy 173.746058 209.478951) (xy 173.762705 209.485846) (xy 173.111813 210.136738) (xy 173.272616 210.246371) - (xy 173.272624 210.246376) (xy 173.502176 210.356921) (xy 173.502174 210.356921) (xy 173.745652 210.432024) - (xy 173.745658 210.432026) (xy 173.997595 210.469999) (xy 173.997604 210.47) (xy 174.252396 210.47) - (xy 174.252404 210.469999) (xy 174.504341 210.432026) (xy 174.504347 210.432024) (xy 174.747824 210.356921) - (xy 174.977376 210.246376) (xy 174.977377 210.246375) (xy 175.138185 210.136738) (xy 174.487294 209.485846) - (xy 174.503942 209.478951) (xy 174.63497 209.391401) (xy 174.746401 209.27997) (xy 174.833951 209.148942) - (xy 174.840846 209.132294) (xy 175.491544 209.782992) (xy 175.491546 209.782991) (xy 175.533544 209.73033) - (xy 175.660941 209.509671) (xy 175.662953 209.505495) (xy 175.664111 209.506052) (xy 175.703378 209.455406) - (xy 175.769246 209.432099) (xy 175.837258 209.448103) (xy 175.885821 209.498336) (xy 175.9 209.555915) - (xy 175.9 212.493907) (xy 175.899403 212.506061) (xy 175.881982 212.682934) (xy 175.87724 212.706775) - (xy 175.827424 212.870998) (xy 175.818121 212.893456) (xy 175.737227 213.044798) (xy 175.723722 213.06501) - (xy 175.614854 213.197666) (xy 175.597666 213.214854) (xy 175.46501 213.323722) (xy 175.444798 213.337227) - (xy 175.293456 213.418121) (xy 175.270998 213.427424) (xy 175.106775 213.47724) (xy 175.082934 213.481982) - (xy 174.906061 213.499403) (xy 174.893907 213.5) (xy 169.466917 213.5) (xy 169.399878 213.480315) - (xy 169.354123 213.427511) (xy 169.344179 213.358353) (xy 169.350975 213.332029) (xy 169.358815 213.311353) - (xy 169.382254 213.249552) (xy 169.401295 213.092734) (xy 169.382254 212.935916) (xy 169.326237 212.788211) - (xy 169.2365 212.658204) (xy 169.118257 212.553451) (xy 169.118255 212.55345) (xy 169.118254 212.553449) - (xy 168.978382 212.480037) (xy 168.825003 212.442234) (xy 168.825002 212.442234) (xy 168.667032 212.442234) - (xy 168.667031 212.442234) (xy 168.513651 212.480037) (xy 168.373779 212.553449) (xy 168.255533 212.658205) - (xy 168.165798 212.788209) (xy 168.165797 212.78821) (xy 168.109779 212.935915) (xy 168.090739 213.092733) - (xy 168.090739 213.092734) (xy 168.10978 213.249552) (xy 168.141059 213.332029) (xy 168.146426 213.401692) - (xy 168.113278 213.463198) (xy 168.05214 213.49702) (xy 168.025117 213.5) (xy 167.7995 213.5) (xy 167.732461 213.480315) - (xy 167.686706 213.427511) (xy 167.6755 213.376) (xy 167.6755 212.992202) (xy 167.695185 212.925163) - (xy 167.717274 212.899386) (xy 167.790482 212.834531) (xy 167.790483 212.83453) (xy 167.88022 212.704523) - (xy 167.936237 212.556818) (xy 167.955278 212.4) (xy 167.936237 212.243182) (xy 167.928104 212.221738) - (xy 167.898414 212.143452) (xy 167.88022 212.095477) (xy 167.790483 211.96547) (xy 167.67224 211.860717) - (xy 167.672238 211.860716) (xy 167.672237 211.860715) (xy 167.532365 211.787303) (xy 167.378986 211.7495) - (xy 167.378985 211.7495) (xy 167.221015 211.7495) (xy 167.221014 211.7495) (xy 167.067634 211.787303) - (xy 166.927762 211.860715) (xy 166.809516 211.965471) (xy 166.719781 212.095475) (xy 166.71978 212.095476) - (xy 166.663762 212.243181) (xy 166.644722 212.399999) (xy 166.644722 212.4) (xy 166.663762 212.556818) - (xy 166.702214 212.658205) (xy 166.71978 212.704523) (xy 166.747576 212.744794) (xy 166.809517 212.834531) - (xy 166.882726 212.899386) (xy 166.919853 212.958574) (xy 166.9245 212.992202) (xy 166.9245 213.376) - (xy 166.904815 213.443039) (xy 166.852011 213.488794) (xy 166.8005 213.5) (xy 165.806093 213.5) - (xy 165.793939 213.499403) (xy 165.617065 213.481982) (xy 165.593224 213.47724) (xy 165.488505 213.445474) - (xy 165.430066 213.407176) (xy 165.40161 213.343364) (xy 165.4005 213.326813) (xy 165.4005 210.692202) - (xy 165.420185 210.625163) (xy 165.442274 210.599386) (xy 165.515482 210.534531) (xy 165.515483 210.53453) - (xy 165.60522 210.404523) (xy 165.661237 210.256818) (xy 165.680278 210.1) (xy 165.667015 209.990764) - (xy 165.661237 209.943181) (xy 165.639992 209.887164) (xy 165.60522 209.795477) (xy 165.515483 209.66547) - (xy 165.39724 209.560717) (xy 165.397238 209.560716) (xy 165.397237 209.560715) (xy 165.257366 209.487304) - (xy 165.149825 209.460798) (xy 165.089444 209.425642) (xy 165.057656 209.363423) (xy 165.0555 209.340401) - (xy 165.0555 207.106112) (xy 165.0555 207.106092) (xy 165.055192 207.093557) (xy 165.054595 207.081403) - (xy 165.053673 207.068894) (xy 165.036252 206.892021) (xy 165.032573 206.867222) (xy 165.027831 206.843381) - (xy 165.021738 206.819057) (xy 164.971922 206.654834) (xy 164.963473 206.63122) (xy 164.95417 206.608762) - (xy 164.943452 206.586101) (xy 164.943448 206.586093) (xy 164.943441 206.586079) (xy 164.862568 206.434778) - (xy 164.862558 206.434759) (xy 164.862551 206.434747) (xy 164.862542 206.434731) (xy 164.849667 206.413251) - (xy 164.836191 206.393081) (xy 164.836145 206.393015) (xy 164.821237 206.372916) (xy 164.821231 206.372908) - (xy 164.821226 206.372901) (xy 164.8 206.347037) (xy 164.8 206.1) (xy 164.552963 206.1) (xy 164.527098 206.078773) - (xy 164.527082 206.078761) (xy 164.506983 206.063853) (xy 164.506934 206.063819) (xy 164.486755 206.050336) - (xy 164.465232 206.037437) (xy 164.434151 206.020824) (xy 164.313894 205.956546) (xy 164.313871 205.956535) - (xy 164.291241 205.945831) (xy 164.291238 205.94583) (xy 164.26879 205.93653) (xy 164.268784 205.936528) - (xy 164.245177 205.92808) (xy 164.141518 205.896636) (xy 164.080936 205.878259) (xy 164.080927 205.878256) - (xy 164.080899 205.878249) (xy 164.056627 205.872169) (xy 164.056612 205.872166) (xy 164.056608 205.872165) - (xy 164.03278 205.867426) (xy 164.032756 205.867421) (xy 164.008009 205.863751) (xy 164.007985 205.863748) - (xy 164.007984 205.863748) (xy 164.00798 205.863747) (xy 164.007958 205.863745) (xy 163.831086 205.846325) - (xy 163.818618 205.845406) (xy 163.80645 205.844808) (xy 163.80286 205.84472) (xy 163.793907 205.8445) - (xy 163.793887 205.8445) (xy 161.726487 205.8445) (xy 161.659448 205.824815) (xy 161.613693 205.772011) - (xy 161.603749 205.702853) (xy 161.604869 205.69631) (xy 161.6151 205.644873) (xy 161.6151 204.139423) - (xy 161.615099 204.139421) (xy 161.600567 204.066364) (xy 161.600566 204.06636) (xy 161.545201 203.983499) - (xy 161.46234 203.928134) (xy 161.462339 203.928133) (xy 161.462335 203.928132) (xy 161.389277 203.9136) - (xy 161.389274 203.9136) (xy 160.832726 203.9136) (xy 160.832723 203.9136) (xy 160.759664 203.928132) - (xy 160.75966 203.928133) (xy 160.676799 203.983499) (xy 160.621433 204.06636) (xy 160.621432 204.066364) - (xy 160.6069 204.139421) (xy 160.6069 205.644873) (xy 160.617131 205.69631) (xy 160.610903 205.765901) - (xy 160.568039 205.821078) (xy 160.502149 205.844322) (xy 160.495513 205.8445) (xy 160.456487 205.8445) - (xy 160.389448 205.824815) (xy 160.343693 205.772011) (xy 160.333749 205.702853) (xy 160.334869 205.69631) - (xy 160.3451 205.644873) (xy 160.3451 204.139423) (xy 160.345099 204.139421) (xy 160.330567 204.066364) - (xy 160.330566 204.06636) (xy 160.275201 203.983499) (xy 160.19234 203.928134) (xy 160.192339 203.928133) - (xy 160.192335 203.928132) (xy 160.119277 203.9136) (xy 160.119274 203.9136) (xy 159.562726 203.9136) - (xy 159.562723 203.9136) (xy 159.489664 203.928132) (xy 159.48966 203.928133) (xy 159.433544 203.965628) - (xy 159.406799 203.983499) (xy 159.406798 203.983499) (xy 159.399429 203.988424) (xy 159.332752 204.009301) - (xy 159.265372 203.990816) (xy 159.251874 203.981174) (xy 159.240929 203.972191) (xy 159.127098 203.878773) - (xy 159.127082 203.878761) (xy 159.106983 203.863853) (xy 159.106934 203.863819) (xy 159.086755 203.850336) - (xy 159.086745 203.85033) (xy 159.065239 203.837441) (xy 158.913894 203.756546) (xy 158.913871 203.756535) - (xy 158.891241 203.745831) (xy 158.891238 203.74583) (xy 158.86879 203.73653) (xy 158.868784 203.736528) - (xy 158.845177 203.72808) (xy 158.741518 203.696636) (xy 158.680936 203.678259) (xy 158.680927 203.678256) - (xy 158.680899 203.678249) (xy 158.656627 203.672169) (xy 158.656612 203.672166) (xy 158.656608 203.672165) - (xy 158.63278 203.667426) (xy 158.632756 203.667421) (xy 158.608009 203.663751) (xy 158.607985 203.663748) - (xy 158.607984 203.663748) (xy 158.60798 203.663747) (xy 158.607958 203.663745) (xy 158.431086 203.646325) - (xy 158.418618 203.645406) (xy 158.40645 203.644808) (xy 158.40286 203.64472) (xy 158.393907 203.6445) - (xy 156.206093 203.6445) (xy 156.197448 203.644712) (xy 156.193549 203.644808) (xy 156.181381 203.645406) - (xy 156.168909 203.646326) (xy 156.168907 203.646326) (xy 156.168896 203.646327) (xy 156.113901 203.651743) - (xy 155.992027 203.663746) (xy 155.992 203.663749) (xy 155.967214 203.667427) (xy 155.967212 203.667427) - (xy 155.943392 203.672165) (xy 155.943382 203.672167) (xy 155.919079 203.678254) (xy 155.919057 203.67826) - (xy 155.754824 203.728079) (xy 155.731222 203.736524) (xy 155.731204 203.736531) (xy 155.708781 203.74582) - (xy 155.708773 203.745823) (xy 155.686107 203.756543) (xy 155.534765 203.837437) (xy 155.513236 203.850341) - (xy 155.49306 203.863822) (xy 155.493034 203.86384) (xy 155.472891 203.87878) (xy 155.349023 203.980437) - (xy 155.284713 204.00775) (xy 155.215845 203.995959) (xy 155.201468 203.987687) (xy 155.195201 203.983499) - (xy 155.11234 203.928134) (xy 155.112339 203.928133) (xy 155.112335 203.928132) (xy 155.039277 203.9136) - (xy 155.039274 203.9136) (xy 154.482726 203.9136) (xy 154.482723 203.9136) (xy 154.409664 203.928132) - (xy 154.40966 203.928133) (xy 154.326799 203.983499) (xy 154.271433 204.06636) (xy 154.271432 204.066364) - (xy 154.2569 204.139421) (xy 154.2569 205.644873) (xy 154.267131 205.69631) (xy 154.260903 205.765901) - (xy 154.218039 205.821078) (xy 154.152149 205.844322) (xy 154.145513 205.8445) (xy 154.106487 205.8445) - (xy 154.039448 205.824815) (xy 153.993693 205.772011) (xy 153.983749 205.702853) (xy 153.984869 205.69631) - (xy 153.9951 205.644873) (xy 153.9951 204.139423) (xy 153.995099 204.139421) (xy 153.980567 204.066364) - (xy 153.980566 204.06636) (xy 153.925201 203.983499) (xy 153.84234 203.928134) (xy 153.842339 203.928133) - (xy 153.842335 203.928132) (xy 153.769277 203.9136) (xy 153.769274 203.9136) (xy 153.724 203.9136) - (xy 153.656961 203.893915) (xy 153.611206 203.841111) (xy 153.6 203.7896) (xy 153.6 201.506092) - (xy 153.600597 201.493938) (xy 153.605473 201.44443) (xy 153.618018 201.317056) (xy 153.622757 201.293232) - (xy 153.672577 201.128994) (xy 153.681875 201.106549) (xy 153.762775 200.955195) (xy 153.776272 200.934995) - (xy 153.885149 200.802328) (xy 153.902328 200.785149) (xy 154.034995 200.676272) (xy 154.055195 200.662775) - (xy 154.206549 200.581875) (xy 154.228994 200.572577) (xy 154.393232 200.522757) (xy 154.417056 200.518018) - (xy 154.593939 200.500597) (xy 154.606093 200.5) (xy 161.599993 200.5) (xy 161.6 200.5) (xy 162.2 200.5) - (xy 162.2 199.9) (xy 162.218314 199.76089) (xy 162.22669 199.729631) (xy 162.27414 199.615076) (xy 162.29032 199.587052) - (xy 162.365802 199.488681) (xy 162.388681 199.465802) (xy 162.487052 199.39032) (xy 162.515076 199.37414) - (xy 162.629631 199.32669) (xy 162.66089 199.318314) (xy 162.753513 199.30612) (xy 162.791942 199.301061) - (xy 162.808127 199.3) (xy 164.64304 199.3) + (xy 168.781404 201.254595) (xy 168.793558 201.255192) (xy 168.806093 201.2555) (xy 175.375134 201.2555) + (xy 175.391317 201.256561) (xy 175.416232 201.25984) (xy 175.446522 201.263828) (xy 175.477787 201.272204) + (xy 175.506063 201.283916) (xy 175.534092 201.300098) (xy 175.558377 201.318733) (xy 175.581263 201.341619) + (xy 175.599897 201.365903) (xy 175.61608 201.393935) (xy 175.622489 201.409405) (xy 175.627793 201.422212) + (xy 175.636169 201.453474) (xy 175.646686 201.533348) (xy 175.646686 201.533349) (xy 175.661593 201.646577) + (xy 175.668109 201.679343) (xy 175.66811 201.679346) (xy 175.668111 201.67935) (xy 175.676489 201.710618) + (xy 175.686947 201.741425) (xy 175.687236 201.742274) (xy 175.687236 201.742275) (xy 175.724681 201.832675) + (xy 175.724689 201.832693) (xy 175.739473 201.862673) (xy 175.755659 201.890708) (xy 175.774214 201.918478) + (xy 175.774223 201.918489) (xy 175.82671 201.986893) (xy 175.826815 201.987029) (xy 175.833819 201.996156) + (xy 175.83382 201.996157) (xy 175.855837 202.021262) (xy 175.855841 202.021266) (xy 175.855842 202.021267) + (xy 175.863678 202.029103) (xy 175.897165 202.090422) (xy 175.9 202.116787) (xy 175.9 207.984084) + (xy 175.880315 208.051123) (xy 175.827511 208.096878) (xy 175.758353 208.106822) (xy 175.694797 208.077797) + (xy 175.663876 208.03406) (xy 175.662953 208.034505) (xy 175.660942 208.030328) (xy 175.533545 207.809672) + (xy 175.491545 207.757006) (xy 174.840846 208.407705) (xy 174.833951 208.391058) (xy 174.746401 208.26003) + (xy 174.63497 208.148599) (xy 174.503942 208.061049) (xy 174.487293 208.054152) (xy 175.138185 207.40326) + (xy 174.977384 207.293628) (xy 174.977376 207.293623) (xy 174.747823 207.183078) (xy 174.747825 207.183078) + (xy 174.504347 207.107975) (xy 174.504341 207.107973) (xy 174.252404 207.07) (xy 173.997595 207.07) + (xy 173.745658 207.107973) (xy 173.745652 207.107975) (xy 173.502175 207.183078) (xy 173.272622 207.293625) + (xy 173.272609 207.293632) (xy 173.111813 207.403259) (xy 173.762706 208.054152) (xy 173.746058 208.061049) + (xy 173.61503 208.148599) (xy 173.503599 208.26003) (xy 173.416049 208.391058) (xy 173.409152 208.407706) + (xy 172.758452 207.757006) (xy 172.716457 207.809667) (xy 172.589058 208.030328) (xy 172.540428 208.154236) + (xy 172.497612 208.20945) (xy 172.431742 208.232751) (xy 172.363732 208.21674) (xy 172.315173 208.166502) + (xy 172.309572 208.154236) (xy 172.260941 208.030328) (xy 172.260942 208.030328) (xy 172.133545 207.809672) + (xy 172.091545 207.757006) (xy 171.440846 208.407705) (xy 171.433951 208.391058) (xy 171.346401 208.26003) + (xy 171.23497 208.148599) (xy 171.103942 208.061049) (xy 171.087293 208.054152) (xy 171.738185 207.40326) + (xy 171.577384 207.293628) (xy 171.577376 207.293623) (xy 171.347823 207.183078) (xy 171.347825 207.183078) + (xy 171.104347 207.107975) (xy 171.104341 207.107973) (xy 170.852404 207.07) (xy 170.597595 207.07) + (xy 170.345658 207.107973) (xy 170.345652 207.107975) (xy 170.102175 207.183078) (xy 169.872622 207.293625) + (xy 169.872609 207.293632) (xy 169.711813 207.403259) (xy 170.362706 208.054152) (xy 170.346058 208.061049) + (xy 170.21503 208.148599) (xy 170.103599 208.26003) (xy 170.016049 208.391058) (xy 170.009152 208.407706) + (xy 169.358452 207.757006) (xy 169.316457 207.809667) (xy 169.189058 208.030328) (xy 169.095973 208.267505) + (xy 169.095968 208.267522) (xy 169.039273 208.51592) (xy 169.020233 208.769995) (xy 169.020233 208.770004) + (xy 169.039273 209.024079) (xy 169.095968 209.272477) (xy 169.095973 209.272494) (xy 169.189058 209.509671) + (xy 169.189057 209.509671) (xy 169.316454 209.730327) (xy 169.316461 209.730338) (xy 169.358452 209.782991) + (xy 169.358453 209.782992) (xy 170.009152 209.132292) (xy 170.016049 209.148942) (xy 170.103599 209.27997) + (xy 170.21503 209.391401) (xy 170.346058 209.478951) (xy 170.362705 209.485846) (xy 169.711813 210.136738) + (xy 169.872616 210.246371) (xy 169.872624 210.246376) (xy 170.102176 210.356921) (xy 170.102174 210.356921) + (xy 170.345652 210.432024) (xy 170.345658 210.432026) (xy 170.597595 210.469999) (xy 170.597604 210.47) + (xy 170.852396 210.47) (xy 170.852404 210.469999) (xy 171.104341 210.432026) (xy 171.104347 210.432024) + (xy 171.347824 210.356921) (xy 171.577376 210.246376) (xy 171.577377 210.246375) (xy 171.738185 210.136738) + (xy 171.087294 209.485846) (xy 171.103942 209.478951) (xy 171.23497 209.391401) (xy 171.346401 209.27997) + (xy 171.433951 209.148942) (xy 171.440846 209.132294) (xy 172.091544 209.782992) (xy 172.091546 209.782991) + (xy 172.133544 209.73033) (xy 172.260941 209.509671) (xy 172.309572 209.385763) (xy 172.352387 209.330549) + (xy 172.418257 209.307248) (xy 172.486268 209.323259) (xy 172.534827 209.373496) (xy 172.540428 209.385763) + (xy 172.589058 209.509671) (xy 172.716454 209.730327) (xy 172.716461 209.730338) (xy 172.758452 209.782991) + (xy 172.758453 209.782992) (xy 173.409152 209.132292) (xy 173.416049 209.148942) (xy 173.503599 209.27997) + (xy 173.61503 209.391401) (xy 173.746058 209.478951) (xy 173.762705 209.485846) (xy 173.111813 210.136738) + (xy 173.272616 210.246371) (xy 173.272624 210.246376) (xy 173.502176 210.356921) (xy 173.502174 210.356921) + (xy 173.745652 210.432024) (xy 173.745658 210.432026) (xy 173.997595 210.469999) (xy 173.997604 210.47) + (xy 174.252396 210.47) (xy 174.252404 210.469999) (xy 174.504341 210.432026) (xy 174.504347 210.432024) + (xy 174.747824 210.356921) (xy 174.977376 210.246376) (xy 174.977377 210.246375) (xy 175.138185 210.136738) + (xy 174.487294 209.485846) (xy 174.503942 209.478951) (xy 174.63497 209.391401) (xy 174.746401 209.27997) + (xy 174.833951 209.148942) (xy 174.840846 209.132294) (xy 175.491544 209.782992) (xy 175.491546 209.782991) + (xy 175.533544 209.73033) (xy 175.660941 209.509671) (xy 175.662953 209.505495) (xy 175.664111 209.506052) + (xy 175.703378 209.455406) (xy 175.769246 209.432099) (xy 175.837258 209.448103) (xy 175.885821 209.498336) + (xy 175.9 209.555915) (xy 175.9 212.493907) (xy 175.899403 212.506061) (xy 175.881982 212.682934) + (xy 175.87724 212.706775) (xy 175.827424 212.870998) (xy 175.818121 212.893456) (xy 175.737227 213.044798) + (xy 175.723722 213.06501) (xy 175.614854 213.197666) (xy 175.597666 213.214854) (xy 175.46501 213.323722) + (xy 175.444798 213.337227) (xy 175.293456 213.418121) (xy 175.270998 213.427424) (xy 175.106775 213.47724) + (xy 175.082934 213.481982) (xy 174.906061 213.499403) (xy 174.893907 213.5) (xy 169.466917 213.5) + (xy 169.399878 213.480315) (xy 169.354123 213.427511) (xy 169.344179 213.358353) (xy 169.350975 213.332029) + (xy 169.358815 213.311353) (xy 169.382254 213.249552) (xy 169.401295 213.092734) (xy 169.382254 212.935916) + (xy 169.326237 212.788211) (xy 169.2365 212.658204) (xy 169.118257 212.553451) (xy 169.118255 212.55345) + (xy 169.118254 212.553449) (xy 168.978382 212.480037) (xy 168.825003 212.442234) (xy 168.825002 212.442234) + (xy 168.667032 212.442234) (xy 168.667031 212.442234) (xy 168.513651 212.480037) (xy 168.373779 212.553449) + (xy 168.255533 212.658205) (xy 168.165798 212.788209) (xy 168.165797 212.78821) (xy 168.109779 212.935915) + (xy 168.090739 213.092733) (xy 168.090739 213.092734) (xy 168.10978 213.249552) (xy 168.141059 213.332029) + (xy 168.146426 213.401692) (xy 168.113278 213.463198) (xy 168.05214 213.49702) (xy 168.025117 213.5) + (xy 167.7995 213.5) (xy 167.732461 213.480315) (xy 167.686706 213.427511) (xy 167.6755 213.376) + (xy 167.6755 212.992202) (xy 167.695185 212.925163) (xy 167.717274 212.899386) (xy 167.740732 212.878605) + (xy 167.790483 212.83453) (xy 167.88022 212.704523) (xy 167.936237 212.556818) (xy 167.955278 212.4) + (xy 167.936237 212.243182) (xy 167.928104 212.221738) (xy 167.898414 212.143452) (xy 167.88022 212.095477) + (xy 167.790483 211.96547) (xy 167.67224 211.860717) (xy 167.672238 211.860716) (xy 167.672237 211.860715) + (xy 167.532365 211.787303) (xy 167.378986 211.7495) (xy 167.378985 211.7495) (xy 167.221015 211.7495) + (xy 167.221014 211.7495) (xy 167.067634 211.787303) (xy 166.927762 211.860715) (xy 166.809516 211.965471) + (xy 166.719781 212.095475) (xy 166.71978 212.095476) (xy 166.663762 212.243181) (xy 166.644722 212.399999) + (xy 166.644722 212.4) (xy 166.663762 212.556818) (xy 166.702214 212.658205) (xy 166.71978 212.704523) + (xy 166.729131 212.71807) (xy 166.809517 212.834531) (xy 166.882726 212.899386) (xy 166.919853 212.958574) + (xy 166.9245 212.992202) (xy 166.9245 213.376) (xy 166.904815 213.443039) (xy 166.852011 213.488794) + (xy 166.8005 213.5) (xy 165.806093 213.5) (xy 165.793939 213.499403) (xy 165.617065 213.481982) + (xy 165.593224 213.47724) (xy 165.488505 213.445474) (xy 165.430066 213.407176) (xy 165.40161 213.343364) + (xy 165.4005 213.326813) (xy 165.4005 210.692202) (xy 165.420185 210.625163) (xy 165.442274 210.599386) + (xy 165.515482 210.534531) (xy 165.515483 210.53453) (xy 165.60522 210.404523) (xy 165.661237 210.256818) + (xy 165.680278 210.1) (xy 165.667015 209.990764) (xy 165.661237 209.943181) (xy 165.639992 209.887164) + (xy 165.60522 209.795477) (xy 165.515483 209.66547) (xy 165.39724 209.560717) (xy 165.397238 209.560716) + (xy 165.397237 209.560715) (xy 165.257366 209.487304) (xy 165.149825 209.460798) (xy 165.089444 209.425642) + (xy 165.057656 209.363423) (xy 165.0555 209.340401) (xy 165.0555 207.106112) (xy 165.0555 207.106092) + (xy 165.055192 207.093557) (xy 165.054595 207.081403) (xy 165.053673 207.068894) (xy 165.036252 206.892021) + (xy 165.032573 206.867222) (xy 165.027831 206.843381) (xy 165.021738 206.819057) (xy 164.971922 206.654834) + (xy 164.963473 206.63122) (xy 164.95417 206.608762) (xy 164.943452 206.586101) (xy 164.943448 206.586093) + (xy 164.943441 206.586079) (xy 164.862568 206.434778) (xy 164.862558 206.434759) (xy 164.862551 206.434747) + (xy 164.862542 206.434731) (xy 164.849667 206.413251) (xy 164.836191 206.393081) (xy 164.836145 206.393015) + (xy 164.821237 206.372916) (xy 164.821231 206.372908) (xy 164.821226 206.372901) (xy 164.712358 206.240245) + (xy 164.712354 206.24024) (xy 164.695525 206.221672) (xy 164.678326 206.204473) (xy 164.659758 206.187644) + (xy 164.61248 206.148844) (xy 164.527098 206.078773) (xy 164.527082 206.078761) (xy 164.506983 206.063853) + (xy 164.506934 206.063819) (xy 164.486755 206.050336) (xy 164.465232 206.037437) (xy 164.434151 206.020824) + (xy 164.313894 205.956546) (xy 164.313871 205.956535) (xy 164.291241 205.945831) (xy 164.291238 205.94583) + (xy 164.26879 205.93653) (xy 164.268784 205.936528) (xy 164.245177 205.92808) (xy 164.141518 205.896636) + (xy 164.080936 205.878259) (xy 164.080927 205.878256) (xy 164.080899 205.878249) (xy 164.056627 205.872169) + (xy 164.056612 205.872166) (xy 164.056608 205.872165) (xy 164.03278 205.867426) (xy 164.032756 205.867421) + (xy 164.008009 205.863751) (xy 164.007985 205.863748) (xy 164.007984 205.863748) (xy 164.00798 205.863747) + (xy 164.007958 205.863745) (xy 163.831086 205.846325) (xy 163.818618 205.845406) (xy 163.80645 205.844808) + (xy 163.80286 205.84472) (xy 163.793907 205.8445) (xy 163.793887 205.8445) (xy 161.726487 205.8445) + (xy 161.659448 205.824815) (xy 161.613693 205.772011) (xy 161.603749 205.702853) (xy 161.604869 205.69631) + (xy 161.6151 205.644873) (xy 161.6151 204.139423) (xy 161.615099 204.139421) (xy 161.600567 204.066364) + (xy 161.600566 204.06636) (xy 161.545201 203.983499) (xy 161.46234 203.928134) (xy 161.462339 203.928133) + (xy 161.462335 203.928132) (xy 161.389277 203.9136) (xy 161.389274 203.9136) (xy 160.832726 203.9136) + (xy 160.832723 203.9136) (xy 160.759664 203.928132) (xy 160.75966 203.928133) (xy 160.676799 203.983499) + (xy 160.621433 204.06636) (xy 160.621432 204.066364) (xy 160.6069 204.139421) (xy 160.6069 205.644873) + (xy 160.617131 205.69631) (xy 160.610903 205.765901) (xy 160.568039 205.821078) (xy 160.502149 205.844322) + (xy 160.495513 205.8445) (xy 160.456487 205.8445) (xy 160.389448 205.824815) (xy 160.343693 205.772011) + (xy 160.333749 205.702853) (xy 160.334869 205.69631) (xy 160.3451 205.644873) (xy 160.3451 204.139423) + (xy 160.345099 204.139421) (xy 160.330567 204.066364) (xy 160.330566 204.06636) (xy 160.275201 203.983499) + (xy 160.19234 203.928134) (xy 160.192339 203.928133) (xy 160.192335 203.928132) (xy 160.119277 203.9136) + (xy 160.119274 203.9136) (xy 159.562726 203.9136) (xy 159.562723 203.9136) (xy 159.489664 203.928132) + (xy 159.48966 203.928133) (xy 159.433544 203.965628) (xy 159.406799 203.983499) (xy 159.406798 203.983499) + (xy 159.399429 203.988424) (xy 159.332752 204.009301) (xy 159.265372 203.990816) (xy 159.251874 203.981174) + (xy 159.240929 203.972191) (xy 159.127098 203.878773) (xy 159.127082 203.878761) (xy 159.106983 203.863853) + (xy 159.106934 203.863819) (xy 159.086755 203.850336) (xy 159.086745 203.85033) (xy 159.065239 203.837441) + (xy 158.913894 203.756546) (xy 158.913871 203.756535) (xy 158.891241 203.745831) (xy 158.891238 203.74583) + (xy 158.86879 203.73653) (xy 158.868784 203.736528) (xy 158.845177 203.72808) (xy 158.741518 203.696636) + (xy 158.680936 203.678259) (xy 158.680927 203.678256) (xy 158.680899 203.678249) (xy 158.656627 203.672169) + (xy 158.656612 203.672166) (xy 158.656608 203.672165) (xy 158.63278 203.667426) (xy 158.632756 203.667421) + (xy 158.608009 203.663751) (xy 158.607985 203.663748) (xy 158.607984 203.663748) (xy 158.60798 203.663747) + (xy 158.607958 203.663745) (xy 158.431086 203.646325) (xy 158.418618 203.645406) (xy 158.40645 203.644808) + (xy 158.40286 203.64472) (xy 158.393907 203.6445) (xy 156.206093 203.6445) (xy 156.197448 203.644712) + (xy 156.193549 203.644808) (xy 156.181381 203.645406) (xy 156.168909 203.646326) (xy 156.168907 203.646326) + (xy 156.168896 203.646327) (xy 156.113901 203.651743) (xy 155.992027 203.663746) (xy 155.992 203.663749) + (xy 155.967214 203.667427) (xy 155.967212 203.667427) (xy 155.943392 203.672165) (xy 155.943382 203.672167) + (xy 155.919079 203.678254) (xy 155.919057 203.67826) (xy 155.754824 203.728079) (xy 155.731222 203.736524) + (xy 155.731204 203.736531) (xy 155.708781 203.74582) (xy 155.708773 203.745823) (xy 155.686107 203.756543) + (xy 155.534765 203.837437) (xy 155.513236 203.850341) (xy 155.49306 203.863822) (xy 155.493034 203.86384) + (xy 155.472891 203.87878) (xy 155.349023 203.980437) (xy 155.284713 204.00775) (xy 155.215845 203.995959) + (xy 155.201468 203.987687) (xy 155.195201 203.983499) (xy 155.11234 203.928134) (xy 155.112339 203.928133) + (xy 155.112335 203.928132) (xy 155.039277 203.9136) (xy 155.039274 203.9136) (xy 154.482726 203.9136) + (xy 154.482723 203.9136) (xy 154.409664 203.928132) (xy 154.40966 203.928133) (xy 154.326799 203.983499) + (xy 154.271433 204.06636) (xy 154.271432 204.066364) (xy 154.2569 204.139421) (xy 154.2569 205.644873) + (xy 154.267131 205.69631) (xy 154.260903 205.765901) (xy 154.218039 205.821078) (xy 154.152149 205.844322) + (xy 154.145513 205.8445) (xy 154.106487 205.8445) (xy 154.039448 205.824815) (xy 153.993693 205.772011) + (xy 153.983749 205.702853) (xy 153.984869 205.69631) (xy 153.9951 205.644873) (xy 153.9951 204.139423) + (xy 153.995099 204.139421) (xy 153.980567 204.066364) (xy 153.980566 204.06636) (xy 153.925201 203.983499) + (xy 153.84234 203.928134) (xy 153.842339 203.928133) (xy 153.842335 203.928132) (xy 153.769277 203.9136) + (xy 153.769274 203.9136) (xy 153.724 203.9136) (xy 153.656961 203.893915) (xy 153.611206 203.841111) + (xy 153.6 203.7896) (xy 153.6 201.506092) (xy 153.600597 201.493938) (xy 153.605473 201.44443) (xy 153.618018 201.317056) + (xy 153.622757 201.293232) (xy 153.672577 201.128994) (xy 153.681875 201.106549) (xy 153.762775 200.955195) + (xy 153.776272 200.934995) (xy 153.885149 200.802328) (xy 153.902328 200.785149) (xy 154.034995 200.676272) + (xy 154.055195 200.662775) (xy 154.206549 200.581875) (xy 154.228994 200.572577) (xy 154.393232 200.522757) + (xy 154.417056 200.518018) (xy 154.593939 200.500597) (xy 154.606093 200.5) (xy 161.599993 200.5) + (xy 161.6 200.5) (xy 161.755291 200.479555) (xy 161.9 200.419615) (xy 162.024264 200.324264) (xy 162.119615 200.2) + (xy 162.179555 200.055291) (xy 162.2 199.9) (xy 162.218314 199.76089) (xy 162.22669 199.729631) + (xy 162.27414 199.615076) (xy 162.29032 199.587052) (xy 162.365802 199.488681) (xy 162.388681 199.465802) + (xy 162.487052 199.39032) (xy 162.515076 199.37414) (xy 162.629631 199.32669) (xy 162.66089 199.318314) + (xy 162.753513 199.30612) (xy 162.791942 199.301061) (xy 162.808127 199.3) (xy 164.64304 199.3) ) ) ) @@ -155158,10 +159191,10 @@ (xy 254.292265 129.045387) (xy 254.279825 129.046298) (xy 254.104303 129.063453) (xy 254.104274 129.063456) (xy 254.079672 129.067077) (xy 254.056045 129.071739) (xy 254.056015 129.071745) (xy 254.031862 129.077746) (xy 254.031858 129.077747) (xy 253.86877 129.126816) (xy 253.845334 129.135132) (xy 253.823011 129.1443) - (xy 253.800489 129.154858) (xy 253.800483 129.154861) (xy 253.650002 129.234569) (xy 253.628587 129.247285) - (xy 253.608491 129.260582) (xy 253.60847 129.260596) (xy 253.588447 129.275295) (xy 253.588415 129.27532) - (xy 253.527553 129.324735) (xy 253.451503 129.386479) (xy 253.442018 129.394572) (xy 253.433065 129.402595) - (xy 253.423958 129.411164) (xy 252.917586 129.911473) (xy 252.253138 130.567961) (xy 252.241678 130.577971) + (xy 253.800489 129.154858) (xy 253.800483 129.154861) (xy 253.649996 129.234572) (xy 253.628585 129.247286) + (xy 253.628583 129.247288) (xy 253.608479 129.260591) (xy 253.608471 129.260597) (xy 253.588449 129.275294) + (xy 253.451497 129.386484) (xy 253.442824 129.393883) (xy 253.442027 129.394564) (xy 253.433044 129.402614) + (xy 253.43304 129.402618) (xy 253.423968 129.411155) (xy 252.25314 130.56796) (xy 252.24168 130.57797) (xy 249.773673 132.47992) (xy 249.708557 132.50525) (xy 249.640354 132.491497) (xy 249.632365 132.487304) (xy 249.632362 132.487303) (xy 249.478986 132.4495) (xy 249.478985 132.4495) (xy 249.321015 132.4495) (xy 249.321014 132.4495) (xy 249.167634 132.487303) (xy 249.027762 132.560715) (xy 248.909516 132.665471) @@ -155180,59 +159213,66 @@ (xy 234.92659 137.699618) (xy 234.916863 137.7) (xy 229.941959 137.7) (xy 229.932232 137.699618) (xy 229.929411 137.699396) (xy 229.92659 137.699618) (xy 229.916863 137.7) (xy 224.941959 137.7) (xy 224.932232 137.699618) (xy 224.929411 137.699396) (xy 224.92659 137.699618) (xy 224.916863 137.7) - (xy 222.8 137.7) (xy 222.8 138.7) (xy 222.8 138.700003) (xy 222.8 141.493907) (xy 222.799403 141.506061) - (xy 222.781982 141.682934) (xy 222.77724 141.706775) (xy 222.727424 141.870998) (xy 222.718121 141.893456) - (xy 222.637227 142.044798) (xy 222.623722 142.06501) (xy 222.514854 142.197666) (xy 222.497666 142.214854) - (xy 222.36501 142.323722) (xy 222.344798 142.337227) (xy 222.193456 142.418121) (xy 222.170998 142.427424) - (xy 222.006775 142.47724) (xy 221.982934 142.481982) (xy 221.806061 142.499403) (xy 221.793907 142.5) - (xy 207.706093 142.5) (xy 207.693939 142.499403) (xy 207.517065 142.481982) (xy 207.493224 142.47724) - (xy 207.329001 142.427424) (xy 207.306543 142.418121) (xy 207.155201 142.337227) (xy 207.134989 142.323722) - (xy 207.002333 142.214854) (xy 206.985145 142.197666) (xy 206.876277 142.06501) (xy 206.862772 142.044798) - (xy 206.781878 141.893456) (xy 206.772575 141.870998) (xy 206.722757 141.706769) (xy 206.718018 141.682941) - (xy 206.700597 141.506061) (xy 206.7 141.493907) (xy 206.7 134.906092) (xy 206.700597 134.893938) - (xy 206.718018 134.717056) (xy 206.722757 134.693232) (xy 206.772577 134.528994) (xy 206.781875 134.506549) - (xy 206.862775 134.355195) (xy 206.876272 134.334995) (xy 206.985149 134.202328) (xy 207.002328 134.185149) - (xy 207.134995 134.076272) (xy 207.155195 134.062775) (xy 207.306549 133.981875) (xy 207.328994 133.972577) - (xy 207.493232 133.922757) (xy 207.517056 133.918018) (xy 207.693939 133.900597) (xy 207.706093 133.9) - (xy 210.799997 133.9) (xy 210.8 133.9) (xy 211.8 133.9) (xy 211.8 131.855) (xy 223.273807 131.855) - (xy 223.294189 132.11399) (xy 223.354838 132.36661) (xy 223.454254 132.606623) (xy 223.454256 132.606627) - (xy 223.454257 132.606628) (xy 223.589999 132.82814) (xy 223.758722 133.025689) (xy 223.956271 133.194412) - (xy 224.177783 133.330154) (xy 224.177785 133.330154) (xy 224.177787 133.330156) (xy 224.238899 133.355469) - (xy 224.417801 133.429573) (xy 224.670417 133.490221) (xy 224.929411 133.510604) (xy 225.188405 133.490221) - (xy 225.441021 133.429573) (xy 225.681039 133.330154) (xy 225.902551 133.194412) (xy 226.1001 133.025689) - (xy 226.268823 132.82814) (xy 226.404565 132.606628) (xy 226.503984 132.36661) (xy 226.564632 132.113994) - (xy 226.585015 131.855) (xy 226.564632 131.596006) (xy 226.503984 131.34339) (xy 226.438188 131.184544) - (xy 226.404567 131.103376) (xy 226.398764 131.093907) (xy 226.268823 130.88186) (xy 226.1001 130.684311) - (xy 225.902551 130.515588) (xy 225.681039 130.379846) (xy 225.681038 130.379845) (xy 225.681034 130.379843) - (xy 225.515038 130.311086) (xy 225.441021 130.280427) (xy 225.441022 130.280427) (xy 225.303332 130.24737) - (xy 225.188405 130.219779) (xy 225.188403 130.219778) (xy 225.188402 130.219778) (xy 224.929411 130.199396) - (xy 224.67042 130.219778) (xy 224.4178 130.280427) (xy 224.177787 130.379843) (xy 223.95627 130.515588) - (xy 223.758722 130.684311) (xy 223.589999 130.881859) (xy 223.454254 131.103376) (xy 223.354838 131.343389) - (xy 223.294189 131.596009) (xy 223.273807 131.855) (xy 211.8 131.855) (xy 211.8 130.206092) (xy 211.800597 130.193938) - (xy 211.818018 130.017056) (xy 211.822757 129.993232) (xy 211.872577 129.828994) (xy 211.881875 129.806549) - (xy 211.962775 129.655195) (xy 211.976272 129.634995) (xy 212.085149 129.502328) (xy 212.102328 129.485149) - (xy 212.234995 129.376272) (xy 212.255195 129.362775) (xy 212.406549 129.281875) (xy 212.428994 129.272577) - (xy 212.593232 129.222757) (xy 212.617056 129.218018) (xy 212.793939 129.200597) (xy 212.806093 129.2) - (xy 231.161681 129.2) (xy 231.22872 129.219685) (xy 231.249362 129.236319) (xy 233.306042 131.292999) - (xy 233.339527 131.354322) (xy 233.338935 131.409627) (xy 233.294189 131.596008) (xy 233.273807 131.855) - (xy 233.294189 132.11399) (xy 233.354838 132.36661) (xy 233.454254 132.606623) (xy 233.454256 132.606627) - (xy 233.454257 132.606628) (xy 233.589999 132.82814) (xy 233.758722 133.025689) (xy 233.956271 133.194412) - (xy 234.177783 133.330154) (xy 234.177785 133.330154) (xy 234.177787 133.330156) (xy 234.238899 133.355469) - (xy 234.417801 133.429573) (xy 234.670417 133.490221) (xy 234.929411 133.510604) (xy 235.188405 133.490221) - (xy 235.441021 133.429573) (xy 235.681039 133.330154) (xy 235.902551 133.194412) (xy 236.1001 133.025689) - (xy 236.268823 132.82814) (xy 236.404565 132.606628) (xy 236.503984 132.36661) (xy 236.564632 132.113994) - (xy 236.585015 131.855) (xy 236.564632 131.596006) (xy 236.503984 131.34339) (xy 236.438188 131.184544) - (xy 236.404567 131.103376) (xy 236.398764 131.093907) (xy 236.268823 130.88186) (xy 236.1001 130.684311) - (xy 235.902551 130.515588) (xy 235.681039 130.379846) (xy 235.681038 130.379845) (xy 235.681034 130.379843) - (xy 235.515038 130.311086) (xy 235.441021 130.280427) (xy 235.441022 130.280427) (xy 235.303332 130.24737) - (xy 235.188405 130.219779) (xy 235.188403 130.219778) (xy 235.188402 130.219778) (xy 234.929411 130.199396) - (xy 234.670419 130.219778) (xy 234.484038 130.264524) (xy 234.414255 130.261033) (xy 234.36741 130.231631) - (xy 233.54746 129.411681) (xy 233.513975 129.350358) (xy 233.518959 129.280666) (xy 233.560831 129.224733) - (xy 233.626295 129.200316) (xy 233.635141 129.2) (xy 234.812882 129.2) (xy 234.860024 129.211618) - (xy 234.860624 129.210037) (xy 234.867633 129.212695) (xy 234.867635 129.212696) (xy 235.021015 129.2505) - (xy 235.178985 129.2505) (xy 235.332365 129.212696) (xy 235.332369 129.212693) (xy 235.339376 129.210037) - (xy 235.339975 129.211618) (xy 235.387118 129.2) (xy 237.199997 129.2) (xy 237.2 129.2) (xy 238.2 129.2) - (xy 238.2 127.506092) (xy 238.200597 127.493938) (xy 238.218018 127.317056) (xy 238.222757 127.293232) + (xy 223.8 137.7) (xy 223.751844 137.704743) (xy 223.604911 137.719214) (xy 223.494149 137.752813) + (xy 223.417317 137.77612) (xy 223.417314 137.776121) (xy 223.417312 137.776122) (xy 223.417309 137.776123) + (xy 223.244435 137.868526) (xy 223.244428 137.868531) (xy 223.092892 137.992892) (xy 222.968531 138.144428) + (xy 222.968526 138.144435) (xy 222.876123 138.317309) (xy 222.876122 138.317312) (xy 222.819214 138.504911) + (xy 222.8 138.700003) (xy 222.8 141.493907) (xy 222.799403 141.506061) (xy 222.781982 141.682934) + (xy 222.77724 141.706775) (xy 222.727424 141.870998) (xy 222.718121 141.893456) (xy 222.637227 142.044798) + (xy 222.623722 142.06501) (xy 222.514854 142.197666) (xy 222.497666 142.214854) (xy 222.36501 142.323722) + (xy 222.344798 142.337227) (xy 222.193456 142.418121) (xy 222.170998 142.427424) (xy 222.006775 142.47724) + (xy 221.982934 142.481982) (xy 221.806061 142.499403) (xy 221.793907 142.5) (xy 207.706093 142.5) + (xy 207.693939 142.499403) (xy 207.517065 142.481982) (xy 207.493224 142.47724) (xy 207.329001 142.427424) + (xy 207.306543 142.418121) (xy 207.155201 142.337227) (xy 207.134989 142.323722) (xy 207.002333 142.214854) + (xy 206.985145 142.197666) (xy 206.876277 142.06501) (xy 206.862772 142.044798) (xy 206.781878 141.893456) + (xy 206.772575 141.870998) (xy 206.722757 141.706769) (xy 206.718018 141.682941) (xy 206.700597 141.506061) + (xy 206.7 141.493907) (xy 206.7 134.906092) (xy 206.700597 134.893938) (xy 206.718018 134.717056) + (xy 206.722757 134.693232) (xy 206.772577 134.528994) (xy 206.781875 134.506549) (xy 206.862775 134.355195) + (xy 206.876272 134.334995) (xy 206.985149 134.202328) (xy 207.002328 134.185149) (xy 207.134995 134.076272) + (xy 207.155195 134.062775) (xy 207.306549 133.981875) (xy 207.328994 133.972577) (xy 207.493232 133.922757) + (xy 207.517056 133.918018) (xy 207.693939 133.900597) (xy 207.706093 133.9) (xy 210.799997 133.9) + (xy 210.8 133.9) (xy 210.99509 133.880785) (xy 211.182683 133.82388) (xy 211.35557 133.73147) (xy 211.507107 133.607107) + (xy 211.63147 133.45557) (xy 211.72388 133.282683) (xy 211.780785 133.09509) (xy 211.8 132.9) (xy 211.8 131.855) + (xy 223.273807 131.855) (xy 223.294189 132.11399) (xy 223.354838 132.36661) (xy 223.454254 132.606623) + (xy 223.454256 132.606627) (xy 223.454257 132.606628) (xy 223.589999 132.82814) (xy 223.758722 133.025689) + (xy 223.956271 133.194412) (xy 224.177783 133.330154) (xy 224.177785 133.330154) (xy 224.177787 133.330156) + (xy 224.238899 133.355469) (xy 224.417801 133.429573) (xy 224.670417 133.490221) (xy 224.929411 133.510604) + (xy 225.188405 133.490221) (xy 225.441021 133.429573) (xy 225.681039 133.330154) (xy 225.902551 133.194412) + (xy 226.1001 133.025689) (xy 226.268823 132.82814) (xy 226.404565 132.606628) (xy 226.503984 132.36661) + (xy 226.564632 132.113994) (xy 226.585015 131.855) (xy 226.564632 131.596006) (xy 226.503984 131.34339) + (xy 226.438188 131.184544) (xy 226.404567 131.103376) (xy 226.398764 131.093907) (xy 226.268823 130.88186) + (xy 226.1001 130.684311) (xy 225.902551 130.515588) (xy 225.681039 130.379846) (xy 225.681038 130.379845) + (xy 225.681034 130.379843) (xy 225.515038 130.311086) (xy 225.441021 130.280427) (xy 225.441022 130.280427) + (xy 225.303332 130.24737) (xy 225.188405 130.219779) (xy 225.188403 130.219778) (xy 225.188402 130.219778) + (xy 224.929411 130.199396) (xy 224.67042 130.219778) (xy 224.4178 130.280427) (xy 224.177787 130.379843) + (xy 223.95627 130.515588) (xy 223.758722 130.684311) (xy 223.589999 130.881859) (xy 223.454254 131.103376) + (xy 223.354838 131.343389) (xy 223.294189 131.596009) (xy 223.273807 131.855) (xy 211.8 131.855) + (xy 211.8 130.206092) (xy 211.800597 130.193938) (xy 211.818018 130.017056) (xy 211.822757 129.993232) + (xy 211.872577 129.828994) (xy 211.881875 129.806549) (xy 211.962775 129.655195) (xy 211.976272 129.634995) + (xy 212.085149 129.502328) (xy 212.102328 129.485149) (xy 212.234995 129.376272) (xy 212.255195 129.362775) + (xy 212.406549 129.281875) (xy 212.428994 129.272577) (xy 212.593232 129.222757) (xy 212.617056 129.218018) + (xy 212.793939 129.200597) (xy 212.806093 129.2) (xy 231.161681 129.2) (xy 231.22872 129.219685) + (xy 231.249362 129.236319) (xy 233.306042 131.292999) (xy 233.339527 131.354322) (xy 233.338935 131.409627) + (xy 233.294189 131.596008) (xy 233.273807 131.855) (xy 233.294189 132.11399) (xy 233.354838 132.36661) + (xy 233.454254 132.606623) (xy 233.454256 132.606627) (xy 233.454257 132.606628) (xy 233.589999 132.82814) + (xy 233.758722 133.025689) (xy 233.956271 133.194412) (xy 234.177783 133.330154) (xy 234.177785 133.330154) + (xy 234.177787 133.330156) (xy 234.238899 133.355469) (xy 234.417801 133.429573) (xy 234.670417 133.490221) + (xy 234.929411 133.510604) (xy 235.188405 133.490221) (xy 235.441021 133.429573) (xy 235.681039 133.330154) + (xy 235.902551 133.194412) (xy 236.1001 133.025689) (xy 236.268823 132.82814) (xy 236.404565 132.606628) + (xy 236.503984 132.36661) (xy 236.564632 132.113994) (xy 236.585015 131.855) (xy 236.564632 131.596006) + (xy 236.503984 131.34339) (xy 236.438188 131.184544) (xy 236.404567 131.103376) (xy 236.398764 131.093907) + (xy 236.268823 130.88186) (xy 236.1001 130.684311) (xy 235.902551 130.515588) (xy 235.681039 130.379846) + (xy 235.681038 130.379845) (xy 235.681034 130.379843) (xy 235.515038 130.311086) (xy 235.441021 130.280427) + (xy 235.441022 130.280427) (xy 235.303332 130.24737) (xy 235.188405 130.219779) (xy 235.188403 130.219778) + (xy 235.188402 130.219778) (xy 234.929411 130.199396) (xy 234.670419 130.219778) (xy 234.484038 130.264524) + (xy 234.414255 130.261033) (xy 234.36741 130.231631) (xy 233.54746 129.411681) (xy 233.513975 129.350358) + (xy 233.518959 129.280666) (xy 233.560831 129.224733) (xy 233.626295 129.200316) (xy 233.635141 129.2) + (xy 234.812882 129.2) (xy 234.860024 129.211618) (xy 234.860624 129.210037) (xy 234.867633 129.212695) + (xy 234.867635 129.212696) (xy 235.021015 129.2505) (xy 235.178985 129.2505) (xy 235.332365 129.212696) + (xy 235.332369 129.212693) (xy 235.339376 129.210037) (xy 235.339975 129.211618) (xy 235.387118 129.2) + (xy 237.199997 129.2) (xy 237.2 129.2) (xy 237.39509 129.180785) (xy 237.582683 129.12388) (xy 237.75557 129.03147) + (xy 237.907107 128.907107) (xy 238.03147 128.75557) (xy 238.12388 128.582683) (xy 238.180785 128.39509) + (xy 238.2 128.2) (xy 238.2 127.506092) (xy 238.200597 127.493938) (xy 238.218018 127.317056) (xy 238.222757 127.293232) (xy 238.272577 127.128994) (xy 238.281875 127.106549) (xy 238.362775 126.955195) (xy 238.376272 126.934995) (xy 238.485149 126.802328) (xy 238.502328 126.785149) (xy 238.626011 126.683645) (xy 238.690321 126.656334) (xy 238.704675 126.6555) (xy 258.179847 126.6555) (xy 258.179854 126.6555) (xy 258.221911 126.652015) @@ -155329,7 +159369,9 @@ (xy 201.937774 212.430341) (xy 201.912756 212.418293) (xy 201.794211 212.343806) (xy 201.772502 212.326493) (xy 201.673506 212.227497) (xy 201.656193 212.205788) (xy 201.581706 212.087243) (xy 201.569658 212.062225) (xy 201.567329 212.05557) (xy 201.523416 211.930072) (xy 201.517239 211.903004) (xy 201.516163 211.893456) - (xy 201.5 211.75) (xy 201.5 211) (xy 200.750006 211) (xy 192.596682 211) (xy 192.529643 210.980315) + (xy 201.5 211.75) (xy 201.481196 211.583109) (xy 201.425727 211.424587) (xy 201.336374 211.282383) + (xy 201.217617 211.163626) (xy 201.075413 211.074273) (xy 201.025339 211.056751) (xy 200.91689 211.018803) + (xy 200.916885 211.018802) (xy 200.750006 211) (xy 200.75 211) (xy 192.596682 211) (xy 192.529643 210.980315) (xy 192.522813 210.975596) (xy 192.506976 210.96385) (xy 192.506944 210.963827) (xy 192.486743 210.950329) (xy 192.486733 210.950323) (xy 192.46527 210.937458) (xy 192.465257 210.937451) (xy 192.465242 210.937442) (xy 192.443957 210.926065) (xy 192.435624 210.92161) (xy 192.399771 210.90778) (xy 192.377258 210.899097) @@ -155347,19 +159389,27 @@ (xy 186.572577 208.628994) (xy 186.581875 208.606549) (xy 186.662775 208.455195) (xy 186.676272 208.434995) (xy 186.785149 208.302328) (xy 186.802328 208.285149) (xy 186.934995 208.176272) (xy 186.955195 208.162775) (xy 187.106549 208.081875) (xy 187.128994 208.072577) (xy 187.293232 208.022757) (xy 187.317056 208.018018) - (xy 187.493939 208.000597) (xy 187.506093 208) (xy 193.999997 208) (xy 194 208) (xy 195 208) (xy 195 204.506092) - (xy 195.000597 204.493938) (xy 195.018018 204.317056) (xy 195.022757 204.293232) (xy 195.072577 204.128994) - (xy 195.081875 204.106549) (xy 195.162775 203.955195) (xy 195.176272 203.934995) (xy 195.285149 203.802328) - (xy 195.302328 203.785149) (xy 195.434995 203.676272) (xy 195.455195 203.662775) (xy 195.606549 203.581875) - (xy 195.628994 203.572577) (xy 195.793232 203.522757) (xy 195.817056 203.518018) (xy 195.993939 203.500597) - (xy 196.006093 203.5) (xy 197.743039 203.5) (xy 197.756922 203.50078) (xy 197.786793 203.504145) - (xy 197.903006 203.517239) (xy 197.930072 203.523416) (xy 198.062227 203.569659) (xy 198.08724 203.581704) - (xy 198.205789 203.656194) (xy 198.227497 203.673506) (xy 198.326493 203.772502) (xy 198.343806 203.794211) - (xy 198.418293 203.912756) (xy 198.430341 203.937774) (xy 198.476582 204.069924) (xy 198.48276 204.096994) - (xy 198.493813 204.195088) (xy 198.5 204.25) (xy 198.5 205) (xy 198.931861 205) (xy 198.965313 205.044687) - (xy 199.074774 205.126628) (xy 199.202886 205.174412) (xy 199.259515 205.1805) (xy 199.850484 205.180499) - (xy 199.907114 205.174412) (xy 200.035226 205.126628) (xy 200.144687 205.044687) (xy 200.167405 205.014338) - (xy 200.186559 205) (xy 201 205) (xy 201 203.006092) (xy 201.000597 202.993938) (xy 201.018018 202.817056) + (xy 187.493939 208.000597) (xy 187.506093 208) (xy 193.999997 208) (xy 194 208) (xy 194.19509 207.980785) + (xy 194.382683 207.92388) (xy 194.55557 207.83147) (xy 194.61199 207.785166) (xy 194.66646 207.759403) + (xy 194.70234 207.752267) (xy 194.785201 207.696902) (xy 194.840566 207.614041) (xy 194.8551 207.540975) + (xy 194.8551 207.540968) (xy 194.855697 207.534915) (xy 194.856949 207.535038) (xy 194.869741 207.483969) + (xy 194.92388 207.382683) (xy 194.980785 207.19509) (xy 195 207) (xy 195 204.506092) (xy 195.000597 204.493938) + (xy 195.018018 204.317056) (xy 195.022757 204.293232) (xy 195.072577 204.128994) (xy 195.081875 204.106549) + (xy 195.162775 203.955195) (xy 195.176272 203.934995) (xy 195.285149 203.802328) (xy 195.302328 203.785149) + (xy 195.434995 203.676272) (xy 195.455195 203.662775) (xy 195.606549 203.581875) (xy 195.628994 203.572577) + (xy 195.793232 203.522757) (xy 195.817056 203.518018) (xy 195.993939 203.500597) (xy 196.006093 203.5) + (xy 197.743039 203.5) (xy 197.756922 203.50078) (xy 197.786793 203.504145) (xy 197.903006 203.517239) + (xy 197.930072 203.523416) (xy 198.062227 203.569659) (xy 198.08724 203.581704) (xy 198.205789 203.656194) + (xy 198.227497 203.673506) (xy 198.326493 203.772502) (xy 198.343806 203.794211) (xy 198.418293 203.912756) + (xy 198.430341 203.937774) (xy 198.476582 204.069924) (xy 198.48276 204.096994) (xy 198.5 204.25) + (xy 198.5 204.250001) (xy 198.518802 204.416885) (xy 198.518803 204.41689) (xy 198.545764 204.493938) + (xy 198.574273 204.575413) (xy 198.663626 204.717617) (xy 198.782383 204.836374) (xy 198.830588 204.866663) + (xy 198.876878 204.918996) (xy 198.880796 204.928319) (xy 198.883372 204.935227) (xy 198.909404 204.970001) + (xy 198.965313 205.044687) (xy 199.074774 205.126628) (xy 199.202886 205.174412) (xy 199.259515 205.1805) + (xy 199.850484 205.180499) (xy 199.907114 205.174412) (xy 200.035226 205.126628) (xy 200.144687 205.044687) + (xy 200.167405 205.014338) (xy 200.223333 204.97247) (xy 200.23064 204.970001) (xy 200.382683 204.92388) + (xy 200.55557 204.83147) (xy 200.707107 204.707107) (xy 200.83147 204.55557) (xy 200.92388 204.382683) + (xy 200.980785 204.19509) (xy 201 204) (xy 201 203.006092) (xy 201.000597 202.993938) (xy 201.018018 202.817056) (xy 201.022757 202.793232) (xy 201.072577 202.628994) (xy 201.081875 202.606549) (xy 201.162775 202.455195) (xy 201.176272 202.434995) (xy 201.285149 202.302328) (xy 201.302367 202.285117) (xy 201.30304 202.284564) (xy 201.304198 202.283616) (xy 201.368519 202.256328) (xy 201.382825 202.2555) (xy 208.617175 202.2555) @@ -155407,15 +159457,20 @@ (xy 268.706543 185.318121) (xy 268.555201 185.237227) (xy 268.534989 185.223722) (xy 268.402333 185.114854) (xy 268.385145 185.097666) (xy 268.276277 184.96501) (xy 268.262772 184.944798) (xy 268.181878 184.793456) (xy 268.172575 184.770998) (xy 268.122757 184.606769) (xy 268.118018 184.582941) (xy 268.100597 184.406061) - (xy 268.1 184.393907) (xy 268.1 178.200003) (xy 268.1 178.2) (xy 268.1 177.2) (xy 267.1 177.2) (xy 267.099997 177.2) - (xy 265.106093 177.2) (xy 265.093939 177.199403) (xy 264.917065 177.181982) (xy 264.893224 177.17724) - (xy 264.729001 177.127424) (xy 264.706543 177.118121) (xy 264.555201 177.037227) (xy 264.534989 177.023722) - (xy 264.402333 176.914854) (xy 264.385145 176.897666) (xy 264.276277 176.76501) (xy 264.262772 176.744798) - (xy 264.181878 176.593456) (xy 264.172575 176.570998) (xy 264.122757 176.406769) (xy 264.118018 176.382937) - (xy 264.116618 176.36873) (xy 264.116023 176.356588) (xy 264.116023 176.207906) (xy 264.102383 176.139337) - (xy 264.1 176.115145) (xy 264.1 176.106091) (xy 264.100597 176.09394) (xy 264.101092 176.088908) - (xy 264.103185 176.067655) (xy 264.129344 176.002869) (xy 264.13889 175.992145) (xy 264.874222 175.256813) - (xy 264.935543 175.22333) + (xy 268.1 184.393907) (xy 268.1 178.200003) (xy 268.080785 178.004911) (xy 268.080785 178.00491) + (xy 268.02388 177.817317) (xy 267.953165 177.685018) (xy 267.938523 177.626565) (xy 267.938523 177.475406) + (xy 267.938522 177.475404) (xy 267.92399 177.402347) (xy 267.923989 177.402343) (xy 267.868624 177.319482) + (xy 267.785763 177.264117) (xy 267.785762 177.264116) (xy 267.785758 177.264115) (xy 267.7127 177.249583) + (xy 267.712697 177.249583) (xy 267.413595 177.249583) (xy 267.377601 177.244244) (xy 267.29509 177.219215) + (xy 267.295088 177.219214) (xy 267.29509 177.219214) (xy 267.144494 177.204382) (xy 267.1 177.2) + (xy 267.099997 177.2) (xy 265.106093 177.2) (xy 265.093939 177.199403) (xy 264.917065 177.181982) + (xy 264.893224 177.17724) (xy 264.729001 177.127424) (xy 264.706543 177.118121) (xy 264.555201 177.037227) + (xy 264.534989 177.023722) (xy 264.402333 176.914854) (xy 264.385145 176.897666) (xy 264.276277 176.76501) + (xy 264.262772 176.744798) (xy 264.181878 176.593456) (xy 264.172575 176.570998) (xy 264.122757 176.406769) + (xy 264.118018 176.382937) (xy 264.116618 176.36873) (xy 264.116023 176.356588) (xy 264.116023 176.207906) + (xy 264.102383 176.139337) (xy 264.1 176.115145) (xy 264.1 176.106091) (xy 264.100597 176.09394) + (xy 264.101092 176.088908) (xy 264.103185 176.067655) (xy 264.129344 176.002869) (xy 264.13889 175.992145) + (xy 264.874222 175.256813) (xy 264.935543 175.22333) ) ) ) @@ -155455,21 +159510,22 @@ (xy 230.087227 148.944798) (xy 230.073722 148.96501) (xy 229.964854 149.097666) (xy 229.947666 149.114854) (xy 229.81501 149.223722) (xy 229.794798 149.237227) (xy 229.643456 149.318121) (xy 229.620998 149.327424) (xy 229.456775 149.37724) (xy 229.432934 149.381982) (xy 229.256061 149.399403) (xy 229.243907 149.4) - (xy 227.15 149.4) (xy 227.15 150.299999) (xy 227.15 150.3) (xy 227.128999 150.486382) (xy 227.12282 150.513453) - (xy 227.065484 150.677309) (xy 227.053437 150.702326) (xy 226.96108 150.849312) (xy 226.943767 150.871021) - (xy 226.821021 150.993767) (xy 226.799312 151.01108) (xy 226.652326 151.103437) (xy 226.627309 151.115484) - (xy 226.463453 151.17282) (xy 226.436382 151.178999) (xy 226.256923 151.19922) (xy 226.243039 151.2) - (xy 225.456093 151.2) (xy 225.443939 151.199403) (xy 225.267065 151.181982) (xy 225.243224 151.17724) - (xy 225.079001 151.127424) (xy 225.056543 151.118121) (xy 224.905201 151.037227) (xy 224.884989 151.023722) - (xy 224.752333 150.914854) (xy 224.735145 150.897666) (xy 224.626277 150.76501) (xy 224.612772 150.744798) - (xy 224.59007 150.702326) (xy 224.531877 150.593453) (xy 224.522575 150.570998) (xy 224.472757 150.406769) - (xy 224.468018 150.382941) (xy 224.450597 150.206061) (xy 224.45 150.193907) (xy 224.45 147.906092) - (xy 224.450597 147.893938) (xy 224.468018 147.717056) (xy 224.472757 147.693232) (xy 224.522577 147.528994) - (xy 224.531875 147.506549) (xy 224.612775 147.355195) (xy 224.626272 147.334995) (xy 224.735149 147.202328) - (xy 224.752328 147.185149) (xy 224.884995 147.076272) (xy 224.905192 147.062777) (xy 224.975605 147.02514) - (xy 225.034057 147.0105) (xy 226.399676 147.0105) (xy 226.399677 147.010499) (xy 226.47274 146.995966) - (xy 226.500655 146.977314) (xy 226.516995 146.966397) (xy 226.583672 146.94552) (xy 226.585884 146.9455) - (xy 229.3845 146.9455) + (xy 228.049993 149.4) (xy 227.849736 149.422563) (xy 227.659505 149.489127) (xy 227.488858 149.596352) + (xy 227.346352 149.738858) (xy 227.239127 149.909505) (xy 227.172563 150.099736) (xy 227.15 150.299999) + (xy 227.15 150.3) (xy 227.128999 150.486382) (xy 227.12282 150.513453) (xy 227.065484 150.677309) + (xy 227.053437 150.702326) (xy 226.96108 150.849312) (xy 226.943767 150.871021) (xy 226.821021 150.993767) + (xy 226.799312 151.01108) (xy 226.652326 151.103437) (xy 226.627309 151.115484) (xy 226.463453 151.17282) + (xy 226.436382 151.178999) (xy 226.256923 151.19922) (xy 226.243039 151.2) (xy 225.456093 151.2) + (xy 225.443939 151.199403) (xy 225.267065 151.181982) (xy 225.243224 151.17724) (xy 225.079001 151.127424) + (xy 225.056543 151.118121) (xy 224.905201 151.037227) (xy 224.884989 151.023722) (xy 224.752333 150.914854) + (xy 224.735145 150.897666) (xy 224.626277 150.76501) (xy 224.612772 150.744798) (xy 224.59007 150.702326) + (xy 224.531877 150.593453) (xy 224.522575 150.570998) (xy 224.472757 150.406769) (xy 224.468018 150.382941) + (xy 224.450597 150.206061) (xy 224.45 150.193907) (xy 224.45 147.906092) (xy 224.450597 147.893938) + (xy 224.468018 147.717056) (xy 224.472757 147.693232) (xy 224.522577 147.528994) (xy 224.531875 147.506549) + (xy 224.612775 147.355195) (xy 224.626272 147.334995) (xy 224.735149 147.202328) (xy 224.752328 147.185149) + (xy 224.884995 147.076272) (xy 224.905192 147.062777) (xy 224.975605 147.02514) (xy 225.034057 147.0105) + (xy 226.399676 147.0105) (xy 226.399677 147.010499) (xy 226.47274 146.995966) (xy 226.500655 146.977314) + (xy 226.516995 146.966397) (xy 226.583672 146.94552) (xy 226.585884 146.9455) (xy 229.3845 146.9455) ) ) ) @@ -155510,12 +159566,12 @@ (xy 275.378213 185.671365) (xy 275.395061 185.683007) (xy 275.397666 185.685145) (xy 275.397682 185.685158) (xy 275.414854 185.702333) (xy 275.523722 185.834989) (xy 275.537227 185.855201) (xy 275.618121 186.006543) (xy 275.627424 186.029001) (xy 275.67724 186.193224) (xy 275.681982 186.217065) (xy 275.699403 186.393938) - (xy 275.7 186.406092) (xy 275.7 195.7) (xy 267.2 195.7) (xy 267.2 186.406092) (xy 267.200597 186.393938) - (xy 267.218018 186.217056) (xy 267.222757 186.193232) (xy 267.272577 186.028994) (xy 267.281875 186.006549) - (xy 267.362775 185.855195) (xy 267.376272 185.834995) (xy 267.485149 185.702328) (xy 267.502328 185.685149) - (xy 267.634995 185.576272) (xy 267.655195 185.562775) (xy 267.806549 185.481875) (xy 267.828994 185.472577) - (xy 267.993232 185.422757) (xy 268.017056 185.418018) (xy 268.193939 185.400597) (xy 268.206093 185.4) - (xy 268.303317 185.4) + (xy 275.7 186.406092) (xy 275.7 195.7) (xy 274.7 195.7) (xy 268.2 195.7) (xy 267.2 195.7) (xy 267.2 186.406092) + (xy 267.200597 186.393938) (xy 267.218018 186.217056) (xy 267.222757 186.193232) (xy 267.272577 186.028994) + (xy 267.281875 186.006549) (xy 267.362775 185.855195) (xy 267.376272 185.834995) (xy 267.485149 185.702328) + (xy 267.502328 185.685149) (xy 267.634995 185.576272) (xy 267.655195 185.562775) (xy 267.806549 185.481875) + (xy 267.828994 185.472577) (xy 267.993232 185.422757) (xy 268.017056 185.418018) (xy 268.193939 185.400597) + (xy 268.206093 185.4) (xy 268.303317 185.4) ) ) ) @@ -155564,13 +159620,14 @@ (xy 170.79306 85.863822) (xy 170.793027 85.863846) (xy 170.77718 85.875599) (xy 170.711608 85.899722) (xy 170.703315 85.9) (xy 168.662211 85.9) (xy 168.63802 85.897617) (xy 168.623189 85.894667) (xy 168.578518 85.885781) (xy 168.533822 85.867267) (xy 168.493727 85.840477) (xy 168.459522 85.806272) (xy 168.43273 85.766175) - (xy 168.414218 85.72148) (xy 168.4 85.65) (xy 168.4 85.4) (xy 168.150004 85.4) (xy 167.153677 85.4) - (xy 167.129484 85.397617) (xy 167.107275 85.393199) (xy 167.107274 85.393199) (xy 166.550726 85.393199) - (xy 166.550725 85.393199) (xy 166.528516 85.397617) (xy 166.504323 85.4) (xy 165.883677 85.4) (xy 165.859484 85.397617) - (xy 165.837275 85.393199) (xy 165.837274 85.393199) (xy 165.280726 85.393199) (xy 165.280725 85.393199) - (xy 165.258516 85.397617) (xy 165.234323 85.4) (xy 164.613677 85.4) (xy 164.589484 85.397617) (xy 164.567275 85.393199) - (xy 164.567274 85.393199) (xy 164.010726 85.393199) (xy 164.010725 85.393199) (xy 163.988516 85.397617) - (xy 163.964323 85.4) (xy 163.343677 85.4) (xy 163.319484 85.397617) (xy 163.297275 85.393199) (xy 163.297274 85.393199) + (xy 168.414218 85.72148) (xy 168.4 85.65) (xy 168.38097 85.554329) (xy 168.326777 85.473223) (xy 168.29429 85.451515) + (xy 168.245671 85.419029) (xy 168.150004 85.4) (xy 168.15 85.4) (xy 167.153677 85.4) (xy 167.129484 85.397617) + (xy 167.107275 85.393199) (xy 167.107274 85.393199) (xy 166.550726 85.393199) (xy 166.550725 85.393199) + (xy 166.528516 85.397617) (xy 166.504323 85.4) (xy 165.883677 85.4) (xy 165.859484 85.397617) (xy 165.837275 85.393199) + (xy 165.837274 85.393199) (xy 165.280726 85.393199) (xy 165.280725 85.393199) (xy 165.258516 85.397617) + (xy 165.234323 85.4) (xy 164.613677 85.4) (xy 164.589484 85.397617) (xy 164.567275 85.393199) (xy 164.567274 85.393199) + (xy 164.010726 85.393199) (xy 164.010725 85.393199) (xy 163.988516 85.397617) (xy 163.964323 85.4) + (xy 163.343677 85.4) (xy 163.319484 85.397617) (xy 163.297275 85.393199) (xy 163.297274 85.393199) (xy 162.740726 85.393199) (xy 162.740725 85.393199) (xy 162.718516 85.397617) (xy 162.694323 85.4) (xy 162.073677 85.4) (xy 162.049484 85.397617) (xy 162.027275 85.393199) (xy 162.027274 85.393199) (xy 161.470726 85.393199) (xy 161.470725 85.393199) (xy 161.448516 85.397617) (xy 161.424323 85.4) @@ -155604,71 +159661,74 @@ (xy 164.929818 81.9) (xy 165.236344 81.9) (xy 165.260537 81.902383) (xy 165.280725 81.906399) (xy 165.280726 81.906399) (xy 165.837275 81.906399) (xy 165.857463 81.902383) (xy 165.881656 81.9) (xy 166.506344 81.9) (xy 166.530537 81.902383) (xy 166.550725 81.906399) (xy 166.550726 81.906399) (xy 167.107275 81.906399) (xy 167.127463 81.902383) - (xy 167.151656 81.9) (xy 167.599997 81.9) (xy 167.6 81.9) (xy 168.6 81.9) (xy 168.6 79.149995) (xy 176.480233 79.149995) - (xy 176.480233 79.150004) (xy 176.499273 79.404079) (xy 176.555968 79.652477) (xy 176.555973 79.652494) - (xy 176.649058 79.889671) (xy 176.649057 79.889671) (xy 176.776454 80.110327) (xy 176.776461 80.110338) - (xy 176.818452 80.162991) (xy 176.818453 80.162992) (xy 177.469152 79.512292) (xy 177.476049 79.528942) - (xy 177.563599 79.65997) (xy 177.67503 79.771401) (xy 177.806058 79.858951) (xy 177.822705 79.865846) - (xy 177.171813 80.516738) (xy 177.332616 80.626371) (xy 177.332624 80.626376) (xy 177.562176 80.736921) - (xy 177.562174 80.736921) (xy 177.805652 80.812024) (xy 177.805658 80.812026) (xy 178.057595 80.849999) - (xy 178.057604 80.85) (xy 178.312396 80.85) (xy 178.312404 80.849999) (xy 178.564341 80.812026) - (xy 178.564347 80.812024) (xy 178.807824 80.736921) (xy 179.037376 80.626376) (xy 179.037377 80.626375) - (xy 179.198185 80.516738) (xy 178.547294 79.865846) (xy 178.563942 79.858951) (xy 178.69497 79.771401) - (xy 178.806401 79.65997) (xy 178.893951 79.528942) (xy 178.900846 79.512294) (xy 179.551544 80.162992) - (xy 179.551546 80.162991) (xy 179.593544 80.11033) (xy 179.720941 79.889671) (xy 179.769572 79.765763) - (xy 179.812387 79.710549) (xy 179.878257 79.687248) (xy 179.946268 79.703259) (xy 179.994827 79.753496) - (xy 180.000428 79.765763) (xy 180.049058 79.889671) (xy 180.176454 80.110327) (xy 180.176461 80.110338) - (xy 180.218452 80.162991) (xy 180.218453 80.162992) (xy 180.869152 79.512292) (xy 180.876049 79.528942) - (xy 180.963599 79.65997) (xy 181.07503 79.771401) (xy 181.206058 79.858951) (xy 181.222705 79.865846) - (xy 180.571813 80.516738) (xy 180.732616 80.626371) (xy 180.732624 80.626376) (xy 180.962176 80.736921) - (xy 180.962174 80.736921) (xy 181.205652 80.812024) (xy 181.205658 80.812026) (xy 181.457595 80.849999) - (xy 181.457604 80.85) (xy 181.712396 80.85) (xy 181.712404 80.849999) (xy 181.964341 80.812026) - (xy 181.964347 80.812024) (xy 182.207824 80.736921) (xy 182.437376 80.626376) (xy 182.437377 80.626375) - (xy 182.598185 80.516738) (xy 181.947294 79.865846) (xy 181.963942 79.858951) (xy 182.09497 79.771401) - (xy 182.206401 79.65997) (xy 182.293951 79.528942) (xy 182.300846 79.512294) (xy 182.951544 80.162992) - (xy 182.951546 80.162991) (xy 182.993544 80.11033) (xy 183.120941 79.889671) (xy 183.214026 79.652494) - (xy 183.214031 79.652477) (xy 183.270726 79.404079) (xy 183.289767 79.150004) (xy 183.289767 79.149995) - (xy 183.270726 78.89592) (xy 183.214031 78.647522) (xy 183.214026 78.647505) (xy 183.120941 78.410328) - (xy 183.120942 78.410328) (xy 182.993545 78.189672) (xy 182.951545 78.137006) (xy 182.300846 78.787705) - (xy 182.293951 78.771058) (xy 182.206401 78.64003) (xy 182.09497 78.528599) (xy 181.963942 78.441049) - (xy 181.947293 78.434152) (xy 182.598185 77.78326) (xy 182.437384 77.673628) (xy 182.437376 77.673623) - (xy 182.207823 77.563078) (xy 182.207825 77.563078) (xy 181.964347 77.487975) (xy 181.964341 77.487973) - (xy 181.712404 77.45) (xy 181.457595 77.45) (xy 181.205658 77.487973) (xy 181.205652 77.487975) - (xy 180.962175 77.563078) (xy 180.732622 77.673625) (xy 180.732609 77.673632) (xy 180.571813 77.783259) - (xy 181.222706 78.434152) (xy 181.206058 78.441049) (xy 181.07503 78.528599) (xy 180.963599 78.64003) - (xy 180.876049 78.771058) (xy 180.869152 78.787706) (xy 180.218452 78.137006) (xy 180.176457 78.189667) - (xy 180.049058 78.410328) (xy 180.000428 78.534236) (xy 179.957612 78.58945) (xy 179.891742 78.612751) - (xy 179.823732 78.59674) (xy 179.775173 78.546502) (xy 179.769572 78.534236) (xy 179.720941 78.410328) - (xy 179.720942 78.410328) (xy 179.593545 78.189672) (xy 179.551545 78.137006) (xy 178.900846 78.787705) - (xy 178.893951 78.771058) (xy 178.806401 78.64003) (xy 178.69497 78.528599) (xy 178.563942 78.441049) - (xy 178.547293 78.434152) (xy 179.198185 77.78326) (xy 179.037384 77.673628) (xy 179.037376 77.673623) - (xy 178.807823 77.563078) (xy 178.807825 77.563078) (xy 178.564347 77.487975) (xy 178.564341 77.487973) - (xy 178.312404 77.45) (xy 178.057595 77.45) (xy 177.805658 77.487973) (xy 177.805652 77.487975) - (xy 177.562175 77.563078) (xy 177.332622 77.673625) (xy 177.332609 77.673632) (xy 177.171813 77.783259) - (xy 177.822706 78.434152) (xy 177.806058 78.441049) (xy 177.67503 78.528599) (xy 177.563599 78.64003) - (xy 177.476049 78.771058) (xy 177.469152 78.787706) (xy 176.818452 78.137006) (xy 176.776457 78.189667) - (xy 176.649058 78.410328) (xy 176.555973 78.647505) (xy 176.555968 78.647522) (xy 176.499273 78.89592) - (xy 176.480233 79.149995) (xy 168.6 79.149995) (xy 168.6 77.906092) (xy 168.600597 77.893938) (xy 168.611498 77.783259) - (xy 168.618018 77.717056) (xy 168.622757 77.693232) (xy 168.672577 77.528994) (xy 168.681875 77.506549) - (xy 168.762775 77.355195) (xy 168.776272 77.334995) (xy 168.885149 77.202328) (xy 168.902328 77.185149) - (xy 169.034995 77.076272) (xy 169.055195 77.062775) (xy 169.206549 76.981875) (xy 169.228994 76.972577) - (xy 169.393232 76.922757) (xy 169.417056 76.918018) (xy 169.593939 76.900597) (xy 169.606093 76.9) - (xy 171.099997 76.9) (xy 171.1 76.9) (xy 172.1 76.9) (xy 172.1 73.820092) (xy 172.9845 73.820092) - (xy 172.9845 73.969907) (xy 173.013723 74.116822) (xy 173.013725 74.11683) (xy 173.071051 74.255229) - (xy 173.071056 74.255238) (xy 173.15428 74.37979) (xy 173.154283 74.379794) (xy 173.260205 74.485716) - (xy 173.260209 74.485719) (xy 173.384761 74.568943) (xy 173.384767 74.568946) (xy 173.384768 74.568947) - (xy 173.52317 74.626275) (xy 173.670092 74.655499) (xy 173.670096 74.6555) (xy 173.670097 74.6555) - (xy 173.819904 74.6555) (xy 173.819905 74.655499) (xy 173.96683 74.626275) (xy 174.105232 74.568947) - (xy 174.229791 74.485719) (xy 174.335719 74.379791) (xy 174.418947 74.255232) (xy 174.476275 74.11683) - (xy 174.5055 73.969903) (xy 174.5055 73.820097) (xy 174.476275 73.67317) (xy 174.418947 73.534768) - (xy 174.418946 73.534767) (xy 174.418943 73.534761) (xy 174.335719 73.410209) (xy 174.335716 73.410205) - (xy 174.229794 73.304283) (xy 174.22979 73.30428) (xy 174.105238 73.221056) (xy 174.105229 73.221051) - (xy 173.96683 73.163725) (xy 173.966822 73.163723) (xy 173.819907 73.1345) (xy 173.819903 73.1345) - (xy 173.670097 73.1345) (xy 173.670092 73.1345) (xy 173.523177 73.163723) (xy 173.523169 73.163725) - (xy 173.38477 73.221051) (xy 173.384761 73.221056) (xy 173.260209 73.30428) (xy 173.260205 73.304283) - (xy 173.154283 73.410205) (xy 173.15428 73.410209) (xy 173.071056 73.534761) (xy 173.071051 73.53477) - (xy 173.013725 73.673169) (xy 173.013723 73.673177) (xy 172.9845 73.820092) (xy 172.1 73.820092) - (xy 172.1 73.702112) (xy 172.119685 73.635073) (xy 172.145335 73.606259) (xy 172.259759 73.512354) + (xy 167.151656 81.9) (xy 167.599997 81.9) (xy 167.6 81.9) (xy 167.79509 81.880785) (xy 167.982683 81.82388) + (xy 168.15557 81.73147) (xy 168.307107 81.607107) (xy 168.43147 81.45557) (xy 168.52388 81.282683) + (xy 168.580785 81.09509) (xy 168.6 80.9) (xy 168.6 79.149995) (xy 176.480233 79.149995) (xy 176.480233 79.150004) + (xy 176.499273 79.404079) (xy 176.555968 79.652477) (xy 176.555973 79.652494) (xy 176.649058 79.889671) + (xy 176.649057 79.889671) (xy 176.776454 80.110327) (xy 176.776461 80.110338) (xy 176.818452 80.162991) + (xy 176.818453 80.162992) (xy 177.469152 79.512292) (xy 177.476049 79.528942) (xy 177.563599 79.65997) + (xy 177.67503 79.771401) (xy 177.806058 79.858951) (xy 177.822705 79.865846) (xy 177.171813 80.516738) + (xy 177.332616 80.626371) (xy 177.332624 80.626376) (xy 177.562176 80.736921) (xy 177.562174 80.736921) + (xy 177.805652 80.812024) (xy 177.805658 80.812026) (xy 178.057595 80.849999) (xy 178.057604 80.85) + (xy 178.312396 80.85) (xy 178.312404 80.849999) (xy 178.564341 80.812026) (xy 178.564347 80.812024) + (xy 178.807824 80.736921) (xy 179.037376 80.626376) (xy 179.037377 80.626375) (xy 179.198185 80.516738) + (xy 178.547294 79.865846) (xy 178.563942 79.858951) (xy 178.69497 79.771401) (xy 178.806401 79.65997) + (xy 178.893951 79.528942) (xy 178.900846 79.512294) (xy 179.551544 80.162992) (xy 179.551546 80.162991) + (xy 179.593544 80.11033) (xy 179.720941 79.889671) (xy 179.769572 79.765763) (xy 179.812387 79.710549) + (xy 179.878257 79.687248) (xy 179.946268 79.703259) (xy 179.994827 79.753496) (xy 180.000428 79.765763) + (xy 180.049058 79.889671) (xy 180.176454 80.110327) (xy 180.176461 80.110338) (xy 180.218452 80.162991) + (xy 180.218453 80.162992) (xy 180.869152 79.512292) (xy 180.876049 79.528942) (xy 180.963599 79.65997) + (xy 181.07503 79.771401) (xy 181.206058 79.858951) (xy 181.222705 79.865846) (xy 180.571813 80.516738) + (xy 180.732616 80.626371) (xy 180.732624 80.626376) (xy 180.962176 80.736921) (xy 180.962174 80.736921) + (xy 181.205652 80.812024) (xy 181.205658 80.812026) (xy 181.457595 80.849999) (xy 181.457604 80.85) + (xy 181.712396 80.85) (xy 181.712404 80.849999) (xy 181.964341 80.812026) (xy 181.964347 80.812024) + (xy 182.207824 80.736921) (xy 182.437376 80.626376) (xy 182.437377 80.626375) (xy 182.598185 80.516738) + (xy 181.947294 79.865846) (xy 181.963942 79.858951) (xy 182.09497 79.771401) (xy 182.206401 79.65997) + (xy 182.293951 79.528942) (xy 182.300846 79.512294) (xy 182.951544 80.162992) (xy 182.951546 80.162991) + (xy 182.993544 80.11033) (xy 183.120941 79.889671) (xy 183.214026 79.652494) (xy 183.214031 79.652477) + (xy 183.270726 79.404079) (xy 183.289767 79.150004) (xy 183.289767 79.149995) (xy 183.270726 78.89592) + (xy 183.214031 78.647522) (xy 183.214026 78.647505) (xy 183.120941 78.410328) (xy 183.120942 78.410328) + (xy 182.993545 78.189672) (xy 182.951545 78.137006) (xy 182.300846 78.787705) (xy 182.293951 78.771058) + (xy 182.206401 78.64003) (xy 182.09497 78.528599) (xy 181.963942 78.441049) (xy 181.947293 78.434152) + (xy 182.598185 77.78326) (xy 182.437384 77.673628) (xy 182.437376 77.673623) (xy 182.207823 77.563078) + (xy 182.207825 77.563078) (xy 181.964347 77.487975) (xy 181.964341 77.487973) (xy 181.712404 77.45) + (xy 181.457595 77.45) (xy 181.205658 77.487973) (xy 181.205652 77.487975) (xy 180.962175 77.563078) + (xy 180.732622 77.673625) (xy 180.732609 77.673632) (xy 180.571813 77.783259) (xy 181.222706 78.434152) + (xy 181.206058 78.441049) (xy 181.07503 78.528599) (xy 180.963599 78.64003) (xy 180.876049 78.771058) + (xy 180.869152 78.787706) (xy 180.218452 78.137006) (xy 180.176457 78.189667) (xy 180.049058 78.410328) + (xy 180.000428 78.534236) (xy 179.957612 78.58945) (xy 179.891742 78.612751) (xy 179.823732 78.59674) + (xy 179.775173 78.546502) (xy 179.769572 78.534236) (xy 179.720941 78.410328) (xy 179.720942 78.410328) + (xy 179.593545 78.189672) (xy 179.551545 78.137006) (xy 178.900846 78.787705) (xy 178.893951 78.771058) + (xy 178.806401 78.64003) (xy 178.69497 78.528599) (xy 178.563942 78.441049) (xy 178.547293 78.434152) + (xy 179.198185 77.78326) (xy 179.037384 77.673628) (xy 179.037376 77.673623) (xy 178.807823 77.563078) + (xy 178.807825 77.563078) (xy 178.564347 77.487975) (xy 178.564341 77.487973) (xy 178.312404 77.45) + (xy 178.057595 77.45) (xy 177.805658 77.487973) (xy 177.805652 77.487975) (xy 177.562175 77.563078) + (xy 177.332622 77.673625) (xy 177.332609 77.673632) (xy 177.171813 77.783259) (xy 177.822706 78.434152) + (xy 177.806058 78.441049) (xy 177.67503 78.528599) (xy 177.563599 78.64003) (xy 177.476049 78.771058) + (xy 177.469152 78.787706) (xy 176.818452 78.137006) (xy 176.776457 78.189667) (xy 176.649058 78.410328) + (xy 176.555973 78.647505) (xy 176.555968 78.647522) (xy 176.499273 78.89592) (xy 176.480233 79.149995) + (xy 168.6 79.149995) (xy 168.6 77.906092) (xy 168.600597 77.893938) (xy 168.611498 77.783259) (xy 168.618018 77.717056) + (xy 168.622757 77.693232) (xy 168.672577 77.528994) (xy 168.681875 77.506549) (xy 168.762775 77.355195) + (xy 168.776272 77.334995) (xy 168.885149 77.202328) (xy 168.902328 77.185149) (xy 169.034995 77.076272) + (xy 169.055195 77.062775) (xy 169.206549 76.981875) (xy 169.228994 76.972577) (xy 169.393232 76.922757) + (xy 169.417056 76.918018) (xy 169.593939 76.900597) (xy 169.606093 76.9) (xy 171.099997 76.9) (xy 171.1 76.9) + (xy 171.29509 76.880785) (xy 171.482683 76.82388) (xy 171.65557 76.73147) (xy 171.807107 76.607107) + (xy 171.93147 76.45557) (xy 172.02388 76.282683) (xy 172.080785 76.09509) (xy 172.1 75.9) (xy 172.1 73.820092) + (xy 172.9845 73.820092) (xy 172.9845 73.969907) (xy 173.013723 74.116822) (xy 173.013725 74.11683) + (xy 173.071051 74.255229) (xy 173.071056 74.255238) (xy 173.15428 74.37979) (xy 173.154283 74.379794) + (xy 173.260205 74.485716) (xy 173.260209 74.485719) (xy 173.384761 74.568943) (xy 173.384767 74.568946) + (xy 173.384768 74.568947) (xy 173.52317 74.626275) (xy 173.670092 74.655499) (xy 173.670096 74.6555) + (xy 173.670097 74.6555) (xy 173.819904 74.6555) (xy 173.819905 74.655499) (xy 173.96683 74.626275) + (xy 174.105232 74.568947) (xy 174.229791 74.485719) (xy 174.335719 74.379791) (xy 174.418947 74.255232) + (xy 174.476275 74.11683) (xy 174.5055 73.969903) (xy 174.5055 73.820097) (xy 174.476275 73.67317) + (xy 174.418947 73.534768) (xy 174.418946 73.534767) (xy 174.418943 73.534761) (xy 174.335719 73.410209) + (xy 174.335716 73.410205) (xy 174.229794 73.304283) (xy 174.22979 73.30428) (xy 174.105238 73.221056) + (xy 174.105229 73.221051) (xy 173.96683 73.163725) (xy 173.966822 73.163723) (xy 173.819907 73.1345) + (xy 173.819903 73.1345) (xy 173.670097 73.1345) (xy 173.670092 73.1345) (xy 173.523177 73.163723) + (xy 173.523169 73.163725) (xy 173.38477 73.221051) (xy 173.384761 73.221056) (xy 173.260209 73.30428) + (xy 173.260205 73.304283) (xy 173.154283 73.410205) (xy 173.15428 73.410209) (xy 173.071056 73.534761) + (xy 173.071051 73.53477) (xy 173.013725 73.673169) (xy 173.013723 73.673177) (xy 172.9845 73.820092) + (xy 172.1 73.820092) (xy 172.1 73.702112) (xy 172.119685 73.635073) (xy 172.145335 73.606259) (xy 172.259759 73.512354) (xy 172.278326 73.495525) (xy 172.278332 73.49552) (xy 172.29552 73.478332) (xy 172.312358 73.459754) (xy 172.421226 73.327098) (xy 172.436164 73.306957) (xy 172.449669 73.286745) (xy 172.462558 73.26524) (xy 172.543452 73.113898) (xy 172.55417 73.091237) (xy 172.563473 73.068779) (xy 172.571922 73.045165) @@ -155714,61 +159774,71 @@ (xy 253.758227 205.422316) (xy 253.709521 205.465465) (xy 253.709515 205.465472) (xy 253.619781 205.595475) (xy 253.61978 205.595476) (xy 253.563762 205.743181) (xy 253.544722 205.899999) (xy 253.544722 205.9) (xy 253.563762 206.056818) (xy 253.61978 206.204523) (xy 253.619781 206.204524) (xy 253.709517 206.334531) - (xy 253.758226 206.377682) (xy 253.795353 206.436871) (xy 253.8 206.470498) (xy 253.8 210.2) (xy 256.823816 210.2) - (xy 256.890855 210.219685) (xy 256.906039 210.231181) (xy 256.93776 210.259283) (xy 256.937762 210.259284) - (xy 257.077634 210.332696) (xy 257.231014 210.3705) (xy 257.231015 210.3705) (xy 257.388985 210.3705) - (xy 257.542365 210.332696) (xy 257.611566 210.296376) (xy 257.68224 210.259283) (xy 257.713958 210.231183) - (xy 257.777191 210.201463) (xy 257.796184 210.2) (xy 258.293907 210.2) (xy 258.306061 210.200597) - (xy 258.482941 210.218018) (xy 258.506769 210.222757) (xy 258.671001 210.272576) (xy 258.693453 210.281877) - (xy 258.824536 210.351942) (xy 258.844798 210.362772) (xy 258.86501 210.376277) (xy 258.997666 210.485145) - (xy 259.014854 210.502333) (xy 259.123722 210.634989) (xy 259.137227 210.655201) (xy 259.218121 210.806543) - (xy 259.227424 210.829001) (xy 259.27724 210.993224) (xy 259.281982 211.017065) (xy 259.299403 211.193938) - (xy 259.3 211.206092) (xy 259.3 213.203316) (xy 259.280315 213.270355) (xy 259.275597 213.277184) - (xy 259.26384 213.293034) (xy 259.263822 213.29306) (xy 259.250341 213.313236) (xy 259.237437 213.334765) - (xy 259.156543 213.486107) (xy 259.145823 213.508773) (xy 259.14582 213.508781) (xy 259.136531 213.531204) - (xy 259.136524 213.531222) (xy 259.128079 213.554824) (xy 259.07826 213.719057) (xy 259.078254 213.719079) - (xy 259.072167 213.743382) (xy 259.072165 213.743392) (xy 259.067427 213.767212) (xy 259.067427 213.767214) - (xy 259.063749 213.792) (xy 259.063746 213.792027) (xy 259.046326 213.968908) (xy 259.045406 213.98138) - (xy 259.044808 213.993548) (xy 259.0445 214.006112) (xy 259.0445 215.1105) (xy 259.024815 215.177539) - (xy 258.972011 215.223294) (xy 258.9205 215.2345) (xy 258.895323 215.2345) (xy 258.822264 215.249032) - (xy 258.82226 215.249033) (xy 258.739399 215.304399) (xy 258.684033 215.38726) (xy 258.684032 215.387264) - (xy 258.6695 215.460321) (xy 258.6695 217.859678) (xy 258.684032 217.932735) (xy 258.684033 217.932739) - (xy 258.684034 217.93274) (xy 258.739399 218.015601) (xy 258.81369 218.06524) (xy 258.82226 218.070966) - (xy 258.822264 218.070967) (xy 258.895321 218.085499) (xy 258.895324 218.0855) (xy 258.895326 218.0855) - (xy 258.987678 218.0855) (xy 259.054717 218.105185) (xy 259.100472 218.157989) (xy 259.106339 218.173506) - (xy 259.128078 218.245173) (xy 259.132949 218.258784) (xy 259.137004 218.328536) (xy 259.112053 218.379229) - (xy 259.014854 218.497666) (xy 258.997666 218.514854) (xy 258.86501 218.623722) (xy 258.844798 218.637227) - (xy 258.693456 218.718121) (xy 258.670998 218.727424) (xy 258.506775 218.77724) (xy 258.482934 218.781982) - (xy 258.306061 218.799403) (xy 258.293907 218.8) (xy 255.8 218.8) (xy 255.8 219.8) (xy 255.8 219.800003) - (xy 255.8 220.999122) (xy 255.780315 221.066161) (xy 255.73736 221.106876) (xy 255.705178 221.125201) - (xy 255.705173 221.125205) (xy 255.652371 221.170957) (xy 255.620743 221.203734) (xy 255.574534 221.292071) - (xy 255.574533 221.292071) (xy 255.554851 221.359103) (xy 255.554848 221.359115) (xy 255.5445 221.431092) - (xy 255.5445 221.496906) (xy 255.546491 221.528749) (xy 255.550338 221.55938) (xy 255.550342 221.559406) - (xy 255.550951 221.563923) (xy 255.584114 221.657936) (xy 255.584115 221.657938) (xy 255.584116 221.65794) - (xy 255.584116 221.657941) (xy 255.619763 221.718024) (xy 255.632887 221.736225) (xy 255.646404 221.754971) - (xy 255.725131 221.81613) (xy 255.731504 221.81932) (xy 255.782641 221.866929) (xy 255.8 221.930204) - (xy 255.8 222.269122) (xy 255.780315 222.336161) (xy 255.73736 222.376876) (xy 255.705178 222.395201) - (xy 255.705173 222.395205) (xy 255.652371 222.440957) (xy 255.620743 222.473734) (xy 255.574534 222.562071) - (xy 255.574533 222.562071) (xy 255.554851 222.629103) (xy 255.554848 222.629115) (xy 255.5445 222.701092) - (xy 255.5445 226.576906) (xy 255.546491 226.608749) (xy 255.550338 226.63938) (xy 255.550342 226.639406) - (xy 255.550951 226.643923) (xy 255.584114 226.737936) (xy 255.584115 226.737938) (xy 255.584116 226.73794) - (xy 255.584116 226.737941) (xy 255.619763 226.798024) (xy 255.623712 226.8035) (xy 255.646404 226.834971) - (xy 255.725131 226.89613) (xy 255.731504 226.89932) (xy 255.782641 226.946929) (xy 255.8 227.010204) - (xy 255.8 227.349122) (xy 255.780315 227.416161) (xy 255.73736 227.456876) (xy 255.705178 227.475201) - (xy 255.705173 227.475205) (xy 255.652371 227.520957) (xy 255.620743 227.553734) (xy 255.574534 227.642071) - (xy 255.574533 227.642071) (xy 255.554851 227.709103) (xy 255.554848 227.709115) (xy 255.5445 227.781092) - (xy 255.5445 227.846906) (xy 255.546491 227.878749) (xy 255.550338 227.90938) (xy 255.550951 227.913922) - (xy 255.562185 227.945769) (xy 255.565923 228.015538) (xy 255.541101 228.065682) (xy 255.514854 228.097665) - (xy 255.497665 228.114855) (xy 255.36501 228.223722) (xy 255.344798 228.237227) (xy 255.193456 228.318121) - (xy 255.170998 228.327424) (xy 255.006775 228.37724) (xy 254.982934 228.381982) (xy 254.806061 228.399403) - (xy 254.793907 228.4) (xy 253.306093 228.4) (xy 253.293939 228.399403) (xy 253.117065 228.381982) - (xy 253.093224 228.37724) (xy 252.929001 228.327424) (xy 252.906543 228.318121) (xy 252.755201 228.237227) - (xy 252.734989 228.223722) (xy 252.602333 228.114854) (xy 252.585145 228.097666) (xy 252.476277 227.96501) - (xy 252.462772 227.944798) (xy 252.381877 227.793453) (xy 252.372575 227.770998) (xy 252.322757 227.606767) - (xy 252.318017 227.582929) (xy 252.317692 227.579628) (xy 252.323143 227.542968) (xy 252.319884 227.54232) - (xy 252.336801 227.457276) (xy 252.336801 226.900723) (xy 252.322267 226.827661) (xy 252.322267 226.82766) - (xy 252.320896 226.825609) (xy 252.319282 226.820453) (xy 252.317594 226.816377) (xy 252.317958 226.816225) - (xy 252.30002 226.758932) (xy 252.3 226.75672) (xy 252.3 226.331279) (xy 252.319685 226.26424) (xy 252.320899 226.262387) + (xy 253.758226 206.377682) (xy 253.795353 206.436871) (xy 253.8 206.470498) (xy 253.8 209.199996) + (xy 253.819214 209.395088) (xy 253.819215 209.39509) (xy 253.87612 209.582683) (xy 253.876121 209.582686) + (xy 253.876122 209.582687) (xy 253.876123 209.58269) (xy 253.968527 209.755566) (xy 253.968528 209.755567) + (xy 253.973062 209.761092) (xy 253.976978 209.766122) (xy 254.01238 209.81409) (xy 254.04785 209.86215) + (xy 254.056092 209.868232) (xy 254.078308 209.889335) (xy 254.092893 209.907107) (xy 254.24443 210.03147) + (xy 254.244433 210.031471) (xy 254.244435 210.031473) (xy 254.417309 210.123876) (xy 254.41731 210.123876) + (xy 254.417317 210.12388) (xy 254.60491 210.180785) (xy 254.604909 210.180785) (xy 254.653682 210.185588) + (xy 254.8 210.2) (xy 256.823816 210.2) (xy 256.890855 210.219685) (xy 256.906039 210.231181) (xy 256.93776 210.259283) + (xy 256.937762 210.259284) (xy 257.077634 210.332696) (xy 257.231014 210.3705) (xy 257.231015 210.3705) + (xy 257.388985 210.3705) (xy 257.542365 210.332696) (xy 257.611566 210.296376) (xy 257.68224 210.259283) + (xy 257.713958 210.231183) (xy 257.777191 210.201463) (xy 257.796184 210.2) (xy 258.293907 210.2) + (xy 258.306061 210.200597) (xy 258.482941 210.218018) (xy 258.506769 210.222757) (xy 258.671001 210.272576) + (xy 258.693453 210.281877) (xy 258.824536 210.351942) (xy 258.844798 210.362772) (xy 258.86501 210.376277) + (xy 258.997666 210.485145) (xy 259.014854 210.502333) (xy 259.123722 210.634989) (xy 259.137227 210.655201) + (xy 259.218121 210.806543) (xy 259.227424 210.829001) (xy 259.27724 210.993224) (xy 259.281982 211.017065) + (xy 259.299403 211.193938) (xy 259.3 211.206092) (xy 259.3 213.203316) (xy 259.280315 213.270355) + (xy 259.275597 213.277184) (xy 259.26384 213.293034) (xy 259.263822 213.29306) (xy 259.250341 213.313236) + (xy 259.237437 213.334765) (xy 259.156543 213.486107) (xy 259.145823 213.508773) (xy 259.14582 213.508781) + (xy 259.136531 213.531204) (xy 259.136524 213.531222) (xy 259.128079 213.554824) (xy 259.07826 213.719057) + (xy 259.078254 213.719079) (xy 259.072167 213.743382) (xy 259.072165 213.743392) (xy 259.067427 213.767212) + (xy 259.067427 213.767214) (xy 259.063749 213.792) (xy 259.063746 213.792027) (xy 259.046326 213.968908) + (xy 259.045406 213.98138) (xy 259.044808 213.993548) (xy 259.0445 214.006112) (xy 259.0445 215.1105) + (xy 259.024815 215.177539) (xy 258.972011 215.223294) (xy 258.9205 215.2345) (xy 258.895323 215.2345) + (xy 258.822264 215.249032) (xy 258.82226 215.249033) (xy 258.739399 215.304399) (xy 258.684033 215.38726) + (xy 258.684032 215.387264) (xy 258.6695 215.460321) (xy 258.6695 217.859678) (xy 258.684032 217.932735) + (xy 258.684033 217.932739) (xy 258.684034 217.93274) (xy 258.739399 218.015601) (xy 258.81369 218.06524) + (xy 258.82226 218.070966) (xy 258.822264 218.070967) (xy 258.895321 218.085499) (xy 258.895324 218.0855) + (xy 258.895326 218.0855) (xy 258.987678 218.0855) (xy 259.054717 218.105185) (xy 259.100472 218.157989) + (xy 259.106339 218.173506) (xy 259.128078 218.245173) (xy 259.132949 218.258784) (xy 259.137004 218.328536) + (xy 259.112053 218.379229) (xy 259.014854 218.497666) (xy 258.997666 218.514854) (xy 258.86501 218.623722) + (xy 258.844798 218.637227) (xy 258.693456 218.718121) (xy 258.670998 218.727424) (xy 258.506775 218.77724) + (xy 258.482934 218.781982) (xy 258.306061 218.799403) (xy 258.293907 218.8) (xy 256.8 218.8) (xy 256.751844 218.804743) + (xy 256.604911 218.819214) (xy 256.494149 218.852813) (xy 256.417317 218.87612) (xy 256.417314 218.876121) + (xy 256.417312 218.876122) (xy 256.417309 218.876123) (xy 256.244435 218.968526) (xy 256.244428 218.968531) + (xy 256.092892 219.092892) (xy 255.968531 219.244428) (xy 255.968526 219.244435) (xy 255.876123 219.417309) + (xy 255.876122 219.417312) (xy 255.819214 219.604911) (xy 255.8 219.800003) (xy 255.8 220.999122) + (xy 255.780315 221.066161) (xy 255.73736 221.106876) (xy 255.705178 221.125201) (xy 255.705173 221.125205) + (xy 255.652371 221.170957) (xy 255.620743 221.203734) (xy 255.574534 221.292071) (xy 255.574533 221.292071) + (xy 255.554851 221.359103) (xy 255.554848 221.359115) (xy 255.5445 221.431092) (xy 255.5445 221.496906) + (xy 255.546491 221.528749) (xy 255.550338 221.55938) (xy 255.550342 221.559406) (xy 255.550951 221.563923) + (xy 255.584114 221.657936) (xy 255.584115 221.657938) (xy 255.584116 221.65794) (xy 255.584116 221.657941) + (xy 255.619763 221.718024) (xy 255.632887 221.736225) (xy 255.646404 221.754971) (xy 255.725131 221.81613) + (xy 255.731504 221.81932) (xy 255.782641 221.866929) (xy 255.8 221.930204) (xy 255.8 222.269122) + (xy 255.780315 222.336161) (xy 255.73736 222.376876) (xy 255.705178 222.395201) (xy 255.705173 222.395205) + (xy 255.652371 222.440957) (xy 255.620743 222.473734) (xy 255.574534 222.562071) (xy 255.574533 222.562071) + (xy 255.554851 222.629103) (xy 255.554848 222.629115) (xy 255.5445 222.701092) (xy 255.5445 226.576906) + (xy 255.546491 226.608749) (xy 255.550338 226.63938) (xy 255.550342 226.639406) (xy 255.550951 226.643923) + (xy 255.584114 226.737936) (xy 255.584115 226.737938) (xy 255.584116 226.73794) (xy 255.584116 226.737941) + (xy 255.619763 226.798024) (xy 255.623712 226.8035) (xy 255.646404 226.834971) (xy 255.725131 226.89613) + (xy 255.731504 226.89932) (xy 255.782641 226.946929) (xy 255.8 227.010204) (xy 255.8 227.349122) + (xy 255.780315 227.416161) (xy 255.73736 227.456876) (xy 255.705178 227.475201) (xy 255.705173 227.475205) + (xy 255.652371 227.520957) (xy 255.620743 227.553734) (xy 255.574534 227.642071) (xy 255.574533 227.642071) + (xy 255.554851 227.709103) (xy 255.554848 227.709115) (xy 255.5445 227.781092) (xy 255.5445 227.846906) + (xy 255.546491 227.878749) (xy 255.550338 227.90938) (xy 255.550951 227.913922) (xy 255.562185 227.945769) + (xy 255.565923 228.015538) (xy 255.541101 228.065682) (xy 255.514854 228.097665) (xy 255.497665 228.114855) + (xy 255.36501 228.223722) (xy 255.344798 228.237227) (xy 255.193456 228.318121) (xy 255.170998 228.327424) + (xy 255.006775 228.37724) (xy 254.982934 228.381982) (xy 254.806061 228.399403) (xy 254.793907 228.4) + (xy 253.306093 228.4) (xy 253.293939 228.399403) (xy 253.117065 228.381982) (xy 253.093224 228.37724) + (xy 252.929001 228.327424) (xy 252.906543 228.318121) (xy 252.755201 228.237227) (xy 252.734989 228.223722) + (xy 252.602333 228.114854) (xy 252.585145 228.097666) (xy 252.476277 227.96501) (xy 252.462772 227.944798) + (xy 252.381877 227.793453) (xy 252.372575 227.770998) (xy 252.322757 227.606767) (xy 252.318017 227.582929) + (xy 252.317692 227.579628) (xy 252.323143 227.542968) (xy 252.319884 227.54232) (xy 252.336801 227.457276) + (xy 252.336801 226.900723) (xy 252.322267 226.827661) (xy 252.322267 226.82766) (xy 252.320896 226.825609) + (xy 252.319282 226.820453) (xy 252.317594 226.816377) (xy 252.317958 226.816225) (xy 252.30002 226.758932) + (xy 252.3 226.75672) (xy 252.3 226.331279) (xy 252.319685 226.26424) (xy 252.320899 226.262387) (xy 252.322267 226.26034) (xy 252.336801 226.187274) (xy 252.336801 225.630726) (xy 252.336801 225.630723) (xy 252.322267 225.557661) (xy 252.322267 225.55766) (xy 252.320896 225.555609) (xy 252.319282 225.550453) (xy 252.317594 225.546377) (xy 252.317958 225.546225) (xy 252.30002 225.488932) (xy 252.3 225.48672) @@ -155787,64 +159857,72 @@ (xy 252.336801 221.107274) (xy 252.336801 220.550726) (xy 252.336801 220.550723) (xy 252.322267 220.477661) (xy 252.322267 220.47766) (xy 252.320896 220.475609) (xy 252.319282 220.470453) (xy 252.317594 220.466377) (xy 252.317958 220.466225) (xy 252.30002 220.408932) (xy 252.3 220.40672) (xy 252.3 219.800003) - (xy 252.3 219.8) (xy 252.3 218.8) (xy 251.3 218.8) (xy 251.299997 218.8) (xy 249.406093 218.8) (xy 249.393939 218.799403) - (xy 249.217065 218.781982) (xy 249.193224 218.77724) (xy 249.029001 218.727424) (xy 249.006543 218.718121) - (xy 248.855201 218.637227) (xy 248.834989 218.623722) (xy 248.702333 218.514854) (xy 248.685145 218.497666) - (xy 248.576277 218.36501) (xy 248.562772 218.344798) (xy 248.516797 218.258784) (xy 248.481877 218.193453) - (xy 248.472575 218.170998) (xy 248.468629 218.157989) (xy 248.422757 218.006769) (xy 248.418018 217.982941) - (xy 248.400597 217.806061) (xy 248.4 217.793907) (xy 248.4 213.700003) (xy 248.4 213.7) (xy 248.4 212.7) - (xy 247.4 212.7) (xy 247.399997 212.7) (xy 246.406093 212.7) (xy 246.393939 212.699403) (xy 246.217065 212.681982) - (xy 246.193224 212.67724) (xy 246.029001 212.627424) (xy 246.006543 212.618121) (xy 245.855201 212.537227) - (xy 245.834989 212.523722) (xy 245.702333 212.414854) (xy 245.685145 212.397666) (xy 245.576277 212.26501) - (xy 245.562772 212.244798) (xy 245.481878 212.093456) (xy 245.472575 212.070998) (xy 245.422757 211.906769) - (xy 245.418018 211.882941) (xy 245.400597 211.706061) (xy 245.4 211.693907) (xy 245.4 210.351942) - (xy 245.419685 210.284903) (xy 245.472489 210.239148) (xy 245.541647 210.229204) (xy 245.593852 210.249488) - (xy 245.662623 210.296375) (xy 245.662624 210.296376) (xy 245.892176 210.406921) (xy 245.892174 210.406921) - (xy 246.135652 210.482024) (xy 246.135658 210.482026) (xy 246.387595 210.519999) (xy 246.387604 210.52) - (xy 246.642396 210.52) (xy 246.642404 210.519999) (xy 246.894341 210.482026) (xy 246.894347 210.482024) - (xy 247.137824 210.406921) (xy 247.367376 210.296376) (xy 247.367377 210.296375) (xy 247.528185 210.186738) - (xy 246.877293 209.535846) (xy 246.893942 209.528951) (xy 247.02497 209.441401) (xy 247.136401 209.32997) - (xy 247.223951 209.198942) (xy 247.230846 209.182294) (xy 247.881544 209.832992) (xy 247.881546 209.832991) - (xy 247.923544 209.78033) (xy 248.050941 209.559671) (xy 248.099572 209.435763) (xy 248.142387 209.380549) - (xy 248.208257 209.357248) (xy 248.276268 209.373259) (xy 248.324827 209.423496) (xy 248.330428 209.435763) - (xy 248.379058 209.559671) (xy 248.506454 209.780327) (xy 248.506461 209.780338) (xy 248.548452 209.832991) - (xy 248.548453 209.832992) (xy 249.199152 209.182292) (xy 249.206049 209.198942) (xy 249.293599 209.32997) - (xy 249.40503 209.441401) (xy 249.536058 209.528951) (xy 249.552705 209.535846) (xy 248.901813 210.186738) - (xy 249.062616 210.296371) (xy 249.062624 210.296376) (xy 249.292176 210.406921) (xy 249.292174 210.406921) - (xy 249.535652 210.482024) (xy 249.535658 210.482026) (xy 249.787595 210.519999) (xy 249.787604 210.52) - (xy 250.042396 210.52) (xy 250.042404 210.519999) (xy 250.294341 210.482026) (xy 250.294347 210.482024) - (xy 250.537824 210.406921) (xy 250.767376 210.296376) (xy 250.767377 210.296375) (xy 250.928185 210.186738) - (xy 250.277294 209.535846) (xy 250.293942 209.528951) (xy 250.42497 209.441401) (xy 250.536401 209.32997) - (xy 250.623951 209.198942) (xy 250.630846 209.182294) (xy 251.281544 209.832992) (xy 251.281546 209.832991) - (xy 251.323544 209.78033) (xy 251.450941 209.559671) (xy 251.544026 209.322494) (xy 251.544031 209.322477) - (xy 251.600726 209.074079) (xy 251.619767 208.820004) (xy 251.619767 208.819995) (xy 251.600726 208.56592) - (xy 251.544031 208.317522) (xy 251.544026 208.317505) (xy 251.450941 208.080328) (xy 251.450942 208.080328) - (xy 251.323545 207.859672) (xy 251.281545 207.807006) (xy 250.630846 208.457705) (xy 250.623951 208.441058) - (xy 250.536401 208.31003) (xy 250.42497 208.198599) (xy 250.293942 208.111049) (xy 250.277293 208.104152) - (xy 250.928185 207.45326) (xy 250.767384 207.343628) (xy 250.767376 207.343623) (xy 250.537823 207.233078) - (xy 250.537825 207.233078) (xy 250.294347 207.157975) (xy 250.294341 207.157973) (xy 250.042404 207.12) - (xy 249.787595 207.12) (xy 249.535658 207.157973) (xy 249.535652 207.157975) (xy 249.292175 207.233078) - (xy 249.062622 207.343625) (xy 249.062609 207.343632) (xy 248.901813 207.453259) (xy 249.552706 208.104152) - (xy 249.536058 208.111049) (xy 249.40503 208.198599) (xy 249.293599 208.31003) (xy 249.206049 208.441058) - (xy 249.199152 208.457706) (xy 248.548452 207.807006) (xy 248.506457 207.859667) (xy 248.379058 208.080328) - (xy 248.330428 208.204236) (xy 248.287612 208.25945) (xy 248.221742 208.282751) (xy 248.153732 208.26674) - (xy 248.105173 208.216502) (xy 248.099572 208.204236) (xy 248.050941 208.080328) (xy 248.050942 208.080328) - (xy 247.923545 207.859672) (xy 247.881545 207.807006) (xy 247.230846 208.457705) (xy 247.223951 208.441058) - (xy 247.136401 208.31003) (xy 247.02497 208.198599) (xy 246.893942 208.111049) (xy 246.877293 208.104152) - (xy 247.528185 207.453259) (xy 247.367384 207.343628) (xy 247.367376 207.343623) (xy 247.137823 207.233078) - (xy 247.137825 207.233078) (xy 246.894347 207.157975) (xy 246.894341 207.157973) (xy 246.642404 207.12) - (xy 246.387595 207.12) (xy 246.135658 207.157973) (xy 246.135652 207.157975) (xy 245.892175 207.233078) - (xy 245.662624 207.343623) (xy 245.662616 207.343628) (xy 245.593851 207.390511) (xy 245.527371 207.412011) - (xy 245.459821 207.394156) (xy 245.412648 207.342616) (xy 245.4 207.288057) (xy 245.4 203.006092) - (xy 245.400597 202.993938) (xy 245.418018 202.817056) (xy 245.422757 202.793232) (xy 245.472577 202.628994) - (xy 245.481875 202.606549) (xy 245.562775 202.455195) (xy 245.576272 202.434995) (xy 245.685149 202.302328) - (xy 245.702367 202.285117) (xy 245.70304 202.284564) (xy 245.704198 202.283616) (xy 245.768519 202.256328) - (xy 245.782825 202.2555) (xy 251.493887 202.2555) (xy 251.493907 202.2555) (xy 251.506442 202.255192) - (xy 251.518596 202.254595) (xy 251.531105 202.253673) (xy 251.707978 202.236252) (xy 251.732777 202.232573) - (xy 251.756618 202.227831) (xy 251.780942 202.221738) (xy 251.945165 202.171922) (xy 251.968779 202.163473) - (xy 251.991237 202.15417) (xy 252.013898 202.143452) (xy 252.046968 202.125776) (xy 252.069154 202.113917) - (xy 252.16524 202.062558) (xy 252.186745 202.049669) (xy 252.206957 202.036164) (xy 252.222813 202.024403) - (xy 252.288385 202.000278) (xy 252.296682 202) (xy 252.5705 202) + (xy 252.280785 219.604911) (xy 252.280785 219.60491) (xy 252.22388 219.417317) (xy 252.13147 219.24443) + (xy 252.093648 219.198344) (xy 252.007107 219.092892) (xy 251.855571 218.968531) (xy 251.855564 218.968526) + (xy 251.68269 218.876123) (xy 251.682687 218.876122) (xy 251.682686 218.876121) (xy 251.682683 218.87612) + (xy 251.49509 218.819215) (xy 251.495088 218.819214) (xy 251.49509 218.819214) (xy 251.344494 218.804382) + (xy 251.3 218.8) (xy 251.299997 218.8) (xy 249.406093 218.8) (xy 249.393939 218.799403) (xy 249.217065 218.781982) + (xy 249.193224 218.77724) (xy 249.029001 218.727424) (xy 249.006543 218.718121) (xy 248.855201 218.637227) + (xy 248.834989 218.623722) (xy 248.702333 218.514854) (xy 248.685145 218.497666) (xy 248.576277 218.36501) + (xy 248.562772 218.344798) (xy 248.516797 218.258784) (xy 248.481877 218.193453) (xy 248.472575 218.170998) + (xy 248.468629 218.157989) (xy 248.422757 218.006769) (xy 248.418018 217.982941) (xy 248.400597 217.806061) + (xy 248.4 217.793907) (xy 248.4 213.700003) (xy 248.383376 213.531222) (xy 248.380785 213.50491) + (xy 248.32388 213.317317) (xy 248.321699 213.313236) (xy 248.231473 213.144435) (xy 248.231471 213.144433) + (xy 248.23147 213.14443) (xy 248.193648 213.098344) (xy 248.107107 212.992892) (xy 247.955571 212.868531) + (xy 247.955564 212.868526) (xy 247.78269 212.776123) (xy 247.782687 212.776122) (xy 247.782686 212.776121) + (xy 247.782683 212.77612) (xy 247.59509 212.719215) (xy 247.595088 212.719214) (xy 247.59509 212.719214) + (xy 247.444494 212.704382) (xy 247.4 212.7) (xy 247.399997 212.7) (xy 246.406093 212.7) (xy 246.393939 212.699403) + (xy 246.217065 212.681982) (xy 246.193224 212.67724) (xy 246.029001 212.627424) (xy 246.006543 212.618121) + (xy 245.855201 212.537227) (xy 245.834989 212.523722) (xy 245.702333 212.414854) (xy 245.685145 212.397666) + (xy 245.576277 212.26501) (xy 245.562772 212.244798) (xy 245.481878 212.093456) (xy 245.472575 212.070998) + (xy 245.422757 211.906769) (xy 245.418018 211.882941) (xy 245.400597 211.706061) (xy 245.4 211.693907) + (xy 245.4 210.351942) (xy 245.419685 210.284903) (xy 245.472489 210.239148) (xy 245.541647 210.229204) + (xy 245.593852 210.249488) (xy 245.662623 210.296375) (xy 245.662624 210.296376) (xy 245.892176 210.406921) + (xy 245.892174 210.406921) (xy 246.135652 210.482024) (xy 246.135658 210.482026) (xy 246.387595 210.519999) + (xy 246.387604 210.52) (xy 246.642396 210.52) (xy 246.642404 210.519999) (xy 246.894341 210.482026) + (xy 246.894347 210.482024) (xy 247.137824 210.406921) (xy 247.367376 210.296376) (xy 247.367377 210.296375) + (xy 247.528185 210.186738) (xy 246.877293 209.535846) (xy 246.893942 209.528951) (xy 247.02497 209.441401) + (xy 247.136401 209.32997) (xy 247.223951 209.198942) (xy 247.230846 209.182294) (xy 247.881544 209.832992) + (xy 247.881546 209.832991) (xy 247.923544 209.78033) (xy 248.050941 209.559671) (xy 248.099572 209.435763) + (xy 248.142387 209.380549) (xy 248.208257 209.357248) (xy 248.276268 209.373259) (xy 248.324827 209.423496) + (xy 248.330428 209.435763) (xy 248.379058 209.559671) (xy 248.506454 209.780327) (xy 248.506461 209.780338) + (xy 248.548452 209.832991) (xy 248.548453 209.832992) (xy 249.199152 209.182292) (xy 249.206049 209.198942) + (xy 249.293599 209.32997) (xy 249.40503 209.441401) (xy 249.536058 209.528951) (xy 249.552705 209.535846) + (xy 248.901813 210.186738) (xy 249.062616 210.296371) (xy 249.062624 210.296376) (xy 249.292176 210.406921) + (xy 249.292174 210.406921) (xy 249.535652 210.482024) (xy 249.535658 210.482026) (xy 249.787595 210.519999) + (xy 249.787604 210.52) (xy 250.042396 210.52) (xy 250.042404 210.519999) (xy 250.294341 210.482026) + (xy 250.294347 210.482024) (xy 250.537824 210.406921) (xy 250.767376 210.296376) (xy 250.767377 210.296375) + (xy 250.928185 210.186738) (xy 250.277294 209.535846) (xy 250.293942 209.528951) (xy 250.42497 209.441401) + (xy 250.536401 209.32997) (xy 250.623951 209.198942) (xy 250.630846 209.182294) (xy 251.281544 209.832992) + (xy 251.281546 209.832991) (xy 251.323544 209.78033) (xy 251.450941 209.559671) (xy 251.544026 209.322494) + (xy 251.544031 209.322477) (xy 251.600726 209.074079) (xy 251.619767 208.820004) (xy 251.619767 208.819995) + (xy 251.600726 208.56592) (xy 251.544031 208.317522) (xy 251.544026 208.317505) (xy 251.450941 208.080328) + (xy 251.450942 208.080328) (xy 251.323545 207.859672) (xy 251.281545 207.807006) (xy 250.630846 208.457705) + (xy 250.623951 208.441058) (xy 250.536401 208.31003) (xy 250.42497 208.198599) (xy 250.293942 208.111049) + (xy 250.277293 208.104152) (xy 250.928185 207.45326) (xy 250.767384 207.343628) (xy 250.767376 207.343623) + (xy 250.537823 207.233078) (xy 250.537825 207.233078) (xy 250.294347 207.157975) (xy 250.294341 207.157973) + (xy 250.042404 207.12) (xy 249.787595 207.12) (xy 249.535658 207.157973) (xy 249.535652 207.157975) + (xy 249.292175 207.233078) (xy 249.062622 207.343625) (xy 249.062609 207.343632) (xy 248.901813 207.453259) + (xy 249.552706 208.104152) (xy 249.536058 208.111049) (xy 249.40503 208.198599) (xy 249.293599 208.31003) + (xy 249.206049 208.441058) (xy 249.199152 208.457706) (xy 248.548452 207.807006) (xy 248.506457 207.859667) + (xy 248.379058 208.080328) (xy 248.330428 208.204236) (xy 248.287612 208.25945) (xy 248.221742 208.282751) + (xy 248.153732 208.26674) (xy 248.105173 208.216502) (xy 248.099572 208.204236) (xy 248.050941 208.080328) + (xy 248.050942 208.080328) (xy 247.923545 207.859672) (xy 247.881545 207.807006) (xy 247.230846 208.457705) + (xy 247.223951 208.441058) (xy 247.136401 208.31003) (xy 247.02497 208.198599) (xy 246.893942 208.111049) + (xy 246.877293 208.104152) (xy 247.528185 207.453259) (xy 247.367384 207.343628) (xy 247.367376 207.343623) + (xy 247.137823 207.233078) (xy 247.137825 207.233078) (xy 246.894347 207.157975) (xy 246.894341 207.157973) + (xy 246.642404 207.12) (xy 246.387595 207.12) (xy 246.135658 207.157973) (xy 246.135652 207.157975) + (xy 245.892175 207.233078) (xy 245.662624 207.343623) (xy 245.662616 207.343628) (xy 245.593851 207.390511) + (xy 245.527371 207.412011) (xy 245.459821 207.394156) (xy 245.412648 207.342616) (xy 245.4 207.288057) + (xy 245.4 203.006092) (xy 245.400597 202.993938) (xy 245.418018 202.817056) (xy 245.422757 202.793232) + (xy 245.472577 202.628994) (xy 245.481875 202.606549) (xy 245.562775 202.455195) (xy 245.576272 202.434995) + (xy 245.685149 202.302328) (xy 245.702367 202.285117) (xy 245.70304 202.284564) (xy 245.704198 202.283616) + (xy 245.768519 202.256328) (xy 245.782825 202.2555) (xy 251.493887 202.2555) (xy 251.493907 202.2555) + (xy 251.506442 202.255192) (xy 251.518596 202.254595) (xy 251.531105 202.253673) (xy 251.707978 202.236252) + (xy 251.732777 202.232573) (xy 251.756618 202.227831) (xy 251.780942 202.221738) (xy 251.945165 202.171922) + (xy 251.968779 202.163473) (xy 251.991237 202.15417) (xy 252.013898 202.143452) (xy 252.046968 202.125776) + (xy 252.069154 202.113917) (xy 252.16524 202.062558) (xy 252.186745 202.049669) (xy 252.206957 202.036164) + (xy 252.222813 202.024403) (xy 252.288385 202.000278) (xy 252.296682 202) (xy 252.5705 202) ) ) ) @@ -155880,100 +159958,110 @@ (xy 170.224815 122.584214) (xy 170.216337 122.595859) (xy 170.214837 122.597686) (xy 170.197665 122.614855) (xy 170.06501 122.723722) (xy 170.044798 122.737227) (xy 169.893456 122.818121) (xy 169.870998 122.827424) (xy 169.706775 122.87724) (xy 169.682934 122.881982) (xy 169.506061 122.899403) (xy 169.493907 122.9) - (xy 163.5 122.9) (xy 163.5 123.9) (xy 163.5 123.900003) (xy 163.5 125.993907) (xy 163.499403 126.006061) - (xy 163.481982 126.182934) (xy 163.47724 126.206775) (xy 163.427424 126.370998) (xy 163.418121 126.393456) - (xy 163.337227 126.544798) (xy 163.323722 126.56501) (xy 163.214854 126.697666) (xy 163.197666 126.714854) - (xy 163.06501 126.823722) (xy 163.044798 126.837227) (xy 162.893456 126.918121) (xy 162.870998 126.927424) - (xy 162.706775 126.97724) (xy 162.682934 126.981982) (xy 162.506061 126.999403) (xy 162.493907 127) - (xy 128.808126 127) (xy 128.791941 126.998939) (xy 128.778917 126.997224) (xy 128.686775 126.985093) - (xy 128.655508 126.976715) (xy 128.565081 126.939259) (xy 128.537048 126.923074) (xy 128.459398 126.863491) - (xy 128.436508 126.840601) (xy 128.423556 126.823722) (xy 128.376925 126.762951) (xy 128.36074 126.734918) - (xy 128.323284 126.644491) (xy 128.314906 126.613223) (xy 128.3 126.5) (xy 128.3 126) (xy 127.8 126) - (xy 127.799993 126) (xy 127.79483 126) (xy 127.727791 125.980315) (xy 127.72594 125.979103) (xy 127.657739 125.933533) - (xy 127.657735 125.933532) (xy 127.584677 125.919) (xy 127.584674 125.919) (xy 127.085326 125.919) - (xy 127.03419 125.929171) (xy 126.98581 125.929171) (xy 126.934674 125.919) (xy 126.435326 125.919) - (xy 126.38419 125.929171) (xy 126.33581 125.929171) (xy 126.284674 125.919) (xy 125.785326 125.919) - (xy 125.73419 125.929171) (xy 125.68581 125.929171) (xy 125.634674 125.919) (xy 125.135326 125.919) - (xy 125.08419 125.929171) (xy 125.03581 125.929171) (xy 124.984674 125.919) (xy 124.485326 125.919) - (xy 124.43419 125.929171) (xy 124.38581 125.929171) (xy 124.334674 125.919) (xy 123.835326 125.919) - (xy 123.78419 125.929171) (xy 123.73581 125.929171) (xy 123.684674 125.919) (xy 123.185326 125.919) - (xy 123.13419 125.929171) (xy 123.08581 125.929171) (xy 123.034674 125.919) (xy 122.535326 125.919) - (xy 122.48419 125.929171) (xy 122.43581 125.929171) (xy 122.384674 125.919) (xy 121.885326 125.919) - (xy 121.83419 125.929171) (xy 121.78581 125.929171) (xy 121.734674 125.919) (xy 121.235326 125.919) - (xy 121.18419 125.929171) (xy 121.13581 125.929171) (xy 121.084674 125.919) (xy 120.585326 125.919) - (xy 120.53419 125.929171) (xy 120.48581 125.929171) (xy 120.434674 125.919) (xy 119.935326 125.919) - (xy 119.935323 125.919) (xy 119.862264 125.933532) (xy 119.86226 125.933533) (xy 119.79406 125.979103) - (xy 119.727382 125.99998) (xy 119.72517 126) (xy 119.206093 126) (xy 119.193939 125.999403) (xy 119.017065 125.981982) - (xy 118.993224 125.97724) (xy 118.829001 125.927424) (xy 118.806543 125.918121) (xy 118.655201 125.837227) - (xy 118.634989 125.823722) (xy 118.502333 125.714854) (xy 118.485145 125.697666) (xy 118.376277 125.56501) - (xy 118.362772 125.544798) (xy 118.281878 125.393456) (xy 118.272575 125.370998) (xy 118.257185 125.320263) - (xy 118.256562 125.250396) (xy 118.273796 125.213828) (xy 118.28022 125.204523) (xy 118.336237 125.056818) - (xy 118.355278 124.9) (xy 118.336237 124.743182) (xy 118.28022 124.595477) (xy 118.280218 124.595474) - (xy 118.280216 124.59547) (xy 118.22195 124.511056) (xy 118.200067 124.444702) (xy 118.2 124.440617) - (xy 118.2 123.506092) (xy 118.200597 123.493938) (xy 118.218018 123.317056) (xy 118.222757 123.293232) - (xy 118.272577 123.128994) (xy 118.281875 123.106549) (xy 118.362775 122.955195) (xy 118.376272 122.934995) - (xy 118.485149 122.802328) (xy 118.502328 122.785149) (xy 118.634995 122.676272) (xy 118.655195 122.662775) - (xy 118.806549 122.581875) (xy 118.828994 122.572577) (xy 118.993232 122.522757) (xy 119.017056 122.518018) - (xy 119.193939 122.500597) (xy 119.206093 122.5) (xy 119.821984 122.5) (xy 119.849985 122.50557) - (xy 119.850281 122.504084) (xy 119.935321 122.520999) (xy 119.935324 122.521) (xy 119.935326 122.521) - (xy 120.434674 122.521) (xy 120.485811 122.510828) (xy 120.534189 122.510828) (xy 120.585326 122.521) - (xy 121.084674 122.521) (xy 121.135811 122.510828) (xy 121.184189 122.510828) (xy 121.235326 122.521) - (xy 121.734674 122.521) (xy 121.785811 122.510828) (xy 121.834189 122.510828) (xy 121.885326 122.521) - (xy 122.384674 122.521) (xy 122.435811 122.510828) (xy 122.484189 122.510828) (xy 122.535326 122.521) - (xy 123.034674 122.521) (xy 123.085811 122.510828) (xy 123.134189 122.510828) (xy 123.185326 122.521) - (xy 123.684674 122.521) (xy 123.735811 122.510828) (xy 123.784189 122.510828) (xy 123.835326 122.521) - (xy 124.334674 122.521) (xy 124.385811 122.510828) (xy 124.434189 122.510828) (xy 124.485326 122.521) - (xy 124.984674 122.521) (xy 125.035811 122.510828) (xy 125.084189 122.510828) (xy 125.135326 122.521) - (xy 125.634674 122.521) (xy 125.685811 122.510828) (xy 125.734189 122.510828) (xy 125.785326 122.521) - (xy 126.284674 122.521) (xy 126.335811 122.510828) (xy 126.384189 122.510828) (xy 126.435326 122.521) - (xy 126.934674 122.521) (xy 126.985811 122.510828) (xy 127.034189 122.510828) (xy 127.085326 122.521) - (xy 127.584676 122.521) (xy 127.584677 122.520999) (xy 127.603903 122.517175) (xy 127.669719 122.504084) - (xy 127.670014 122.50557) (xy 127.698016 122.5) (xy 129.499997 122.5) (xy 129.5 122.5) (xy 130.5 122.5) - (xy 130.5 121.406092) (xy 130.500597 121.393938) (xy 130.518018 121.217056) (xy 130.522757 121.193232) - (xy 130.572577 121.028994) (xy 130.581875 121.006549) (xy 130.662775 120.855195) (xy 130.676272 120.834995) - (xy 130.785149 120.702328) (xy 130.802328 120.685149) (xy 130.934995 120.576272) (xy 130.955195 120.562775) - (xy 131.106549 120.481875) (xy 131.128994 120.472577) (xy 131.293232 120.422757) (xy 131.317056 120.418018) - (xy 131.493939 120.400597) (xy 131.506093 120.4) (xy 137.399997 120.4) (xy 137.4 120.4) (xy 138.4 120.4) - (xy 138.4 116.706092) (xy 138.400597 116.693938) (xy 138.418018 116.517056) (xy 138.422757 116.493232) - (xy 138.472577 116.328994) (xy 138.481875 116.306549) (xy 138.562775 116.155195) (xy 138.576272 116.134995) - (xy 138.685149 116.002328) (xy 138.702367 115.985117) (xy 138.70304 115.984564) (xy 138.704198 115.983616) - (xy 138.768519 115.956328) (xy 138.782825 115.9555) (xy 165.349956 115.9555) (xy 165.416995 115.975185) - (xy 165.46275 116.027989) (xy 165.473609 116.070232) (xy 165.474272 116.07908) (xy 165.530967 116.327477) - (xy 165.530972 116.327494) (xy 165.624057 116.564671) (xy 165.624056 116.564671) (xy 165.751453 116.785327) - (xy 165.75146 116.785338) (xy 165.793451 116.837991) (xy 165.793452 116.837992) (xy 166.444151 116.187292) - (xy 166.451048 116.203942) (xy 166.538598 116.33497) (xy 166.650029 116.446401) (xy 166.781057 116.533951) - (xy 166.797704 116.540846) (xy 166.146812 117.191738) (xy 166.307615 117.301371) (xy 166.307624 117.301376) - (xy 166.539995 117.41328) (xy 166.591855 117.460102) (xy 166.610168 117.527529) (xy 166.58912 117.594153) - (xy 166.539995 117.63672) (xy 166.307621 117.748625) (xy 166.307608 117.748632) (xy 166.146812 117.858259) - (xy 166.797705 118.509152) (xy 166.781057 118.516049) (xy 166.650029 118.603599) (xy 166.538598 118.71503) - (xy 166.451048 118.846058) (xy 166.444151 118.862706) (xy 165.793451 118.212006) (xy 165.751456 118.264667) - (xy 165.624057 118.485328) (xy 165.530972 118.722505) (xy 165.530967 118.722522) (xy 165.474272 118.97092) - (xy 165.455232 119.224995) (xy 165.455232 119.225004) (xy 165.474272 119.479079) (xy 165.530967 119.727477) - (xy 165.530972 119.727494) (xy 165.624057 119.964671) (xy 165.624056 119.964671) (xy 165.751453 120.185327) - (xy 165.75146 120.185338) (xy 165.793451 120.237991) (xy 165.793452 120.237992) (xy 166.444151 119.587292) - (xy 166.451048 119.603942) (xy 166.538598 119.73497) (xy 166.650029 119.846401) (xy 166.781057 119.933951) - (xy 166.797704 119.940846) (xy 166.146812 120.591738) (xy 166.307615 120.701371) (xy 166.307623 120.701376) - (xy 166.537175 120.811921) (xy 166.537173 120.811921) (xy 166.780651 120.887024) (xy 166.780657 120.887026) - (xy 167.032594 120.924999) (xy 167.032603 120.925) (xy 167.287395 120.925) (xy 167.287403 120.924999) - (xy 167.53934 120.887026) (xy 167.539346 120.887024) (xy 167.782823 120.811921) (xy 168.012375 120.701376) - (xy 168.012376 120.701375) (xy 168.173184 120.591738) (xy 167.522293 119.940846) (xy 167.538941 119.933951) - (xy 167.669969 119.846401) (xy 167.7814 119.73497) (xy 167.86895 119.603942) (xy 167.875845 119.587294) - (xy 168.526543 120.237992) (xy 168.526545 120.237991) (xy 168.568543 120.18533) (xy 168.69594 119.964671) - (xy 168.789025 119.727494) (xy 168.78903 119.727477) (xy 168.845725 119.479079) (xy 168.864766 119.225004) - (xy 168.864766 119.224995) (xy 168.845725 118.97092) (xy 168.78903 118.722522) (xy 168.789025 118.722505) - (xy 168.69594 118.485328) (xy 168.695941 118.485328) (xy 168.568544 118.264672) (xy 168.526544 118.212006) - (xy 167.875845 118.862705) (xy 167.86895 118.846058) (xy 167.7814 118.71503) (xy 167.669969 118.603599) - (xy 167.538941 118.516049) (xy 167.522292 118.509152) (xy 168.173184 117.85826) (xy 168.012383 117.748628) - (xy 168.012375 117.748623) (xy 167.780002 117.63672) (xy 167.728142 117.589898) (xy 167.709829 117.522471) - (xy 167.730876 117.455847) (xy 167.780002 117.41328) (xy 168.012375 117.301376) (xy 168.012376 117.301375) - (xy 168.173184 117.191738) (xy 167.522293 116.540846) (xy 167.538941 116.533951) (xy 167.669969 116.446401) - (xy 167.7814 116.33497) (xy 167.86895 116.203942) (xy 167.875845 116.187293) (xy 168.526544 116.837992) - (xy 168.526545 116.837991) (xy 168.568543 116.78533) (xy 168.69594 116.564671) (xy 168.789025 116.327494) - (xy 168.78903 116.327477) (xy 168.845725 116.07908) (xy 168.846389 116.070232) (xy 168.871029 116.004851) - (xy 168.927105 115.963171) (xy 168.970042 115.9555) (xy 169.493887 115.9555) (xy 169.493907 115.9555) - (xy 169.506442 115.955192) (xy 169.518596 115.954595) (xy 169.531105 115.953673) (xy 169.707978 115.936252) - (xy 169.732777 115.932573) (xy 169.756618 115.927831) (xy 169.780942 115.921738) (xy 169.945165 115.871922) - (xy 169.958787 115.867047) (xy 170.028537 115.862995) + (xy 164.5 122.9) (xy 164.451844 122.904743) (xy 164.304911 122.919214) (xy 164.221786 122.94443) + (xy 164.117317 122.97612) (xy 164.117314 122.976121) (xy 164.117312 122.976122) (xy 164.117309 122.976123) + (xy 163.944435 123.068526) (xy 163.944428 123.068531) (xy 163.792892 123.192892) (xy 163.668531 123.344428) + (xy 163.668526 123.344435) (xy 163.576123 123.517309) (xy 163.576122 123.517312) (xy 163.519214 123.704911) + (xy 163.5 123.900003) (xy 163.5 125.993907) (xy 163.499403 126.006061) (xy 163.481982 126.182934) + (xy 163.47724 126.206775) (xy 163.427424 126.370998) (xy 163.418121 126.393456) (xy 163.337227 126.544798) + (xy 163.323722 126.56501) (xy 163.214854 126.697666) (xy 163.197666 126.714854) (xy 163.06501 126.823722) + (xy 163.044798 126.837227) (xy 162.893456 126.918121) (xy 162.870998 126.927424) (xy 162.706775 126.97724) + (xy 162.682934 126.981982) (xy 162.506061 126.999403) (xy 162.493907 127) (xy 128.808126 127) (xy 128.791941 126.998939) + (xy 128.778917 126.997224) (xy 128.686775 126.985093) (xy 128.655508 126.976715) (xy 128.565081 126.939259) + (xy 128.537048 126.923074) (xy 128.459398 126.863491) (xy 128.436508 126.840601) (xy 128.423556 126.823722) + (xy 128.376925 126.762951) (xy 128.36074 126.734918) (xy 128.323284 126.644491) (xy 128.314906 126.613223) + (xy 128.3 126.5) (xy 128.282963 126.370591) (xy 128.282961 126.370586) (xy 128.233015 126.250004) + (xy 128.233015 126.250003) (xy 128.233013 126.25) (xy 128.153553 126.146447) (xy 128.05 126.066987) + (xy 128.049997 126.066986) (xy 128.049995 126.066984) (xy 127.929413 126.017038) (xy 127.929408 126.017036) + (xy 127.800009 126.000001) (xy 127.800006 126) (xy 127.8 126) (xy 127.799993 126) (xy 127.79483 126) + (xy 127.727791 125.980315) (xy 127.72594 125.979103) (xy 127.657739 125.933533) (xy 127.657735 125.933532) + (xy 127.584677 125.919) (xy 127.584674 125.919) (xy 127.085326 125.919) (xy 127.03419 125.929171) + (xy 126.98581 125.929171) (xy 126.934674 125.919) (xy 126.435326 125.919) (xy 126.38419 125.929171) + (xy 126.33581 125.929171) (xy 126.284674 125.919) (xy 125.785326 125.919) (xy 125.73419 125.929171) + (xy 125.68581 125.929171) (xy 125.634674 125.919) (xy 125.135326 125.919) (xy 125.08419 125.929171) + (xy 125.03581 125.929171) (xy 124.984674 125.919) (xy 124.485326 125.919) (xy 124.43419 125.929171) + (xy 124.38581 125.929171) (xy 124.334674 125.919) (xy 123.835326 125.919) (xy 123.78419 125.929171) + (xy 123.73581 125.929171) (xy 123.684674 125.919) (xy 123.185326 125.919) (xy 123.13419 125.929171) + (xy 123.08581 125.929171) (xy 123.034674 125.919) (xy 122.535326 125.919) (xy 122.48419 125.929171) + (xy 122.43581 125.929171) (xy 122.384674 125.919) (xy 121.885326 125.919) (xy 121.83419 125.929171) + (xy 121.78581 125.929171) (xy 121.734674 125.919) (xy 121.235326 125.919) (xy 121.18419 125.929171) + (xy 121.13581 125.929171) (xy 121.084674 125.919) (xy 120.585326 125.919) (xy 120.53419 125.929171) + (xy 120.48581 125.929171) (xy 120.434674 125.919) (xy 119.935326 125.919) (xy 119.935323 125.919) + (xy 119.862264 125.933532) (xy 119.86226 125.933533) (xy 119.79406 125.979103) (xy 119.727382 125.99998) + (xy 119.72517 126) (xy 119.206093 126) (xy 119.193939 125.999403) (xy 119.017065 125.981982) (xy 118.993224 125.97724) + (xy 118.829001 125.927424) (xy 118.806543 125.918121) (xy 118.655201 125.837227) (xy 118.634989 125.823722) + (xy 118.502333 125.714854) (xy 118.485145 125.697666) (xy 118.376277 125.56501) (xy 118.362772 125.544798) + (xy 118.281878 125.393456) (xy 118.272575 125.370998) (xy 118.257185 125.320263) (xy 118.256562 125.250396) + (xy 118.273796 125.213828) (xy 118.28022 125.204523) (xy 118.336237 125.056818) (xy 118.355278 124.9) + (xy 118.336237 124.743182) (xy 118.28022 124.595477) (xy 118.280218 124.595474) (xy 118.280216 124.59547) + (xy 118.22195 124.511056) (xy 118.200067 124.444702) (xy 118.2 124.440617) (xy 118.2 123.506092) + (xy 118.200597 123.493938) (xy 118.218018 123.317056) (xy 118.222757 123.293232) (xy 118.272577 123.128994) + (xy 118.281875 123.106549) (xy 118.362775 122.955195) (xy 118.376272 122.934995) (xy 118.485149 122.802328) + (xy 118.502328 122.785149) (xy 118.634995 122.676272) (xy 118.655195 122.662775) (xy 118.806549 122.581875) + (xy 118.828994 122.572577) (xy 118.993232 122.522757) (xy 119.017056 122.518018) (xy 119.193939 122.500597) + (xy 119.206093 122.5) (xy 119.821984 122.5) (xy 119.849985 122.50557) (xy 119.850281 122.504084) + (xy 119.935321 122.520999) (xy 119.935324 122.521) (xy 119.935326 122.521) (xy 120.434674 122.521) + (xy 120.485811 122.510828) (xy 120.534189 122.510828) (xy 120.585326 122.521) (xy 121.084674 122.521) + (xy 121.135811 122.510828) (xy 121.184189 122.510828) (xy 121.235326 122.521) (xy 121.734674 122.521) + (xy 121.785811 122.510828) (xy 121.834189 122.510828) (xy 121.885326 122.521) (xy 122.384674 122.521) + (xy 122.435811 122.510828) (xy 122.484189 122.510828) (xy 122.535326 122.521) (xy 123.034674 122.521) + (xy 123.085811 122.510828) (xy 123.134189 122.510828) (xy 123.185326 122.521) (xy 123.684674 122.521) + (xy 123.735811 122.510828) (xy 123.784189 122.510828) (xy 123.835326 122.521) (xy 124.334674 122.521) + (xy 124.385811 122.510828) (xy 124.434189 122.510828) (xy 124.485326 122.521) (xy 124.984674 122.521) + (xy 125.035811 122.510828) (xy 125.084189 122.510828) (xy 125.135326 122.521) (xy 125.634674 122.521) + (xy 125.685811 122.510828) (xy 125.734189 122.510828) (xy 125.785326 122.521) (xy 126.284674 122.521) + (xy 126.335811 122.510828) (xy 126.384189 122.510828) (xy 126.435326 122.521) (xy 126.934674 122.521) + (xy 126.985811 122.510828) (xy 127.034189 122.510828) (xy 127.085326 122.521) (xy 127.584676 122.521) + (xy 127.584677 122.520999) (xy 127.603903 122.517175) (xy 127.669719 122.504084) (xy 127.670014 122.50557) + (xy 127.698016 122.5) (xy 129.499997 122.5) (xy 129.5 122.5) (xy 129.69509 122.480785) (xy 129.882683 122.42388) + (xy 130.05557 122.33147) (xy 130.207107 122.207107) (xy 130.33147 122.05557) (xy 130.42388 121.882683) + (xy 130.480785 121.69509) (xy 130.5 121.5) (xy 130.5 121.406092) (xy 130.500597 121.393938) (xy 130.518018 121.217056) + (xy 130.522757 121.193232) (xy 130.572577 121.028994) (xy 130.581875 121.006549) (xy 130.662775 120.855195) + (xy 130.676272 120.834995) (xy 130.785149 120.702328) (xy 130.802328 120.685149) (xy 130.934995 120.576272) + (xy 130.955195 120.562775) (xy 131.106549 120.481875) (xy 131.128994 120.472577) (xy 131.293232 120.422757) + (xy 131.317056 120.418018) (xy 131.493939 120.400597) (xy 131.506093 120.4) (xy 137.399997 120.4) + (xy 137.4 120.4) (xy 137.59509 120.380785) (xy 137.782683 120.32388) (xy 137.95557 120.23147) (xy 138.107107 120.107107) + (xy 138.23147 119.95557) (xy 138.32388 119.782683) (xy 138.380785 119.59509) (xy 138.4 119.4) (xy 138.4 116.706092) + (xy 138.400597 116.693938) (xy 138.418018 116.517056) (xy 138.422757 116.493232) (xy 138.472577 116.328994) + (xy 138.481875 116.306549) (xy 138.562775 116.155195) (xy 138.576272 116.134995) (xy 138.685149 116.002328) + (xy 138.702367 115.985117) (xy 138.70304 115.984564) (xy 138.704198 115.983616) (xy 138.768519 115.956328) + (xy 138.782825 115.9555) (xy 165.349956 115.9555) (xy 165.416995 115.975185) (xy 165.46275 116.027989) + (xy 165.473609 116.070232) (xy 165.474272 116.07908) (xy 165.530967 116.327477) (xy 165.530972 116.327494) + (xy 165.624057 116.564671) (xy 165.624056 116.564671) (xy 165.751453 116.785327) (xy 165.75146 116.785338) + (xy 165.793451 116.837991) (xy 165.793452 116.837992) (xy 166.444151 116.187292) (xy 166.451048 116.203942) + (xy 166.538598 116.33497) (xy 166.650029 116.446401) (xy 166.781057 116.533951) (xy 166.797704 116.540846) + (xy 166.146812 117.191738) (xy 166.307615 117.301371) (xy 166.307624 117.301376) (xy 166.539995 117.41328) + (xy 166.591855 117.460102) (xy 166.610168 117.527529) (xy 166.58912 117.594153) (xy 166.539995 117.63672) + (xy 166.307621 117.748625) (xy 166.307608 117.748632) (xy 166.146812 117.858259) (xy 166.797705 118.509152) + (xy 166.781057 118.516049) (xy 166.650029 118.603599) (xy 166.538598 118.71503) (xy 166.451048 118.846058) + (xy 166.444151 118.862706) (xy 165.793451 118.212006) (xy 165.751456 118.264667) (xy 165.624057 118.485328) + (xy 165.530972 118.722505) (xy 165.530967 118.722522) (xy 165.474272 118.97092) (xy 165.455232 119.224995) + (xy 165.455232 119.225004) (xy 165.474272 119.479079) (xy 165.530967 119.727477) (xy 165.530972 119.727494) + (xy 165.624057 119.964671) (xy 165.624056 119.964671) (xy 165.751453 120.185327) (xy 165.75146 120.185338) + (xy 165.793451 120.237991) (xy 165.793452 120.237992) (xy 166.444151 119.587292) (xy 166.451048 119.603942) + (xy 166.538598 119.73497) (xy 166.650029 119.846401) (xy 166.781057 119.933951) (xy 166.797704 119.940846) + (xy 166.146812 120.591738) (xy 166.307615 120.701371) (xy 166.307623 120.701376) (xy 166.537175 120.811921) + (xy 166.537173 120.811921) (xy 166.780651 120.887024) (xy 166.780657 120.887026) (xy 167.032594 120.924999) + (xy 167.032603 120.925) (xy 167.287395 120.925) (xy 167.287403 120.924999) (xy 167.53934 120.887026) + (xy 167.539346 120.887024) (xy 167.782823 120.811921) (xy 168.012375 120.701376) (xy 168.012376 120.701375) + (xy 168.173184 120.591738) (xy 167.522293 119.940846) (xy 167.538941 119.933951) (xy 167.669969 119.846401) + (xy 167.7814 119.73497) (xy 167.86895 119.603942) (xy 167.875845 119.587294) (xy 168.526543 120.237992) + (xy 168.526545 120.237991) (xy 168.568543 120.18533) (xy 168.69594 119.964671) (xy 168.789025 119.727494) + (xy 168.78903 119.727477) (xy 168.845725 119.479079) (xy 168.864766 119.225004) (xy 168.864766 119.224995) + (xy 168.845725 118.97092) (xy 168.78903 118.722522) (xy 168.789025 118.722505) (xy 168.69594 118.485328) + (xy 168.695941 118.485328) (xy 168.568544 118.264672) (xy 168.526544 118.212006) (xy 167.875845 118.862705) + (xy 167.86895 118.846058) (xy 167.7814 118.71503) (xy 167.669969 118.603599) (xy 167.538941 118.516049) + (xy 167.522292 118.509152) (xy 168.173184 117.85826) (xy 168.012383 117.748628) (xy 168.012375 117.748623) + (xy 167.780002 117.63672) (xy 167.728142 117.589898) (xy 167.709829 117.522471) (xy 167.730876 117.455847) + (xy 167.780002 117.41328) (xy 168.012375 117.301376) (xy 168.012376 117.301375) (xy 168.173184 117.191738) + (xy 167.522293 116.540846) (xy 167.538941 116.533951) (xy 167.669969 116.446401) (xy 167.7814 116.33497) + (xy 167.86895 116.203942) (xy 167.875845 116.187293) (xy 168.526544 116.837992) (xy 168.526545 116.837991) + (xy 168.568543 116.78533) (xy 168.69594 116.564671) (xy 168.789025 116.327494) (xy 168.78903 116.327477) + (xy 168.845725 116.07908) (xy 168.846389 116.070232) (xy 168.871029 116.004851) (xy 168.927105 115.963171) + (xy 168.970042 115.9555) (xy 169.493887 115.9555) (xy 169.493907 115.9555) (xy 169.506442 115.955192) + (xy 169.518596 115.954595) (xy 169.531105 115.953673) (xy 169.707978 115.936252) (xy 169.732777 115.932573) + (xy 169.756618 115.927831) (xy 169.780942 115.921738) (xy 169.945165 115.871922) (xy 169.958787 115.867047) + (xy 170.028537 115.862995) ) ) ) @@ -156005,16 +160093,16 @@ (filled_polygon (layer "F.Cu") (pts - (xy 241.5 70.9) (xy 239.606093 70.9) (xy 239.593939 70.899403) (xy 239.417065 70.881982) (xy 239.393224 70.87724) - (xy 239.229001 70.827424) (xy 239.206543 70.818121) (xy 239.055201 70.737227) (xy 239.034989 70.723722) - (xy 238.902333 70.614854) (xy 238.885145 70.597666) (xy 238.776277 70.46501) (xy 238.762772 70.444798) - (xy 238.681878 70.293456) (xy 238.672575 70.270998) (xy 238.622757 70.106769) (xy 238.618018 70.082941) - (xy 238.600597 69.906061) (xy 238.6 69.893907) (xy 238.6 68.206092) (xy 238.600597 68.193938) (xy 238.618018 68.017056) - (xy 238.622757 67.993232) (xy 238.672577 67.828994) (xy 238.681875 67.806549) (xy 238.762775 67.655195) - (xy 238.776272 67.634995) (xy 238.885149 67.502328) (xy 238.902328 67.485149) (xy 239.034995 67.376272) - (xy 239.055195 67.362775) (xy 239.206549 67.281875) (xy 239.228994 67.272577) (xy 239.393232 67.222757) - (xy 239.417056 67.218018) (xy 239.593939 67.200597) (xy 239.606093 67.2) (xy 240.999993 67.2) (xy 241 67.2) - (xy 241.5 67.2) + (xy 241.5 70.9) (xy 240.5 70.9) (xy 239.606093 70.9) (xy 239.593939 70.899403) (xy 239.417065 70.881982) + (xy 239.393224 70.87724) (xy 239.229001 70.827424) (xy 239.206543 70.818121) (xy 239.055201 70.737227) + (xy 239.034989 70.723722) (xy 238.902333 70.614854) (xy 238.885145 70.597666) (xy 238.776277 70.46501) + (xy 238.762772 70.444798) (xy 238.681878 70.293456) (xy 238.672575 70.270998) (xy 238.622757 70.106769) + (xy 238.618018 70.082941) (xy 238.600597 69.906061) (xy 238.6 69.893907) (xy 238.6 68.206092) (xy 238.600597 68.193938) + (xy 238.618018 68.017056) (xy 238.622757 67.993232) (xy 238.672577 67.828994) (xy 238.681875 67.806549) + (xy 238.762775 67.655195) (xy 238.776272 67.634995) (xy 238.885149 67.502328) (xy 238.902328 67.485149) + (xy 239.034995 67.376272) (xy 239.055195 67.362775) (xy 239.206549 67.281875) (xy 239.228994 67.272577) + (xy 239.393232 67.222757) (xy 239.417056 67.218018) (xy 239.593939 67.200597) (xy 239.606093 67.2) + (xy 240.999993 67.2) (xy 241 67.2) (xy 241.5 67.2) ) ) ) @@ -156045,114 +160133,117 @@ (filled_polygon (layer "F.Cu") (pts - (xy 249.835178 85.98148) (xy 249.895037 85.987325) (xy 250.012166 85.998764) (xy 250.036021 86.003489) - (xy 250.200374 86.053216) (xy 250.222848 86.062507) (xy 250.374332 86.143358) (xy 250.394557 86.156856) - (xy 250.527345 86.265722) (xy 250.544543 86.282904) (xy 250.552277 86.29232) (xy 250.65353 86.4156) - (xy 250.667049 86.435818) (xy 250.74803 86.587221) (xy 250.757343 86.60969) (xy 250.807215 86.773998) - (xy 250.811962 86.797852) (xy 250.829402 86.974819) (xy 250.83 86.98698) (xy 250.83 90.93574) (xy 250.810315 91.002779) - (xy 250.757511 91.048534) (xy 250.688353 91.058478) (xy 250.631689 91.035006) (xy 250.567093 90.986649) - (xy 250.567086 90.986645) (xy 250.432379 90.936403) (xy 250.432372 90.936401) (xy 250.372844 90.93) - (xy 249.375 90.93) (xy 249.375 91.867639) (xy 249.358351 91.860743) (xy 249.203793 91.83) (xy 249.046207 91.83) - (xy 248.891649 91.860743) (xy 248.875 91.867639) (xy 248.875 90.93) (xy 247.877155 90.93) (xy 247.817627 90.936401) - (xy 247.81762 90.936403) (xy 247.682913 90.986645) (xy 247.682906 90.986649) (xy 247.567812 91.072809) - (xy 247.567809 91.072812) (xy 247.481649 91.187906) (xy 247.481645 91.187913) (xy 247.431403 91.32262) - (xy 247.431401 91.322627) (xy 247.425 91.382155) (xy 247.425 91.711711) (xy 247.405315 91.77875) - (xy 247.352511 91.824505) (xy 247.283353 91.834449) (xy 247.219797 91.805424) (xy 247.193613 91.773712) - (xy 247.133543 91.669669) (xy 247.091545 91.617006) (xy 246.440846 92.267705) (xy 246.433951 92.251058) - (xy 246.346401 92.12003) (xy 246.23497 92.008599) (xy 246.103942 91.921049) (xy 246.087293 91.914152) - (xy 246.738185 91.26326) (xy 246.577384 91.153628) (xy 246.577376 91.153623) (xy 246.347823 91.043078) - (xy 246.347825 91.043078) (xy 246.104347 90.967975) (xy 246.104341 90.967973) (xy 245.852404 90.93) - (xy 245.597595 90.93) (xy 245.345658 90.967973) (xy 245.345652 90.967975) (xy 245.102175 91.043078) - (xy 244.872622 91.153625) (xy 244.872609 91.153632) (xy 244.711813 91.263259) (xy 245.362706 91.914152) - (xy 245.346058 91.921049) (xy 245.21503 92.008599) (xy 245.103599 92.12003) (xy 245.016049 92.251058) - (xy 245.009152 92.267706) (xy 244.358452 91.617006) (xy 244.316457 91.669667) (xy 244.189058 91.890328) - (xy 244.095973 92.127505) (xy 244.095968 92.127522) (xy 244.039273 92.37592) (xy 244.020233 92.629995) - (xy 244.020233 92.630004) (xy 244.039273 92.884079) (xy 244.095968 93.132477) (xy 244.095973 93.132494) - (xy 244.189058 93.369671) (xy 244.189057 93.369671) (xy 244.316454 93.590327) (xy 244.316461 93.590338) - (xy 244.358452 93.642991) (xy 244.358453 93.642992) (xy 245.009152 92.992292) (xy 245.016049 93.008942) - (xy 245.103599 93.13997) (xy 245.21503 93.251401) (xy 245.346058 93.338951) (xy 245.362705 93.345846) - (xy 244.711813 93.996738) (xy 244.872616 94.106371) (xy 244.872624 94.106376) (xy 245.102176 94.216921) - (xy 245.102174 94.216921) (xy 245.345652 94.292024) (xy 245.345658 94.292026) (xy 245.597595 94.329999) - (xy 245.597604 94.33) (xy 245.852396 94.33) (xy 245.852404 94.329999) (xy 246.104341 94.292026) - (xy 246.104347 94.292024) (xy 246.347824 94.216921) (xy 246.577376 94.106376) (xy 246.577377 94.106375) - (xy 246.738185 93.996738) (xy 246.087294 93.345846) (xy 246.103942 93.338951) (xy 246.23497 93.251401) - (xy 246.346401 93.13997) (xy 246.433951 93.008942) (xy 246.440846 92.992294) (xy 247.091544 93.642992) - (xy 247.091546 93.642991) (xy 247.133544 93.59033) (xy 247.193613 93.486288) (xy 247.24418 93.438073) - (xy 247.312787 93.424849) (xy 247.377651 93.450817) (xy 247.41818 93.507731) (xy 247.425 93.548288) - (xy 247.425 93.877844) (xy 247.431401 93.937372) (xy 247.431403 93.937379) (xy 247.481645 94.072086) - (xy 247.481649 94.072093) (xy 247.567809 94.187187) (xy 247.567812 94.18719) (xy 247.682906 94.27335) - (xy 247.682913 94.273354) (xy 247.81762 94.323596) (xy 247.817627 94.323598) (xy 247.877155 94.329999) - (xy 247.877172 94.33) (xy 248.875 94.33) (xy 248.875 93.39236) (xy 248.891649 93.399257) (xy 249.046207 93.43) - (xy 249.203793 93.43) (xy 249.358351 93.399257) (xy 249.375 93.39236) (xy 249.375 94.33) (xy 250.372828 94.33) - (xy 250.372844 94.329999) (xy 250.432372 94.323598) (xy 250.432379 94.323596) (xy 250.567086 94.273354) - (xy 250.567089 94.273352) (xy 250.631688 94.224993) (xy 250.697152 94.200575) (xy 250.765425 94.215426) - (xy 250.814831 94.26483) (xy 250.83 94.324259) (xy 250.83 95.21) (xy 251.141842 95.505763) (xy 251.141848 95.505769) - (xy 258.117684 102.121929) (xy 258.117689 102.121934) (xy 258.117698 102.121942) (xy 258.2 102.2) - (xy 258.2977 102.257643) (xy 258.297713 102.257651) (xy 262.731777 104.873748) (xy 267.702597 107.806532) - (xy 267.713316 107.81363) (xy 267.864338 107.925325) (xy 267.883298 107.942657) (xy 268.003756 108.078229) - (xy 268.018737 108.099096) (xy 268.10867 108.256577) (xy 268.11903 108.280085) (xy 268.174581 108.452717) - (xy 268.179875 108.477855) (xy 268.199333 108.664671) (xy 268.2 108.677517) (xy 268.2 116.293907) - (xy 268.199403 116.306061) (xy 268.181982 116.482934) (xy 268.17724 116.506775) (xy 268.127424 116.670998) - (xy 268.118121 116.693456) (xy 268.037227 116.844798) (xy 268.023722 116.86501) (xy 267.914854 116.997666) - (xy 267.897666 117.014854) (xy 267.76501 117.123722) (xy 267.744798 117.137227) (xy 267.593456 117.218121) - (xy 267.570998 117.227424) (xy 267.406775 117.27724) (xy 267.382934 117.281982) (xy 267.206061 117.299403) - (xy 267.193907 117.3) (xy 266.05156 117.3) (xy 266.039731 117.299434) (xy 266.012509 117.296825) - (xy 265.867525 117.282929) (xy 265.844296 117.278435) (xy 265.684073 117.231206) (xy 265.66212 117.222382) - (xy 265.587139 117.18356) (xy 265.536656 117.135256) (xy 265.520576 117.083686) (xy 265.51139 116.972824) - (xy 265.45543 116.751845) (xy 265.444129 116.726082) (xy 265.363862 116.543091) (xy 265.239185 116.352257) - (xy 265.084791 116.184541) (xy 265.084787 116.184538) (xy 264.904909 116.044533) (xy 264.9049 116.044527) - (xy 264.84654 116.012945) (xy 264.796949 115.963726) (xy 264.792553 115.95494) (xy 262.784845 111.509299) - (xy 262.784843 111.509296) (xy 262.6 111.1) (xy 262.171278 110.966258) (xy 262.171274 110.966257) - (xy 246.437901 106.058179) (xy 232.294323 101.646042) (xy 229.008449 100.621002) (xy 228.996179 100.61645) - (xy 228.820598 100.540536) (xy 228.797812 100.527677) (xy 228.647432 100.420436) (xy 228.62785 100.403081) - (xy 228.503323 100.266674) (xy 228.487826 100.245607) (xy 228.39469 100.086102) (xy 228.383955 100.062243) - (xy 228.326361 99.886748) (xy 228.320874 99.861177) (xy 228.300692 99.670947) (xy 228.3 99.657865) - (xy 228.3 92.629995) (xy 233.730233 92.629995) (xy 233.730233 92.630004) (xy 233.749273 92.884079) - (xy 233.805968 93.132477) (xy 233.805973 93.132494) (xy 233.899058 93.369671) (xy 233.899057 93.369671) - (xy 234.026454 93.590327) (xy 234.026461 93.590338) (xy 234.068452 93.642991) (xy 234.068453 93.642992) - (xy 234.719152 92.992292) (xy 234.726049 93.008942) (xy 234.813599 93.13997) (xy 234.92503 93.251401) - (xy 235.056058 93.338951) (xy 235.072705 93.345846) (xy 234.421813 93.996738) (xy 234.582616 94.106371) - (xy 234.582624 94.106376) (xy 234.812176 94.216921) (xy 234.812174 94.216921) (xy 235.055652 94.292024) - (xy 235.055658 94.292026) (xy 235.307595 94.329999) (xy 235.307604 94.33) (xy 235.562396 94.33) - (xy 235.562404 94.329999) (xy 235.814341 94.292026) (xy 235.814347 94.292024) (xy 236.057824 94.216921) - (xy 236.287376 94.106376) (xy 236.287377 94.106375) (xy 236.448185 93.996738) (xy 235.797294 93.345846) - (xy 235.813942 93.338951) (xy 235.94497 93.251401) (xy 236.056401 93.13997) (xy 236.143951 93.008942) - (xy 236.150846 92.992294) (xy 236.801544 93.642992) (xy 236.801546 93.642991) (xy 236.843544 93.59033) - (xy 236.903613 93.486288) (xy 236.95418 93.438073) (xy 237.022787 93.424849) (xy 237.087651 93.450817) - (xy 237.12818 93.507731) (xy 237.135 93.548288) (xy 237.135 93.877844) (xy 237.141401 93.937372) - (xy 237.141403 93.937379) (xy 237.191645 94.072086) (xy 237.191649 94.072093) (xy 237.277809 94.187187) - (xy 237.277812 94.18719) (xy 237.392906 94.27335) (xy 237.392913 94.273354) (xy 237.52762 94.323596) - (xy 237.527627 94.323598) (xy 237.587155 94.329999) (xy 237.587172 94.33) (xy 238.585 94.33) (xy 238.585 93.39236) - (xy 238.601649 93.399257) (xy 238.756207 93.43) (xy 238.913793 93.43) (xy 239.068351 93.399257) - (xy 239.085 93.39236) (xy 239.085 94.33) (xy 240.082828 94.33) (xy 240.082844 94.329999) (xy 240.142372 94.323598) - (xy 240.142379 94.323596) (xy 240.277086 94.273354) (xy 240.277093 94.27335) (xy 240.392187 94.18719) - (xy 240.39219 94.187187) (xy 240.47835 94.072093) (xy 240.478354 94.072086) (xy 240.528596 93.937379) - (xy 240.528598 93.937372) (xy 240.534999 93.877844) (xy 240.535 93.877827) (xy 240.535 92.88) (xy 239.597361 92.88) - (xy 239.604257 92.863351) (xy 239.635 92.708793) (xy 239.635 92.551207) (xy 239.604257 92.396649) - (xy 239.597361 92.38) (xy 240.535 92.38) (xy 240.535 91.382172) (xy 240.534999 91.382155) (xy 240.528598 91.322627) - (xy 240.528596 91.32262) (xy 240.478354 91.187913) (xy 240.47835 91.187906) (xy 240.39219 91.072812) - (xy 240.392187 91.072809) (xy 240.277093 90.986649) (xy 240.277086 90.986645) (xy 240.142379 90.936403) - (xy 240.142372 90.936401) (xy 240.082844 90.93) (xy 239.085 90.93) (xy 239.085 91.867639) (xy 239.068351 91.860743) - (xy 238.913793 91.83) (xy 238.756207 91.83) (xy 238.601649 91.860743) (xy 238.585 91.867639) (xy 238.585 90.93) - (xy 237.587155 90.93) (xy 237.527627 90.936401) (xy 237.52762 90.936403) (xy 237.392913 90.986645) - (xy 237.392906 90.986649) (xy 237.277812 91.072809) (xy 237.277809 91.072812) (xy 237.191649 91.187906) - (xy 237.191645 91.187913) (xy 237.141403 91.32262) (xy 237.141401 91.322627) (xy 237.135 91.382155) - (xy 237.135 91.711711) (xy 237.115315 91.77875) (xy 237.062511 91.824505) (xy 236.993353 91.834449) - (xy 236.929797 91.805424) (xy 236.903613 91.773712) (xy 236.843543 91.669669) (xy 236.801545 91.617006) - (xy 236.150846 92.267705) (xy 236.143951 92.251058) (xy 236.056401 92.12003) (xy 235.94497 92.008599) - (xy 235.813942 91.921049) (xy 235.797293 91.914152) (xy 236.448185 91.26326) (xy 236.287384 91.153628) - (xy 236.287376 91.153623) (xy 236.057823 91.043078) (xy 236.057825 91.043078) (xy 235.814347 90.967975) - (xy 235.814341 90.967973) (xy 235.562404 90.93) (xy 235.307595 90.93) (xy 235.055658 90.967973) - (xy 235.055652 90.967975) (xy 234.812175 91.043078) (xy 234.582622 91.153625) (xy 234.582609 91.153632) - (xy 234.421813 91.263259) (xy 235.072706 91.914152) (xy 235.056058 91.921049) (xy 234.92503 92.008599) - (xy 234.813599 92.12003) (xy 234.726049 92.251058) (xy 234.719152 92.267706) (xy 234.068452 91.617006) - (xy 234.026457 91.669667) (xy 233.899058 91.890328) (xy 233.805973 92.127505) (xy 233.805968 92.127522) - (xy 233.749273 92.37592) (xy 233.730233 92.629995) (xy 228.3 92.629995) (xy 228.3 87.005205) (xy 228.300596 86.993058) - (xy 228.317997 86.816279) (xy 228.322734 86.79245) (xy 228.328328 86.773998) (xy 228.372497 86.628306) - (xy 228.381784 86.605871) (xy 228.462598 86.454577) (xy 228.476076 86.43439) (xy 228.584846 86.301749) - (xy 228.602008 86.284573) (xy 228.668274 86.230135) (xy 228.734537 86.1757) (xy 228.754729 86.162192) - (xy 228.90594 86.081249) (xy 228.928373 86.071938) (xy 229.092476 86.022028) (xy 229.116288 86.017273) - (xy 229.293066 85.999713) (xy 229.305189 85.999107) (xy 249.823024 85.980893) + (xy 249.83517 85.981479) (xy 250.012167 85.998764) (xy 250.036021 86.003489) (xy 250.200374 86.053216) + (xy 250.222848 86.062507) (xy 250.374332 86.143358) (xy 250.394557 86.156856) (xy 250.527345 86.265722) + (xy 250.544543 86.282904) (xy 250.552277 86.29232) (xy 250.65353 86.4156) (xy 250.667049 86.435818) + (xy 250.74803 86.587221) (xy 250.757343 86.60969) (xy 250.807215 86.773998) (xy 250.811962 86.797852) + (xy 250.829402 86.974819) (xy 250.83 86.98698) (xy 250.83 90.93574) (xy 250.810315 91.002779) (xy 250.757511 91.048534) + (xy 250.688353 91.058478) (xy 250.631689 91.035006) (xy 250.567093 90.986649) (xy 250.567086 90.986645) + (xy 250.432379 90.936403) (xy 250.432372 90.936401) (xy 250.372844 90.93) (xy 249.375 90.93) (xy 249.375 91.867639) + (xy 249.358351 91.860743) (xy 249.203793 91.83) (xy 249.046207 91.83) (xy 248.891649 91.860743) + (xy 248.875 91.867639) (xy 248.875 90.93) (xy 247.877155 90.93) (xy 247.817627 90.936401) (xy 247.81762 90.936403) + (xy 247.682913 90.986645) (xy 247.682906 90.986649) (xy 247.567812 91.072809) (xy 247.567809 91.072812) + (xy 247.481649 91.187906) (xy 247.481645 91.187913) (xy 247.431403 91.32262) (xy 247.431401 91.322627) + (xy 247.425 91.382155) (xy 247.425 91.711711) (xy 247.405315 91.77875) (xy 247.352511 91.824505) + (xy 247.283353 91.834449) (xy 247.219797 91.805424) (xy 247.193613 91.773712) (xy 247.133543 91.669669) + (xy 247.091545 91.617006) (xy 246.440846 92.267705) (xy 246.433951 92.251058) (xy 246.346401 92.12003) + (xy 246.23497 92.008599) (xy 246.103942 91.921049) (xy 246.087293 91.914152) (xy 246.738185 91.26326) + (xy 246.577384 91.153628) (xy 246.577376 91.153623) (xy 246.347823 91.043078) (xy 246.347825 91.043078) + (xy 246.104347 90.967975) (xy 246.104341 90.967973) (xy 245.852404 90.93) (xy 245.597595 90.93) + (xy 245.345658 90.967973) (xy 245.345652 90.967975) (xy 245.102175 91.043078) (xy 244.872622 91.153625) + (xy 244.872609 91.153632) (xy 244.711813 91.263259) (xy 245.362706 91.914152) (xy 245.346058 91.921049) + (xy 245.21503 92.008599) (xy 245.103599 92.12003) (xy 245.016049 92.251058) (xy 245.009152 92.267706) + (xy 244.358452 91.617006) (xy 244.316457 91.669667) (xy 244.189058 91.890328) (xy 244.095973 92.127505) + (xy 244.095968 92.127522) (xy 244.039273 92.37592) (xy 244.020233 92.629995) (xy 244.020233 92.630004) + (xy 244.039273 92.884079) (xy 244.095968 93.132477) (xy 244.095973 93.132494) (xy 244.189058 93.369671) + (xy 244.189057 93.369671) (xy 244.316454 93.590327) (xy 244.316461 93.590338) (xy 244.358452 93.642991) + (xy 244.358453 93.642992) (xy 245.009152 92.992292) (xy 245.016049 93.008942) (xy 245.103599 93.13997) + (xy 245.21503 93.251401) (xy 245.346058 93.338951) (xy 245.362705 93.345846) (xy 244.711813 93.996738) + (xy 244.872616 94.106371) (xy 244.872624 94.106376) (xy 245.102176 94.216921) (xy 245.102174 94.216921) + (xy 245.345652 94.292024) (xy 245.345658 94.292026) (xy 245.597595 94.329999) (xy 245.597604 94.33) + (xy 245.852396 94.33) (xy 245.852404 94.329999) (xy 246.104341 94.292026) (xy 246.104347 94.292024) + (xy 246.347824 94.216921) (xy 246.577376 94.106376) (xy 246.577377 94.106375) (xy 246.738185 93.996738) + (xy 246.087294 93.345846) (xy 246.103942 93.338951) (xy 246.23497 93.251401) (xy 246.346401 93.13997) + (xy 246.433951 93.008942) (xy 246.440846 92.992294) (xy 247.091544 93.642992) (xy 247.091546 93.642991) + (xy 247.133544 93.59033) (xy 247.193613 93.486288) (xy 247.24418 93.438073) (xy 247.312787 93.424849) + (xy 247.377651 93.450817) (xy 247.41818 93.507731) (xy 247.425 93.548288) (xy 247.425 93.877844) + (xy 247.431401 93.937372) (xy 247.431403 93.937379) (xy 247.481645 94.072086) (xy 247.481649 94.072093) + (xy 247.567809 94.187187) (xy 247.567812 94.18719) (xy 247.682906 94.27335) (xy 247.682913 94.273354) + (xy 247.81762 94.323596) (xy 247.817627 94.323598) (xy 247.877155 94.329999) (xy 247.877172 94.33) + (xy 248.875 94.33) (xy 248.875 93.39236) (xy 248.891649 93.399257) (xy 249.046207 93.43) (xy 249.203793 93.43) + (xy 249.358351 93.399257) (xy 249.375 93.39236) (xy 249.375 94.33) (xy 250.372828 94.33) (xy 250.372844 94.329999) + (xy 250.432372 94.323598) (xy 250.432379 94.323596) (xy 250.567086 94.273354) (xy 250.567089 94.273352) + (xy 250.631688 94.224993) (xy 250.697152 94.200575) (xy 250.765425 94.215426) (xy 250.814831 94.26483) + (xy 250.83 94.324259) (xy 250.83 94.780211) (xy 250.850526 94.981773) (xy 250.911262 95.175072) + (xy 250.911264 95.175075) (xy 251.009717 95.35216) (xy 251.141842 95.505763) (xy 251.141848 95.505769) + (xy 258.117684 102.121929) (xy 258.117689 102.121934) (xy 258.117694 102.121938) (xy 258.203861 102.194879) + (xy 258.203868 102.194884) (xy 258.203876 102.19489) (xy 258.297684 102.257633) (xy 258.297713 102.257651) + (xy 262.731777 104.873748) (xy 267.702597 107.806532) (xy 267.713316 107.81363) (xy 267.864338 107.925325) + (xy 267.883298 107.942657) (xy 268.003756 108.078229) (xy 268.018737 108.099096) (xy 268.10867 108.256577) + (xy 268.11903 108.280085) (xy 268.174581 108.452717) (xy 268.179875 108.477855) (xy 268.199333 108.664671) + (xy 268.2 108.677517) (xy 268.2 116.293907) (xy 268.199403 116.306061) (xy 268.181982 116.482934) + (xy 268.17724 116.506775) (xy 268.127424 116.670998) (xy 268.118121 116.693456) (xy 268.037227 116.844798) + (xy 268.023722 116.86501) (xy 267.914854 116.997666) (xy 267.897666 117.014854) (xy 267.76501 117.123722) + (xy 267.744798 117.137227) (xy 267.593456 117.218121) (xy 267.570998 117.227424) (xy 267.406775 117.27724) + (xy 267.382934 117.281982) (xy 267.206061 117.299403) (xy 267.193907 117.3) (xy 266.05156 117.3) + (xy 266.039731 117.299434) (xy 266.012509 117.296825) (xy 265.867525 117.282929) (xy 265.844296 117.278435) + (xy 265.684073 117.231206) (xy 265.66212 117.222382) (xy 265.587139 117.18356) (xy 265.536656 117.135256) + (xy 265.520576 117.083686) (xy 265.51139 116.972824) (xy 265.45543 116.751845) (xy 265.444129 116.726082) + (xy 265.363862 116.543091) (xy 265.239185 116.352257) (xy 265.084791 116.184541) (xy 265.084787 116.184538) + (xy 264.904909 116.044533) (xy 264.9049 116.044527) (xy 264.84654 116.012945) (xy 264.796949 115.963726) + (xy 264.792553 115.95494) (xy 262.784845 111.509299) (xy 262.784843 111.509296) (xy 262.784842 111.509293) + (xy 262.678398 111.327508) (xy 262.536231 111.172051) (xy 262.536227 111.172048) (xy 262.536225 111.172046) + (xy 262.364653 111.049827) (xy 262.364651 111.049826) (xy 262.171278 110.966258) (xy 243.104845 105.018421) + (xy 229.008459 100.621006) (xy 228.996176 100.616449) (xy 228.820598 100.540536) (xy 228.797812 100.527677) + (xy 228.647432 100.420436) (xy 228.62785 100.403081) (xy 228.503323 100.266674) (xy 228.487826 100.245607) + (xy 228.39469 100.086102) (xy 228.383955 100.062243) (xy 228.326361 99.886748) (xy 228.320874 99.861177) + (xy 228.300692 99.670947) (xy 228.3 99.657865) (xy 228.3 92.629995) (xy 233.730233 92.629995) (xy 233.730233 92.630004) + (xy 233.749273 92.884079) (xy 233.805968 93.132477) (xy 233.805973 93.132494) (xy 233.899058 93.369671) + (xy 233.899057 93.369671) (xy 234.026454 93.590327) (xy 234.026461 93.590338) (xy 234.068452 93.642991) + (xy 234.068453 93.642992) (xy 234.719152 92.992292) (xy 234.726049 93.008942) (xy 234.813599 93.13997) + (xy 234.92503 93.251401) (xy 235.056058 93.338951) (xy 235.072705 93.345846) (xy 234.421813 93.996738) + (xy 234.582616 94.106371) (xy 234.582624 94.106376) (xy 234.812176 94.216921) (xy 234.812174 94.216921) + (xy 235.055652 94.292024) (xy 235.055658 94.292026) (xy 235.307595 94.329999) (xy 235.307604 94.33) + (xy 235.562396 94.33) (xy 235.562404 94.329999) (xy 235.814341 94.292026) (xy 235.814347 94.292024) + (xy 236.057824 94.216921) (xy 236.287376 94.106376) (xy 236.287377 94.106375) (xy 236.448185 93.996738) + (xy 235.797294 93.345846) (xy 235.813942 93.338951) (xy 235.94497 93.251401) (xy 236.056401 93.13997) + (xy 236.143951 93.008942) (xy 236.150846 92.992294) (xy 236.801544 93.642992) (xy 236.801546 93.642991) + (xy 236.843544 93.59033) (xy 236.903613 93.486288) (xy 236.95418 93.438073) (xy 237.022787 93.424849) + (xy 237.087651 93.450817) (xy 237.12818 93.507731) (xy 237.135 93.548288) (xy 237.135 93.877844) + (xy 237.141401 93.937372) (xy 237.141403 93.937379) (xy 237.191645 94.072086) (xy 237.191649 94.072093) + (xy 237.277809 94.187187) (xy 237.277812 94.18719) (xy 237.392906 94.27335) (xy 237.392913 94.273354) + (xy 237.52762 94.323596) (xy 237.527627 94.323598) (xy 237.587155 94.329999) (xy 237.587172 94.33) + (xy 238.585 94.33) (xy 238.585 93.39236) (xy 238.601649 93.399257) (xy 238.756207 93.43) (xy 238.913793 93.43) + (xy 239.068351 93.399257) (xy 239.085 93.39236) (xy 239.085 94.33) (xy 240.082828 94.33) (xy 240.082844 94.329999) + (xy 240.142372 94.323598) (xy 240.142379 94.323596) (xy 240.277086 94.273354) (xy 240.277093 94.27335) + (xy 240.392187 94.18719) (xy 240.39219 94.187187) (xy 240.47835 94.072093) (xy 240.478354 94.072086) + (xy 240.528596 93.937379) (xy 240.528598 93.937372) (xy 240.534999 93.877844) (xy 240.535 93.877827) + (xy 240.535 92.88) (xy 239.597361 92.88) (xy 239.604257 92.863351) (xy 239.635 92.708793) (xy 239.635 92.551207) + (xy 239.604257 92.396649) (xy 239.597361 92.38) (xy 240.535 92.38) (xy 240.535 91.382172) (xy 240.534999 91.382155) + (xy 240.528598 91.322627) (xy 240.528596 91.32262) (xy 240.478354 91.187913) (xy 240.47835 91.187906) + (xy 240.39219 91.072812) (xy 240.392187 91.072809) (xy 240.277093 90.986649) (xy 240.277086 90.986645) + (xy 240.142379 90.936403) (xy 240.142372 90.936401) (xy 240.082844 90.93) (xy 239.085 90.93) (xy 239.085 91.867639) + (xy 239.068351 91.860743) (xy 238.913793 91.83) (xy 238.756207 91.83) (xy 238.601649 91.860743) + (xy 238.585 91.867639) (xy 238.585 90.93) (xy 237.587155 90.93) (xy 237.527627 90.936401) (xy 237.52762 90.936403) + (xy 237.392913 90.986645) (xy 237.392906 90.986649) (xy 237.277812 91.072809) (xy 237.277809 91.072812) + (xy 237.191649 91.187906) (xy 237.191645 91.187913) (xy 237.141403 91.32262) (xy 237.141401 91.322627) + (xy 237.135 91.382155) (xy 237.135 91.711711) (xy 237.115315 91.77875) (xy 237.062511 91.824505) + (xy 236.993353 91.834449) (xy 236.929797 91.805424) (xy 236.903613 91.773712) (xy 236.843543 91.669669) + (xy 236.801545 91.617006) (xy 236.150846 92.267705) (xy 236.143951 92.251058) (xy 236.056401 92.12003) + (xy 235.94497 92.008599) (xy 235.813942 91.921049) (xy 235.797293 91.914152) (xy 236.448185 91.26326) + (xy 236.287384 91.153628) (xy 236.287376 91.153623) (xy 236.057823 91.043078) (xy 236.057825 91.043078) + (xy 235.814347 90.967975) (xy 235.814341 90.967973) (xy 235.562404 90.93) (xy 235.307595 90.93) + (xy 235.055658 90.967973) (xy 235.055652 90.967975) (xy 234.812175 91.043078) (xy 234.582622 91.153625) + (xy 234.582609 91.153632) (xy 234.421813 91.263259) (xy 235.072706 91.914152) (xy 235.056058 91.921049) + (xy 234.92503 92.008599) (xy 234.813599 92.12003) (xy 234.726049 92.251058) (xy 234.719152 92.267706) + (xy 234.068452 91.617006) (xy 234.026457 91.669667) (xy 233.899058 91.890328) (xy 233.805973 92.127505) + (xy 233.805968 92.127522) (xy 233.749273 92.37592) (xy 233.730233 92.629995) (xy 228.3 92.629995) + (xy 228.3 87.005205) (xy 228.300596 86.993058) (xy 228.317997 86.816279) (xy 228.322734 86.79245) + (xy 228.328328 86.773998) (xy 228.372497 86.628306) (xy 228.381784 86.605871) (xy 228.462598 86.454577) + (xy 228.476076 86.43439) (xy 228.584846 86.301749) (xy 228.602008 86.284573) (xy 228.668274 86.230135) + (xy 228.734537 86.1757) (xy 228.754729 86.162192) (xy 228.90594 86.081249) (xy 228.928373 86.071938) + (xy 229.092476 86.022028) (xy 229.116288 86.017273) (xy 229.293068 85.999713) (xy 229.305189 85.999107) + (xy 249.823024 85.980893) ) ) ) @@ -156191,17 +160282,24 @@ (xy 243.199164 202.204306) (xy 243.238498 202.26205) (xy 243.2445 202.30016) (xy 243.2445 212.949839) (xy 243.224815 213.016878) (xy 243.199164 213.045693) (xy 243.165009 213.073723) (xy 243.144798 213.087227) (xy 242.993456 213.168121) (xy 242.970998 213.177424) (xy 242.806775 213.22724) (xy 242.782934 213.231982) - (xy 242.606061 213.249403) (xy 242.593907 213.25) (xy 237.5 213.25) (xy 237.5 214.25) (xy 237.5 214.250003) - (xy 237.5 215.243907) (xy 237.499403 215.256061) (xy 237.481982 215.432934) (xy 237.47724 215.456775) - (xy 237.427424 215.620998) (xy 237.418121 215.643456) (xy 237.337227 215.794798) (xy 237.323722 215.81501) - (xy 237.214854 215.947666) (xy 237.197666 215.964854) (xy 237.06501 216.073722) (xy 237.044798 216.087227) - (xy 236.893456 216.168121) (xy 236.870998 216.177424) (xy 236.706775 216.22724) (xy 236.682934 216.231982) - (xy 236.506061 216.249403) (xy 236.493907 216.25) (xy 232.006093 216.25) (xy 231.993939 216.249403) - (xy 231.817065 216.231982) (xy 231.793224 216.22724) (xy 231.629001 216.177424) (xy 231.606543 216.168121) - (xy 231.455201 216.087227) (xy 231.434989 216.073722) (xy 231.302333 215.964854) (xy 231.285145 215.947666) - (xy 231.176277 215.81501) (xy 231.162772 215.794798) (xy 231.081878 215.643456) (xy 231.072575 215.620998) - (xy 231.022757 215.456769) (xy 231.018018 215.432941) (xy 231.000597 215.256061) (xy 231 215.243907) - (xy 231 214.250003) (xy 231 214.25) (xy 231 213.25) (xy 230 213.25) (xy 229.999997 213.25) (xy 219.006093 213.25) + (xy 242.606061 213.249403) (xy 242.593907 213.25) (xy 238.5 213.25) (xy 238.451844 213.254743) (xy 238.304911 213.269214) + (xy 238.194149 213.302813) (xy 238.117317 213.32612) (xy 238.117314 213.326121) (xy 238.117312 213.326122) + (xy 238.117309 213.326123) (xy 237.944435 213.418526) (xy 237.944428 213.418531) (xy 237.792892 213.542892) + (xy 237.668531 213.694428) (xy 237.668526 213.694435) (xy 237.576123 213.867309) (xy 237.576122 213.867312) + (xy 237.519214 214.054911) (xy 237.5 214.250003) (xy 237.5 215.243907) (xy 237.499403 215.256061) + (xy 237.481982 215.432934) (xy 237.47724 215.456775) (xy 237.427424 215.620998) (xy 237.418121 215.643456) + (xy 237.337227 215.794798) (xy 237.323722 215.81501) (xy 237.214854 215.947666) (xy 237.197666 215.964854) + (xy 237.06501 216.073722) (xy 237.044798 216.087227) (xy 236.893456 216.168121) (xy 236.870998 216.177424) + (xy 236.706775 216.22724) (xy 236.682934 216.231982) (xy 236.506061 216.249403) (xy 236.493907 216.25) + (xy 232.006093 216.25) (xy 231.993939 216.249403) (xy 231.817065 216.231982) (xy 231.793224 216.22724) + (xy 231.629001 216.177424) (xy 231.606543 216.168121) (xy 231.455201 216.087227) (xy 231.434989 216.073722) + (xy 231.302333 215.964854) (xy 231.285145 215.947666) (xy 231.176277 215.81501) (xy 231.162772 215.794798) + (xy 231.081878 215.643456) (xy 231.072575 215.620998) (xy 231.022757 215.456769) (xy 231.018018 215.432941) + (xy 231.000597 215.256061) (xy 231 215.243907) (xy 231 214.250003) (xy 230.980785 214.054911) (xy 230.980785 214.05491) + (xy 230.92388 213.867317) (xy 230.83147 213.69443) (xy 230.793648 213.648344) (xy 230.707107 213.542892) + (xy 230.555571 213.418531) (xy 230.555564 213.418526) (xy 230.38269 213.326123) (xy 230.382687 213.326122) + (xy 230.382686 213.326121) (xy 230.382683 213.32612) (xy 230.19509 213.269215) (xy 230.195088 213.269214) + (xy 230.19509 213.269214) (xy 230.044494 213.254382) (xy 230 213.25) (xy 229.999997 213.25) (xy 219.006093 213.25) (xy 218.993939 213.249403) (xy 218.817065 213.231982) (xy 218.793224 213.22724) (xy 218.629001 213.177424) (xy 218.606543 213.168121) (xy 218.455201 213.087227) (xy 218.434989 213.073722) (xy 218.302333 212.964854) (xy 218.285145 212.947666) (xy 218.176277 212.81501) (xy 218.162772 212.794798) (xy 218.081878 212.643456) @@ -156226,63 +160324,69 @@ (xy 223.007975 210.236252) (xy 223.03278 210.232573) (xy 223.05662 210.227831) (xy 223.080942 210.221738) (xy 223.245165 210.171922) (xy 223.268779 210.163473) (xy 223.291237 210.15417) (xy 223.313898 210.143452) (xy 223.46524 210.062558) (xy 223.486745 210.049669) (xy 223.506957 210.036164) (xy 223.522813 210.024403) - (xy 223.588385 210.000278) (xy 223.596682 210) (xy 225.249997 210) (xy 225.25 210) (xy 226.25 210) - (xy 226.25 208.819995) (xy 235.620233 208.819995) (xy 235.620233 208.820004) (xy 235.639273 209.074079) - (xy 235.695968 209.322477) (xy 235.695973 209.322494) (xy 235.789058 209.559671) (xy 235.789057 209.559671) - (xy 235.916454 209.780327) (xy 235.916461 209.780338) (xy 235.958452 209.832991) (xy 235.958453 209.832992) - (xy 236.609152 209.182292) (xy 236.616049 209.198942) (xy 236.703599 209.32997) (xy 236.81503 209.441401) - (xy 236.946058 209.528951) (xy 236.962705 209.535846) (xy 236.311813 210.186738) (xy 236.472616 210.296371) - (xy 236.472624 210.296376) (xy 236.702176 210.406921) (xy 236.702174 210.406921) (xy 236.945652 210.482024) - (xy 236.945658 210.482026) (xy 237.197595 210.519999) (xy 237.197604 210.52) (xy 237.452396 210.52) - (xy 237.452404 210.519999) (xy 237.704341 210.482026) (xy 237.704347 210.482024) (xy 237.947824 210.406921) - (xy 238.177376 210.296376) (xy 238.177377 210.296375) (xy 238.338185 210.186738) (xy 237.687294 209.535846) - (xy 237.703942 209.528951) (xy 237.83497 209.441401) (xy 237.946401 209.32997) (xy 238.033951 209.198942) - (xy 238.040846 209.182294) (xy 238.691544 209.832992) (xy 238.691546 209.832991) (xy 238.733544 209.78033) - (xy 238.860941 209.559671) (xy 238.909572 209.435763) (xy 238.952387 209.380549) (xy 239.018257 209.357248) - (xy 239.086268 209.373259) (xy 239.134827 209.423496) (xy 239.140428 209.435763) (xy 239.189058 209.559671) - (xy 239.316454 209.780327) (xy 239.316461 209.780338) (xy 239.358452 209.832991) (xy 239.358453 209.832992) - (xy 240.009152 209.182292) (xy 240.016049 209.198942) (xy 240.103599 209.32997) (xy 240.21503 209.441401) - (xy 240.346058 209.528951) (xy 240.362705 209.535846) (xy 239.711813 210.186738) (xy 239.872616 210.296371) - (xy 239.872624 210.296376) (xy 240.102176 210.406921) (xy 240.102174 210.406921) (xy 240.345652 210.482024) - (xy 240.345658 210.482026) (xy 240.597595 210.519999) (xy 240.597604 210.52) (xy 240.852396 210.52) - (xy 240.852404 210.519999) (xy 241.104341 210.482026) (xy 241.104347 210.482024) (xy 241.347824 210.406921) - (xy 241.577376 210.296376) (xy 241.577377 210.296375) (xy 241.738185 210.186738) (xy 241.087294 209.535846) - (xy 241.103942 209.528951) (xy 241.23497 209.441401) (xy 241.346401 209.32997) (xy 241.433951 209.198942) - (xy 241.440846 209.182294) (xy 242.091544 209.832992) (xy 242.091546 209.832991) (xy 242.133544 209.78033) - (xy 242.260941 209.559671) (xy 242.354026 209.322494) (xy 242.354031 209.322477) (xy 242.410726 209.074079) - (xy 242.429767 208.820004) (xy 242.429767 208.819995) (xy 242.410726 208.56592) (xy 242.354031 208.317522) - (xy 242.354026 208.317505) (xy 242.260941 208.080328) (xy 242.260942 208.080328) (xy 242.133545 207.859672) - (xy 242.091545 207.807006) (xy 241.440846 208.457705) (xy 241.433951 208.441058) (xy 241.346401 208.31003) - (xy 241.23497 208.198599) (xy 241.103942 208.111049) (xy 241.087293 208.104152) (xy 241.738185 207.45326) - (xy 241.577384 207.343628) (xy 241.577376 207.343623) (xy 241.347823 207.233078) (xy 241.347825 207.233078) - (xy 241.104347 207.157975) (xy 241.104341 207.157973) (xy 240.852404 207.12) (xy 240.597595 207.12) - (xy 240.345658 207.157973) (xy 240.345652 207.157975) (xy 240.102175 207.233078) (xy 239.872622 207.343625) - (xy 239.872609 207.343632) (xy 239.711813 207.453259) (xy 240.362706 208.104152) (xy 240.346058 208.111049) - (xy 240.21503 208.198599) (xy 240.103599 208.31003) (xy 240.016049 208.441058) (xy 240.009152 208.457706) - (xy 239.358452 207.807006) (xy 239.316457 207.859667) (xy 239.189058 208.080328) (xy 239.140428 208.204236) - (xy 239.097612 208.25945) (xy 239.031742 208.282751) (xy 238.963732 208.26674) (xy 238.915173 208.216502) - (xy 238.909572 208.204236) (xy 238.860941 208.080328) (xy 238.860942 208.080328) (xy 238.733545 207.859672) - (xy 238.691545 207.807006) (xy 238.040846 208.457705) (xy 238.033951 208.441058) (xy 237.946401 208.31003) - (xy 237.83497 208.198599) (xy 237.703942 208.111049) (xy 237.687293 208.104152) (xy 238.338185 207.45326) - (xy 238.177384 207.343628) (xy 238.177376 207.343623) (xy 237.947823 207.233078) (xy 237.947825 207.233078) - (xy 237.704347 207.157975) (xy 237.704341 207.157973) (xy 237.452404 207.12) (xy 237.197595 207.12) - (xy 236.945658 207.157973) (xy 236.945652 207.157975) (xy 236.702175 207.233078) (xy 236.472622 207.343625) - (xy 236.472609 207.343632) (xy 236.311813 207.453259) (xy 236.962706 208.104152) (xy 236.946058 208.111049) - (xy 236.81503 208.198599) (xy 236.703599 208.31003) (xy 236.616049 208.441058) (xy 236.609152 208.457706) - (xy 235.958452 207.807006) (xy 235.916457 207.859667) (xy 235.789058 208.080328) (xy 235.695973 208.317505) - (xy 235.695968 208.317522) (xy 235.639273 208.56592) (xy 235.620233 208.819995) (xy 226.25 208.819995) - (xy 226.25 208.756092) (xy 226.250597 208.743938) (xy 226.268018 208.567056) (xy 226.272757 208.543232) - (xy 226.310592 208.418503) (xy 226.34889 208.360066) (xy 226.412702 208.33161) (xy 226.429253 208.3305) - (xy 226.538985 208.3305) (xy 226.692365 208.292696) (xy 226.755709 208.25945) (xy 226.83224 208.219283) - (xy 226.950483 208.11453) (xy 227.04022 207.984523) (xy 227.096237 207.836818) (xy 227.096237 207.836814) - (xy 227.097207 207.834258) (xy 227.139385 207.778556) (xy 227.200995 207.754826) (xy 227.229434 207.752025) - (xy 227.243941 207.750597) (xy 227.256093 207.75) (xy 229.146444 207.75) (xy 229.146447 207.75) - (xy 229.5 207.75) (xy 229.75 207.5) (xy 229.869906 207.401596) (xy 229.89011 207.388095) (xy 230.016149 207.320726) - (xy 230.038587 207.311431) (xy 230.175357 207.269942) (xy 230.199179 207.265204) (xy 230.347492 207.250597) - (xy 230.359646 207.25) (xy 230.390354 207.25) (xy 230.402508 207.250597) (xy 230.550818 207.265204) - (xy 230.574644 207.269943) (xy 230.711409 207.31143) (xy 230.733853 207.320728) (xy 230.859883 207.388092) - (xy 230.880093 207.401596) (xy 231 207.5) (xy 231.25 207.75) (xy 233.249997 207.75) (xy 233.25 207.75) - (xy 234.25 207.75) (xy 234.25 203.006092) (xy 234.250597 202.993938) (xy 234.268018 202.817056) + (xy 223.588385 210.000278) (xy 223.596682 210) (xy 225.249997 210) (xy 225.25 210) (xy 225.44509 209.980785) + (xy 225.632683 209.92388) (xy 225.80557 209.83147) (xy 225.957107 209.707107) (xy 226.08147 209.55557) + (xy 226.17388 209.382683) (xy 226.230785 209.19509) (xy 226.25 209) (xy 226.25 208.819995) (xy 235.620233 208.819995) + (xy 235.620233 208.820004) (xy 235.639273 209.074079) (xy 235.695968 209.322477) (xy 235.695973 209.322494) + (xy 235.789058 209.559671) (xy 235.789057 209.559671) (xy 235.916454 209.780327) (xy 235.916461 209.780338) + (xy 235.958452 209.832991) (xy 235.958453 209.832992) (xy 236.609152 209.182292) (xy 236.616049 209.198942) + (xy 236.703599 209.32997) (xy 236.81503 209.441401) (xy 236.946058 209.528951) (xy 236.962705 209.535846) + (xy 236.311813 210.186738) (xy 236.472616 210.296371) (xy 236.472624 210.296376) (xy 236.702176 210.406921) + (xy 236.702174 210.406921) (xy 236.945652 210.482024) (xy 236.945658 210.482026) (xy 237.197595 210.519999) + (xy 237.197604 210.52) (xy 237.452396 210.52) (xy 237.452404 210.519999) (xy 237.704341 210.482026) + (xy 237.704347 210.482024) (xy 237.947824 210.406921) (xy 238.177376 210.296376) (xy 238.177377 210.296375) + (xy 238.338185 210.186738) (xy 237.687294 209.535846) (xy 237.703942 209.528951) (xy 237.83497 209.441401) + (xy 237.946401 209.32997) (xy 238.033951 209.198942) (xy 238.040846 209.182294) (xy 238.691544 209.832992) + (xy 238.691546 209.832991) (xy 238.733544 209.78033) (xy 238.860941 209.559671) (xy 238.909572 209.435763) + (xy 238.952387 209.380549) (xy 239.018257 209.357248) (xy 239.086268 209.373259) (xy 239.134827 209.423496) + (xy 239.140428 209.435763) (xy 239.189058 209.559671) (xy 239.316454 209.780327) (xy 239.316461 209.780338) + (xy 239.358452 209.832991) (xy 239.358453 209.832992) (xy 240.009152 209.182292) (xy 240.016049 209.198942) + (xy 240.103599 209.32997) (xy 240.21503 209.441401) (xy 240.346058 209.528951) (xy 240.362705 209.535846) + (xy 239.711813 210.186738) (xy 239.872616 210.296371) (xy 239.872624 210.296376) (xy 240.102176 210.406921) + (xy 240.102174 210.406921) (xy 240.345652 210.482024) (xy 240.345658 210.482026) (xy 240.597595 210.519999) + (xy 240.597604 210.52) (xy 240.852396 210.52) (xy 240.852404 210.519999) (xy 241.104341 210.482026) + (xy 241.104347 210.482024) (xy 241.347824 210.406921) (xy 241.577376 210.296376) (xy 241.577377 210.296375) + (xy 241.738185 210.186738) (xy 241.087294 209.535846) (xy 241.103942 209.528951) (xy 241.23497 209.441401) + (xy 241.346401 209.32997) (xy 241.433951 209.198942) (xy 241.440846 209.182294) (xy 242.091544 209.832992) + (xy 242.091546 209.832991) (xy 242.133544 209.78033) (xy 242.260941 209.559671) (xy 242.354026 209.322494) + (xy 242.354031 209.322477) (xy 242.410726 209.074079) (xy 242.429767 208.820004) (xy 242.429767 208.819995) + (xy 242.410726 208.56592) (xy 242.354031 208.317522) (xy 242.354026 208.317505) (xy 242.260941 208.080328) + (xy 242.260942 208.080328) (xy 242.133545 207.859672) (xy 242.091545 207.807006) (xy 241.440846 208.457705) + (xy 241.433951 208.441058) (xy 241.346401 208.31003) (xy 241.23497 208.198599) (xy 241.103942 208.111049) + (xy 241.087293 208.104152) (xy 241.738185 207.45326) (xy 241.577384 207.343628) (xy 241.577376 207.343623) + (xy 241.347823 207.233078) (xy 241.347825 207.233078) (xy 241.104347 207.157975) (xy 241.104341 207.157973) + (xy 240.852404 207.12) (xy 240.597595 207.12) (xy 240.345658 207.157973) (xy 240.345652 207.157975) + (xy 240.102175 207.233078) (xy 239.872622 207.343625) (xy 239.872609 207.343632) (xy 239.711813 207.453259) + (xy 240.362706 208.104152) (xy 240.346058 208.111049) (xy 240.21503 208.198599) (xy 240.103599 208.31003) + (xy 240.016049 208.441058) (xy 240.009152 208.457706) (xy 239.358452 207.807006) (xy 239.316457 207.859667) + (xy 239.189058 208.080328) (xy 239.140428 208.204236) (xy 239.097612 208.25945) (xy 239.031742 208.282751) + (xy 238.963732 208.26674) (xy 238.915173 208.216502) (xy 238.909572 208.204236) (xy 238.860941 208.080328) + (xy 238.860942 208.080328) (xy 238.733545 207.859672) (xy 238.691545 207.807006) (xy 238.040846 208.457705) + (xy 238.033951 208.441058) (xy 237.946401 208.31003) (xy 237.83497 208.198599) (xy 237.703942 208.111049) + (xy 237.687293 208.104152) (xy 238.338185 207.45326) (xy 238.177384 207.343628) (xy 238.177376 207.343623) + (xy 237.947823 207.233078) (xy 237.947825 207.233078) (xy 237.704347 207.157975) (xy 237.704341 207.157973) + (xy 237.452404 207.12) (xy 237.197595 207.12) (xy 236.945658 207.157973) (xy 236.945652 207.157975) + (xy 236.702175 207.233078) (xy 236.472622 207.343625) (xy 236.472609 207.343632) (xy 236.311813 207.453259) + (xy 236.962706 208.104152) (xy 236.946058 208.111049) (xy 236.81503 208.198599) (xy 236.703599 208.31003) + (xy 236.616049 208.441058) (xy 236.609152 208.457706) (xy 235.958452 207.807006) (xy 235.916457 207.859667) + (xy 235.789058 208.080328) (xy 235.695973 208.317505) (xy 235.695968 208.317522) (xy 235.639273 208.56592) + (xy 235.620233 208.819995) (xy 226.25 208.819995) (xy 226.25 208.756092) (xy 226.250597 208.743938) + (xy 226.268018 208.567056) (xy 226.272757 208.543232) (xy 226.310592 208.418503) (xy 226.34889 208.360066) + (xy 226.412702 208.33161) (xy 226.429253 208.3305) (xy 226.538985 208.3305) (xy 226.692365 208.292696) + (xy 226.755709 208.25945) (xy 226.83224 208.219283) (xy 226.950483 208.11453) (xy 227.04022 207.984523) + (xy 227.096237 207.836818) (xy 227.096237 207.836814) (xy 227.097207 207.834258) (xy 227.139385 207.778556) + (xy 227.200995 207.754826) (xy 227.229434 207.752025) (xy 227.243941 207.750597) (xy 227.256093 207.75) + (xy 229.146444 207.75) (xy 229.146447 207.75) (xy 229.312967 207.733599) (xy 229.473087 207.685027) + (xy 229.620655 207.60615) (xy 229.75 207.5) (xy 229.869906 207.401596) (xy 229.89011 207.388095) + (xy 230.016149 207.320726) (xy 230.038587 207.311431) (xy 230.175357 207.269942) (xy 230.199179 207.265204) + (xy 230.347492 207.250597) (xy 230.359646 207.25) (xy 230.390354 207.25) (xy 230.402508 207.250597) + (xy 230.550818 207.265204) (xy 230.574644 207.269943) (xy 230.711409 207.31143) (xy 230.733853 207.320728) + (xy 230.859883 207.388092) (xy 230.880093 207.401596) (xy 230.947734 207.457107) (xy 231 207.5) + (xy 231.129345 207.60615) (xy 231.129348 207.606151) (xy 231.12935 207.606153) (xy 231.256058 207.67388) + (xy 231.276913 207.685027) (xy 231.437033 207.733599) (xy 231.603553 207.75) (xy 233.249997 207.75) + (xy 233.25 207.75) (xy 233.44509 207.730785) (xy 233.632683 207.67388) (xy 233.80557 207.58147) + (xy 233.957107 207.457107) (xy 234.08147 207.30557) (xy 234.17388 207.132683) (xy 234.230785 206.94509) + (xy 234.25 206.75) (xy 234.25 203.006092) (xy 234.250597 202.993938) (xy 234.268018 202.817056) (xy 234.272757 202.793232) (xy 234.322577 202.628994) (xy 234.331875 202.606549) (xy 234.412775 202.455195) (xy 234.426272 202.434995) (xy 234.535149 202.302328) (xy 234.552328 202.285149) (xy 234.684995 202.176272) (xy 234.705195 202.162775) (xy 234.856549 202.081875) (xy 234.878994 202.072577) (xy 235.043232 202.022757) @@ -156353,48 +160457,50 @@ (xy 247.082884 69.459236) (xy 247.017015 69.482474) (xy 247.017006 69.482478) (xy 246.975582 69.501395) (xy 246.975574 69.5014) (xy 246.900242 69.566676) (xy 246.900238 69.56668) (xy 246.857375 69.621857) (xy 246.855903 69.624146) (xy 246.854303 69.626637) (xy 246.801502 69.672393) (xy 246.749987 69.6836) - (xy 246.282723 69.6836) (xy 246.209664 69.698132) (xy 246.20966 69.698133) (xy 246.206866 69.7) - (xy 246.1 69.7) (xy 246.1 69.793606) (xy 246.071433 69.83636) (xy 246.071432 69.836364) (xy 246.0569 69.909421) - (xy 246.0569 71.348795) (xy 246.037215 71.415834) (xy 246.009303 71.445025) (xy 246.009776 71.445571) - (xy 245.952371 71.495311) (xy 245.920743 71.528088) (xy 245.874534 71.616425) (xy 245.874533 71.616425) - (xy 245.854851 71.683457) (xy 245.854848 71.683469) (xy 245.8445 71.755446) (xy 245.8445 71.755448) - (xy 245.8445 72.393907) (xy 245.844723 72.402984) (xy 245.844808 72.40645) (xy 245.845406 72.418618) - (xy 245.846325 72.431086) (xy 245.863745 72.607958) (xy 245.863751 72.608009) (xy 245.867421 72.632756) - (xy 245.867427 72.632785) (xy 245.872169 72.656627) (xy 245.878249 72.680899) (xy 245.878257 72.680928) - (xy 245.928079 72.845171) (xy 245.936523 72.868772) (xy 245.936524 72.868775) (xy 245.945826 72.891231) - (xy 245.95655 72.913905) (xy 245.956557 72.913919) (xy 246.03743 73.06522) (xy 246.037456 73.065267) - (xy 246.050331 73.086747) (xy 246.063807 73.106917) (xy 246.063853 73.106983) (xy 246.078761 73.127082) - (xy 246.078773 73.127098) (xy 246.1 73.152963) (xy 246.1 73.4) (xy 246.347037 73.4) (xy 246.372901 73.421226) - (xy 246.372916 73.421237) (xy 246.393015 73.436145) (xy 246.393081 73.436191) (xy 246.413251 73.449667) - (xy 246.434731 73.462542) (xy 246.434747 73.462551) (xy 246.434759 73.462558) (xy 246.434778 73.462568) - (xy 246.586079 73.543441) (xy 246.586093 73.543448) (xy 246.586097 73.54345) (xy 246.586101 73.543452) - (xy 246.608762 73.55417) (xy 246.63122 73.563473) (xy 246.654834 73.571922) (xy 246.819057 73.621738) - (xy 246.843381 73.627831) (xy 246.867222 73.632573) (xy 246.885462 73.635278) (xy 246.89202 73.636252) - (xy 246.909984 73.638021) (xy 247.068895 73.653673) (xy 247.081404 73.654595) (xy 247.093558 73.655192) - (xy 247.106093 73.6555) (xy 248.644434 73.6555) (xy 248.711473 73.675185) (xy 248.740287 73.700835) - (xy 248.832148 73.812768) (xy 248.845653 73.832979) (xy 248.921927 73.975676) (xy 248.93123 73.998135) - (xy 248.978201 74.152978) (xy 248.982943 74.176819) (xy 249 74.35) (xy 249 74.715407) (xy 248.998061 74.718485) - (xy 248.934766 74.748076) (xy 248.928455 74.748555) (xy 248.92846 74.748596) (xy 248.921014 74.749499) - (xy 248.767634 74.787303) (xy 248.627762 74.860715) (xy 248.509516 74.965471) (xy 248.419781 75.095475) - (xy 248.41978 75.095476) (xy 248.363762 75.243181) (xy 248.344722 75.399999) (xy 248.344722 75.4) - (xy 248.363762 75.556818) (xy 248.411551 75.682824) (xy 248.41978 75.704523) (xy 248.509517 75.83453) - (xy 248.62776 75.939283) (xy 248.627762 75.939284) (xy 248.767634 76.012696) (xy 248.921014 76.0505) - (xy 248.921015 76.0505) (xy 249.078985 76.0505) (xy 249.232365 76.012696) (xy 249.37224 75.939283) - (xy 249.490483 75.83453) (xy 249.58022 75.704523) (xy 249.636237 75.556818) (xy 249.655278 75.4) - (xy 249.655277 75.399996) (xy 249.656147 75.392836) (xy 249.683768 75.328658) (xy 249.726277 75.3) - (xy 250.493907 75.3) (xy 250.506061 75.300597) (xy 250.682941 75.318018) (xy 250.706769 75.322757) - (xy 250.870996 75.372574) (xy 250.893451 75.381876) (xy 250.913956 75.392836) (xy 250.99532 75.436325) - (xy 251.015526 75.449826) (xy 251.037134 75.46756) (xy 251.061004 75.48351) (xy 251.087003 75.497407) - (xy 251.107207 75.510907) (xy 251.19535 75.583244) (xy 251.197666 75.585145) (xy 251.214841 75.602317) - (xy 251.216342 75.604146) (xy 251.243664 75.668451) (xy 251.2445 75.682824) (xy 251.2445 79.593907) - (xy 251.244723 79.602984) (xy 251.244808 79.60645) (xy 251.245406 79.618618) (xy 251.246325 79.631086) - (xy 251.263745 79.807958) (xy 251.263751 79.808009) (xy 251.267421 79.832756) (xy 251.267426 79.83278) - (xy 251.271815 79.85485) (xy 251.272169 79.856627) (xy 251.278249 79.880899) (xy 251.278256 79.880927) - (xy 251.278259 79.880936) (xy 251.321007 80.021858) (xy 251.328079 80.045171) (xy 251.336523 80.068772) - (xy 251.336524 80.068775) (xy 251.345826 80.091231) (xy 251.35655 80.113905) (xy 251.356557 80.113919) - (xy 251.43743 80.26522) (xy 251.437456 80.265267) (xy 251.450331 80.286747) (xy 251.463807 80.306917) - (xy 251.463853 80.306982) (xy 251.475595 80.322813) (xy 251.499722 80.388385) (xy 251.5 80.396683) - (xy 251.5 80.803316) (xy 251.480315 80.870355) (xy 251.475597 80.877184) (xy 251.46384 80.893034) + (xy 246.282723 69.6836) (xy 246.209664 69.698132) (xy 246.20966 69.698133) (xy 246.126799 69.753499) + (xy 246.071433 69.83636) (xy 246.071432 69.836364) (xy 246.0569 69.909421) (xy 246.0569 71.348795) + (xy 246.037215 71.415834) (xy 246.009303 71.445025) (xy 246.009776 71.445571) (xy 245.952371 71.495311) + (xy 245.920743 71.528088) (xy 245.874534 71.616425) (xy 245.874533 71.616425) (xy 245.854851 71.683457) + (xy 245.854848 71.683469) (xy 245.8445 71.755446) (xy 245.8445 71.755448) (xy 245.8445 72.393907) + (xy 245.844723 72.402984) (xy 245.844808 72.40645) (xy 245.845406 72.418618) (xy 245.846325 72.431086) + (xy 245.863745 72.607958) (xy 245.863751 72.608009) (xy 245.867421 72.632756) (xy 245.867427 72.632785) + (xy 245.872169 72.656627) (xy 245.878249 72.680899) (xy 245.878257 72.680928) (xy 245.928079 72.845171) + (xy 245.936523 72.868772) (xy 245.936524 72.868775) (xy 245.945826 72.891231) (xy 245.95655 72.913905) + (xy 245.956557 72.913919) (xy 246.03743 73.06522) (xy 246.037456 73.065267) (xy 246.050331 73.086747) + (xy 246.063807 73.106917) (xy 246.063853 73.106983) (xy 246.078761 73.127082) (xy 246.078773 73.127098) + (xy 246.115759 73.172165) (xy 246.187644 73.259758) (xy 246.204473 73.278326) (xy 246.221672 73.295525) + (xy 246.24024 73.312354) (xy 246.240245 73.312358) (xy 246.372901 73.421226) (xy 246.372916 73.421237) + (xy 246.393015 73.436145) (xy 246.393081 73.436191) (xy 246.413251 73.449667) (xy 246.434731 73.462542) + (xy 246.434747 73.462551) (xy 246.434759 73.462558) (xy 246.434778 73.462568) (xy 246.586079 73.543441) + (xy 246.586093 73.543448) (xy 246.586097 73.54345) (xy 246.586101 73.543452) (xy 246.608762 73.55417) + (xy 246.63122 73.563473) (xy 246.654834 73.571922) (xy 246.819057 73.621738) (xy 246.843381 73.627831) + (xy 246.867222 73.632573) (xy 246.885462 73.635278) (xy 246.89202 73.636252) (xy 246.909984 73.638021) + (xy 247.068895 73.653673) (xy 247.081404 73.654595) (xy 247.093558 73.655192) (xy 247.106093 73.6555) + (xy 248.644434 73.6555) (xy 248.711473 73.675185) (xy 248.740287 73.700835) (xy 248.832148 73.812768) + (xy 248.845653 73.832979) (xy 248.921927 73.975676) (xy 248.93123 73.998135) (xy 248.978201 74.152978) + (xy 248.982943 74.176819) (xy 249 74.35) (xy 249.018253 74.535334) (xy 249.034686 74.589505) (xy 249.035309 74.659372) + (xy 248.998061 74.718485) (xy 248.934766 74.748076) (xy 248.928455 74.748555) (xy 248.92846 74.748596) + (xy 248.921014 74.749499) (xy 248.767634 74.787303) (xy 248.627762 74.860715) (xy 248.509516 74.965471) + (xy 248.419781 75.095475) (xy 248.41978 75.095476) (xy 248.363762 75.243181) (xy 248.344722 75.399999) + (xy 248.344722 75.4) (xy 248.363762 75.556818) (xy 248.411551 75.682824) (xy 248.41978 75.704523) + (xy 248.509517 75.83453) (xy 248.62776 75.939283) (xy 248.627762 75.939284) (xy 248.767634 76.012696) + (xy 248.921014 76.0505) (xy 248.921015 76.0505) (xy 249.078985 76.0505) (xy 249.232365 76.012696) + (xy 249.37224 75.939283) (xy 249.490483 75.83453) (xy 249.58022 75.704523) (xy 249.636237 75.556818) + (xy 249.655278 75.4) (xy 249.655277 75.399996) (xy 249.656147 75.392836) (xy 249.683768 75.328658) + (xy 249.741702 75.289601) (xy 249.791397 75.284379) (xy 249.95 75.3) (xy 250.493907 75.3) (xy 250.506061 75.300597) + (xy 250.682941 75.318018) (xy 250.706769 75.322757) (xy 250.870996 75.372574) (xy 250.893451 75.381876) + (xy 250.913956 75.392836) (xy 250.99532 75.436325) (xy 251.015526 75.449826) (xy 251.037134 75.46756) + (xy 251.061004 75.48351) (xy 251.087003 75.497407) (xy 251.107207 75.510907) (xy 251.19535 75.583244) + (xy 251.197666 75.585145) (xy 251.214841 75.602317) (xy 251.216342 75.604146) (xy 251.243664 75.668451) + (xy 251.2445 75.682824) (xy 251.2445 79.593907) (xy 251.244723 79.602984) (xy 251.244808 79.60645) + (xy 251.245406 79.618618) (xy 251.246325 79.631086) (xy 251.263745 79.807958) (xy 251.263751 79.808009) + (xy 251.267421 79.832756) (xy 251.267426 79.83278) (xy 251.272165 79.856608) (xy 251.278259 79.880937) + (xy 251.278264 79.880956) (xy 251.295613 79.938152) (xy 251.295618 79.938163) (xy 251.298273 79.946915) + (xy 251.298273 79.946916) (xy 251.328076 80.045165) (xy 251.329926 80.050334) (xy 251.333447 80.060176) + (xy 251.336526 80.068779) (xy 251.345829 80.091237) (xy 251.351983 80.104248) (xy 251.35655 80.113905) + (xy 251.356557 80.113919) (xy 251.43743 80.26522) (xy 251.437456 80.265267) (xy 251.450331 80.286747) + (xy 251.463807 80.306917) (xy 251.463853 80.306982) (xy 251.475595 80.322813) (xy 251.499722 80.388385) + (xy 251.5 80.396683) (xy 251.5 80.803316) (xy 251.480315 80.870355) (xy 251.475597 80.877184) (xy 251.46384 80.893034) (xy 251.463822 80.89306) (xy 251.450341 80.913236) (xy 251.437437 80.934765) (xy 251.356543 81.086107) (xy 251.345823 81.108773) (xy 251.34582 81.108781) (xy 251.336531 81.131204) (xy 251.336524 81.131222) (xy 251.328079 81.154824) (xy 251.27826 81.319057) (xy 251.278254 81.319079) (xy 251.272167 81.343382) @@ -156402,12 +160508,13 @@ (xy 251.263746 81.392027) (xy 251.246326 81.568908) (xy 251.245406 81.58138) (xy 251.245405 81.581403) (xy 251.244808 81.593557) (xy 251.2445 81.606092) (xy 251.2445 83.293907) (xy 251.244723 83.302984) (xy 251.244808 83.30645) (xy 251.245406 83.318618) (xy 251.246325 83.331086) (xy 251.263745 83.507958) - (xy 251.263751 83.508009) (xy 251.267421 83.532756) (xy 251.267427 83.532785) (xy 251.272169 83.556627) - (xy 251.278249 83.580899) (xy 251.278257 83.580928) (xy 251.328076 83.745162) (xy 251.336534 83.7688) - (xy 251.345821 83.791217) (xy 251.345829 83.791236) (xy 251.356546 83.813894) (xy 251.388903 83.87443) - (xy 251.419827 83.932285) (xy 251.437444 83.965244) (xy 251.450321 83.98673) (xy 251.450328 83.986741) - (xy 251.450332 83.986747) (xy 251.463836 84.006957) (xy 251.475595 84.022811) (xy 251.499722 84.088381) - (xy 251.5 84.096681) (xy 251.5 84.393907) (xy 251.499403 84.406061) (xy 251.481982 84.582934) (xy 251.47724 84.606775) + (xy 251.263751 83.508009) (xy 251.267421 83.532756) (xy 251.267426 83.53278) (xy 251.272165 83.556608) + (xy 251.278259 83.580937) (xy 251.278261 83.580944) (xy 251.306203 83.673059) (xy 251.306205 83.673064) + (xy 251.328073 83.745156) (xy 251.328074 83.74516) (xy 251.336524 83.768775) (xy 251.345821 83.791217) + (xy 251.345829 83.791236) (xy 251.356546 83.813894) (xy 251.388903 83.87443) (xy 251.419827 83.932285) + (xy 251.437444 83.965244) (xy 251.450321 83.98673) (xy 251.450328 83.986741) (xy 251.450332 83.986747) + (xy 251.463836 84.006957) (xy 251.475595 84.022811) (xy 251.499722 84.088381) (xy 251.5 84.096681) + (xy 251.5 84.393907) (xy 251.499403 84.406061) (xy 251.481982 84.582934) (xy 251.47724 84.606775) (xy 251.427424 84.770998) (xy 251.418121 84.793456) (xy 251.337227 84.944798) (xy 251.323722 84.96501) (xy 251.214854 85.097666) (xy 251.197666 85.114854) (xy 251.06501 85.223722) (xy 251.044798 85.237227) (xy 250.893456 85.318121) (xy 250.870998 85.327424) (xy 250.706775 85.37724) (xy 250.682934 85.381982) @@ -156505,99 +160612,111 @@ (xy 259.787227 131.644798) (xy 259.773722 131.66501) (xy 259.664854 131.797666) (xy 259.647666 131.814854) (xy 259.51501 131.923722) (xy 259.494798 131.937227) (xy 259.343456 132.018121) (xy 259.320998 132.027424) (xy 259.156775 132.07724) (xy 259.132934 132.081982) (xy 258.956061 132.099403) (xy 258.943907 132.1) - (xy 256.9 132.1) (xy 256.610675 132.374294) (xy 256.610671 132.374298) (xy 256.610658 132.374309) - (xy 241.509718 146.690785) (xy 241.50965 146.690849) (xy 241.509631 146.690868) (xy 241.5 146.7) - (xy 241.490659 146.70934) (xy 241.490584 146.709415) (xy 215.373758 172.826241) (xy 215.369227 172.830549) - (xy 215.301414 172.891846) (xy 215.291732 172.899749) (xy 215.21809 172.953911) (xy 215.212962 172.957487) - (xy 207.45573 178.081091) (xy 207.445357 178.08724) (xy 207.289655 178.169577) (xy 207.267367 178.178716) - (xy 207.104501 178.227647) (xy 207.080867 178.232305) (xy 206.905566 178.249414) (xy 206.893521 178.25) - (xy 194.547042 178.25) (xy 194.480003 178.230315) (xy 194.434248 178.177511) (xy 194.424304 178.108353) - (xy 194.444992 178.05556) (xy 194.456227 178.039283) (xy 194.48022 178.004523) (xy 194.536237 177.856818) - (xy 194.555278 177.7) (xy 194.54963 177.65348) (xy 194.536237 177.543181) (xy 194.494428 177.432941) - (xy 194.48022 177.395477) (xy 194.390483 177.26547) (xy 194.27224 177.160717) (xy 194.272238 177.160716) - (xy 194.272237 177.160715) (xy 194.132365 177.087303) (xy 193.978986 177.0495) (xy 193.978985 177.0495) - (xy 193.821015 177.0495) (xy 193.821014 177.0495) (xy 193.667634 177.087303) (xy 193.527762 177.160715) - (xy 193.409516 177.26547) (xy 193.407089 177.268987) (xy 193.405742 177.270938) (xy 193.351463 177.314929) - (xy 193.303692 177.3245) (xy 189.214743 177.3245) (xy 189.147704 177.304815) (xy 189.101949 177.252011) - (xy 189.098801 177.244472) (xy 189.098587 177.243907) (xy 189.08022 177.195477) (xy 188.990483 177.06547) - (xy 188.87224 176.960717) (xy 188.872238 176.960716) (xy 188.872237 176.960715) (xy 188.732365 176.887303) - (xy 188.578986 176.8495) (xy 188.578985 176.8495) (xy 188.421015 176.8495) (xy 188.421014 176.8495) - (xy 188.267634 176.887303) (xy 188.127762 176.960715) (xy 188.009516 177.065471) (xy 187.919781 177.195475) - (xy 187.91978 177.195476) (xy 187.863762 177.343181) (xy 187.857413 177.395476) (xy 187.844722 177.5) - (xy 187.858145 177.610554) (xy 187.846686 177.679477) (xy 187.799782 177.731263) (xy 187.73505 177.7495) - (xy 187.721014 177.7495) (xy 187.567634 177.787303) (xy 187.427762 177.860715) (xy 187.309516 177.965471) - (xy 187.219781 178.095474) (xy 187.191528 178.169972) (xy 187.14935 178.225674) (xy 187.083752 178.249731) - (xy 187.075586 178.25) (xy 177.061351 178.25) (xy 176.994312 178.230315) (xy 176.948557 178.177511) - (xy 176.938613 178.108353) (xy 176.967638 178.044797) (xy 176.979124 178.033184) (xy 176.983006 178.029745) - (xy 177.090483 177.93453) (xy 177.18022 177.804523) (xy 177.236237 177.656818) (xy 177.255278 177.5) - (xy 177.242587 177.395475) (xy 177.236237 177.343181) (xy 177.20166 177.252011) (xy 177.18022 177.195477) - (xy 177.090483 177.06547) (xy 176.97224 176.960717) (xy 176.972238 176.960716) (xy 176.972237 176.960715) - (xy 176.832365 176.887303) (xy 176.678986 176.8495) (xy 176.678985 176.8495) (xy 176.521015 176.8495) - (xy 176.521014 176.8495) (xy 176.367634 176.887303) (xy 176.227762 176.960715) (xy 176.109514 177.065472) - (xy 176.102046 177.076292) (xy 176.047763 177.120281) (xy 175.978314 177.127939) (xy 175.91575 177.096835) - (xy 175.89795 177.076292) (xy 175.890481 177.065472) (xy 175.872452 177.0495) (xy 175.772236 176.960717) - (xy 175.772234 176.960716) (xy 175.772233 176.960715) (xy 175.632361 176.887303) (xy 175.478982 176.8495) - (xy 175.478981 176.8495) (xy 175.321011 176.8495) (xy 175.32101 176.8495) (xy 175.16763 176.887303) - (xy 175.027758 176.960715) (xy 174.909512 177.065471) (xy 174.819777 177.195475) (xy 174.819776 177.195476) - (xy 174.763759 177.343181) (xy 174.744718 177.5) (xy 174.744718 177.500001) (xy 174.750892 177.550854) - (xy 174.739431 177.619777) (xy 174.715477 177.65348) (xy 174.155277 178.213681) (xy 174.093954 178.247166) - (xy 174.067596 178.25) (xy 156.006093 178.25) (xy 155.993939 178.249403) (xy 155.817065 178.231982) - (xy 155.793224 178.22724) (xy 155.629001 178.177424) (xy 155.606543 178.168121) (xy 155.455201 178.087227) - (xy 155.434989 178.073722) (xy 155.302333 177.964854) (xy 155.285145 177.947666) (xy 155.176277 177.81501) - (xy 155.162772 177.794798) (xy 155.128812 177.731263) (xy 155.081877 177.643453) (xy 155.072575 177.620998) - (xy 155.069407 177.610553) (xy 155.022757 177.456769) (xy 155.018018 177.432941) (xy 155.000597 177.256061) - (xy 155 177.243907) (xy 155 174.750003) (xy 155 174.75) (xy 155 173.75) (xy 154 173.75) (xy 153.999997 173.75) - (xy 136.405142 173.75) (xy 136.338103 173.730315) (xy 136.292348 173.677511) (xy 136.282404 173.608353) - (xy 136.283525 173.601809) (xy 136.297343 173.532335) (xy 136.297344 173.532333) (xy 136.297344 172.97578) - (xy 136.297343 172.975778) (xy 136.282811 172.902721) (xy 136.28281 172.902717) (xy 136.275546 172.891846) - (xy 136.227445 172.819856) (xy 136.144584 172.764491) (xy 136.144583 172.76449) (xy 136.144579 172.764489) - (xy 136.071521 172.749957) (xy 136.071518 172.749957) (xy 134.56607 172.749957) (xy 134.566067 172.749957) - (xy 134.493008 172.764489) (xy 134.493004 172.76449) (xy 134.458921 172.787263) (xy 134.442888 172.797976) - (xy 134.376213 172.818853) (xy 134.308833 172.800368) (xy 134.262143 172.748389) (xy 134.25 172.694873) - (xy 134.25 172.54324) (xy 134.269685 172.476201) (xy 134.322489 172.430446) (xy 134.391647 172.420502) - (xy 134.442887 172.440136) (xy 134.493004 172.473623) (xy 134.493006 172.473623) (xy 134.493008 172.473624) - (xy 134.566065 172.488156) (xy 134.566068 172.488157) (xy 134.56607 172.488157) (xy 136.07152 172.488157) - (xy 136.071521 172.488156) (xy 136.144584 172.473623) (xy 136.227445 172.418258) (xy 136.28281 172.335397) - (xy 136.297344 172.262331) (xy 136.297344 171.705783) (xy 136.297344 171.70578) (xy 136.297343 171.705778) - (xy 136.282811 171.632721) (xy 136.28281 171.632717) (xy 136.227445 171.549856) (xy 136.144584 171.494491) - (xy 136.144583 171.49449) (xy 136.144579 171.494489) (xy 136.071521 171.479957) (xy 136.071518 171.479957) - (xy 134.56607 171.479957) (xy 134.566067 171.479957) (xy 134.493008 171.494489) (xy 134.493004 171.49449) - (xy 134.458921 171.517263) (xy 134.442888 171.527976) (xy 134.376213 171.548853) (xy 134.308833 171.530368) - (xy 134.262143 171.478389) (xy 134.25 171.424873) (xy 134.25 167.46324) (xy 134.268569 167.4) (xy 134.525062 167.4) - (xy 134.566065 167.408156) (xy 134.566068 167.408157) (xy 134.56607 167.408157) (xy 136.07152 167.408157) - (xy 136.071521 167.408156) (xy 136.112525 167.4) (xy 164 167.4) (xy 164 170) (xy 179.049997 170) - (xy 179.05 170) (xy 180.05 170) (xy 180.05 165.0995) (xy 180.069685 165.032461) (xy 180.122489 164.986706) - (xy 180.174 164.9755) (xy 182.926 164.9755) (xy 182.993039 164.995185) (xy 183.038794 165.047989) - (xy 183.05 165.0995) (xy 183.05 170) (xy 184.050003 170) (xy 189.034867 170) (xy 189.101906 170.019685) - (xy 189.147661 170.072489) (xy 189.157963 170.109053) (xy 189.163763 170.156819) (xy 189.204969 170.26547) - (xy 189.21978 170.304523) (xy 189.309517 170.43453) (xy 189.42776 170.539283) (xy 189.427762 170.539284) - (xy 189.567634 170.612696) (xy 189.721014 170.6505) (xy 189.721015 170.6505) (xy 189.878985 170.6505) - (xy 190.032365 170.612696) (xy 190.17224 170.539283) (xy 190.290483 170.43453) (xy 190.38022 170.304523) - (xy 190.436237 170.156818) (xy 190.440469 170.121963) (xy 190.442037 170.109053) (xy 190.469659 170.044875) - (xy 190.527594 170.005819) (xy 190.565133 170) (xy 210.941416 170) (xy 210.94142 170) (xy 211.2 170) - (xy 219.5 165.4) (xy 222.772664 161.95) (xy 225.747315 158.81416) (xy 225.807734 158.779071) (xy 225.837278 158.7755) - (xy 225.945725 158.7755) (xy 226.012764 158.795185) (xy 226.024835 158.804014) (xy 226.029754 158.808089) - (xy 226.152109 158.867013) (xy 226.286396 158.887254) (xy 226.420683 158.867013) (xy 226.543038 158.808089) - (xy 226.566576 158.788588) (xy 227.032228 158.322936) (xy 227.051729 158.299398) (xy 227.110653 158.177043) - (xy 227.130894 158.042756) (xy 227.118342 157.959483) (xy 227.127814 157.890262) (xy 227.173209 157.837148) - (xy 227.240112 157.817007) (xy 227.259439 157.818389) (xy 227.33533 157.829828) (xy 227.469617 157.809587) - (xy 227.591972 157.750663) (xy 227.61551 157.731162) (xy 228.081162 157.26551) (xy 228.100663 157.241972) - (xy 228.159587 157.119617) (xy 228.179828 156.98533) (xy 228.159587 156.851043) (xy 228.100663 156.728688) - (xy 228.081162 156.70515) (xy 228.081152 156.70514) (xy 228.081144 156.705131) (xy 227.995544 156.619531) - (xy 227.962059 156.558208) (xy 227.967043 156.488516) (xy 227.993258 156.446516) (xy 229.601684 154.750935) - (xy 229.601689 154.750928) (xy 229.601705 154.750909) (xy 229.65 154.7) (xy 229.690726 154.642814) - (xy 231.422887 152.21057) (xy 231.436189 152.194846) (xy 232.564217 151.066819) (xy 232.62554 151.033334) - (xy 232.651898 151.0305) (xy 234.204676 151.0305) (xy 234.204677 151.030499) (xy 234.27774 151.015966) - (xy 234.360601 150.960601) (xy 234.415966 150.87774) (xy 234.4305 150.804674) (xy 234.4305 148.555326) - (xy 234.4305 148.555323) (xy 234.430499 148.555321) (xy 234.415967 148.482264) (xy 234.415966 148.48226) - (xy 234.404747 148.46547) (xy 234.360601 148.399399) (xy 234.3606 148.399398) (xy 234.315366 148.369174) - (xy 234.270561 148.315562) (xy 234.261854 148.246237) (xy 234.283252 148.194141) (xy 234.734798 147.560095) - (xy 234.789717 147.516911) (xy 234.859271 147.510273) (xy 234.918024 147.539214) (xy 235.00276 147.614283) - (xy 235.002762 147.614284) (xy 235.142634 147.687696) (xy 235.296014 147.7255) (xy 235.296015 147.7255) - (xy 235.453985 147.7255) (xy 235.607365 147.687696) (xy 235.708775 147.634471) (xy 235.74724 147.614283) - (xy 235.865483 147.50953) (xy 235.95522 147.379523) (xy 236.011237 147.231818) (xy 236.030278 147.075) - (xy 236.024102 147.024144) (xy 236.035561 146.955224) (xy 236.059514 146.921521) (xy 238.095123 144.885913) - (xy 238.121371 144.865884) (xy 238.5 144.65) (xy 238.595961 144.553358) (xy 238.595966 144.553354) + (xy 257.298681 132.1) (xy 257.110132 132.117936) (xy 256.928346 132.171101) (xy 256.759848 132.257587) + (xy 256.759845 132.257589) (xy 256.689238 132.312829) (xy 256.610675 132.374294) (xy 256.610671 132.374298) + (xy 256.610658 132.374309) (xy 241.509718 146.690785) (xy 241.509677 146.690823) (xy 241.509631 146.690868) + (xy 241.504484 146.695814) (xy 241.500024 146.7001) (xy 241.490584 146.709415) (xy 215.373758 172.826241) + (xy 215.369227 172.830549) (xy 215.301414 172.891846) (xy 215.291732 172.899749) (xy 215.21809 172.953911) + (xy 215.212962 172.957487) (xy 207.45573 178.081091) (xy 207.445357 178.08724) (xy 207.289655 178.169577) + (xy 207.267367 178.178716) (xy 207.104501 178.227647) (xy 207.080867 178.232305) (xy 206.905566 178.249414) + (xy 206.893521 178.25) (xy 194.547042 178.25) (xy 194.480003 178.230315) (xy 194.434248 178.177511) + (xy 194.424304 178.108353) (xy 194.444992 178.05556) (xy 194.456227 178.039283) (xy 194.48022 178.004523) + (xy 194.536237 177.856818) (xy 194.555278 177.7) (xy 194.54963 177.65348) (xy 194.536237 177.543181) + (xy 194.494428 177.432941) (xy 194.48022 177.395477) (xy 194.390483 177.26547) (xy 194.27224 177.160717) + (xy 194.272238 177.160716) (xy 194.272237 177.160715) (xy 194.132365 177.087303) (xy 193.978986 177.0495) + (xy 193.978985 177.0495) (xy 193.821015 177.0495) (xy 193.821014 177.0495) (xy 193.667634 177.087303) + (xy 193.527762 177.160715) (xy 193.409516 177.26547) (xy 193.407089 177.268987) (xy 193.405742 177.270938) + (xy 193.351463 177.314929) (xy 193.303692 177.3245) (xy 189.214743 177.3245) (xy 189.147704 177.304815) + (xy 189.101949 177.252011) (xy 189.098801 177.244472) (xy 189.098587 177.243907) (xy 189.08022 177.195477) + (xy 188.990483 177.06547) (xy 188.87224 176.960717) (xy 188.872238 176.960716) (xy 188.872237 176.960715) + (xy 188.732365 176.887303) (xy 188.578986 176.8495) (xy 188.578985 176.8495) (xy 188.421015 176.8495) + (xy 188.421014 176.8495) (xy 188.267634 176.887303) (xy 188.127762 176.960715) (xy 188.009516 177.065471) + (xy 187.919781 177.195475) (xy 187.91978 177.195476) (xy 187.863762 177.343181) (xy 187.857413 177.395476) + (xy 187.844722 177.5) (xy 187.858145 177.610554) (xy 187.846686 177.679477) (xy 187.799782 177.731263) + (xy 187.73505 177.7495) (xy 187.721014 177.7495) (xy 187.567634 177.787303) (xy 187.427762 177.860715) + (xy 187.309516 177.965471) (xy 187.219781 178.095474) (xy 187.191528 178.169972) (xy 187.14935 178.225674) + (xy 187.083752 178.249731) (xy 187.075586 178.25) (xy 177.061351 178.25) (xy 176.994312 178.230315) + (xy 176.948557 178.177511) (xy 176.938613 178.108353) (xy 176.967638 178.044797) (xy 176.979124 178.033184) + (xy 176.983006 178.029745) (xy 177.090483 177.93453) (xy 177.18022 177.804523) (xy 177.236237 177.656818) + (xy 177.255278 177.5) (xy 177.242587 177.395475) (xy 177.236237 177.343181) (xy 177.20166 177.252011) + (xy 177.18022 177.195477) (xy 177.090483 177.06547) (xy 176.97224 176.960717) (xy 176.972238 176.960716) + (xy 176.972237 176.960715) (xy 176.832365 176.887303) (xy 176.678986 176.8495) (xy 176.678985 176.8495) + (xy 176.521015 176.8495) (xy 176.521014 176.8495) (xy 176.367634 176.887303) (xy 176.227762 176.960715) + (xy 176.109514 177.065472) (xy 176.102046 177.076292) (xy 176.047763 177.120281) (xy 175.978314 177.127939) + (xy 175.91575 177.096835) (xy 175.89795 177.076292) (xy 175.890481 177.065472) (xy 175.872452 177.0495) + (xy 175.772236 176.960717) (xy 175.772234 176.960716) (xy 175.772233 176.960715) (xy 175.632361 176.887303) + (xy 175.478982 176.8495) (xy 175.478981 176.8495) (xy 175.321011 176.8495) (xy 175.32101 176.8495) + (xy 175.16763 176.887303) (xy 175.027758 176.960715) (xy 174.909512 177.065471) (xy 174.819777 177.195475) + (xy 174.819776 177.195476) (xy 174.763759 177.343181) (xy 174.744718 177.5) (xy 174.744718 177.500001) + (xy 174.750892 177.550854) (xy 174.739431 177.619777) (xy 174.715477 177.65348) (xy 174.155277 178.213681) + (xy 174.093954 178.247166) (xy 174.067596 178.25) (xy 156.006093 178.25) (xy 155.993939 178.249403) + (xy 155.817065 178.231982) (xy 155.793224 178.22724) (xy 155.629001 178.177424) (xy 155.606543 178.168121) + (xy 155.455201 178.087227) (xy 155.434989 178.073722) (xy 155.302333 177.964854) (xy 155.285145 177.947666) + (xy 155.176277 177.81501) (xy 155.162772 177.794798) (xy 155.128812 177.731263) (xy 155.081877 177.643453) + (xy 155.072575 177.620998) (xy 155.069407 177.610553) (xy 155.022757 177.456769) (xy 155.018018 177.432941) + (xy 155.000597 177.256061) (xy 155 177.243907) (xy 155 174.750003) (xy 154.980785 174.554911) (xy 154.980785 174.55491) + (xy 154.92388 174.367317) (xy 154.83147 174.19443) (xy 154.793648 174.148344) (xy 154.707107 174.042892) + (xy 154.555571 173.918531) (xy 154.555564 173.918526) (xy 154.38269 173.826123) (xy 154.382687 173.826122) + (xy 154.382686 173.826121) (xy 154.382683 173.82612) (xy 154.19509 173.769215) (xy 154.195088 173.769214) + (xy 154.19509 173.769214) (xy 154.044494 173.754382) (xy 154 173.75) (xy 153.999997 173.75) (xy 136.405142 173.75) + (xy 136.338103 173.730315) (xy 136.292348 173.677511) (xy 136.282404 173.608353) (xy 136.283525 173.601809) + (xy 136.297343 173.532335) (xy 136.297344 173.532333) (xy 136.297344 172.97578) (xy 136.297343 172.975778) + (xy 136.282811 172.902721) (xy 136.28281 172.902717) (xy 136.275546 172.891846) (xy 136.227445 172.819856) + (xy 136.144584 172.764491) (xy 136.144583 172.76449) (xy 136.144579 172.764489) (xy 136.071521 172.749957) + (xy 136.071518 172.749957) (xy 134.56607 172.749957) (xy 134.566067 172.749957) (xy 134.493008 172.764489) + (xy 134.493004 172.76449) (xy 134.458921 172.787263) (xy 134.442888 172.797976) (xy 134.376213 172.818853) + (xy 134.308833 172.800368) (xy 134.262143 172.748389) (xy 134.25 172.694873) (xy 134.25 172.54324) + (xy 134.269685 172.476201) (xy 134.322489 172.430446) (xy 134.391647 172.420502) (xy 134.442887 172.440136) + (xy 134.493004 172.473623) (xy 134.493006 172.473623) (xy 134.493008 172.473624) (xy 134.566065 172.488156) + (xy 134.566068 172.488157) (xy 134.56607 172.488157) (xy 136.07152 172.488157) (xy 136.071521 172.488156) + (xy 136.144584 172.473623) (xy 136.227445 172.418258) (xy 136.28281 172.335397) (xy 136.297344 172.262331) + (xy 136.297344 171.705783) (xy 136.297344 171.70578) (xy 136.297343 171.705778) (xy 136.282811 171.632721) + (xy 136.28281 171.632717) (xy 136.227445 171.549856) (xy 136.144584 171.494491) (xy 136.144583 171.49449) + (xy 136.144579 171.494489) (xy 136.071521 171.479957) (xy 136.071518 171.479957) (xy 134.56607 171.479957) + (xy 134.566067 171.479957) (xy 134.493008 171.494489) (xy 134.493004 171.49449) (xy 134.458921 171.517263) + (xy 134.442888 171.527976) (xy 134.376213 171.548853) (xy 134.308833 171.530368) (xy 134.262143 171.478389) + (xy 134.25 171.424873) (xy 134.25 167.46324) (xy 134.268569 167.4) (xy 134.525062 167.4) (xy 134.566065 167.408156) + (xy 134.566068 167.408157) (xy 134.56607 167.408157) (xy 136.07152 167.408157) (xy 136.071521 167.408156) + (xy 136.112525 167.4) (xy 164 167.4) (xy 164 168.999996) (xy 164.019214 169.195088) (xy 164.019215 169.19509) + (xy 164.07612 169.382683) (xy 164.076121 169.382686) (xy 164.076122 169.382687) (xy 164.076123 169.38269) + (xy 164.168526 169.555564) (xy 164.168531 169.555571) (xy 164.292892 169.707107) (xy 164.398344 169.793648) + (xy 164.44443 169.83147) (xy 164.444433 169.831471) (xy 164.444435 169.831473) (xy 164.617309 169.923876) + (xy 164.61731 169.923876) (xy 164.617317 169.92388) (xy 164.80491 169.980785) (xy 164.804909 169.980785) + (xy 164.853682 169.985588) (xy 165 170) (xy 179.049997 170) (xy 179.05 170) (xy 179.24509 169.980785) + (xy 179.432683 169.92388) (xy 179.60557 169.83147) (xy 179.757107 169.707107) (xy 179.88147 169.55557) + (xy 179.97388 169.382683) (xy 180.030785 169.19509) (xy 180.05 169) (xy 180.05 165.0995) (xy 180.069685 165.032461) + (xy 180.122489 164.986706) (xy 180.174 164.9755) (xy 182.926 164.9755) (xy 182.993039 164.995185) + (xy 183.038794 165.047989) (xy 183.05 165.0995) (xy 183.05 168.999996) (xy 183.069214 169.195088) + (xy 183.069215 169.19509) (xy 183.12612 169.382683) (xy 183.126121 169.382686) (xy 183.126122 169.382687) + (xy 183.126123 169.38269) (xy 183.218526 169.555564) (xy 183.218531 169.555571) (xy 183.342892 169.707107) + (xy 183.448344 169.793648) (xy 183.49443 169.83147) (xy 183.494433 169.831471) (xy 183.494435 169.831473) + (xy 183.667309 169.923876) (xy 183.66731 169.923876) (xy 183.667317 169.92388) (xy 183.85491 169.980785) + (xy 183.854909 169.980785) (xy 183.903682 169.985588) (xy 184.05 170) (xy 210.941416 170) (xy 210.94142 170) + (xy 211.109313 169.985805) (xy 211.272439 169.943624) (xy 211.426168 169.874654) (xy 219.36526 165.474675) + (xy 219.492778 165.390673) (xy 219.606019 165.288236) (xy 222.768006 161.95491) (xy 222.772664 161.95) + (xy 225.747315 158.81416) (xy 225.807734 158.779071) (xy 225.837278 158.7755) (xy 225.945725 158.7755) + (xy 226.012764 158.795185) (xy 226.024835 158.804014) (xy 226.029754 158.808089) (xy 226.152109 158.867013) + (xy 226.286396 158.887254) (xy 226.420683 158.867013) (xy 226.543038 158.808089) (xy 226.566576 158.788588) + (xy 227.032228 158.322936) (xy 227.051729 158.299398) (xy 227.110653 158.177043) (xy 227.130894 158.042756) + (xy 227.118342 157.959483) (xy 227.127814 157.890262) (xy 227.173209 157.837148) (xy 227.240112 157.817007) + (xy 227.259439 157.818389) (xy 227.33533 157.829828) (xy 227.469617 157.809587) (xy 227.591972 157.750663) + (xy 227.61551 157.731162) (xy 228.081162 157.26551) (xy 228.100663 157.241972) (xy 228.159587 157.119617) + (xy 228.179828 156.98533) (xy 228.159587 156.851043) (xy 228.100663 156.728688) (xy 228.081162 156.70515) + (xy 228.081152 156.70514) (xy 228.081144 156.705131) (xy 227.995544 156.619531) (xy 227.962059 156.558208) + (xy 227.967043 156.488516) (xy 227.993258 156.446516) (xy 229.601684 154.750935) (xy 229.6481 154.698435) + (xy 229.690726 154.642814) (xy 231.422887 152.21057) (xy 231.436189 152.194846) (xy 232.564217 151.066819) + (xy 232.62554 151.033334) (xy 232.651898 151.0305) (xy 234.204676 151.0305) (xy 234.204677 151.030499) + (xy 234.27774 151.015966) (xy 234.360601 150.960601) (xy 234.415966 150.87774) (xy 234.4305 150.804674) + (xy 234.4305 148.555326) (xy 234.4305 148.555323) (xy 234.430499 148.555321) (xy 234.415967 148.482264) + (xy 234.415966 148.48226) (xy 234.404747 148.46547) (xy 234.360601 148.399399) (xy 234.3606 148.399398) + (xy 234.315366 148.369174) (xy 234.270561 148.315562) (xy 234.261854 148.246237) (xy 234.283252 148.194141) + (xy 234.734798 147.560095) (xy 234.789717 147.516911) (xy 234.859271 147.510273) (xy 234.918024 147.539214) + (xy 235.00276 147.614283) (xy 235.002762 147.614284) (xy 235.142634 147.687696) (xy 235.296014 147.7255) + (xy 235.296015 147.7255) (xy 235.453985 147.7255) (xy 235.607365 147.687696) (xy 235.708775 147.634471) + (xy 235.74724 147.614283) (xy 235.865483 147.50953) (xy 235.95522 147.379523) (xy 236.011237 147.231818) + (xy 236.030278 147.075) (xy 236.024102 147.024144) (xy 236.035561 146.955224) (xy 236.059514 146.921521) + (xy 238.095123 144.885913) (xy 238.121373 144.865882) (xy 238.381683 144.717461) (xy 238.447853 144.67355) + (xy 238.494373 144.64268) (xy 238.494378 144.642675) (xy 238.494387 144.64267) (xy 238.595966 144.553354) (xy 241.019999 142.112128) (xy 241.081204 142.078428) (xy 241.10799 142.0755) (xy 241.304733 142.0755) (xy 241.371772 142.095185) (xy 241.406783 142.129061) (xy 241.408259 142.131199) (xy 241.410556 142.134528) (xy 241.410558 142.13453) (xy 241.528801 142.239283) (xy 241.528803 142.239284) (xy 241.668675 142.312696) @@ -156609,14 +160728,13 @@ (xy 244.612843 138.802907) (xy 244.638803 138.789283) (xy 244.757046 138.68453) (xy 244.846783 138.554523) (xy 244.9028 138.406818) (xy 244.921841 138.25) (xy 244.921795 138.249621) (xy 244.921841 138.249344) (xy 244.921841 138.242499) (xy 244.922979 138.242499) (xy 244.933255 138.180698) (xy 244.956897 138.147309) - (xy 245.546633 137.553391) (xy 245.550008 137.550008) (xy 245.553254 137.546784) (xy 249.359328 133.786292) + (xy 245.546633 137.553391) (xy 245.550008 137.550008) (xy 245.553399 137.546641) (xy 249.359328 133.786291) (xy 249.420851 133.753177) (xy 249.446479 133.7505) (xy 249.478985 133.7505) (xy 249.632365 133.712696) (xy 249.672944 133.691398) (xy 249.77224 133.639283) (xy 249.890483 133.53453) (xy 249.98022 133.404523) - (xy 250.036237 133.256818) (xy 250.050252 133.141385) (xy 250.077873 133.07721) (xy 250.086181 133.068142) - (xy 253.09716 130.093224) (xy 253.603553 129.592896) (xy 253.612546 129.584837) (xy 253.688598 129.52309) - (xy 253.749478 129.473662) (xy 253.76958 129.460361) (xy 253.920089 129.380639) (xy 253.942386 129.371482) - (xy 254.105474 129.322412) (xy 254.129138 129.317743) (xy 254.304672 129.300587) (xy 254.316733 129.3) - (xy 258.943907 129.3) + (xy 250.036237 133.256818) (xy 250.050252 133.141385) (xy 250.077873 133.07721) (xy 250.086175 133.068149) + (xy 253.603558 129.592891) (xy 253.612541 129.584841) (xy 253.749479 129.473662) (xy 253.76958 129.460361) + (xy 253.920089 129.380639) (xy 253.942386 129.371482) (xy 254.105474 129.322412) (xy 254.129138 129.317743) + (xy 254.304672 129.300587) (xy 254.316733 129.3) (xy 258.943907 129.3) ) ) ) @@ -156669,211 +160787,214 @@ (xy 199.113762 99.906818) (xy 199.16978 100.054523) (xy 199.169781 100.054524) (xy 199.259517 100.184531) (xy 199.341267 100.256953) (xy 199.37776 100.289283) (xy 199.377761 100.289283) (xy 199.383374 100.294256) (xy 199.382511 100.295229) (xy 199.421594 100.343467) (xy 199.429247 100.412916) (xy 199.428882 100.414876) - (xy 199.414046 100.491216) (xy 199.414276 100.543217) (xy 199.414355 100.561086) (xy 199.423067 100.619836) + (xy 199.414046 100.491216) (xy 199.414276 100.543212) (xy 199.414355 100.561086) (xy 199.422367 100.615116) (xy 199.425024 100.633029) (xy 199.425621 100.63503) (xy 199.425628 100.635054) (xy 199.432699 100.655145) (xy 199.433838 100.65838) (xy 199.442879 100.680575) (xy 199.451505 100.699129) (xy 199.453297 100.702983) (xy 199.5319 100.852651) (xy 199.531916 100.85268) (xy 199.544443 100.873964) (xy 199.557567 100.893983) - (xy 199.572102 100.913974) (xy 199.6 100.948683) (xy 199.6 101) (xy 199.650116 101.011035) (xy 199.678027 101.045761) - (xy 199.694378 101.064203) (xy 199.694413 101.06424) (xy 199.711097 101.08132) (xy 199.711141 101.081363) - (xy 199.729236 101.098175) (xy 199.858524 101.207145) (xy 199.878157 101.222132) (xy 199.897868 101.235722) - (xy 199.918861 101.248745) (xy 200.066674 101.330823) (xy 200.088819 101.341755) (xy 200.103757 101.348251) - (xy 200.11077 101.351301) (xy 200.110776 101.351303) (xy 200.11078 101.351305) (xy 200.133885 101.36005) - (xy 200.166129 101.370502) (xy 200.195632 101.380066) (xy 200.195637 101.380067) (xy 200.19564 101.380068) - (xy 200.243579 101.390649) (xy 200.243584 101.390649) (xy 200.243586 101.39065) (xy 200.251555 101.391619) - (xy 200.290661 101.396375) (xy 200.309284 101.397837) (xy 200.312387 101.398081) (xy 200.312388 101.398081) - (xy 200.31239 101.398081) (xy 200.386422 101.386083) (xy 200.410796 101.382134) (xy 200.437671 101.372109) - (xy 200.50736 101.367124) (xy 200.568684 101.400608) (xy 200.596945 101.444318) (xy 200.619777 101.50452) - (xy 200.709514 101.634527) (xy 200.827757 101.73928) (xy 200.827759 101.739281) (xy 200.967631 101.812693) - (xy 201.121011 101.850497) (xy 201.121012 101.850497) (xy 201.278982 101.850497) (xy 201.432362 101.812693) - (xy 201.57223 101.739284) (xy 201.572231 101.739282) (xy 201.572237 101.73928) (xy 201.597997 101.716458) - (xy 201.661227 101.686738) (xy 201.73049 101.69592) (xy 201.739926 101.700593) (xy 201.805667 101.736707) - (xy 201.805669 101.736708) (xy 201.846209 101.751946) (xy 201.873737 101.762293) (xy 201.873739 101.762293) - (xy 201.873743 101.762295) (xy 259.160095 114.376674) (xy 259.160106 114.376677) (xy 259.647166 114.483926) - (xy 259.708404 114.517567) (xy 259.741733 114.578975) (xy 259.7445 114.605025) (xy 259.7445 115.412396) - (xy 259.746461 115.443987) (xy 259.750256 115.474432) (xy 259.75026 115.474455) (xy 259.756106 115.505521) - (xy 259.756521 115.507401) (xy 259.756462 115.507413) (xy 259.756467 115.507439) (xy 259.75639 115.507453) - (xy 259.759359 115.525262) (xy 259.77299 115.689758) (xy 259.77299 115.710232) (xy 259.765497 115.800671) - (xy 259.765497 115.800672) (xy 259.759359 115.874735) (xy 259.756395 115.892521) (xy 259.756531 115.892551) - (xy 259.756114 115.894441) (xy 259.750256 115.92556) (xy 259.746462 115.956005) (xy 259.74646 115.956023) - (xy 259.7445 115.987598) (xy 259.7445 117.555202) (xy 259.724815 117.622241) (xy 259.672011 117.667996) - (xy 259.602853 117.67794) (xy 259.544338 117.653055) (xy 259.472455 117.597107) (xy 259.404906 117.544531) - (xy 259.404903 117.544529) (xy 259.4049 117.544527) (xy 259.204432 117.43604) (xy 259.204429 117.436039) - (xy 259.204426 117.436037) (xy 259.20442 117.436035) (xy 259.204418 117.436034) (xy 258.988826 117.36202) - (xy 258.820188 117.33388) (xy 258.763977 117.3245) (xy 258.536023 117.3245) (xy 258.491053 117.332004) - (xy 258.311173 117.36202) (xy 258.095581 117.436034) (xy 258.095567 117.43604) (xy 257.895099 117.544527) - (xy 257.89509 117.544533) (xy 257.715212 117.684538) (xy 257.715208 117.684541) (xy 257.560814 117.852257) - (xy 257.436137 118.043091) (xy 257.344569 118.251844) (xy 257.28861 118.47282) (xy 257.288608 118.472831) - (xy 257.269786 118.699993) (xy 257.269786 118.700006) (xy 257.289033 118.932287) (xy 257.287831 118.932386) - (xy 257.280131 118.99603) (xy 257.253893 119.034737) (xy 254.675451 121.613181) (xy 254.614128 121.646666) - (xy 254.58777 121.6495) (xy 235.36223 121.6495) (xy 235.295191 121.629815) (xy 235.274549 121.613181) - (xy 229.878421 116.217052) (xy 229.878414 116.217046) (xy 229.778818 116.150499) (xy 229.778817 116.150499) - (xy 229.755495 116.134916) (xy 229.755488 116.134912) (xy 229.618917 116.078343) (xy 229.618907 116.07834) - (xy 229.47392 116.0495) (xy 229.473918 116.0495) (xy 193.943157 116.0495) (xy 193.876118 116.029815) - (xy 193.868846 116.024767) (xy 193.817331 115.986203) (xy 193.817328 115.986201) (xy 193.682486 115.935909) - (xy 193.682485 115.935908) (xy 193.682483 115.935908) (xy 193.622873 115.929499) (xy 193.622863 115.929499) - (xy 192.927129 115.929499) (xy 192.927123 115.9295) (xy 192.867516 115.935907) (xy 192.732671 115.986201) - (xy 192.732668 115.986203) (xy 192.681154 116.024767) (xy 192.61569 116.049184) (xy 192.606843 116.0495) - (xy 192.247387 116.0495) (xy 192.180348 116.029815) (xy 192.134593 115.977011) (xy 192.124649 115.907853) - (xy 192.145337 115.85506) (xy 192.148352 115.850692) (xy 192.18022 115.804523) (xy 192.236237 115.656818) - (xy 192.255278 115.5) (xy 192.249102 115.449144) (xy 192.260561 115.380224) (xy 192.284514 115.346521) - (xy 192.864218 114.766817) (xy 192.925539 114.733334) (xy 192.951888 114.7305) (xy 193.622872 114.7305) - (xy 193.682483 114.724092) (xy 193.817331 114.673797) (xy 193.932546 114.587547) (xy 194.018796 114.472332) - (xy 194.069091 114.337484) (xy 194.0755 114.277874) (xy 194.075499 113.582129) (xy 194.069091 113.522518) - (xy 194.042254 113.450565) (xy 194.018797 113.387672) (xy 194.018793 113.387665) (xy 193.932547 113.272456) - (xy 193.932544 113.272453) (xy 193.817335 113.186207) (xy 193.817328 113.186203) (xy 193.682486 113.135911) - (xy 193.682485 113.13591) (xy 193.682483 113.13591) (xy 193.622873 113.129501) (xy 193.622863 113.129501) - (xy 192.927129 113.129501) (xy 192.927123 113.129502) (xy 192.867516 113.135909) (xy 192.732671 113.186203) - (xy 192.732664 113.186207) (xy 192.617455 113.272453) (xy 192.617452 113.272456) (xy 192.531206 113.387665) - (xy 192.531202 113.387672) (xy 192.480908 113.522518) (xy 192.474501 113.582117) (xy 192.474501 113.582124) - (xy 192.4745 113.582136) (xy 192.4745 114.043099) (xy 192.454815 114.110138) (xy 192.438181 114.13078) - (xy 191.75578 114.813181) (xy 191.694457 114.846666) (xy 191.668099 114.8495) (xy 191.521014 114.8495) - (xy 191.367634 114.887303) (xy 191.227762 114.960715) (xy 191.109516 115.065471) (xy 191.019781 115.195475) - (xy 191.01978 115.195476) (xy 190.963762 115.343181) (xy 190.944722 115.499999) (xy 190.944722 115.5) - (xy 190.963762 115.656818) (xy 191.01978 115.804523) (xy 191.019781 115.804524) (xy 191.054663 115.85506) - (xy 191.076546 115.921415) (xy 191.059081 115.989066) (xy 191.007813 116.036536) (xy 190.952613 116.0495) - (xy 188.976402 116.0495) (xy 188.952209 116.047117) (xy 188.913918 116.0395) (xy 188.913917 116.0395) - (xy 188.766082 116.0395) (xy 188.76608 116.0395) (xy 188.621092 116.06834) (xy 188.621082 116.068343) - (xy 188.484511 116.124912) (xy 188.484499 116.124919) (xy 188.446217 116.150499) (xy 188.446216 116.1505) - (xy 188.361581 116.20705) (xy 188.309474 116.259158) (xy 188.257048 116.311584) (xy 188.257046 116.311586) - (xy 187.874831 116.693799) (xy 187.813508 116.727284) (xy 187.743816 116.7223) (xy 187.708485 116.701971) - (xy 187.698527 116.693799) (xy 187.602334 116.614855) (xy 187.585136 116.597655) (xy 187.583637 116.595828) - (xy 187.556332 116.531514) (xy 187.5555 116.517175) (xy 187.5555 115.173599) (xy 187.575185 115.10656) - (xy 187.627989 115.060805) (xy 187.697147 115.050861) (xy 187.760703 115.079886) (xy 187.761675 115.080737) - (xy 187.82776 115.139283) (xy 187.827762 115.139284) (xy 187.967634 115.212696) (xy 188.121014 115.2505) - (xy 188.121015 115.2505) (xy 188.278985 115.2505) (xy 188.432365 115.212696) (xy 188.57224 115.139283) - (xy 188.690483 115.03453) (xy 188.78022 114.904523) (xy 188.836237 114.756818) (xy 188.855278 114.6) - (xy 188.839777 114.472332) (xy 188.836237 114.443181) (xy 188.810887 114.37634) (xy 188.78022 114.295477) - (xy 188.690483 114.16547) (xy 188.57224 114.060717) (xy 188.572238 114.060716) (xy 188.572237 114.060715) - (xy 188.432365 113.987303) (xy 188.278986 113.9495) (xy 188.278985 113.9495) (xy 188.1995 113.9495) - (xy 188.132461 113.929815) (xy 188.086706 113.877011) (xy 188.0755 113.8255) (xy 188.0755 113.450567) - (xy 188.0755 113.450565) (xy 188.04991 113.355062) (xy 188.000475 113.269438) (xy 187.930562 113.199525) - (xy 187.330563 112.599526) (xy 187.330562 112.599525) (xy 187.244938 112.55009) (xy 187.197186 112.537295) - (xy 187.197184 112.537294) (xy 187.197182 112.537293) (xy 187.149436 112.5245) (xy 187.149435 112.5245) - (xy 171.9069 112.5245) (xy 171.839861 112.504815) (xy 171.819219 112.488181) (xy 170.536319 111.205281) - (xy 170.502834 111.143958) (xy 170.5 111.1176) (xy 170.5 107.944995) (xy 178.925233 107.944995) - (xy 178.925233 107.945004) (xy 178.944273 108.199079) (xy 179.000968 108.447477) (xy 179.000973 108.447494) - (xy 179.094058 108.684671) (xy 179.094057 108.684671) (xy 179.221454 108.905327) (xy 179.221461 108.905338) - (xy 179.263452 108.957991) (xy 179.263453 108.957992) (xy 179.914152 108.307292) (xy 179.921049 108.323942) - (xy 180.008599 108.45497) (xy 180.12003 108.566401) (xy 180.251058 108.653951) (xy 180.267705 108.660846) - (xy 179.616813 109.311738) (xy 179.777616 109.421371) (xy 179.777624 109.421376) (xy 180.007176 109.531921) - (xy 180.007174 109.531921) (xy 180.250652 109.607024) (xy 180.250658 109.607026) (xy 180.502595 109.644999) - (xy 180.502604 109.645) (xy 180.757396 109.645) (xy 180.757404 109.644999) (xy 181.009341 109.607026) - (xy 181.009347 109.607024) (xy 181.252824 109.531921) (xy 181.482376 109.421376) (xy 181.482377 109.421375) - (xy 181.643185 109.311738) (xy 180.992294 108.660846) (xy 181.008942 108.653951) (xy 181.13997 108.566401) - (xy 181.251401 108.45497) (xy 181.338951 108.323942) (xy 181.345846 108.307294) (xy 181.996544 108.957992) - (xy 181.996546 108.957991) (xy 182.038544 108.90533) (xy 182.165941 108.684671) (xy 182.259026 108.447494) - (xy 182.259031 108.447477) (xy 182.315726 108.199079) (xy 182.334767 107.945004) (xy 182.334767 107.944995) - (xy 182.315726 107.69092) (xy 182.259031 107.442522) (xy 182.259026 107.442505) (xy 182.165941 107.205328) - (xy 182.165942 107.205328) (xy 182.038545 106.984672) (xy 181.996545 106.932006) (xy 181.345846 107.582705) - (xy 181.338951 107.566058) (xy 181.251401 107.43503) (xy 181.13997 107.323599) (xy 181.008942 107.236049) - (xy 180.992293 107.229152) (xy 181.643185 106.57826) (xy 181.486529 106.471454) (xy 181.442227 106.417425) - (xy 181.434167 106.348022) (xy 181.46491 106.285279) (xy 181.524694 106.249117) (xy 181.55638 106.245) - (xy 181.877828 106.245) (xy 181.877844 106.244999) (xy 181.937372 106.238598) (xy 181.937379 106.238596) - (xy 182.072086 106.188354) (xy 182.072093 106.18835) (xy 182.187187 106.10219) (xy 182.18719 106.102187) - (xy 182.27335 105.987093) (xy 182.273354 105.987086) (xy 182.323596 105.852379) (xy 182.323598 105.852372) - (xy 182.329999 105.792844) (xy 182.33 105.792827) (xy 182.33 104.795) (xy 181.392361 104.795) (xy 181.399257 104.778351) - (xy 181.43 104.623793) (xy 181.43 104.466207) (xy 181.399257 104.311649) (xy 181.392361 104.295) - (xy 182.33 104.295) (xy 182.33 103.297172) (xy 182.329999 103.297155) (xy 182.323598 103.237627) - (xy 182.323596 103.23762) (xy 182.273354 103.102913) (xy 182.27335 103.102906) (xy 182.18719 102.987812) - (xy 182.187187 102.987809) (xy 182.072093 102.901649) (xy 182.072086 102.901645) (xy 181.937379 102.851403) - (xy 181.937372 102.851401) (xy 181.877844 102.845) (xy 180.88 102.845) (xy 180.88 103.782639) (xy 180.863351 103.775743) - (xy 180.708793 103.745) (xy 180.551207 103.745) (xy 180.396649 103.775743) (xy 180.38 103.782639) - (xy 180.38 102.845) (xy 179.382155 102.845) (xy 179.322627 102.851401) (xy 179.32262 102.851403) - (xy 179.187913 102.901645) (xy 179.187906 102.901649) (xy 179.072812 102.987809) (xy 179.072809 102.987812) - (xy 178.986649 103.102906) (xy 178.986645 103.102913) (xy 178.936403 103.23762) (xy 178.936401 103.237627) - (xy 178.93 103.297155) (xy 178.93 104.295) (xy 179.867639 104.295) (xy 179.860743 104.311649) (xy 179.83 104.466207) - (xy 179.83 104.623793) (xy 179.860743 104.778351) (xy 179.867639 104.795) (xy 178.93 104.795) (xy 178.93 105.792844) - (xy 178.936401 105.852372) (xy 178.936403 105.852379) (xy 178.986645 105.987086) (xy 178.986649 105.987093) - (xy 179.072809 106.102187) (xy 179.072812 106.10219) (xy 179.187906 106.18835) (xy 179.187913 106.188354) - (xy 179.32262 106.238596) (xy 179.322627 106.238598) (xy 179.382155 106.244999) (xy 179.382172 106.245) - (xy 179.70362 106.245) (xy 179.770659 106.264685) (xy 179.816414 106.317489) (xy 179.826358 106.386647) - (xy 179.797333 106.450203) (xy 179.773471 106.471454) (xy 179.616813 106.578259) (xy 180.267706 107.229152) - (xy 180.251058 107.236049) (xy 180.12003 107.323599) (xy 180.008599 107.43503) (xy 179.921049 107.566058) - (xy 179.914152 107.582706) (xy 179.263452 106.932006) (xy 179.221457 106.984667) (xy 179.094058 107.205328) - (xy 179.000973 107.442505) (xy 179.000968 107.442522) (xy 178.944273 107.69092) (xy 178.925233 107.944995) - (xy 170.5 107.944995) (xy 170.5 92.619995) (xy 176.480233 92.619995) (xy 176.480233 92.620004) (xy 176.499273 92.874079) - (xy 176.555968 93.122477) (xy 176.555973 93.122494) (xy 176.649058 93.359671) (xy 176.649057 93.359671) - (xy 176.776454 93.580327) (xy 176.776461 93.580338) (xy 176.818452 93.632991) (xy 176.818453 93.632992) - (xy 177.469152 92.982292) (xy 177.476049 92.998942) (xy 177.563599 93.12997) (xy 177.67503 93.241401) - (xy 177.806058 93.328951) (xy 177.822705 93.335846) (xy 177.171813 93.986738) (xy 177.332616 94.096371) - (xy 177.332624 94.096376) (xy 177.562176 94.206921) (xy 177.562174 94.206921) (xy 177.805652 94.282024) - (xy 177.805658 94.282026) (xy 178.057595 94.319999) (xy 178.057604 94.32) (xy 178.312396 94.32) - (xy 178.312404 94.319999) (xy 178.564341 94.282026) (xy 178.564347 94.282024) (xy 178.807824 94.206921) - (xy 179.037376 94.096376) (xy 179.037377 94.096375) (xy 179.198185 93.986738) (xy 178.547294 93.335846) - (xy 178.563942 93.328951) (xy 178.69497 93.241401) (xy 178.806401 93.12997) (xy 178.893951 92.998942) - (xy 178.900846 92.982294) (xy 179.551544 93.632992) (xy 179.551546 93.632991) (xy 179.593544 93.58033) - (xy 179.653613 93.476288) (xy 179.70418 93.428073) (xy 179.772787 93.414849) (xy 179.837651 93.440817) - (xy 179.87818 93.497731) (xy 179.885 93.538288) (xy 179.885 93.867844) (xy 179.891401 93.927372) - (xy 179.891403 93.927379) (xy 179.941645 94.062086) (xy 179.941649 94.062093) (xy 180.027809 94.177187) - (xy 180.027812 94.17719) (xy 180.142906 94.26335) (xy 180.142913 94.263354) (xy 180.27762 94.313596) - (xy 180.277627 94.313598) (xy 180.337155 94.319999) (xy 180.337172 94.32) (xy 181.335 94.32) (xy 181.335 93.38236) - (xy 181.351649 93.389257) (xy 181.506207 93.42) (xy 181.663793 93.42) (xy 181.818351 93.389257) - (xy 181.835 93.38236) (xy 181.835 94.32) (xy 182.832828 94.32) (xy 182.832844 94.319999) (xy 182.892372 94.313598) - (xy 182.892379 94.313596) (xy 183.027086 94.263354) (xy 183.027093 94.26335) (xy 183.142187 94.17719) - (xy 183.14219 94.177187) (xy 183.22835 94.062093) (xy 183.228354 94.062086) (xy 183.278596 93.927379) - (xy 183.278598 93.927372) (xy 183.284999 93.867844) (xy 183.285 93.867827) (xy 183.285 92.87) (xy 182.347361 92.87) - (xy 182.354257 92.853351) (xy 182.385 92.698793) (xy 182.385 92.619995) (xy 185.670234 92.619995) - (xy 185.670234 92.620004) (xy 185.689274 92.874079) (xy 185.745969 93.122477) (xy 185.745974 93.122494) - (xy 185.839059 93.359671) (xy 185.839058 93.359671) (xy 185.966455 93.580327) (xy 185.966462 93.580338) - (xy 186.008453 93.632991) (xy 186.008454 93.632992) (xy 186.659153 92.982292) (xy 186.66605 92.998942) - (xy 186.7536 93.12997) (xy 186.865031 93.241401) (xy 186.996059 93.328951) (xy 187.012706 93.335846) - (xy 186.361814 93.986738) (xy 186.522617 94.096371) (xy 186.522625 94.096376) (xy 186.752177 94.206921) - (xy 186.752175 94.206921) (xy 186.995653 94.282024) (xy 186.995659 94.282026) (xy 187.247596 94.319999) - (xy 187.247605 94.32) (xy 187.502397 94.32) (xy 187.502405 94.319999) (xy 187.754342 94.282026) - (xy 187.754348 94.282024) (xy 187.997825 94.206921) (xy 188.227377 94.096376) (xy 188.227378 94.096375) - (xy 188.388186 93.986738) (xy 187.737295 93.335846) (xy 187.753943 93.328951) (xy 187.884971 93.241401) - (xy 187.996402 93.12997) (xy 188.083952 92.998942) (xy 188.090847 92.982294) (xy 188.741545 93.632992) - (xy 188.741547 93.632991) (xy 188.783545 93.58033) (xy 188.843614 93.476288) (xy 188.894181 93.428073) - (xy 188.962788 93.414849) (xy 189.027652 93.440817) (xy 189.068181 93.497731) (xy 189.075001 93.538288) - (xy 189.075001 93.867844) (xy 189.081402 93.927372) (xy 189.081404 93.927379) (xy 189.131646 94.062086) - (xy 189.13165 94.062093) (xy 189.21781 94.177187) (xy 189.217813 94.17719) (xy 189.332907 94.26335) - (xy 189.332914 94.263354) (xy 189.467621 94.313596) (xy 189.467628 94.313598) (xy 189.527156 94.319999) - (xy 189.527173 94.32) (xy 190.525001 94.32) (xy 190.525001 93.38236) (xy 190.54165 93.389257) (xy 190.696208 93.42) - (xy 190.853794 93.42) (xy 191.008352 93.389257) (xy 191.025001 93.38236) (xy 191.025001 94.32) (xy 192.022829 94.32) - (xy 192.022845 94.319999) (xy 192.082373 94.313598) (xy 192.08238 94.313596) (xy 192.217087 94.263354) - (xy 192.217094 94.26335) (xy 192.332188 94.17719) (xy 192.332191 94.177187) (xy 192.418351 94.062093) - (xy 192.418355 94.062086) (xy 192.468597 93.927379) (xy 192.468599 93.927372) (xy 192.475 93.867844) - (xy 192.475001 93.867827) (xy 192.475001 92.87) (xy 191.537362 92.87) (xy 191.544258 92.853351) - (xy 191.575001 92.698793) (xy 191.575001 92.541207) (xy 191.544258 92.386649) (xy 191.537362 92.37) - (xy 192.475001 92.37) (xy 192.475001 91.372172) (xy 192.475 91.372155) (xy 192.468599 91.312627) - (xy 192.468597 91.31262) (xy 192.418355 91.177913) (xy 192.418351 91.177906) (xy 192.332191 91.062812) - (xy 192.332188 91.062809) (xy 192.217094 90.976649) (xy 192.217087 90.976645) (xy 192.08238 90.926403) - (xy 192.082373 90.926401) (xy 192.022845 90.92) (xy 191.025001 90.92) (xy 191.025001 91.857639) - (xy 191.008352 91.850743) (xy 190.853794 91.82) (xy 190.696208 91.82) (xy 190.54165 91.850743) (xy 190.525001 91.857639) - (xy 190.525001 90.92) (xy 189.527156 90.92) (xy 189.467628 90.926401) (xy 189.467621 90.926403) - (xy 189.332914 90.976645) (xy 189.332907 90.976649) (xy 189.217813 91.062809) (xy 189.21781 91.062812) - (xy 189.13165 91.177906) (xy 189.131646 91.177913) (xy 189.081404 91.31262) (xy 189.081402 91.312627) - (xy 189.075001 91.372155) (xy 189.075001 91.701711) (xy 189.055316 91.76875) (xy 189.002512 91.814505) - (xy 188.933354 91.824449) (xy 188.869798 91.795424) (xy 188.843614 91.763712) (xy 188.783544 91.659669) - (xy 188.741546 91.607006) (xy 188.090847 92.257705) (xy 188.083952 92.241058) (xy 187.996402 92.11003) - (xy 187.884971 91.998599) (xy 187.753943 91.911049) (xy 187.737294 91.904152) (xy 188.388186 91.25326) - (xy 188.227385 91.143628) (xy 188.227377 91.143623) (xy 187.997824 91.033078) (xy 187.997826 91.033078) - (xy 187.754348 90.957975) (xy 187.754342 90.957973) (xy 187.502405 90.92) (xy 187.247596 90.92) - (xy 186.995659 90.957973) (xy 186.995653 90.957975) (xy 186.752176 91.033078) (xy 186.522623 91.143625) - (xy 186.52261 91.143632) (xy 186.361814 91.253259) (xy 187.012707 91.904152) (xy 186.996059 91.911049) - (xy 186.865031 91.998599) (xy 186.7536 92.11003) (xy 186.66605 92.241058) (xy 186.659153 92.257706) - (xy 186.008453 91.607006) (xy 185.966458 91.659667) (xy 185.839059 91.880328) (xy 185.745974 92.117505) - (xy 185.745969 92.117522) (xy 185.689274 92.36592) (xy 185.670234 92.619995) (xy 182.385 92.619995) - (xy 182.385 92.541207) (xy 182.354257 92.386649) (xy 182.347361 92.37) (xy 183.285 92.37) (xy 183.285 91.372172) - (xy 183.284999 91.372155) (xy 183.278598 91.312627) (xy 183.278596 91.31262) (xy 183.228354 91.177913) - (xy 183.22835 91.177906) (xy 183.14219 91.062812) (xy 183.142187 91.062809) (xy 183.027093 90.976649) - (xy 183.027086 90.976645) (xy 182.892379 90.926403) (xy 182.892372 90.926401) (xy 182.832844 90.92) - (xy 181.835 90.92) (xy 181.835 91.857639) (xy 181.818351 91.850743) (xy 181.663793 91.82) (xy 181.506207 91.82) - (xy 181.351649 91.850743) (xy 181.335 91.857639) (xy 181.335 90.92) (xy 180.337155 90.92) (xy 180.277627 90.926401) - (xy 180.27762 90.926403) (xy 180.142913 90.976645) (xy 180.142906 90.976649) (xy 180.027812 91.062809) - (xy 180.027809 91.062812) (xy 179.941649 91.177906) (xy 179.941645 91.177913) (xy 179.891403 91.31262) - (xy 179.891401 91.312627) (xy 179.885 91.372155) (xy 179.885 91.701711) (xy 179.865315 91.76875) - (xy 179.812511 91.814505) (xy 179.743353 91.824449) (xy 179.679797 91.795424) (xy 179.653613 91.763712) - (xy 179.593543 91.659669) (xy 179.551545 91.607006) (xy 178.900846 92.257705) (xy 178.893951 92.241058) - (xy 178.806401 92.11003) (xy 178.69497 91.998599) (xy 178.563942 91.911049) (xy 178.547293 91.904152) - (xy 179.198185 91.25326) (xy 179.037384 91.143628) (xy 179.037376 91.143623) (xy 178.807823 91.033078) - (xy 178.807825 91.033078) (xy 178.564347 90.957975) (xy 178.564341 90.957973) (xy 178.312404 90.92) - (xy 178.057595 90.92) (xy 177.805658 90.957973) (xy 177.805652 90.957975) (xy 177.562175 91.033078) - (xy 177.332622 91.143625) (xy 177.332609 91.143632) (xy 177.171813 91.253259) (xy 177.822706 91.904152) - (xy 177.806058 91.911049) (xy 177.67503 91.998599) (xy 177.563599 92.11003) (xy 177.476049 92.241058) - (xy 177.469152 92.257706) (xy 176.818452 91.607006) (xy 176.776457 91.659667) (xy 176.649058 91.880328) - (xy 176.555973 92.117505) (xy 176.555968 92.117522) (xy 176.499273 92.36592) (xy 176.480233 92.619995) - (xy 170.5 92.619995) (xy 170.5 86.906092) (xy 170.500597 86.893938) (xy 170.513049 86.767511) (xy 170.518018 86.717056) + (xy 199.572102 100.913974) (xy 199.678027 101.045761) (xy 199.694378 101.064203) (xy 199.694413 101.06424) + (xy 199.711097 101.08132) (xy 199.711141 101.081363) (xy 199.729236 101.098175) (xy 199.858524 101.207145) + (xy 199.878157 101.222132) (xy 199.897868 101.235722) (xy 199.918861 101.248745) (xy 200.066674 101.330823) + (xy 200.088819 101.341755) (xy 200.103757 101.348251) (xy 200.11077 101.351301) (xy 200.110776 101.351303) + (xy 200.11078 101.351305) (xy 200.133885 101.36005) (xy 200.166129 101.370502) (xy 200.195632 101.380066) + (xy 200.195637 101.380067) (xy 200.19564 101.380068) (xy 200.243579 101.390649) (xy 200.243584 101.390649) + (xy 200.243586 101.39065) (xy 200.251555 101.391619) (xy 200.290661 101.396375) (xy 200.309284 101.397837) + (xy 200.312387 101.398081) (xy 200.312388 101.398081) (xy 200.31239 101.398081) (xy 200.386422 101.386083) + (xy 200.410796 101.382134) (xy 200.437671 101.372109) (xy 200.50736 101.367124) (xy 200.568684 101.400608) + (xy 200.596945 101.444318) (xy 200.619777 101.50452) (xy 200.709514 101.634527) (xy 200.827757 101.73928) + (xy 200.827759 101.739281) (xy 200.967631 101.812693) (xy 201.121011 101.850497) (xy 201.121012 101.850497) + (xy 201.278982 101.850497) (xy 201.432362 101.812693) (xy 201.57223 101.739284) (xy 201.572231 101.739282) + (xy 201.572237 101.73928) (xy 201.597997 101.716458) (xy 201.661227 101.686738) (xy 201.73049 101.69592) + (xy 201.739926 101.700593) (xy 201.805667 101.736707) (xy 201.805669 101.736708) (xy 201.846209 101.751946) + (xy 201.873737 101.762293) (xy 201.873739 101.762293) (xy 201.873743 101.762295) (xy 254.131746 113.269438) + (xy 259.142157 114.372724) (xy 259.153726 114.375865) (xy 259.284967 114.418406) (xy 259.306928 114.427955) + (xy 259.411393 114.485963) (xy 259.431099 114.499549) (xy 259.522489 114.576577) (xy 259.539222 114.593706) + (xy 259.614075 114.686835) (xy 259.627206 114.706862) (xy 259.682772 114.812666) (xy 259.691805 114.834837) + (xy 259.696183 114.8495) (xy 259.725996 114.949347) (xy 259.730599 114.972849) (xy 259.74392 115.110146) + (xy 259.7445 115.122121) (xy 259.7445 115.412396) (xy 259.746461 115.443987) (xy 259.750256 115.474432) + (xy 259.75026 115.474455) (xy 259.756106 115.505521) (xy 259.756521 115.507401) (xy 259.756462 115.507413) + (xy 259.756467 115.507439) (xy 259.75639 115.507453) (xy 259.759359 115.525262) (xy 259.77299 115.689758) + (xy 259.77299 115.710232) (xy 259.765497 115.800671) (xy 259.765497 115.800672) (xy 259.759359 115.874735) + (xy 259.756395 115.892521) (xy 259.756531 115.892551) (xy 259.756114 115.894441) (xy 259.750256 115.92556) + (xy 259.746462 115.956005) (xy 259.74646 115.956023) (xy 259.7445 115.987598) (xy 259.7445 117.555202) + (xy 259.724815 117.622241) (xy 259.672011 117.667996) (xy 259.602853 117.67794) (xy 259.544338 117.653055) + (xy 259.472455 117.597107) (xy 259.404906 117.544531) (xy 259.404903 117.544529) (xy 259.4049 117.544527) + (xy 259.204432 117.43604) (xy 259.204429 117.436039) (xy 259.204426 117.436037) (xy 259.20442 117.436035) + (xy 259.204418 117.436034) (xy 258.988826 117.36202) (xy 258.820188 117.33388) (xy 258.763977 117.3245) + (xy 258.536023 117.3245) (xy 258.491053 117.332004) (xy 258.311173 117.36202) (xy 258.095581 117.436034) + (xy 258.095567 117.43604) (xy 257.895099 117.544527) (xy 257.89509 117.544533) (xy 257.715212 117.684538) + (xy 257.715208 117.684541) (xy 257.560814 117.852257) (xy 257.436137 118.043091) (xy 257.344569 118.251844) + (xy 257.28861 118.47282) (xy 257.288608 118.472831) (xy 257.269786 118.699993) (xy 257.269786 118.700006) + (xy 257.289033 118.932287) (xy 257.287831 118.932386) (xy 257.280131 118.99603) (xy 257.253893 119.034737) + (xy 254.675451 121.613181) (xy 254.614128 121.646666) (xy 254.58777 121.6495) (xy 235.36223 121.6495) + (xy 235.295191 121.629815) (xy 235.274549 121.613181) (xy 229.878421 116.217052) (xy 229.878414 116.217046) + (xy 229.778818 116.150499) (xy 229.778817 116.150499) (xy 229.755495 116.134916) (xy 229.755488 116.134912) + (xy 229.618917 116.078343) (xy 229.618907 116.07834) (xy 229.47392 116.0495) (xy 229.473918 116.0495) + (xy 193.943157 116.0495) (xy 193.876118 116.029815) (xy 193.868846 116.024767) (xy 193.817331 115.986203) + (xy 193.817328 115.986201) (xy 193.682486 115.935909) (xy 193.682485 115.935908) (xy 193.682483 115.935908) + (xy 193.622873 115.929499) (xy 193.622863 115.929499) (xy 192.927129 115.929499) (xy 192.927123 115.9295) + (xy 192.867516 115.935907) (xy 192.732671 115.986201) (xy 192.732668 115.986203) (xy 192.681154 116.024767) + (xy 192.61569 116.049184) (xy 192.606843 116.0495) (xy 192.247387 116.0495) (xy 192.180348 116.029815) + (xy 192.134593 115.977011) (xy 192.124649 115.907853) (xy 192.145337 115.85506) (xy 192.148352 115.850692) + (xy 192.18022 115.804523) (xy 192.236237 115.656818) (xy 192.255278 115.5) (xy 192.249102 115.449144) + (xy 192.260561 115.380224) (xy 192.284514 115.346521) (xy 192.864218 114.766817) (xy 192.925539 114.733334) + (xy 192.951888 114.7305) (xy 193.622872 114.7305) (xy 193.682483 114.724092) (xy 193.817331 114.673797) + (xy 193.932546 114.587547) (xy 194.018796 114.472332) (xy 194.069091 114.337484) (xy 194.0755 114.277874) + (xy 194.075499 113.582129) (xy 194.069091 113.522518) (xy 194.042254 113.450565) (xy 194.018797 113.387672) + (xy 194.018793 113.387665) (xy 193.932547 113.272456) (xy 193.932544 113.272453) (xy 193.817335 113.186207) + (xy 193.817328 113.186203) (xy 193.682486 113.135911) (xy 193.682485 113.13591) (xy 193.682483 113.13591) + (xy 193.622873 113.129501) (xy 193.622863 113.129501) (xy 192.927129 113.129501) (xy 192.927123 113.129502) + (xy 192.867516 113.135909) (xy 192.732671 113.186203) (xy 192.732664 113.186207) (xy 192.617455 113.272453) + (xy 192.617452 113.272456) (xy 192.531206 113.387665) (xy 192.531202 113.387672) (xy 192.480908 113.522518) + (xy 192.474501 113.582117) (xy 192.474501 113.582124) (xy 192.4745 113.582136) (xy 192.4745 114.043099) + (xy 192.454815 114.110138) (xy 192.438181 114.13078) (xy 191.75578 114.813181) (xy 191.694457 114.846666) + (xy 191.668099 114.8495) (xy 191.521014 114.8495) (xy 191.367634 114.887303) (xy 191.227762 114.960715) + (xy 191.109516 115.065471) (xy 191.019781 115.195475) (xy 191.01978 115.195476) (xy 190.963762 115.343181) + (xy 190.944722 115.499999) (xy 190.944722 115.5) (xy 190.963762 115.656818) (xy 191.01978 115.804523) + (xy 191.019781 115.804524) (xy 191.054663 115.85506) (xy 191.076546 115.921415) (xy 191.059081 115.989066) + (xy 191.007813 116.036536) (xy 190.952613 116.0495) (xy 188.976402 116.0495) (xy 188.952209 116.047117) + (xy 188.913918 116.0395) (xy 188.913917 116.0395) (xy 188.766082 116.0395) (xy 188.76608 116.0395) + (xy 188.621092 116.06834) (xy 188.621082 116.068343) (xy 188.484511 116.124912) (xy 188.484499 116.124919) + (xy 188.446217 116.150499) (xy 188.446216 116.1505) (xy 188.361581 116.20705) (xy 188.309474 116.259158) + (xy 188.257048 116.311584) (xy 188.257046 116.311586) (xy 187.874831 116.693799) (xy 187.813508 116.727284) + (xy 187.743816 116.7223) (xy 187.708485 116.701971) (xy 187.698527 116.693799) (xy 187.602334 116.614855) + (xy 187.585136 116.597655) (xy 187.583637 116.595828) (xy 187.556332 116.531514) (xy 187.5555 116.517175) + (xy 187.5555 115.173599) (xy 187.575185 115.10656) (xy 187.627989 115.060805) (xy 187.697147 115.050861) + (xy 187.760703 115.079886) (xy 187.761675 115.080737) (xy 187.82776 115.139283) (xy 187.827762 115.139284) + (xy 187.967634 115.212696) (xy 188.121014 115.2505) (xy 188.121015 115.2505) (xy 188.278985 115.2505) + (xy 188.432365 115.212696) (xy 188.57224 115.139283) (xy 188.690483 115.03453) (xy 188.78022 114.904523) + (xy 188.836237 114.756818) (xy 188.855278 114.6) (xy 188.842141 114.491802) (xy 188.836237 114.443181) + (xy 188.796151 114.337484) (xy 188.78022 114.295477) (xy 188.690483 114.16547) (xy 188.57224 114.060717) + (xy 188.572238 114.060716) (xy 188.572237 114.060715) (xy 188.432365 113.987303) (xy 188.278986 113.9495) + (xy 188.278985 113.9495) (xy 188.1995 113.9495) (xy 188.132461 113.929815) (xy 188.086706 113.877011) + (xy 188.0755 113.8255) (xy 188.0755 113.450567) (xy 188.0755 113.450565) (xy 188.04991 113.355062) + (xy 188.000475 113.269438) (xy 187.930562 113.199525) (xy 187.330563 112.599526) (xy 187.330562 112.599525) + (xy 187.244938 112.55009) (xy 187.197186 112.537295) (xy 187.197184 112.537294) (xy 187.197182 112.537293) + (xy 187.149436 112.5245) (xy 187.149435 112.5245) (xy 171.9069 112.5245) (xy 171.839861 112.504815) + (xy 171.819219 112.488181) (xy 170.536319 111.205281) (xy 170.502834 111.143958) (xy 170.5 111.1176) + (xy 170.5 107.944995) (xy 178.925233 107.944995) (xy 178.925233 107.945004) (xy 178.944273 108.199079) + (xy 179.000968 108.447477) (xy 179.000973 108.447494) (xy 179.094058 108.684671) (xy 179.094057 108.684671) + (xy 179.221454 108.905327) (xy 179.221461 108.905338) (xy 179.263452 108.957991) (xy 179.263453 108.957992) + (xy 179.914152 108.307292) (xy 179.921049 108.323942) (xy 180.008599 108.45497) (xy 180.12003 108.566401) + (xy 180.251058 108.653951) (xy 180.267705 108.660846) (xy 179.616813 109.311738) (xy 179.777616 109.421371) + (xy 179.777624 109.421376) (xy 180.007176 109.531921) (xy 180.007174 109.531921) (xy 180.250652 109.607024) + (xy 180.250658 109.607026) (xy 180.502595 109.644999) (xy 180.502604 109.645) (xy 180.757396 109.645) + (xy 180.757404 109.644999) (xy 181.009341 109.607026) (xy 181.009347 109.607024) (xy 181.252824 109.531921) + (xy 181.482376 109.421376) (xy 181.482377 109.421375) (xy 181.643185 109.311738) (xy 180.992294 108.660846) + (xy 181.008942 108.653951) (xy 181.13997 108.566401) (xy 181.251401 108.45497) (xy 181.338951 108.323942) + (xy 181.345846 108.307294) (xy 181.996544 108.957992) (xy 181.996546 108.957991) (xy 182.038544 108.90533) + (xy 182.165941 108.684671) (xy 182.259026 108.447494) (xy 182.259031 108.447477) (xy 182.315726 108.199079) + (xy 182.334767 107.945004) (xy 182.334767 107.944995) (xy 182.315726 107.69092) (xy 182.259031 107.442522) + (xy 182.259026 107.442505) (xy 182.165941 107.205328) (xy 182.165942 107.205328) (xy 182.038545 106.984672) + (xy 181.996545 106.932006) (xy 181.345846 107.582705) (xy 181.338951 107.566058) (xy 181.251401 107.43503) + (xy 181.13997 107.323599) (xy 181.008942 107.236049) (xy 180.992293 107.229152) (xy 181.643185 106.57826) + (xy 181.486529 106.471454) (xy 181.442227 106.417425) (xy 181.434167 106.348022) (xy 181.46491 106.285279) + (xy 181.524694 106.249117) (xy 181.55638 106.245) (xy 181.877828 106.245) (xy 181.877844 106.244999) + (xy 181.937372 106.238598) (xy 181.937379 106.238596) (xy 182.072086 106.188354) (xy 182.072093 106.18835) + (xy 182.187187 106.10219) (xy 182.18719 106.102187) (xy 182.27335 105.987093) (xy 182.273354 105.987086) + (xy 182.323596 105.852379) (xy 182.323598 105.852372) (xy 182.329999 105.792844) (xy 182.33 105.792827) + (xy 182.33 104.795) (xy 181.392361 104.795) (xy 181.399257 104.778351) (xy 181.43 104.623793) (xy 181.43 104.466207) + (xy 181.399257 104.311649) (xy 181.392361 104.295) (xy 182.33 104.295) (xy 182.33 103.297172) (xy 182.329999 103.297155) + (xy 182.323598 103.237627) (xy 182.323596 103.23762) (xy 182.273354 103.102913) (xy 182.27335 103.102906) + (xy 182.18719 102.987812) (xy 182.187187 102.987809) (xy 182.072093 102.901649) (xy 182.072086 102.901645) + (xy 181.937379 102.851403) (xy 181.937372 102.851401) (xy 181.877844 102.845) (xy 180.88 102.845) + (xy 180.88 103.782639) (xy 180.863351 103.775743) (xy 180.708793 103.745) (xy 180.551207 103.745) + (xy 180.396649 103.775743) (xy 180.38 103.782639) (xy 180.38 102.845) (xy 179.382155 102.845) (xy 179.322627 102.851401) + (xy 179.32262 102.851403) (xy 179.187913 102.901645) (xy 179.187906 102.901649) (xy 179.072812 102.987809) + (xy 179.072809 102.987812) (xy 178.986649 103.102906) (xy 178.986645 103.102913) (xy 178.936403 103.23762) + (xy 178.936401 103.237627) (xy 178.93 103.297155) (xy 178.93 104.295) (xy 179.867639 104.295) (xy 179.860743 104.311649) + (xy 179.83 104.466207) (xy 179.83 104.623793) (xy 179.860743 104.778351) (xy 179.867639 104.795) + (xy 178.93 104.795) (xy 178.93 105.792844) (xy 178.936401 105.852372) (xy 178.936403 105.852379) + (xy 178.986645 105.987086) (xy 178.986649 105.987093) (xy 179.072809 106.102187) (xy 179.072812 106.10219) + (xy 179.187906 106.18835) (xy 179.187913 106.188354) (xy 179.32262 106.238596) (xy 179.322627 106.238598) + (xy 179.382155 106.244999) (xy 179.382172 106.245) (xy 179.70362 106.245) (xy 179.770659 106.264685) + (xy 179.816414 106.317489) (xy 179.826358 106.386647) (xy 179.797333 106.450203) (xy 179.773471 106.471454) + (xy 179.616813 106.578259) (xy 180.267706 107.229152) (xy 180.251058 107.236049) (xy 180.12003 107.323599) + (xy 180.008599 107.43503) (xy 179.921049 107.566058) (xy 179.914152 107.582706) (xy 179.263452 106.932006) + (xy 179.221457 106.984667) (xy 179.094058 107.205328) (xy 179.000973 107.442505) (xy 179.000968 107.442522) + (xy 178.944273 107.69092) (xy 178.925233 107.944995) (xy 170.5 107.944995) (xy 170.5 92.619995) + (xy 176.480233 92.619995) (xy 176.480233 92.620004) (xy 176.499273 92.874079) (xy 176.555968 93.122477) + (xy 176.555973 93.122494) (xy 176.649058 93.359671) (xy 176.649057 93.359671) (xy 176.776454 93.580327) + (xy 176.776461 93.580338) (xy 176.818452 93.632991) (xy 176.818453 93.632992) (xy 177.469152 92.982292) + (xy 177.476049 92.998942) (xy 177.563599 93.12997) (xy 177.67503 93.241401) (xy 177.806058 93.328951) + (xy 177.822705 93.335846) (xy 177.171813 93.986738) (xy 177.332616 94.096371) (xy 177.332624 94.096376) + (xy 177.562176 94.206921) (xy 177.562174 94.206921) (xy 177.805652 94.282024) (xy 177.805658 94.282026) + (xy 178.057595 94.319999) (xy 178.057604 94.32) (xy 178.312396 94.32) (xy 178.312404 94.319999) + (xy 178.564341 94.282026) (xy 178.564347 94.282024) (xy 178.807824 94.206921) (xy 179.037376 94.096376) + (xy 179.037377 94.096375) (xy 179.198185 93.986738) (xy 178.547294 93.335846) (xy 178.563942 93.328951) + (xy 178.69497 93.241401) (xy 178.806401 93.12997) (xy 178.893951 92.998942) (xy 178.900846 92.982294) + (xy 179.551544 93.632992) (xy 179.551546 93.632991) (xy 179.593544 93.58033) (xy 179.653613 93.476288) + (xy 179.70418 93.428073) (xy 179.772787 93.414849) (xy 179.837651 93.440817) (xy 179.87818 93.497731) + (xy 179.885 93.538288) (xy 179.885 93.867844) (xy 179.891401 93.927372) (xy 179.891403 93.927379) + (xy 179.941645 94.062086) (xy 179.941649 94.062093) (xy 180.027809 94.177187) (xy 180.027812 94.17719) + (xy 180.142906 94.26335) (xy 180.142913 94.263354) (xy 180.27762 94.313596) (xy 180.277627 94.313598) + (xy 180.337155 94.319999) (xy 180.337172 94.32) (xy 181.335 94.32) (xy 181.335 93.38236) (xy 181.351649 93.389257) + (xy 181.506207 93.42) (xy 181.663793 93.42) (xy 181.818351 93.389257) (xy 181.835 93.38236) (xy 181.835 94.32) + (xy 182.832828 94.32) (xy 182.832844 94.319999) (xy 182.892372 94.313598) (xy 182.892379 94.313596) + (xy 183.027086 94.263354) (xy 183.027093 94.26335) (xy 183.142187 94.17719) (xy 183.14219 94.177187) + (xy 183.22835 94.062093) (xy 183.228354 94.062086) (xy 183.278596 93.927379) (xy 183.278598 93.927372) + (xy 183.284999 93.867844) (xy 183.285 93.867827) (xy 183.285 92.87) (xy 182.347361 92.87) (xy 182.354257 92.853351) + (xy 182.385 92.698793) (xy 182.385 92.619995) (xy 185.670234 92.619995) (xy 185.670234 92.620004) + (xy 185.689274 92.874079) (xy 185.745969 93.122477) (xy 185.745974 93.122494) (xy 185.839059 93.359671) + (xy 185.839058 93.359671) (xy 185.966455 93.580327) (xy 185.966462 93.580338) (xy 186.008453 93.632991) + (xy 186.008454 93.632992) (xy 186.659153 92.982292) (xy 186.66605 92.998942) (xy 186.7536 93.12997) + (xy 186.865031 93.241401) (xy 186.996059 93.328951) (xy 187.012706 93.335846) (xy 186.361814 93.986738) + (xy 186.522617 94.096371) (xy 186.522625 94.096376) (xy 186.752177 94.206921) (xy 186.752175 94.206921) + (xy 186.995653 94.282024) (xy 186.995659 94.282026) (xy 187.247596 94.319999) (xy 187.247605 94.32) + (xy 187.502397 94.32) (xy 187.502405 94.319999) (xy 187.754342 94.282026) (xy 187.754348 94.282024) + (xy 187.997825 94.206921) (xy 188.227377 94.096376) (xy 188.227378 94.096375) (xy 188.388186 93.986738) + (xy 187.737295 93.335846) (xy 187.753943 93.328951) (xy 187.884971 93.241401) (xy 187.996402 93.12997) + (xy 188.083952 92.998942) (xy 188.090847 92.982294) (xy 188.741545 93.632992) (xy 188.741547 93.632991) + (xy 188.783545 93.58033) (xy 188.843614 93.476288) (xy 188.894181 93.428073) (xy 188.962788 93.414849) + (xy 189.027652 93.440817) (xy 189.068181 93.497731) (xy 189.075001 93.538288) (xy 189.075001 93.867844) + (xy 189.081402 93.927372) (xy 189.081404 93.927379) (xy 189.131646 94.062086) (xy 189.13165 94.062093) + (xy 189.21781 94.177187) (xy 189.217813 94.17719) (xy 189.332907 94.26335) (xy 189.332914 94.263354) + (xy 189.467621 94.313596) (xy 189.467628 94.313598) (xy 189.527156 94.319999) (xy 189.527173 94.32) + (xy 190.525001 94.32) (xy 190.525001 93.38236) (xy 190.54165 93.389257) (xy 190.696208 93.42) (xy 190.853794 93.42) + (xy 191.008352 93.389257) (xy 191.025001 93.38236) (xy 191.025001 94.32) (xy 192.022829 94.32) (xy 192.022845 94.319999) + (xy 192.082373 94.313598) (xy 192.08238 94.313596) (xy 192.217087 94.263354) (xy 192.217094 94.26335) + (xy 192.332188 94.17719) (xy 192.332191 94.177187) (xy 192.418351 94.062093) (xy 192.418355 94.062086) + (xy 192.468597 93.927379) (xy 192.468599 93.927372) (xy 192.475 93.867844) (xy 192.475001 93.867827) + (xy 192.475001 92.87) (xy 191.537362 92.87) (xy 191.544258 92.853351) (xy 191.575001 92.698793) + (xy 191.575001 92.541207) (xy 191.544258 92.386649) (xy 191.537362 92.37) (xy 192.475001 92.37) + (xy 192.475001 91.372172) (xy 192.475 91.372155) (xy 192.468599 91.312627) (xy 192.468597 91.31262) + (xy 192.418355 91.177913) (xy 192.418351 91.177906) (xy 192.332191 91.062812) (xy 192.332188 91.062809) + (xy 192.217094 90.976649) (xy 192.217087 90.976645) (xy 192.08238 90.926403) (xy 192.082373 90.926401) + (xy 192.022845 90.92) (xy 191.025001 90.92) (xy 191.025001 91.857639) (xy 191.008352 91.850743) + (xy 190.853794 91.82) (xy 190.696208 91.82) (xy 190.54165 91.850743) (xy 190.525001 91.857639) (xy 190.525001 90.92) + (xy 189.527156 90.92) (xy 189.467628 90.926401) (xy 189.467621 90.926403) (xy 189.332914 90.976645) + (xy 189.332907 90.976649) (xy 189.217813 91.062809) (xy 189.21781 91.062812) (xy 189.13165 91.177906) + (xy 189.131646 91.177913) (xy 189.081404 91.31262) (xy 189.081402 91.312627) (xy 189.075001 91.372155) + (xy 189.075001 91.701711) (xy 189.055316 91.76875) (xy 189.002512 91.814505) (xy 188.933354 91.824449) + (xy 188.869798 91.795424) (xy 188.843614 91.763712) (xy 188.783544 91.659669) (xy 188.741546 91.607006) + (xy 188.090847 92.257705) (xy 188.083952 92.241058) (xy 187.996402 92.11003) (xy 187.884971 91.998599) + (xy 187.753943 91.911049) (xy 187.737294 91.904152) (xy 188.388186 91.25326) (xy 188.227385 91.143628) + (xy 188.227377 91.143623) (xy 187.997824 91.033078) (xy 187.997826 91.033078) (xy 187.754348 90.957975) + (xy 187.754342 90.957973) (xy 187.502405 90.92) (xy 187.247596 90.92) (xy 186.995659 90.957973) + (xy 186.995653 90.957975) (xy 186.752176 91.033078) (xy 186.522623 91.143625) (xy 186.52261 91.143632) + (xy 186.361814 91.253259) (xy 187.012707 91.904152) (xy 186.996059 91.911049) (xy 186.865031 91.998599) + (xy 186.7536 92.11003) (xy 186.66605 92.241058) (xy 186.659153 92.257706) (xy 186.008453 91.607006) + (xy 185.966458 91.659667) (xy 185.839059 91.880328) (xy 185.745974 92.117505) (xy 185.745969 92.117522) + (xy 185.689274 92.36592) (xy 185.670234 92.619995) (xy 182.385 92.619995) (xy 182.385 92.541207) + (xy 182.354257 92.386649) (xy 182.347361 92.37) (xy 183.285 92.37) (xy 183.285 91.372172) (xy 183.284999 91.372155) + (xy 183.278598 91.312627) (xy 183.278596 91.31262) (xy 183.228354 91.177913) (xy 183.22835 91.177906) + (xy 183.14219 91.062812) (xy 183.142187 91.062809) (xy 183.027093 90.976649) (xy 183.027086 90.976645) + (xy 182.892379 90.926403) (xy 182.892372 90.926401) (xy 182.832844 90.92) (xy 181.835 90.92) (xy 181.835 91.857639) + (xy 181.818351 91.850743) (xy 181.663793 91.82) (xy 181.506207 91.82) (xy 181.351649 91.850743) + (xy 181.335 91.857639) (xy 181.335 90.92) (xy 180.337155 90.92) (xy 180.277627 90.926401) (xy 180.27762 90.926403) + (xy 180.142913 90.976645) (xy 180.142906 90.976649) (xy 180.027812 91.062809) (xy 180.027809 91.062812) + (xy 179.941649 91.177906) (xy 179.941645 91.177913) (xy 179.891403 91.31262) (xy 179.891401 91.312627) + (xy 179.885 91.372155) (xy 179.885 91.701711) (xy 179.865315 91.76875) (xy 179.812511 91.814505) + (xy 179.743353 91.824449) (xy 179.679797 91.795424) (xy 179.653613 91.763712) (xy 179.593543 91.659669) + (xy 179.551545 91.607006) (xy 178.900846 92.257705) (xy 178.893951 92.241058) (xy 178.806401 92.11003) + (xy 178.69497 91.998599) (xy 178.563942 91.911049) (xy 178.547293 91.904152) (xy 179.198185 91.25326) + (xy 179.037384 91.143628) (xy 179.037376 91.143623) (xy 178.807823 91.033078) (xy 178.807825 91.033078) + (xy 178.564347 90.957975) (xy 178.564341 90.957973) (xy 178.312404 90.92) (xy 178.057595 90.92) + (xy 177.805658 90.957973) (xy 177.805652 90.957975) (xy 177.562175 91.033078) (xy 177.332622 91.143625) + (xy 177.332609 91.143632) (xy 177.171813 91.253259) (xy 177.822706 91.904152) (xy 177.806058 91.911049) + (xy 177.67503 91.998599) (xy 177.563599 92.11003) (xy 177.476049 92.241058) (xy 177.469152 92.257706) + (xy 176.818452 91.607006) (xy 176.776457 91.659667) (xy 176.649058 91.880328) (xy 176.555973 92.117505) + (xy 176.555968 92.117522) (xy 176.499273 92.36592) (xy 176.480233 92.619995) (xy 170.5 92.619995) + (xy 170.5 86.906092) (xy 170.500597 86.893938) (xy 170.513049 86.767511) (xy 170.518018 86.717056) (xy 170.522757 86.693232) (xy 170.572577 86.528994) (xy 170.581875 86.506549) (xy 170.662775 86.355195) (xy 170.676272 86.334995) (xy 170.785149 86.202328) (xy 170.802328 86.185149) (xy 170.934995 86.076272) (xy 170.955195 86.062775) (xy 171.106549 85.981875) (xy 171.128994 85.972577) (xy 171.293232 85.922757) @@ -156912,58 +161033,60 @@ (xy 255.518435 162.911665) (xy 255.582939 162.918018) (xy 255.606769 162.922757) (xy 255.771001 162.972576) (xy 255.793453 162.981877) (xy 255.872906 163.024345) (xy 255.944798 163.062772) (xy 255.965008 163.076276) (xy 256.087684 163.176953) (xy 256.097666 163.185145) (xy 256.114854 163.202333) (xy 256.216353 163.32601) - (xy 256.243666 163.390319) (xy 256.2445 163.404674) (xy 256.2445 164.024908) (xy 256.244503 164.024937) - (xy 256.248683 164.070949) (xy 256.248684 164.070956) (xy 256.256743 164.114935) (xy 256.256748 164.114955) - (xy 256.26916 164.159478) (xy 256.26916 164.15948) (xy 256.280999 164.190696) (xy 256.288153 164.219719) - (xy 256.296086 164.285052) (xy 256.296086 164.314946) (xy 256.288153 164.380279) (xy 256.281 164.409301) - (xy 256.269163 164.440512) (xy 256.25674 164.485075) (xy 256.248683 164.52905) (xy 256.2445 164.575091) - (xy 256.2445 165.324906) (xy 256.248683 165.370949) (xy 256.248684 165.370956) (xy 256.256743 165.414935) - (xy 256.256748 165.414955) (xy 256.26916 165.459478) (xy 256.26916 165.45948) (xy 256.280999 165.490696) - (xy 256.288153 165.519719) (xy 256.296086 165.585052) (xy 256.296086 165.614946) (xy 256.288153 165.680279) - (xy 256.281 165.709301) (xy 256.269163 165.740512) (xy 256.25674 165.785075) (xy 256.248683 165.82905) - (xy 256.2445 165.875091) (xy 256.2445 166.624906) (xy 256.248683 166.670949) (xy 256.248684 166.670956) - (xy 256.256743 166.714935) (xy 256.256748 166.714955) (xy 256.26916 166.759478) (xy 256.26916 166.75948) - (xy 256.280999 166.790696) (xy 256.288153 166.819719) (xy 256.296086 166.885052) (xy 256.296086 166.914946) - (xy 256.288153 166.980279) (xy 256.281 167.009301) (xy 256.269163 167.040512) (xy 256.25674 167.085075) - (xy 256.248683 167.12905) (xy 256.2445 167.175091) (xy 256.2445 167.924906) (xy 256.248683 167.970949) - (xy 256.248684 167.970956) (xy 256.256743 168.014935) (xy 256.256748 168.014955) (xy 256.26916 168.059478) - (xy 256.26916 168.05948) (xy 256.280999 168.090696) (xy 256.288153 168.119719) (xy 256.296086 168.185052) - (xy 256.296086 168.214946) (xy 256.288153 168.280279) (xy 256.281 168.309301) (xy 256.269163 168.340512) - (xy 256.25674 168.385075) (xy 256.248683 168.42905) (xy 256.2445 168.475091) (xy 256.2445 169.224906) - (xy 256.248683 169.270949) (xy 256.248684 169.270956) (xy 256.256743 169.314935) (xy 256.256748 169.314955) - (xy 256.26916 169.359478) (xy 256.26916 169.35948) (xy 256.280999 169.390696) (xy 256.288153 169.419719) - (xy 256.296086 169.485052) (xy 256.296086 169.514946) (xy 256.288153 169.580279) (xy 256.281 169.609301) - (xy 256.269163 169.640512) (xy 256.25674 169.685075) (xy 256.248683 169.72905) (xy 256.246477 169.753334) - (xy 256.244551 169.774535) (xy 256.2445 169.775091) (xy 256.2445 170.524906) (xy 256.248683 170.570949) - (xy 256.248684 170.570956) (xy 256.256743 170.614935) (xy 256.256748 170.614955) (xy 256.26916 170.659478) - (xy 256.26916 170.65948) (xy 256.280999 170.690696) (xy 256.288153 170.719719) (xy 256.296086 170.785052) - (xy 256.296086 170.814946) (xy 256.288153 170.880279) (xy 256.281 170.909301) (xy 256.269163 170.940512) - (xy 256.25674 170.985075) (xy 256.248683 171.02905) (xy 256.2445 171.075091) (xy 256.2445 171.824906) - (xy 256.248683 171.870949) (xy 256.248684 171.870956) (xy 256.256743 171.914935) (xy 256.256748 171.914955) - (xy 256.26916 171.959478) (xy 256.26916 171.95948) (xy 256.280999 171.990696) (xy 256.288153 172.019719) - (xy 256.296086 172.085052) (xy 256.296086 172.114946) (xy 256.288153 172.180279) (xy 256.281 172.209301) - (xy 256.269163 172.240512) (xy 256.25674 172.285075) (xy 256.248683 172.32905) (xy 256.2445 172.375091) - (xy 256.2445 173.124906) (xy 256.248683 173.170949) (xy 256.248684 173.170956) (xy 256.256743 173.214935) - (xy 256.256748 173.214955) (xy 256.26916 173.259478) (xy 256.26916 173.25948) (xy 256.280999 173.290696) - (xy 256.288153 173.319719) (xy 256.296086 173.385052) (xy 256.296086 173.414946) (xy 256.288153 173.480279) - (xy 256.281 173.509301) (xy 256.269163 173.540512) (xy 256.25674 173.585075) (xy 256.248683 173.62905) - (xy 256.24726 173.644717) (xy 256.2445 173.67509) (xy 256.2445 174.293907) (xy 256.244748 174.304031) - (xy 256.244808 174.306447) (xy 256.245406 174.318622) (xy 256.246325 174.331085) (xy 256.263747 174.507975) - (xy 256.267356 174.532421) (xy 256.272001 174.555943) (xy 256.277939 174.579877) (xy 256.278035 174.580196) - (xy 256.279725 174.585486) (xy 256.281377 174.655336) (xy 256.270965 174.681678) (xy 256.237227 174.744798) - (xy 256.223722 174.76501) (xy 256.114854 174.897666) (xy 256.097666 174.914854) (xy 255.96501 175.023722) - (xy 255.944798 175.037227) (xy 255.793456 175.118121) (xy 255.770998 175.127424) (xy 255.606775 175.17724) - (xy 255.582934 175.181982) (xy 255.406061 175.199403) (xy 255.393907 175.2) (xy 251.706093 175.2) - (xy 251.693939 175.199403) (xy 251.517065 175.181982) (xy 251.493224 175.17724) (xy 251.329001 175.127424) - (xy 251.306543 175.118121) (xy 251.155201 175.037227) (xy 251.134989 175.023722) (xy 251.002334 174.914855) - (xy 250.985136 174.897655) (xy 250.983637 174.895828) (xy 250.956332 174.831514) (xy 250.9555 174.817175) - (xy 250.9555 164.247617) (xy 250.975185 164.180578) (xy 250.988087 164.163833) (xy 251.151183 163.985912) - (xy 251.151185 163.985908) (xy 251.151187 163.985906) (xy 251.151188 163.985907) (xy 251.799187 163.278998) - (xy 251.810626 163.265622) (xy 251.821269 163.252272) (xy 251.83176 163.23814) (xy 251.893616 163.148523) - (xy 251.91343 163.126158) (xy 251.958235 163.086466) (xy 251.962694 163.082515) (xy 251.987295 163.065531) - (xy 252.045579 163.034941) (xy 252.073514 163.024347) (xy 252.159921 163.00305) (xy 252.177148 163.000075) - (xy 252.179452 162.999843) (xy 252.228003 162.989942) (xy 252.276992 162.974695) (xy 252.35728 162.94053) - (xy 252.357281 162.940529) (xy 252.429259 162.909899) (xy 252.477809 162.9) (xy 254.891818 162.9) + (xy 256.243666 163.390319) (xy 256.2445 163.404674) (xy 256.2445 164.024906) (xy 256.248683 164.070949) + (xy 256.248684 164.070956) (xy 256.256743 164.114935) (xy 256.256748 164.114955) (xy 256.26916 164.159478) + (xy 256.26916 164.15948) (xy 256.280999 164.190696) (xy 256.288153 164.219719) (xy 256.296086 164.285052) + (xy 256.296086 164.314946) (xy 256.288153 164.380279) (xy 256.281 164.409301) (xy 256.269163 164.440512) + (xy 256.25674 164.485075) (xy 256.248683 164.52905) (xy 256.2445 164.575091) (xy 256.2445 165.324906) + (xy 256.248683 165.370949) (xy 256.248684 165.370956) (xy 256.256743 165.414935) (xy 256.256748 165.414955) + (xy 256.26916 165.459478) (xy 256.26916 165.45948) (xy 256.280999 165.490696) (xy 256.288153 165.519719) + (xy 256.296086 165.585052) (xy 256.296086 165.614946) (xy 256.288153 165.680279) (xy 256.281 165.709301) + (xy 256.269163 165.740512) (xy 256.25674 165.785075) (xy 256.248683 165.82905) (xy 256.2445 165.875091) + (xy 256.2445 166.624906) (xy 256.248683 166.670949) (xy 256.248684 166.670956) (xy 256.256743 166.714935) + (xy 256.256748 166.714955) (xy 256.26916 166.759478) (xy 256.26916 166.75948) (xy 256.280999 166.790696) + (xy 256.288153 166.819719) (xy 256.296086 166.885052) (xy 256.296086 166.914946) (xy 256.288153 166.980279) + (xy 256.281 167.009301) (xy 256.269163 167.040512) (xy 256.25674 167.085075) (xy 256.248683 167.12905) + (xy 256.2445 167.175091) (xy 256.2445 167.924906) (xy 256.248683 167.970949) (xy 256.248684 167.970956) + (xy 256.256743 168.014935) (xy 256.256748 168.014955) (xy 256.26916 168.059478) (xy 256.26916 168.05948) + (xy 256.280999 168.090696) (xy 256.288153 168.119719) (xy 256.296086 168.185052) (xy 256.296086 168.214946) + (xy 256.288153 168.280279) (xy 256.281 168.309301) (xy 256.269163 168.340512) (xy 256.25674 168.385075) + (xy 256.248683 168.42905) (xy 256.2445 168.475091) (xy 256.2445 169.224906) (xy 256.248683 169.270949) + (xy 256.248684 169.270956) (xy 256.256743 169.314935) (xy 256.256748 169.314955) (xy 256.26916 169.359478) + (xy 256.26916 169.35948) (xy 256.280999 169.390696) (xy 256.288153 169.419719) (xy 256.296086 169.485052) + (xy 256.296086 169.514946) (xy 256.288153 169.580279) (xy 256.281 169.609301) (xy 256.269163 169.640512) + (xy 256.25674 169.685075) (xy 256.251083 169.715946) (xy 256.248696 169.728981) (xy 256.248683 169.72905) + (xy 256.2445 169.775091) (xy 256.2445 170.524906) (xy 256.248683 170.570949) (xy 256.248684 170.570956) + (xy 256.256743 170.614935) (xy 256.256748 170.614955) (xy 256.26916 170.659478) (xy 256.26916 170.65948) + (xy 256.280999 170.690696) (xy 256.288153 170.719719) (xy 256.296086 170.785052) (xy 256.296086 170.814946) + (xy 256.288153 170.880279) (xy 256.281 170.909301) (xy 256.269163 170.940512) (xy 256.25674 170.985075) + (xy 256.248683 171.02905) (xy 256.2445 171.075091) (xy 256.2445 171.824906) (xy 256.248683 171.870949) + (xy 256.248684 171.870956) (xy 256.256743 171.914935) (xy 256.256748 171.914955) (xy 256.26916 171.959478) + (xy 256.26916 171.95948) (xy 256.280999 171.990696) (xy 256.288153 172.019719) (xy 256.296086 172.085052) + (xy 256.296086 172.114946) (xy 256.288153 172.180279) (xy 256.281 172.209301) (xy 256.269163 172.240512) + (xy 256.25674 172.285075) (xy 256.248683 172.32905) (xy 256.2445 172.375091) (xy 256.2445 173.124906) + (xy 256.248683 173.170949) (xy 256.248684 173.170956) (xy 256.256743 173.214935) (xy 256.256748 173.214955) + (xy 256.26916 173.259478) (xy 256.26916 173.25948) (xy 256.280999 173.290696) (xy 256.288153 173.319719) + (xy 256.296086 173.385052) (xy 256.296086 173.414946) (xy 256.288153 173.480279) (xy 256.281 173.509301) + (xy 256.269163 173.540512) (xy 256.25674 173.585075) (xy 256.248683 173.62905) (xy 256.24726 173.644717) + (xy 256.2445 173.67509) (xy 256.2445 174.293907) (xy 256.244748 174.304031) (xy 256.244808 174.306447) + (xy 256.245406 174.318622) (xy 256.246325 174.331085) (xy 256.263747 174.507975) (xy 256.267356 174.532421) + (xy 256.272001 174.555943) (xy 256.277939 174.579877) (xy 256.278035 174.580196) (xy 256.279725 174.585486) + (xy 256.281377 174.655336) (xy 256.270965 174.681678) (xy 256.237227 174.744798) (xy 256.223722 174.76501) + (xy 256.114854 174.897666) (xy 256.097666 174.914854) (xy 255.96501 175.023722) (xy 255.944798 175.037227) + (xy 255.793456 175.118121) (xy 255.770998 175.127424) (xy 255.606775 175.17724) (xy 255.582934 175.181982) + (xy 255.406061 175.199403) (xy 255.393907 175.2) (xy 251.706093 175.2) (xy 251.693939 175.199403) + (xy 251.517065 175.181982) (xy 251.493224 175.17724) (xy 251.329001 175.127424) (xy 251.306543 175.118121) + (xy 251.155201 175.037227) (xy 251.134989 175.023722) (xy 251.002334 174.914855) (xy 250.985136 174.897655) + (xy 250.983637 174.895828) (xy 250.956332 174.831514) (xy 250.9555 174.817175) (xy 250.9555 164.506601) + (xy 250.956032 164.495122) (xy 250.959654 164.456163) (xy 250.959655 164.456163) (xy 250.959654 164.456158) + (xy 250.968285 164.363359) (xy 250.972521 164.340788) (xy 251.004001 164.230576) (xy 251.012327 164.209174) + (xy 251.014527 164.204775) (xy 251.063602 164.106641) (xy 251.075726 164.087149) (xy 251.155732 163.981733) + (xy 251.163072 163.972941) (xy 251.799187 163.278998) (xy 251.810626 163.265622) (xy 251.821269 163.252272) + (xy 251.83176 163.23814) (xy 251.893616 163.148523) (xy 251.91343 163.126158) (xy 251.958235 163.086466) + (xy 251.962694 163.082515) (xy 251.987295 163.065531) (xy 252.045579 163.034941) (xy 252.073514 163.024347) + (xy 252.159921 163.00305) (xy 252.177148 163.000075) (xy 252.179452 162.999843) (xy 252.228003 162.989942) + (xy 252.276992 162.974695) (xy 252.338713 162.948431) (xy 252.338714 162.94843) (xy 252.429259 162.909899) + (xy 252.477809 162.9) (xy 254.891818 162.9) ) ) ) @@ -157047,43 +161170,48 @@ (xy 234.926082 123.1505) (xy 255.02392 123.1505) (xy 255.121462 123.131096) (xy 255.168913 123.121658) (xy 255.198412 123.109438) (xy 255.245865 123.1) (xy 258.893907 123.1) (xy 258.906061 123.100597) (xy 259.082941 123.118018) (xy 259.106769 123.122757) (xy 259.271001 123.172576) (xy 259.293453 123.181877) - (xy 259.362562 123.218816) (xy 259.444798 123.262772) (xy 259.46501 123.276277) (xy 259.597666 123.385145) - (xy 259.614854 123.402333) (xy 259.723722 123.534989) (xy 259.737227 123.555201) (xy 259.818121 123.706543) - (xy 259.827424 123.729001) (xy 259.87724 123.893224) (xy 259.881982 123.917065) (xy 259.899403 124.093938) - (xy 259.9 124.106092) (xy 259.9 125.393907) (xy 259.899403 125.406061) (xy 259.881982 125.582934) - (xy 259.87724 125.606775) (xy 259.827424 125.770998) (xy 259.818121 125.793456) (xy 259.737227 125.944798) - (xy 259.723722 125.96501) (xy 259.614854 126.097666) (xy 259.597666 126.114854) (xy 259.46501 126.223722) - (xy 259.444798 126.237227) (xy 259.293456 126.318121) (xy 259.270998 126.327424) (xy 259.106775 126.37724) - (xy 259.08289 126.381986) (xy 259.08182 126.382091) (xy 259.029449 126.375966) (xy 258.988823 126.36202) - (xy 258.958518 126.356963) (xy 258.763977 126.3245) (xy 258.536023 126.3245) (xy 258.510746 126.328718) - (xy 258.311175 126.36202) (xy 258.261617 126.379034) (xy 258.220116 126.393281) (xy 258.179854 126.4) - (xy 227.847496 126.4) (xy 227.827634 126.398399) (xy 227.821784 126.397449) (xy 227.784083 126.384879) - (xy 227.782198 126.383891) (xy 227.759491 126.368575) (xy 227.747312 126.358231) (xy 227.736471 126.347828) - (xy 227.71883 126.328718) (xy 227.713902 126.323045) (xy 226.955083 125.393907) (xy 225 123) (xy 224.525581 123) - (xy 199.148267 123) (xy 199.081228 122.980315) (xy 199.06604 122.968816) (xy 199.060562 122.963963) - (xy 198.97224 122.885717) (xy 198.972238 122.885716) (xy 198.972237 122.885715) (xy 198.832365 122.812303) - (xy 198.678986 122.7745) (xy 198.678985 122.7745) (xy 198.521015 122.7745) (xy 198.521014 122.7745) - (xy 198.367634 122.812303) (xy 198.227762 122.885715) (xy 198.13396 122.968816) (xy 198.070726 122.998537) - (xy 198.051733 123) (xy 197.148267 123) (xy 197.081228 122.980315) (xy 197.06604 122.968816) (xy 197.060562 122.963963) - (xy 196.97224 122.885717) (xy 196.972238 122.885716) (xy 196.972237 122.885715) (xy 196.832365 122.812303) - (xy 196.678986 122.7745) (xy 196.678985 122.7745) (xy 196.521015 122.7745) (xy 196.521014 122.7745) - (xy 196.367634 122.812303) (xy 196.227762 122.885715) (xy 196.13396 122.968816) (xy 196.070726 122.998537) - (xy 196.051733 123) (xy 194.200003 123) (xy 194.2 123) (xy 193.2 123) (xy 193.2 124) (xy 193.2 124.000003) - (xy 193.2 125.793907) (xy 193.199403 125.806061) (xy 193.181982 125.982934) (xy 193.177239 126.006777) - (xy 193.173038 126.020625) (xy 193.13474 126.079063) (xy 193.070927 126.107519) (xy 193.00186 126.096957) - (xy 192.952328 126.055068) (xy 192.937947 126.034233) (xy 192.890483 125.96547) (xy 192.77224 125.860717) - (xy 192.772238 125.860716) (xy 192.772237 125.860715) (xy 192.632365 125.787303) (xy 192.478986 125.7495) - (xy 192.478985 125.7495) (xy 192.321015 125.7495) (xy 192.321014 125.7495) (xy 192.167634 125.787303) - (xy 192.027762 125.860715) (xy 191.909516 125.965471) (xy 191.819781 126.095475) (xy 191.81978 126.095476) - (xy 191.763763 126.243181) (xy 191.744722 126.4) (xy 191.750896 126.450854) (xy 191.739435 126.519777) - (xy 191.715481 126.55348) (xy 191.505281 126.763681) (xy 191.443958 126.797166) (xy 191.4176 126.8) - (xy 188.906093 126.8) (xy 188.893939 126.799403) (xy 188.717065 126.781982) (xy 188.693224 126.77724) - (xy 188.529001 126.727424) (xy 188.506543 126.718121) (xy 188.355201 126.637227) (xy 188.334989 126.623722) - (xy 188.202333 126.514854) (xy 188.185145 126.497666) (xy 188.100255 126.394227) (xy 188.076276 126.365008) - (xy 188.062772 126.344798) (xy 188.054177 126.328718) (xy 187.981877 126.193453) (xy 187.972575 126.170997) - (xy 187.955839 126.115823) (xy 187.9505 126.079829) (xy 187.9505 118.792229) (xy 187.970185 118.72519) - (xy 187.986819 118.704548) (xy 189.104548 117.586819) (xy 189.165871 117.553334) (xy 189.192229 117.5505) - (xy 228.971507 117.5505) + (xy 259.377224 123.226653) (xy 259.444798 123.262772) (xy 259.465008 123.276276) (xy 259.576095 123.367442) + (xy 259.597666 123.385145) (xy 259.614854 123.402333) (xy 259.723722 123.534989) (xy 259.737227 123.555201) + (xy 259.818121 123.706543) (xy 259.827424 123.729001) (xy 259.87724 123.893224) (xy 259.881982 123.917065) + (xy 259.899403 124.093938) (xy 259.9 124.106092) (xy 259.9 125.393907) (xy 259.899403 125.406061) + (xy 259.881982 125.582934) (xy 259.87724 125.606775) (xy 259.827424 125.770998) (xy 259.818121 125.793456) + (xy 259.737227 125.944798) (xy 259.723722 125.96501) (xy 259.614854 126.097666) (xy 259.597666 126.114854) + (xy 259.46501 126.223722) (xy 259.444798 126.237227) (xy 259.293456 126.318121) (xy 259.270998 126.327424) + (xy 259.106775 126.37724) (xy 259.08289 126.381986) (xy 259.08182 126.382091) (xy 259.029449 126.375966) + (xy 258.988823 126.36202) (xy 258.958518 126.356963) (xy 258.763977 126.3245) (xy 258.536023 126.3245) + (xy 258.510746 126.328718) (xy 258.311175 126.36202) (xy 258.261617 126.379034) (xy 258.220116 126.393281) + (xy 258.179854 126.4) (xy 227.847496 126.4) (xy 227.827634 126.398399) (xy 227.821784 126.397449) + (xy 227.784083 126.384879) (xy 227.782198 126.383891) (xy 227.759491 126.368575) (xy 227.747312 126.358231) + (xy 227.736471 126.347828) (xy 227.71883 126.328718) (xy 227.713902 126.323045) (xy 225.816693 124.000003) + (xy 225.300096 123.367454) (xy 225.300091 123.367449) (xy 225.300085 123.367442) (xy 225.142217 123.212756) + (xy 225.142215 123.212754) (xy 224.954208 123.096522) (xy 224.954209 123.096522) (xy 224.745254 123.024427) + (xy 224.525581 123) (xy 224.525574 123) (xy 199.148267 123) (xy 199.081228 122.980315) (xy 199.06604 122.968816) + (xy 199.060562 122.963963) (xy 198.97224 122.885717) (xy 198.972238 122.885716) (xy 198.972237 122.885715) + (xy 198.832365 122.812303) (xy 198.678986 122.7745) (xy 198.678985 122.7745) (xy 198.521015 122.7745) + (xy 198.521014 122.7745) (xy 198.367634 122.812303) (xy 198.227762 122.885715) (xy 198.13396 122.968816) + (xy 198.070726 122.998537) (xy 198.051733 123) (xy 197.148267 123) (xy 197.081228 122.980315) (xy 197.06604 122.968816) + (xy 197.060562 122.963963) (xy 196.97224 122.885717) (xy 196.972238 122.885716) (xy 196.972237 122.885715) + (xy 196.832365 122.812303) (xy 196.678986 122.7745) (xy 196.678985 122.7745) (xy 196.521015 122.7745) + (xy 196.521014 122.7745) (xy 196.367634 122.812303) (xy 196.227762 122.885715) (xy 196.13396 122.968816) + (xy 196.070726 122.998537) (xy 196.051733 123) (xy 194.200003 123) (xy 194.2 123) (xy 194.105293 123.009328) + (xy 194.093139 123.009925) (xy 193.983328 123.009925) (xy 193.829948 123.047728) (xy 193.690076 123.12114) + (xy 193.571819 123.225905) (xy 193.571157 123.226653) (xy 193.557025 123.24026) (xy 193.492888 123.292897) + (xy 193.368531 123.444428) (xy 193.368526 123.444435) (xy 193.276123 123.617309) (xy 193.276122 123.617312) + (xy 193.219214 123.804911) (xy 193.2 124.000003) (xy 193.2 125.793907) (xy 193.199403 125.806061) + (xy 193.181982 125.982934) (xy 193.177239 126.006777) (xy 193.173038 126.020625) (xy 193.13474 126.079063) + (xy 193.070927 126.107519) (xy 193.00186 126.096957) (xy 192.952328 126.055068) (xy 192.937947 126.034233) + (xy 192.890483 125.96547) (xy 192.77224 125.860717) (xy 192.772238 125.860716) (xy 192.772237 125.860715) + (xy 192.632365 125.787303) (xy 192.478986 125.7495) (xy 192.478985 125.7495) (xy 192.321015 125.7495) + (xy 192.321014 125.7495) (xy 192.167634 125.787303) (xy 192.027762 125.860715) (xy 191.909516 125.965471) + (xy 191.819781 126.095475) (xy 191.81978 126.095476) (xy 191.763763 126.243181) (xy 191.744722 126.4) + (xy 191.750896 126.450854) (xy 191.739435 126.519777) (xy 191.715481 126.55348) (xy 191.505281 126.763681) + (xy 191.443958 126.797166) (xy 191.4176 126.8) (xy 188.906093 126.8) (xy 188.893939 126.799403) + (xy 188.717065 126.781982) (xy 188.693224 126.77724) (xy 188.529001 126.727424) (xy 188.506543 126.718121) + (xy 188.355201 126.637227) (xy 188.334989 126.623722) (xy 188.202333 126.514854) (xy 188.185145 126.497666) + (xy 188.100255 126.394227) (xy 188.076276 126.365008) (xy 188.062772 126.344798) (xy 188.054177 126.328718) + (xy 187.981877 126.193453) (xy 187.972575 126.170997) (xy 187.955839 126.115823) (xy 187.9505 126.079829) + (xy 187.9505 118.792229) (xy 187.970185 118.72519) (xy 187.986819 118.704548) (xy 189.104548 117.586819) + (xy 189.165871 117.553334) (xy 189.192229 117.5505) (xy 228.971507 117.5505) ) ) ) @@ -157120,7 +161248,8 @@ (xy 117.627424 73.229001) (xy 117.67724 73.393224) (xy 117.681982 73.417065) (xy 117.699403 73.593938) (xy 117.7 73.606092) (xy 117.7 81.237789) (xy 117.697617 81.261982) (xy 117.685781 81.321482) (xy 117.667267 81.366179) (xy 117.640481 81.406268) (xy 117.606269 81.440479) (xy 117.571975 81.463394) (xy 117.566179 81.467267) - (xy 117.521481 81.485781) (xy 117.466681 81.496681) (xy 117.45 81.5) (xy 117.2 81.5) (xy 117.2 81.749995) + (xy 117.521481 81.485781) (xy 117.466681 81.496681) (xy 117.45 81.5) (xy 117.386072 81.512715) (xy 117.354327 81.51903) + (xy 117.273223 81.573223) (xy 117.219029 81.654328) (xy 117.219029 81.654329) (xy 117.2 81.749995) (xy 117.2 82.835901) (xy 117.180315 82.90294) (xy 117.144891 82.939002) (xy 117.099399 82.969399) (xy 117.044033 83.05226) (xy 117.044032 83.052264) (xy 117.0295 83.125321) (xy 117.0295 83.572477) (xy 117.009815 83.639516) (xy 116.957011 83.685271) (xy 116.929691 83.694094) (xy 116.924191 83.695188) @@ -157131,11 +161260,17 @@ (xy 116.760966 82.54774) (xy 116.7755 82.474674) (xy 116.7755 81.825326) (xy 116.7755 81.825323) (xy 116.775499 81.825321) (xy 116.760967 81.752264) (xy 116.760966 81.75226) (xy 116.739033 81.719435) (xy 116.705601 81.669399) (xy 116.62274 81.614034) (xy 116.622739 81.614033) (xy 116.622735 81.614032) - (xy 116.6 81.609509) (xy 116.6 81.5) (xy 115.9 81.5) (xy 115.758119 81.484014) (xy 115.731047 81.477835) - (xy 115.60947 81.435293) (xy 115.584453 81.423246) (xy 115.475385 81.354714) (xy 115.453676 81.337401) - (xy 115.362598 81.246323) (xy 115.345285 81.224614) (xy 115.276753 81.115546) (xy 115.264708 81.090533) - (xy 115.222163 80.968948) (xy 115.215986 80.941885) (xy 115.20078 80.806922) (xy 115.2 80.793039) - (xy 115.2 80.550003) (xy 115.2 80.55) (xy 115.2 79.6) (xy 114.25 79.6) (xy 114.076819 79.582943) + (xy 116.549677 81.5995) (xy 116.549674 81.5995) (xy 116.287471 81.5995) (xy 116.221498 81.580493) + (xy 116.203723 81.569324) (xy 116.203718 81.569321) (xy 116.055766 81.51755) (xy 116.055757 81.517548) + (xy 115.9 81.5) (xy 115.758119 81.484014) (xy 115.731047 81.477835) (xy 115.60947 81.435293) (xy 115.584453 81.423246) + (xy 115.475385 81.354714) (xy 115.453676 81.337401) (xy 115.362598 81.246323) (xy 115.345285 81.224614) + (xy 115.276753 81.115546) (xy 115.264708 81.090533) (xy 115.222163 80.968948) (xy 115.215986 80.941885) + (xy 115.20078 80.806922) (xy 115.2 80.793039) (xy 115.2 80.550003) (xy 115.181746 80.364663) (xy 115.181745 80.364661) + (xy 115.175839 80.34519) (xy 115.170499 80.309194) (xy 115.170499 80.079518) (xy 115.170498 80.079509) + (xy 115.164412 80.022885) (xy 115.146588 79.975101) (xy 115.116628 79.894774) (xy 115.034687 79.785313) + (xy 114.968911 79.736074) (xy 114.925228 79.703373) (xy 114.925226 79.703372) (xy 114.797114 79.655588) + (xy 114.797112 79.655587) (xy 114.79711 79.655587) (xy 114.740501 79.6495) (xy 114.556736 79.6495) + (xy 114.520742 79.644161) (xy 114.435334 79.618253) (xy 114.435335 79.618253) (xy 114.25 79.6) (xy 114.076819 79.582943) (xy 114.052978 79.578201) (xy 113.898135 79.53123) (xy 113.875679 79.521928) (xy 113.732979 79.445653) (xy 113.712768 79.432148) (xy 113.587689 79.329498) (xy 113.570501 79.31231) (xy 113.467851 79.187231) (xy 113.454346 79.16702) (xy 113.378069 79.024316) (xy 113.368769 79.001864) (xy 113.321796 78.847015) @@ -157205,10 +161340,18 @@ (xy 179.463814 165.340273) (xy 179.463811 165.340269) (xy 179.463811 165.340266) (xy 179.368039 165.161089) (xy 179.369647 165.160229) (xy 179.351321 165.101729) (xy 179.369797 165.034347) (xy 179.42177 164.98765) (xy 179.475301 164.9755) (xy 179.6705 164.9755) (xy 179.737539 164.995185) (xy 179.783294 165.047989) - (xy 179.7945 165.0995) (xy 179.7945 169.6205) (xy 179.774815 169.687539) (xy 179.722011 169.733294) - (xy 179.6705 169.7445) (xy 164.382825 169.7445) (xy 164.315786 169.724815) (xy 164.304172 169.716363) - (xy 164.302345 169.714864) (xy 164.28513 169.697648) (xy 164.283632 169.695822) (xy 164.256331 169.631507) - (xy 164.2555 169.617175) (xy 164.2555 168.650092) (xy 176.8345 168.650092) (xy 176.8345 168.799907) + (xy 179.7945 165.0995) (xy 179.7945 168.98135) (xy 179.793903 168.993505) (xy 179.780178 169.132848) + (xy 179.775436 169.156688) (xy 179.74023 169.272749) (xy 179.730927 169.295208) (xy 179.673755 169.402167) + (xy 179.660251 169.422377) (xy 179.583315 169.516125) (xy 179.566125 169.533315) (xy 179.472377 169.610251) + (xy 179.452167 169.623755) (xy 179.345208 169.680927) (xy 179.322749 169.69023) (xy 179.206688 169.725436) + (xy 179.182848 169.730178) (xy 179.043505 169.743903) (xy 179.03135 169.7445) (xy 165.018651 169.7445) + (xy 165.006496 169.743903) (xy 165.005514 169.743806) (xy 164.878727 169.731318) (xy 164.878723 169.731318) + (xy 164.878713 169.731317) (xy 164.867139 169.730176) (xy 164.84331 169.725435) (xy 164.727248 169.690229) + (xy 164.704789 169.680926) (xy 164.597838 169.62376) (xy 164.577624 169.610253) (xy 164.555082 169.591752) + (xy 164.555062 169.591738) (xy 164.536529 169.576529) (xy 164.483871 169.533314) (xy 164.466682 169.516124) + (xy 164.389743 169.422371) (xy 164.376239 169.402162) (xy 164.374521 169.398947) (xy 164.31907 169.295206) + (xy 164.30977 169.272754) (xy 164.27456 169.156677) (xy 164.26982 169.132848) (xy 164.256097 168.993503) + (xy 164.2555 168.98135) (xy 164.2555 168.650092) (xy 176.8345 168.650092) (xy 176.8345 168.799907) (xy 176.863723 168.946822) (xy 176.863725 168.94683) (xy 176.921051 169.085229) (xy 176.921056 169.085238) (xy 177.00428 169.20979) (xy 177.004283 169.209794) (xy 177.110205 169.315716) (xy 177.110209 169.315719) (xy 177.234761 169.398943) (xy 177.23477 169.398948) (xy 177.266123 169.411934) (xy 177.37317 169.456275) @@ -157232,12 +161375,12 @@ (xy 172.12777 166.039283) (xy 172.127772 166.039284) (xy 172.267644 166.112696) (xy 172.421024 166.1505) (xy 172.421025 166.1505) (xy 172.578995 166.1505) (xy 172.732375 166.112696) (xy 172.796161 166.079218) (xy 172.87225 166.039283) (xy 172.990493 165.93453) (xy 173.08023 165.804523) (xy 173.136247 165.656818) - (xy 173.155288 165.5) (xy 173.150371 165.4595) (xy 173.136247 165.343181) (xy 173.102686 165.25469) + (xy 173.155288 165.5) (xy 173.150371 165.4595) (xy 173.136247 165.343181) (xy 173.10217 165.253329) (xy 173.08023 165.195477) (xy 172.990493 165.06547) (xy 172.990491 165.065468) (xy 172.917273 165.000602) (xy 172.880146 164.941413) (xy 172.8755 164.907787) (xy 172.8755 164.192204) (xy 172.895185 164.125165) (xy 172.917274 164.099388) (xy 172.922019 164.095185) (xy 172.990483 164.034532) (xy 173.08022 163.904525) (xy 173.136237 163.75682) (xy 173.143136 163.699999) (xy 173.544722 163.699999) (xy 173.544722 163.7) - (xy 173.563762 163.856818) (xy 173.612585 163.985551) (xy 173.61978 164.004523) (xy 173.629066 164.017976) + (xy 173.563762 163.856818) (xy 173.61403 163.989362) (xy 173.61978 164.004523) (xy 173.629066 164.017976) (xy 173.709517 164.134531) (xy 173.782726 164.199386) (xy 173.819853 164.258574) (xy 173.8245 164.292202) (xy 173.8245 164.707796) (xy 173.804815 164.774835) (xy 173.782727 164.800611) (xy 173.709518 164.865468) (xy 173.619781 164.995475) (xy 173.61978 164.995476) (xy 173.563762 165.143181) (xy 173.544722 165.299999) @@ -157274,21 +161417,27 @@ (filled_polygon (layer "F.Cu") (pts - (xy 224.886993 123.275185) (xy 224.915993 123.301063) (xy 226.757192 125.555523) (xy 227.516011 126.484661) - (xy 227.521015 126.490601) (xy 227.521038 126.490628) (xy 227.525928 126.496258) (xy 227.531077 126.502007) - (xy 227.548746 126.521147) (xy 227.55955 126.532161) (xy 227.559568 126.532179) (xy 227.570409 126.542582) - (xy 227.581913 126.552971) (xy 227.581924 126.552981) (xy 227.581927 126.552983) (xy 227.594089 126.563313) - (xy 227.594107 126.563327) (xy 227.616603 126.580383) (xy 227.616618 126.580394) (xy 227.639325 126.59571) - (xy 227.663586 126.61019) (xy 227.665471 126.611178) (xy 227.703269 126.627262) (xy 227.74097 126.639832) - (xy 227.780829 126.649645) (xy 227.783871 126.650139) (xy 227.786671 126.650594) (xy 227.786678 126.650594) - (xy 227.786679 126.650595) (xy 227.807106 126.653073) (xy 227.826968 126.654674) (xy 227.847496 126.6555) - (xy 237.876 126.6555) (xy 237.943039 126.675185) (xy 237.988794 126.727989) (xy 238 126.7795) (xy 238 127.128996) - (xy 237.994661 127.16499) (xy 237.978263 127.219045) (xy 237.978254 127.219079) (xy 237.972167 127.243382) - (xy 237.972165 127.243392) (xy 237.967427 127.267212) (xy 237.967427 127.267214) (xy 237.963749 127.292) - (xy 237.963746 127.292027) (xy 237.956985 127.360677) (xy 237.946669 127.46543) (xy 237.946326 127.468908) - (xy 237.945406 127.48138) (xy 237.945405 127.481403) (xy 237.944808 127.493557) (xy 237.944533 127.504775) - (xy 237.9445 127.506112) (xy 237.9445 128.8205) (xy 237.924815 128.887539) (xy 237.872011 128.933294) - (xy 237.8205 128.9445) (xy 235.844704 128.9445) (xy 235.777665 128.924815) (xy 235.73191 128.872011) + (xy 224.518235 123.256258) (xy 224.675085 123.273698) (xy 224.701804 123.279715) (xy 224.81797 123.319795) + (xy 224.830984 123.324286) (xy 224.855744 123.336032) (xy 224.971963 123.407883) (xy 224.993537 123.424782) + (xy 225.10625 123.535223) (xy 225.115507 123.545356) (xy 225.457641 123.964284) (xy 225.618802 124.161618) + (xy 225.618802 124.161619) (xy 227.516011 126.484661) (xy 227.521015 126.490601) (xy 227.521038 126.490628) + (xy 227.525928 126.496258) (xy 227.531077 126.502007) (xy 227.548746 126.521147) (xy 227.55955 126.532161) + (xy 227.559568 126.532179) (xy 227.570409 126.542582) (xy 227.581913 126.552971) (xy 227.581924 126.552981) + (xy 227.581927 126.552983) (xy 227.594089 126.563313) (xy 227.594107 126.563327) (xy 227.616603 126.580383) + (xy 227.616618 126.580394) (xy 227.639325 126.59571) (xy 227.663586 126.61019) (xy 227.665471 126.611178) + (xy 227.703269 126.627262) (xy 227.74097 126.639832) (xy 227.780829 126.649645) (xy 227.783871 126.650139) + (xy 227.786671 126.650594) (xy 227.786678 126.650594) (xy 227.786679 126.650595) (xy 227.807106 126.653073) + (xy 227.826968 126.654674) (xy 227.847496 126.6555) (xy 237.876 126.6555) (xy 237.943039 126.675185) + (xy 237.988794 126.727989) (xy 238 126.7795) (xy 238 127.128996) (xy 237.994661 127.16499) (xy 237.978263 127.219045) + (xy 237.978254 127.219079) (xy 237.972167 127.243382) (xy 237.972165 127.243392) (xy 237.967427 127.267212) + (xy 237.967427 127.267214) (xy 237.963749 127.292) (xy 237.963746 127.292027) (xy 237.956985 127.360677) + (xy 237.946669 127.46543) (xy 237.946326 127.468908) (xy 237.945406 127.48138) (xy 237.945405 127.481403) + (xy 237.944808 127.493557) (xy 237.944533 127.504775) (xy 237.9445 127.506112) (xy 237.9445 128.18135) + (xy 237.943903 128.193505) (xy 237.930178 128.332848) (xy 237.925436 128.356688) (xy 237.89023 128.472749) + (xy 237.880927 128.495208) (xy 237.823755 128.602167) (xy 237.810251 128.622377) (xy 237.733315 128.716125) + (xy 237.716125 128.733315) (xy 237.622377 128.810251) (xy 237.602167 128.823755) (xy 237.495208 128.880927) + (xy 237.472749 128.89023) (xy 237.356688 128.925436) (xy 237.332848 128.930178) (xy 237.193505 128.943903) + (xy 237.18135 128.9445) (xy 235.844704 128.9445) (xy 235.777665 128.924815) (xy 235.73191 128.872011) (xy 235.721966 128.802853) (xy 235.728762 128.776529) (xy 235.734167 128.762275) (xy 235.736237 128.756818) (xy 235.755278 128.6) (xy 235.749102 128.549144) (xy 235.760561 128.480224) (xy 235.784514 128.446521) (xy 235.811168 128.419867) (xy 235.872489 128.386384) (xy 235.942181 128.391368) (xy 235.998113 128.433239) @@ -157324,7 +161473,7 @@ (xy 227.9395 128.202877) (xy 227.945907 128.262484) (xy 227.996201 128.397329) (xy 227.996205 128.397336) (xy 228.082451 128.512545) (xy 228.082454 128.512548) (xy 228.197663 128.598794) (xy 228.19767 128.598798) (xy 228.242617 128.615562) (xy 228.332516 128.649092) (xy 228.392126 128.655501) (xy 229.087871 128.6555) - (xy 229.147482 128.649092) (xy 229.218495 128.622606) (xy 229.243395 128.613319) (xy 229.286728 128.605501) + (xy 229.147482 128.649092) (xy 229.219109 128.622377) (xy 229.243395 128.613319) (xy 229.286728 128.605501) (xy 230.567182 128.605501) (xy 230.634221 128.625186) (xy 230.654863 128.64182) (xy 230.745862 128.732819) (xy 230.779347 128.794142) (xy 230.774363 128.863834) (xy 230.732491 128.919767) (xy 230.667027 128.944184) (xy 230.658181 128.9445) (xy 212.806093 128.9445) (xy 212.797448 128.944712) (xy 212.793549 128.944808) @@ -157355,20 +161504,20 @@ (xy 216.086428 128.299311) (xy 216.12015 128.254804) (xy 216.185754 128.230766) (xy 216.193885 128.230499) (xy 216.647886 128.230499) (xy 216.714925 128.250184) (xy 216.76068 128.302988) (xy 216.764068 128.311166) (xy 216.796203 128.397327) (xy 216.796207 128.397334) (xy 216.882453 128.512543) (xy 216.882456 128.512546) - (xy 216.997665 128.598792) (xy 216.997672 128.598796) (xy 217.036611 128.613319) (xy 217.132518 128.64909) + (xy 216.997665 128.598792) (xy 216.997672 128.598796) (xy 217.035587 128.612937) (xy 217.132518 128.64909) (xy 217.192128 128.655499) (xy 217.887873 128.655498) (xy 217.947484 128.64909) (xy 218.082332 128.598795) (xy 218.197547 128.512545) (xy 218.283797 128.39733) (xy 218.334092 128.262482) (xy 218.340501 128.202872) (xy 218.3405 127.507127) (xy 218.3405 127.507126) (xy 219.539499 127.507126) (xy 219.539499 127.50713) (xy 219.539499 127.507134) (xy 219.539499 128.202869) (xy 219.5395 128.202875) (xy 219.545907 128.262482) (xy 219.596201 128.397327) (xy 219.596205 128.397334) (xy 219.682451 128.512543) (xy 219.682454 128.512546) - (xy 219.797663 128.598792) (xy 219.79767 128.598796) (xy 219.836609 128.613319) (xy 219.932516 128.64909) + (xy 219.797663 128.598792) (xy 219.79767 128.598796) (xy 219.835585 128.612937) (xy 219.932516 128.64909) (xy 219.992126 128.655499) (xy 220.687871 128.655498) (xy 220.747482 128.64909) (xy 220.88233 128.598795) (xy 220.997545 128.512545) (xy 221.068822 128.417331) (xy 221.083793 128.397333) (xy 221.083794 128.397332) (xy 221.084487 128.395476) (xy 221.099164 128.356125) (xy 221.141036 128.300192) (xy 221.2065 128.275776) (xy 221.215345 128.27546) (xy 221.403692 128.27546) (xy 221.470731 128.295145) (xy 221.505742 128.329021) (xy 221.507181 128.331105) (xy 221.509515 128.334488) (xy 221.509517 128.33449) (xy 221.62776 128.439243) (xy 221.627762 128.439244) (xy 221.767634 128.512656) (xy 221.921014 128.55046) (xy 221.921015 128.55046) - (xy 222.078985 128.55046) (xy 222.232365 128.512656) (xy 222.284281 128.485408) (xy 222.37224 128.439243) + (xy 222.078985 128.55046) (xy 222.232365 128.512656) (xy 222.286133 128.484436) (xy 222.37224 128.439243) (xy 222.490483 128.33449) (xy 222.58022 128.204483) (xy 222.636237 128.056778) (xy 222.655278 127.89996) (xy 222.653881 127.88845) (xy 222.636237 127.743141) (xy 222.607771 127.668083) (xy 222.58195 127.599999) (xy 223.544722 127.599999) (xy 223.544722 127.6) (xy 223.563762 127.756818) (xy 223.615295 127.892696) @@ -157480,12 +161629,12 @@ (xy 205.387762 129.978532) (xy 205.371397 129.801917) (xy 205.355295 129.745325) (xy 205.315582 129.60575) (xy 205.315581 129.605748) (xy 205.314013 129.600237) (xy 205.315994 129.599673) (xy 205.310902 129.539174) (xy 205.343614 129.477435) (xy 205.34463 129.476405) (xy 206.025277 128.795758) (xy 206.086598 128.762275) - (xy 206.15629 128.767259) (xy 206.212222 128.809129) (xy 206.228034 128.830251) (xy 206.313483 128.894217) + (xy 206.15629 128.767259) (xy 206.212222 128.809129) (xy 206.228034 128.830251) (xy 206.308157 128.89023) (xy 206.327219 128.9045) (xy 206.337495 128.912192) (xy 206.465607 128.959976) (xy 206.522236 128.966064) (xy 207.063205 128.966063) (xy 207.119835 128.959976) (xy 207.247947 128.912192) (xy 207.357408 128.830251) (xy 207.439349 128.72079) (xy 207.45154 128.688102) (xy 207.493408 128.632173) (xy 207.558871 128.607755) (xy 207.627145 128.622606) (xy 207.676551 128.67201) (xy 207.683901 128.688103) (xy 207.696093 128.720791) - (xy 207.723063 128.756818) (xy 207.778034 128.830251) (xy 207.854562 128.887539) (xy 207.877219 128.9045) + (xy 207.723063 128.756818) (xy 207.778034 128.830251) (xy 207.858157 128.89023) (xy 207.877219 128.9045) (xy 207.887495 128.912192) (xy 208.015607 128.959976) (xy 208.072236 128.966064) (xy 208.613205 128.966063) (xy 208.669835 128.959976) (xy 208.797947 128.912192) (xy 208.907408 128.830251) (xy 208.989349 128.72079) (xy 209.037133 128.592678) (xy 209.04101 128.556618) (xy 209.04322 128.536065) (xy 209.04322 128.536058) @@ -157890,9 +162039,11 @@ (xy 224.421014 158.8505) (xy 224.421015 158.8505) (xy 224.578985 158.8505) (xy 224.732365 158.812696) (xy 224.776172 158.789703) (xy 224.833798 158.7755) (xy 225.143279 158.7755) (xy 225.210318 158.795185) (xy 225.256073 158.847989) (xy 225.266017 158.917147) (xy 225.236992 158.980703) (xy 225.233252 158.984827) - (xy 222.810102 161.539283) (xy 222.587297 161.774161) (xy 219.354865 165.181747) (xy 219.325011 165.204865) - (xy 212.828536 168.805321) (xy 212.760357 168.820601) (xy 212.694741 168.796596) (xy 212.652519 168.740926) - (xy 212.645331 168.681919) (xy 212.655278 168.6) (xy 212.649102 168.549144) (xy 212.660561 168.480224) + (xy 222.865178 161.481223) (xy 222.587304 161.774154) (xy 222.587302 161.774155) (xy 222.583793 161.777854) + (xy 222.583763 161.777884) (xy 222.583764 161.777885) (xy 219.430633 165.101873) (xy 219.423855 165.108492) + (xy 219.342928 165.181698) (xy 219.327957 165.193291) (xy 219.236818 165.253329) (xy 219.228713 165.258235) + (xy 212.828536 168.80532) (xy 212.760357 168.8206) (xy 212.694741 168.796595) (xy 212.652519 168.740925) + (xy 212.645331 168.681918) (xy 212.655278 168.6) (xy 212.649102 168.549144) (xy 212.660561 168.480224) (xy 212.684514 168.446521) (xy 213.074218 168.056819) (xy 213.135541 168.023334) (xy 213.161899 168.0205) (xy 213.38613 168.0205) (xy 213.386144 168.020499) (xy 213.408023 168.018146) (xy 213.442022 168.014491) (xy 213.56845 167.967336) (xy 213.676472 167.886472) (xy 213.757336 167.77845) (xy 213.804491 167.652022) @@ -157960,34 +162111,35 @@ (xy 211.37332 168.0205) (xy 211.440359 168.040185) (xy 211.486114 168.092989) (xy 211.496058 168.162147) (xy 211.47537 168.21494) (xy 211.419781 168.295475) (xy 211.41978 168.295476) (xy 211.363762 168.443181) (xy 211.344722 168.599999) (xy 211.344722 168.6) (xy 211.363762 168.756818) (xy 211.41978 168.904523) - (xy 211.509517 169.03453) (xy 211.62776 169.139283) (xy 211.731463 169.193711) (xy 211.781673 169.242294) - (xy 211.797648 169.310313) (xy 211.774313 169.376171) (xy 211.733944 169.411963) (xy 211.161978 169.728957) - (xy 211.101869 169.7445) (xy 201.610271 169.7445) (xy 201.543232 169.724815) (xy 201.499166 169.673961) + (xy 211.509517 169.03453) (xy 211.62776 169.139283) (xy 211.627762 169.139284) (xy 211.73146 169.19371) + (xy 211.781673 169.242294) (xy 211.797647 169.310314) (xy 211.774312 169.376171) (xy 211.733943 169.411963) + (xy 211.31632 169.643417) (xy 211.306986 169.648087) (xy 211.197129 169.697375) (xy 211.177413 169.704291) + (xy 211.07641 169.730408) (xy 211.055816 169.733915) (xy 210.965878 169.74152) (xy 210.935848 169.744059) + (xy 210.925403 169.7445) (xy 201.610271 169.7445) (xy 201.543232 169.724815) (xy 201.499166 169.673961) (xy 201.461286 169.72177) (xy 201.395176 169.74438) (xy 201.389729 169.7445) (xy 191.606779 169.7445) (xy 191.53974 169.724815) (xy 191.493985 169.672011) (xy 191.484041 169.602853) (xy 191.490837 169.576529) - (xy 191.507414 169.532819) (xy 191.536237 169.456818) (xy 191.555278 169.3) (xy 191.544678 169.212696) + (xy 191.506488 169.535259) (xy 191.536237 169.456818) (xy 191.555278 169.3) (xy 191.544678 169.212696) (xy 191.536237 169.143181) (xy 191.514262 169.085238) (xy 191.48022 168.995477) (xy 191.390483 168.86547) (xy 191.27224 168.760717) (xy 191.272238 168.760716) (xy 191.272237 168.760715) (xy 191.132365 168.687303) - (xy 190.978986 168.6495) (xy 190.978985 168.6495) (xy 190.8319 168.6495) (xy 190.764861 168.629815) - (xy 190.744219 168.613181) (xy 190.643219 168.512181) (xy 190.609734 168.450858) (xy 190.614718 168.381166) - (xy 190.65659 168.325233) (xy 190.722054 168.300816) (xy 190.728188 168.300596) (xy 190.728985 168.3005) - (xy 190.882365 168.262696) (xy 190.925217 168.240205) (xy 191.02224 168.189283) (xy 191.140483 168.08453) - (xy 191.23022 167.954523) (xy 191.286237 167.806818) (xy 191.305278 167.65) (xy 191.294635 167.562342) - (xy 191.286237 167.493181) (xy 191.249724 167.396905) (xy 191.23022 167.345477) (xy 191.140483 167.21547) - (xy 191.02224 167.110717) (xy 191.022238 167.110716) (xy 191.022237 167.110715) (xy 190.882365 167.037303) - (xy 190.728986 166.9995) (xy 190.728985 166.9995) (xy 190.695681 166.9995) (xy 190.628642 166.979815) - (xy 190.582887 166.927011) (xy 190.571681 166.8755) (xy 190.571681 160.465275) (xy 190.591366 160.398236) + (xy 190.978986 168.6495) (xy 190.978985 168.6495) (xy 190.821015 168.6495) (xy 190.667635 168.687304) + (xy 190.667634 168.687304) (xy 190.660353 168.689099) (xy 190.659626 168.68615) (xy 190.603828 168.690448) + (xy 190.542322 168.657299) (xy 190.541842 168.656821) (xy 190.359466 168.474445) (xy 190.325981 168.413122) + (xy 190.330965 168.34343) (xy 190.372837 168.287497) (xy 190.417472 168.266367) (xy 190.432369 168.262696) + (xy 190.572244 168.189283) (xy 190.690487 168.08453) (xy 190.780224 167.954523) (xy 190.836241 167.806818) + (xy 190.855282 167.65) (xy 190.836241 167.493182) (xy 190.835833 167.492107) (xy 190.800902 167.4) + (xy 190.780224 167.345477) (xy 190.690487 167.21547) (xy 190.690485 167.215468) (xy 190.613454 167.147224) + (xy 190.576327 167.088035) (xy 190.571681 167.054409) (xy 190.571681 160.465275) (xy 190.591366 160.398236) (xy 190.64417 160.352481) (xy 190.713328 160.342537) (xy 190.776884 160.371562) (xy 190.803068 160.403275) (xy 190.841267 160.469437) (xy 190.845185 160.476223) (xy 195.765481 165.396518) (xy 195.798966 165.457841) (xy 195.800896 165.499143) (xy 195.794722 165.549997) (xy 195.794722 165.55) (xy 195.813762 165.706818) - (xy 195.856548 165.819633) (xy 195.86978 165.854523) (xy 195.959517 165.98453) (xy 196.07776 166.089283) + (xy 195.850818 165.804524) (xy 195.86978 165.854523) (xy 195.959517 165.98453) (xy 196.07776 166.089283) (xy 196.077762 166.089284) (xy 196.217634 166.162696) (xy 196.371014 166.2005) (xy 196.371015 166.2005) - (xy 196.528985 166.2005) (xy 196.682365 166.162696) (xy 196.695956 166.155563) (xy 196.82224 166.089283) + (xy 196.528985 166.2005) (xy 196.682365 166.162696) (xy 196.732955 166.136144) (xy 196.82224 166.089283) (xy 196.940483 165.98453) (xy 197.03022 165.854523) (xy 197.086237 165.706818) (xy 197.105278 165.55) (xy 197.090868 165.431324) (xy 197.102328 165.362402) (xy 197.149232 165.310616) (xy 197.216688 165.292409) (xy 197.283279 165.313561) (xy 197.301645 165.328698) (xy 200.817473 168.844526) (xy 200.850958 168.905849) (xy 200.852888 168.91726) (xy 200.863762 169.006815) (xy 200.863763 169.006821) (xy 200.915479 169.143182) - (xy 200.91978 169.154523) (xy 201.009517 169.28453) (xy 201.12776 169.389283) (xy 201.170973 169.411963) + (xy 200.91978 169.154523) (xy 201.009517 169.28453) (xy 201.12776 169.389283) (xy 201.127762 169.389284) (xy 201.256435 169.456818) (xy 201.267635 169.462696) (xy 201.401526 169.495696) (xy 201.419404 169.500103) (xy 201.479784 169.535259) (xy 201.500175 169.57517) (xy 201.516558 169.539297) (xy 201.575336 169.501523) (xy 201.580596 169.500103) (xy 201.593107 169.497019) (xy 201.732365 169.462696) (xy 201.87224 169.389283) @@ -158051,361 +162203,362 @@ (xy 196.410531 155.309011) (xy 196.458474 155.266539) (xy 196.548211 155.136532) (xy 196.570229 155.078472) (xy 196.612406 155.022771) (xy 196.678003 154.998713) (xy 196.746194 155.013939) (xy 196.773852 155.034763) (xy 203.138181 161.399092) (xy 203.171666 161.460415) (xy 203.1745 161.486773) (xy 203.1745 165.665564) - (xy 203.1745 165.764436) (xy 203.180162 165.785565) (xy 203.20009 165.859938) (xy 203.200091 165.859941) - (xy 203.243154 165.934528) (xy 203.249521 165.945556) (xy 203.249528 165.945565) (xy 204.843181 167.539218) - (xy 204.876666 167.600541) (xy 204.878907 167.621391) (xy 204.879364 167.62137) (xy 204.879499 167.624263) - (xy 204.882353 167.654699) (xy 204.882353 167.654701) (xy 204.925654 167.778445) (xy 204.927207 167.782882) - (xy 205.00785 167.89215) (xy 205.117118 167.972793) (xy 205.159845 167.987744) (xy 205.245299 168.017646) - (xy 205.27573 168.0205) (xy 205.275734 168.0205) (xy 205.78427 168.0205) (xy 205.814699 168.017646) - (xy 205.814701 168.017646) (xy 205.87879 167.995219) (xy 205.942882 167.972793) (xy 206.05215 167.89215) - (xy 206.132793 167.782882) (xy 206.165229 167.690185) (xy 206.177646 167.654701) (xy 206.177646 167.654699) - (xy 206.1805 167.624269) (xy 206.1805 166.96573) (xy 206.177646 166.9353) (xy 206.177646 166.935298) - (xy 206.134345 166.811554) (xy 206.132793 166.807118) (xy 206.05215 166.69785) (xy 206.007326 166.664768) - (xy 205.965077 166.609123) (xy 205.959618 166.539467) (xy 205.992685 166.477917) (xy 206.00732 166.465235) - (xy 206.05215 166.43215) (xy 206.132793 166.322882) (xy 206.16857 166.220638) (xy 206.177646 166.194701) - (xy 206.177646 166.194699) (xy 206.1805 166.164269) (xy 206.1805 165.50573) (xy 206.177646 165.4753) - (xy 206.177646 165.475298) (xy 206.134345 165.351554) (xy 206.132793 165.347118) (xy 206.05215 165.23785) - (xy 206.007326 165.204768) (xy 205.965077 165.149123) (xy 205.959618 165.079467) (xy 205.992685 165.017917) - (xy 206.00732 165.005235) (xy 206.05215 164.97215) (xy 206.132793 164.862882) (xy 206.165229 164.770185) - (xy 206.177646 164.734701) (xy 206.177646 164.734699) (xy 206.1805 164.704269) (xy 206.1805 164.04573) - (xy 206.177646 164.0153) (xy 206.177646 164.015298) (xy 206.132793 163.887119) (xy 206.132792 163.887117) - (xy 206.132791 163.887116) (xy 206.05215 163.77785) (xy 206.007326 163.744768) (xy 205.965077 163.689123) - (xy 205.959618 163.619467) (xy 205.992685 163.557917) (xy 206.00732 163.545235) (xy 206.05215 163.51215) - (xy 206.132793 163.402882) (xy 206.168618 163.3005) (xy 206.177646 163.274701) (xy 206.177646 163.274699) - (xy 206.1805 163.244269) (xy 206.1805 162.58573) (xy 206.177646 162.5553) (xy 206.177646 162.555298) - (xy 206.134345 162.431554) (xy 206.132793 162.427118) (xy 206.05215 162.31785) (xy 205.942882 162.237207) - (xy 205.94288 162.237206) (xy 205.8147 162.192353) (xy 205.78427 162.1895) (xy 205.784266 162.1895) - (xy 205.3995 162.1895) (xy 205.332461 162.169815) (xy 205.286706 162.117011) (xy 205.2755 162.0655) - (xy 205.2755 160.699999) (xy 206.444722 160.699999) (xy 206.444722 160.7) (xy 206.463762 160.856818) - (xy 206.517885 160.999526) (xy 206.51978 161.004523) (xy 206.609517 161.13453) (xy 206.72776 161.239283) - (xy 206.734884 161.243022) (xy 206.867634 161.312696) (xy 207.021014 161.3505) (xy 207.021015 161.3505) - (xy 207.178985 161.3505) (xy 207.332365 161.312696) (xy 207.355154 161.300735) (xy 207.47224 161.239283) - (xy 207.590483 161.13453) (xy 207.64795 161.051273) (xy 207.702233 161.007284) (xy 207.771681 160.999624) - (xy 207.834246 161.030727) (xy 207.852048 161.051272) (xy 207.858568 161.060717) (xy 207.909515 161.134528) - (xy 207.909517 161.13453) (xy 208.02776 161.239283) (xy 208.034884 161.243022) (xy 208.167634 161.312696) - (xy 208.321014 161.3505) (xy 208.321015 161.3505) (xy 208.478985 161.3505) (xy 208.632365 161.312696) - (xy 208.655154 161.300735) (xy 208.77224 161.239283) (xy 208.890483 161.13453) (xy 208.94795 161.051273) - (xy 209.002233 161.007284) (xy 209.071681 160.999624) (xy 209.134246 161.030727) (xy 209.152048 161.051272) - (xy 209.158568 161.060717) (xy 209.209515 161.134528) (xy 209.209517 161.13453) (xy 209.32776 161.239283) - (xy 209.334884 161.243022) (xy 209.467634 161.312696) (xy 209.621014 161.3505) (xy 209.621015 161.3505) - (xy 209.778985 161.3505) (xy 209.932365 161.312696) (xy 209.955154 161.300735) (xy 210.07224 161.239283) - (xy 210.190483 161.13453) (xy 210.24795 161.051273) (xy 210.302233 161.007284) (xy 210.371681 160.999624) - (xy 210.434246 161.030727) (xy 210.452048 161.051272) (xy 210.458568 161.060717) (xy 210.509515 161.134528) - (xy 210.509517 161.13453) (xy 210.62776 161.239283) (xy 210.634884 161.243022) (xy 210.767634 161.312696) - (xy 210.921014 161.3505) (xy 210.921015 161.3505) (xy 211.078985 161.3505) (xy 211.232365 161.312696) - (xy 211.255154 161.300735) (xy 211.37224 161.239283) (xy 211.490483 161.13453) (xy 211.58022 161.004523) - (xy 211.636237 160.856818) (xy 211.655278 160.7) (xy 211.649102 160.649144) (xy 211.660561 160.580224) - (xy 211.684514 160.546521) (xy 212.890951 159.340084) (xy 212.92628 159.317244) (xy 212.925723 159.316182) - (xy 212.965893 159.295099) (xy 213.07224 159.239283) (xy 213.190483 159.13453) (xy 213.28022 159.004523) - (xy 213.336237 158.856818) (xy 213.355278 158.7) (xy 213.345588 158.62019) (xy 213.336237 158.543181) - (xy 213.305969 158.463371) (xy 213.28022 158.395477) (xy 213.190483 158.26547) (xy 213.07224 158.160717) - (xy 213.072238 158.160716) (xy 213.072237 158.160715) (xy 212.932365 158.087303) (xy 212.778986 158.0495) - (xy 212.778985 158.0495) (xy 212.621015 158.0495) (xy 212.621014 158.0495) (xy 212.467634 158.087303) - (xy 212.327761 158.160715) (xy 212.327759 158.160717) (xy 212.282226 158.201055) (xy 212.218992 158.230776) - (xy 212.149729 158.221592) (xy 212.117774 158.201055) (xy 212.07224 158.160717) (xy 212.072238 158.160715) - (xy 211.932365 158.087303) (xy 211.778986 158.0495) (xy 211.778985 158.0495) (xy 211.621015 158.0495) - (xy 211.621014 158.0495) (xy 211.467634 158.087303) (xy 211.327762 158.160715) (xy 211.209516 158.265471) - (xy 211.15205 158.348725) (xy 211.097767 158.392715) (xy 211.028318 158.400375) (xy 210.965754 158.369271) - (xy 210.94795 158.348725) (xy 210.899999 158.279257) (xy 210.890483 158.26547) (xy 210.77224 158.160717) - (xy 210.772238 158.160716) (xy 210.772237 158.160715) (xy 210.632365 158.087303) (xy 210.478986 158.0495) - (xy 210.478985 158.0495) (xy 210.321015 158.0495) (xy 210.321014 158.0495) (xy 210.167634 158.087303) - (xy 210.027762 158.160715) (xy 209.909516 158.265471) (xy 209.85205 158.348725) (xy 209.797767 158.392715) - (xy 209.728318 158.400375) (xy 209.665754 158.369271) (xy 209.64795 158.348725) (xy 209.599999 158.279257) - (xy 209.590483 158.26547) (xy 209.47224 158.160717) (xy 209.472238 158.160716) (xy 209.472237 158.160715) - (xy 209.332365 158.087303) (xy 209.178986 158.0495) (xy 209.178985 158.0495) (xy 209.021015 158.0495) - (xy 209.021014 158.0495) (xy 208.867634 158.087303) (xy 208.727762 158.160715) (xy 208.609516 158.265471) - (xy 208.519781 158.395475) (xy 208.51978 158.395476) (xy 208.463762 158.543181) (xy 208.444722 158.699999) - (xy 208.444722 158.700001) (xy 208.450896 158.750854) (xy 208.439435 158.819777) (xy 208.415481 158.85348) - (xy 207.255781 160.013181) (xy 207.194458 160.046666) (xy 207.1681 160.0495) (xy 207.021014 160.0495) - (xy 206.867634 160.087303) (xy 206.727762 160.160715) (xy 206.609516 160.265471) (xy 206.519781 160.395475) - (xy 206.51978 160.395476) (xy 206.463762 160.543181) (xy 206.444722 160.699999) (xy 205.2755 160.699999) - (xy 205.2755 160.459122) (xy 205.2755 160.459119) (xy 205.274111 160.453937) (xy 205.254676 160.381403) - (xy 205.24991 160.363616) (xy 205.200475 160.277992) (xy 205.130562 160.208079) (xy 193.749391 148.826908) - (xy 193.715906 148.765585) (xy 193.72089 148.695893) (xy 193.749388 148.651549) (xy 193.829746 148.571191) - (xy 193.858855 148.533256) (xy 193.872836 148.49484) (xy 193.914261 148.438578) (xy 193.946946 148.42073) - (xy 193.985363 148.406748) (xy 194.023298 148.37764) (xy 194.183299 148.217638) (xy 194.212408 148.179703) - (xy 194.226389 148.141287) (xy 194.267814 148.085025) (xy 194.300499 148.067177) (xy 194.338916 148.053195) - (xy 194.33892 148.053191) (xy 194.347236 148.048631) (xy 194.348534 148.050998) (xy 194.400078 148.031064) - (xy 194.468524 148.045094) (xy 194.51852 148.093901) (xy 194.534193 148.161991) (xy 194.526353 148.198604) - (xy 194.476263 148.330681) (xy 194.457222 148.487499) (xy 194.457222 148.4875) (xy 194.476262 148.644318) - (xy 194.522253 148.765585) (xy 194.53228 148.792023) (xy 194.622017 148.92203) (xy 194.74026 149.026783) - (xy 194.740262 149.026784) (xy 194.880134 149.100196) (xy 195.033514 149.138) (xy 195.180601 149.138) - (xy 195.24764 149.157685) (xy 195.268282 149.174319) (xy 195.294438 149.200475) (xy 195.380062 149.24991) - (xy 195.425403 149.262059) (xy 195.475564 149.2755) (xy 195.475565 149.2755) (xy 197.903692 149.2755) - (xy 197.970731 149.295185) (xy 198.005742 149.329061) (xy 198.008163 149.332569) (xy 198.009515 149.334528) - (xy 198.009517 149.33453) (xy 198.12776 149.439283) (xy 198.134916 149.443039) (xy 198.267634 149.512696) - (xy 198.421014 149.5505) (xy 198.421015 149.5505) (xy 198.578985 149.5505) (xy 198.732365 149.512696) - (xy 198.78885 149.48305) (xy 198.87224 149.439283) (xy 198.990483 149.33453) (xy 199.08022 149.204523) - (xy 199.136237 149.056818) (xy 199.155278 148.9) (xy 199.151652 148.870141) (xy 199.136237 148.743182) - (xy 199.133366 148.735613) (xy 199.101267 148.650975) (xy 199.095901 148.581316) (xy 199.129048 148.519809) - (xy 199.190186 148.485988) (xy 199.259904 148.490589) (xy 199.299436 148.514191) (xy 199.327759 148.539282) - (xy 199.327761 148.539284) (xy 199.467634 148.612696) (xy 199.621014 148.6505) (xy 199.621015 148.6505) - (xy 199.778985 148.6505) (xy 199.932365 148.612696) (xy 199.955654 148.600473) (xy 200.07224 148.539283) - (xy 200.190483 148.43453) (xy 200.28022 148.304523) (xy 200.336237 148.156818) (xy 200.355278 148) - (xy 200.353823 147.988021) (xy 200.336237 147.843182) (xy 200.330488 147.828023) (xy 200.288887 147.718332) - (xy 200.283521 147.648671) (xy 200.316668 147.587165) (xy 200.377806 147.553344) (xy 200.434504 147.553966) - (xy 200.461014 147.5605) (xy 200.461015 147.5605) (xy 200.618985 147.5605) (xy 200.772365 147.522696) - (xy 200.79745 147.50953) (xy 200.91224 147.449283) (xy 201.030483 147.34453) (xy 201.12022 147.214523) - (xy 201.176237 147.066818) (xy 201.195278 146.91) (xy 201.194251 146.901537) (xy 201.176237 146.753181) - (xy 201.146057 146.673604) (xy 201.12022 146.605477) (xy 201.030483 146.47547) (xy 200.91224 146.370717) - (xy 200.912238 146.370716) (xy 200.912237 146.370715) (xy 200.772365 146.297303) (xy 200.618986 146.2595) - (xy 200.618985 146.2595) (xy 200.461015 146.2595) (xy 200.461014 146.2595) (xy 200.307634 146.297303) - (xy 200.167762 146.370715) (xy 200.049514 146.475472) (xy 199.998106 146.549952) (xy 199.943824 146.593943) - (xy 199.896056 146.603513) (xy 199.35938 146.603513) (xy 199.292341 146.583828) (xy 199.271699 146.567195) - (xy 198.97925 146.274748) (xy 198.979246 146.274745) (xy 198.934902 146.239007) (xy 198.855333 146.20267) - (xy 198.810523 146.182206) (xy 198.694642 146.165544) (xy 198.675183 146.162747) (xy 198.675182 146.162747) - (xy 198.539841 146.182206) (xy 198.415463 146.239007) (xy 198.415462 146.239008) (xy 198.371117 146.274743) - (xy 198.371113 146.274747) (xy 197.953244 146.692618) (xy 197.953234 146.69263) (xy 197.917499 146.736971) - (xy 197.917498 146.736974) (xy 197.860698 146.861349) (xy 197.841239 146.99669) (xy 197.860698 147.132031) - (xy 197.879366 147.172908) (xy 197.917499 147.25641) (xy 197.953237 147.300757) (xy 198.033686 147.381206) - (xy 198.065299 147.412818) (xy 198.098784 147.474141) (xy 198.0938 147.543833) (xy 198.051929 147.599767) - (xy 197.986465 147.624184) (xy 197.977618 147.6245) (xy 197.614364 147.6245) (xy 197.547325 147.604815) - (xy 197.50157 147.552011) (xy 197.491626 147.482853) (xy 197.498422 147.456529) (xy 197.518977 147.402328) - (xy 197.536237 147.356818) (xy 197.555278 147.2) (xy 197.552098 147.173806) (xy 197.536237 147.043181) - (xy 197.502763 146.954919) (xy 197.48022 146.895477) (xy 197.390483 146.76547) (xy 197.27224 146.660717) - (xy 197.272238 146.660716) (xy 197.272237 146.660715) (xy 197.132365 146.587303) (xy 196.978986 146.5495) - (xy 196.978985 146.5495) (xy 196.821015 146.5495) (xy 196.667633 146.587304) (xy 196.611949 146.616529) - (xy 196.54344 146.630253) (xy 196.478388 146.60476) (xy 196.466644 146.594413) (xy 196.014794 146.142563) - (xy 195.985954 146.097293) (xy 195.980175 146.081415) (xy 195.979471 146.080498) (xy 195.951066 146.04348) - (xy 195.951059 146.043472) (xy 194.907187 144.999602) (xy 194.907181 144.999596) (xy 194.869247 144.970487) - (xy 194.869245 144.970486) (xy 194.869243 144.970485) (xy 194.761381 144.931227) (xy 194.646592 144.931227) - (xy 194.646591 144.931227) (xy 194.538727 144.970486) (xy 194.500788 144.999597) (xy 194.340791 145.159595) - (xy 194.34079 145.159596) (xy 194.31168 145.197532) (xy 194.297697 145.235949) (xy 194.256269 145.292212) - (xy 194.22359 145.310056) (xy 194.185172 145.32404) (xy 194.147235 145.35315) (xy 194.14723 145.353154) - (xy 194.066882 145.433503) (xy 194.005559 145.466988) (xy 193.935867 145.462004) (xy 193.89152 145.433503) - (xy 192.59377 144.135753) (xy 192.593769 144.135752) (xy 192.508145 144.086317) (xy 192.447585 144.07009) - (xy 192.447583 144.070089) (xy 192.447581 144.070088) (xy 192.412643 144.060727) (xy 192.412642 144.060727) - (xy 190.048226 144.060727) (xy 189.981187 144.041042) (xy 189.935432 143.988238) (xy 189.925488 143.91908) - (xy 189.954513 143.855524) (xy 189.960545 143.849046) (xy 192.477307 141.332283) (xy 192.53863 141.298798) - (xy 192.608322 141.303782) (xy 192.652669 141.332283) (xy 192.733015 141.412629) (xy 192.733018 141.412631) - (xy 192.733024 141.412637) (xy 192.770959 141.441746) (xy 192.809372 141.455727) (xy 192.865636 141.497153) - (xy 192.883483 141.529836) (xy 192.897465 141.56825) (xy 192.897466 141.568252) (xy 192.897467 141.568254) - (xy 192.926575 141.606189) (xy 193.086577 141.76619) (xy 193.105794 141.780936) (xy 193.12451 141.795298) - (xy 193.124511 141.795298) (xy 193.124512 141.795299) (xy 193.162927 141.80928) (xy 193.21919 141.850706) - (xy 193.237037 141.883389) (xy 193.25102 141.921806) (xy 193.251021 141.921808) (xy 193.280129 141.959743) - (xy 193.440131 142.119744) (xy 193.478066 142.148853) (xy 193.516479 142.162834) (xy 193.572743 142.20426) - (xy 193.59059 142.236943) (xy 193.604572 142.275357) (xy 193.604573 142.275359) (xy 193.604574 142.275361) - (xy 193.633682 142.313296) (xy 193.793684 142.473297) (xy 193.808563 142.484714) (xy 193.831617 142.502405) - (xy 193.831618 142.502405) (xy 193.831619 142.502406) (xy 193.870034 142.516387) (xy 193.926297 142.557813) - (xy 193.944144 142.590496) (xy 193.958127 142.628913) (xy 193.958128 142.628915) (xy 193.987236 142.66685) - (xy 194.147238 142.826851) (xy 194.185173 142.85596) (xy 194.223586 142.869941) (xy 194.27985 142.911367) - (xy 194.297697 142.94405) (xy 194.311679 142.982464) (xy 194.31168 142.982466) (xy 194.311681 142.982468) - (xy 194.340789 143.020403) (xy 194.500791 143.180404) (xy 194.538726 143.209513) (xy 194.577139 143.223494) - (xy 194.633403 143.26492) (xy 194.65125 143.297603) (xy 194.665232 143.336017) (xy 194.665233 143.336019) - (xy 194.665234 143.336021) (xy 194.694342 143.373956) (xy 194.854344 143.533957) (xy 194.863451 143.540945) - (xy 194.892277 143.563065) (xy 194.892278 143.563065) (xy 194.892279 143.563066) (xy 195.000145 143.602326) - (xy 195.000147 143.602326) (xy 195.114932 143.602326) (xy 195.114934 143.602326) (xy 195.2228 143.563066) - (xy 195.260734 143.533958) (xy 195.654054 143.140638) (xy 195.715377 143.107153) (xy 195.741735 143.104319) - (xy 197.5846 143.104319) (xy 197.584601 143.104319) (xy 197.632351 143.091524) (xy 197.680103 143.078729) - (xy 197.765727 143.029294) (xy 197.83564 142.959381) (xy 197.835639 142.959381) (xy 197.894208 142.900812) - (xy 198.454623 142.340397) (xy 198.515945 142.306913) (xy 198.585637 142.311897) (xy 198.64157 142.353769) - (xy 198.658244 142.384105) (xy 198.668959 142.412358) (xy 198.669781 142.414525) (xy 198.710349 142.473297) - (xy 198.759517 142.54453) (xy 198.87776 142.649283) (xy 198.877762 142.649284) (xy 199.017634 142.722696) - (xy 199.171014 142.7605) (xy 199.171015 142.7605) (xy 199.328983 142.7605) (xy 199.328985 142.7605) - (xy 199.374157 142.749366) (xy 199.443958 142.752435) (xy 199.491512 142.782082) (xy 200.184097 143.474667) - (xy 200.217582 143.53599) (xy 200.218033 143.586541) (xy 200.200125 143.676563) (xy 200.167739 143.738474) - (xy 200.166189 143.740051) (xy 200.133248 143.772992) (xy 200.071925 143.806477) (xy 200.015893 143.805708) - (xy 199.868986 143.7695) (xy 199.868985 143.7695) (xy 199.711015 143.7695) (xy 199.711014 143.7695) - (xy 199.557634 143.807303) (xy 199.417762 143.880715) (xy 199.41776 143.880717) (xy 199.325537 143.962419) - (xy 199.299516 143.985471) (xy 199.209781 144.115475) (xy 199.20978 144.115476) (xy 199.153762 144.263181) - (xy 199.134722 144.419999) (xy 199.134722 144.42) (xy 199.153762 144.576818) (xy 199.194428 144.684044) - (xy 199.20978 144.724523) (xy 199.299517 144.85453) (xy 199.41776 144.959283) (xy 199.417762 144.959284) - (xy 199.557634 145.032696) (xy 199.711014 145.0705) (xy 199.711015 145.0705) (xy 199.868985 145.0705) - (xy 200.022365 145.032696) (xy 200.075228 145.004951) (xy 200.16224 144.959283) (xy 200.280483 144.85453) - (xy 200.37022 144.724523) (xy 200.426237 144.576818) (xy 200.426237 144.576809) (xy 200.428031 144.569536) - (xy 200.430063 144.570037) (xy 200.453495 144.515583) (xy 200.461284 144.50703) (xy 200.697228 144.271086) - (xy 200.758549 144.237603) (xy 200.760608 144.237174) (xy 200.848225 144.219745) (xy 200.910168 144.178357) - (xy 201.418824 143.669701) (xy 201.460212 143.607758) (xy 201.479655 143.510018) (xy 201.460212 143.412277) - (xy 201.418824 143.350335) (xy 201.418822 143.350332) (xy 201.086946 143.018456) (xy 201.066204 143.004597) - (xy 201.025002 142.977067) (xy 200.927261 142.957624) (xy 200.927259 142.957624) (xy 200.827007 142.977566) - (xy 200.757415 142.971339) (xy 200.715134 142.94363) (xy 199.93882 142.167316) (xy 199.905335 142.105993) - (xy 199.903407 142.094597) (xy 199.886237 141.953182) (xy 199.83022 141.805477) (xy 199.804168 141.767734) - (xy 199.782285 141.701379) (xy 199.79975 141.633728) (xy 199.827561 141.601435) (xy 199.832171 141.597651) - (xy 199.832179 141.597646) (xy 200.237192 141.192633) (xy 200.298515 141.159148) (xy 200.324873 141.156314) - (xy 201.17862 141.156314) (xy 201.178622 141.156314) (xy 201.219167 141.145449) (xy 201.227736 141.143154) - (xy 201.275931 141.13024) (xy 201.345781 141.131901) (xy 201.403644 141.171063) (xy 201.431122 141.235068) - (xy 201.433762 141.256817) (xy 201.43842 141.269098) (xy 201.480619 141.380368) (xy 201.488677 141.424337) - (xy 201.488677 142.245994) (xy 201.468992 142.313033) (xy 201.452358 142.333675) (xy 201.284228 142.501804) - (xy 201.284227 142.501805) (xy 201.242838 142.563749) (xy 201.229962 142.62848) (xy 201.223395 142.66149) - (xy 201.242838 142.759231) (xy 201.265716 142.793471) (xy 201.284227 142.821175) (xy 201.616103 143.153051) - (xy 201.616106 143.153053) (xy 201.678048 143.194441) (xy 201.753811 143.209512) (xy 201.775788 143.213884) - (xy 201.775788 143.213883) (xy 201.775789 143.213884) (xy 201.873529 143.194441) (xy 201.935472 143.153053) - (xy 202.444128 142.644397) (xy 202.485516 142.582454) (xy 202.504959 142.484714) (xy 202.485516 142.386973) - (xy 202.444128 142.325031) (xy 202.444126 142.325028) (xy 202.275996 142.156898) (xy 202.242511 142.095575) - (xy 202.239677 142.069217) (xy 202.239677 141.820557) (xy 202.259362 141.753518) (xy 202.306047 141.710763) - (xy 202.44224 141.639283) (xy 202.560483 141.53453) (xy 202.65022 141.404523) (xy 202.706237 141.256818) - (xy 202.725278 141.1) (xy 202.725271 141.099938) (xy 202.706237 140.943181) (xy 202.663371 140.830154) - (xy 202.65022 140.795477) (xy 202.560483 140.66547) (xy 202.44224 140.560717) (xy 202.442238 140.560716) - (xy 202.442237 140.560715) (xy 202.302366 140.487304) (xy 202.236139 140.470981) (xy 202.175759 140.435825) - (xy 202.14397 140.373606) (xy 202.150866 140.304077) (xy 202.178131 140.262905) (xy 203.759972 138.681063) - (xy 203.821293 138.64758) (xy 203.890985 138.652564) (xy 203.892444 138.653119) (xy 203.982544 138.688024) - (xy 204.183024 138.7255) (xy 204.183026 138.7255) (xy 204.386974 138.7255) (xy 204.386976 138.7255) - (xy 204.587456 138.688024) (xy 204.777637 138.614348) (xy 204.951041 138.506981) (xy 205.088292 138.38186) - (xy 205.101762 138.369581) (xy 205.108833 138.360218) (xy 205.224673 138.206821) (xy 205.315582 138.02425) - (xy 205.371397 137.828083) (xy 205.390215 137.625) (xy 205.387944 137.600496) (xy 205.371397 137.421917) - (xy 205.359203 137.379059) (xy 205.315582 137.22575) (xy 205.300504 137.19547) (xy 205.254762 137.103606) - (xy 205.224673 137.043179) (xy 205.139744 136.930715) (xy 205.101762 136.880418) (xy 204.951041 136.743019) - (xy 204.951039 136.743017) (xy 204.777642 136.635655) (xy 204.777635 136.635651) (xy 204.619774 136.574496) - (xy 204.587456 136.561976) (xy 204.386976 136.5245) (xy 204.183024 136.5245) (xy 203.982544 136.561976) - (xy 203.982541 136.561976) (xy 203.982541 136.561977) (xy 203.792364 136.635651) (xy 203.792357 136.635655) - (xy 203.61896 136.743017) (xy 203.618958 136.743019) (xy 203.468237 136.880418) (xy 203.345327 137.043178) - (xy 203.254422 137.225739) (xy 203.254417 137.225752) (xy 203.198602 137.421917) (xy 203.179785 137.624999) - (xy 203.179785 137.625) (xy 203.198602 137.828082) (xy 203.233453 137.950565) (xy 203.254417 138.024247) - (xy 203.255987 138.029763) (xy 203.254003 138.030327) (xy 203.259098 138.090816) (xy 203.22639 138.152557) - (xy 203.22529 138.153671) (xy 202.241863 139.137098) (xy 202.18054 139.170583) (xy 202.110848 139.165599) - (xy 202.054915 139.123727) (xy 202.030498 139.058263) (xy 202.031085 139.034476) (xy 202.035272 139) - (xy 202.016231 138.843182) (xy 202.014752 138.839283) (xy 201.991421 138.777764) (xy 201.960214 138.695477) - (xy 201.870477 138.56547) (xy 201.870476 138.565469) (xy 201.857271 138.55377) (xy 201.820146 138.494579) - (xy 201.8155 138.460956) (xy 201.8155 136.895816) (xy 201.835185 136.828777) (xy 201.836397 136.826926) - (xy 201.854388 136.8) (xy 201.885966 136.75274) (xy 201.9005 136.679674) (xy 201.9005 135.960326) - (xy 201.9005 135.960323) (xy 201.900499 135.960321) (xy 201.885967 135.887264) (xy 201.885966 135.88726) - (xy 201.830601 135.804399) (xy 201.74774 135.749034) (xy 201.747739 135.749033) (xy 201.747735 135.749032) - (xy 201.674677 135.7345) (xy 201.674674 135.7345) (xy 201.4059 135.7345) (xy 201.338861 135.714815) - (xy 201.293106 135.662011) (xy 201.283162 135.592853) (xy 201.312187 135.529297) (xy 201.318219 135.522819) - (xy 201.349219 135.491819) (xy 201.410542 135.458334) (xy 201.4369 135.4555) (xy 201.674676 135.4555) - (xy 201.674677 135.455499) (xy 201.74774 135.440966) (xy 201.830601 135.385601) (xy 201.885966 135.30274) - (xy 201.9005 135.229674) (xy 201.9005 135.084999) (xy 203.179785 135.084999) (xy 203.179785 135.085) - (xy 203.198602 135.288082) (xy 203.254417 135.484247) (xy 203.254422 135.48426) (xy 203.345327 135.666821) - (xy 203.468237 135.829581) (xy 203.618958 135.96698) (xy 203.61896 135.966982) (xy 203.689338 136.010558) - (xy 203.792363 136.074348) (xy 203.982544 136.148024) (xy 204.183024 136.1855) (xy 204.183026 136.1855) - (xy 204.386974 136.1855) (xy 204.386976 136.1855) (xy 204.587456 136.148024) (xy 204.777637 136.074348) - (xy 204.951041 135.966981) (xy 205.101764 135.829579) (xy 205.224673 135.666821) (xy 205.315582 135.48425) - (xy 205.371397 135.288083) (xy 205.390215 135.085) (xy 205.384582 135.024214) (xy 205.371397 134.881917) - (xy 205.358503 134.836601) (xy 205.315582 134.68575) (xy 205.306352 134.667214) (xy 205.270532 134.595277) - (xy 205.224673 134.503179) (xy 205.136265 134.386108) (xy 205.101762 134.340418) (xy 204.951041 134.203019) - (xy 204.951039 134.203017) (xy 204.777642 134.095655) (xy 204.777635 134.095651) (xy 204.682546 134.058814) - (xy 204.587456 134.021976) (xy 204.386976 133.9845) (xy 204.183024 133.9845) (xy 203.982544 134.021976) - (xy 203.982541 134.021976) (xy 203.982541 134.021977) (xy 203.792364 134.095651) (xy 203.792357 134.095655) - (xy 203.61896 134.203017) (xy 203.618958 134.203019) (xy 203.468237 134.340418) (xy 203.345327 134.503178) - (xy 203.254422 134.685739) (xy 203.254417 134.685752) (xy 203.198602 134.881917) (xy 203.179785 135.084999) - (xy 201.9005 135.084999) (xy 201.9005 134.510326) (xy 201.9005 134.510323) (xy 201.900499 134.510321) - (xy 201.885967 134.437264) (xy 201.885966 134.43726) (xy 201.885964 134.437257) (xy 201.836396 134.363073) - (xy 201.81552 134.296396) (xy 201.8155 134.294184) (xy 201.8155 134.070566) (xy 201.8155 134.070565) - (xy 201.813985 134.064912) (xy 201.794 133.990326) (xy 201.78991 133.975062) (xy 201.740475 133.889438) - (xy 201.670562 133.819525) (xy 200.924709 133.073672) (xy 200.891224 133.012349) (xy 200.895666 132.950234) - (xy 200.894013 132.949764) (xy 200.909008 132.897064) (xy 200.951397 132.748083) (xy 200.970215 132.545) - (xy 200.970215 132.544999) (xy 203.179785 132.544999) (xy 203.179785 132.545) (xy 203.198602 132.748082) - (xy 203.254417 132.944247) (xy 203.254422 132.94426) (xy 203.345327 133.126821) (xy 203.468237 133.289581) - (xy 203.618958 133.42698) (xy 203.61896 133.426982) (xy 203.689996 133.470965) (xy 203.792363 133.534348) - (xy 203.982544 133.608024) (xy 204.183024 133.6455) (xy 204.183026 133.6455) (xy 204.386974 133.6455) - (xy 204.386976 133.6455) (xy 204.587456 133.608024) (xy 204.777637 133.534348) (xy 204.951041 133.426981) - (xy 205.101764 133.289579) (xy 205.224673 133.126821) (xy 205.315582 132.94425) (xy 205.371397 132.748083) - (xy 205.390215 132.545) (xy 205.390017 132.542868) (xy 205.371397 132.341917) (xy 205.355954 132.287641) - (xy 205.315582 132.14575) (xy 205.303185 132.120854) (xy 205.252199 132.018459) (xy 205.224673 131.963179) - (xy 205.101764 131.800421) (xy 205.101762 131.800418) (xy 204.951041 131.663019) (xy 204.951039 131.663017) - (xy 204.777642 131.555655) (xy 204.777635 131.555651) (xy 204.651457 131.50677) (xy 204.587456 131.481976) - (xy 204.386976 131.4445) (xy 204.183024 131.4445) (xy 203.982544 131.481976) (xy 203.982541 131.481976) - (xy 203.982541 131.481977) (xy 203.792364 131.555651) (xy 203.792357 131.555655) (xy 203.61896 131.663017) - (xy 203.618958 131.663019) (xy 203.468237 131.800418) (xy 203.345327 131.963178) (xy 203.254422 132.145739) - (xy 203.254417 132.145752) (xy 203.198602 132.341917) (xy 203.179785 132.544999) (xy 200.970215 132.544999) - (xy 200.970017 132.542868) (xy 200.951397 132.341917) (xy 200.935954 132.287641) (xy 200.895582 132.14575) - (xy 200.883185 132.120854) (xy 200.832199 132.018459) (xy 200.804673 131.963179) (xy 200.681764 131.800421) - (xy 200.681762 131.800418) (xy 200.531041 131.663019) (xy 200.531039 131.663017) (xy 200.357642 131.555655) - (xy 200.357635 131.555651) (xy 200.231457 131.50677) (xy 200.167456 131.481976) (xy 199.966976 131.4445) - (xy 199.763024 131.4445) (xy 199.562544 131.481976) (xy 199.562541 131.481976) (xy 199.562541 131.481977) - (xy 199.372364 131.555651) (xy 199.372357 131.555655) (xy 199.254777 131.628457) (xy 199.187416 131.647012) - (xy 199.120717 131.626204) (xy 199.075856 131.572639) (xy 199.0655 131.52303) (xy 199.0655 131.310566) - (xy 199.0655 131.310564) (xy 199.03991 131.215061) (xy 198.990475 131.129437) (xy 198.920562 131.059524) - (xy 198.453219 130.592181) (xy 198.419734 130.530858) (xy 198.424718 130.461166) (xy 198.46659 130.405233) - (xy 198.532054 130.380816) (xy 198.5409 130.3805) (xy 198.745815 130.3805) (xy 198.812854 130.400185) - (xy 198.856813 130.449225) (xy 198.925327 130.586821) (xy 198.973418 130.650504) (xy 199.048237 130.749581) - (xy 199.198958 130.88698) (xy 199.19896 130.886982) (xy 199.248614 130.917726) (xy 199.372363 130.994348) - (xy 199.562544 131.068024) (xy 199.763024 131.1055) (xy 199.763026 131.1055) (xy 199.966974 131.1055) - (xy 199.966976 131.1055) (xy 200.167456 131.068024) (xy 200.357637 130.994348) (xy 200.531041 130.886981) - (xy 200.681764 130.749579) (xy 200.804673 130.586821) (xy 200.895582 130.40425) (xy 200.951397 130.208083) - (xy 200.970215 130.005) (xy 200.967762 129.978532) (xy 200.951397 129.801917) (xy 200.935295 129.745325) - (xy 200.895582 129.60575) (xy 200.889323 129.593181) (xy 200.836603 129.487303) (xy 200.804673 129.423179) - (xy 200.681764 129.260421) (xy 200.681762 129.260418) (xy 200.531041 129.123019) (xy 200.531039 129.123017) - (xy 200.357642 129.015655) (xy 200.357635 129.015651) (xy 200.245383 128.972165) (xy 200.167456 128.941976) - (xy 199.966976 128.9045) (xy 199.763024 128.9045) (xy 199.562544 128.941976) (xy 199.562541 128.941976) - (xy 199.562541 128.941977) (xy 199.372364 129.015651) (xy 199.372357 129.015655) (xy 199.19896 129.123017) - (xy 199.198958 129.123019) (xy 199.048237 129.260418) (xy 198.926469 129.421667) (xy 198.925327 129.423179) - (xy 198.856813 129.560773) (xy 198.809313 129.612008) (xy 198.745815 129.6295) (xy 197.917065 129.6295) - (xy 197.850026 129.609815) (xy 197.829384 129.593181) (xy 197.825603 129.5894) (xy 197.825601 129.589399) - (xy 197.825601 129.589398) (xy 197.762398 129.547168) (xy 197.742739 129.534032) (xy 197.742735 129.534031) - (xy 197.669677 129.519499) (xy 197.669674 129.519499) (xy 197.200326 129.519499) (xy 197.200323 129.519499) - (xy 197.127264 129.534031) (xy 197.12726 129.534032) (xy 197.044399 129.589398) (xy 196.989033 129.672259) - (xy 196.989032 129.672263) (xy 196.9745 129.74532) (xy 196.9745 130.464677) (xy 196.989032 130.537734) - (xy 196.989033 130.537738) (xy 196.989034 130.537739) (xy 197.044399 130.6206) (xy 197.12726 130.675965) - (xy 197.127264 130.675966) (xy 197.200321 130.690498) (xy 197.200324 130.690499) (xy 197.200326 130.690499) - (xy 197.438101 130.690499) (xy 197.50514 130.710184) (xy 197.525782 130.726818) (xy 198.006783 131.207819) - (xy 198.040268 131.269142) (xy 198.035284 131.338834) (xy 197.993412 131.394767) (xy 197.927948 131.419184) - (xy 197.919102 131.4195) (xy 197.851014 131.4195) (xy 197.697634 131.457303) (xy 197.557762 131.530715) - (xy 197.514796 131.568779) (xy 197.454668 131.622048) (xy 197.439516 131.635471) (xy 197.349781 131.765475) - (xy 197.34978 131.765476) (xy 197.293762 131.913181) (xy 197.274722 132.069999) (xy 197.274722 132.070001) - (xy 197.280896 132.120854) (xy 197.269435 132.189777) (xy 197.245481 132.22348) (xy 197.138912 132.330049) - (xy 197.077589 132.363534) (xy 197.007897 132.35855) (xy 196.982343 132.345472) (xy 196.957741 132.329034) - (xy 196.957735 132.329032) (xy 196.884677 132.3145) (xy 196.884674 132.3145) (xy 196.415326 132.3145) - (xy 196.415323 132.3145) (xy 196.342264 132.329032) (xy 196.34226 132.329033) (xy 196.259399 132.384399) - (xy 196.204033 132.46726) (xy 196.204032 132.467264) (xy 196.1895 132.540321) (xy 196.1895 133.259678) - (xy 196.204032 133.332735) (xy 196.204033 133.332739) (xy 196.204034 133.33274) (xy 196.259399 133.415601) - (xy 196.328156 133.461542) (xy 196.34226 133.470966) (xy 196.342264 133.470967) (xy 196.415321 133.485499) - (xy 196.415324 133.4855) (xy 196.415326 133.4855) (xy 196.884676 133.4855) (xy 196.884677 133.485499) - (xy 196.95774 133.470966) (xy 196.977186 133.457972) (xy 197.043862 133.437095) (xy 197.111242 133.455579) - (xy 197.157933 133.507558) (xy 197.169109 133.576528) (xy 197.162018 133.605046) (xy 197.143763 133.65318) - (xy 197.139976 133.684366) (xy 197.112352 133.748544) (xy 197.054418 133.787599) (xy 196.984565 133.789132) - (xy 196.969593 133.782325) (xy 196.969021 133.783707) (xy 196.957735 133.779032) (xy 196.884677 133.7645) - (xy 196.884674 133.7645) (xy 196.415326 133.7645) (xy 196.415323 133.7645) (xy 196.342264 133.779032) - (xy 196.34226 133.779033) (xy 196.302849 133.805367) (xy 196.267465 133.82901) (xy 196.259398 133.8344) - (xy 196.244504 133.856691) (xy 196.190891 133.901496) (xy 196.121566 133.910203) (xy 196.058539 133.880048) - (xy 196.024361 133.828755) (xy 196.010496 133.789132) (xy 196.002793 133.767118) (xy 195.92215 133.65785) - (xy 195.812882 133.577207) (xy 195.81288 133.577206) (xy 195.6847 133.532353) (xy 195.65427 133.5295) - (xy 195.654266 133.5295) (xy 194.995734 133.5295) (xy 194.99573 133.5295) (xy 194.9653 133.532353) - (xy 194.965298 133.532353) (xy 194.837119 133.577206) (xy 194.837117 133.577207) (xy 194.727848 133.657851) - (xy 194.65679 133.754133) (xy 194.601143 133.796384) (xy 194.55702 133.8045) (xy 194.373468 133.8045) - (xy 194.306429 133.784815) (xy 194.304576 133.783601) (xy 194.297739 133.779033) (xy 194.224677 133.7645) - (xy 194.224674 133.7645) (xy 193.755326 133.7645) (xy 193.7495 133.7645) (xy 193.682461 133.744815) - (xy 193.636706 133.692011) (xy 193.6255 133.6405) (xy 193.6255 133.6095) (xy 193.645185 133.542461) - (xy 193.697989 133.496706) (xy 193.7495 133.4855) (xy 194.224676 133.4855) (xy 194.224677 133.485499) - (xy 194.29774 133.470966) (xy 194.380601 133.415601) (xy 194.435966 133.33274) (xy 194.4505 133.259674) - (xy 194.4505 132.540326) (xy 194.4505 132.540323) (xy 194.450499 132.540321) (xy 194.435967 132.467264) - (xy 194.435966 132.46726) (xy 194.418875 132.441681) (xy 194.386396 132.393073) (xy 194.36552 132.326396) - (xy 194.3655 132.324184) (xy 194.3655 130.701061) (xy 194.385185 130.634022) (xy 194.40727 130.608248) - (xy 194.490483 130.53453) (xy 194.58022 130.404523) (xy 194.636237 130.256818) (xy 194.655278 130.1) - (xy 194.643137 130.000004) (xy 194.636237 129.943181) (xy 194.602731 129.854834) (xy 194.58022 129.795477) - (xy 194.490483 129.66547) (xy 194.37224 129.560717) (xy 194.372238 129.560716) (xy 194.372237 129.560715) - (xy 194.232365 129.487303) (xy 194.078986 129.4495) (xy 194.078985 129.4495) (xy 193.921015 129.4495) - (xy 193.921014 129.4495) (xy 193.779174 129.484459) (xy 193.709372 129.481389) (xy 193.65231 129.441069) - (xy 193.626105 129.3763) (xy 193.6255 129.364062) (xy 193.6255 128.981898) (xy 193.645185 128.914859) - (xy 193.661814 128.894222) (xy 194.260714 128.295322) (xy 196.9745 128.295322) (xy 196.9745 129.014679) - (xy 196.989032 129.087736) (xy 196.989033 129.08774) (xy 196.989034 129.087741) (xy 197.044399 129.170602) - (xy 197.124119 129.223868) (xy 197.12726 129.225967) (xy 197.127264 129.225968) (xy 197.200321 129.2405) - (xy 197.200324 129.240501) (xy 197.200326 129.240501) (xy 197.669676 129.240501) (xy 197.669677 129.2405) - (xy 197.74274 129.225967) (xy 197.825601 129.170602) (xy 197.847761 129.137437) (xy 197.88239 129.085611) - (xy 197.936002 129.040805) (xy 197.985492 129.030501) (xy 198.724433 129.030501) (xy 198.724435 129.030501) - (xy 198.783497 129.014675) (xy 198.819937 129.004911) (xy 198.905561 128.955476) (xy 198.975474 128.885563) - (xy 199.259218 128.601819) (xy 199.320541 128.568334) (xy 199.346899 128.5655) (xy 200.739676 128.5655) - (xy 200.739677 128.565499) (xy 200.81274 128.550966) (xy 200.895601 128.495601) (xy 200.950966 128.41274) - (xy 200.9655 128.339674) (xy 200.9655 127.464999) (xy 203.179785 127.464999) (xy 203.179785 127.465) - (xy 203.198602 127.668082) (xy 203.254417 127.864247) (xy 203.254422 127.86426) (xy 203.345327 128.046821) - (xy 203.468237 128.209581) (xy 203.618958 128.34698) (xy 203.61896 128.346982) (xy 203.700279 128.397332) - (xy 203.792363 128.454348) (xy 203.982544 128.528024) (xy 204.183024 128.5655) (xy 204.183026 128.5655) - (xy 204.386974 128.5655) (xy 204.386976 128.5655) (xy 204.587456 128.528024) (xy 204.777637 128.454348) - (xy 204.951041 128.346981) (xy 205.087848 128.222265) (xy 205.101762 128.209581) (xy 205.101764 128.209579) - (xy 205.224673 128.046821) (xy 205.315582 127.86425) (xy 205.371397 127.668083) (xy 205.390215 127.465) - (xy 205.38819 127.443151) (xy 205.371397 127.261917) (xy 205.362853 127.231887) (xy 205.315582 127.06575) - (xy 205.313172 127.060911) (xy 205.261341 126.956818) (xy 205.224673 126.883179) (xy 205.127521 126.754529) - (xy 205.101762 126.720418) (xy 204.951041 126.583019) (xy 204.951039 126.583017) (xy 204.777642 126.475655) - (xy 204.777635 126.475651) (xy 204.637146 126.421226) (xy 204.587456 126.401976) (xy 204.386976 126.3645) - (xy 204.183024 126.3645) (xy 203.982544 126.401976) (xy 203.982541 126.401976) (xy 203.982541 126.401977) - (xy 203.792364 126.475651) (xy 203.792357 126.475655) (xy 203.61896 126.583017) (xy 203.618958 126.583019) - (xy 203.468237 126.720418) (xy 203.345327 126.883178) (xy 203.254422 127.065739) (xy 203.254417 127.065752) - (xy 203.198602 127.261917) (xy 203.179785 127.464999) (xy 200.9655 127.464999) (xy 200.9655 126.590326) - (xy 200.9655 126.590323) (xy 200.965499 126.590321) (xy 200.950967 126.517264) (xy 200.950966 126.51726) - (xy 200.936411 126.495477) (xy 200.895601 126.434399) (xy 200.81274 126.379034) (xy 200.812739 126.379033) - (xy 200.812735 126.379032) (xy 200.739677 126.3645) (xy 200.739674 126.3645) (xy 198.990326 126.3645) - (xy 198.990323 126.3645) (xy 198.917264 126.379032) (xy 198.91726 126.379033) (xy 198.834399 126.434399) - (xy 198.779033 126.51726) (xy 198.779032 126.517264) (xy 198.7645 126.590321) (xy 198.7645 127.983101) - (xy 198.744815 128.05014) (xy 198.728181 128.070782) (xy 198.555781 128.243182) (xy 198.494458 128.276667) - (xy 198.4681 128.279501) (xy 197.985492 128.279501) (xy 197.918453 128.259816) (xy 197.88239 128.224391) - (xy 197.825602 128.139401) (xy 197.825425 128.139283) (xy 197.756771 128.09341) (xy 197.742739 128.084034) - (xy 197.742735 128.084033) (xy 197.669677 128.069501) (xy 197.669674 128.069501) (xy 197.200326 128.069501) - (xy 197.200323 128.069501) (xy 197.127264 128.084033) (xy 197.12726 128.084034) (xy 197.044399 128.1394) - (xy 196.989033 128.222261) (xy 196.989032 128.222265) (xy 196.9745 128.295322) (xy 194.260714 128.295322) - (xy 198.444217 124.111818) (xy 198.50554 124.078334) (xy 198.531898 124.0755) (xy 198.678985 124.0755) - (xy 198.832365 124.037696) (xy 198.97224 123.964283) (xy 199.090483 123.85953) (xy 199.18022 123.729523) - (xy 199.236237 123.581818) (xy 199.255278 123.425) (xy 199.251568 123.394446) (xy 199.263028 123.325523) - (xy 199.309932 123.273737) (xy 199.374664 123.2555) (xy 224.819954 123.2555) + (xy 203.1745 165.764436) (xy 203.180162 165.785565) (xy 203.20009 165.859938) (xy 203.247716 165.942428) + (xy 203.249526 165.945563) (xy 203.249528 165.945565) (xy 204.843181 167.539218) (xy 204.876666 167.600541) + (xy 204.878907 167.621391) (xy 204.879364 167.62137) (xy 204.879499 167.624263) (xy 204.882353 167.654699) + (xy 204.882353 167.654701) (xy 204.925654 167.778445) (xy 204.927207 167.782882) (xy 205.00785 167.89215) + (xy 205.117118 167.972793) (xy 205.159845 167.987744) (xy 205.245299 168.017646) (xy 205.27573 168.0205) + (xy 205.275734 168.0205) (xy 205.78427 168.0205) (xy 205.814699 168.017646) (xy 205.814701 168.017646) + (xy 205.87879 167.995219) (xy 205.942882 167.972793) (xy 206.05215 167.89215) (xy 206.132793 167.782882) + (xy 206.165229 167.690185) (xy 206.177646 167.654701) (xy 206.177646 167.654699) (xy 206.1805 167.624269) + (xy 206.1805 166.96573) (xy 206.177646 166.9353) (xy 206.177646 166.935298) (xy 206.134345 166.811554) + (xy 206.132793 166.807118) (xy 206.05215 166.69785) (xy 206.007326 166.664768) (xy 205.965077 166.609123) + (xy 205.959618 166.539467) (xy 205.992685 166.477917) (xy 206.00732 166.465235) (xy 206.05215 166.43215) + (xy 206.132793 166.322882) (xy 206.16857 166.220638) (xy 206.177646 166.194701) (xy 206.177646 166.194699) + (xy 206.1805 166.164269) (xy 206.1805 165.50573) (xy 206.177646 165.4753) (xy 206.177646 165.475298) + (xy 206.134345 165.351554) (xy 206.132793 165.347118) (xy 206.05215 165.23785) (xy 206.007326 165.204768) + (xy 205.965077 165.149123) (xy 205.959618 165.079467) (xy 205.992685 165.017917) (xy 206.00732 165.005235) + (xy 206.05215 164.97215) (xy 206.132793 164.862882) (xy 206.165229 164.770185) (xy 206.177646 164.734701) + (xy 206.177646 164.734699) (xy 206.1805 164.704269) (xy 206.1805 164.04573) (xy 206.177646 164.0153) + (xy 206.177646 164.015298) (xy 206.132793 163.887119) (xy 206.132792 163.887117) (xy 206.132791 163.887116) + (xy 206.05215 163.77785) (xy 206.007326 163.744768) (xy 205.965077 163.689123) (xy 205.959618 163.619467) + (xy 205.992685 163.557917) (xy 206.00732 163.545235) (xy 206.05215 163.51215) (xy 206.132793 163.402882) + (xy 206.168618 163.3005) (xy 206.177646 163.274701) (xy 206.177646 163.274699) (xy 206.1805 163.244269) + (xy 206.1805 162.58573) (xy 206.177646 162.5553) (xy 206.177646 162.555298) (xy 206.134345 162.431554) + (xy 206.132793 162.427118) (xy 206.05215 162.31785) (xy 205.942882 162.237207) (xy 205.94288 162.237206) + (xy 205.8147 162.192353) (xy 205.78427 162.1895) (xy 205.784266 162.1895) (xy 205.3995 162.1895) + (xy 205.332461 162.169815) (xy 205.286706 162.117011) (xy 205.2755 162.0655) (xy 205.2755 160.699999) + (xy 206.444722 160.699999) (xy 206.444722 160.7) (xy 206.463762 160.856818) (xy 206.517885 160.999526) + (xy 206.51978 161.004523) (xy 206.609517 161.13453) (xy 206.72776 161.239283) (xy 206.734884 161.243022) + (xy 206.867634 161.312696) (xy 207.021014 161.3505) (xy 207.021015 161.3505) (xy 207.178985 161.3505) + (xy 207.332365 161.312696) (xy 207.355154 161.300735) (xy 207.47224 161.239283) (xy 207.590483 161.13453) + (xy 207.64795 161.051273) (xy 207.702233 161.007284) (xy 207.771681 160.999624) (xy 207.834246 161.030727) + (xy 207.852048 161.051272) (xy 207.858568 161.060717) (xy 207.909515 161.134528) (xy 207.909517 161.13453) + (xy 208.02776 161.239283) (xy 208.034884 161.243022) (xy 208.167634 161.312696) (xy 208.321014 161.3505) + (xy 208.321015 161.3505) (xy 208.478985 161.3505) (xy 208.632365 161.312696) (xy 208.655154 161.300735) + (xy 208.77224 161.239283) (xy 208.890483 161.13453) (xy 208.94795 161.051273) (xy 209.002233 161.007284) + (xy 209.071681 160.999624) (xy 209.134246 161.030727) (xy 209.152048 161.051272) (xy 209.158568 161.060717) + (xy 209.209515 161.134528) (xy 209.209517 161.13453) (xy 209.32776 161.239283) (xy 209.334884 161.243022) + (xy 209.467634 161.312696) (xy 209.621014 161.3505) (xy 209.621015 161.3505) (xy 209.778985 161.3505) + (xy 209.932365 161.312696) (xy 209.955154 161.300735) (xy 210.07224 161.239283) (xy 210.190483 161.13453) + (xy 210.24795 161.051273) (xy 210.302233 161.007284) (xy 210.371681 160.999624) (xy 210.434246 161.030727) + (xy 210.452048 161.051272) (xy 210.458568 161.060717) (xy 210.509515 161.134528) (xy 210.509517 161.13453) + (xy 210.62776 161.239283) (xy 210.634884 161.243022) (xy 210.767634 161.312696) (xy 210.921014 161.3505) + (xy 210.921015 161.3505) (xy 211.078985 161.3505) (xy 211.232365 161.312696) (xy 211.255154 161.300735) + (xy 211.37224 161.239283) (xy 211.490483 161.13453) (xy 211.58022 161.004523) (xy 211.636237 160.856818) + (xy 211.655278 160.7) (xy 211.649102 160.649144) (xy 211.660561 160.580224) (xy 211.684514 160.546521) + (xy 212.890951 159.340084) (xy 212.92628 159.317244) (xy 212.925723 159.316182) (xy 212.965893 159.295099) + (xy 213.07224 159.239283) (xy 213.190483 159.13453) (xy 213.28022 159.004523) (xy 213.336237 158.856818) + (xy 213.355278 158.7) (xy 213.345588 158.62019) (xy 213.336237 158.543181) (xy 213.305969 158.463371) + (xy 213.28022 158.395477) (xy 213.190483 158.26547) (xy 213.07224 158.160717) (xy 213.072238 158.160716) + (xy 213.072237 158.160715) (xy 212.932365 158.087303) (xy 212.778986 158.0495) (xy 212.778985 158.0495) + (xy 212.621015 158.0495) (xy 212.621014 158.0495) (xy 212.467634 158.087303) (xy 212.327761 158.160715) + (xy 212.327759 158.160717) (xy 212.282226 158.201055) (xy 212.218992 158.230776) (xy 212.149729 158.221592) + (xy 212.117774 158.201055) (xy 212.07224 158.160717) (xy 212.072238 158.160715) (xy 211.932365 158.087303) + (xy 211.778986 158.0495) (xy 211.778985 158.0495) (xy 211.621015 158.0495) (xy 211.621014 158.0495) + (xy 211.467634 158.087303) (xy 211.327762 158.160715) (xy 211.209516 158.265471) (xy 211.15205 158.348725) + (xy 211.097767 158.392715) (xy 211.028318 158.400375) (xy 210.965754 158.369271) (xy 210.94795 158.348725) + (xy 210.899999 158.279257) (xy 210.890483 158.26547) (xy 210.77224 158.160717) (xy 210.772238 158.160716) + (xy 210.772237 158.160715) (xy 210.632365 158.087303) (xy 210.478986 158.0495) (xy 210.478985 158.0495) + (xy 210.321015 158.0495) (xy 210.321014 158.0495) (xy 210.167634 158.087303) (xy 210.027762 158.160715) + (xy 209.909516 158.265471) (xy 209.85205 158.348725) (xy 209.797767 158.392715) (xy 209.728318 158.400375) + (xy 209.665754 158.369271) (xy 209.64795 158.348725) (xy 209.599999 158.279257) (xy 209.590483 158.26547) + (xy 209.47224 158.160717) (xy 209.472238 158.160716) (xy 209.472237 158.160715) (xy 209.332365 158.087303) + (xy 209.178986 158.0495) (xy 209.178985 158.0495) (xy 209.021015 158.0495) (xy 209.021014 158.0495) + (xy 208.867634 158.087303) (xy 208.727762 158.160715) (xy 208.609516 158.265471) (xy 208.519781 158.395475) + (xy 208.51978 158.395476) (xy 208.463762 158.543181) (xy 208.444722 158.699999) (xy 208.444722 158.700001) + (xy 208.450896 158.750854) (xy 208.439435 158.819777) (xy 208.415481 158.85348) (xy 207.255781 160.013181) + (xy 207.194458 160.046666) (xy 207.1681 160.0495) (xy 207.021014 160.0495) (xy 206.867634 160.087303) + (xy 206.727762 160.160715) (xy 206.609516 160.265471) (xy 206.519781 160.395475) (xy 206.51978 160.395476) + (xy 206.463762 160.543181) (xy 206.444722 160.699999) (xy 205.2755 160.699999) (xy 205.2755 160.459122) + (xy 205.2755 160.459119) (xy 205.274111 160.453937) (xy 205.24991 160.363617) (xy 205.24991 160.363616) + (xy 205.24795 160.360222) (xy 205.234193 160.336394) (xy 205.200475 160.277992) (xy 205.130562 160.208079) + (xy 193.749391 148.826908) (xy 193.715906 148.765585) (xy 193.72089 148.695893) (xy 193.749388 148.651549) + (xy 193.829746 148.571191) (xy 193.858855 148.533256) (xy 193.872836 148.49484) (xy 193.914261 148.438578) + (xy 193.946946 148.42073) (xy 193.985363 148.406748) (xy 194.023298 148.37764) (xy 194.183299 148.217638) + (xy 194.212408 148.179703) (xy 194.226389 148.141287) (xy 194.267814 148.085025) (xy 194.300499 148.067177) + (xy 194.338916 148.053195) (xy 194.33892 148.053191) (xy 194.347236 148.048631) (xy 194.348534 148.050998) + (xy 194.400078 148.031064) (xy 194.468524 148.045094) (xy 194.51852 148.093901) (xy 194.534193 148.161991) + (xy 194.526353 148.198604) (xy 194.476263 148.330681) (xy 194.457222 148.487499) (xy 194.457222 148.4875) + (xy 194.476262 148.644318) (xy 194.522253 148.765585) (xy 194.53228 148.792023) (xy 194.622017 148.92203) + (xy 194.74026 149.026783) (xy 194.740262 149.026784) (xy 194.880134 149.100196) (xy 195.033514 149.138) + (xy 195.180601 149.138) (xy 195.24764 149.157685) (xy 195.268282 149.174319) (xy 195.294438 149.200475) + (xy 195.380062 149.24991) (xy 195.425403 149.262059) (xy 195.475564 149.2755) (xy 195.475565 149.2755) + (xy 197.903692 149.2755) (xy 197.970731 149.295185) (xy 198.005742 149.329061) (xy 198.008163 149.332569) + (xy 198.009515 149.334528) (xy 198.009517 149.33453) (xy 198.12776 149.439283) (xy 198.134916 149.443039) + (xy 198.267634 149.512696) (xy 198.421014 149.5505) (xy 198.421015 149.5505) (xy 198.578985 149.5505) + (xy 198.732365 149.512696) (xy 198.78885 149.48305) (xy 198.87224 149.439283) (xy 198.990483 149.33453) + (xy 199.08022 149.204523) (xy 199.136237 149.056818) (xy 199.155278 148.9) (xy 199.151652 148.870141) + (xy 199.136237 148.743182) (xy 199.133366 148.735613) (xy 199.101267 148.650975) (xy 199.095901 148.581316) + (xy 199.129048 148.519809) (xy 199.190186 148.485988) (xy 199.259904 148.490589) (xy 199.299436 148.514191) + (xy 199.327759 148.539282) (xy 199.327761 148.539284) (xy 199.467634 148.612696) (xy 199.621014 148.6505) + (xy 199.621015 148.6505) (xy 199.778985 148.6505) (xy 199.932365 148.612696) (xy 199.955654 148.600473) + (xy 200.07224 148.539283) (xy 200.190483 148.43453) (xy 200.28022 148.304523) (xy 200.336237 148.156818) + (xy 200.355278 148) (xy 200.353823 147.988021) (xy 200.336237 147.843182) (xy 200.330488 147.828023) + (xy 200.288887 147.718332) (xy 200.283521 147.648671) (xy 200.316668 147.587165) (xy 200.377806 147.553344) + (xy 200.434504 147.553966) (xy 200.461014 147.5605) (xy 200.461015 147.5605) (xy 200.618985 147.5605) + (xy 200.772365 147.522696) (xy 200.79745 147.50953) (xy 200.91224 147.449283) (xy 201.030483 147.34453) + (xy 201.12022 147.214523) (xy 201.176237 147.066818) (xy 201.195278 146.91) (xy 201.194251 146.901537) + (xy 201.176237 146.753181) (xy 201.146057 146.673604) (xy 201.12022 146.605477) (xy 201.030483 146.47547) + (xy 200.91224 146.370717) (xy 200.912238 146.370716) (xy 200.912237 146.370715) (xy 200.772365 146.297303) + (xy 200.618986 146.2595) (xy 200.618985 146.2595) (xy 200.461015 146.2595) (xy 200.461014 146.2595) + (xy 200.307634 146.297303) (xy 200.167762 146.370715) (xy 200.049514 146.475472) (xy 199.998106 146.549952) + (xy 199.943824 146.593943) (xy 199.896056 146.603513) (xy 199.35938 146.603513) (xy 199.292341 146.583828) + (xy 199.271699 146.567195) (xy 198.97925 146.274748) (xy 198.979246 146.274745) (xy 198.934902 146.239007) + (xy 198.855333 146.20267) (xy 198.810523 146.182206) (xy 198.694642 146.165544) (xy 198.675183 146.162747) + (xy 198.675182 146.162747) (xy 198.539841 146.182206) (xy 198.415463 146.239007) (xy 198.415462 146.239008) + (xy 198.371117 146.274743) (xy 198.371113 146.274747) (xy 197.953244 146.692618) (xy 197.953234 146.69263) + (xy 197.917499 146.736971) (xy 197.917498 146.736974) (xy 197.860698 146.861349) (xy 197.841239 146.99669) + (xy 197.860698 147.132031) (xy 197.879366 147.172908) (xy 197.917499 147.25641) (xy 197.953237 147.300757) + (xy 198.033686 147.381206) (xy 198.065299 147.412818) (xy 198.098784 147.474141) (xy 198.0938 147.543833) + (xy 198.051929 147.599767) (xy 197.986465 147.624184) (xy 197.977618 147.6245) (xy 197.614364 147.6245) + (xy 197.547325 147.604815) (xy 197.50157 147.552011) (xy 197.491626 147.482853) (xy 197.498422 147.456529) + (xy 197.518977 147.402328) (xy 197.536237 147.356818) (xy 197.555278 147.2) (xy 197.552098 147.173806) + (xy 197.536237 147.043181) (xy 197.502763 146.954919) (xy 197.48022 146.895477) (xy 197.390483 146.76547) + (xy 197.27224 146.660717) (xy 197.272238 146.660716) (xy 197.272237 146.660715) (xy 197.132365 146.587303) + (xy 196.978986 146.5495) (xy 196.978985 146.5495) (xy 196.821015 146.5495) (xy 196.667633 146.587304) + (xy 196.611949 146.616529) (xy 196.54344 146.630253) (xy 196.478388 146.60476) (xy 196.466644 146.594413) + (xy 196.014794 146.142563) (xy 195.985954 146.097293) (xy 195.980175 146.081415) (xy 195.979471 146.080498) + (xy 195.951066 146.04348) (xy 195.951059 146.043472) (xy 194.907187 144.999602) (xy 194.907181 144.999596) + (xy 194.869247 144.970487) (xy 194.869245 144.970486) (xy 194.869243 144.970485) (xy 194.761381 144.931227) + (xy 194.646592 144.931227) (xy 194.646591 144.931227) (xy 194.538727 144.970486) (xy 194.500788 144.999597) + (xy 194.340791 145.159595) (xy 194.34079 145.159596) (xy 194.31168 145.197532) (xy 194.297697 145.235949) + (xy 194.256269 145.292212) (xy 194.22359 145.310056) (xy 194.185172 145.32404) (xy 194.147235 145.35315) + (xy 194.14723 145.353154) (xy 194.066882 145.433503) (xy 194.005559 145.466988) (xy 193.935867 145.462004) + (xy 193.89152 145.433503) (xy 192.59377 144.135753) (xy 192.593769 144.135752) (xy 192.508145 144.086317) + (xy 192.447585 144.07009) (xy 192.447583 144.070089) (xy 192.447581 144.070088) (xy 192.412643 144.060727) + (xy 192.412642 144.060727) (xy 190.048226 144.060727) (xy 189.981187 144.041042) (xy 189.935432 143.988238) + (xy 189.925488 143.91908) (xy 189.954513 143.855524) (xy 189.960545 143.849046) (xy 192.477307 141.332283) + (xy 192.53863 141.298798) (xy 192.608322 141.303782) (xy 192.652669 141.332283) (xy 192.733015 141.412629) + (xy 192.733018 141.412631) (xy 192.733024 141.412637) (xy 192.770959 141.441746) (xy 192.809372 141.455727) + (xy 192.865636 141.497153) (xy 192.883483 141.529836) (xy 192.897465 141.56825) (xy 192.897466 141.568252) + (xy 192.897467 141.568254) (xy 192.926575 141.606189) (xy 193.086577 141.76619) (xy 193.105794 141.780936) + (xy 193.12451 141.795298) (xy 193.124511 141.795298) (xy 193.124512 141.795299) (xy 193.162927 141.80928) + (xy 193.21919 141.850706) (xy 193.237037 141.883389) (xy 193.25102 141.921806) (xy 193.251021 141.921808) + (xy 193.280129 141.959743) (xy 193.440131 142.119744) (xy 193.478066 142.148853) (xy 193.516479 142.162834) + (xy 193.572743 142.20426) (xy 193.59059 142.236943) (xy 193.604572 142.275357) (xy 193.604573 142.275359) + (xy 193.604574 142.275361) (xy 193.633682 142.313296) (xy 193.793684 142.473297) (xy 193.808563 142.484714) + (xy 193.831617 142.502405) (xy 193.831618 142.502405) (xy 193.831619 142.502406) (xy 193.870034 142.516387) + (xy 193.926297 142.557813) (xy 193.944144 142.590496) (xy 193.958127 142.628913) (xy 193.958128 142.628915) + (xy 193.987236 142.66685) (xy 194.147238 142.826851) (xy 194.185173 142.85596) (xy 194.223586 142.869941) + (xy 194.27985 142.911367) (xy 194.297697 142.94405) (xy 194.311679 142.982464) (xy 194.31168 142.982466) + (xy 194.311681 142.982468) (xy 194.340789 143.020403) (xy 194.500791 143.180404) (xy 194.538726 143.209513) + (xy 194.577139 143.223494) (xy 194.633403 143.26492) (xy 194.65125 143.297603) (xy 194.665232 143.336017) + (xy 194.665233 143.336019) (xy 194.665234 143.336021) (xy 194.694342 143.373956) (xy 194.854344 143.533957) + (xy 194.863451 143.540945) (xy 194.892277 143.563065) (xy 194.892278 143.563065) (xy 194.892279 143.563066) + (xy 195.000145 143.602326) (xy 195.000147 143.602326) (xy 195.114932 143.602326) (xy 195.114934 143.602326) + (xy 195.2228 143.563066) (xy 195.260734 143.533958) (xy 195.654054 143.140638) (xy 195.715377 143.107153) + (xy 195.741735 143.104319) (xy 197.5846 143.104319) (xy 197.584601 143.104319) (xy 197.632351 143.091524) + (xy 197.680103 143.078729) (xy 197.765727 143.029294) (xy 197.83564 142.959381) (xy 197.835639 142.959381) + (xy 197.894208 142.900812) (xy 198.454623 142.340397) (xy 198.515945 142.306913) (xy 198.585637 142.311897) + (xy 198.64157 142.353769) (xy 198.658244 142.384105) (xy 198.668959 142.412358) (xy 198.669781 142.414525) + (xy 198.710349 142.473297) (xy 198.759517 142.54453) (xy 198.87776 142.649283) (xy 198.877762 142.649284) + (xy 199.017634 142.722696) (xy 199.171014 142.7605) (xy 199.171015 142.7605) (xy 199.328983 142.7605) + (xy 199.328985 142.7605) (xy 199.374157 142.749366) (xy 199.443958 142.752435) (xy 199.491512 142.782082) + (xy 200.184097 143.474667) (xy 200.217582 143.53599) (xy 200.218033 143.586541) (xy 200.200125 143.676563) + (xy 200.167739 143.738474) (xy 200.166189 143.740051) (xy 200.133248 143.772992) (xy 200.071925 143.806477) + (xy 200.015893 143.805708) (xy 199.868986 143.7695) (xy 199.868985 143.7695) (xy 199.711015 143.7695) + (xy 199.711014 143.7695) (xy 199.557634 143.807303) (xy 199.417762 143.880715) (xy 199.41776 143.880717) + (xy 199.325537 143.962419) (xy 199.299516 143.985471) (xy 199.209781 144.115475) (xy 199.20978 144.115476) + (xy 199.153762 144.263181) (xy 199.134722 144.419999) (xy 199.134722 144.42) (xy 199.153762 144.576818) + (xy 199.194428 144.684044) (xy 199.20978 144.724523) (xy 199.299517 144.85453) (xy 199.41776 144.959283) + (xy 199.417762 144.959284) (xy 199.557634 145.032696) (xy 199.711014 145.0705) (xy 199.711015 145.0705) + (xy 199.868985 145.0705) (xy 200.022365 145.032696) (xy 200.075228 145.004951) (xy 200.16224 144.959283) + (xy 200.280483 144.85453) (xy 200.37022 144.724523) (xy 200.426237 144.576818) (xy 200.426237 144.576809) + (xy 200.428031 144.569536) (xy 200.430063 144.570037) (xy 200.453495 144.515583) (xy 200.461284 144.50703) + (xy 200.697228 144.271086) (xy 200.758549 144.237603) (xy 200.760608 144.237174) (xy 200.848225 144.219745) + (xy 200.910168 144.178357) (xy 201.418824 143.669701) (xy 201.460212 143.607758) (xy 201.479655 143.510018) + (xy 201.460212 143.412277) (xy 201.418824 143.350335) (xy 201.418822 143.350332) (xy 201.086946 143.018456) + (xy 201.066204 143.004597) (xy 201.025002 142.977067) (xy 200.927261 142.957624) (xy 200.927259 142.957624) + (xy 200.827007 142.977566) (xy 200.757415 142.971339) (xy 200.715134 142.94363) (xy 199.93882 142.167316) + (xy 199.905335 142.105993) (xy 199.903407 142.094597) (xy 199.886237 141.953182) (xy 199.83022 141.805477) + (xy 199.804168 141.767734) (xy 199.782285 141.701379) (xy 199.79975 141.633728) (xy 199.827561 141.601435) + (xy 199.832171 141.597651) (xy 199.832179 141.597646) (xy 200.237192 141.192633) (xy 200.298515 141.159148) + (xy 200.324873 141.156314) (xy 201.17862 141.156314) (xy 201.178622 141.156314) (xy 201.219167 141.145449) + (xy 201.227736 141.143154) (xy 201.275931 141.13024) (xy 201.345781 141.131901) (xy 201.403644 141.171063) + (xy 201.431122 141.235068) (xy 201.433762 141.256817) (xy 201.43842 141.269098) (xy 201.480619 141.380368) + (xy 201.488677 141.424337) (xy 201.488677 142.245994) (xy 201.468992 142.313033) (xy 201.452358 142.333675) + (xy 201.284228 142.501804) (xy 201.284227 142.501805) (xy 201.242838 142.563749) (xy 201.229962 142.62848) + (xy 201.223395 142.66149) (xy 201.242838 142.759231) (xy 201.265716 142.793471) (xy 201.284227 142.821175) + (xy 201.616103 143.153051) (xy 201.616106 143.153053) (xy 201.678048 143.194441) (xy 201.753811 143.209512) + (xy 201.775788 143.213884) (xy 201.775788 143.213883) (xy 201.775789 143.213884) (xy 201.873529 143.194441) + (xy 201.935472 143.153053) (xy 202.444128 142.644397) (xy 202.485516 142.582454) (xy 202.504959 142.484714) + (xy 202.485516 142.386973) (xy 202.444128 142.325031) (xy 202.444126 142.325028) (xy 202.275996 142.156898) + (xy 202.242511 142.095575) (xy 202.239677 142.069217) (xy 202.239677 141.820557) (xy 202.259362 141.753518) + (xy 202.306047 141.710763) (xy 202.44224 141.639283) (xy 202.560483 141.53453) (xy 202.65022 141.404523) + (xy 202.706237 141.256818) (xy 202.725278 141.1) (xy 202.725271 141.099938) (xy 202.706237 140.943181) + (xy 202.663371 140.830154) (xy 202.65022 140.795477) (xy 202.560483 140.66547) (xy 202.44224 140.560717) + (xy 202.442238 140.560716) (xy 202.442237 140.560715) (xy 202.302366 140.487304) (xy 202.236139 140.470981) + (xy 202.175759 140.435825) (xy 202.14397 140.373606) (xy 202.150866 140.304077) (xy 202.178131 140.262905) + (xy 203.759972 138.681063) (xy 203.821293 138.64758) (xy 203.890985 138.652564) (xy 203.892444 138.653119) + (xy 203.982544 138.688024) (xy 204.183024 138.7255) (xy 204.183026 138.7255) (xy 204.386974 138.7255) + (xy 204.386976 138.7255) (xy 204.587456 138.688024) (xy 204.777637 138.614348) (xy 204.951041 138.506981) + (xy 205.088292 138.38186) (xy 205.101762 138.369581) (xy 205.108833 138.360218) (xy 205.224673 138.206821) + (xy 205.315582 138.02425) (xy 205.371397 137.828083) (xy 205.390215 137.625) (xy 205.387944 137.600496) + (xy 205.371397 137.421917) (xy 205.359203 137.379059) (xy 205.315582 137.22575) (xy 205.300504 137.19547) + (xy 205.254762 137.103606) (xy 205.224673 137.043179) (xy 205.139744 136.930715) (xy 205.101762 136.880418) + (xy 204.951041 136.743019) (xy 204.951039 136.743017) (xy 204.777642 136.635655) (xy 204.777635 136.635651) + (xy 204.619774 136.574496) (xy 204.587456 136.561976) (xy 204.386976 136.5245) (xy 204.183024 136.5245) + (xy 203.982544 136.561976) (xy 203.982541 136.561976) (xy 203.982541 136.561977) (xy 203.792364 136.635651) + (xy 203.792357 136.635655) (xy 203.61896 136.743017) (xy 203.618958 136.743019) (xy 203.468237 136.880418) + (xy 203.345327 137.043178) (xy 203.254422 137.225739) (xy 203.254417 137.225752) (xy 203.198602 137.421917) + (xy 203.179785 137.624999) (xy 203.179785 137.625) (xy 203.198602 137.828082) (xy 203.233453 137.950565) + (xy 203.254417 138.024247) (xy 203.255987 138.029763) (xy 203.254003 138.030327) (xy 203.259098 138.090816) + (xy 203.22639 138.152557) (xy 203.22529 138.153671) (xy 202.241863 139.137098) (xy 202.18054 139.170583) + (xy 202.110848 139.165599) (xy 202.054915 139.123727) (xy 202.030498 139.058263) (xy 202.031085 139.034476) + (xy 202.035272 139) (xy 202.016231 138.843182) (xy 202.014752 138.839283) (xy 201.991421 138.777764) + (xy 201.960214 138.695477) (xy 201.870477 138.56547) (xy 201.870476 138.565469) (xy 201.857271 138.55377) + (xy 201.820146 138.494579) (xy 201.8155 138.460956) (xy 201.8155 136.895816) (xy 201.835185 136.828777) + (xy 201.836397 136.826926) (xy 201.854388 136.8) (xy 201.885966 136.75274) (xy 201.9005 136.679674) + (xy 201.9005 135.960326) (xy 201.9005 135.960323) (xy 201.900499 135.960321) (xy 201.885967 135.887264) + (xy 201.885966 135.88726) (xy 201.830601 135.804399) (xy 201.763443 135.759526) (xy 201.747739 135.749033) + (xy 201.747735 135.749032) (xy 201.674677 135.7345) (xy 201.674674 135.7345) (xy 201.4059 135.7345) + (xy 201.338861 135.714815) (xy 201.293106 135.662011) (xy 201.283162 135.592853) (xy 201.312187 135.529297) + (xy 201.318219 135.522819) (xy 201.349219 135.491819) (xy 201.410542 135.458334) (xy 201.4369 135.4555) + (xy 201.674676 135.4555) (xy 201.674677 135.455499) (xy 201.74774 135.440966) (xy 201.830601 135.385601) + (xy 201.885966 135.30274) (xy 201.9005 135.229674) (xy 201.9005 135.084999) (xy 203.179785 135.084999) + (xy 203.179785 135.085) (xy 203.198602 135.288082) (xy 203.254417 135.484247) (xy 203.254422 135.48426) + (xy 203.345327 135.666821) (xy 203.468237 135.829581) (xy 203.618958 135.96698) (xy 203.61896 135.966982) + (xy 203.689338 136.010558) (xy 203.792363 136.074348) (xy 203.982544 136.148024) (xy 204.183024 136.1855) + (xy 204.183026 136.1855) (xy 204.386974 136.1855) (xy 204.386976 136.1855) (xy 204.587456 136.148024) + (xy 204.777637 136.074348) (xy 204.951041 135.966981) (xy 205.101764 135.829579) (xy 205.224673 135.666821) + (xy 205.315582 135.48425) (xy 205.371397 135.288083) (xy 205.390215 135.085) (xy 205.384582 135.024214) + (xy 205.371397 134.881917) (xy 205.358503 134.836601) (xy 205.315582 134.68575) (xy 205.306352 134.667214) + (xy 205.270532 134.595277) (xy 205.224673 134.503179) (xy 205.136265 134.386108) (xy 205.101762 134.340418) + (xy 204.951041 134.203019) (xy 204.951039 134.203017) (xy 204.777642 134.095655) (xy 204.777635 134.095651) + (xy 204.682546 134.058814) (xy 204.587456 134.021976) (xy 204.386976 133.9845) (xy 204.183024 133.9845) + (xy 203.982544 134.021976) (xy 203.982541 134.021976) (xy 203.982541 134.021977) (xy 203.792364 134.095651) + (xy 203.792357 134.095655) (xy 203.61896 134.203017) (xy 203.618958 134.203019) (xy 203.468237 134.340418) + (xy 203.345327 134.503178) (xy 203.254422 134.685739) (xy 203.254417 134.685752) (xy 203.198602 134.881917) + (xy 203.179785 135.084999) (xy 201.9005 135.084999) (xy 201.9005 134.510326) (xy 201.9005 134.510323) + (xy 201.900499 134.510321) (xy 201.885967 134.437264) (xy 201.885966 134.43726) (xy 201.885964 134.437257) + (xy 201.836396 134.363073) (xy 201.81552 134.296396) (xy 201.8155 134.294184) (xy 201.8155 134.070566) + (xy 201.8155 134.070565) (xy 201.813985 134.064912) (xy 201.794 133.990326) (xy 201.78991 133.975062) + (xy 201.740475 133.889438) (xy 201.670562 133.819525) (xy 200.924709 133.073672) (xy 200.891224 133.012349) + (xy 200.895666 132.950234) (xy 200.894013 132.949764) (xy 200.90388 132.915085) (xy 200.951397 132.748083) + (xy 200.970215 132.545) (xy 200.970215 132.544999) (xy 203.179785 132.544999) (xy 203.179785 132.545) + (xy 203.198602 132.748082) (xy 203.254417 132.944247) (xy 203.254422 132.94426) (xy 203.345327 133.126821) + (xy 203.468237 133.289581) (xy 203.618958 133.42698) (xy 203.61896 133.426982) (xy 203.689996 133.470965) + (xy 203.792363 133.534348) (xy 203.982544 133.608024) (xy 204.183024 133.6455) (xy 204.183026 133.6455) + (xy 204.386974 133.6455) (xy 204.386976 133.6455) (xy 204.587456 133.608024) (xy 204.777637 133.534348) + (xy 204.951041 133.426981) (xy 205.101764 133.289579) (xy 205.224673 133.126821) (xy 205.315582 132.94425) + (xy 205.371397 132.748083) (xy 205.390215 132.545) (xy 205.390017 132.542868) (xy 205.371397 132.341917) + (xy 205.355954 132.287641) (xy 205.315582 132.14575) (xy 205.303185 132.120854) (xy 205.252199 132.018459) + (xy 205.224673 131.963179) (xy 205.101764 131.800421) (xy 205.101762 131.800418) (xy 204.951041 131.663019) + (xy 204.951039 131.663017) (xy 204.777642 131.555655) (xy 204.777635 131.555651) (xy 204.651457 131.50677) + (xy 204.587456 131.481976) (xy 204.386976 131.4445) (xy 204.183024 131.4445) (xy 203.982544 131.481976) + (xy 203.982541 131.481976) (xy 203.982541 131.481977) (xy 203.792364 131.555651) (xy 203.792357 131.555655) + (xy 203.61896 131.663017) (xy 203.618958 131.663019) (xy 203.468237 131.800418) (xy 203.345327 131.963178) + (xy 203.254422 132.145739) (xy 203.254417 132.145752) (xy 203.198602 132.341917) (xy 203.179785 132.544999) + (xy 200.970215 132.544999) (xy 200.970017 132.542868) (xy 200.951397 132.341917) (xy 200.935954 132.287641) + (xy 200.895582 132.14575) (xy 200.883185 132.120854) (xy 200.832199 132.018459) (xy 200.804673 131.963179) + (xy 200.681764 131.800421) (xy 200.681762 131.800418) (xy 200.531041 131.663019) (xy 200.531039 131.663017) + (xy 200.357642 131.555655) (xy 200.357635 131.555651) (xy 200.231457 131.50677) (xy 200.167456 131.481976) + (xy 199.966976 131.4445) (xy 199.763024 131.4445) (xy 199.562544 131.481976) (xy 199.562541 131.481976) + (xy 199.562541 131.481977) (xy 199.372364 131.555651) (xy 199.372357 131.555655) (xy 199.254777 131.628457) + (xy 199.187416 131.647012) (xy 199.120717 131.626204) (xy 199.075856 131.572639) (xy 199.0655 131.52303) + (xy 199.0655 131.310566) (xy 199.0655 131.310564) (xy 199.03991 131.215061) (xy 198.990475 131.129437) + (xy 198.920562 131.059524) (xy 198.453219 130.592181) (xy 198.419734 130.530858) (xy 198.424718 130.461166) + (xy 198.46659 130.405233) (xy 198.532054 130.380816) (xy 198.5409 130.3805) (xy 198.745815 130.3805) + (xy 198.812854 130.400185) (xy 198.856813 130.449225) (xy 198.925327 130.586821) (xy 198.973418 130.650504) + (xy 199.048237 130.749581) (xy 199.198958 130.88698) (xy 199.19896 130.886982) (xy 199.248614 130.917726) + (xy 199.372363 130.994348) (xy 199.562544 131.068024) (xy 199.763024 131.1055) (xy 199.763026 131.1055) + (xy 199.966974 131.1055) (xy 199.966976 131.1055) (xy 200.167456 131.068024) (xy 200.357637 130.994348) + (xy 200.531041 130.886981) (xy 200.681764 130.749579) (xy 200.804673 130.586821) (xy 200.895582 130.40425) + (xy 200.951397 130.208083) (xy 200.970215 130.005) (xy 200.967762 129.978532) (xy 200.951397 129.801917) + (xy 200.935295 129.745325) (xy 200.895582 129.60575) (xy 200.889323 129.593181) (xy 200.836603 129.487303) + (xy 200.804673 129.423179) (xy 200.681764 129.260421) (xy 200.681762 129.260418) (xy 200.531041 129.123019) + (xy 200.531039 129.123017) (xy 200.357642 129.015655) (xy 200.357635 129.015651) (xy 200.245383 128.972165) + (xy 200.167456 128.941976) (xy 199.966976 128.9045) (xy 199.763024 128.9045) (xy 199.562544 128.941976) + (xy 199.562541 128.941976) (xy 199.562541 128.941977) (xy 199.372364 129.015651) (xy 199.372357 129.015655) + (xy 199.19896 129.123017) (xy 199.198958 129.123019) (xy 199.048237 129.260418) (xy 198.926469 129.421667) + (xy 198.925327 129.423179) (xy 198.856813 129.560773) (xy 198.809313 129.612008) (xy 198.745815 129.6295) + (xy 197.917065 129.6295) (xy 197.850026 129.609815) (xy 197.829384 129.593181) (xy 197.825603 129.5894) + (xy 197.825601 129.589399) (xy 197.825601 129.589398) (xy 197.762398 129.547168) (xy 197.742739 129.534032) + (xy 197.742735 129.534031) (xy 197.669677 129.519499) (xy 197.669674 129.519499) (xy 197.200326 129.519499) + (xy 197.200323 129.519499) (xy 197.127264 129.534031) (xy 197.12726 129.534032) (xy 197.044399 129.589398) + (xy 196.989033 129.672259) (xy 196.989032 129.672263) (xy 196.9745 129.74532) (xy 196.9745 130.464677) + (xy 196.989032 130.537734) (xy 196.989033 130.537738) (xy 196.989034 130.537739) (xy 197.044399 130.6206) + (xy 197.12726 130.675965) (xy 197.127264 130.675966) (xy 197.200321 130.690498) (xy 197.200324 130.690499) + (xy 197.200326 130.690499) (xy 197.438101 130.690499) (xy 197.50514 130.710184) (xy 197.525782 130.726818) + (xy 198.006783 131.207819) (xy 198.040268 131.269142) (xy 198.035284 131.338834) (xy 197.993412 131.394767) + (xy 197.927948 131.419184) (xy 197.919102 131.4195) (xy 197.851014 131.4195) (xy 197.697634 131.457303) + (xy 197.557762 131.530715) (xy 197.514796 131.568779) (xy 197.454668 131.622048) (xy 197.439516 131.635471) + (xy 197.349781 131.765475) (xy 197.34978 131.765476) (xy 197.293762 131.913181) (xy 197.274722 132.069999) + (xy 197.274722 132.070001) (xy 197.280896 132.120854) (xy 197.269435 132.189777) (xy 197.245481 132.22348) + (xy 197.138912 132.330049) (xy 197.077589 132.363534) (xy 197.007897 132.35855) (xy 196.982343 132.345472) + (xy 196.957741 132.329034) (xy 196.957735 132.329032) (xy 196.884677 132.3145) (xy 196.884674 132.3145) + (xy 196.415326 132.3145) (xy 196.415323 132.3145) (xy 196.342264 132.329032) (xy 196.34226 132.329033) + (xy 196.259399 132.384399) (xy 196.204033 132.46726) (xy 196.204032 132.467264) (xy 196.1895 132.540321) + (xy 196.1895 133.259678) (xy 196.204032 133.332735) (xy 196.204033 133.332739) (xy 196.204034 133.33274) + (xy 196.259399 133.415601) (xy 196.328156 133.461542) (xy 196.34226 133.470966) (xy 196.342264 133.470967) + (xy 196.415321 133.485499) (xy 196.415324 133.4855) (xy 196.415326 133.4855) (xy 196.884676 133.4855) + (xy 196.884677 133.485499) (xy 196.95774 133.470966) (xy 196.977186 133.457972) (xy 197.043862 133.437095) + (xy 197.111242 133.455579) (xy 197.157933 133.507558) (xy 197.169109 133.576528) (xy 197.162018 133.605046) + (xy 197.143763 133.65318) (xy 197.139976 133.684366) (xy 197.112352 133.748544) (xy 197.054418 133.787599) + (xy 196.984565 133.789132) (xy 196.969593 133.782325) (xy 196.969021 133.783707) (xy 196.957735 133.779032) + (xy 196.884677 133.7645) (xy 196.884674 133.7645) (xy 196.415326 133.7645) (xy 196.415323 133.7645) + (xy 196.342264 133.779032) (xy 196.34226 133.779033) (xy 196.302849 133.805367) (xy 196.267465 133.82901) + (xy 196.259398 133.8344) (xy 196.244504 133.856691) (xy 196.190891 133.901496) (xy 196.121566 133.910203) + (xy 196.058539 133.880048) (xy 196.024361 133.828755) (xy 196.010496 133.789132) (xy 196.002793 133.767118) + (xy 195.92215 133.65785) (xy 195.812882 133.577207) (xy 195.81288 133.577206) (xy 195.6847 133.532353) + (xy 195.65427 133.5295) (xy 195.654266 133.5295) (xy 194.995734 133.5295) (xy 194.99573 133.5295) + (xy 194.9653 133.532353) (xy 194.965298 133.532353) (xy 194.837119 133.577206) (xy 194.837117 133.577207) + (xy 194.727848 133.657851) (xy 194.65679 133.754133) (xy 194.601143 133.796384) (xy 194.55702 133.8045) + (xy 194.373468 133.8045) (xy 194.306429 133.784815) (xy 194.304576 133.783601) (xy 194.297739 133.779033) + (xy 194.224677 133.7645) (xy 194.224674 133.7645) (xy 193.755326 133.7645) (xy 193.7495 133.7645) + (xy 193.682461 133.744815) (xy 193.636706 133.692011) (xy 193.6255 133.6405) (xy 193.6255 133.6095) + (xy 193.645185 133.542461) (xy 193.697989 133.496706) (xy 193.7495 133.4855) (xy 194.224676 133.4855) + (xy 194.224677 133.485499) (xy 194.29774 133.470966) (xy 194.380601 133.415601) (xy 194.435966 133.33274) + (xy 194.4505 133.259674) (xy 194.4505 132.540326) (xy 194.4505 132.540323) (xy 194.450499 132.540321) + (xy 194.435967 132.467264) (xy 194.435966 132.46726) (xy 194.418875 132.441681) (xy 194.386396 132.393073) + (xy 194.36552 132.326396) (xy 194.3655 132.324184) (xy 194.3655 130.701061) (xy 194.385185 130.634022) + (xy 194.40727 130.608248) (xy 194.490483 130.53453) (xy 194.58022 130.404523) (xy 194.636237 130.256818) + (xy 194.655278 130.1) (xy 194.643137 130.000004) (xy 194.636237 129.943181) (xy 194.602731 129.854834) + (xy 194.58022 129.795477) (xy 194.490483 129.66547) (xy 194.37224 129.560717) (xy 194.372238 129.560716) + (xy 194.372237 129.560715) (xy 194.232365 129.487303) (xy 194.078986 129.4495) (xy 194.078985 129.4495) + (xy 193.921015 129.4495) (xy 193.921014 129.4495) (xy 193.779174 129.484459) (xy 193.709372 129.481389) + (xy 193.65231 129.441069) (xy 193.626105 129.3763) (xy 193.6255 129.364062) (xy 193.6255 128.981898) + (xy 193.645185 128.914859) (xy 193.661814 128.894222) (xy 194.260714 128.295322) (xy 196.9745 128.295322) + (xy 196.9745 129.014679) (xy 196.989032 129.087736) (xy 196.989033 129.08774) (xy 196.989034 129.087741) + (xy 197.044399 129.170602) (xy 197.124119 129.223868) (xy 197.12726 129.225967) (xy 197.127264 129.225968) + (xy 197.200321 129.2405) (xy 197.200324 129.240501) (xy 197.200326 129.240501) (xy 197.669676 129.240501) + (xy 197.669677 129.2405) (xy 197.74274 129.225967) (xy 197.825601 129.170602) (xy 197.847761 129.137437) + (xy 197.88239 129.085611) (xy 197.936002 129.040805) (xy 197.985492 129.030501) (xy 198.724433 129.030501) + (xy 198.724435 129.030501) (xy 198.783497 129.014675) (xy 198.819937 129.004911) (xy 198.905561 128.955476) + (xy 198.975474 128.885563) (xy 199.259218 128.601819) (xy 199.320541 128.568334) (xy 199.346899 128.5655) + (xy 200.739676 128.5655) (xy 200.739677 128.565499) (xy 200.81274 128.550966) (xy 200.895601 128.495601) + (xy 200.950966 128.41274) (xy 200.9655 128.339674) (xy 200.9655 127.464999) (xy 203.179785 127.464999) + (xy 203.179785 127.465) (xy 203.198602 127.668082) (xy 203.254417 127.864247) (xy 203.254422 127.86426) + (xy 203.345327 128.046821) (xy 203.468237 128.209581) (xy 203.618958 128.34698) (xy 203.61896 128.346982) + (xy 203.700279 128.397332) (xy 203.792363 128.454348) (xy 203.982544 128.528024) (xy 204.183024 128.5655) + (xy 204.183026 128.5655) (xy 204.386974 128.5655) (xy 204.386976 128.5655) (xy 204.587456 128.528024) + (xy 204.777637 128.454348) (xy 204.951041 128.346981) (xy 205.087848 128.222265) (xy 205.101762 128.209581) + (xy 205.101764 128.209579) (xy 205.224673 128.046821) (xy 205.315582 127.86425) (xy 205.371397 127.668083) + (xy 205.390215 127.465) (xy 205.38819 127.443151) (xy 205.371397 127.261917) (xy 205.362853 127.231887) + (xy 205.315582 127.06575) (xy 205.313172 127.060911) (xy 205.261341 126.956818) (xy 205.224673 126.883179) + (xy 205.127521 126.754529) (xy 205.101762 126.720418) (xy 204.951041 126.583019) (xy 204.951039 126.583017) + (xy 204.777642 126.475655) (xy 204.777635 126.475651) (xy 204.637146 126.421226) (xy 204.587456 126.401976) + (xy 204.386976 126.3645) (xy 204.183024 126.3645) (xy 203.982544 126.401976) (xy 203.982541 126.401976) + (xy 203.982541 126.401977) (xy 203.792364 126.475651) (xy 203.792357 126.475655) (xy 203.61896 126.583017) + (xy 203.618958 126.583019) (xy 203.468237 126.720418) (xy 203.345327 126.883178) (xy 203.254422 127.065739) + (xy 203.254417 127.065752) (xy 203.198602 127.261917) (xy 203.179785 127.464999) (xy 200.9655 127.464999) + (xy 200.9655 126.590326) (xy 200.9655 126.590323) (xy 200.965499 126.590321) (xy 200.950967 126.517264) + (xy 200.950966 126.51726) (xy 200.936411 126.495477) (xy 200.895601 126.434399) (xy 200.81274 126.379034) + (xy 200.812739 126.379033) (xy 200.812735 126.379032) (xy 200.739677 126.3645) (xy 200.739674 126.3645) + (xy 198.990326 126.3645) (xy 198.990323 126.3645) (xy 198.917264 126.379032) (xy 198.91726 126.379033) + (xy 198.834399 126.434399) (xy 198.779033 126.51726) (xy 198.779032 126.517264) (xy 198.7645 126.590321) + (xy 198.7645 127.983101) (xy 198.744815 128.05014) (xy 198.728181 128.070782) (xy 198.555781 128.243182) + (xy 198.494458 128.276667) (xy 198.4681 128.279501) (xy 197.985492 128.279501) (xy 197.918453 128.259816) + (xy 197.88239 128.224391) (xy 197.825602 128.139401) (xy 197.825425 128.139283) (xy 197.756771 128.09341) + (xy 197.742739 128.084034) (xy 197.742735 128.084033) (xy 197.669677 128.069501) (xy 197.669674 128.069501) + (xy 197.200326 128.069501) (xy 197.200323 128.069501) (xy 197.127264 128.084033) (xy 197.12726 128.084034) + (xy 197.044399 128.1394) (xy 196.989033 128.222261) (xy 196.989032 128.222265) (xy 196.9745 128.295322) + (xy 194.260714 128.295322) (xy 198.444217 124.111818) (xy 198.50554 124.078334) (xy 198.531898 124.0755) + (xy 198.678985 124.0755) (xy 198.832365 124.037696) (xy 198.868659 124.018647) (xy 198.97224 123.964283) + (xy 199.090483 123.85953) (xy 199.18022 123.729523) (xy 199.236237 123.581818) (xy 199.255278 123.425) + (xy 199.251568 123.394446) (xy 199.263028 123.325523) (xy 199.309932 123.273737) (xy 199.374664 123.2555) + (xy 224.50455 123.2555) ) ) (filled_polygon @@ -158607,77 +162760,76 @@ (xy 189.551043 149.949342) (xy 189.391045 150.109341) (xy 189.361934 150.147277) (xy 189.322674 150.255144) (xy 189.322674 150.255145) (xy 189.322674 150.369934) (xy 189.361934 150.4778) (xy 189.391042 150.515734) (xy 189.601158 150.72585) (xy 189.784362 150.909053) (xy 189.817847 150.970376) (xy 189.820681 150.996734) - (xy 189.820681 167.245616) (xy 189.846271 167.341119) (xy 189.87848 167.396906) (xy 189.886387 167.410601) - (xy 189.902858 167.478502) (xy 189.880005 167.544528) (xy 189.825084 167.587718) (xy 189.75553 167.594359) - (xy 189.693428 167.562342) (xy 189.691318 167.560281) (xy 188.978048 166.847011) (xy 187.936819 165.805781) - (xy 187.903334 165.744458) (xy 187.9005 165.7181) (xy 187.9005 163.150262) (xy 187.900499 163.150257) - (xy 187.900454 163.15009) (xy 187.88031 163.07491) (xy 187.88031 163.074909) (xy 187.876051 163.059018) - (xy 187.87491 163.054757) (xy 187.825475 162.969133) (xy 187.755562 162.89922) (xy 185.855868 160.999526) - (xy 185.855867 160.999525) (xy 185.770243 160.95009) (xy 185.722491 160.937295) (xy 185.722489 160.937294) - (xy 185.722487 160.937293) (xy 185.674741 160.9245) (xy 185.67474 160.9245) (xy 182.279047 160.9245) - (xy 182.212008 160.904815) (xy 182.166253 160.852011) (xy 182.156309 160.782853) (xy 182.185334 160.719297) - (xy 182.235714 160.684318) (xy 182.277327 160.668797) (xy 182.277326 160.668797) (xy 182.27733 160.668796) - (xy 182.392546 160.582546) (xy 182.478796 160.46733) (xy 182.529091 160.332482) (xy 182.5355 160.272872) - (xy 182.5355 160.2245) (xy 182.555185 160.157461) (xy 182.607989 160.111706) (xy 182.6595 160.1005) - (xy 185.224078 160.1005) (xy 185.291117 160.120185) (xy 185.306305 160.131684) (xy 185.309516 160.134528) - (xy 185.309517 160.13453) (xy 185.42776 160.239283) (xy 185.427762 160.239284) (xy 185.567634 160.312696) - (xy 185.721014 160.3505) (xy 185.721015 160.3505) (xy 185.878985 160.3505) (xy 186.032365 160.312696) - (xy 186.089225 160.282853) (xy 186.17224 160.239283) (xy 186.290483 160.13453) (xy 186.38022 160.004523) - (xy 186.436237 159.856818) (xy 186.455278 159.7) (xy 186.451989 159.672908) (xy 186.436237 159.543181) - (xy 186.391755 159.425893) (xy 186.38022 159.395477) (xy 186.290483 159.26547) (xy 186.17224 159.160717) - (xy 186.172238 159.160716) (xy 186.172237 159.160715) (xy 186.032365 159.087303) (xy 185.878986 159.0495) - (xy 185.878985 159.0495) (xy 185.721015 159.0495) (xy 185.721014 159.0495) (xy 185.567634 159.087303) - (xy 185.427762 159.160715) (xy 185.309515 159.265471) (xy 185.288487 159.295938) (xy 185.234205 159.33993) - (xy 185.186436 159.3495) (xy 182.6595 159.3495) (xy 182.592461 159.329815) (xy 182.546706 159.277011) - (xy 182.5355 159.2255) (xy 182.5355 159.177136) (xy 182.5355 159.177128) (xy 182.529091 159.117518) - (xy 182.478796 158.98267) (xy 182.392546 158.867454) (xy 182.27733 158.781204) (xy 182.277328 158.781203) - (xy 182.277327 158.781202) (xy 182.142481 158.730908) (xy 182.142482 158.730908) (xy 182.082882 158.724501) - (xy 182.08288 158.7245) (xy 182.082872 158.7245) (xy 180.987128 158.7245) (xy 180.98712 158.7245) - (xy 180.987117 158.724501) (xy 180.927518 158.730908) (xy 180.792672 158.781202) (xy 180.79267 158.781204) - (xy 180.677454 158.867454) (xy 180.591204 158.98267) (xy 180.591202 158.982672) (xy 180.540908 159.117518) - (xy 180.534501 159.177117) (xy 180.5345 159.177136) (xy 180.5345 160.143101) (xy 180.514815 160.21014) - (xy 180.498181 160.230782) (xy 180.340782 160.388181) (xy 180.279459 160.421666) (xy 180.253101 160.4245) - (xy 179.502446 160.4245) (xy 179.435407 160.404815) (xy 179.389652 160.352011) (xy 179.379708 160.282853) - (xy 179.393088 160.242047) (xy 179.4383 160.157461) (xy 179.463814 160.109727) (xy 179.521024 159.921132) - (xy 179.540341 159.725) (xy 179.521024 159.528868) (xy 179.48235 159.40138) (xy 179.481727 159.331515) - (xy 179.513328 159.277707) (xy 180.779219 158.011819) (xy 180.840542 157.978334) (xy 180.8669 157.9755) - (xy 186.103692 157.9755) (xy 186.170731 157.995185) (xy 186.205742 158.029061) (xy 186.206908 158.03075) - (xy 186.209515 158.034528) (xy 186.209517 158.03453) (xy 186.32776 158.139283) (xy 186.327762 158.139284) - (xy 186.467634 158.212696) (xy 186.621014 158.2505) (xy 186.621015 158.2505) (xy 186.778985 158.2505) - (xy 186.932365 158.212696) (xy 187.031401 158.160717) (xy 187.07224 158.139283) (xy 187.190483 158.03453) - (xy 187.28022 157.904523) (xy 187.336237 157.756818) (xy 187.355278 157.6) (xy 187.353737 157.587304) - (xy 187.336237 157.443181) (xy 187.30908 157.371576) (xy 187.28022 157.295477) (xy 187.190483 157.16547) - (xy 187.07224 157.060717) (xy 187.072238 157.060716) (xy 187.072237 157.060715) (xy 186.932365 156.987303) - (xy 186.778986 156.9495) (xy 186.778985 156.9495) (xy 186.621015 156.9495) (xy 186.621014 156.9495) - (xy 186.467634 156.987303) (xy 186.327762 157.060715) (xy 186.209516 157.16547) (xy 186.207089 157.168987) - (xy 186.205742 157.170938) (xy 186.151463 157.214929) (xy 186.103692 157.2245) (xy 180.610564 157.2245) - (xy 180.515063 157.250089) (xy 180.51506 157.25009) (xy 180.42944 157.299522) (xy 180.429435 157.299526) - (xy 178.982293 158.746668) (xy 178.92097 158.780153) (xy 178.858617 158.777648) (xy 178.73113 158.738975) - (xy 178.535 158.719659) (xy 178.33887 158.738975) (xy 178.289556 158.753934) (xy 178.21138 158.777649) - (xy 178.141516 158.778272) (xy 178.087706 158.746669) (xy 174.540563 155.199526) (xy 174.540562 155.199525) - (xy 174.454938 155.15009) (xy 174.389232 155.132484) (xy 174.389231 155.132483) (xy 174.359436 155.1245) - (xy 174.359435 155.1245) (xy 164.124 155.1245) (xy 164.056961 155.104815) (xy 164.011206 155.052011) - (xy 164 155.0005) (xy 164 151.3995) (xy 164.019685 151.332461) (xy 164.072489 151.286706) (xy 164.124 151.2755) - (xy 165.138636 151.2755) (xy 165.138637 151.2755) (xy 165.176729 151.265292) (xy 165.186937 151.262558) - (xy 165.212642 151.25567) (xy 165.234139 151.24991) (xy 165.319763 151.200475) (xy 165.389676 151.130562) - (xy 165.489675 151.030563) (xy 166.085856 150.43438) (xy 166.147179 150.400896) (xy 166.173537 150.398062) - (xy 166.320624 150.398062) (xy 166.474004 150.360258) (xy 166.506541 150.343181) (xy 166.613879 150.286845) - (xy 166.732122 150.182092) (xy 166.821859 150.052085) (xy 166.877876 149.90438) (xy 166.896917 149.747562) - (xy 166.896019 149.740162) (xy 166.877876 149.590743) (xy 166.850357 149.518182) (xy 166.821859 149.443039) - (xy 166.732122 149.313032) (xy 166.613879 149.208279) (xy 166.613877 149.208278) (xy 166.613876 149.208277) - (xy 166.474004 149.134865) (xy 166.320625 149.097062) (xy 166.313352 149.096179) (xy 166.249175 149.068556) - (xy 166.210119 149.010622) (xy 166.205853 148.965036) (xy 166.205278 148.965036) (xy 166.205278 148.958892) - (xy 166.205206 148.958126) (xy 166.205278 148.957536) (xy 166.1886 148.820183) (xy 166.186237 148.800717) - (xy 166.154614 148.717335) (xy 166.13022 148.653013) (xy 166.040483 148.523006) (xy 165.92224 148.418253) - (xy 165.922238 148.418252) (xy 165.922237 148.418251) (xy 165.782365 148.344839) (xy 165.628986 148.307036) - (xy 165.628985 148.307036) (xy 165.471015 148.307036) (xy 165.471014 148.307036) (xy 165.317634 148.344839) - (xy 165.177762 148.418251) (xy 165.152641 148.440506) (xy 165.078691 148.50602) (xy 165.059516 148.523007) - (xy 164.969781 148.653011) (xy 164.96978 148.653012) (xy 164.913762 148.800717) (xy 164.894722 148.957535) - (xy 164.894722 148.957537) (xy 164.900896 149.00839) (xy 164.889435 149.077313) (xy 164.865481 149.111016) - (xy 164.538319 149.438179) (xy 164.476998 149.471663) (xy 164.45064 149.474497) (xy 164.124 149.474497) - (xy 164.056961 149.454812) (xy 164.011206 149.402008) (xy 164 149.350497) (xy 164 147.882397) (xy 164.019685 147.815358) - (xy 164.036319 147.794716) (xy 167.087856 144.743179) (xy 167.149179 144.709694) (xy 167.175537 144.70686) - (xy 167.408356 144.70686) + (xy 189.820681 167.061183) (xy 189.800996 167.128222) (xy 189.778908 167.153998) (xy 189.709522 167.215468) + (xy 189.619785 167.345474) (xy 189.580751 167.448398) (xy 189.538572 167.5041) (xy 189.472975 167.528157) + (xy 189.404784 167.51293) (xy 189.377128 167.492107) (xy 187.936819 166.051798) (xy 187.903334 165.990475) + (xy 187.9005 165.964117) (xy 187.9005 163.150262) (xy 187.900499 163.150257) (xy 187.900454 163.15009) + (xy 187.88031 163.07491) (xy 187.88031 163.074909) (xy 187.876051 163.059018) (xy 187.87491 163.054757) + (xy 187.825475 162.969133) (xy 187.755562 162.89922) (xy 185.855868 160.999526) (xy 185.855867 160.999525) + (xy 185.770243 160.95009) (xy 185.722491 160.937295) (xy 185.722489 160.937294) (xy 185.722487 160.937293) + (xy 185.674741 160.9245) (xy 185.67474 160.9245) (xy 182.279047 160.9245) (xy 182.212008 160.904815) + (xy 182.166253 160.852011) (xy 182.156309 160.782853) (xy 182.185334 160.719297) (xy 182.235714 160.684318) + (xy 182.277327 160.668797) (xy 182.277326 160.668797) (xy 182.27733 160.668796) (xy 182.392546 160.582546) + (xy 182.478796 160.46733) (xy 182.529091 160.332482) (xy 182.5355 160.272872) (xy 182.5355 160.2245) + (xy 182.555185 160.157461) (xy 182.607989 160.111706) (xy 182.6595 160.1005) (xy 185.224078 160.1005) + (xy 185.291117 160.120185) (xy 185.306305 160.131684) (xy 185.309516 160.134528) (xy 185.309517 160.13453) + (xy 185.42776 160.239283) (xy 185.427762 160.239284) (xy 185.567634 160.312696) (xy 185.721014 160.3505) + (xy 185.721015 160.3505) (xy 185.878985 160.3505) (xy 186.032365 160.312696) (xy 186.089225 160.282853) + (xy 186.17224 160.239283) (xy 186.290483 160.13453) (xy 186.38022 160.004523) (xy 186.436237 159.856818) + (xy 186.455278 159.7) (xy 186.451989 159.672908) (xy 186.436237 159.543181) (xy 186.391755 159.425893) + (xy 186.38022 159.395477) (xy 186.290483 159.26547) (xy 186.17224 159.160717) (xy 186.172238 159.160716) + (xy 186.172237 159.160715) (xy 186.032365 159.087303) (xy 185.878986 159.0495) (xy 185.878985 159.0495) + (xy 185.721015 159.0495) (xy 185.721014 159.0495) (xy 185.567634 159.087303) (xy 185.427762 159.160715) + (xy 185.309515 159.265471) (xy 185.288487 159.295938) (xy 185.234205 159.33993) (xy 185.186436 159.3495) + (xy 182.6595 159.3495) (xy 182.592461 159.329815) (xy 182.546706 159.277011) (xy 182.5355 159.2255) + (xy 182.5355 159.177136) (xy 182.5355 159.177128) (xy 182.529091 159.117518) (xy 182.478796 158.98267) + (xy 182.392546 158.867454) (xy 182.27733 158.781204) (xy 182.277328 158.781203) (xy 182.277327 158.781202) + (xy 182.142481 158.730908) (xy 182.142482 158.730908) (xy 182.082882 158.724501) (xy 182.08288 158.7245) + (xy 182.082872 158.7245) (xy 180.987128 158.7245) (xy 180.98712 158.7245) (xy 180.987117 158.724501) + (xy 180.927518 158.730908) (xy 180.792672 158.781202) (xy 180.79267 158.781204) (xy 180.677454 158.867454) + (xy 180.591204 158.98267) (xy 180.591202 158.982672) (xy 180.540908 159.117518) (xy 180.534501 159.177117) + (xy 180.5345 159.177136) (xy 180.5345 160.143101) (xy 180.514815 160.21014) (xy 180.498181 160.230782) + (xy 180.340782 160.388181) (xy 180.279459 160.421666) (xy 180.253101 160.4245) (xy 179.502446 160.4245) + (xy 179.435407 160.404815) (xy 179.389652 160.352011) (xy 179.379708 160.282853) (xy 179.393088 160.242047) + (xy 179.4383 160.157461) (xy 179.463814 160.109727) (xy 179.521024 159.921132) (xy 179.540341 159.725) + (xy 179.521024 159.528868) (xy 179.48235 159.40138) (xy 179.481727 159.331515) (xy 179.513328 159.277707) + (xy 180.779219 158.011819) (xy 180.840542 157.978334) (xy 180.8669 157.9755) (xy 186.103692 157.9755) + (xy 186.170731 157.995185) (xy 186.205742 158.029061) (xy 186.206908 158.03075) (xy 186.209515 158.034528) + (xy 186.209517 158.03453) (xy 186.32776 158.139283) (xy 186.327762 158.139284) (xy 186.467634 158.212696) + (xy 186.621014 158.2505) (xy 186.621015 158.2505) (xy 186.778985 158.2505) (xy 186.932365 158.212696) + (xy 187.031401 158.160717) (xy 187.07224 158.139283) (xy 187.190483 158.03453) (xy 187.28022 157.904523) + (xy 187.336237 157.756818) (xy 187.355278 157.6) (xy 187.353737 157.587304) (xy 187.336237 157.443181) + (xy 187.30908 157.371576) (xy 187.28022 157.295477) (xy 187.190483 157.16547) (xy 187.07224 157.060717) + (xy 187.072238 157.060716) (xy 187.072237 157.060715) (xy 186.932365 156.987303) (xy 186.778986 156.9495) + (xy 186.778985 156.9495) (xy 186.621015 156.9495) (xy 186.621014 156.9495) (xy 186.467634 156.987303) + (xy 186.327762 157.060715) (xy 186.209516 157.16547) (xy 186.207089 157.168987) (xy 186.205742 157.170938) + (xy 186.151463 157.214929) (xy 186.103692 157.2245) (xy 180.610564 157.2245) (xy 180.515063 157.250089) + (xy 180.51506 157.25009) (xy 180.42944 157.299522) (xy 180.429435 157.299526) (xy 178.982293 158.746668) + (xy 178.92097 158.780153) (xy 178.858617 158.777648) (xy 178.73113 158.738975) (xy 178.535 158.719659) + (xy 178.33887 158.738975) (xy 178.289556 158.753934) (xy 178.21138 158.777649) (xy 178.141516 158.778272) + (xy 178.087706 158.746669) (xy 174.540563 155.199526) (xy 174.540562 155.199525) (xy 174.454938 155.15009) + (xy 174.389232 155.132484) (xy 174.389231 155.132483) (xy 174.359436 155.1245) (xy 174.359435 155.1245) + (xy 164.124 155.1245) (xy 164.056961 155.104815) (xy 164.011206 155.052011) (xy 164 155.0005) (xy 164 151.3995) + (xy 164.019685 151.332461) (xy 164.072489 151.286706) (xy 164.124 151.2755) (xy 165.138636 151.2755) + (xy 165.138637 151.2755) (xy 165.176729 151.265292) (xy 165.186937 151.262558) (xy 165.212642 151.25567) + (xy 165.234139 151.24991) (xy 165.319763 151.200475) (xy 165.389676 151.130562) (xy 165.489675 151.030563) + (xy 166.085856 150.43438) (xy 166.147179 150.400896) (xy 166.173537 150.398062) (xy 166.320624 150.398062) + (xy 166.474004 150.360258) (xy 166.506541 150.343181) (xy 166.613879 150.286845) (xy 166.732122 150.182092) + (xy 166.821859 150.052085) (xy 166.877876 149.90438) (xy 166.896917 149.747562) (xy 166.896019 149.740162) + (xy 166.877876 149.590743) (xy 166.850357 149.518182) (xy 166.821859 149.443039) (xy 166.732122 149.313032) + (xy 166.613879 149.208279) (xy 166.613877 149.208278) (xy 166.613876 149.208277) (xy 166.474004 149.134865) + (xy 166.320625 149.097062) (xy 166.313352 149.096179) (xy 166.249175 149.068556) (xy 166.210119 149.010622) + (xy 166.205853 148.965036) (xy 166.205278 148.965036) (xy 166.205278 148.958892) (xy 166.205206 148.958126) + (xy 166.205278 148.957536) (xy 166.1886 148.820183) (xy 166.186237 148.800717) (xy 166.154614 148.717335) + (xy 166.13022 148.653013) (xy 166.040483 148.523006) (xy 165.92224 148.418253) (xy 165.922238 148.418252) + (xy 165.922237 148.418251) (xy 165.782365 148.344839) (xy 165.628986 148.307036) (xy 165.628985 148.307036) + (xy 165.471015 148.307036) (xy 165.471014 148.307036) (xy 165.317634 148.344839) (xy 165.177762 148.418251) + (xy 165.152641 148.440506) (xy 165.078691 148.50602) (xy 165.059516 148.523007) (xy 164.969781 148.653011) + (xy 164.96978 148.653012) (xy 164.913762 148.800717) (xy 164.894722 148.957535) (xy 164.894722 148.957537) + (xy 164.900896 149.00839) (xy 164.889435 149.077313) (xy 164.865481 149.111016) (xy 164.538319 149.438179) + (xy 164.476998 149.471663) (xy 164.45064 149.474497) (xy 164.124 149.474497) (xy 164.056961 149.454812) + (xy 164.011206 149.402008) (xy 164 149.350497) (xy 164 147.882397) (xy 164.019685 147.815358) (xy 164.036319 147.794716) + (xy 167.087856 144.743179) (xy 167.149179 144.709694) (xy 167.175537 144.70686) (xy 167.408356 144.70686) ) ) (filled_polygon @@ -158790,7 +162942,7 @@ (xy 174.98022 128.395477) (xy 174.890483 128.26547) (xy 174.77224 128.160717) (xy 174.772238 128.160716) (xy 174.772237 128.160715) (xy 174.632365 128.087303) (xy 174.478986 128.0495) (xy 174.478985 128.0495) (xy 174.321015 128.0495) (xy 174.321014 128.0495) (xy 174.167634 128.087303) (xy 174.027762 128.160715) - (xy 174.02776 128.160717) (xy 173.912887 128.262485) (xy 173.909516 128.265471) (xy 173.819781 128.395475) + (xy 173.980186 128.202863) (xy 173.912887 128.262485) (xy 173.909516 128.265471) (xy 173.819781 128.395475) (xy 173.81978 128.395476) (xy 173.763762 128.543181) (xy 173.744722 128.699999) (xy 173.744722 128.7) (xy 173.763762 128.856818) (xy 173.81978 129.004523) (xy 173.844824 129.040805) (xy 173.909517 129.134531) (xy 173.982726 129.199386) (xy 174.019853 129.258574) (xy 174.0245 129.292202) (xy 174.0245 139.949438) @@ -158827,18 +162979,18 @@ (xy 168.472456 123.867452) (xy 168.472453 123.867455) (xy 168.386207 123.982664) (xy 168.386204 123.982669) (xy 168.354067 124.068834) (xy 168.312195 124.124767) (xy 168.246731 124.149184) (xy 168.237885 124.1495) (xy 168.213564 124.1495) (xy 168.146525 124.129815) (xy 168.111513 124.095938) (xy 168.090484 124.065471) - (xy 167.997021 123.982671) (xy 167.97224 123.960717) (xy 167.972238 123.960716) (xy 167.972237 123.960715) + (xy 168.03763 124.018647) (xy 167.97224 123.960717) (xy 167.972238 123.960716) (xy 167.972237 123.960715) (xy 167.832365 123.887303) (xy 167.678986 123.8495) (xy 167.678985 123.8495) (xy 167.521015 123.8495) (xy 167.521014 123.8495) (xy 167.367634 123.887303) (xy 167.227762 123.960715) (xy 167.109516 124.065471) (xy 167.019781 124.195475) (xy 167.01978 124.195476) (xy 166.963762 124.343181) (xy 166.944722 124.499999) (xy 164 124.499999) (xy 164 124.006092) (xy 164.000597 123.993938) (xy 164.003869 123.960715) (xy 164.018018 123.817056) (xy 164.022757 123.793232) (xy 164.072577 123.628994) (xy 164.081875 123.606549) (xy 164.162775 123.455195) - (xy 164.176272 123.434995) (xy 164.285149 123.302328) (xy 164.302328 123.285149) (xy 164.426011 123.183645) - (xy 164.490321 123.156334) (xy 164.504675 123.1555) (xy 169.493887 123.1555) (xy 169.493907 123.1555) - (xy 169.506442 123.155192) (xy 169.518596 123.154595) (xy 169.531105 123.153673) (xy 169.707978 123.136252) - (xy 169.732777 123.132573) (xy 169.756618 123.127831) (xy 169.780942 123.121738) (xy 169.945165 123.071922) - (xy 169.968779 123.063473) (xy 169.991237 123.05417) (xy 170.013898 123.043452) (xy 170.062047 123.017715) - (xy 170.130449 123.003474) + (xy 164.176272 123.434995) (xy 164.285149 123.302328) (xy 164.302328 123.285149) (xy 164.424106 123.185208) + (xy 164.488414 123.157897) (xy 164.49048 123.157674) (xy 164.506508 123.156095) (xy 164.518648 123.1555) + (xy 169.493887 123.1555) (xy 169.493907 123.1555) (xy 169.506442 123.155192) (xy 169.518596 123.154595) + (xy 169.531105 123.153673) (xy 169.707978 123.136252) (xy 169.732777 123.132573) (xy 169.756618 123.127831) + (xy 169.780942 123.121738) (xy 169.945165 123.071922) (xy 169.968779 123.063473) (xy 169.991237 123.05417) + (xy 170.013898 123.043452) (xy 170.062047 123.017715) (xy 170.130449 123.003474) ) ) (filled_polygon @@ -158854,8 +163006,8 @@ (xy 188.881404 127.054595) (xy 188.893558 127.055192) (xy 188.906093 127.0555) (xy 190.914101 127.0555) (xy 190.98114 127.075185) (xy 191.026895 127.127989) (xy 191.036839 127.197147) (xy 191.007814 127.260703) (xy 191.001782 127.267181) (xy 189.199526 129.069436) (xy 189.15009 129.155062) (xy 189.150086 129.155072) - (xy 189.14708 129.166294) (xy 189.147079 129.166301) (xy 189.127198 129.240497) (xy 189.127197 129.240499) - (xy 189.1245 129.250563) (xy 189.1245 129.4078) (xy 189.104815 129.474839) (xy 189.082727 129.500615) + (xy 189.14708 129.166294) (xy 189.147079 129.166301) (xy 189.125379 129.247286) (xy 189.125375 129.2473) + (xy 189.1245 129.250562) (xy 189.1245 129.4078) (xy 189.104815 129.474839) (xy 189.082727 129.500615) (xy 189.009518 129.565472) (xy 188.919781 129.695479) (xy 188.91978 129.69548) (xy 188.863762 129.843185) (xy 188.844722 130.000003) (xy 188.844722 130.000004) (xy 188.863762 130.156822) (xy 188.909876 130.278412) (xy 188.91978 130.304527) (xy 189.009517 130.434534) (xy 189.12776 130.539287) (xy 189.127762 130.539288) @@ -159023,11 +163175,17 @@ (filled_polygon (layer "F.Cu") (pts - (xy 195.892375 123.275185) (xy 195.93813 123.327989) (xy 195.948432 123.394447) (xy 195.944722 123.425001) - (xy 195.950896 123.475854) (xy 195.939435 123.544777) (xy 195.915481 123.57848) (xy 193.667181 125.826781) - (xy 193.605858 125.860266) (xy 193.536166 125.855282) (xy 193.480233 125.81341) (xy 193.455816 125.747946) - (xy 193.4555 125.7391) (xy 193.4555 123.3795) (xy 193.475185 123.312461) (xy 193.527989 123.266706) - (xy 193.5795 123.2555) (xy 195.825336 123.2555) + (xy 195.892375 123.275185) (xy 195.93813 123.327989) (xy 195.948431 123.394446) (xy 195.944722 123.425) + (xy 195.944722 123.425001) (xy 195.950896 123.475854) (xy 195.939435 123.544777) (xy 195.915481 123.57848) + (xy 193.667181 125.826781) (xy 193.605858 125.860266) (xy 193.536166 125.855282) (xy 193.480233 125.81341) + (xy 193.455816 125.747946) (xy 193.4555 125.7391) (xy 193.4555 124.018647) (xy 193.456097 124.006494) + (xy 193.465348 123.912556) (xy 193.46982 123.867146) (xy 193.47456 123.843314) (xy 193.509774 123.72723) + (xy 193.519064 123.704801) (xy 193.576245 123.597824) (xy 193.589737 123.577631) (xy 193.666689 123.483865) + (xy 193.683863 123.466692) (xy 193.719115 123.437762) (xy 193.729594 123.428443) (xy 193.734236 123.424316) + (xy 193.744811 123.414133) (xy 193.748578 123.410652) (xy 193.825011 123.34294) (xy 193.849609 123.325962) + (xy 193.907883 123.295376) (xy 193.93583 123.284776) (xy 193.999735 123.269026) (xy 194.029402 123.265425) + (xy 194.093119 123.265425) (xy 194.093139 123.265425) (xy 194.105674 123.265117) (xy 194.117828 123.26452) + (xy 194.130337 123.263598) (xy 194.206495 123.256096) (xy 194.218648 123.2555) (xy 195.825336 123.2555) ) ) ) @@ -159058,63 +163216,76 @@ (filled_polygon (layer "F.Cu") (pts - (xy 264.584214 172.975185) (xy 264.595828 172.983637) (xy 264.597655 172.985136) (xy 264.614845 173.002322) - (xy 264.616347 173.004153) (xy 264.643665 173.068459) (xy 264.6445 173.082824) (xy 264.6445 174.022647) - (xy 264.648192 174.065932) (xy 264.648192 174.065933) (xy 264.655311 174.10734) (xy 264.655314 174.107354) - (xy 264.65855 174.123165) (xy 264.700088 174.21379) (xy 264.70478 174.220278) (xy 264.705295 174.22099) - (xy 264.728628 174.286848) (xy 264.712652 174.354867) (xy 264.674729 174.393073) (xy 264.675884 174.394579) - (xy 264.669438 174.399524) (xy 263.227548 175.841414) (xy 263.171891 175.937813) (xy 263.121324 175.986028) - (xy 263.102269 175.992686) (xy 263.092784 175.996615) (xy 263.009922 176.051981) (xy 262.954556 176.134843) - (xy 262.954555 176.134847) (xy 262.940023 176.207904) (xy 262.940023 177.007261) (xy 262.954555 177.080318) - (xy 262.954556 177.080322) (xy 262.971045 177.105) (xy 263.009922 177.163184) (xy 263.009923 177.163184) - (xy 263.010983 177.164771) (xy 263.03186 177.231448) (xy 263.013375 177.298828) (xy 262.99953 177.316327) - (xy 262.942056 177.402343) (xy 262.942055 177.402347) (xy 262.927523 177.475404) (xy 262.927523 178.576) - (xy 262.907838 178.643039) (xy 262.855034 178.688794) (xy 262.803523 178.7) (xy 258.7 178.7) (xy 258.7 179.7) - (xy 258.7 179.700003) (xy 258.7 182.393907) (xy 258.699403 182.406061) (xy 258.681982 182.582934) - (xy 258.67724 182.606775) (xy 258.627424 182.770998) (xy 258.618121 182.793456) (xy 258.537227 182.944798) - (xy 258.523722 182.96501) (xy 258.414854 183.097666) (xy 258.397666 183.114854) (xy 258.26501 183.223722) - (xy 258.244798 183.237227) (xy 258.093456 183.318121) (xy 258.070998 183.327424) (xy 257.906775 183.37724) - (xy 257.882934 183.381982) (xy 257.706061 183.399403) (xy 257.693907 183.4) (xy 252.397611 183.4) - (xy 252.330572 183.380315) (xy 252.325855 183.377129) (xy 252.304079 183.361678) (xy 252.304072 183.361673) - (xy 252.166566 183.275272) (xy 252.141493 183.261414) (xy 252.141494 183.261414) (xy 252.141486 183.26141) - (xy 252.116473 183.249364) (xy 252.097005 183.241301) (xy 252.090001 183.2384) (xy 251.936712 183.184762) - (xy 251.936709 183.184761) (xy 251.936703 183.184759) (xy 251.909164 183.176826) (xy 251.882095 183.170649) - (xy 251.853875 183.165854) (xy 251.853816 183.165846) (xy 251.678625 183.146107) (xy 251.678579 183.146103) - (xy 251.650018 183.1445) (xy 251.65 183.1445) (xy 251.182825 183.1445) (xy 251.115786 183.124815) - (xy 251.104167 183.116358) (xy 251.102339 183.114858) (xy 251.085141 183.097661) (xy 251.078933 183.090096) - (xy 251.051622 183.025786) (xy 251.050798 183.01296) (xy 251.045116 182.546955) (xy 251.045115 182.546948) - (xy 251.045076 182.54373) (xy 251.045074 182.543674) (xy 251.044774 182.519054) (xy 250.961718 175.708406) - (xy 250.980583 175.641137) (xy 250.99019 175.627828) (xy 251.088639 175.508942) (xy 251.106012 175.491744) - (xy 251.202904 175.413145) (xy 251.267367 175.386199) (xy 251.317013 175.390783) (xy 251.419057 175.421738) - (xy 251.443381 175.427831) (xy 251.467222 175.432573) (xy 251.485462 175.435278) (xy 251.49202 175.436252) - (xy 251.509984 175.438021) (xy 251.668895 175.453673) (xy 251.681404 175.454595) (xy 251.693558 175.455192) - (xy 251.706093 175.4555) (xy 251.706113 175.4555) (xy 255.393887 175.4555) (xy 255.393907 175.4555) - (xy 255.406442 175.455192) (xy 255.418596 175.454595) (xy 255.431105 175.453673) (xy 255.607978 175.436252) - (xy 255.632777 175.432573) (xy 255.656618 175.427831) (xy 255.680942 175.421738) (xy 255.845165 175.371922) - (xy 255.868779 175.363473) (xy 255.877308 175.35994) (xy 255.924764 175.3505) (xy 255.978985 175.3505) - (xy 256.132361 175.312697) (xy 256.132361 175.312696) (xy 256.132365 175.312696) (xy 256.214696 175.269484) - (xy 256.273567 175.255288) (xy 256.654117 175.259132) (xy 256.720954 175.279493) (xy 256.731527 175.287271) - (xy 256.772901 175.321226) (xy 256.772916 175.321237) (xy 256.793015 175.336145) (xy 256.793081 175.336191) - (xy 256.813251 175.349667) (xy 256.834731 175.362542) (xy 256.834747 175.362551) (xy 256.834759 175.362558) - (xy 256.834778 175.362568) (xy 256.986079 175.443441) (xy 256.986093 175.443448) (xy 256.986097 175.44345) - (xy 256.986101 175.443452) (xy 257.008762 175.45417) (xy 257.03122 175.463473) (xy 257.054834 175.471922) - (xy 257.219057 175.521738) (xy 257.243381 175.527831) (xy 257.267222 175.532573) (xy 257.285462 175.535278) - (xy 257.29202 175.536252) (xy 257.309984 175.538021) (xy 257.468895 175.553673) (xy 257.481404 175.554595) - (xy 257.493558 175.555192) (xy 257.506093 175.5555) (xy 257.506113 175.5555) (xy 259.693887 175.5555) - (xy 259.693907 175.5555) (xy 259.706442 175.555192) (xy 259.718596 175.554595) (xy 259.731105 175.553673) - (xy 259.907978 175.536252) (xy 259.932777 175.532573) (xy 259.956618 175.527831) (xy 259.980942 175.521738) - (xy 260.145165 175.471922) (xy 260.168779 175.463473) (xy 260.191237 175.45417) (xy 260.213898 175.443452) - (xy 260.227369 175.436252) (xy 260.270598 175.413145) (xy 260.36524 175.362558) (xy 260.386745 175.349669) - (xy 260.401033 175.340121) (xy 260.406917 175.336191) (xy 260.406926 175.336184) (xy 260.406957 175.336164) - (xy 260.427098 175.321226) (xy 260.455966 175.297534) (xy 260.7 175.3) (xy 260.7 175.052961) (xy 260.721226 175.027098) - (xy 260.736164 175.006957) (xy 260.749669 174.986745) (xy 260.762558 174.965239) (xy 260.843452 174.813896) - (xy 260.85417 174.791236) (xy 260.863473 174.768778) (xy 260.871922 174.745164) (xy 260.909075 174.622686) - (xy 260.917312 174.586006) (xy 260.922651 174.550011) (xy 260.925416 174.512524) (xy 260.925416 173.937904) - (xy 260.931062 173.902045) (xy 260.93084 173.901984) (xy 260.931385 173.899993) (xy 260.931417 173.899797) - (xy 260.93157 173.899323) (xy 260.94362 173.855402) (xy 260.94362 173.855398) (xy 260.943623 173.85539) - (xy 260.951441 173.812057) (xy 260.9555 173.766693) (xy 260.9555 173.082824) (xy 260.975185 173.015785) - (xy 260.983628 173.004182) (xy 260.985131 173.00235) (xy 261.002367 172.985117) (xy 261.00304 172.984564) - (xy 261.004198 172.983616) (xy 261.068519 172.956328) (xy 261.082825 172.9555) (xy 264.517175 172.9555) + (xy 263.893507 172.956097) (xy 263.919451 172.958651) (xy 263.919451 172.958652) (xy 264.032845 172.969819) + (xy 264.056676 172.974558) (xy 264.172757 173.009771) (xy 264.195206 173.01907) (xy 264.302162 173.076239) + (xy 264.322371 173.089743) (xy 264.416124 173.166682) (xy 264.433315 173.183872) (xy 264.491738 173.255062) + (xy 264.491752 173.255082) (xy 264.510253 173.277624) (xy 264.52376 173.297838) (xy 264.580926 173.404789) + (xy 264.590229 173.427247) (xy 264.625436 173.543311) (xy 264.630178 173.567152) (xy 264.6433 173.700383) + (xy 264.643903 173.7065) (xy 264.6445 173.718654) (xy 264.6445 174.022647) (xy 264.648192 174.065932) + (xy 264.648192 174.065933) (xy 264.655311 174.10734) (xy 264.655314 174.107354) (xy 264.65855 174.123165) + (xy 264.700088 174.21379) (xy 264.70478 174.220278) (xy 264.705295 174.22099) (xy 264.728628 174.286848) + (xy 264.712652 174.354867) (xy 264.674729 174.393073) (xy 264.675884 174.394579) (xy 264.669438 174.399524) + (xy 263.227548 175.841414) (xy 263.171891 175.937813) (xy 263.121324 175.986028) (xy 263.102269 175.992686) + (xy 263.092784 175.996615) (xy 263.009922 176.051981) (xy 262.954556 176.134843) (xy 262.954555 176.134847) + (xy 262.940023 176.207904) (xy 262.940023 177.007261) (xy 262.954555 177.080318) (xy 262.954556 177.080322) + (xy 262.971045 177.105) (xy 263.009922 177.163184) (xy 263.009923 177.163184) (xy 263.010983 177.164771) + (xy 263.03186 177.231448) (xy 263.013375 177.298828) (xy 262.99953 177.316327) (xy 262.942056 177.402343) + (xy 262.942055 177.402347) (xy 262.927523 177.475404) (xy 262.927523 178.576) (xy 262.907838 178.643039) + (xy 262.855034 178.688794) (xy 262.803523 178.7) (xy 259.7 178.7) (xy 259.651844 178.704743) (xy 259.504911 178.719214) + (xy 259.394149 178.752813) (xy 259.317317 178.77612) (xy 259.317314 178.776121) (xy 259.317312 178.776122) + (xy 259.317309 178.776123) (xy 259.144435 178.868526) (xy 259.144428 178.868531) (xy 258.992892 178.992892) + (xy 258.868531 179.144428) (xy 258.868526 179.144435) (xy 258.776123 179.317309) (xy 258.776122 179.317312) + (xy 258.719214 179.504911) (xy 258.7 179.700003) (xy 258.7 182.393907) (xy 258.699403 182.406061) + (xy 258.681982 182.582934) (xy 258.67724 182.606775) (xy 258.627424 182.770998) (xy 258.618121 182.793456) + (xy 258.537227 182.944798) (xy 258.523722 182.96501) (xy 258.414854 183.097666) (xy 258.397666 183.114854) + (xy 258.26501 183.223722) (xy 258.244798 183.237227) (xy 258.093456 183.318121) (xy 258.070998 183.327424) + (xy 257.906775 183.37724) (xy 257.882934 183.381982) (xy 257.706061 183.399403) (xy 257.693907 183.4) + (xy 252.397611 183.4) (xy 252.330572 183.380315) (xy 252.325855 183.377129) (xy 252.304079 183.361678) + (xy 252.304072 183.361673) (xy 252.166566 183.275272) (xy 252.141493 183.261414) (xy 252.141494 183.261414) + (xy 252.141486 183.26141) (xy 252.116473 183.249364) (xy 252.097005 183.241301) (xy 252.090001 183.2384) + (xy 251.936712 183.184762) (xy 251.936709 183.184761) (xy 251.936703 183.184759) (xy 251.909164 183.176826) + (xy 251.882095 183.170649) (xy 251.853875 183.165854) (xy 251.853816 183.165846) (xy 251.678625 183.146107) + (xy 251.678579 183.146103) (xy 251.650018 183.1445) (xy 251.65 183.1445) (xy 251.182825 183.1445) + (xy 251.115786 183.124815) (xy 251.104167 183.116358) (xy 251.102339 183.114858) (xy 251.085141 183.097661) + (xy 251.078933 183.090096) (xy 251.051622 183.025786) (xy 251.050798 183.012956) (xy 251.045115 182.546954) + (xy 251.045115 182.546947) (xy 251.005769 179.320621) (xy 250.961717 175.708407) (xy 250.980582 175.641138) + (xy 250.990188 175.62783) (xy 251.088639 175.508942) (xy 251.106012 175.491744) (xy 251.202904 175.413145) + (xy 251.267367 175.386199) (xy 251.317013 175.390783) (xy 251.419057 175.421738) (xy 251.443381 175.427831) + (xy 251.467222 175.432573) (xy 251.485462 175.435278) (xy 251.49202 175.436252) (xy 251.509984 175.438021) + (xy 251.668895 175.453673) (xy 251.681404 175.454595) (xy 251.693558 175.455192) (xy 251.706093 175.4555) + (xy 251.706113 175.4555) (xy 255.393887 175.4555) (xy 255.393907 175.4555) (xy 255.406442 175.455192) + (xy 255.418596 175.454595) (xy 255.431105 175.453673) (xy 255.607978 175.436252) (xy 255.632777 175.432573) + (xy 255.656618 175.427831) (xy 255.680942 175.421738) (xy 255.845165 175.371922) (xy 255.868779 175.363473) + (xy 255.877308 175.35994) (xy 255.924764 175.3505) (xy 255.978985 175.3505) (xy 256.132361 175.312697) + (xy 256.132361 175.312696) (xy 256.132365 175.312696) (xy 256.214696 175.269484) (xy 256.273567 175.255288) + (xy 256.654117 175.259132) (xy 256.720954 175.279493) (xy 256.731527 175.287271) (xy 256.772901 175.321226) + (xy 256.772916 175.321237) (xy 256.793015 175.336145) (xy 256.793081 175.336191) (xy 256.813251 175.349667) + (xy 256.834731 175.362542) (xy 256.834747 175.362551) (xy 256.834759 175.362558) (xy 256.834778 175.362568) + (xy 256.986079 175.443441) (xy 256.986093 175.443448) (xy 256.986097 175.44345) (xy 256.986101 175.443452) + (xy 257.008762 175.45417) (xy 257.03122 175.463473) (xy 257.054834 175.471922) (xy 257.219057 175.521738) + (xy 257.243381 175.527831) (xy 257.267222 175.532573) (xy 257.285462 175.535278) (xy 257.29202 175.536252) + (xy 257.309984 175.538021) (xy 257.468895 175.553673) (xy 257.481404 175.554595) (xy 257.493558 175.555192) + (xy 257.506093 175.5555) (xy 257.506113 175.5555) (xy 259.693887 175.5555) (xy 259.693907 175.5555) + (xy 259.706442 175.555192) (xy 259.718596 175.554595) (xy 259.731105 175.553673) (xy 259.907978 175.536252) + (xy 259.932777 175.532573) (xy 259.956618 175.527831) (xy 259.980942 175.521738) (xy 260.145165 175.471922) + (xy 260.168779 175.463473) (xy 260.191237 175.45417) (xy 260.213898 175.443452) (xy 260.227369 175.436252) + (xy 260.270598 175.413145) (xy 260.36524 175.362558) (xy 260.386745 175.349669) (xy 260.401033 175.340121) + (xy 260.406917 175.336191) (xy 260.406926 175.336184) (xy 260.406957 175.336164) (xy 260.427098 175.321226) + (xy 260.559754 175.212358) (xy 260.578332 175.19552) (xy 260.59552 175.178332) (xy 260.612358 175.159754) + (xy 260.721226 175.027098) (xy 260.736164 175.006957) (xy 260.749669 174.986745) (xy 260.762558 174.965239) + (xy 260.843452 174.813896) (xy 260.85417 174.791236) (xy 260.863473 174.768778) (xy 260.871922 174.745164) + (xy 260.909075 174.622686) (xy 260.917312 174.586006) (xy 260.922651 174.550011) (xy 260.925416 174.512524) + (xy 260.925416 173.937904) (xy 260.931062 173.902045) (xy 260.93084 173.901984) (xy 260.931385 173.899993) + (xy 260.931417 173.899797) (xy 260.93157 173.899323) (xy 260.94362 173.855402) (xy 260.94362 173.855398) + (xy 260.943623 173.85539) (xy 260.951441 173.812057) (xy 260.9555 173.766693) (xy 260.9555 173.718646) + (xy 260.956098 173.706478) (xy 260.956699 173.700383) (xy 260.961054 173.656163) (xy 260.961054 173.656161) + (xy 260.96982 173.567148) (xy 260.974561 173.543311) (xy 261.009774 173.42723) (xy 261.019064 173.404801) + (xy 261.076242 173.297829) (xy 261.089743 173.277626) (xy 261.166682 173.183873) (xy 261.183873 173.166682) + (xy 261.277626 173.089743) (xy 261.297829 173.076242) (xy 261.404798 173.019066) (xy 261.427236 173.009772) + (xy 261.468318 172.997311) (xy 261.468317 172.99731) (xy 261.470503 172.996646) (xy 261.535505 172.97693) + (xy 261.535534 172.97692) (xy 261.543303 172.974563) (xy 261.567142 172.96982) (xy 261.676886 172.959013) + (xy 261.676888 172.959013) (xy 261.696845 172.957047) (xy 261.706499 172.956097) (xy 261.718648 172.9555) + (xy 263.881355 172.9555) ) ) ) @@ -159172,22 +163343,30 @@ (xy 134.021196 172.833389) (xy 134.072061 172.919118) (xy 134.072064 172.919122) (xy 134.072066 172.919125) (xy 134.072069 172.919128) (xy 134.118746 172.971094) (xy 134.118752 172.9711) (xy 134.118756 172.971104) (xy 134.152091 173.00214) (xy 134.152093 173.002141) (xy 134.241234 173.046763) (xy 134.246918 173.048941) - (xy 134.246308 173.050531) (xy 134.25 173.05281) (xy 134.25 173.75) (xy 134.525062 173.75) (xy 134.566065 173.758156) - (xy 134.566068 173.758157) (xy 134.56607 173.758157) (xy 135.977815 173.758157) (xy 136.044854 173.777842) - (xy 136.085569 173.820797) (xy 136.099249 173.844821) (xy 136.099252 173.844825) (xy 136.099254 173.844828) - (xy 136.125722 173.875374) (xy 136.145005 173.897628) (xy 136.145008 173.897631) (xy 136.145009 173.897632) - (xy 136.177783 173.929257) (xy 136.266118 173.975465) (xy 136.266119 173.975465) (xy 136.266119 173.975466) - (xy 136.316247 173.990184) (xy 136.333157 173.99515) (xy 136.333161 173.99515) (xy 136.333163 173.995151) - (xy 136.344794 173.996823) (xy 136.405142 174.0055) (xy 154.617175 174.0055) (xy 154.684214 174.025185) - (xy 154.695828 174.033637) (xy 154.697655 174.035136) (xy 154.714845 174.052322) (xy 154.716347 174.054153) - (xy 154.743665 174.118459) (xy 154.7445 174.132824) (xy 154.7445 177.243907) (xy 154.744723 177.252984) + (xy 134.246308 173.050531) (xy 134.298831 173.082961) (xy 134.323708 173.127092) (xy 134.32379 173.127059) + (xy 134.324069 173.127733) (xy 134.325259 173.129844) (xy 134.326122 173.132691) (xy 134.328452 173.138315) + (xy 134.327366 173.138764) (xy 134.340244 173.190167) (xy 134.340244 173.532335) (xy 134.354776 173.605392) + (xy 134.354777 173.605396) (xy 134.354778 173.605397) (xy 134.410143 173.688258) (xy 134.493004 173.743623) + (xy 134.493008 173.743624) (xy 134.566065 173.758156) (xy 134.566068 173.758157) (xy 134.56607 173.758157) + (xy 135.977815 173.758157) (xy 136.044854 173.777842) (xy 136.085569 173.820797) (xy 136.099249 173.844821) + (xy 136.099252 173.844825) (xy 136.099254 173.844828) (xy 136.125722 173.875374) (xy 136.145005 173.897628) + (xy 136.145008 173.897631) (xy 136.145009 173.897632) (xy 136.177783 173.929257) (xy 136.266118 173.975465) + (xy 136.266119 173.975465) (xy 136.266119 173.975466) (xy 136.316247 173.990184) (xy 136.333157 173.99515) + (xy 136.333161 173.99515) (xy 136.333163 173.995151) (xy 136.344794 173.996823) (xy 136.405142 174.0055) + (xy 153.981355 174.0055) (xy 153.993507 174.006097) (xy 154.019451 174.008651) (xy 154.019451 174.008652) + (xy 154.132845 174.019819) (xy 154.156676 174.024558) (xy 154.272757 174.059771) (xy 154.295206 174.06907) + (xy 154.402162 174.126239) (xy 154.422371 174.139743) (xy 154.516124 174.216682) (xy 154.533315 174.233872) + (xy 154.591741 174.305066) (xy 154.591751 174.305079) (xy 154.610255 174.327628) (xy 154.623758 174.347836) + (xy 154.680926 174.454788) (xy 154.690229 174.477247) (xy 154.725436 174.593309) (xy 154.730178 174.617149) + (xy 154.743903 174.756496) (xy 154.7445 174.768651) (xy 154.7445 177.243907) (xy 154.744723 177.252984) (xy 154.744808 177.25645) (xy 154.745406 177.268618) (xy 154.746325 177.281086) (xy 154.763745 177.457958) (xy 154.763751 177.458009) (xy 154.767421 177.482756) (xy 154.767427 177.482785) (xy 154.772165 177.506608) (xy 154.778258 177.530934) (xy 154.786516 177.558158) (xy 154.824909 177.684721) (xy 154.828074 177.695156) (xy 154.836527 177.718781) (xy 154.845829 177.741236) (xy 154.856546 177.763894) (xy 154.903481 177.851704) (xy 154.904974 177.854497) (xy 154.937437 177.915232) (xy 154.950336 177.936755) (xy 154.963819 177.956934) - (xy 154.963853 177.956983) (xy 154.978761 177.977082) (xy 154.978773 177.977098) (xy 155 178.002963) - (xy 155 178.25) (xy 155.247037 178.25) (xy 155.272901 178.271226) (xy 155.272916 178.271237) (xy 155.293015 178.286145) + (xy 154.963853 177.956983) (xy 154.978761 177.977082) (xy 154.978773 177.977098) (xy 154.997288 177.999658) + (xy 155.087644 178.109758) (xy 155.104473 178.128326) (xy 155.121672 178.145525) (xy 155.14024 178.162354) + (xy 155.140245 178.162358) (xy 155.272901 178.271226) (xy 155.272916 178.271237) (xy 155.293015 178.286145) (xy 155.293081 178.286191) (xy 155.313251 178.299667) (xy 155.334731 178.312542) (xy 155.334747 178.312551) (xy 155.334759 178.312558) (xy 155.334778 178.312568) (xy 155.486079 178.393441) (xy 155.486093 178.393448) (xy 155.486097 178.39345) (xy 155.486101 178.393452) (xy 155.508762 178.40417) (xy 155.53122 178.413473) @@ -159200,7 +163379,7 @@ (xy 172.226542 180.242941) (xy 172.226541 180.242943) (xy 172.2245 180.250559) (xy 172.2245 180.307796) (xy 172.204815 180.374835) (xy 172.182727 180.400611) (xy 172.109518 180.465468) (xy 172.019781 180.595475) (xy 172.01978 180.595476) (xy 171.963762 180.743181) (xy 171.944722 180.899999) (xy 171.944722 180.9) - (xy 171.963762 181.056818) (xy 172.006267 181.168892) (xy 172.01978 181.204523) (xy 172.109517 181.33453) + (xy 171.963762 181.056818) (xy 172.003665 181.162032) (xy 172.01978 181.204523) (xy 172.109517 181.33453) (xy 172.22776 181.439283) (xy 172.227762 181.439284) (xy 172.367634 181.512696) (xy 172.521014 181.5505) (xy 172.521015 181.5505) (xy 172.678985 181.5505) (xy 172.832365 181.512696) (xy 172.857692 181.499403) (xy 172.97224 181.439283) (xy 173.090483 181.33453) (xy 173.18022 181.204523) (xy 173.236237 181.056818) @@ -159211,100 +163390,118 @@ (xy 173.461547 180.252987) (xy 173.46177 180.254823) (xy 173.46177 180.254826) (xy 173.495061 180.342605) (xy 173.517788 180.402531) (xy 173.523121 180.410257) (xy 173.607524 180.532537) (xy 173.72795 180.639224) (xy 173.765077 180.698414) (xy 173.7647 180.766974) (xy 173.754852 180.800513) (xy 173.754848 180.800529) - (xy 173.7445 180.872506) (xy 173.7445 185.617175) (xy 173.724815 185.684214) (xy 173.716342 185.695854) - (xy 173.714843 185.69768) (xy 173.69768 185.714843) (xy 173.695854 185.716342) (xy 173.631548 185.743664) - (xy 173.617175 185.7445) (xy 170.86756 185.7445) (xy 170.800521 185.724815) (xy 170.754766 185.672011) - (xy 170.744822 185.602853) (xy 170.773847 185.539297) (xy 170.785328 185.527688) (xy 170.890476 185.434537) - (xy 170.980213 185.30453) (xy 171.03623 185.156825) (xy 171.055271 185.000007) (xy 171.040456 184.877989) - (xy 171.03623 184.843188) (xy 171.005173 184.761298) (xy 170.980213 184.695484) (xy 170.890476 184.565477) - (xy 170.772233 184.460724) (xy 170.772231 184.460723) (xy 170.77223 184.460722) (xy 170.632358 184.38731) - (xy 170.478979 184.349507) (xy 170.478978 184.349507) (xy 170.321008 184.349507) (xy 170.321007 184.349507) - (xy 170.167627 184.38731) (xy 170.027755 184.460722) (xy 169.909509 184.565478) (xy 169.819774 184.695482) - (xy 169.81977 184.695488) (xy 169.815936 184.705598) (xy 169.773755 184.761298) (xy 169.708156 184.785351) - (xy 169.639966 184.77012) (xy 169.590836 184.720441) (xy 169.584058 184.705598) (xy 169.58022 184.695477) - (xy 169.490483 184.56547) (xy 169.37224 184.460717) (xy 169.372238 184.460716) (xy 169.372237 184.460715) - (xy 169.232365 184.387303) (xy 169.078986 184.3495) (xy 169.078985 184.3495) (xy 168.948625 184.3495) - (xy 168.881586 184.329815) (xy 168.835831 184.277011) (xy 168.825887 184.207853) (xy 168.827734 184.197906) - (xy 168.845727 184.119076) (xy 168.864767 183.865002) (xy 168.864767 183.864993) (xy 168.845726 183.610918) - (xy 168.789031 183.36252) (xy 168.789026 183.362503) (xy 168.695941 183.125326) (xy 168.695942 183.125326) - (xy 168.568545 182.90467) (xy 168.526545 182.852004) (xy 167.875846 183.502703) (xy 167.868951 183.486056) - (xy 167.781401 183.355028) (xy 167.66997 183.243597) (xy 167.538942 183.156047) (xy 167.522293 183.14915) - (xy 168.173185 182.498258) (xy 168.012384 182.388626) (xy 168.012376 182.388621) (xy 167.780003 182.276718) - (xy 167.728143 182.229896) (xy 167.70983 182.162469) (xy 167.730877 182.095845) (xy 167.780003 182.053278) - (xy 168.012376 181.941374) (xy 168.012377 181.941373) (xy 168.173185 181.831736) (xy 167.522294 181.180844) - (xy 167.538942 181.173949) (xy 167.66997 181.086399) (xy 167.781401 180.974968) (xy 167.868951 180.84394) - (xy 167.875846 180.827292) (xy 168.526544 181.47799) (xy 168.526546 181.477989) (xy 168.568544 181.425328) - (xy 168.695941 181.204669) (xy 168.789026 180.967492) (xy 168.789031 180.967475) (xy 168.845726 180.719077) - (xy 168.864767 180.465002) (xy 168.864767 180.464993) (xy 168.845726 180.210918) (xy 168.789031 179.96252) - (xy 168.789026 179.962503) (xy 168.695941 179.725326) (xy 168.695942 179.725326) (xy 168.568545 179.50467) - (xy 168.526545 179.452004) (xy 167.875846 180.102703) (xy 167.868951 180.086056) (xy 167.781401 179.955028) - (xy 167.66997 179.843597) (xy 167.538942 179.756047) (xy 167.522293 179.74915) (xy 168.173185 179.098258) - (xy 168.012384 178.988626) (xy 168.012376 178.988621) (xy 167.782823 178.878076) (xy 167.782825 178.878076) - (xy 167.539347 178.802973) (xy 167.539341 178.802971) (xy 167.287404 178.764998) (xy 167.032595 178.764998) - (xy 166.780658 178.802971) (xy 166.780652 178.802973) (xy 166.537175 178.878076) (xy 166.307622 178.988623) - (xy 166.307609 178.98863) (xy 166.146813 179.098257) (xy 166.797706 179.74915) (xy 166.781058 179.756047) - (xy 166.65003 179.843597) (xy 166.538599 179.955028) (xy 166.451049 180.086056) (xy 166.444152 180.102704) - (xy 165.793452 179.452004) (xy 165.751457 179.504665) (xy 165.624058 179.725326) (xy 165.530973 179.962503) - (xy 165.530968 179.96252) (xy 165.474273 180.210918) (xy 165.455233 180.464993) (xy 165.455233 180.465002) - (xy 165.474273 180.719077) (xy 165.530968 180.967475) (xy 165.530973 180.967492) (xy 165.624058 181.204669) - (xy 165.624057 181.204669) (xy 165.751454 181.425325) (xy 165.751461 181.425336) (xy 165.793452 181.477989) - (xy 165.793453 181.47799) (xy 166.444152 180.82729) (xy 166.451049 180.84394) (xy 166.538599 180.974968) - (xy 166.65003 181.086399) (xy 166.781058 181.173949) (xy 166.797705 181.180844) (xy 166.146813 181.831736) - (xy 166.307616 181.941369) (xy 166.307625 181.941374) (xy 166.539996 182.053278) (xy 166.591856 182.1001) - (xy 166.610169 182.167527) (xy 166.589121 182.234151) (xy 166.539996 182.276718) (xy 166.307622 182.388623) - (xy 166.307609 182.38863) (xy 166.146813 182.498257) (xy 166.797706 183.14915) (xy 166.781058 183.156047) - (xy 166.65003 183.243597) (xy 166.538599 183.355028) (xy 166.451049 183.486056) (xy 166.444152 183.502704) - (xy 165.793452 182.852004) (xy 165.751457 182.904665) (xy 165.624058 183.125326) (xy 165.530973 183.362503) - (xy 165.530968 183.36252) (xy 165.474273 183.610918) (xy 165.455233 183.864993) (xy 165.455233 183.865002) - (xy 165.474273 184.119077) (xy 165.530968 184.367475) (xy 165.530973 184.367492) (xy 165.624058 184.604669) - (xy 165.624057 184.604669) (xy 165.751454 184.825325) (xy 165.751461 184.825336) (xy 165.793452 184.877989) - (xy 165.793453 184.87799) (xy 166.444152 184.22729) (xy 166.451049 184.24394) (xy 166.538599 184.374968) - (xy 166.65003 184.486399) (xy 166.781058 184.573949) (xy 166.797705 184.580844) (xy 166.146813 185.231736) - (xy 166.307616 185.341369) (xy 166.307624 185.341374) (xy 166.537176 185.451919) (xy 166.537174 185.451919) - (xy 166.780652 185.527022) (xy 166.780658 185.527024) (xy 167.032595 185.564997) (xy 167.032604 185.564998) - (xy 167.287396 185.564998) (xy 167.287404 185.564997) (xy 167.539341 185.527024) (xy 167.539347 185.527022) - (xy 167.787254 185.450553) (xy 167.78783 185.452422) (xy 167.849292 185.446953) (xy 167.911187 185.479368) - (xy 167.945731 185.540101) (xy 167.941957 185.609868) (xy 167.912722 185.656239) (xy 167.605281 185.963681) - (xy 167.543958 185.997166) (xy 167.5176 186) (xy 157.447042 186) (xy 157.380003 185.980315) (xy 157.334248 185.927511) - (xy 157.324304 185.858353) (xy 157.344992 185.80556) (xy 157.35101 185.796841) (xy 157.38022 185.754523) - (xy 157.436237 185.606818) (xy 157.455278 185.45) (xy 157.453401 185.434537) (xy 157.436237 185.293181) - (xy 157.394428 185.182941) (xy 157.38022 185.145477) (xy 157.290483 185.01547) (xy 157.17224 184.910717) - (xy 157.172238 184.910716) (xy 157.172237 184.910715) (xy 157.032365 184.837303) (xy 156.878986 184.7995) - (xy 156.878985 184.7995) (xy 156.721015 184.7995) (xy 156.721014 184.7995) (xy 156.567634 184.837303) - (xy 156.427762 184.910715) (xy 156.42776 184.910717) (xy 156.326973 185.000006) (xy 156.309516 185.015471) - (xy 156.219781 185.145475) (xy 156.21978 185.145476) (xy 156.163762 185.293181) (xy 156.144722 185.449999) - (xy 156.151979 185.50977) (xy 156.140518 185.578694) (xy 156.116564 185.612397) (xy 155.765281 185.963681) - (xy 155.703958 185.997166) (xy 155.6776 186) (xy 150.660748 186) (xy 150.593709 185.980315) (xy 150.558698 185.94644) - (xy 150.545632 185.927511) (xy 150.490483 185.847613) (xy 150.37224 185.74286) (xy 150.372238 185.742859) - (xy 150.372237 185.742858) (xy 150.232365 185.669446) (xy 150.078986 185.631643) (xy 150.078985 185.631643) - (xy 149.921015 185.631643) (xy 149.921014 185.631643) (xy 149.767634 185.669446) (xy 149.627761 185.742858) - (xy 149.627759 185.74286) (xy 149.566826 185.796841) (xy 149.503593 185.826562) (xy 149.434329 185.817378) - (xy 149.405935 185.799878) (xy 149.302333 185.714854) (xy 149.285145 185.697666) (xy 149.274105 185.684214) - (xy 149.176276 185.565008) (xy 149.162772 185.544798) (xy 149.081877 185.393453) (xy 149.072575 185.370998) - (xy 149.063589 185.341374) (xy 149.022757 185.206769) (xy 149.018018 185.182941) (xy 149.000597 185.006061) - (xy 149 184.993907) (xy 149 182.500003) (xy 149 182.5) (xy 149 181.5) (xy 148 181.5) (xy 147.999997 181.5) - (xy 136.256093 181.5) (xy 136.243939 181.499403) (xy 136.067065 181.481982) (xy 136.043224 181.47724) - (xy 135.879001 181.427424) (xy 135.856543 181.418121) (xy 135.705201 181.337227) (xy 135.684989 181.323722) - (xy 135.552333 181.214854) (xy 135.535145 181.197666) (xy 135.426277 181.06501) (xy 135.412772 181.044798) - (xy 135.335376 180.9) (xy 135.331877 180.893453) (xy 135.322575 180.870998) (xy 135.276491 180.719077) - (xy 135.272757 180.706769) (xy 135.268018 180.682941) (xy 135.250597 180.506061) (xy 135.25 180.493907) - (xy 135.25 179.500003) (xy 135.25 179.5) (xy 135.25 178.5) (xy 134.25 178.5) (xy 134.067065 178.481982) - (xy 134.043224 178.47724) (xy 133.879001 178.427424) (xy 133.856544 178.418122) (xy 133.781673 178.378102) - (xy 133.72269 178.346575) (xy 133.672846 178.297612) (xy 133.657144 178.237217) (xy 133.657144 178.035624) - (xy 133.655975 178.031262) (xy 133.655974 178.03126) (xy 133.654258 178.024856) (xy 133.631554 177.940122) - (xy 133.631554 177.940121) (xy 133.582119 177.854497) (xy 133.512206 177.784584) (xy 133.373461 177.645839) - (xy 133.339976 177.584516) (xy 133.337142 177.558158) (xy 133.337142 177.144576) (xy 133.337141 177.144567) - (xy 133.336605 177.139583) (xy 133.331055 177.087944) (xy 133.322332 177.064558) (xy 133.313231 177.040159) - (xy 133.283271 176.959832) (xy 133.25 176.915386) (xy 133.25 176.5) (xy 132.25 176.5) (xy 132.249997 176.5) - (xy 132.006093 176.5) (xy 131.993939 176.499403) (xy 131.817065 176.481982) (xy 131.793224 176.47724) - (xy 131.629001 176.427424) (xy 131.606543 176.418121) (xy 131.455201 176.337227) (xy 131.434989 176.323722) - (xy 131.302333 176.214854) (xy 131.285145 176.197666) (xy 131.176277 176.06501) (xy 131.162772 176.044798) - (xy 131.081878 175.893456) (xy 131.072575 175.870998) (xy 131.022757 175.706769) (xy 131.018018 175.682941) - (xy 131.000597 175.506061) (xy 131 175.493907) (xy 131 166.256092) (xy 131.000597 166.243938) (xy 131.018018 166.067056) - (xy 131.022757 166.043232) (xy 131.072577 165.878994) (xy 131.081875 165.856549) (xy 131.162775 165.705195) - (xy 131.176272 165.684995) (xy 131.285149 165.552328) (xy 131.302328 165.535149) (xy 131.434995 165.426272) - (xy 131.455195 165.412775) (xy 131.606549 165.331875) (xy 131.628994 165.322577) (xy 131.793232 165.272757) - (xy 131.817056 165.268018) (xy 131.993939 165.250597) (xy 132.006093 165.25) (xy 133.243907 165.25) + (xy 173.7445 180.872506) (xy 173.7445 184.98135) (xy 173.743903 184.993505) (xy 173.730178 185.132848) + (xy 173.725436 185.156688) (xy 173.69023 185.272749) (xy 173.680927 185.295208) (xy 173.623755 185.402167) + (xy 173.610251 185.422377) (xy 173.533315 185.516125) (xy 173.516125 185.533315) (xy 173.422377 185.610251) + (xy 173.402167 185.623755) (xy 173.295208 185.680927) (xy 173.272749 185.69023) (xy 173.156688 185.725436) + (xy 173.132848 185.730178) (xy 172.993505 185.743903) (xy 172.98135 185.7445) (xy 170.86756 185.7445) + (xy 170.800521 185.724815) (xy 170.754766 185.672011) (xy 170.744822 185.602853) (xy 170.773847 185.539297) + (xy 170.785328 185.527688) (xy 170.890476 185.434537) (xy 170.980213 185.30453) (xy 171.03623 185.156825) + (xy 171.055271 185.000007) (xy 171.040456 184.877989) (xy 171.03623 184.843188) (xy 171.005173 184.761298) + (xy 170.980213 184.695484) (xy 170.890476 184.565477) (xy 170.772233 184.460724) (xy 170.772231 184.460723) + (xy 170.77223 184.460722) (xy 170.632358 184.38731) (xy 170.478979 184.349507) (xy 170.478978 184.349507) + (xy 170.321008 184.349507) (xy 170.321007 184.349507) (xy 170.167627 184.38731) (xy 170.027755 184.460722) + (xy 169.909509 184.565478) (xy 169.819774 184.695482) (xy 169.81977 184.695488) (xy 169.815936 184.705598) + (xy 169.773755 184.761298) (xy 169.708156 184.785351) (xy 169.639966 184.77012) (xy 169.590836 184.720441) + (xy 169.584058 184.705598) (xy 169.58022 184.695477) (xy 169.490483 184.56547) (xy 169.37224 184.460717) + (xy 169.372238 184.460716) (xy 169.372237 184.460715) (xy 169.232365 184.387303) (xy 169.078986 184.3495) + (xy 169.078985 184.3495) (xy 168.948625 184.3495) (xy 168.881586 184.329815) (xy 168.835831 184.277011) + (xy 168.825887 184.207853) (xy 168.827734 184.197906) (xy 168.845727 184.119076) (xy 168.864767 183.865002) + (xy 168.864767 183.864993) (xy 168.845726 183.610918) (xy 168.789031 183.36252) (xy 168.789026 183.362503) + (xy 168.695941 183.125326) (xy 168.695942 183.125326) (xy 168.568545 182.90467) (xy 168.526545 182.852004) + (xy 167.875846 183.502703) (xy 167.868951 183.486056) (xy 167.781401 183.355028) (xy 167.66997 183.243597) + (xy 167.538942 183.156047) (xy 167.522293 183.14915) (xy 168.173185 182.498258) (xy 168.012384 182.388626) + (xy 168.012376 182.388621) (xy 167.780003 182.276718) (xy 167.728143 182.229896) (xy 167.70983 182.162469) + (xy 167.730877 182.095845) (xy 167.780003 182.053278) (xy 168.012376 181.941374) (xy 168.012377 181.941373) + (xy 168.173185 181.831736) (xy 167.522294 181.180844) (xy 167.538942 181.173949) (xy 167.66997 181.086399) + (xy 167.781401 180.974968) (xy 167.868951 180.84394) (xy 167.875846 180.827292) (xy 168.526544 181.47799) + (xy 168.526546 181.477989) (xy 168.568544 181.425328) (xy 168.695941 181.204669) (xy 168.789026 180.967492) + (xy 168.789031 180.967475) (xy 168.845726 180.719077) (xy 168.864767 180.465002) (xy 168.864767 180.464993) + (xy 168.845726 180.210918) (xy 168.789031 179.96252) (xy 168.789026 179.962503) (xy 168.695941 179.725326) + (xy 168.695942 179.725326) (xy 168.568545 179.50467) (xy 168.526545 179.452004) (xy 167.875846 180.102703) + (xy 167.868951 180.086056) (xy 167.781401 179.955028) (xy 167.66997 179.843597) (xy 167.538942 179.756047) + (xy 167.522293 179.74915) (xy 168.173185 179.098258) (xy 168.012384 178.988626) (xy 168.012376 178.988621) + (xy 167.782823 178.878076) (xy 167.782825 178.878076) (xy 167.539347 178.802973) (xy 167.539341 178.802971) + (xy 167.287404 178.764998) (xy 167.032595 178.764998) (xy 166.780658 178.802971) (xy 166.780652 178.802973) + (xy 166.537175 178.878076) (xy 166.307622 178.988623) (xy 166.307609 178.98863) (xy 166.146813 179.098257) + (xy 166.797706 179.74915) (xy 166.781058 179.756047) (xy 166.65003 179.843597) (xy 166.538599 179.955028) + (xy 166.451049 180.086056) (xy 166.444152 180.102704) (xy 165.793452 179.452004) (xy 165.751457 179.504665) + (xy 165.624058 179.725326) (xy 165.530973 179.962503) (xy 165.530968 179.96252) (xy 165.474273 180.210918) + (xy 165.455233 180.464993) (xy 165.455233 180.465002) (xy 165.474273 180.719077) (xy 165.530968 180.967475) + (xy 165.530973 180.967492) (xy 165.624058 181.204669) (xy 165.624057 181.204669) (xy 165.751454 181.425325) + (xy 165.751461 181.425336) (xy 165.793452 181.477989) (xy 165.793453 181.47799) (xy 166.444152 180.82729) + (xy 166.451049 180.84394) (xy 166.538599 180.974968) (xy 166.65003 181.086399) (xy 166.781058 181.173949) + (xy 166.797705 181.180844) (xy 166.146813 181.831736) (xy 166.307616 181.941369) (xy 166.307625 181.941374) + (xy 166.539996 182.053278) (xy 166.591856 182.1001) (xy 166.610169 182.167527) (xy 166.589121 182.234151) + (xy 166.539996 182.276718) (xy 166.307622 182.388623) (xy 166.307609 182.38863) (xy 166.146813 182.498257) + (xy 166.797706 183.14915) (xy 166.781058 183.156047) (xy 166.65003 183.243597) (xy 166.538599 183.355028) + (xy 166.451049 183.486056) (xy 166.444152 183.502704) (xy 165.793452 182.852004) (xy 165.751457 182.904665) + (xy 165.624058 183.125326) (xy 165.530973 183.362503) (xy 165.530968 183.36252) (xy 165.474273 183.610918) + (xy 165.455233 183.864993) (xy 165.455233 183.865002) (xy 165.474273 184.119077) (xy 165.530968 184.367475) + (xy 165.530973 184.367492) (xy 165.624058 184.604669) (xy 165.624057 184.604669) (xy 165.751454 184.825325) + (xy 165.751461 184.825336) (xy 165.793452 184.877989) (xy 165.793453 184.87799) (xy 166.444152 184.22729) + (xy 166.451049 184.24394) (xy 166.538599 184.374968) (xy 166.65003 184.486399) (xy 166.781058 184.573949) + (xy 166.797705 184.580844) (xy 166.146813 185.231736) (xy 166.307616 185.341369) (xy 166.307624 185.341374) + (xy 166.537176 185.451919) (xy 166.537174 185.451919) (xy 166.780652 185.527022) (xy 166.780658 185.527024) + (xy 167.032595 185.564997) (xy 167.032604 185.564998) (xy 167.287396 185.564998) (xy 167.287404 185.564997) + (xy 167.539341 185.527024) (xy 167.539347 185.527022) (xy 167.787254 185.450553) (xy 167.78783 185.452422) + (xy 167.849292 185.446953) (xy 167.911187 185.479368) (xy 167.945731 185.540101) (xy 167.941957 185.609868) + (xy 167.912722 185.656239) (xy 167.605281 185.963681) (xy 167.543958 185.997166) (xy 167.5176 186) + (xy 157.447042 186) (xy 157.380003 185.980315) (xy 157.334248 185.927511) (xy 157.324304 185.858353) + (xy 157.344992 185.80556) (xy 157.35101 185.796841) (xy 157.38022 185.754523) (xy 157.436237 185.606818) + (xy 157.455278 185.45) (xy 157.453401 185.434537) (xy 157.436237 185.293181) (xy 157.394428 185.182941) + (xy 157.38022 185.145477) (xy 157.290483 185.01547) (xy 157.17224 184.910717) (xy 157.172238 184.910716) + (xy 157.172237 184.910715) (xy 157.032365 184.837303) (xy 156.878986 184.7995) (xy 156.878985 184.7995) + (xy 156.721015 184.7995) (xy 156.721014 184.7995) (xy 156.567634 184.837303) (xy 156.427762 184.910715) + (xy 156.42776 184.910717) (xy 156.326973 185.000006) (xy 156.309516 185.015471) (xy 156.219781 185.145475) + (xy 156.21978 185.145476) (xy 156.163762 185.293181) (xy 156.144722 185.449999) (xy 156.151979 185.50977) + (xy 156.140518 185.578694) (xy 156.116564 185.612397) (xy 155.765281 185.963681) (xy 155.703958 185.997166) + (xy 155.6776 186) (xy 150.660748 186) (xy 150.593709 185.980315) (xy 150.558698 185.94644) (xy 150.545632 185.927511) + (xy 150.490483 185.847613) (xy 150.37224 185.74286) (xy 150.372238 185.742859) (xy 150.372237 185.742858) + (xy 150.232365 185.669446) (xy 150.078986 185.631643) (xy 150.078985 185.631643) (xy 149.921015 185.631643) + (xy 149.921014 185.631643) (xy 149.767634 185.669446) (xy 149.627761 185.742858) (xy 149.627759 185.74286) + (xy 149.566826 185.796841) (xy 149.503593 185.826562) (xy 149.434329 185.817378) (xy 149.405935 185.799878) + (xy 149.302333 185.714854) (xy 149.285145 185.697666) (xy 149.271408 185.680927) (xy 149.176276 185.565008) + (xy 149.162772 185.544798) (xy 149.081877 185.393453) (xy 149.072575 185.370998) (xy 149.063589 185.341374) + (xy 149.022757 185.206769) (xy 149.018018 185.182941) (xy 149.000597 185.006061) (xy 149 184.993907) + (xy 149 182.500003) (xy 148.980785 182.304911) (xy 148.972233 182.276718) (xy 148.92388 182.117317) + (xy 148.923876 182.117309) (xy 148.831473 181.944435) (xy 148.831471 181.944433) (xy 148.83147 181.94443) + (xy 148.738985 181.831736) (xy 148.707107 181.792892) (xy 148.555571 181.668531) (xy 148.555564 181.668526) + (xy 148.38269 181.576123) (xy 148.382687 181.576122) (xy 148.382686 181.576121) (xy 148.382683 181.57612) + (xy 148.19509 181.519215) (xy 148.195088 181.519214) (xy 148.19509 181.519214) (xy 148.044494 181.504382) + (xy 148 181.5) (xy 147.999997 181.5) (xy 136.256093 181.5) (xy 136.243939 181.499403) (xy 136.067065 181.481982) + (xy 136.043224 181.47724) (xy 135.879001 181.427424) (xy 135.856543 181.418121) (xy 135.705201 181.337227) + (xy 135.684989 181.323722) (xy 135.552333 181.214854) (xy 135.535145 181.197666) (xy 135.426277 181.06501) + (xy 135.412772 181.044798) (xy 135.335376 180.9) (xy 135.331877 180.893453) (xy 135.322575 180.870998) + (xy 135.276491 180.719077) (xy 135.272757 180.706769) (xy 135.268018 180.682941) (xy 135.250597 180.506061) + (xy 135.25 180.493907) (xy 135.25 179.500003) (xy 135.245272 179.452004) (xy 135.230785 179.30491) + (xy 135.17388 179.117317) (xy 135.163693 179.098258) (xy 135.081473 178.944435) (xy 135.081471 178.944433) + (xy 135.08147 178.94443) (xy 135.018185 178.867317) (xy 134.957107 178.792892) (xy 134.805571 178.668531) + (xy 134.805564 178.668526) (xy 134.63269 178.576123) (xy 134.632687 178.576122) (xy 134.632686 178.576121) + (xy 134.632683 178.57612) (xy 134.44509 178.519215) (xy 134.445088 178.519214) (xy 134.44509 178.519214) + (xy 134.25 178.5) (xy 134.067065 178.481982) (xy 134.043224 178.47724) (xy 133.879001 178.427424) + (xy 133.856544 178.418122) (xy 133.781673 178.378102) (xy 133.72269 178.346575) (xy 133.672846 178.297612) + (xy 133.657144 178.237217) (xy 133.657144 178.035624) (xy 133.655975 178.031262) (xy 133.655974 178.03126) + (xy 133.654258 178.024856) (xy 133.631554 177.940122) (xy 133.631554 177.940121) (xy 133.582119 177.854497) + (xy 133.512206 177.784584) (xy 133.373461 177.645839) (xy 133.339976 177.584516) (xy 133.337142 177.558158) + (xy 133.337142 177.144576) (xy 133.337141 177.144567) (xy 133.336605 177.139583) (xy 133.331055 177.087944) + (xy 133.322332 177.064558) (xy 133.313231 177.040159) (xy 133.283271 176.959832) (xy 133.20133 176.850371) + (xy 133.135554 176.801132) (xy 133.091871 176.768431) (xy 133.091869 176.76843) (xy 132.963757 176.720646) + (xy 132.963755 176.720645) (xy 132.963753 176.720645) (xy 132.907144 176.714558) (xy 132.906023 176.714558) + (xy 132.905776 176.714485) (xy 132.903821 176.714381) (xy 132.90383 176.714202) (xy 132.903825 176.714202) + (xy 132.903836 176.714098) (xy 132.903845 176.713918) (xy 132.838984 176.694873) (xy 132.827357 176.68641) + (xy 132.805572 176.668531) (xy 132.805564 176.668526) (xy 132.63269 176.576123) (xy 132.632687 176.576122) + (xy 132.632686 176.576121) (xy 132.632683 176.57612) (xy 132.44509 176.519215) (xy 132.445088 176.519214) + (xy 132.44509 176.519214) (xy 132.294494 176.504382) (xy 132.25 176.5) (xy 132.249997 176.5) (xy 132.006093 176.5) + (xy 131.993939 176.499403) (xy 131.817065 176.481982) (xy 131.793224 176.47724) (xy 131.629001 176.427424) + (xy 131.606543 176.418121) (xy 131.455201 176.337227) (xy 131.434989 176.323722) (xy 131.302333 176.214854) + (xy 131.285145 176.197666) (xy 131.176277 176.06501) (xy 131.162772 176.044798) (xy 131.081878 175.893456) + (xy 131.072575 175.870998) (xy 131.022757 175.706769) (xy 131.018018 175.682941) (xy 131.000597 175.506061) + (xy 131 175.493907) (xy 131 166.256092) (xy 131.000597 166.243938) (xy 131.018018 166.067056) (xy 131.022757 166.043232) + (xy 131.072577 165.878994) (xy 131.081875 165.856549) (xy 131.162775 165.705195) (xy 131.176272 165.684995) + (xy 131.285149 165.552328) (xy 131.302328 165.535149) (xy 131.434995 165.426272) (xy 131.455195 165.412775) + (xy 131.606549 165.331875) (xy 131.628994 165.322577) (xy 131.793232 165.272757) (xy 131.817056 165.268018) + (xy 131.993939 165.250597) (xy 132.006093 165.25) (xy 133.243907 165.25) ) ) ) @@ -159342,32 +163539,42 @@ (xy 252.613341 73.841062) (xy 252.625389 73.86608) (xy 252.654811 73.950165) (xy 252.658372 74.019944) (xy 252.648255 74.047412) (xy 252.634353 74.074695) (xy 252.634353 74.074697) (xy 252.6195 74.168475) (xy 252.6195 74.531517) (xy 252.623172 74.5547) (xy 252.634354 74.625304) (xy 252.69195 74.738342) - (xy 252.691952 74.738344) (xy 252.691954 74.738347) (xy 252.7 74.746393) (xy 252.7 75.3) (xy 253.991874 75.3) + (xy 252.691952 74.738344) (xy 252.691954 74.738347) (xy 252.781652 74.828045) (xy 252.781656 74.828048) + (xy 252.781658 74.82805) (xy 252.78166 74.828051) (xy 252.796865 74.835799) (xy 252.84556 74.880309) + (xy 252.896349 74.961137) (xy 252.89635 74.961139) (xy 252.896352 74.961141) (xy 253.038859 75.103648) + (xy 253.209505 75.210872) (xy 253.399731 75.277435) (xy 253.399734 75.277435) (xy 253.399736 75.277436) + (xy 253.507591 75.289588) (xy 253.599994 75.299999) (xy 253.599997 75.3) (xy 253.6 75.3) (xy 253.991874 75.3) (xy 254.008059 75.301061) (xy 254.113226 75.314906) (xy 254.144485 75.323281) (xy 254.167954 75.333002) (xy 254.222355 75.37684) (xy 254.244421 75.443134) (xy 254.2445 75.447562) (xy 254.2445 75.64186) (xy 254.245047 75.658589) (xy 254.246109 75.674797) (xy 254.247745 75.6914) (xy 254.266702 75.835391) (xy 254.273222 75.868172) (xy 254.281595 75.899422) (xy 254.292344 75.931091) (xy 254.292346 75.931096) (xy 254.344778 76.057682) (xy 254.359557 76.08765) (xy 254.359564 76.087664) (xy 254.36621 76.099175) (xy 254.375746 76.115695) (xy 254.394313 76.143483) (xy 254.477747 76.252215) (xy 254.499777 76.277335) - (xy 254.5 76.277558) (xy 254.5 76.3) (xy 254.522442 76.3) (xy 254.522663 76.300221) (xy 254.547774 76.322243) - (xy 254.547778 76.322246) (xy 254.547786 76.322253) (xy 254.65651 76.405681) (xy 254.684302 76.42425) - (xy 254.712334 76.440434) (xy 254.740814 76.454478) (xy 254.742315 76.455219) (xy 254.807002 76.482012) - (xy 254.868909 76.507655) (xy 254.900555 76.518398) (xy 254.931815 76.526774) (xy 254.931826 76.526777) - (xy 254.942949 76.528989) (xy 254.964601 76.533296) (xy 255.085774 76.549249) (xy 255.11665 76.553314) - (xy 255.15 76.5555) (xy 255.4205 76.5555) (xy 255.487539 76.575185) (xy 255.533294 76.627989) (xy 255.5445 76.6795) - (xy 255.5445 80.217175) (xy 255.524815 80.284214) (xy 255.516342 80.295854) (xy 255.514843 80.29768) - (xy 255.49768 80.314843) (xy 255.495854 80.316342) (xy 255.431548 80.343664) (xy 255.417175 80.3445) - (xy 252.506093 80.3445) (xy 252.497448 80.344712) (xy 252.493549 80.344808) (xy 252.481381 80.345406) - (xy 252.468909 80.346326) (xy 252.468907 80.346326) (xy 252.468896 80.346327) (xy 252.413901 80.351743) - (xy 252.292027 80.363746) (xy 252.292 80.363749) (xy 252.267214 80.367427) (xy 252.267212 80.367427) - (xy 252.243392 80.372165) (xy 252.243382 80.372167) (xy 252.219079 80.378254) (xy 252.219057 80.37826) - (xy 252.054819 80.42808) (xy 252.041204 80.432952) (xy 251.971451 80.437) (xy 251.920769 80.412052) - (xy 251.802333 80.314854) (xy 251.785145 80.297666) (xy 251.676277 80.16501) (xy 251.662772 80.144798) - (xy 251.581878 79.993456) (xy 251.572575 79.970998) (xy 251.522757 79.806769) (xy 251.518018 79.782941) - (xy 251.500597 79.606061) (xy 251.5 79.593907) (xy 251.5 75.499999) (xy 251.5 75.3) (xy 251.3 75.3) - (xy 251.276149 75.295255) (xy 251.247656 75.289588) (xy 251.202956 75.271072) (xy 251.179086 75.255122) - (xy 251.144877 75.220913) (xy 251.128927 75.197043) (xy 251.110412 75.152346) (xy 251.102381 75.111971) - (xy 251.1 75.087789) (xy 251.1 74.206961) (xy 251.10078 74.193077) (xy 251.114118 74.074697) (xy 251.118493 74.035865) + (xy 254.522663 76.300221) (xy 254.547774 76.322243) (xy 254.547778 76.322246) (xy 254.547786 76.322253) + (xy 254.65651 76.405681) (xy 254.684302 76.42425) (xy 254.712334 76.440434) (xy 254.740814 76.454478) + (xy 254.742315 76.455219) (xy 254.807002 76.482012) (xy 254.868909 76.507655) (xy 254.900555 76.518398) + (xy 254.931815 76.526774) (xy 254.931826 76.526777) (xy 254.942949 76.528989) (xy 254.964601 76.533296) + (xy 255.085774 76.549249) (xy 255.11665 76.553314) (xy 255.116652 76.553314) (xy 255.235344 76.568939) + (xy 255.266612 76.577317) (xy 255.331062 76.604013) (xy 255.359094 76.620197) (xy 255.414444 76.662668) + (xy 255.43733 76.685554) (xy 255.463362 76.719479) (xy 255.479801 76.740904) (xy 255.495985 76.768936) + (xy 255.52268 76.833383) (xy 255.531058 76.864649) (xy 255.543439 76.958684) (xy 255.5445 76.974871) + (xy 255.5445 79.58135) (xy 255.543903 79.593505) (xy 255.530178 79.732848) (xy 255.525436 79.756688) + (xy 255.49023 79.872749) (xy 255.480927 79.895208) (xy 255.423755 80.002167) (xy 255.410251 80.022377) + (xy 255.333315 80.116125) (xy 255.316125 80.133315) (xy 255.222377 80.210251) (xy 255.202167 80.223755) + (xy 255.095208 80.280927) (xy 255.072749 80.29023) (xy 254.956688 80.325436) (xy 254.932848 80.330178) + (xy 254.793505 80.343903) (xy 254.78135 80.3445) (xy 252.506093 80.3445) (xy 252.497448 80.344712) + (xy 252.493549 80.344808) (xy 252.481381 80.345406) (xy 252.468909 80.346326) (xy 252.468907 80.346326) + (xy 252.468896 80.346327) (xy 252.413901 80.351743) (xy 252.292027 80.363746) (xy 252.292 80.363749) + (xy 252.267214 80.367427) (xy 252.267212 80.367427) (xy 252.243392 80.372165) (xy 252.243382 80.372167) + (xy 252.219079 80.378254) (xy 252.219057 80.37826) (xy 252.054819 80.42808) (xy 252.041204 80.432952) + (xy 251.971451 80.437) (xy 251.920769 80.412052) (xy 251.802333 80.314854) (xy 251.785145 80.297666) + (xy 251.676277 80.16501) (xy 251.662772 80.144798) (xy 251.581878 79.993456) (xy 251.572575 79.970998) + (xy 251.542772 79.872749) (xy 251.522757 79.806769) (xy 251.518018 79.782941) (xy 251.500597 79.606061) + (xy 251.5 79.593907) (xy 251.5 75.499999) (xy 251.499999 75.499995) (xy 251.484777 75.423464) (xy 251.484776 75.423463) + (xy 251.441421 75.358578) (xy 251.376537 75.315224) (xy 251.374938 75.314906) (xy 251.3 75.3) (xy 251.276149 75.295255) + (xy 251.247656 75.289588) (xy 251.202956 75.271072) (xy 251.179086 75.255122) (xy 251.144877 75.220913) + (xy 251.128927 75.197043) (xy 251.110412 75.152346) (xy 251.102381 75.111971) (xy 251.1 75.087789) + (xy 251.1 74.206961) (xy 251.10078 74.193077) (xy 251.114118 74.074697) (xy 251.118493 74.035865) (xy 251.124669 74.008803) (xy 251.174612 73.866075) (xy 251.186659 73.841062) (xy 251.267106 73.71303) (xy 251.284411 73.691331) (xy 251.391331 73.584411) (xy 251.41303 73.567106) (xy 251.541064 73.486657) (xy 251.566075 73.474612) (xy 251.708803 73.424669) (xy 251.735865 73.418493) (xy 251.886119 73.401564) @@ -159402,43 +163609,50 @@ (filled_polygon (layer "F.Cu") (pts - (xy 159.4 79.9) (xy 158 79.9) (xy 158 80.599993) (xy 158 93.893907) (xy 157.999403 93.906061) (xy 157.981982 94.082934) - (xy 157.97724 94.106775) (xy 157.927424 94.270998) (xy 157.918121 94.293456) (xy 157.837227 94.444798) - (xy 157.823722 94.46501) (xy 157.714854 94.597666) (xy 157.697666 94.614854) (xy 157.56501 94.723722) - (xy 157.544798 94.737227) (xy 157.393456 94.818121) (xy 157.370998 94.827424) (xy 157.206775 94.87724) - (xy 157.182934 94.881982) (xy 157.006061 94.899403) (xy 156.993907 94.9) (xy 146.7 94.9) (xy 144.106093 94.9) - (xy 144.093939 94.899403) (xy 143.917065 94.881982) (xy 143.893224 94.87724) (xy 143.729001 94.827424) - (xy 143.706543 94.818121) (xy 143.555201 94.737227) (xy 143.534989 94.723722) (xy 143.402333 94.614854) - (xy 143.385145 94.597666) (xy 143.276277 94.46501) (xy 143.262772 94.444798) (xy 143.181878 94.293456) - (xy 143.172575 94.270998) (xy 143.122757 94.106769) (xy 143.118018 94.082941) (xy 143.100597 93.906061) - (xy 143.1 93.893907) (xy 143.1 83.606092) (xy 143.100597 83.593938) (xy 143.118018 83.417056) (xy 143.122757 83.393232) - (xy 143.172577 83.228994) (xy 143.181875 83.206549) (xy 143.262775 83.055195) (xy 143.276272 83.034995) - (xy 143.385149 82.902328) (xy 143.402328 82.885149) (xy 143.534995 82.776272) (xy 143.555195 82.762775) - (xy 143.706544 82.681877) (xy 143.728998 82.672577) (xy 143.750465 82.666064) (xy 143.824117 82.643722) - (xy 143.89398 82.643098) (xy 143.923859 82.656025) (xy 143.934759 82.662558) (xy 143.934778 82.662568) - (xy 144.086079 82.743441) (xy 144.086093 82.743448) (xy 144.086097 82.74345) (xy 144.086101 82.743452) - (xy 144.108762 82.75417) (xy 144.13122 82.763473) (xy 144.154834 82.771922) (xy 144.319057 82.821738) - (xy 144.343381 82.827831) (xy 144.367222 82.832573) (xy 144.385462 82.835278) (xy 144.39202 82.836252) - (xy 144.409984 82.838021) (xy 144.568895 82.853673) (xy 144.581404 82.854595) (xy 144.593558 82.855192) - (xy 144.606093 82.8555) (xy 144.606113 82.8555) (xy 145.491532 82.8555) (xy 145.492599 82.855484) - (xy 145.498896 82.855394) (xy 145.506034 82.855188) (xy 145.584642 82.840393) (xy 145.63213 82.823423) - (xy 145.632129 82.823422) (xy 145.633656 82.822877) (xy 145.641715 82.820303) (xy 145.663972 82.814026) - (xy 145.672665 82.809596) (xy 145.672664 82.809595) (xy 145.732137 82.779291) (xy 145.76905 82.767302) - (xy 145.773978 82.766521) (xy 145.793347 82.765) (xy 146.096656 82.765) (xy 146.11603 82.766523) - (xy 146.118135 82.766856) (xy 146.120944 82.7673) (xy 146.157856 82.779289) (xy 146.211782 82.806766) - (xy 146.225981 82.814002) (xy 146.226102 82.814064) (xy 146.226107 82.814066) (xy 146.226111 82.814068) - (xy 146.226115 82.814069) (xy 146.231498 82.816186) (xy 146.233714 82.817907) (xy 146.271361 82.828961) - (xy 146.271361 82.828962) (xy 146.326491 82.84515) (xy 146.326493 82.84515) (xy 146.326495 82.845151) - (xy 146.347958 82.848236) (xy 146.398475 82.8555) (xy 146.944434 82.8555) (xy 147.011473 82.875185) - (xy 147.040287 82.900835) (xy 147.132148 83.012768) (xy 147.145653 83.032979) (xy 147.221927 83.175676) - (xy 147.23123 83.198135) (xy 147.278201 83.352978) (xy 147.282943 83.376819) (xy 147.293903 83.4881) - (xy 147.2945 83.500254) (xy 147.2945 84.116517) (xy 147.3 84.151242) (xy 147.3 84.5) (xy 152.499997 84.5) - (xy 152.5 84.5) (xy 153.5 84.5) (xy 153.5 82.956195) (xy 153.506959 82.91524) (xy 153.511477 82.902328) - (xy 153.517646 82.884699) (xy 153.518538 82.875185) (xy 153.5205 82.854269) (xy 153.5205 82.34573) - (xy 153.517646 82.315305) (xy 153.517646 82.315301) (xy 153.506958 82.284756) (xy 153.5 82.243802) - (xy 153.5 81.306195) (xy 153.506959 81.26524) (xy 153.517646 81.234699) (xy 153.5205 81.204266) - (xy 153.5205 80.695734) (xy 153.517646 80.665301) (xy 153.506958 80.634756) (xy 153.5 80.593802) - (xy 153.5 79.996195) (xy 153.506959 79.95524) (xy 153.509038 79.949299) (xy 153.517646 79.924699) + (xy 159.4 79.9) (xy 158.699993 79.9) (xy 158.544242 79.917548) (xy 158.544233 79.91755) (xy 158.396281 79.969321) + (xy 158.396278 79.969323) (xy 158.263556 80.052718) (xy 158.152718 80.163556) (xy 158.069323 80.296278) + (xy 158.069321 80.296281) (xy 158.01755 80.444233) (xy 158.017548 80.444242) (xy 158 80.599993) + (xy 158 93.893907) (xy 157.999403 93.906061) (xy 157.981982 94.082934) (xy 157.97724 94.106775) + (xy 157.927424 94.270998) (xy 157.918121 94.293456) (xy 157.837227 94.444798) (xy 157.823722 94.46501) + (xy 157.714854 94.597666) (xy 157.697666 94.614854) (xy 157.56501 94.723722) (xy 157.544798 94.737227) + (xy 157.393456 94.818121) (xy 157.370998 94.827424) (xy 157.206775 94.87724) (xy 157.182934 94.881982) + (xy 157.006061 94.899403) (xy 156.993907 94.9) (xy 144.106093 94.9) (xy 144.093939 94.899403) (xy 143.917065 94.881982) + (xy 143.893224 94.87724) (xy 143.729001 94.827424) (xy 143.706543 94.818121) (xy 143.555201 94.737227) + (xy 143.534989 94.723722) (xy 143.402333 94.614854) (xy 143.385145 94.597666) (xy 143.276277 94.46501) + (xy 143.262772 94.444798) (xy 143.181878 94.293456) (xy 143.172575 94.270998) (xy 143.122757 94.106769) + (xy 143.118018 94.082941) (xy 143.100597 93.906061) (xy 143.1 93.893907) (xy 143.1 83.606092) (xy 143.100597 83.593938) + (xy 143.118018 83.417056) (xy 143.122757 83.393232) (xy 143.172577 83.228994) (xy 143.181875 83.206549) + (xy 143.262775 83.055195) (xy 143.276272 83.034995) (xy 143.385149 82.902328) (xy 143.402328 82.885149) + (xy 143.534995 82.776272) (xy 143.555195 82.762775) (xy 143.706544 82.681877) (xy 143.728998 82.672577) + (xy 143.750465 82.666064) (xy 143.824117 82.643722) (xy 143.89398 82.643098) (xy 143.923859 82.656025) + (xy 143.934759 82.662558) (xy 143.934778 82.662568) (xy 144.086079 82.743441) (xy 144.086093 82.743448) + (xy 144.086097 82.74345) (xy 144.086101 82.743452) (xy 144.108762 82.75417) (xy 144.13122 82.763473) + (xy 144.154834 82.771922) (xy 144.319057 82.821738) (xy 144.343381 82.827831) (xy 144.367222 82.832573) + (xy 144.385462 82.835278) (xy 144.39202 82.836252) (xy 144.409984 82.838021) (xy 144.568895 82.853673) + (xy 144.581404 82.854595) (xy 144.593558 82.855192) (xy 144.606093 82.8555) (xy 144.606113 82.8555) + (xy 145.491532 82.8555) (xy 145.492599 82.855484) (xy 145.498896 82.855394) (xy 145.506034 82.855188) + (xy 145.584642 82.840393) (xy 145.63213 82.823423) (xy 145.632129 82.823422) (xy 145.633656 82.822877) + (xy 145.641715 82.820303) (xy 145.663972 82.814026) (xy 145.672665 82.809596) (xy 145.672664 82.809595) + (xy 145.732137 82.779291) (xy 145.76905 82.767302) (xy 145.773978 82.766521) (xy 145.793347 82.765) + (xy 146.096656 82.765) (xy 146.11603 82.766523) (xy 146.118135 82.766856) (xy 146.120944 82.7673) + (xy 146.157856 82.779289) (xy 146.211782 82.806766) (xy 146.225981 82.814002) (xy 146.226102 82.814064) + (xy 146.226107 82.814066) (xy 146.226111 82.814068) (xy 146.226115 82.814069) (xy 146.231498 82.816186) + (xy 146.233714 82.817907) (xy 146.271361 82.828961) (xy 146.271361 82.828962) (xy 146.326491 82.84515) + (xy 146.326493 82.84515) (xy 146.326495 82.845151) (xy 146.347958 82.848236) (xy 146.398475 82.8555) + (xy 146.944434 82.8555) (xy 147.011473 82.875185) (xy 147.040287 82.900835) (xy 147.132148 83.012768) + (xy 147.145653 83.032979) (xy 147.221927 83.175676) (xy 147.23123 83.198135) (xy 147.278201 83.352978) + (xy 147.282943 83.376819) (xy 147.293903 83.4881) (xy 147.2945 83.500254) (xy 147.2945 84.116517) + (xy 147.305292 84.184657) (xy 147.309354 84.210304) (xy 147.36695 84.323342) (xy 147.366952 84.323344) + (xy 147.366954 84.323347) (xy 147.456652 84.413045) (xy 147.456654 84.413046) (xy 147.456658 84.41305) + (xy 147.569696 84.470646) (xy 147.569698 84.470647) (xy 147.663475 84.485499) (xy 147.663481 84.4855) + (xy 148.026518 84.485499) (xy 148.040045 84.483356) (xy 148.071581 84.482427) (xy 148.25 84.5) (xy 152.499997 84.5) + (xy 152.5 84.5) (xy 152.69509 84.480785) (xy 152.882683 84.42388) (xy 153.05557 84.33147) (xy 153.207107 84.207107) + (xy 153.33147 84.05557) (xy 153.42388 83.882683) (xy 153.480785 83.69509) (xy 153.5 83.5) (xy 153.5 82.956195) + (xy 153.506959 82.91524) (xy 153.511477 82.902328) (xy 153.517646 82.884699) (xy 153.518538 82.875185) + (xy 153.5205 82.854269) (xy 153.5205 82.34573) (xy 153.517646 82.315305) (xy 153.517646 82.315301) + (xy 153.506958 82.284756) (xy 153.5 82.243802) (xy 153.5 81.306195) (xy 153.506959 81.26524) (xy 153.517646 81.234699) + (xy 153.5205 81.204266) (xy 153.5205 80.695734) (xy 153.517646 80.665301) (xy 153.506958 80.634756) + (xy 153.5 80.593802) (xy 153.5 79.996195) (xy 153.506959 79.95524) (xy 153.509038 79.949299) (xy 153.517646 79.924699) (xy 153.517647 79.924689) (xy 153.5205 79.894269) (xy 153.5205 79.38573) (xy 153.517646 79.355305) (xy 153.517646 79.355301) (xy 153.506958 79.324756) (xy 153.5 79.283802) (xy 153.5 78.730601) (xy 153.519685 78.663562) (xy 153.527052 78.653289) (xy 153.532652 78.646268) (xy 153.549235 78.622897) (xy 153.629678 78.494872) @@ -159497,88 +163711,94 @@ (xy 240.781799 71.824174) (xy 240.799397 72.00194) (xy 240.8 72.014156) (xy 240.8 84.901907) (xy 240.799409 84.914) (xy 240.782164 85.089987) (xy 240.777469 85.113711) (xy 240.728152 85.277169) (xy 240.718942 85.299531) (xy 240.638835 85.450308) (xy 240.625459 85.470458) (xy 240.517604 85.60282) (xy 240.500571 85.619989) - (xy 240.397535 85.705327) (xy 240.333349 85.732929) (xy 240.31855 85.733829) (xy 229.304974 85.743606) - (xy 229.29404 85.743885) (xy 229.292433 85.743926) (xy 229.287033 85.744195) (xy 229.280285 85.744533) - (xy 229.267834 85.745462) (xy 229.267822 85.745463) (xy 229.267811 85.745464) (xy 229.091033 85.763024) - (xy 229.09103 85.763024) (xy 229.091014 85.763026) (xy 229.066252 85.76672) (xy 229.042441 85.771475) - (xy 229.018137 85.777582) (xy 229.01811 85.777589) (xy 228.854048 85.827487) (xy 228.854005 85.827501) - (xy 228.847778 85.829734) (xy 228.778029 85.833828) (xy 228.727701 85.809214) (xy 228.605251 85.709641) - (xy 228.587911 85.692441) (xy 228.478017 85.559486) (xy 228.464387 85.539218) (xy 228.422349 85.461041) - (xy 228.382698 85.387304) (xy 228.373307 85.364759) (xy 228.322989 85.199775) (xy 228.318201 85.175831) - (xy 228.300603 84.998058) (xy 228.3 84.985843) (xy 228.3 81.100003) (xy 228.3 81.1) (xy 228.3 80.1) - (xy 227.3 80.1) (xy 227.299997 80.1) (xy 220.706093 80.1) (xy 220.693939 80.099403) (xy 220.517065 80.081982) - (xy 220.493224 80.07724) (xy 220.329001 80.027424) (xy 220.306543 80.018121) (xy 220.155201 79.937227) - (xy 220.134989 79.923722) (xy 220.002333 79.814854) (xy 219.985145 79.797666) (xy 219.876277 79.66501) - (xy 219.862772 79.644798) (xy 219.781878 79.493456) (xy 219.772575 79.470998) (xy 219.755309 79.414079) - (xy 219.722757 79.306769) (xy 219.718018 79.282941) (xy 219.705909 79.159995) (xy 233.730233 79.159995) - (xy 233.730233 79.160004) (xy 233.749273 79.414079) (xy 233.805968 79.662477) (xy 233.805973 79.662494) - (xy 233.899058 79.899671) (xy 233.899057 79.899671) (xy 234.026454 80.120327) (xy 234.026461 80.120338) - (xy 234.068452 80.172991) (xy 234.068453 80.172992) (xy 234.719152 79.522292) (xy 234.726049 79.538942) - (xy 234.813599 79.66997) (xy 234.92503 79.781401) (xy 235.056058 79.868951) (xy 235.072705 79.875846) - (xy 234.421813 80.526738) (xy 234.582616 80.636371) (xy 234.582624 80.636376) (xy 234.812176 80.746921) - (xy 234.812174 80.746921) (xy 235.055652 80.822024) (xy 235.055658 80.822026) (xy 235.307595 80.859999) - (xy 235.307604 80.86) (xy 235.562396 80.86) (xy 235.562404 80.859999) (xy 235.814341 80.822026) - (xy 235.814347 80.822024) (xy 236.057824 80.746921) (xy 236.287376 80.636376) (xy 236.287377 80.636375) - (xy 236.448185 80.526738) (xy 235.797294 79.875846) (xy 235.813942 79.868951) (xy 235.94497 79.781401) - (xy 236.056401 79.66997) (xy 236.143951 79.538942) (xy 236.150846 79.522294) (xy 236.801544 80.172992) - (xy 236.801546 80.172991) (xy 236.843544 80.12033) (xy 236.970941 79.899671) (xy 237.019572 79.775763) - (xy 237.062387 79.720549) (xy 237.128257 79.697248) (xy 237.196268 79.713259) (xy 237.244827 79.763496) - (xy 237.250428 79.775763) (xy 237.299058 79.899671) (xy 237.426454 80.120327) (xy 237.426461 80.120338) - (xy 237.468452 80.172991) (xy 237.468453 80.172992) (xy 238.119152 79.522292) (xy 238.126049 79.538942) - (xy 238.213599 79.66997) (xy 238.32503 79.781401) (xy 238.456058 79.868951) (xy 238.472705 79.875846) - (xy 237.821813 80.526738) (xy 237.982616 80.636371) (xy 237.982624 80.636376) (xy 238.212176 80.746921) - (xy 238.212174 80.746921) (xy 238.455652 80.822024) (xy 238.455658 80.822026) (xy 238.707595 80.859999) - (xy 238.707604 80.86) (xy 238.962396 80.86) (xy 238.962404 80.859999) (xy 239.214341 80.822026) - (xy 239.214347 80.822024) (xy 239.457824 80.746921) (xy 239.687376 80.636376) (xy 239.687377 80.636375) - (xy 239.848185 80.526738) (xy 239.197294 79.875846) (xy 239.213942 79.868951) (xy 239.34497 79.781401) - (xy 239.456401 79.66997) (xy 239.543951 79.538942) (xy 239.550846 79.522294) (xy 240.201544 80.172992) - (xy 240.201546 80.172991) (xy 240.243544 80.12033) (xy 240.370941 79.899671) (xy 240.464026 79.662494) - (xy 240.464031 79.662477) (xy 240.520726 79.414079) (xy 240.539767 79.160004) (xy 240.539767 79.159995) - (xy 240.520726 78.90592) (xy 240.464031 78.657522) (xy 240.464026 78.657505) (xy 240.370941 78.420328) - (xy 240.370942 78.420328) (xy 240.243545 78.199672) (xy 240.201545 78.147006) (xy 239.550846 78.797705) - (xy 239.543951 78.781058) (xy 239.456401 78.65003) (xy 239.34497 78.538599) (xy 239.213942 78.451049) - (xy 239.197293 78.444152) (xy 239.848185 77.79326) (xy 239.687384 77.683628) (xy 239.687376 77.683623) - (xy 239.457823 77.573078) (xy 239.457825 77.573078) (xy 239.214347 77.497975) (xy 239.214341 77.497973) - (xy 238.962404 77.46) (xy 238.707595 77.46) (xy 238.455658 77.497973) (xy 238.455652 77.497975) - (xy 238.212175 77.573078) (xy 237.982622 77.683625) (xy 237.982609 77.683632) (xy 237.821813 77.793259) - (xy 238.472706 78.444152) (xy 238.456058 78.451049) (xy 238.32503 78.538599) (xy 238.213599 78.65003) - (xy 238.126049 78.781058) (xy 238.119152 78.797706) (xy 237.468452 78.147006) (xy 237.426457 78.199667) - (xy 237.299058 78.420328) (xy 237.250428 78.544236) (xy 237.207612 78.59945) (xy 237.141742 78.622751) - (xy 237.073732 78.60674) (xy 237.025173 78.556502) (xy 237.019572 78.544236) (xy 236.970941 78.420328) - (xy 236.970942 78.420328) (xy 236.843545 78.199672) (xy 236.801545 78.147006) (xy 236.150846 78.797705) - (xy 236.143951 78.781058) (xy 236.056401 78.65003) (xy 235.94497 78.538599) (xy 235.813942 78.451049) - (xy 235.797293 78.444152) (xy 236.448185 77.79326) (xy 236.287384 77.683628) (xy 236.287376 77.683623) - (xy 236.057823 77.573078) (xy 236.057825 77.573078) (xy 235.814347 77.497975) (xy 235.814341 77.497973) - (xy 235.562404 77.46) (xy 235.307595 77.46) (xy 235.055658 77.497973) (xy 235.055652 77.497975) - (xy 234.812175 77.573078) (xy 234.582622 77.683625) (xy 234.582609 77.683632) (xy 234.421813 77.793259) - (xy 235.072706 78.444152) (xy 235.056058 78.451049) (xy 234.92503 78.538599) (xy 234.813599 78.65003) - (xy 234.726049 78.781058) (xy 234.719152 78.797706) (xy 234.068452 78.147006) (xy 234.026457 78.199667) - (xy 233.899058 78.420328) (xy 233.805973 78.657505) (xy 233.805968 78.657522) (xy 233.749273 78.90592) - (xy 233.730233 79.159995) (xy 219.705909 79.159995) (xy 219.700597 79.106061) (xy 219.7 79.093907) - (xy 219.7 77.606092) (xy 219.700597 77.593938) (xy 219.718018 77.417056) (xy 219.722757 77.393232) - (xy 219.772577 77.228994) (xy 219.781875 77.206549) (xy 219.862775 77.055195) (xy 219.876272 77.034995) - (xy 219.985149 76.902328) (xy 220.002328 76.885149) (xy 220.134995 76.776272) (xy 220.155195 76.762775) - (xy 220.306549 76.681875) (xy 220.328994 76.672577) (xy 220.493232 76.622757) (xy 220.517056 76.618018) - (xy 220.693939 76.600597) (xy 220.706093 76.6) (xy 220.986057 76.6) (xy 221.010246 76.602382) (xy 221.056953 76.611673) - (xy 221.082725 76.6168) (xy 221.082726 76.6168) (xy 221.639275 76.6168) (xy 221.665046 76.611673) - (xy 221.711753 76.602382) (xy 221.735943 76.6) (xy 222.256057 76.6) (xy 222.280246 76.602382) (xy 222.326953 76.611673) - (xy 222.352725 76.6168) (xy 222.352726 76.6168) (xy 222.909275 76.6168) (xy 222.935046 76.611673) - (xy 222.981753 76.602382) (xy 223.005943 76.6) (xy 223.526057 76.6) (xy 223.550246 76.602382) (xy 223.596953 76.611673) - (xy 223.622725 76.6168) (xy 223.622726 76.6168) (xy 224.179275 76.6168) (xy 224.205046 76.611673) - (xy 224.251753 76.602382) (xy 224.275943 76.6) (xy 224.796057 76.6) (xy 224.820246 76.602382) (xy 224.866953 76.611673) - (xy 224.892725 76.6168) (xy 224.892726 76.6168) (xy 225.449275 76.6168) (xy 225.475046 76.611673) - (xy 225.521753 76.602382) (xy 225.545943 76.6) (xy 226.066057 76.6) (xy 226.090246 76.602382) (xy 226.136953 76.611673) - (xy 226.162725 76.6168) (xy 226.162726 76.6168) (xy 226.719275 76.6168) (xy 226.745046 76.611673) - (xy 226.791753 76.602382) (xy 226.815943 76.6) (xy 227.299995 76.6) (xy 227.3 76.6) (xy 227.341998 76.6) - (xy 227.350322 76.600409) (xy 227.432723 76.6168) (xy 227.432726 76.6168) (xy 227.989276 76.6168) - (xy 227.989277 76.616799) (xy 228.06234 76.602266) (xy 228.065731 76.6) (xy 228.3 76.6) (xy 228.3 72.098092) - (xy 228.300591 72.086) (xy 228.317835 71.910013) (xy 228.32253 71.886288) (xy 228.341271 71.824174) - (xy 228.371847 71.722828) (xy 228.381057 71.700468) (xy 228.461169 71.549682) (xy 228.474534 71.529548) - (xy 228.582405 71.397166) (xy 228.599421 71.380014) (xy 228.730927 71.271096) (xy 228.750951 71.25757) - (xy 228.9011 71.176249) (xy 228.92338 71.166863) (xy 229.08645 71.116236) (xy 229.110128 71.111354) - (xy 229.285982 71.092702) (xy 229.298045 71.092015) (xy 234.162381 71.0531) (xy 234.206701 71.060914) - (xy 234.242886 71.074411) (xy 234.299515 71.080499) (xy 234.890484 71.080498) (xy 234.947114 71.074411) - (xy 235.002219 71.053857) (xy 235.044557 71.046043) (xy 238.999697 71.014402) + (xy 240.397535 85.705327) (xy 240.333349 85.732929) (xy 240.31855 85.733829) (xy 229.304973 85.743606) + (xy 229.294319 85.743877) (xy 229.292431 85.743926) (xy 229.283756 85.744359) (xy 229.280288 85.744533) + (xy 229.267833 85.745462) (xy 229.267813 85.745464) (xy 229.091033 85.763024) (xy 229.09103 85.763024) + (xy 229.091014 85.763026) (xy 229.066252 85.76672) (xy 229.042441 85.771475) (xy 229.018137 85.777582) + (xy 229.01811 85.777589) (xy 228.854048 85.827487) (xy 228.854005 85.827501) (xy 228.847778 85.829734) + (xy 228.778029 85.833828) (xy 228.727701 85.809214) (xy 228.605251 85.709641) (xy 228.587911 85.692441) + (xy 228.478017 85.559486) (xy 228.464387 85.539218) (xy 228.422349 85.461041) (xy 228.382698 85.387304) + (xy 228.373307 85.364759) (xy 228.322989 85.199775) (xy 228.318201 85.175831) (xy 228.300603 84.998058) + (xy 228.3 84.985843) (xy 228.3 81.100003) (xy 228.280785 80.904911) (xy 228.267161 80.859999) (xy 228.22388 80.717317) + (xy 228.222112 80.711488) (xy 228.223009 80.711215) (xy 228.2151 80.671454) (xy 228.2151 80.329423) + (xy 228.215099 80.329421) (xy 228.200567 80.256364) (xy 228.200566 80.25636) (xy 228.145201 80.173499) + (xy 228.065627 80.12033) (xy 228.062339 80.118133) (xy 228.062335 80.118132) (xy 227.989277 80.1036) + (xy 227.989274 80.1036) (xy 227.432726 80.1036) (xy 227.43272 80.1036) (xy 227.41891 80.106347) + (xy 227.382571 80.108132) (xy 227.325379 80.102499) (xy 227.3 80.1) (xy 227.299997 80.1) (xy 220.706093 80.1) + (xy 220.693939 80.099403) (xy 220.517065 80.081982) (xy 220.493224 80.07724) (xy 220.329001 80.027424) + (xy 220.306543 80.018121) (xy 220.155201 79.937227) (xy 220.134989 79.923722) (xy 220.002333 79.814854) + (xy 219.985145 79.797666) (xy 219.876277 79.66501) (xy 219.862772 79.644798) (xy 219.781878 79.493456) + (xy 219.772575 79.470998) (xy 219.755309 79.414079) (xy 219.722757 79.306769) (xy 219.718018 79.282941) + (xy 219.705909 79.159995) (xy 233.730233 79.159995) (xy 233.730233 79.160004) (xy 233.749273 79.414079) + (xy 233.805968 79.662477) (xy 233.805973 79.662494) (xy 233.899058 79.899671) (xy 233.899057 79.899671) + (xy 234.026454 80.120327) (xy 234.026461 80.120338) (xy 234.068452 80.172991) (xy 234.068453 80.172992) + (xy 234.719152 79.522292) (xy 234.726049 79.538942) (xy 234.813599 79.66997) (xy 234.92503 79.781401) + (xy 235.056058 79.868951) (xy 235.072705 79.875846) (xy 234.421813 80.526738) (xy 234.582616 80.636371) + (xy 234.582624 80.636376) (xy 234.812176 80.746921) (xy 234.812174 80.746921) (xy 235.055652 80.822024) + (xy 235.055658 80.822026) (xy 235.307595 80.859999) (xy 235.307604 80.86) (xy 235.562396 80.86) + (xy 235.562404 80.859999) (xy 235.814341 80.822026) (xy 235.814347 80.822024) (xy 236.057824 80.746921) + (xy 236.287376 80.636376) (xy 236.287377 80.636375) (xy 236.448185 80.526738) (xy 235.797294 79.875846) + (xy 235.813942 79.868951) (xy 235.94497 79.781401) (xy 236.056401 79.66997) (xy 236.143951 79.538942) + (xy 236.150846 79.522294) (xy 236.801544 80.172992) (xy 236.801546 80.172991) (xy 236.843544 80.12033) + (xy 236.970941 79.899671) (xy 237.019572 79.775763) (xy 237.062387 79.720549) (xy 237.128257 79.697248) + (xy 237.196268 79.713259) (xy 237.244827 79.763496) (xy 237.250428 79.775763) (xy 237.299058 79.899671) + (xy 237.426454 80.120327) (xy 237.426461 80.120338) (xy 237.468452 80.172991) (xy 237.468453 80.172992) + (xy 238.119152 79.522292) (xy 238.126049 79.538942) (xy 238.213599 79.66997) (xy 238.32503 79.781401) + (xy 238.456058 79.868951) (xy 238.472705 79.875846) (xy 237.821813 80.526738) (xy 237.982616 80.636371) + (xy 237.982624 80.636376) (xy 238.212176 80.746921) (xy 238.212174 80.746921) (xy 238.455652 80.822024) + (xy 238.455658 80.822026) (xy 238.707595 80.859999) (xy 238.707604 80.86) (xy 238.962396 80.86) + (xy 238.962404 80.859999) (xy 239.214341 80.822026) (xy 239.214347 80.822024) (xy 239.457824 80.746921) + (xy 239.687376 80.636376) (xy 239.687377 80.636375) (xy 239.848185 80.526738) (xy 239.197294 79.875846) + (xy 239.213942 79.868951) (xy 239.34497 79.781401) (xy 239.456401 79.66997) (xy 239.543951 79.538942) + (xy 239.550846 79.522294) (xy 240.201544 80.172992) (xy 240.201546 80.172991) (xy 240.243544 80.12033) + (xy 240.370941 79.899671) (xy 240.464026 79.662494) (xy 240.464031 79.662477) (xy 240.520726 79.414079) + (xy 240.539767 79.160004) (xy 240.539767 79.159995) (xy 240.520726 78.90592) (xy 240.464031 78.657522) + (xy 240.464026 78.657505) (xy 240.370941 78.420328) (xy 240.370942 78.420328) (xy 240.243545 78.199672) + (xy 240.201545 78.147006) (xy 239.550846 78.797705) (xy 239.543951 78.781058) (xy 239.456401 78.65003) + (xy 239.34497 78.538599) (xy 239.213942 78.451049) (xy 239.197293 78.444152) (xy 239.848185 77.79326) + (xy 239.687384 77.683628) (xy 239.687376 77.683623) (xy 239.457823 77.573078) (xy 239.457825 77.573078) + (xy 239.214347 77.497975) (xy 239.214341 77.497973) (xy 238.962404 77.46) (xy 238.707595 77.46) + (xy 238.455658 77.497973) (xy 238.455652 77.497975) (xy 238.212175 77.573078) (xy 237.982622 77.683625) + (xy 237.982609 77.683632) (xy 237.821813 77.793259) (xy 238.472706 78.444152) (xy 238.456058 78.451049) + (xy 238.32503 78.538599) (xy 238.213599 78.65003) (xy 238.126049 78.781058) (xy 238.119152 78.797706) + (xy 237.468452 78.147006) (xy 237.426457 78.199667) (xy 237.299058 78.420328) (xy 237.250428 78.544236) + (xy 237.207612 78.59945) (xy 237.141742 78.622751) (xy 237.073732 78.60674) (xy 237.025173 78.556502) + (xy 237.019572 78.544236) (xy 236.970941 78.420328) (xy 236.970942 78.420328) (xy 236.843545 78.199672) + (xy 236.801545 78.147006) (xy 236.150846 78.797705) (xy 236.143951 78.781058) (xy 236.056401 78.65003) + (xy 235.94497 78.538599) (xy 235.813942 78.451049) (xy 235.797293 78.444152) (xy 236.448185 77.79326) + (xy 236.287384 77.683628) (xy 236.287376 77.683623) (xy 236.057823 77.573078) (xy 236.057825 77.573078) + (xy 235.814347 77.497975) (xy 235.814341 77.497973) (xy 235.562404 77.46) (xy 235.307595 77.46) + (xy 235.055658 77.497973) (xy 235.055652 77.497975) (xy 234.812175 77.573078) (xy 234.582622 77.683625) + (xy 234.582609 77.683632) (xy 234.421813 77.793259) (xy 235.072706 78.444152) (xy 235.056058 78.451049) + (xy 234.92503 78.538599) (xy 234.813599 78.65003) (xy 234.726049 78.781058) (xy 234.719152 78.797706) + (xy 234.068452 78.147006) (xy 234.026457 78.199667) (xy 233.899058 78.420328) (xy 233.805973 78.657505) + (xy 233.805968 78.657522) (xy 233.749273 78.90592) (xy 233.730233 79.159995) (xy 219.705909 79.159995) + (xy 219.700597 79.106061) (xy 219.7 79.093907) (xy 219.7 77.606092) (xy 219.700597 77.593938) (xy 219.718018 77.417056) + (xy 219.722757 77.393232) (xy 219.772577 77.228994) (xy 219.781875 77.206549) (xy 219.862775 77.055195) + (xy 219.876272 77.034995) (xy 219.985149 76.902328) (xy 220.002328 76.885149) (xy 220.134995 76.776272) + (xy 220.155195 76.762775) (xy 220.306549 76.681875) (xy 220.328994 76.672577) (xy 220.493232 76.622757) + (xy 220.517056 76.618018) (xy 220.693939 76.600597) (xy 220.706093 76.6) (xy 220.986057 76.6) (xy 221.010246 76.602382) + (xy 221.056953 76.611673) (xy 221.082725 76.6168) (xy 221.082726 76.6168) (xy 221.639275 76.6168) + (xy 221.665046 76.611673) (xy 221.711753 76.602382) (xy 221.735943 76.6) (xy 222.256057 76.6) (xy 222.280246 76.602382) + (xy 222.326953 76.611673) (xy 222.352725 76.6168) (xy 222.352726 76.6168) (xy 222.909275 76.6168) + (xy 222.935046 76.611673) (xy 222.981753 76.602382) (xy 223.005943 76.6) (xy 223.526057 76.6) (xy 223.550246 76.602382) + (xy 223.596953 76.611673) (xy 223.622725 76.6168) (xy 223.622726 76.6168) (xy 224.179275 76.6168) + (xy 224.205046 76.611673) (xy 224.251753 76.602382) (xy 224.275943 76.6) (xy 224.796057 76.6) (xy 224.820246 76.602382) + (xy 224.866953 76.611673) (xy 224.892725 76.6168) (xy 224.892726 76.6168) (xy 225.449275 76.6168) + (xy 225.475046 76.611673) (xy 225.521753 76.602382) (xy 225.545943 76.6) (xy 226.066057 76.6) (xy 226.090246 76.602382) + (xy 226.136953 76.611673) (xy 226.162725 76.6168) (xy 226.162726 76.6168) (xy 226.719275 76.6168) + (xy 226.745046 76.611673) (xy 226.791753 76.602382) (xy 226.815943 76.6) (xy 227.299995 76.6) (xy 227.3 76.6) + (xy 227.313978 76.598623) (xy 227.350322 76.600409) (xy 227.432723 76.6168) (xy 227.432726 76.6168) + (xy 227.989276 76.6168) (xy 227.989277 76.616799) (xy 228.06234 76.602266) (xy 228.145201 76.546901) + (xy 228.200566 76.46404) (xy 228.2151 76.390974) (xy 228.2151 76.028544) (xy 228.223009 75.988785) + (xy 228.222111 75.988513) (xy 228.223878 75.982685) (xy 228.22388 75.982683) (xy 228.280785 75.79509) + (xy 228.3 75.6) (xy 228.3 72.098092) (xy 228.300591 72.086) (xy 228.317835 71.910013) (xy 228.32253 71.886288) + (xy 228.341271 71.824174) (xy 228.371847 71.722828) (xy 228.381057 71.700468) (xy 228.461169 71.549682) + (xy 228.474534 71.529548) (xy 228.582405 71.397166) (xy 228.599421 71.380014) (xy 228.730927 71.271096) + (xy 228.750951 71.25757) (xy 228.9011 71.176249) (xy 228.92338 71.166863) (xy 229.08645 71.116236) + (xy 229.110128 71.111354) (xy 229.285982 71.092702) (xy 229.298045 71.092015) (xy 234.162381 71.0531) + (xy 234.206701 71.060914) (xy 234.242886 71.074411) (xy 234.299515 71.080499) (xy 234.890484 71.080498) + (xy 234.947114 71.074411) (xy 235.002219 71.053857) (xy 235.044557 71.046043) (xy 238.999697 71.014402) ) ) ) @@ -159625,28 +163845,36 @@ (xy 133.879955 202.470677) (xy 133.813277 202.491554) (xy 133.811066 202.491574) (xy 133.496921 202.491574) (xy 133.429882 202.471889) (xy 133.428032 202.470677) (xy 133.397994 202.450607) (xy 133.397987 202.450604) (xy 133.324929 202.436072) (xy 133.324926 202.436072) (xy 132.675578 202.436072) (xy 132.675575 202.436072) - (xy 132.602516 202.450604) (xy 132.602512 202.450605) (xy 132.541198 202.491574) (xy 131.930254 202.491574) - (xy 131.930253 203.491569) (xy 131.930253 203.491577) (xy 131.930253 205.316577) (xy 131.930253 206.061573) - (xy 132.772144 206.061573) (xy 132.788248 206.062623) (xy 132.814644 206.06608) (xy 132.93027 206.081226) - (xy 132.961386 206.08952) (xy 133.086278 206.140967) (xy 133.114212 206.156997) (xy 133.221643 206.238878) - (xy 133.244506 206.261563) (xy 133.318531 206.357129) (xy 133.344022 206.422183) (xy 133.3445 206.433063) - (xy 133.3445 206.975908) (xy 133.324815 207.042947) (xy 133.319218 207.050946) (xy 133.250952 207.140755) - (xy 133.228041 207.163846) (xy 133.122168 207.245635) (xy 133.094037 207.261974) (xy 132.970541 207.31341) - (xy 132.939131 207.321871) (xy 132.814151 207.338408) (xy 132.798327 207.340502) (xy 132.782063 207.341573) - (xy 132.680253 207.341573) (xy 131.930252 207.341572) (xy 131.930252 207.971573) (xy 131.930252 207.971574) - (xy 131.910915 208.118443) (xy 131.902537 208.149709) (xy 131.852095 208.271488) (xy 131.835909 208.299523) - (xy 131.755665 208.404098) (xy 131.732777 208.426986) (xy 131.628202 208.50723) (xy 131.600167 208.523416) - (xy 131.478388 208.573858) (xy 131.447122 208.582236) (xy 131.325236 208.598283) (xy 131.308309 208.600512) - (xy 131.292126 208.601573) (xy 128.526345 208.601573) (xy 128.514191 208.600976) (xy 128.337317 208.583555) - (xy 128.313476 208.578813) (xy 128.149253 208.528997) (xy 128.126795 208.519694) (xy 127.975453 208.4388) - (xy 127.955241 208.425295) (xy 127.822585 208.316427) (xy 127.805397 208.299239) (xy 127.696532 208.166586) - (xy 127.683027 208.146374) (xy 127.60213 207.995025) (xy 127.592828 207.972568) (xy 127.543012 207.808349) - (xy 127.53827 207.784514) (xy 127.520849 207.607634) (xy 127.520252 207.59548) (xy 127.520252 205.316577) - (xy 127.520252 202.637644) (xy 127.520847 202.625532) (xy 127.538271 202.448629) (xy 127.54301 202.424805) - (xy 127.59283 202.260566) (xy 127.602126 202.238125) (xy 127.683031 202.086763) (xy 127.696525 202.066568) - (xy 127.805402 201.933901) (xy 127.822581 201.916722) (xy 127.955248 201.807845) (xy 127.975443 201.794351) - (xy 128.126805 201.713446) (xy 128.149246 201.70415) (xy 128.313485 201.65433) (xy 128.337309 201.649591) - (xy 128.514192 201.63217) (xy 128.526346 201.631573) (xy 133.427294 201.631573) + (xy 132.602516 202.450604) (xy 132.602512 202.450605) (xy 132.541228 202.491554) (xy 132.519651 202.505971) + (xy 132.464286 202.588832) (xy 132.464285 202.588833) (xy 132.457502 202.598986) (xy 132.453818 202.596524) + (xy 132.424797 202.632401) (xy 132.412724 202.639769) (xy 132.374685 202.660102) (xy 132.374683 202.660104) + (xy 132.223146 202.784466) (xy 132.098785 202.936002) (xy 132.098779 202.936009) (xy 132.006376 203.108884) + (xy 131.949467 203.296486) (xy 131.930253 203.491577) (xy 131.930253 205.316577) (xy 131.94893 205.482348) + (xy 131.990804 205.602016) (xy 132.004031 205.639816) (xy 132.092789 205.781073) (xy 132.210753 205.899037) + (xy 132.35201 205.987795) (xy 132.471675 206.029667) (xy 132.509477 206.042895) (xy 132.615492 206.054839) + (xy 132.675248 206.061572) (xy 132.675249 206.061573) (xy 132.675253 206.061573) (xy 132.772144 206.061573) + (xy 132.788248 206.062623) (xy 132.814644 206.06608) (xy 132.93027 206.081226) (xy 132.961386 206.08952) + (xy 133.086278 206.140967) (xy 133.114212 206.156997) (xy 133.221643 206.238878) (xy 133.244506 206.261563) + (xy 133.318531 206.357129) (xy 133.344022 206.422183) (xy 133.3445 206.433063) (xy 133.3445 206.975908) + (xy 133.324815 207.042947) (xy 133.319218 207.050946) (xy 133.250952 207.140755) (xy 133.228041 207.163846) + (xy 133.122168 207.245635) (xy 133.094037 207.261974) (xy 132.970541 207.31341) (xy 132.939131 207.321871) + (xy 132.814151 207.338408) (xy 132.798327 207.340502) (xy 132.782063 207.341573) (xy 132.560251 207.341573) + (xy 132.397197 207.363038) (xy 132.397195 207.363039) (xy 132.245252 207.425976) (xy 132.114773 207.526096) + (xy 132.014656 207.656571) (xy 132.014654 207.656573) (xy 131.95172 207.808512) (xy 131.951718 207.808517) + (xy 131.930252 207.971573) (xy 131.930252 207.971574) (xy 131.910915 208.118443) (xy 131.902537 208.149709) + (xy 131.852095 208.271488) (xy 131.835909 208.299523) (xy 131.755665 208.404098) (xy 131.732777 208.426986) + (xy 131.628202 208.50723) (xy 131.600167 208.523416) (xy 131.478388 208.573858) (xy 131.447122 208.582236) + (xy 131.325236 208.598283) (xy 131.308309 208.600512) (xy 131.292126 208.601573) (xy 128.526345 208.601573) + (xy 128.514191 208.600976) (xy 128.337317 208.583555) (xy 128.313476 208.578813) (xy 128.149253 208.528997) + (xy 128.126795 208.519694) (xy 127.975453 208.4388) (xy 127.955241 208.425295) (xy 127.822585 208.316427) + (xy 127.805397 208.299239) (xy 127.696532 208.166586) (xy 127.683027 208.146374) (xy 127.60213 207.995025) + (xy 127.592828 207.972568) (xy 127.543012 207.808349) (xy 127.53827 207.784514) (xy 127.520849 207.607634) + (xy 127.520252 207.59548) (xy 127.520252 205.316573) (xy 127.520252 202.637644) (xy 127.520847 202.625532) + (xy 127.538271 202.448629) (xy 127.54301 202.424805) (xy 127.59283 202.260566) (xy 127.602126 202.238125) + (xy 127.683031 202.086763) (xy 127.696525 202.066568) (xy 127.805402 201.933901) (xy 127.822581 201.916722) + (xy 127.955248 201.807845) (xy 127.975443 201.794351) (xy 128.126805 201.713446) (xy 128.149246 201.70415) + (xy 128.313485 201.65433) (xy 128.337309 201.649591) (xy 128.514192 201.63217) (xy 128.526346 201.631573) + (xy 133.427294 201.631573) ) ) ) @@ -159684,7 +163912,9 @@ (xy 116.520039 83.630556) (xy 116.520314 83.632826) (xy 116.520316 83.632834) (xy 116.551798 83.727424) (xy 116.586372 83.78814) (xy 116.61235 83.825556) (xy 116.612352 83.825557) (xy 116.612353 83.825559) (xy 116.649367 83.855385) (xy 116.689975 83.888108) (xy 116.733474 83.910861) (xy 116.783753 83.959375) - (xy 116.8 84.020737) (xy 116.8 85.279326) (xy 116.767633 85.287304) (xy 116.627762 85.360715) (xy 116.509516 85.465471) + (xy 116.8 84.020737) (xy 116.8 84.650006) (xy 116.821309 84.839137) (xy 116.82131 84.839142) (xy 116.884176 85.018802) + (xy 116.923335 85.081123) (xy 116.942335 85.14836) (xy 116.921967 85.215195) (xy 116.868699 85.260409) + (xy 116.848016 85.267492) (xy 116.767633 85.287304) (xy 116.627762 85.360715) (xy 116.509516 85.465471) (xy 116.419781 85.595475) (xy 116.41978 85.595476) (xy 116.363762 85.743181) (xy 116.344722 85.899999) (xy 116.344722 85.9) (xy 116.363762 86.056818) (xy 116.403752 86.16226) (xy 116.41978 86.204523) (xy 116.509517 86.33453) (xy 116.62776 86.439283) (xy 116.627762 86.439284) (xy 116.767634 86.512696) @@ -159694,17 +163924,19 @@ (xy 117.780472 85.650565) (xy 117.780472 85.650564) (xy 117.780475 85.650562) (xy 117.829911 85.564937) (xy 117.829911 85.564936) (xy 117.831607 85.561999) (xy 117.882175 85.513784) (xy 117.938994 85.5) (xy 118.039158 85.5) (xy 118.049336 85.5005) (xy 118.050326 85.5005) (xy 118.350664 85.5005) (xy 118.360842 85.5) - (xy 121.349993 85.5) (xy 121.35 85.5) (xy 121.9 85.5) (xy 121.9 84.95) (xy 121.91661 84.823831) - (xy 121.924987 84.79257) (xy 121.967439 84.69008) (xy 121.983621 84.662052) (xy 122.051158 84.574035) - (xy 122.074035 84.551158) (xy 122.162052 84.483621) (xy 122.19008 84.467439) (xy 122.29257 84.424987) - (xy 122.323831 84.41661) (xy 122.441941 84.40106) (xy 122.458126 84.4) (xy 123.329002 84.4) (xy 123.364996 84.405339) - (xy 123.419057 84.421738) (xy 123.443381 84.427831) (xy 123.467222 84.432573) (xy 123.485462 84.435278) - (xy 123.49202 84.436252) (xy 123.509984 84.438021) (xy 123.668895 84.453673) (xy 123.681404 84.454595) - (xy 123.693558 84.455192) (xy 123.706093 84.4555) (xy 123.706113 84.4555) (xy 124.193887 84.4555) - (xy 124.193907 84.4555) (xy 124.206442 84.455192) (xy 124.218596 84.454595) (xy 124.231105 84.453673) - (xy 124.407978 84.436252) (xy 124.432777 84.432573) (xy 124.456618 84.427831) (xy 124.480942 84.421738) - (xy 124.535003 84.405339) (xy 124.570997 84.4) (xy 125.000001 84.4) (xy 125.3 84.4) (xy 125.3 84.1) - (xy 125.318025 84.009379) (xy 125.336534 83.964693) (xy 125.374168 83.90837) (xy 125.40837 83.874168) + (xy 121.349993 85.5) (xy 121.35 85.5) (xy 121.49235 85.481259) (xy 121.625 85.426314) (xy 121.738909 85.338909) + (xy 121.826314 85.225) (xy 121.881259 85.09235) (xy 121.9 84.95) (xy 121.91661 84.823831) (xy 121.924987 84.79257) + (xy 121.967439 84.69008) (xy 121.983621 84.662052) (xy 122.051158 84.574035) (xy 122.074035 84.551158) + (xy 122.162052 84.483621) (xy 122.19008 84.467439) (xy 122.29257 84.424987) (xy 122.323831 84.41661) + (xy 122.441941 84.40106) (xy 122.458126 84.4) (xy 123.329002 84.4) (xy 123.364996 84.405339) (xy 123.419057 84.421738) + (xy 123.443381 84.427831) (xy 123.467222 84.432573) (xy 123.485462 84.435278) (xy 123.49202 84.436252) + (xy 123.509984 84.438021) (xy 123.668895 84.453673) (xy 123.681404 84.454595) (xy 123.693558 84.455192) + (xy 123.706093 84.4555) (xy 123.706113 84.4555) (xy 124.193887 84.4555) (xy 124.193907 84.4555) + (xy 124.206442 84.455192) (xy 124.218596 84.454595) (xy 124.231105 84.453673) (xy 124.407978 84.436252) + (xy 124.432777 84.432573) (xy 124.456618 84.427831) (xy 124.480942 84.421738) (xy 124.535003 84.405339) + (xy 124.570997 84.4) (xy 125.000001 84.4) (xy 125.000002 84.399999) (xy 125.038612 84.392319) (xy 125.114802 84.377165) + (xy 125.114802 84.377164) (xy 125.114805 84.377164) (xy 125.212132 84.312132) (xy 125.277164 84.214805) + (xy 125.3 84.1) (xy 125.318025 84.009379) (xy 125.336534 83.964693) (xy 125.374168 83.90837) (xy 125.40837 83.874168) (xy 125.464693 83.836534) (xy 125.509379 83.818025) (xy 125.588028 83.802381) (xy 125.612211 83.8) (xy 126.793039 83.8) (xy 126.806922 83.80078) (xy 126.857192 83.806444) (xy 126.986382 83.821) (xy 127.013453 83.827179) (xy 127.177309 83.884515) (xy 127.202326 83.896562) (xy 127.349314 83.98892) (xy 127.371021 84.006232) @@ -159713,50 +163945,55 @@ (xy 127.678999 84.886382) (xy 127.67282 84.913453) (xy 127.615484 85.077309) (xy 127.603437 85.102326) (xy 127.51108 85.249312) (xy 127.493767 85.271021) (xy 127.371021 85.393767) (xy 127.349312 85.41108) (xy 127.202326 85.503437) (xy 127.177309 85.515484) (xy 127.013453 85.57282) (xy 126.986382 85.578999) - (xy 126.806923 85.59922) (xy 126.793039 85.6) (xy 125.7 85.6) (xy 125.7 86.6) (xy 125.7 86.600003) - (xy 125.7 88.240243) (xy 125.698473 88.259642) (xy 125.685942 88.338757) (xy 125.673954 88.375653) - (xy 125.642071 88.438227) (xy 125.619267 88.469613) (xy 125.569613 88.519267) (xy 125.538227 88.542071) - (xy 125.475653 88.573954) (xy 125.438756 88.585942) (xy 125.35 88.6) (xy 125 88.6) (xy 125 88.918728) - (xy 124.977506 88.966178) (xy 124.941259 88.994129) (xy 124.88666 89.021949) (xy 124.886653 89.021954) - (xy 124.796955 89.111652) (xy 124.796952 89.111657) (xy 124.739353 89.224698) (xy 124.724501 89.318475) - (xy 124.724501 89.681517) (xy 124.735293 89.749657) (xy 124.739355 89.775304) (xy 124.796951 89.888342) - (xy 124.796953 89.888344) (xy 124.796955 89.888347) (xy 124.886653 89.978045) (xy 124.886657 89.978048) - (xy 124.886659 89.97805) (xy 124.932296 90.001303) (xy 124.983091 90.049277) (xy 125 90.111787) - (xy 125 90.693905) (xy 124.999403 90.70606) (xy 124.989623 90.80535) (xy 124.963462 90.870137) (xy 124.922516 90.903679) - (xy 124.886657 90.92195) (xy 124.796955 91.011652) (xy 124.796952 91.011657) (xy 124.739353 91.124698) - (xy 124.724501 91.218475) (xy 124.724501 91.334184) (xy 124.704816 91.401223) (xy 124.679166 91.430037) - (xy 124.56501 91.523722) (xy 124.544798 91.537227) (xy 124.393456 91.618121) (xy 124.370998 91.627424) - (xy 124.206775 91.67724) (xy 124.182934 91.681982) (xy 124.006061 91.699403) (xy 123.993907 91.7) - (xy 122.996683 91.7) (xy 122.929644 91.680315) (xy 122.922813 91.675595) (xy 122.906982 91.663853) - (xy 122.906934 91.663819) (xy 122.886755 91.650336) (xy 122.865232 91.637437) (xy 122.834151 91.620824) - (xy 122.713894 91.556546) (xy 122.713871 91.556535) (xy 122.691241 91.545831) (xy 122.691238 91.54583) - (xy 122.66879 91.53653) (xy 122.668784 91.536528) (xy 122.645177 91.52808) (xy 122.541518 91.496636) - (xy 122.480936 91.478259) (xy 122.480927 91.478256) (xy 122.480899 91.478249) (xy 122.456627 91.472169) - (xy 122.456612 91.472166) (xy 122.456608 91.472165) (xy 122.43278 91.467426) (xy 122.432756 91.467421) - (xy 122.408009 91.463751) (xy 122.407985 91.463748) (xy 122.407984 91.463748) (xy 122.40798 91.463747) - (xy 122.407958 91.463745) (xy 122.231086 91.446325) (xy 122.218618 91.445406) (xy 122.20645 91.444808) - (xy 122.20286 91.44472) (xy 122.193907 91.4445) (xy 122.193887 91.4445) (xy 116.971121 91.4445) - (xy 116.904082 91.424815) (xy 116.858327 91.372011) (xy 116.849505 91.344697) (xy 116.832567 91.259542) - (xy 116.818029 91.211616) (xy 116.799515 91.166917) (xy 116.775902 91.122738) (xy 116.738273 91.066423) - (xy 116.738271 91.06642) (xy 116.738268 91.066416) (xy 116.706506 91.027716) (xy 116.706499 91.027707) - (xy 116.672292 90.9935) (xy 116.665201 90.98768) (xy 116.633582 90.96173) (xy 116.633578 90.961727) - (xy 116.577264 90.924099) (xy 116.577261 90.924097) (xy 116.57726 90.924096) (xy 116.577258 90.924095) - (xy 116.533083 90.900483) (xy 116.533076 90.90048) (xy 116.533074 90.900479) (xy 116.533069 90.900477) - (xy 116.488394 90.881972) (xy 116.488384 90.881968) (xy 116.440467 90.867434) (xy 116.361813 90.851789) - (xy 116.337013 90.848111) (xy 116.312831 90.84573) (xy 116.303988 90.845295) (xy 116.287789 90.8445) - (xy 113.506093 90.8445) (xy 113.497448 90.844712) (xy 113.493549 90.844808) (xy 113.481381 90.845406) - (xy 113.468909 90.846326) (xy 113.468907 90.846326) (xy 113.468896 90.846327) (xy 113.413901 90.851743) - (xy 113.292027 90.863746) (xy 113.292 90.863749) (xy 113.267214 90.867427) (xy 113.267212 90.867427) - (xy 113.243392 90.872165) (xy 113.243382 90.872167) (xy 113.219079 90.878254) (xy 113.219057 90.87826) - (xy 113.054819 90.92808) (xy 113.041204 90.932952) (xy 112.971451 90.937) (xy 112.920769 90.912052) - (xy 112.910566 90.903679) (xy 112.802333 90.814854) (xy 112.785145 90.797666) (xy 112.676277 90.66501) - (xy 112.662772 90.644798) (xy 112.581878 90.493456) (xy 112.572575 90.470998) (xy 112.522757 90.306769) - (xy 112.518018 90.282941) (xy 112.500597 90.106061) (xy 112.5 90.093907) (xy 112.5 83.906092) (xy 112.500597 83.893938) - (xy 112.504394 83.855385) (xy 112.518018 83.717056) (xy 112.522757 83.693232) (xy 112.572577 83.528994) - (xy 112.581875 83.506549) (xy 112.662775 83.355195) (xy 112.676272 83.334995) (xy 112.785149 83.202328) - (xy 112.802328 83.185149) (xy 112.934995 83.076272) (xy 112.955195 83.062775) (xy 113.106549 82.981875) - (xy 113.128994 82.972577) (xy 113.293232 82.922757) (xy 113.317056 82.918018) (xy 113.493939 82.900597) - (xy 113.506093 82.9) (xy 116.238159 82.9) + (xy 126.806923 85.59922) (xy 126.793039 85.6) (xy 126.7 85.6) (xy 126.651844 85.604743) (xy 126.504911 85.619214) + (xy 126.394149 85.652813) (xy 126.317317 85.67612) (xy 126.317314 85.676121) (xy 126.317312 85.676122) + (xy 126.317309 85.676123) (xy 126.144435 85.768526) (xy 126.144428 85.768531) (xy 125.992892 85.892892) + (xy 125.868531 86.044428) (xy 125.868526 86.044435) (xy 125.776123 86.217309) (xy 125.776122 86.217312) + (xy 125.719214 86.404911) (xy 125.7 86.600003) (xy 125.7 88.240243) (xy 125.698473 88.259642) (xy 125.685942 88.338757) + (xy 125.673954 88.375653) (xy 125.642071 88.438227) (xy 125.619267 88.469613) (xy 125.569613 88.519267) + (xy 125.538227 88.542071) (xy 125.475653 88.573954) (xy 125.438756 88.585942) (xy 125.35 88.6) (xy 125.349999 88.6) + (xy 125.241847 88.617128) (xy 125.241846 88.617128) (xy 125.176798 88.650272) (xy 125.144275 88.666844) + (xy 125.144274 88.666845) (xy 125.144269 88.666848) (xy 125.066848 88.744269) (xy 125.066845 88.744274) + (xy 125.017128 88.841846) (xy 125.017128 88.841847) (xy 125.007436 88.903043) (xy 124.977506 88.966178) + (xy 124.941259 88.994129) (xy 124.88666 89.021949) (xy 124.886653 89.021954) (xy 124.796955 89.111652) + (xy 124.796952 89.111657) (xy 124.739353 89.224698) (xy 124.724501 89.318475) (xy 124.724501 89.681517) + (xy 124.735293 89.749657) (xy 124.739355 89.775304) (xy 124.796951 89.888342) (xy 124.796953 89.888344) + (xy 124.796955 89.888347) (xy 124.886653 89.978045) (xy 124.886657 89.978048) (xy 124.886659 89.97805) + (xy 124.932296 90.001303) (xy 124.983091 90.049277) (xy 125 90.111787) (xy 125 90.693905) (xy 124.999403 90.70606) + (xy 124.989623 90.80535) (xy 124.963462 90.870137) (xy 124.922516 90.903679) (xy 124.886657 90.92195) + (xy 124.796955 91.011652) (xy 124.796952 91.011657) (xy 124.739353 91.124698) (xy 124.724501 91.218475) + (xy 124.724501 91.334184) (xy 124.704816 91.401223) (xy 124.679166 91.430037) (xy 124.56501 91.523722) + (xy 124.544798 91.537227) (xy 124.393456 91.618121) (xy 124.370998 91.627424) (xy 124.206775 91.67724) + (xy 124.182934 91.681982) (xy 124.006061 91.699403) (xy 123.993907 91.7) (xy 122.996683 91.7) (xy 122.929644 91.680315) + (xy 122.922813 91.675595) (xy 122.906982 91.663853) (xy 122.906934 91.663819) (xy 122.886755 91.650336) + (xy 122.865232 91.637437) (xy 122.834151 91.620824) (xy 122.713894 91.556546) (xy 122.713871 91.556535) + (xy 122.691241 91.545831) (xy 122.691238 91.54583) (xy 122.66879 91.53653) (xy 122.668784 91.536528) + (xy 122.645177 91.52808) (xy 122.541518 91.496636) (xy 122.480936 91.478259) (xy 122.480927 91.478256) + (xy 122.480899 91.478249) (xy 122.456627 91.472169) (xy 122.456612 91.472166) (xy 122.456608 91.472165) + (xy 122.43278 91.467426) (xy 122.432756 91.467421) (xy 122.408009 91.463751) (xy 122.407985 91.463748) + (xy 122.407984 91.463748) (xy 122.40798 91.463747) (xy 122.407958 91.463745) (xy 122.231086 91.446325) + (xy 122.218618 91.445406) (xy 122.20645 91.444808) (xy 122.20286 91.44472) (xy 122.193907 91.4445) + (xy 122.193887 91.4445) (xy 116.971121 91.4445) (xy 116.904082 91.424815) (xy 116.858327 91.372011) + (xy 116.849505 91.344697) (xy 116.832567 91.259542) (xy 116.818029 91.211616) (xy 116.799515 91.166917) + (xy 116.775902 91.122738) (xy 116.738273 91.066423) (xy 116.738271 91.06642) (xy 116.738268 91.066416) + (xy 116.706506 91.027716) (xy 116.706499 91.027707) (xy 116.672292 90.9935) (xy 116.665201 90.98768) + (xy 116.633582 90.96173) (xy 116.633578 90.961727) (xy 116.577264 90.924099) (xy 116.577261 90.924097) + (xy 116.57726 90.924096) (xy 116.577258 90.924095) (xy 116.533083 90.900483) (xy 116.533076 90.90048) + (xy 116.533074 90.900479) (xy 116.533069 90.900477) (xy 116.488394 90.881972) (xy 116.488384 90.881968) + (xy 116.440467 90.867434) (xy 116.361813 90.851789) (xy 116.337013 90.848111) (xy 116.312831 90.84573) + (xy 116.303988 90.845295) (xy 116.287789 90.8445) (xy 113.506093 90.8445) (xy 113.497448 90.844712) + (xy 113.493549 90.844808) (xy 113.481381 90.845406) (xy 113.468909 90.846326) (xy 113.468907 90.846326) + (xy 113.468896 90.846327) (xy 113.413901 90.851743) (xy 113.292027 90.863746) (xy 113.292 90.863749) + (xy 113.267214 90.867427) (xy 113.267212 90.867427) (xy 113.243392 90.872165) (xy 113.243382 90.872167) + (xy 113.219079 90.878254) (xy 113.219057 90.87826) (xy 113.054819 90.92808) (xy 113.041204 90.932952) + (xy 112.971451 90.937) (xy 112.920769 90.912052) (xy 112.910566 90.903679) (xy 112.802333 90.814854) + (xy 112.785145 90.797666) (xy 112.676277 90.66501) (xy 112.662772 90.644798) (xy 112.581878 90.493456) + (xy 112.572575 90.470998) (xy 112.522757 90.306769) (xy 112.518018 90.282941) (xy 112.500597 90.106061) + (xy 112.5 90.093907) (xy 112.5 83.906092) (xy 112.500597 83.893938) (xy 112.504394 83.855385) (xy 112.518018 83.717056) + (xy 112.522757 83.693232) (xy 112.572577 83.528994) (xy 112.581875 83.506549) (xy 112.662775 83.355195) + (xy 112.676272 83.334995) (xy 112.785149 83.202328) (xy 112.802328 83.185149) (xy 112.934995 83.076272) + (xy 112.955195 83.062775) (xy 113.106549 82.981875) (xy 113.128994 82.972577) (xy 113.293232 82.922757) + (xy 113.317056 82.918018) (xy 113.493939 82.900597) (xy 113.506093 82.9) (xy 116.238159 82.9) ) ) ) @@ -159844,62 +164081,62 @@ (xy 275.952394 163.451657) (xy 275.974562 163.466184) (xy 275.997671 163.485149) (xy 276.014855 163.502334) (xy 276.123722 163.634989) (xy 276.137227 163.655201) (xy 276.218121 163.806543) (xy 276.227424 163.829001) (xy 276.27724 163.993224) (xy 276.281982 164.017065) (xy 276.299403 164.193938) (xy 276.3 164.206092) - (xy 276.3 175.1) (xy 271.3 175.1) (xy 271.3 174.852962) (xy 271.314079 174.835807) (xy 271.32315 174.824075) - (xy 271.330559 174.813896) (xy 271.331611 174.812451) (xy 271.331612 174.812449) (xy 271.370188 174.734074) - (xy 271.386328 174.679105) (xy 271.386327 174.679104) (xy 271.39684 174.643301) (xy 271.397454 174.638242) - (xy 271.397455 174.63824) (xy 271.411844 174.51972) (xy 271.418998 174.490697) (xy 271.442335 174.429161) - (xy 271.456227 174.402695) (xy 271.460275 174.396831) (xy 271.482958 174.363969) (xy 271.512591 174.30672) - (xy 271.533943 174.248437) (xy 271.548305 174.185594) (xy 271.553672 174.131109) (xy 271.554595 174.118595) - (xy 271.555192 174.106439) (xy 271.5555 174.093906) (xy 271.5555 173.759381) (xy 271.555466 173.755192) - (xy 271.555399 173.751106) (xy 271.542578 173.675272) (xy 271.520695 173.608919) (xy 271.488322 173.543802) - (xy 271.456225 173.497301) (xy 271.442335 173.470835) (xy 271.418998 173.409299) (xy 271.411844 173.380276) - (xy 271.403911 173.314938) (xy 271.403911 173.285059) (xy 271.411844 173.219715) (xy 271.418994 173.190706) - (xy 271.44234 173.12915) (xy 271.456226 173.102694) (xy 271.488322 173.056197) (xy 271.490687 173.05271) - (xy 271.492952 173.04931) (xy 271.525465 172.979641) (xy 271.54515 172.912602) (xy 271.5555 172.840617) - (xy 271.5555 172.459381) (xy 271.555466 172.455192) (xy 271.555399 172.451106) (xy 271.542578 172.375272) - (xy 271.520695 172.308919) (xy 271.488322 172.243802) (xy 271.456225 172.197301) (xy 271.442335 172.170835) - (xy 271.418998 172.109299) (xy 271.411844 172.080276) (xy 271.403911 172.014938) (xy 271.403911 171.985059) - (xy 271.411844 171.919715) (xy 271.418994 171.890706) (xy 271.44234 171.82915) (xy 271.456226 171.802694) - (xy 271.488322 171.756197) (xy 271.490687 171.75271) (xy 271.492952 171.74931) (xy 271.525465 171.679641) - (xy 271.54515 171.612602) (xy 271.5555 171.540617) (xy 271.5555 171.159381) (xy 271.555466 171.155192) - (xy 271.555399 171.151106) (xy 271.542578 171.075272) (xy 271.520695 171.008919) (xy 271.488322 170.943802) - (xy 271.456225 170.897301) (xy 271.442335 170.870835) (xy 271.418998 170.809299) (xy 271.411844 170.780276) - (xy 271.403911 170.714938) (xy 271.403911 170.685059) (xy 271.411844 170.619715) (xy 271.418994 170.590706) - (xy 271.44234 170.52915) (xy 271.456226 170.502694) (xy 271.488322 170.456197) (xy 271.490687 170.45271) - (xy 271.492952 170.44931) (xy 271.525465 170.379641) (xy 271.54515 170.312602) (xy 271.5555 170.240617) - (xy 271.5555 169.859381) (xy 271.555466 169.855192) (xy 271.555399 169.851106) (xy 271.542578 169.775272) - (xy 271.520695 169.708919) (xy 271.488322 169.643802) (xy 271.456225 169.597301) (xy 271.442335 169.570835) - (xy 271.418998 169.509299) (xy 271.411844 169.480276) (xy 271.403911 169.414938) (xy 271.403911 169.385059) - (xy 271.411844 169.319715) (xy 271.418994 169.290706) (xy 271.44234 169.22915) (xy 271.456226 169.202694) - (xy 271.488322 169.156197) (xy 271.490687 169.15271) (xy 271.492952 169.14931) (xy 271.525465 169.079641) - (xy 271.54515 169.012602) (xy 271.5555 168.940617) (xy 271.5555 168.559381) (xy 271.555466 168.555192) - (xy 271.555399 168.551106) (xy 271.542578 168.475272) (xy 271.520695 168.408919) (xy 271.488322 168.343802) - (xy 271.456225 168.297301) (xy 271.442335 168.270835) (xy 271.418998 168.209299) (xy 271.411844 168.180276) - (xy 271.403911 168.114938) (xy 271.403911 168.085059) (xy 271.411844 168.019715) (xy 271.418994 167.990706) - (xy 271.44234 167.92915) (xy 271.456226 167.902694) (xy 271.488322 167.856197) (xy 271.490687 167.85271) - (xy 271.492952 167.84931) (xy 271.525465 167.779641) (xy 271.54515 167.712602) (xy 271.5555 167.640617) - (xy 271.5555 167.259381) (xy 271.555466 167.255192) (xy 271.555399 167.251106) (xy 271.542578 167.175272) - (xy 271.520695 167.108919) (xy 271.488322 167.043802) (xy 271.456225 166.997301) (xy 271.442335 166.970835) - (xy 271.418998 166.909299) (xy 271.411844 166.880276) (xy 271.403911 166.814938) (xy 271.403911 166.785059) - (xy 271.411844 166.719715) (xy 271.418994 166.690706) (xy 271.44234 166.62915) (xy 271.456226 166.602694) - (xy 271.488322 166.556197) (xy 271.490687 166.55271) (xy 271.492952 166.54931) (xy 271.525465 166.479641) - (xy 271.54515 166.412602) (xy 271.5555 166.340617) (xy 271.5555 165.959381) (xy 271.555466 165.955192) - (xy 271.555399 165.951106) (xy 271.542578 165.875272) (xy 271.520695 165.808919) (xy 271.488322 165.743802) - (xy 271.456225 165.697301) (xy 271.442335 165.670835) (xy 271.418998 165.609299) (xy 271.411844 165.580276) - (xy 271.403911 165.514938) (xy 271.403911 165.485059) (xy 271.411844 165.419715) (xy 271.418994 165.390706) - (xy 271.44234 165.32915) (xy 271.456226 165.302694) (xy 271.488322 165.256197) (xy 271.490687 165.25271) - (xy 271.492952 165.24931) (xy 271.525465 165.179641) (xy 271.54515 165.112602) (xy 271.5555 165.040617) - (xy 271.5555 164.659381) (xy 271.555466 164.655192) (xy 271.555399 164.651106) (xy 271.542578 164.575272) - (xy 271.520695 164.508919) (xy 271.488322 164.443802) (xy 271.456225 164.397301) (xy 271.442335 164.370835) - (xy 271.418998 164.309299) (xy 271.411844 164.280276) (xy 271.403911 164.214938) (xy 271.403911 164.185059) - (xy 271.411844 164.119715) (xy 271.418994 164.090706) (xy 271.442338 164.029155) (xy 271.456224 164.002698) - (xy 271.510273 163.924397) (xy 271.536051 163.877033) (xy 271.54772 163.818367) (xy 271.5555 163.779259) - (xy 271.5555 163.582824) (xy 271.575185 163.515785) (xy 271.583628 163.504182) (xy 271.585131 163.50235) - (xy 271.602367 163.485117) (xy 271.60304 163.484564) (xy 271.604198 163.483616) (xy 271.668519 163.456328) - (xy 271.682825 163.4555) (xy 271.849031 163.4555) (xy 271.849783 163.45547) (xy 271.869003 163.454718) - (xy 271.964959 163.427685) (xy 272.043266 163.36599) (xy 272.092002 163.279023) (xy 272.092002 163.27902) - (xy 272.095091 163.273509) (xy 272.145036 163.224649) (xy 272.191107 163.210725) (xy 272.27941 163.202027) - (xy 272.29394 163.200597) (xy 272.306093 163.2) (xy 272.464069 163.2) + (xy 276.3 175.1) (xy 275.3 175.1) (xy 272.3 175.1) (xy 271.3 175.1) (xy 271.3 174.852962) (xy 271.314079 174.835807) + (xy 271.32315 174.824075) (xy 271.330559 174.813896) (xy 271.331611 174.812451) (xy 271.331612 174.812449) + (xy 271.370188 174.734074) (xy 271.386328 174.679105) (xy 271.386327 174.679104) (xy 271.39684 174.643301) + (xy 271.397454 174.638242) (xy 271.397455 174.63824) (xy 271.411844 174.51972) (xy 271.418998 174.490697) + (xy 271.442335 174.429161) (xy 271.456227 174.402695) (xy 271.460275 174.396831) (xy 271.482958 174.363969) + (xy 271.512591 174.30672) (xy 271.533943 174.248437) (xy 271.548305 174.185594) (xy 271.553672 174.131109) + (xy 271.554595 174.118595) (xy 271.555192 174.106439) (xy 271.5555 174.093906) (xy 271.5555 173.759381) + (xy 271.555466 173.755192) (xy 271.555399 173.751106) (xy 271.542578 173.675272) (xy 271.520695 173.608919) + (xy 271.488322 173.543802) (xy 271.456225 173.497301) (xy 271.442335 173.470835) (xy 271.418998 173.409299) + (xy 271.411844 173.380276) (xy 271.403911 173.314938) (xy 271.403911 173.285059) (xy 271.411844 173.219715) + (xy 271.418994 173.190706) (xy 271.44234 173.12915) (xy 271.456226 173.102694) (xy 271.488322 173.056197) + (xy 271.490687 173.05271) (xy 271.492952 173.04931) (xy 271.525465 172.979641) (xy 271.54515 172.912602) + (xy 271.5555 172.840617) (xy 271.5555 172.459381) (xy 271.555466 172.455192) (xy 271.555399 172.451106) + (xy 271.542578 172.375272) (xy 271.520695 172.308919) (xy 271.488322 172.243802) (xy 271.456225 172.197301) + (xy 271.442335 172.170835) (xy 271.418998 172.109299) (xy 271.411844 172.080276) (xy 271.403911 172.014938) + (xy 271.403911 171.985059) (xy 271.411844 171.919715) (xy 271.418994 171.890706) (xy 271.44234 171.82915) + (xy 271.456226 171.802694) (xy 271.488322 171.756197) (xy 271.490687 171.75271) (xy 271.492952 171.74931) + (xy 271.525465 171.679641) (xy 271.54515 171.612602) (xy 271.5555 171.540617) (xy 271.5555 171.159381) + (xy 271.555466 171.155192) (xy 271.555399 171.151106) (xy 271.542578 171.075272) (xy 271.520695 171.008919) + (xy 271.488322 170.943802) (xy 271.456225 170.897301) (xy 271.442335 170.870835) (xy 271.418998 170.809299) + (xy 271.411844 170.780276) (xy 271.403911 170.714938) (xy 271.403911 170.685059) (xy 271.411844 170.619715) + (xy 271.418994 170.590706) (xy 271.44234 170.52915) (xy 271.456226 170.502694) (xy 271.488322 170.456197) + (xy 271.490687 170.45271) (xy 271.492952 170.44931) (xy 271.525465 170.379641) (xy 271.54515 170.312602) + (xy 271.5555 170.240617) (xy 271.5555 169.859381) (xy 271.555466 169.855192) (xy 271.555399 169.851106) + (xy 271.542578 169.775272) (xy 271.520695 169.708919) (xy 271.488322 169.643802) (xy 271.456225 169.597301) + (xy 271.442335 169.570835) (xy 271.418998 169.509299) (xy 271.411844 169.480276) (xy 271.403911 169.414938) + (xy 271.403911 169.385059) (xy 271.411844 169.319715) (xy 271.418994 169.290706) (xy 271.44234 169.22915) + (xy 271.456226 169.202694) (xy 271.488322 169.156197) (xy 271.490687 169.15271) (xy 271.492952 169.14931) + (xy 271.525465 169.079641) (xy 271.54515 169.012602) (xy 271.5555 168.940617) (xy 271.5555 168.559381) + (xy 271.555466 168.555192) (xy 271.555399 168.551106) (xy 271.542578 168.475272) (xy 271.520695 168.408919) + (xy 271.488322 168.343802) (xy 271.456225 168.297301) (xy 271.442335 168.270835) (xy 271.418998 168.209299) + (xy 271.411844 168.180276) (xy 271.403911 168.114938) (xy 271.403911 168.085059) (xy 271.411844 168.019715) + (xy 271.418994 167.990706) (xy 271.44234 167.92915) (xy 271.456226 167.902694) (xy 271.488322 167.856197) + (xy 271.490687 167.85271) (xy 271.492952 167.84931) (xy 271.525465 167.779641) (xy 271.54515 167.712602) + (xy 271.5555 167.640617) (xy 271.5555 167.259381) (xy 271.555466 167.255192) (xy 271.555399 167.251106) + (xy 271.542578 167.175272) (xy 271.520695 167.108919) (xy 271.488322 167.043802) (xy 271.456225 166.997301) + (xy 271.442335 166.970835) (xy 271.418998 166.909299) (xy 271.411844 166.880276) (xy 271.403911 166.814938) + (xy 271.403911 166.785059) (xy 271.411844 166.719715) (xy 271.418994 166.690706) (xy 271.44234 166.62915) + (xy 271.456226 166.602694) (xy 271.488322 166.556197) (xy 271.490687 166.55271) (xy 271.492952 166.54931) + (xy 271.525465 166.479641) (xy 271.54515 166.412602) (xy 271.5555 166.340617) (xy 271.5555 165.959381) + (xy 271.555466 165.955192) (xy 271.555399 165.951106) (xy 271.542578 165.875272) (xy 271.520695 165.808919) + (xy 271.488322 165.743802) (xy 271.456225 165.697301) (xy 271.442335 165.670835) (xy 271.418998 165.609299) + (xy 271.411844 165.580276) (xy 271.403911 165.514938) (xy 271.403911 165.485059) (xy 271.411844 165.419715) + (xy 271.418994 165.390706) (xy 271.44234 165.32915) (xy 271.456226 165.302694) (xy 271.488322 165.256197) + (xy 271.490687 165.25271) (xy 271.492952 165.24931) (xy 271.525465 165.179641) (xy 271.54515 165.112602) + (xy 271.5555 165.040617) (xy 271.5555 164.659381) (xy 271.555466 164.655192) (xy 271.555399 164.651106) + (xy 271.542578 164.575272) (xy 271.520695 164.508919) (xy 271.488322 164.443802) (xy 271.456225 164.397301) + (xy 271.442335 164.370835) (xy 271.418998 164.309299) (xy 271.411844 164.280276) (xy 271.403911 164.214938) + (xy 271.403911 164.185059) (xy 271.411844 164.119715) (xy 271.418998 164.090698) (xy 271.442336 164.029163) + (xy 271.456223 164.002701) (xy 271.49362 163.948522) (xy 271.513425 163.926167) (xy 271.568355 163.877502) + (xy 271.582266 163.866837) (xy 271.61497 163.845253) (xy 271.653195 163.814123) (xy 271.689358 163.778096) + (xy 271.76669 163.683865) (xy 271.783869 163.666686) (xy 271.877626 163.589742) (xy 271.897831 163.576242) + (xy 271.911277 163.569056) (xy 271.943733 163.548426) (xy 271.973555 163.526151) (xy 271.982326 163.519297) + (xy 272.045732 163.442369) (xy 272.078799 163.380819) (xy 272.096693 163.338934) (xy 272.099221 163.317631) + (xy 272.126667 163.253382) (xy 272.184495 163.214168) (xy 272.210197 163.208844) (xy 272.293939 163.200597) + (xy 272.306093 163.2) (xy 272.464069 163.2) ) ) ) @@ -159937,7 +164174,10 @@ (xy 132.814493 197.08321) (xy 132.831806 197.104919) (xy 132.86077 197.151015) (xy 132.87977 197.218252) (xy 132.879542 197.222833) (xy 132.879635 197.222838) (xy 132.8795 197.225723) (xy 132.8795 197.884269) (xy 132.882353 197.914699) (xy 132.882353 197.914701) (xy 132.927206 198.04288) (xy 132.927207 198.042882) - (xy 133 198.141513) (xy 133 198.4) (xy 133.7 198.4) (xy 133.819057 198.413382) (xy 133.883479 198.440431) + (xy 133.00785 198.15215) (xy 133.117118 198.232793) (xy 133.159845 198.247744) (xy 133.245299 198.277646) + (xy 133.27573 198.2805) (xy 133.275734 198.2805) (xy 133.280699 198.2805) (xy 133.346671 198.299506) + (xy 133.396281 198.330678) (xy 133.544235 198.38245) (xy 133.54424 198.38245) (xy 133.544242 198.382451) + (xy 133.699982 198.399998) (xy 133.7 198.4) (xy 133.819057 198.413382) (xy 133.883479 198.440431) (xy 133.892888 198.448925) (xy 134.238433 198.79447) (xy 134.271918 198.855793) (xy 134.274752 198.882151) (xy 134.274752 200.866245) (xy 134.279056 200.887885) (xy 134.272827 200.957477) (xy 134.229963 201.012654) (xy 134.181697 201.033679) (xy 134.174228 201.035169) (xy 134.125772 201.03518) (xy 134.122774 201.034584) @@ -160005,32 +164245,38 @@ (xy 172.37724 72.806775) (xy 172.327424 72.970998) (xy 172.318121 72.993456) (xy 172.237227 73.144798) (xy 172.223722 73.16501) (xy 172.114854 73.297666) (xy 172.097666 73.314854) (xy 171.96501 73.423722) (xy 171.944798 73.437227) (xy 171.793456 73.518121) (xy 171.770998 73.527424) (xy 171.606775 73.57724) - (xy 171.582934 73.581982) (xy 171.406061 73.599403) (xy 171.393907 73.6) (xy 167.1 73.6) (xy 167.1 74.6) - (xy 167.1 74.600003) (xy 167.1 78.993907) (xy 167.099403 79.006061) (xy 167.081982 79.182934) (xy 167.07724 79.206775) - (xy 167.027424 79.370998) (xy 167.018121 79.393456) (xy 166.937227 79.544798) (xy 166.923722 79.56501) - (xy 166.814854 79.697666) (xy 166.797666 79.714854) (xy 166.66501 79.823722) (xy 166.644798 79.837227) - (xy 166.493456 79.918121) (xy 166.470998 79.927424) (xy 166.306775 79.97724) (xy 166.282934 79.981982) - (xy 166.106061 79.999403) (xy 166.093907 80) (xy 166.003828 80) (xy 165.950962 79.989973) (xy 165.938566 79.982693) + (xy 171.582934 73.581982) (xy 171.406061 73.599403) (xy 171.393907 73.6) (xy 168.1 73.6) (xy 168.051844 73.604743) + (xy 167.904911 73.619214) (xy 167.794149 73.652813) (xy 167.717317 73.67612) (xy 167.717314 73.676121) + (xy 167.717312 73.676122) (xy 167.717309 73.676123) (xy 167.544435 73.768526) (xy 167.544428 73.768531) + (xy 167.392892 73.892892) (xy 167.268531 74.044428) (xy 167.268526 74.044435) (xy 167.176123 74.217309) + (xy 167.176122 74.217312) (xy 167.119214 74.404911) (xy 167.1 74.600003) (xy 167.1 78.993907) (xy 167.099403 79.006061) + (xy 167.081982 79.182934) (xy 167.07724 79.206775) (xy 167.027424 79.370998) (xy 167.018121 79.393456) + (xy 166.937227 79.544798) (xy 166.923722 79.56501) (xy 166.814854 79.697666) (xy 166.797666 79.714854) + (xy 166.66501 79.823722) (xy 166.644798 79.837227) (xy 166.493456 79.918121) (xy 166.470998 79.927424) + (xy 166.306775 79.97724) (xy 166.282934 79.981982) (xy 166.106061 79.999403) (xy 166.093907 80) + (xy 166.05 80) (xy 166.039061 80.001077) (xy 166.019608 80.002993) (xy 165.950962 79.989973) (xy 165.938566 79.982693) (xy 165.930405 79.97724) (xy 165.91034 79.963833) (xy 165.910339 79.963832) (xy 165.910338 79.963832) (xy 165.837276 79.949299) (xy 165.837274 79.949299) (xy 165.280726 79.949299) (xy 165.280723 79.949299) - (xy 165.207664 79.963831) (xy 165.20766 79.963832) (xy 165.153531 80) (xy 165.1 80) (xy 165.1 80.056312) - (xy 165.069433 80.102059) (xy 165.069432 80.102063) (xy 165.0549 80.17512) (xy 165.0549 81.20544) - (xy 165.049561 81.241435) (xy 165.03123 81.301864) (xy 165.021927 81.324323) (xy 164.945653 81.46702) - (xy 164.932148 81.487231) (xy 164.829498 81.61231) (xy 164.81231 81.629498) (xy 164.687231 81.732148) - (xy 164.66702 81.745653) (xy 164.524323 81.821927) (xy 164.501864 81.83123) (xy 164.347021 81.878201) - (xy 164.32318 81.882943) (xy 164.156061 81.899403) (xy 164.143907 81.9) (xy 161.906093 81.9) (xy 161.893939 81.899403) - (xy 161.717065 81.881982) (xy 161.693224 81.87724) (xy 161.529001 81.827424) (xy 161.506543 81.818121) - (xy 161.355201 81.737227) (xy 161.334989 81.723722) (xy 161.202333 81.614854) (xy 161.185145 81.597666) - (xy 161.076277 81.46501) (xy 161.062777 81.444807) (xy 160.99774 81.323132) (xy 160.9831 81.264681) - (xy 160.9831 80.175122) (xy 160.983099 80.17512) (xy 160.968567 80.102063) (xy 160.968566 80.102059) - (xy 160.937999 80.056312) (xy 160.913201 80.019198) (xy 160.9 80.010377) (xy 160.9 79.9) (xy 160.150006 79.9) - (xy 159.4 79.9) (xy 159.4 71.515866) (xy 159.419685 71.448827) (xy 159.42423 71.442232) (xy 159.482793 71.362882) - (xy 159.51189 71.279727) (xy 159.527646 71.234701) (xy 159.527646 71.234699) (xy 159.5305 71.204269) - (xy 159.5305 70.54573) (xy 159.527646 70.5153) (xy 159.527646 70.515298) (xy 159.483374 70.388779) - (xy 159.479811 70.319001) (xy 159.491057 70.289371) (xy 159.562775 70.155195) (xy 159.576272 70.134995) - (xy 159.685149 70.002328) (xy 159.702328 69.985149) (xy 159.834995 69.876272) (xy 159.855195 69.862775) - (xy 160.006549 69.781875) (xy 160.028994 69.772577) (xy 160.193232 69.722757) (xy 160.217056 69.718018) - (xy 160.393939 69.700597) (xy 160.406093 69.7) (xy 160.803317 69.7) + (xy 165.207664 79.963831) (xy 165.20766 79.963832) (xy 165.124799 80.019198) (xy 165.069433 80.102059) + (xy 165.069432 80.102063) (xy 165.0549 80.17512) (xy 165.0549 81.20544) (xy 165.049561 81.241435) + (xy 165.03123 81.301864) (xy 165.021927 81.324323) (xy 164.945653 81.46702) (xy 164.932148 81.487231) + (xy 164.829498 81.61231) (xy 164.81231 81.629498) (xy 164.687231 81.732148) (xy 164.66702 81.745653) + (xy 164.524323 81.821927) (xy 164.501864 81.83123) (xy 164.347021 81.878201) (xy 164.32318 81.882943) + (xy 164.156061 81.899403) (xy 164.143907 81.9) (xy 161.906093 81.9) (xy 161.893939 81.899403) (xy 161.717065 81.881982) + (xy 161.693224 81.87724) (xy 161.529001 81.827424) (xy 161.506543 81.818121) (xy 161.355201 81.737227) + (xy 161.334989 81.723722) (xy 161.202333 81.614854) (xy 161.185145 81.597666) (xy 161.076277 81.46501) + (xy 161.062777 81.444807) (xy 160.99774 81.323132) (xy 160.9831 81.264681) (xy 160.9831 80.175122) + (xy 160.983099 80.17512) (xy 160.968567 80.102063) (xy 160.968566 80.102059) (xy 160.913201 80.019198) + (xy 160.83034 79.963833) (xy 160.830339 79.963832) (xy 160.830335 79.963831) (xy 160.757277 79.949299) + (xy 160.757274 79.949299) (xy 160.42511 79.949299) (xy 160.384155 79.94234) (xy 160.316898 79.918805) + (xy 160.316885 79.918802) (xy 160.150006 79.9) (xy 160.15 79.9) (xy 159.4 79.9) (xy 159.4 71.515866) + (xy 159.419685 71.448827) (xy 159.42423 71.442232) (xy 159.482793 71.362882) (xy 159.51189 71.279727) + (xy 159.527646 71.234701) (xy 159.527646 71.234699) (xy 159.5305 71.204269) (xy 159.5305 70.54573) + (xy 159.527646 70.5153) (xy 159.527646 70.515298) (xy 159.483374 70.388779) (xy 159.479811 70.319001) + (xy 159.491057 70.289371) (xy 159.562775 70.155195) (xy 159.576272 70.134995) (xy 159.685149 70.002328) + (xy 159.702328 69.985149) (xy 159.834995 69.876272) (xy 159.855195 69.862775) (xy 160.006549 69.781875) + (xy 160.028994 69.772577) (xy 160.193232 69.722757) (xy 160.217056 69.718018) (xy 160.393939 69.700597) + (xy 160.406093 69.7) (xy 160.803317 69.7) ) ) ) @@ -160069,27 +164315,29 @@ (xy 264.860824 131.111355) (xy 264.911122 131.271089) (xy 264.916093 131.294678) (xy 264.934533 131.461124) (xy 264.934846 131.485231) (xy 264.920728 131.652105) (xy 264.91637 131.675816) (xy 264.868558 131.842637) (xy 264.864672 131.854063) (xy 263.769886 134.623229) (xy 263.765256 134.63354) (xy 263.690813 134.780938) - (xy 263.678838 134.800085) (xy 263.578901 134.931531) (xy 263.571658 134.940208) (xy 234.565366 166.628589) - (xy 234.565358 166.628598) (xy 234.5 166.7) (xy 234.449554 166.782608) (xy 234.449543 166.782626) - (xy 234.449534 166.78264) (xy 219.612034 191.080291) (xy 219.611307 191.081467) (xy 219.600526 191.098687) - (xy 219.599023 191.101028) (xy 219.58788 191.117969) (xy 219.587111 191.119125) (xy 216.670745 195.446635) - (xy 216.670737 195.446647) (xy 216.670733 195.446653) (xy 216.5 195.7) (xy 216.5 196.005507) (xy 216.5 196.00551) + (xy 263.678838 134.800085) (xy 263.578901 134.931531) (xy 263.571658 134.940208) (xy 234.565354 166.628602) + (xy 234.503739 166.702806) (xy 234.503736 166.70281) (xy 234.449543 166.782626) (xy 234.449534 166.78264) + (xy 219.612034 191.080291) (xy 219.611307 191.081467) (xy 219.600526 191.098687) (xy 219.599023 191.101028) + (xy 219.58788 191.117969) (xy 219.587111 191.119125) (xy 216.670745 195.446635) (xy 216.670737 195.446647) + (xy 216.577131 195.62039) (xy 216.519474 195.809119) (xy 216.519472 195.809128) (xy 216.5 196.00551) (xy 216.5 202.943713) (xy 216.495774 202.975809) (xy 216.4945 202.980563) (xy 216.4945 217.449748) (xy 216.493903 217.461903) (xy 216.481982 217.582935) (xy 216.47724 217.606775) (xy 216.427424 217.770998) (xy 216.418121 217.793456) (xy 216.337227 217.944798) (xy 216.323722 217.96501) (xy 216.214854 218.097666) (xy 216.197666 218.114854) (xy 216.06501 218.223722) (xy 216.044798 218.237227) (xy 215.893456 218.318121) (xy 215.870998 218.327424) (xy 215.706775 218.37724) (xy 215.682934 218.381982) (xy 215.506061 218.399403) - (xy 215.493907 218.4) (xy 197 218.4) (xy 197 213.2) (xy 210.1 213.2) (xy 210.1 201.796681) (xy 210.119685 201.729642) - (xy 210.124392 201.722829) (xy 210.136164 201.706957) (xy 210.149669 201.686745) (xy 210.162558 201.66524) - (xy 210.243452 201.513898) (xy 210.25417 201.491237) (xy 210.263473 201.468779) (xy 210.271922 201.445165) - (xy 210.321738 201.280942) (xy 210.327831 201.256618) (xy 210.332573 201.232777) (xy 210.336252 201.207978) - (xy 210.353673 201.031105) (xy 210.354595 201.018596) (xy 210.355192 201.006442) (xy 210.3555 200.993907) - (xy 210.3555 190.890411) (xy 210.368819 190.834503) (xy 210.435475 190.702552) (xy 210.435479 190.702543) - (xy 215.160411 181.349106) (xy 215.160421 181.349088) (xy 215.202386 181.266011) (xy 215.223656 181.236006) - (xy 215.28816 181.168892) (xy 215.288159 181.168891) (xy 215.288161 181.16889) (xy 215.288162 181.16889) - (xy 257.177341 137.584197) (xy 257.177341 137.584196) (xy 257.179292 137.582167) (xy 257.179295 137.582163) - (xy 257.181673 137.579689) (xy 257.183293 137.578037) (xy 257.185512 137.575819) (xy 257.187679 137.573653) - (xy 257.188537 137.572791) (xy 258.994498 135.766833) (xy 259.00194 135.759071) (xy 259.009002 135.751388) + (xy 215.493907 218.4) (xy 197 218.4) (xy 197 213.2) (xy 209.1 213.2) (xy 209.29509 213.180785) (xy 209.482683 213.12388) + (xy 209.65557 213.03147) (xy 209.807107 212.907107) (xy 209.93147 212.75557) (xy 210.02388 212.582683) + (xy 210.080785 212.39509) (xy 210.1 212.2) (xy 210.1 201.796681) (xy 210.119685 201.729642) (xy 210.124392 201.722829) + (xy 210.136164 201.706957) (xy 210.149669 201.686745) (xy 210.162558 201.66524) (xy 210.243452 201.513898) + (xy 210.25417 201.491237) (xy 210.263473 201.468779) (xy 210.271922 201.445165) (xy 210.321738 201.280942) + (xy 210.327831 201.256618) (xy 210.332573 201.232777) (xy 210.336252 201.207978) (xy 210.353673 201.031105) + (xy 210.354595 201.018596) (xy 210.355192 201.006442) (xy 210.3555 200.993907) (xy 210.3555 191.060453) + (xy 210.356347 191.045986) (xy 210.370491 190.925585) (xy 210.375779 190.880565) (xy 210.382485 190.852421) + (xy 210.397023 190.812696) (xy 210.439727 190.696006) (xy 210.445483 190.682736) (xy 215.154046 181.361705) + (xy 215.158493 181.353658) (xy 215.213386 181.262541) (xy 215.224033 181.247522) (xy 215.275511 181.185292) + (xy 215.27551 181.185291) (xy 215.291815 181.165581) (xy 215.297944 181.158709) (xy 257.176705 137.584855) + (xy 257.177001 137.58455) (xy 257.18211 137.579288) (xy 257.182961 137.57842) (xy 257.188088 137.573242) + (xy 257.188304 137.573024) (xy 258.994498 135.766833) (xy 259.00194 135.759071) (xy 259.009002 135.751388) (xy 259.016111 135.743319) (xy 259.114483 135.626815) (xy 259.127648 135.609821) (xy 259.139714 135.592814) (xy 259.151411 135.574764) (xy 259.151414 135.574757) (xy 259.151421 135.574748) (xy 259.204791 135.48425) (xy 259.226207 135.447937) (xy 259.236344 135.428966) (xy 259.245389 135.410176) (xy 259.253889 135.390432) @@ -160163,12 +164411,16 @@ (xy 151.593907 207.3) (xy 148.908126 207.3) (xy 148.891941 207.298939) (xy 148.878917 207.297224) (xy 148.786775 207.285093) (xy 148.755508 207.276715) (xy 148.732047 207.266997) (xy 148.677643 207.223156) (xy 148.655579 207.156861) (xy 148.6555 207.152436) (xy 148.6555 206.410616) (xy 148.675185 206.343577) - (xy 148.725475 206.3) (xy 149 206.3) (xy 149 203.906092) (xy 149.000597 203.893938) (xy 149.018018 203.717056) - (xy 149.022757 203.693232) (xy 149.072577 203.528994) (xy 149.081875 203.506549) (xy 149.162775 203.355195) - (xy 149.176272 203.334995) (xy 149.285149 203.202328) (xy 149.302328 203.185149) (xy 149.434995 203.076272) - (xy 149.455195 203.062775) (xy 149.606549 202.981875) (xy 149.628994 202.972577) (xy 149.793232 202.922757) - (xy 149.817056 202.918018) (xy 149.993939 202.900597) (xy 150.006093 202.9) (xy 150.250003 202.9) - (xy 151.1 202.9) (xy 151.1 201.956961) (xy 151.10078 201.943078) (xy 151.117239 201.796995) (xy 151.11724 201.796994) + (xy 148.727989 206.297822) (xy 148.755309 206.288999) (xy 148.814802 206.277165) (xy 148.814802 206.277164) + (xy 148.814805 206.277164) (xy 148.912132 206.212132) (xy 148.977164 206.114805) (xy 149 206) (xy 149 203.906092) + (xy 149.000597 203.893938) (xy 149.018018 203.717056) (xy 149.022757 203.693232) (xy 149.072577 203.528994) + (xy 149.081875 203.506549) (xy 149.162775 203.355195) (xy 149.176272 203.334995) (xy 149.285149 203.202328) + (xy 149.302328 203.185149) (xy 149.434995 203.076272) (xy 149.455195 203.062775) (xy 149.606549 202.981875) + (xy 149.628994 202.972577) (xy 149.793232 202.922757) (xy 149.817056 202.918018) (xy 149.993939 202.900597) + (xy 150.006093 202.9) (xy 150.250003 202.9) (xy 150.250004 202.899999) (xy 150.344571 202.889344) + (xy 150.439137 202.87869) (xy 150.43914 202.878689) (xy 150.439143 202.878689) (xy 150.618801 202.815824) + (xy 150.779966 202.714557) (xy 150.914557 202.579966) (xy 151.015824 202.418801) (xy 151.078689 202.239143) + (xy 151.1 202.05) (xy 151.1 201.956961) (xy 151.10078 201.943078) (xy 151.117239 201.796995) (xy 151.11724 201.796994) (xy 151.117239 201.796991) (xy 151.123415 201.769929) (xy 151.16966 201.637768) (xy 151.181702 201.612762) (xy 151.256197 201.494205) (xy 151.273502 201.472506) (xy 151.372506 201.373502) (xy 151.394205 201.356197) (xy 151.512762 201.281702) (xy 151.537768 201.26966) (xy 151.669929 201.223415) (xy 151.696991 201.217239) @@ -160219,22 +164471,27 @@ (xy 264.17724 82.406775) (xy 264.127424 82.570998) (xy 264.118121 82.593456) (xy 264.037227 82.744798) (xy 264.023722 82.76501) (xy 263.914854 82.897666) (xy 263.897666 82.914854) (xy 263.76501 83.023722) (xy 263.744798 83.037227) (xy 263.593456 83.118121) (xy 263.570998 83.127424) (xy 263.406775 83.17724) - (xy 263.382934 83.181982) (xy 263.206061 83.199403) (xy 263.193907 83.2) (xy 256.1 83.2) (xy 256.1 83.589559) - (xy 256.060908 83.694371) (xy 256.054501 83.75397) (xy 256.0545 83.753989) (xy 256.0545 83.932285) - (xy 256.045061 83.979738) (xy 256.032559 84.00992) (xy 256.016374 84.037953) (xy 255.948847 84.125957) - (xy 255.925957 84.148847) (xy 255.83795 84.216376) (xy 255.809916 84.232561) (xy 255.707432 84.275011) - (xy 255.676166 84.283389) (xy 255.577194 84.296419) (xy 255.558057 84.298939) (xy 255.541874 84.3) - (xy 252.506093 84.3) (xy 252.493939 84.299403) (xy 252.317065 84.281982) (xy 252.293224 84.27724) - (xy 252.129001 84.227424) (xy 252.106543 84.218121) (xy 251.955201 84.137227) (xy 251.934989 84.123722) - (xy 251.802333 84.014854) (xy 251.785145 83.997666) (xy 251.731488 83.932285) (xy 251.676276 83.865008) - (xy 251.662772 83.844798) (xy 251.614234 83.753989) (xy 251.581877 83.693453) (xy 251.572575 83.670998) - (xy 251.522757 83.506769) (xy 251.518018 83.482941) (xy 251.500597 83.306061) (xy 251.5 83.293907) - (xy 251.5 81.606092) (xy 251.500597 81.593938) (xy 251.518018 81.417056) (xy 251.522757 81.393232) - (xy 251.572577 81.228994) (xy 251.581875 81.206549) (xy 251.662775 81.055195) (xy 251.676272 81.034995) - (xy 251.785149 80.902328) (xy 251.802328 80.885149) (xy 251.934995 80.776272) (xy 251.955195 80.762775) - (xy 252.106549 80.681875) (xy 252.128994 80.672577) (xy 252.293232 80.622757) (xy 252.317056 80.618018) - (xy 252.493939 80.600597) (xy 252.506093 80.6) (xy 254.799997 80.6) (xy 254.8 80.6) (xy 255.8 80.6) - (xy 255.8 76.3) (xy 255.15 76.3) (xy 255.119124 76.295935) (xy 254.997951 76.279982) (xy 254.966684 76.271604) + (xy 263.382934 83.181982) (xy 263.206061 83.199403) (xy 263.193907 83.2) (xy 256.649992 83.2) (xy 256.50765 83.218741) + (xy 256.507646 83.218742) (xy 256.375 83.273685) (xy 256.261092 83.361089) (xy 256.172641 83.476361) + (xy 256.166588 83.485537) (xy 256.111206 83.559518) (xy 256.111202 83.559525) (xy 256.060908 83.694371) + (xy 256.054501 83.75397) (xy 256.0545 83.753989) (xy 256.0545 83.932285) (xy 256.045061 83.979738) + (xy 256.032559 84.00992) (xy 256.016374 84.037953) (xy 255.948847 84.125957) (xy 255.925957 84.148847) + (xy 255.83795 84.216376) (xy 255.809916 84.232561) (xy 255.707432 84.275011) (xy 255.676166 84.283389) + (xy 255.577194 84.296419) (xy 255.558057 84.298939) (xy 255.541874 84.3) (xy 252.506093 84.3) (xy 252.493939 84.299403) + (xy 252.317065 84.281982) (xy 252.293224 84.27724) (xy 252.129001 84.227424) (xy 252.106543 84.218121) + (xy 251.955201 84.137227) (xy 251.934989 84.123722) (xy 251.802333 84.014854) (xy 251.785145 83.997666) + (xy 251.731488 83.932285) (xy 251.676276 83.865008) (xy 251.662772 83.844798) (xy 251.614234 83.753989) + (xy 251.581877 83.693453) (xy 251.572575 83.670998) (xy 251.553359 83.60765) (xy 251.522757 83.506769) + (xy 251.518018 83.482941) (xy 251.500597 83.306061) (xy 251.5 83.293907) (xy 251.5 81.606092) (xy 251.500597 81.593938) + (xy 251.518018 81.417056) (xy 251.522757 81.393232) (xy 251.572577 81.228994) (xy 251.581875 81.206549) + (xy 251.662775 81.055195) (xy 251.676272 81.034995) (xy 251.785149 80.902328) (xy 251.802328 80.885149) + (xy 251.934995 80.776272) (xy 251.955195 80.762775) (xy 252.106549 80.681875) (xy 252.128994 80.672577) + (xy 252.293232 80.622757) (xy 252.317056 80.618018) (xy 252.493939 80.600597) (xy 252.506093 80.6) + (xy 254.799997 80.6) (xy 254.8 80.6) (xy 254.99509 80.580785) (xy 255.182683 80.52388) (xy 255.35557 80.43147) + (xy 255.507107 80.307107) (xy 255.63147 80.15557) (xy 255.72388 79.982683) (xy 255.780785 79.79509) + (xy 255.8 79.6) (xy 255.8 76.95) (xy 255.777852 76.781768) (xy 255.712917 76.625) (xy 255.609619 76.490381) + (xy 255.475 76.387083) (xy 255.474999 76.387082) (xy 255.474997 76.387081) (xy 255.318235 76.322149) + (xy 255.31823 76.322147) (xy 255.15 76.3) (xy 255.119124 76.295935) (xy 254.997951 76.279982) (xy 254.966684 76.271604) (xy 254.840082 76.219164) (xy 254.81205 76.20298) (xy 254.703326 76.119552) (xy 254.680447 76.096673) (xy 254.597017 75.987946) (xy 254.580835 75.959917) (xy 254.528394 75.833311) (xy 254.520017 75.802047) (xy 254.501061 75.658059) (xy 254.5 75.641874) (xy 254.5 74.810357) (xy 254.519685 74.743318) (xy 254.52294 74.738555) @@ -160274,15 +164531,16 @@ (filled_polygon (layer "F.Cu") (pts - (xy 151.1 63.6) (xy 144.006093 63.6) (xy 143.993939 63.599403) (xy 143.817065 63.581982) (xy 143.793224 63.57724) - (xy 143.629001 63.527424) (xy 143.606543 63.518121) (xy 143.455201 63.437227) (xy 143.434989 63.423722) - (xy 143.302333 63.314854) (xy 143.285145 63.297666) (xy 143.176277 63.16501) (xy 143.162772 63.144798) - (xy 143.081878 62.993456) (xy 143.072575 62.970998) (xy 143.022757 62.806769) (xy 143.018018 62.782941) - (xy 143.000597 62.606061) (xy 143 62.593907) (xy 143 60.006092) (xy 143.000597 59.993938) (xy 143.018018 59.817056) - (xy 143.022757 59.793232) (xy 143.072577 59.628994) (xy 143.081875 59.606549) (xy 143.162775 59.455195) - (xy 143.176272 59.434995) (xy 143.285149 59.302328) (xy 143.302328 59.285149) (xy 143.434995 59.176272) - (xy 143.455195 59.162775) (xy 143.606549 59.081875) (xy 143.628994 59.072577) (xy 143.793232 59.022757) - (xy 143.817056 59.018018) (xy 143.993939 59.000597) (xy 144.006093 59) (xy 151.1 59) + (xy 151.1 63.6) (xy 150.1 63.6) (xy 144.006093 63.6) (xy 143.993939 63.599403) (xy 143.817065 63.581982) + (xy 143.793224 63.57724) (xy 143.629001 63.527424) (xy 143.606543 63.518121) (xy 143.455201 63.437227) + (xy 143.434989 63.423722) (xy 143.302333 63.314854) (xy 143.285145 63.297666) (xy 143.176277 63.16501) + (xy 143.162772 63.144798) (xy 143.081878 62.993456) (xy 143.072575 62.970998) (xy 143.022757 62.806769) + (xy 143.018018 62.782941) (xy 143.000597 62.606061) (xy 143 62.593907) (xy 143 60.006092) (xy 143.000597 59.993938) + (xy 143.018018 59.817056) (xy 143.022757 59.793232) (xy 143.072577 59.628994) (xy 143.081875 59.606549) + (xy 143.162775 59.455195) (xy 143.176272 59.434995) (xy 143.285149 59.302328) (xy 143.302328 59.285149) + (xy 143.434995 59.176272) (xy 143.455195 59.162775) (xy 143.606549 59.081875) (xy 143.628994 59.072577) + (xy 143.793232 59.022757) (xy 143.817056 59.018018) (xy 143.993939 59.000597) (xy 144.006093 59) + (xy 151.1 59) ) ) ) @@ -160317,28 +164575,31 @@ (pts (xy 142.811971 202.102381) (xy 142.890618 202.118024) (xy 142.935308 202.136535) (xy 142.991626 202.174166) (xy 143.025833 202.208373) (xy 143.05654 202.254329) (xy 143.063462 202.264688) (xy 143.081976 202.309387) - (xy 143.1 202.4) (xy 143.1 202.7) (xy 147.393907 202.7) (xy 147.406061 202.700597) (xy 147.582941 202.718018) - (xy 147.606769 202.722757) (xy 147.771001 202.772576) (xy 147.793453 202.781877) (xy 147.944798 202.862772) - (xy 147.965008 202.876276) (xy 147.996759 202.902333) (xy 148.097666 202.985145) (xy 148.114854 203.002333) - (xy 148.223722 203.134989) (xy 148.237227 203.155201) (xy 148.318121 203.306543) (xy 148.327424 203.329001) - (xy 148.37724 203.493224) (xy 148.381982 203.517065) (xy 148.399403 203.693938) (xy 148.4 203.706092) - (xy 148.4 209.993907) (xy 148.399403 210.006061) (xy 148.381982 210.182934) (xy 148.37724 210.206775) - (xy 148.327424 210.370998) (xy 148.318121 210.393456) (xy 148.237227 210.544798) (xy 148.223722 210.56501) - (xy 148.114854 210.697666) (xy 148.097666 210.714854) (xy 147.96501 210.823722) (xy 147.944798 210.837227) - (xy 147.793456 210.918121) (xy 147.770998 210.927424) (xy 147.606775 210.97724) (xy 147.582934 210.981982) - (xy 147.406061 210.999403) (xy 147.393907 211) (xy 134.606093 211) (xy 134.593939 210.999403) (xy 134.417065 210.981982) - (xy 134.393224 210.97724) (xy 134.229001 210.927424) (xy 134.206543 210.918121) (xy 134.055201 210.837227) - (xy 134.034989 210.823722) (xy 133.902333 210.714854) (xy 133.885145 210.697666) (xy 133.776277 210.56501) - (xy 133.762772 210.544798) (xy 133.681878 210.393456) (xy 133.672575 210.370998) (xy 133.622757 210.206769) - (xy 133.618018 210.182941) (xy 133.600597 210.006061) (xy 133.6 209.993907) (xy 133.6 203.606092) - (xy 133.600597 203.593938) (xy 133.618018 203.417056) (xy 133.622757 203.393232) (xy 133.672577 203.228994) - (xy 133.681875 203.206549) (xy 133.762775 203.055195) (xy 133.776272 203.034995) (xy 133.885149 202.902328) - (xy 133.902328 202.885149) (xy 134.034995 202.776272) (xy 134.055187 202.762779) (xy 134.169437 202.701712) - (xy 134.227887 202.687072) (xy 134.424928 202.687072) (xy 134.424929 202.687071) (xy 134.497992 202.672538) - (xy 134.57528 202.620896) (xy 134.641957 202.60002) (xy 134.644169 202.6) (xy 136.650001 202.6) - (xy 136.9 202.6) (xy 136.9 202.35) (xy 136.914219 202.278514) (xy 136.932729 202.233826) (xy 136.959524 202.193724) - (xy 136.993724 202.159524) (xy 137.033826 202.132729) (xy 137.078514 202.114219) (xy 137.138028 202.102381) - (xy 137.162211 202.1) (xy 142.787789 202.1) + (xy 143.1 202.4) (xy 143.122836 202.514805) (xy 143.187868 202.612132) (xy 143.285195 202.677164) + (xy 143.285196 202.677164) (xy 143.285197 202.677165) (xy 143.399995 202.699999) (xy 143.399999 202.7) + (xy 143.4 202.7) (xy 147.393907 202.7) (xy 147.406061 202.700597) (xy 147.582941 202.718018) (xy 147.606769 202.722757) + (xy 147.771001 202.772576) (xy 147.793453 202.781877) (xy 147.944798 202.862772) (xy 147.965008 202.876276) + (xy 147.996759 202.902333) (xy 148.097666 202.985145) (xy 148.114854 203.002333) (xy 148.223722 203.134989) + (xy 148.237227 203.155201) (xy 148.318121 203.306543) (xy 148.327424 203.329001) (xy 148.37724 203.493224) + (xy 148.381982 203.517065) (xy 148.399403 203.693938) (xy 148.4 203.706092) (xy 148.4 209.993907) + (xy 148.399403 210.006061) (xy 148.381982 210.182934) (xy 148.37724 210.206775) (xy 148.327424 210.370998) + (xy 148.318121 210.393456) (xy 148.237227 210.544798) (xy 148.223722 210.56501) (xy 148.114854 210.697666) + (xy 148.097666 210.714854) (xy 147.96501 210.823722) (xy 147.944798 210.837227) (xy 147.793456 210.918121) + (xy 147.770998 210.927424) (xy 147.606775 210.97724) (xy 147.582934 210.981982) (xy 147.406061 210.999403) + (xy 147.393907 211) (xy 134.606093 211) (xy 134.593939 210.999403) (xy 134.417065 210.981982) (xy 134.393224 210.97724) + (xy 134.229001 210.927424) (xy 134.206543 210.918121) (xy 134.055201 210.837227) (xy 134.034989 210.823722) + (xy 133.902333 210.714854) (xy 133.885145 210.697666) (xy 133.776277 210.56501) (xy 133.762772 210.544798) + (xy 133.681878 210.393456) (xy 133.672575 210.370998) (xy 133.622757 210.206769) (xy 133.618018 210.182941) + (xy 133.600597 210.006061) (xy 133.6 209.993907) (xy 133.6 203.606092) (xy 133.600597 203.593938) + (xy 133.618018 203.417056) (xy 133.622757 203.393232) (xy 133.672577 203.228994) (xy 133.681875 203.206549) + (xy 133.762775 203.055195) (xy 133.776272 203.034995) (xy 133.885149 202.902328) (xy 133.902328 202.885149) + (xy 134.034995 202.776272) (xy 134.055187 202.762779) (xy 134.169437 202.701712) (xy 134.227887 202.687072) + (xy 134.424928 202.687072) (xy 134.424929 202.687071) (xy 134.497992 202.672538) (xy 134.57528 202.620896) + (xy 134.641957 202.60002) (xy 134.644169 202.6) (xy 136.650001 202.6) (xy 136.650002 202.599999) + (xy 136.745671 202.58097) (xy 136.826777 202.526777) (xy 136.88097 202.445671) (xy 136.9 202.35) + (xy 136.914219 202.278514) (xy 136.932729 202.233826) (xy 136.959524 202.193724) (xy 136.993724 202.159524) + (xy 137.033826 202.132729) (xy 137.078514 202.114219) (xy 137.138028 202.102381) (xy 137.162211 202.1) + (xy 142.787789 202.1) ) ) ) @@ -160373,7 +164634,12 @@ (xy 142.493453 94.081877) (xy 142.644798 94.162772) (xy 142.66501 94.176277) (xy 142.797666 94.285145) (xy 142.814854 94.302333) (xy 142.923722 94.434989) (xy 142.937227 94.455201) (xy 143.018121 94.606543) (xy 143.027424 94.629001) (xy 143.07724 94.793224) (xy 143.081982 94.817065) (xy 143.099403 94.993938) - (xy 143.1 95.006092) (xy 143.1 102) (xy 169.493907 102) (xy 169.506061 102.000597) (xy 169.612656 102.011095) + (xy 143.1 95.006092) (xy 143.1 100.999996) (xy 143.119214 101.195088) (xy 143.138183 101.257621) + (xy 143.17612 101.382683) (xy 143.176121 101.382686) (xy 143.176122 101.382687) (xy 143.176123 101.38269) + (xy 143.268526 101.555564) (xy 143.268531 101.555571) (xy 143.392892 101.707107) (xy 143.498344 101.793648) + (xy 143.54443 101.83147) (xy 143.544433 101.831471) (xy 143.544435 101.831473) (xy 143.717309 101.923876) + (xy 143.71731 101.923876) (xy 143.717317 101.92388) (xy 143.90491 101.980785) (xy 143.904909 101.980785) + (xy 143.953682 101.985588) (xy 144.1 102) (xy 169.493907 102) (xy 169.506061 102.000597) (xy 169.612656 102.011095) (xy 169.677441 102.037256) (xy 169.7178 102.09429) (xy 169.7245 102.134498) (xy 169.7245 111.349437) (xy 169.734282 111.385946) (xy 169.750088 111.444934) (xy 169.750091 111.444941) (xy 169.791785 111.517157) (xy 169.799526 111.530564) (xy 169.799527 111.530565) (xy 170.463681 112.194718) (xy 170.497166 112.256041) @@ -160393,211 +164659,214 @@ (xy 168.30857 114.931031) (xy 168.145763 114.754175) (xy 168.145758 114.754171) (xy 168.145756 114.754169) (xy 167.956074 114.606533) (xy 167.956068 114.606529) (xy 167.744656 114.492118) (xy 167.744651 114.492116) (xy 167.517299 114.414066) (xy 167.325172 114.382006) (xy 167.280191 114.3745) (xy 167.039807 114.3745) - (xy 167.013008 114.378972) (xy 166.802698 114.414066) (xy 166.575346 114.492116) (xy 166.575341 114.492118) + (xy 166.994826 114.382006) (xy 166.802698 114.414066) (xy 166.575346 114.492116) (xy 166.575341 114.492118) (xy 166.363929 114.606529) (xy 166.363923 114.606533) (xy 166.174241 114.754169) (xy 166.174238 114.754172) - (xy 166.011429 114.931029) (xy 166.011426 114.931033) (xy 165.87995 115.13227) (xy 165.783388 115.35241) - (xy 165.724379 115.585434) (xy 165.724313 115.586239) (xy 165.724192 115.58655) (xy 165.723535 115.590493) - (xy 165.722723 115.590357) (xy 165.69916 115.651424) (xy 165.642758 115.692663) (xy 165.600736 115.7) - (xy 138.4 115.7) (xy 137.522 115.7) (xy 137.454961 115.680315) (xy 137.409206 115.627511) (xy 137.398 115.576) - (xy 137.398 115.454398) (xy 137.417685 115.387359) (xy 137.434315 115.366721) (xy 137.534217 115.266818) - (xy 137.59554 115.233334) (xy 137.621898 115.2305) (xy 137.768985 115.2305) (xy 137.922365 115.192696) - (xy 137.928334 115.189563) (xy 138.06224 115.119283) (xy 138.180483 115.01453) (xy 138.27022 114.884523) - (xy 138.326237 114.736818) (xy 138.345278 114.58) (xy 138.341698 114.550511) (xy 138.326237 114.423181) - (xy 138.297961 114.348624) (xy 138.27022 114.275477) (xy 138.180483 114.14547) (xy 138.06224 114.040717) - (xy 138.062238 114.040716) (xy 138.062237 114.040715) (xy 137.922365 113.967303) (xy 137.768986 113.9295) - (xy 137.768985 113.9295) (xy 137.611015 113.9295) (xy 137.611014 113.9295) (xy 137.457634 113.967303) - (xy 137.317762 114.040715) (xy 137.199516 114.145471) (xy 137.109781 114.275475) (xy 137.10978 114.275476) - (xy 137.053763 114.423181) (xy 137.034722 114.58) (xy 137.034722 114.580001) (xy 137.040896 114.630854) - (xy 137.029435 114.699777) (xy 137.005481 114.73348) (xy 136.791938 114.947025) (xy 136.722026 115.016936) - (xy 136.672591 115.102559) (xy 136.67259 115.10256) (xy 136.66811 115.119283) (xy 136.665523 115.128937) - (xy 136.648441 115.192689) (xy 136.64844 115.192692) (xy 136.647 115.198065) (xy 136.647 115.576) - (xy 136.627315 115.643039) (xy 136.574511 115.688794) (xy 136.523 115.7) (xy 134.452099 115.7) (xy 134.38506 115.680315) - (xy 134.339305 115.627511) (xy 134.329361 115.558353) (xy 134.336159 115.532025) (xy 134.336236 115.53182) - (xy 134.336237 115.531818) (xy 134.355278 115.375) (xy 134.349525 115.327615) (xy 134.336237 115.218181) - (xy 134.302391 115.128937) (xy 134.28022 115.070477) (xy 134.190483 114.94047) (xy 134.07224 114.835717) - (xy 134.072238 114.835716) (xy 134.072237 114.835715) (xy 133.932365 114.762303) (xy 133.778986 114.7245) - (xy 133.778985 114.7245) (xy 133.621015 114.7245) (xy 133.621014 114.7245) (xy 133.467634 114.762303) - (xy 133.327762 114.835715) (xy 133.209516 114.94047) (xy 133.207089 114.943987) (xy 133.205742 114.945938) - (xy 133.151463 114.989929) (xy 133.103692 114.9995) (xy 130.100099 114.9995) (xy 130.03306 114.979815) - (xy 129.987305 114.927011) (xy 129.983065 114.916474) (xy 129.972793 114.887118) (xy 129.89215 114.77785) - (xy 129.782882 114.697207) (xy 129.78288 114.697206) (xy 129.6547 114.652353) (xy 129.62427 114.6495) - (xy 129.624266 114.6495) (xy 129.115734 114.6495) (xy 129.11573 114.6495) (xy 129.0853 114.652353) - (xy 129.085298 114.652353) (xy 128.957119 114.697206) (xy 128.957117 114.697207) (xy 128.84785 114.77785) - (xy 128.767207 114.887117) (xy 128.767206 114.887119) (xy 128.722353 115.015298) (xy 128.722353 115.0153) - (xy 128.7195 115.04573) (xy 128.7195 115.214821) (xy 128.699815 115.28186) (xy 128.647011 115.327615) - (xy 128.577853 115.337559) (xy 128.514297 115.308534) (xy 128.499647 115.293486) (xy 128.476277 115.26501) - (xy 128.462772 115.244798) (xy 128.385052 115.099394) (xy 128.37106 115.048592) (xy 128.370771 115.04862) - (xy 128.370617 115.046982) (xy 128.370546 115.046723) (xy 128.370499 115.04573) (xy 128.367646 115.015301) - (xy 128.367646 115.0153) (xy 128.367646 115.015298) (xy 128.321625 114.88378) (xy 128.315265 114.854988) - (xy 128.300597 114.70606) (xy 128.3 114.693907) (xy 128.3 111.652158) (xy 128.319685 111.585119) - (xy 128.366376 111.542361) (xy 128.372236 111.539285) (xy 128.372235 111.539285) (xy 128.37224 111.539283) - (xy 128.490483 111.43453) (xy 128.58022 111.304523) (xy 128.636237 111.156818) (xy 128.655278 111) - (xy 128.636237 110.843182) (xy 128.58022 110.695477) (xy 128.490483 110.56547) (xy 128.37224 110.460717) - (xy 128.372238 110.460716) (xy 128.372237 110.460715) (xy 128.366369 110.457635) (xy 128.316159 110.409047) - (xy 128.3 110.347841) (xy 128.3 108.92444) (xy 128.319685 108.857401) (xy 128.372489 108.811646) - (xy 128.441647 108.801702) (xy 128.453663 108.80404) (xy 128.561015 108.8305) (xy 128.718985 108.8305) - (xy 128.872365 108.792696) (xy 129.01224 108.719283) (xy 129.130483 108.61453) (xy 129.22022 108.484523) - (xy 129.276237 108.336818) (xy 129.295278 108.18) (xy 129.288799 108.126636) (xy 129.276237 108.023181) - (xy 129.246588 107.945004) (xy 129.22022 107.875477) (xy 129.130483 107.74547) (xy 129.062272 107.68504) - (xy 129.025146 107.62585) (xy 129.0205 107.592225) (xy 129.0205 104.690099) (xy 129.040185 104.62306) - (xy 129.092989 104.577305) (xy 129.103525 104.573065) (xy 129.132882 104.562793) (xy 129.24215 104.48215) - (xy 129.280231 104.430551) (xy 129.335877 104.388302) (xy 129.405533 104.382843) (xy 129.467082 104.41591) - (xy 129.479763 104.430544) (xy 129.51785 104.48215) (xy 129.537154 104.496397) (xy 129.571128 104.521471) - (xy 129.613379 104.577118) (xy 129.618838 104.646774) (xy 129.585771 104.708324) (xy 129.571807 104.720507) - (xy 129.525314 104.755312) (xy 129.443373 104.864771) (xy 129.431181 104.897459) (xy 129.400961 104.978482) - (xy 129.395587 104.992889) (xy 129.3895 105.049498) (xy 129.3895 105.640481) (xy 129.389501 105.64049) - (xy 129.395587 105.697114) (xy 129.42618 105.779133) (xy 129.443372 105.825226) (xy 129.525313 105.934687) - (xy 129.534148 105.941301) (xy 129.57602 105.997232) (xy 129.581006 106.066923) (xy 129.561889 106.111008) - (xy 129.489781 106.215475) (xy 129.48978 106.215476) (xy 129.433762 106.363181) (xy 129.414722 106.519999) - (xy 129.414722 106.52) (xy 129.433762 106.676818) (xy 129.465194 106.759696) (xy 129.48978 106.824523) - (xy 129.579517 106.95453) (xy 129.69776 107.059283) (xy 129.697762 107.059284) (xy 129.837634 107.132696) - (xy 129.991014 107.1705) (xy 129.991015 107.1705) (xy 130.148985 107.1705) (xy 130.302365 107.132696) - (xy 130.304897 107.131367) (xy 130.44224 107.059283) (xy 130.560483 106.95453) (xy 130.65022 106.824523) - (xy 130.706237 106.676818) (xy 130.725278 106.52) (xy 130.706237 106.363182) (xy 130.703786 106.35672) - (xy 130.673981 106.27813) (xy 130.65022 106.215477) (xy 130.650218 106.215474) (xy 130.650216 106.21547) - (xy 130.591738 106.130749) (xy 130.569855 106.064395) (xy 130.587321 105.996743) (xy 130.619475 105.961045) - (xy 130.654687 105.934687) (xy 130.736628 105.825226) (xy 130.748819 105.792538) (xy 130.790687 105.736609) - (xy 130.85615 105.712191) (xy 130.924424 105.727042) (xy 130.97383 105.776446) (xy 130.98118 105.792539) - (xy 130.993372 105.825227) (xy 131.054712 105.907168) (xy 131.075312 105.934686) (xy 131.075314 105.934688) - (xy 131.184774 106.016628) (xy 131.192562 106.020881) (xy 131.191813 106.022252) (xy 131.239763 106.058143) - (xy 131.264184 106.123606) (xy 131.2645 106.132459) (xy 131.2645 109.060951) (xy 131.244815 109.12799) - (xy 131.222729 109.153765) (xy 131.209518 109.165468) (xy 131.209515 109.165472) (xy 131.119781 109.295475) - (xy 131.11978 109.295476) (xy 131.063762 109.443181) (xy 131.044722 109.599999) (xy 131.044722 109.6) - (xy 131.063762 109.756818) (xy 131.097026 109.844526) (xy 131.11978 109.904523) (xy 131.209517 110.03453) - (xy 131.32776 110.139283) (xy 131.327762 110.139284) (xy 131.467634 110.212696) (xy 131.621014 110.2505) - (xy 131.621015 110.2505) (xy 131.778985 110.2505) (xy 131.932365 110.212696) (xy 131.967158 110.194435) - (xy 132.07224 110.139283) (xy 132.190483 110.03453) (xy 132.28022 109.904523) (xy 132.336237 109.756818) - (xy 132.355278 109.6) (xy 132.344678 109.512696) (xy 132.336237 109.443181) (xy 132.303641 109.357234) - (xy 132.28022 109.295477) (xy 132.190483 109.16547) (xy 132.07224 109.060717) (xy 132.072237 109.060715) - (xy 132.072231 109.06071) (xy 132.069052 109.058515) (xy 132.067266 109.056311) (xy 132.066626 109.055744) - (xy 132.06672 109.055637) (xy 132.025066 109.004229) (xy 132.0155 108.956471) (xy 132.0155 106.132459) - (xy 132.035185 106.06542) (xy 132.087989 106.019665) (xy 132.094928 106.01679) (xy 132.095222 106.016629) - (xy 132.095226 106.016628) (xy 132.204687 105.934687) (xy 132.286628 105.825226) (xy 132.334412 105.697114) - (xy 132.336687 105.675944) (xy 132.340499 105.640501) (xy 132.340499 105.64049) (xy 132.3405 105.640485) - (xy 132.340499 105.049516) (xy 132.334412 104.992886) (xy 132.286628 104.864774) (xy 132.204687 104.755313) - (xy 132.204685 104.755311) (xy 132.204684 104.75531) (xy 132.158193 104.720507) (xy 132.116322 104.664573) - (xy 132.111338 104.594882) (xy 132.138579 104.544995) (xy 165.455233 104.544995) (xy 165.455233 104.545004) - (xy 165.474273 104.799079) (xy 165.530968 105.047477) (xy 165.530973 105.047494) (xy 165.624058 105.284671) - (xy 165.624057 105.284671) (xy 165.751454 105.505327) (xy 165.751461 105.505338) (xy 165.793452 105.557991) - (xy 165.793453 105.557992) (xy 166.444152 104.907292) (xy 166.451049 104.923942) (xy 166.538599 105.05497) - (xy 166.65003 105.166401) (xy 166.781058 105.253951) (xy 166.797705 105.260846) (xy 166.146813 105.911738) - (xy 166.307616 106.021371) (xy 166.307625 106.021376) (xy 166.539996 106.13328) (xy 166.591856 106.180102) - (xy 166.610169 106.247529) (xy 166.589121 106.314153) (xy 166.539996 106.35672) (xy 166.307622 106.468625) - (xy 166.307609 106.468632) (xy 166.146813 106.578259) (xy 166.797706 107.229152) (xy 166.781058 107.236049) - (xy 166.65003 107.323599) (xy 166.538599 107.43503) (xy 166.451049 107.566058) (xy 166.444152 107.582706) - (xy 165.793452 106.932006) (xy 165.751457 106.984667) (xy 165.624058 107.205328) (xy 165.530973 107.442505) - (xy 165.530968 107.442522) (xy 165.474273 107.69092) (xy 165.455233 107.944995) (xy 165.455233 107.945004) - (xy 165.474273 108.199079) (xy 165.530968 108.447477) (xy 165.530973 108.447494) (xy 165.624058 108.684671) - (xy 165.624057 108.684671) (xy 165.751454 108.905327) (xy 165.751461 108.905338) (xy 165.793452 108.957991) - (xy 165.793453 108.957992) (xy 166.444152 108.307292) (xy 166.451049 108.323942) (xy 166.538599 108.45497) - (xy 166.65003 108.566401) (xy 166.781058 108.653951) (xy 166.797705 108.660846) (xy 166.146813 109.311738) - (xy 166.307616 109.421371) (xy 166.307624 109.421376) (xy 166.537176 109.531921) (xy 166.537174 109.531921) - (xy 166.780652 109.607024) (xy 166.780658 109.607026) (xy 167.032595 109.644999) (xy 167.032604 109.645) - (xy 167.287396 109.645) (xy 167.287404 109.644999) (xy 167.539341 109.607026) (xy 167.539347 109.607024) - (xy 167.782824 109.531921) (xy 168.012376 109.421376) (xy 168.012377 109.421375) (xy 168.173185 109.311738) - (xy 167.522294 108.660846) (xy 167.538942 108.653951) (xy 167.66997 108.566401) (xy 167.781401 108.45497) - (xy 167.868951 108.323942) (xy 167.875846 108.307294) (xy 168.526544 108.957992) (xy 168.526546 108.957991) - (xy 168.568544 108.90533) (xy 168.695941 108.684671) (xy 168.789026 108.447494) (xy 168.789031 108.447477) - (xy 168.845726 108.199079) (xy 168.864767 107.945004) (xy 168.864767 107.944995) (xy 168.845726 107.69092) - (xy 168.789031 107.442522) (xy 168.789026 107.442505) (xy 168.695941 107.205328) (xy 168.695942 107.205328) - (xy 168.568545 106.984672) (xy 168.526545 106.932006) (xy 167.875846 107.582705) (xy 167.868951 107.566058) - (xy 167.781401 107.43503) (xy 167.66997 107.323599) (xy 167.538942 107.236049) (xy 167.522293 107.229152) - (xy 168.173185 106.57826) (xy 168.012384 106.468628) (xy 168.012376 106.468623) (xy 167.780003 106.35672) - (xy 167.728143 106.309898) (xy 167.70983 106.242471) (xy 167.730877 106.175847) (xy 167.780003 106.13328) - (xy 168.012376 106.021376) (xy 168.012377 106.021375) (xy 168.173185 105.911738) (xy 167.522294 105.260846) - (xy 167.538942 105.253951) (xy 167.66997 105.166401) (xy 167.781401 105.05497) (xy 167.868951 104.923942) - (xy 167.875846 104.907294) (xy 168.526544 105.557992) (xy 168.526546 105.557991) (xy 168.568544 105.50533) - (xy 168.695941 105.284671) (xy 168.789026 105.047494) (xy 168.789031 105.047477) (xy 168.845726 104.799079) - (xy 168.864767 104.545004) (xy 168.864767 104.544995) (xy 168.845726 104.29092) (xy 168.789031 104.042522) - (xy 168.789026 104.042505) (xy 168.695941 103.805328) (xy 168.695942 103.805328) (xy 168.568545 103.584672) - (xy 168.526545 103.532006) (xy 167.875846 104.182705) (xy 167.868951 104.166058) (xy 167.781401 104.03503) - (xy 167.66997 103.923599) (xy 167.538942 103.836049) (xy 167.522293 103.829152) (xy 168.173185 103.17826) - (xy 168.012384 103.068628) (xy 168.012376 103.068623) (xy 167.782823 102.958078) (xy 167.782825 102.958078) - (xy 167.539347 102.882975) (xy 167.539341 102.882973) (xy 167.287404 102.845) (xy 167.032595 102.845) - (xy 166.780658 102.882973) (xy 166.780652 102.882975) (xy 166.537175 102.958078) (xy 166.307622 103.068625) - (xy 166.307609 103.068632) (xy 166.146813 103.178259) (xy 166.797706 103.829152) (xy 166.781058 103.836049) - (xy 166.65003 103.923599) (xy 166.538599 104.03503) (xy 166.451049 104.166058) (xy 166.444152 104.182706) - (xy 165.793452 103.532006) (xy 165.751457 103.584667) (xy 165.624058 103.805328) (xy 165.530973 104.042505) - (xy 165.530968 104.042522) (xy 165.474273 104.29092) (xy 165.455233 104.544995) (xy 132.138579 104.544995) - (xy 132.144824 104.533559) (xy 132.158859 104.52148) (xy 132.21215 104.48215) (xy 132.292793 104.372882) - (xy 132.321473 104.29092) (xy 132.337646 104.244701) (xy 132.337646 104.244699) (xy 132.3405 104.214269) - (xy 132.3405 103.55573) (xy 132.337646 103.5253) (xy 132.337646 103.525298) (xy 132.292793 103.397119) - (xy 132.292792 103.397117) (xy 132.263337 103.357207) (xy 132.21215 103.28785) (xy 132.160551 103.249768) - (xy 132.118302 103.194123) (xy 132.112843 103.124467) (xy 132.14591 103.062918) (xy 132.160544 103.050236) - (xy 132.21215 103.01215) (xy 132.292793 102.902882) (xy 132.303059 102.873543) (xy 132.343779 102.81677) - (xy 132.408731 102.791022) (xy 132.420099 102.7905) (xy 133.114435 102.7905) (xy 133.114436 102.7905) - (xy 133.160943 102.778037) (xy 133.173406 102.774699) (xy 133.189511 102.770383) (xy 133.209938 102.76491) - (xy 133.295562 102.715475) (xy 133.365475 102.645562) (xy 134.244218 101.766817) (xy 134.305541 101.733333) - (xy 134.331899 101.730499) (xy 134.478986 101.730499) (xy 134.632366 101.692695) (xy 134.638453 101.6895) - (xy 134.772241 101.619282) (xy 134.890484 101.514529) (xy 134.980221 101.384522) (xy 135.036238 101.236817) - (xy 135.055279 101.079999) (xy 135.049011 101.028372) (xy 135.036238 100.92318) (xy 135.003799 100.837646) - (xy 134.980221 100.775476) (xy 134.890484 100.645469) (xy 134.772241 100.540716) (xy 134.772239 100.540715) - (xy 134.772238 100.540714) (xy 134.632366 100.467302) (xy 134.478987 100.429499) (xy 134.478986 100.429499) - (xy 134.321016 100.429499) (xy 134.321015 100.429499) (xy 134.167635 100.467302) (xy 134.027763 100.540714) - (xy 133.909517 100.64547) (xy 133.819782 100.775474) (xy 133.819781 100.775475) (xy 133.763764 100.92318) - (xy 133.744723 101.079999) (xy 133.744723 101.08) (xy 133.750897 101.130853) (xy 133.739436 101.199776) - (xy 133.715482 101.233479) (xy 132.945782 102.003181) (xy 132.884459 102.036666) (xy 132.858101 102.0395) - (xy 132.420099 102.0395) (xy 132.35306 102.019815) (xy 132.307305 101.967011) (xy 132.303065 101.956474) - (xy 132.292793 101.927118) (xy 132.21215 101.81785) (xy 132.102882 101.737207) (xy 132.10288 101.737206) - (xy 131.9747 101.692353) (xy 131.94427 101.6895) (xy 131.944266 101.6895) (xy 131.463463 101.6895) - (xy 131.396424 101.669815) (xy 131.350669 101.617011) (xy 131.340725 101.547853) (xy 131.36678 101.490799) - (xy 131.366415 101.490555) (xy 131.367922 101.488299) (xy 131.36975 101.484297) (xy 131.372746 101.481078) - (xy 131.373197 101.480402) (xy 131.373201 101.4804) (xy 131.428566 101.397539) (xy 131.4431 101.324473) - (xy 131.4431 99.819025) (xy 131.4431 99.819022) (xy 131.443099 99.81902) (xy 131.428567 99.745963) - (xy 131.428566 99.745959) (xy 131.373201 99.663098) (xy 131.29034 99.607733) (xy 131.290339 99.607732) - (xy 131.290335 99.607731) (xy 131.217277 99.593199) (xy 131.217274 99.593199) (xy 130.660726 99.593199) - (xy 130.660723 99.593199) (xy 130.587664 99.607731) (xy 130.58766 99.607732) (xy 130.504799 99.663098) - (xy 130.449433 99.745959) (xy 130.449432 99.745963) (xy 130.4349 99.81902) (xy 130.4349 101.324477) - (xy 130.449432 101.397534) (xy 130.449433 101.397538) (xy 130.467805 101.425034) (xy 130.504799 101.4804) - (xy 130.556311 101.514819) (xy 130.574271 101.536309) (xy 130.575088 101.536362) (xy 130.575681 101.533383) - (xy 130.660721 101.550298) (xy 130.660724 101.550299) (xy 131.153538 101.550299) (xy 131.220577 101.569984) - (xy 131.266332 101.622788) (xy 131.276276 101.691946) (xy 131.247251 101.755502) (xy 131.227174 101.774067) - (xy 131.208499 101.78785) (xy 131.16785 101.81785) (xy 131.087207 101.927117) (xy 131.087206 101.927119) - (xy 131.042353 102.055298) (xy 131.042353 102.0553) (xy 131.0395 102.08573) (xy 131.0395 102.744269) - (xy 131.042353 102.774699) (xy 131.042353 102.774701) (xy 131.087206 102.90288) (xy 131.087207 102.902882) - (xy 131.16785 103.01215) (xy 131.219446 103.050229) (xy 131.219447 103.05023) (xy 131.261697 103.105878) - (xy 131.267156 103.175534) (xy 131.234088 103.237083) (xy 131.219447 103.24977) (xy 131.16785 103.28785) - (xy 131.087207 103.397117) (xy 131.087206 103.397119) (xy 131.042353 103.525298) (xy 131.042353 103.5253) - (xy 131.0395 103.55573) (xy 131.0395 104.214269) (xy 131.042353 104.244699) (xy 131.042353 104.244701) - (xy 131.087206 104.37288) (xy 131.087207 104.372882) (xy 131.16785 104.48215) (xy 131.170777 104.48431) - (xy 131.173195 104.487495) (xy 131.174421 104.488721) (xy 131.174253 104.488888) (xy 131.213026 104.539959) - (xy 131.218482 104.609615) (xy 131.185413 104.671163) (xy 131.171451 104.683345) (xy 131.075313 104.755313) - (xy 130.993372 104.864773) (xy 130.981181 104.897459) (xy 130.93931 104.953392) (xy 130.873845 104.977808) - (xy 130.805572 104.962956) (xy 130.756167 104.91355) (xy 130.748819 104.897459) (xy 130.747072 104.892776) - (xy 130.736628 104.864774) (xy 130.654687 104.755313) (xy 130.654685 104.755312) (xy 130.654685 104.755311) - (xy 130.558549 104.683345) (xy 130.516677 104.627412) (xy 130.511693 104.55772) (xy 130.545178 104.496397) - (xy 130.559227 104.484307) (xy 130.56215 104.48215) (xy 130.642793 104.372882) (xy 130.671473 104.29092) - (xy 130.687646 104.244701) (xy 130.687646 104.244699) (xy 130.6905 104.214269) (xy 130.6905 103.55573) - (xy 130.687646 103.5253) (xy 130.687646 103.525298) (xy 130.642793 103.397119) (xy 130.642792 103.397117) - (xy 130.613337 103.357207) (xy 130.56215 103.28785) (xy 130.510551 103.249768) (xy 130.468302 103.194123) - (xy 130.462843 103.124467) (xy 130.49591 103.062918) (xy 130.510544 103.050236) (xy 130.56215 103.01215) - (xy 130.642793 102.902882) (xy 130.675975 102.808054) (xy 130.687646 102.774701) (xy 130.687646 102.774699) - (xy 130.6905 102.744269) (xy 130.6905 102.08573) (xy 130.687646 102.0553) (xy 130.687646 102.055298) - (xy 130.642793 101.927119) (xy 130.642792 101.927117) (xy 130.56215 101.81785) (xy 130.475171 101.753657) - (xy 130.462117 101.736464) (xy 130.450368 101.736255) (xy 130.446465 101.734961) (xy 130.324701 101.692354) - (xy 130.324699 101.692353) (xy 130.29427 101.6895) (xy 130.294266 101.6895) (xy 130.193463 101.6895) - (xy 130.126424 101.669815) (xy 130.080669 101.617011) (xy 130.070725 101.547853) (xy 130.09678 101.490799) - (xy 130.096415 101.490555) (xy 130.097922 101.488299) (xy 130.09975 101.484297) (xy 130.102746 101.481078) - (xy 130.103197 101.480402) (xy 130.103201 101.4804) (xy 130.158566 101.397539) (xy 130.1731 101.324473) - (xy 130.1731 99.819025) (xy 130.1731 99.819022) (xy 130.173099 99.81902) (xy 130.158567 99.745963) - (xy 130.158566 99.745959) (xy 130.103201 99.663098) (xy 130.02034 99.607733) (xy 130.020339 99.607732) - (xy 130.020335 99.607731) (xy 129.947277 99.593199) (xy 129.947274 99.593199) (xy 129.390726 99.593199) - (xy 129.390723 99.593199) (xy 129.317664 99.607731) (xy 129.31766 99.607732) (xy 129.234799 99.663098) - (xy 129.179433 99.745959) (xy 129.179432 99.745963) (xy 129.1649 99.81902) (xy 129.1649 100.507855) - (xy 129.145215 100.574894) (xy 129.092411 100.620649) (xy 129.023253 100.630593) (xy 128.959697 100.601568) - (xy 128.951396 100.592759) (xy 128.951222 100.592934) (xy 128.939419 100.581131) (xy 128.905934 100.519808) - (xy 128.9031 100.49345) (xy 128.9031 99.819022) (xy 128.903099 99.81902) (xy 128.888567 99.745963) - (xy 128.888566 99.745959) (xy 128.833201 99.663098) (xy 128.75034 99.607733) (xy 128.750339 99.607732) - (xy 128.750335 99.607731) (xy 128.677277 99.593199) (xy 128.677274 99.593199) (xy 128.120726 99.593199) - (xy 128.120723 99.593199) (xy 128.086531 99.6) (xy 127.441468 99.6) (xy 127.407276 99.593199) (xy 127.407274 99.593199) - (xy 126.850726 99.593199) (xy 126.850725 99.593199) (xy 126.839274 99.595477) (xy 126.832533 99.596818) - (xy 126.828516 99.597617) (xy 126.804323 99.6) (xy 126.183677 99.6) (xy 126.159484 99.597617) (xy 126.155467 99.596818) - (xy 126.148726 99.595477) (xy 126.137275 99.593199) (xy 126.137274 99.593199) (xy 125.580726 99.593199) - (xy 125.580725 99.593199) (xy 125.569274 99.595477) (xy 125.562533 99.596818) (xy 125.558516 99.597617) - (xy 125.534323 99.6) (xy 124.913677 99.6) (xy 124.889484 99.597617) (xy 124.885467 99.596818) (xy 124.878726 99.595477) - (xy 124.867275 99.593199) (xy 124.867274 99.593199) (xy 124.310726 99.593199) (xy 124.310725 99.593199) - (xy 124.299274 99.595477) (xy 124.292533 99.596818) (xy 124.288516 99.597617) (xy 124.264323 99.6) - (xy 123.806093 99.6) (xy 123.793939 99.599403) (xy 123.617065 99.581982) (xy 123.593224 99.57724) + (xy 166.174235 114.754174) (xy 166.174235 114.754175) (xy 166.152441 114.77785) (xy 166.011429 114.931029) + (xy 166.011426 114.931033) (xy 165.87995 115.13227) (xy 165.783388 115.35241) (xy 165.724379 115.585434) + (xy 165.724313 115.586239) (xy 165.724192 115.58655) (xy 165.723535 115.590493) (xy 165.722723 115.590357) + (xy 165.69916 115.651424) (xy 165.642758 115.692663) (xy 165.600736 115.7) (xy 137.522 115.7) (xy 137.454961 115.680315) + (xy 137.409206 115.627511) (xy 137.398 115.576) (xy 137.398 115.454398) (xy 137.417685 115.387359) + (xy 137.434315 115.366721) (xy 137.534217 115.266818) (xy 137.59554 115.233334) (xy 137.621898 115.2305) + (xy 137.768985 115.2305) (xy 137.922365 115.192696) (xy 137.928334 115.189563) (xy 138.06224 115.119283) + (xy 138.180483 115.01453) (xy 138.27022 114.884523) (xy 138.326237 114.736818) (xy 138.345278 114.58) + (xy 138.341698 114.550511) (xy 138.326237 114.423181) (xy 138.297961 114.348624) (xy 138.27022 114.275477) + (xy 138.180483 114.14547) (xy 138.06224 114.040717) (xy 138.062238 114.040716) (xy 138.062237 114.040715) + (xy 137.922365 113.967303) (xy 137.768986 113.9295) (xy 137.768985 113.9295) (xy 137.611015 113.9295) + (xy 137.611014 113.9295) (xy 137.457634 113.967303) (xy 137.317762 114.040715) (xy 137.199516 114.145471) + (xy 137.109781 114.275475) (xy 137.10978 114.275476) (xy 137.053763 114.423181) (xy 137.034722 114.58) + (xy 137.034722 114.580001) (xy 137.040896 114.630854) (xy 137.029435 114.699777) (xy 137.005481 114.73348) + (xy 136.791938 114.947025) (xy 136.722026 115.016936) (xy 136.672591 115.102559) (xy 136.67259 115.10256) + (xy 136.670661 115.109761) (xy 136.665523 115.128937) (xy 136.648441 115.192689) (xy 136.64844 115.192692) + (xy 136.647 115.198065) (xy 136.647 115.576) (xy 136.627315 115.643039) (xy 136.574511 115.688794) + (xy 136.523 115.7) (xy 134.452099 115.7) (xy 134.38506 115.680315) (xy 134.339305 115.627511) (xy 134.329361 115.558353) + (xy 134.336159 115.532025) (xy 134.336236 115.53182) (xy 134.336237 115.531818) (xy 134.355278 115.375) + (xy 134.349525 115.327615) (xy 134.336237 115.218181) (xy 134.302391 115.128937) (xy 134.28022 115.070477) + (xy 134.190483 114.94047) (xy 134.07224 114.835717) (xy 134.072238 114.835716) (xy 134.072237 114.835715) + (xy 133.932365 114.762303) (xy 133.778986 114.7245) (xy 133.778985 114.7245) (xy 133.621015 114.7245) + (xy 133.621014 114.7245) (xy 133.467634 114.762303) (xy 133.327762 114.835715) (xy 133.209516 114.94047) + (xy 133.207089 114.943987) (xy 133.205742 114.945938) (xy 133.151463 114.989929) (xy 133.103692 114.9995) + (xy 130.100099 114.9995) (xy 130.03306 114.979815) (xy 129.987305 114.927011) (xy 129.983065 114.916474) + (xy 129.972793 114.887118) (xy 129.89215 114.77785) (xy 129.782882 114.697207) (xy 129.78288 114.697206) + (xy 129.6547 114.652353) (xy 129.62427 114.6495) (xy 129.624266 114.6495) (xy 129.115734 114.6495) + (xy 129.11573 114.6495) (xy 129.0853 114.652353) (xy 129.085298 114.652353) (xy 128.957119 114.697206) + (xy 128.957117 114.697207) (xy 128.84785 114.77785) (xy 128.767207 114.887117) (xy 128.767206 114.887119) + (xy 128.722353 115.015298) (xy 128.722353 115.0153) (xy 128.7195 115.04573) (xy 128.7195 115.214821) + (xy 128.699815 115.28186) (xy 128.647011 115.327615) (xy 128.577853 115.337559) (xy 128.514297 115.308534) + (xy 128.499647 115.293486) (xy 128.476277 115.26501) (xy 128.462772 115.244798) (xy 128.385052 115.099394) + (xy 128.37106 115.048592) (xy 128.370771 115.04862) (xy 128.370617 115.046982) (xy 128.370546 115.046723) + (xy 128.370499 115.04573) (xy 128.367646 115.015301) (xy 128.367646 115.0153) (xy 128.367646 115.015298) + (xy 128.321625 114.88378) (xy 128.315265 114.854988) (xy 128.300597 114.70606) (xy 128.3 114.693907) + (xy 128.3 111.652158) (xy 128.319685 111.585119) (xy 128.366376 111.542361) (xy 128.372236 111.539285) + (xy 128.372235 111.539285) (xy 128.37224 111.539283) (xy 128.490483 111.43453) (xy 128.58022 111.304523) + (xy 128.636237 111.156818) (xy 128.655278 111) (xy 128.636237 110.843182) (xy 128.58022 110.695477) + (xy 128.490483 110.56547) (xy 128.37224 110.460717) (xy 128.372238 110.460716) (xy 128.372237 110.460715) + (xy 128.366369 110.457635) (xy 128.316159 110.409047) (xy 128.3 110.347841) (xy 128.3 108.92444) + (xy 128.319685 108.857401) (xy 128.372489 108.811646) (xy 128.441647 108.801702) (xy 128.453663 108.80404) + (xy 128.561015 108.8305) (xy 128.718985 108.8305) (xy 128.872365 108.792696) (xy 129.01224 108.719283) + (xy 129.130483 108.61453) (xy 129.22022 108.484523) (xy 129.276237 108.336818) (xy 129.295278 108.18) + (xy 129.288799 108.126636) (xy 129.276237 108.023181) (xy 129.246588 107.945004) (xy 129.22022 107.875477) + (xy 129.130483 107.74547) (xy 129.062272 107.68504) (xy 129.025146 107.62585) (xy 129.0205 107.592225) + (xy 129.0205 104.690099) (xy 129.040185 104.62306) (xy 129.092989 104.577305) (xy 129.103525 104.573065) + (xy 129.132882 104.562793) (xy 129.24215 104.48215) (xy 129.280231 104.430551) (xy 129.335877 104.388302) + (xy 129.405533 104.382843) (xy 129.467082 104.41591) (xy 129.479763 104.430544) (xy 129.51785 104.48215) + (xy 129.537154 104.496397) (xy 129.571128 104.521471) (xy 129.613379 104.577118) (xy 129.618838 104.646774) + (xy 129.585771 104.708324) (xy 129.571807 104.720507) (xy 129.525314 104.755312) (xy 129.443373 104.864771) + (xy 129.431181 104.897459) (xy 129.400961 104.978482) (xy 129.395587 104.992889) (xy 129.3895 105.049498) + (xy 129.3895 105.640481) (xy 129.389501 105.64049) (xy 129.395587 105.697114) (xy 129.42618 105.779133) + (xy 129.443372 105.825226) (xy 129.525313 105.934687) (xy 129.534148 105.941301) (xy 129.57602 105.997232) + (xy 129.581006 106.066923) (xy 129.561889 106.111008) (xy 129.489781 106.215475) (xy 129.48978 106.215476) + (xy 129.433762 106.363181) (xy 129.414722 106.519999) (xy 129.414722 106.52) (xy 129.433762 106.676818) + (xy 129.465194 106.759696) (xy 129.48978 106.824523) (xy 129.579517 106.95453) (xy 129.69776 107.059283) + (xy 129.697762 107.059284) (xy 129.837634 107.132696) (xy 129.991014 107.1705) (xy 129.991015 107.1705) + (xy 130.148985 107.1705) (xy 130.302365 107.132696) (xy 130.304897 107.131367) (xy 130.44224 107.059283) + (xy 130.560483 106.95453) (xy 130.65022 106.824523) (xy 130.706237 106.676818) (xy 130.725278 106.52) + (xy 130.706237 106.363182) (xy 130.703786 106.35672) (xy 130.673981 106.27813) (xy 130.65022 106.215477) + (xy 130.650218 106.215474) (xy 130.650216 106.21547) (xy 130.591738 106.130749) (xy 130.569855 106.064395) + (xy 130.587321 105.996743) (xy 130.619475 105.961045) (xy 130.654687 105.934687) (xy 130.736628 105.825226) + (xy 130.748819 105.792538) (xy 130.790687 105.736609) (xy 130.85615 105.712191) (xy 130.924424 105.727042) + (xy 130.97383 105.776446) (xy 130.98118 105.792539) (xy 130.993372 105.825227) (xy 131.054712 105.907168) + (xy 131.075312 105.934686) (xy 131.075314 105.934688) (xy 131.184774 106.016628) (xy 131.192562 106.020881) + (xy 131.191813 106.022252) (xy 131.239763 106.058143) (xy 131.264184 106.123606) (xy 131.2645 106.132459) + (xy 131.2645 109.060951) (xy 131.244815 109.12799) (xy 131.222729 109.153765) (xy 131.209518 109.165468) + (xy 131.209515 109.165472) (xy 131.119781 109.295475) (xy 131.11978 109.295476) (xy 131.063762 109.443181) + (xy 131.044722 109.599999) (xy 131.044722 109.6) (xy 131.063762 109.756818) (xy 131.097026 109.844526) + (xy 131.11978 109.904523) (xy 131.209517 110.03453) (xy 131.32776 110.139283) (xy 131.327762 110.139284) + (xy 131.467634 110.212696) (xy 131.621014 110.2505) (xy 131.621015 110.2505) (xy 131.778985 110.2505) + (xy 131.932365 110.212696) (xy 131.967158 110.194435) (xy 132.07224 110.139283) (xy 132.190483 110.03453) + (xy 132.28022 109.904523) (xy 132.336237 109.756818) (xy 132.355278 109.6) (xy 132.344678 109.512696) + (xy 132.336237 109.443181) (xy 132.303641 109.357234) (xy 132.28022 109.295477) (xy 132.190483 109.16547) + (xy 132.07224 109.060717) (xy 132.072237 109.060715) (xy 132.072231 109.06071) (xy 132.069052 109.058515) + (xy 132.067266 109.056311) (xy 132.066626 109.055744) (xy 132.06672 109.055637) (xy 132.025066 109.004229) + (xy 132.0155 108.956471) (xy 132.0155 106.132459) (xy 132.035185 106.06542) (xy 132.087989 106.019665) + (xy 132.094928 106.01679) (xy 132.095222 106.016629) (xy 132.095226 106.016628) (xy 132.204687 105.934687) + (xy 132.286628 105.825226) (xy 132.334412 105.697114) (xy 132.336687 105.675944) (xy 132.340499 105.640501) + (xy 132.340499 105.64049) (xy 132.3405 105.640485) (xy 132.340499 105.049516) (xy 132.334412 104.992886) + (xy 132.286628 104.864774) (xy 132.204687 104.755313) (xy 132.204685 104.755311) (xy 132.204684 104.75531) + (xy 132.158193 104.720507) (xy 132.116322 104.664573) (xy 132.111338 104.594882) (xy 132.138579 104.544995) + (xy 165.455233 104.544995) (xy 165.455233 104.545004) (xy 165.474273 104.799079) (xy 165.530968 105.047477) + (xy 165.530973 105.047494) (xy 165.624058 105.284671) (xy 165.624057 105.284671) (xy 165.751454 105.505327) + (xy 165.751461 105.505338) (xy 165.793452 105.557991) (xy 165.793453 105.557992) (xy 166.444152 104.907292) + (xy 166.451049 104.923942) (xy 166.538599 105.05497) (xy 166.65003 105.166401) (xy 166.781058 105.253951) + (xy 166.797705 105.260846) (xy 166.146813 105.911738) (xy 166.307616 106.021371) (xy 166.307625 106.021376) + (xy 166.539996 106.13328) (xy 166.591856 106.180102) (xy 166.610169 106.247529) (xy 166.589121 106.314153) + (xy 166.539996 106.35672) (xy 166.307622 106.468625) (xy 166.307609 106.468632) (xy 166.146813 106.578259) + (xy 166.797706 107.229152) (xy 166.781058 107.236049) (xy 166.65003 107.323599) (xy 166.538599 107.43503) + (xy 166.451049 107.566058) (xy 166.444152 107.582706) (xy 165.793452 106.932006) (xy 165.751457 106.984667) + (xy 165.624058 107.205328) (xy 165.530973 107.442505) (xy 165.530968 107.442522) (xy 165.474273 107.69092) + (xy 165.455233 107.944995) (xy 165.455233 107.945004) (xy 165.474273 108.199079) (xy 165.530968 108.447477) + (xy 165.530973 108.447494) (xy 165.624058 108.684671) (xy 165.624057 108.684671) (xy 165.751454 108.905327) + (xy 165.751461 108.905338) (xy 165.793452 108.957991) (xy 165.793453 108.957992) (xy 166.444152 108.307292) + (xy 166.451049 108.323942) (xy 166.538599 108.45497) (xy 166.65003 108.566401) (xy 166.781058 108.653951) + (xy 166.797705 108.660846) (xy 166.146813 109.311738) (xy 166.307616 109.421371) (xy 166.307624 109.421376) + (xy 166.537176 109.531921) (xy 166.537174 109.531921) (xy 166.780652 109.607024) (xy 166.780658 109.607026) + (xy 167.032595 109.644999) (xy 167.032604 109.645) (xy 167.287396 109.645) (xy 167.287404 109.644999) + (xy 167.539341 109.607026) (xy 167.539347 109.607024) (xy 167.782824 109.531921) (xy 168.012376 109.421376) + (xy 168.012377 109.421375) (xy 168.173185 109.311738) (xy 167.522294 108.660846) (xy 167.538942 108.653951) + (xy 167.66997 108.566401) (xy 167.781401 108.45497) (xy 167.868951 108.323942) (xy 167.875846 108.307294) + (xy 168.526544 108.957992) (xy 168.526546 108.957991) (xy 168.568544 108.90533) (xy 168.695941 108.684671) + (xy 168.789026 108.447494) (xy 168.789031 108.447477) (xy 168.845726 108.199079) (xy 168.864767 107.945004) + (xy 168.864767 107.944995) (xy 168.845726 107.69092) (xy 168.789031 107.442522) (xy 168.789026 107.442505) + (xy 168.695941 107.205328) (xy 168.695942 107.205328) (xy 168.568545 106.984672) (xy 168.526545 106.932006) + (xy 167.875846 107.582705) (xy 167.868951 107.566058) (xy 167.781401 107.43503) (xy 167.66997 107.323599) + (xy 167.538942 107.236049) (xy 167.522293 107.229152) (xy 168.173185 106.57826) (xy 168.012384 106.468628) + (xy 168.012376 106.468623) (xy 167.780003 106.35672) (xy 167.728143 106.309898) (xy 167.70983 106.242471) + (xy 167.730877 106.175847) (xy 167.780003 106.13328) (xy 168.012376 106.021376) (xy 168.012377 106.021375) + (xy 168.173185 105.911738) (xy 167.522294 105.260846) (xy 167.538942 105.253951) (xy 167.66997 105.166401) + (xy 167.781401 105.05497) (xy 167.868951 104.923942) (xy 167.875846 104.907294) (xy 168.526544 105.557992) + (xy 168.526546 105.557991) (xy 168.568544 105.50533) (xy 168.695941 105.284671) (xy 168.789026 105.047494) + (xy 168.789031 105.047477) (xy 168.845726 104.799079) (xy 168.864767 104.545004) (xy 168.864767 104.544995) + (xy 168.845726 104.29092) (xy 168.789031 104.042522) (xy 168.789026 104.042505) (xy 168.695941 103.805328) + (xy 168.695942 103.805328) (xy 168.568545 103.584672) (xy 168.526545 103.532006) (xy 167.875846 104.182705) + (xy 167.868951 104.166058) (xy 167.781401 104.03503) (xy 167.66997 103.923599) (xy 167.538942 103.836049) + (xy 167.522293 103.829152) (xy 168.173185 103.17826) (xy 168.012384 103.068628) (xy 168.012376 103.068623) + (xy 167.782823 102.958078) (xy 167.782825 102.958078) (xy 167.539347 102.882975) (xy 167.539341 102.882973) + (xy 167.287404 102.845) (xy 167.032595 102.845) (xy 166.780658 102.882973) (xy 166.780652 102.882975) + (xy 166.537175 102.958078) (xy 166.307622 103.068625) (xy 166.307609 103.068632) (xy 166.146813 103.178259) + (xy 166.797706 103.829152) (xy 166.781058 103.836049) (xy 166.65003 103.923599) (xy 166.538599 104.03503) + (xy 166.451049 104.166058) (xy 166.444152 104.182706) (xy 165.793452 103.532006) (xy 165.751457 103.584667) + (xy 165.624058 103.805328) (xy 165.530973 104.042505) (xy 165.530968 104.042522) (xy 165.474273 104.29092) + (xy 165.455233 104.544995) (xy 132.138579 104.544995) (xy 132.144824 104.533559) (xy 132.158859 104.52148) + (xy 132.21215 104.48215) (xy 132.292793 104.372882) (xy 132.321473 104.29092) (xy 132.337646 104.244701) + (xy 132.337646 104.244699) (xy 132.3405 104.214269) (xy 132.3405 103.55573) (xy 132.337646 103.5253) + (xy 132.337646 103.525298) (xy 132.292793 103.397119) (xy 132.292792 103.397117) (xy 132.263337 103.357207) + (xy 132.21215 103.28785) (xy 132.160551 103.249768) (xy 132.118302 103.194123) (xy 132.112843 103.124467) + (xy 132.14591 103.062918) (xy 132.160544 103.050236) (xy 132.21215 103.01215) (xy 132.292793 102.902882) + (xy 132.303059 102.873543) (xy 132.343779 102.81677) (xy 132.408731 102.791022) (xy 132.420099 102.7905) + (xy 133.114435 102.7905) (xy 133.114436 102.7905) (xy 133.160943 102.778037) (xy 133.173406 102.774699) + (xy 133.189511 102.770383) (xy 133.209938 102.76491) (xy 133.295562 102.715475) (xy 133.365475 102.645562) + (xy 134.244218 101.766817) (xy 134.305541 101.733333) (xy 134.331899 101.730499) (xy 134.478986 101.730499) + (xy 134.632366 101.692695) (xy 134.638453 101.6895) (xy 134.772241 101.619282) (xy 134.890484 101.514529) + (xy 134.980221 101.384522) (xy 135.036238 101.236817) (xy 135.055279 101.079999) (xy 135.049011 101.028372) + (xy 135.036238 100.92318) (xy 135.003799 100.837646) (xy 134.980221 100.775476) (xy 134.890484 100.645469) + (xy 134.772241 100.540716) (xy 134.772239 100.540715) (xy 134.772238 100.540714) (xy 134.632366 100.467302) + (xy 134.478987 100.429499) (xy 134.478986 100.429499) (xy 134.321016 100.429499) (xy 134.321015 100.429499) + (xy 134.167635 100.467302) (xy 134.027763 100.540714) (xy 133.909517 100.64547) (xy 133.819782 100.775474) + (xy 133.819781 100.775475) (xy 133.763764 100.92318) (xy 133.744723 101.079999) (xy 133.744723 101.08) + (xy 133.750897 101.130853) (xy 133.739436 101.199776) (xy 133.715482 101.233479) (xy 132.945782 102.003181) + (xy 132.884459 102.036666) (xy 132.858101 102.0395) (xy 132.420099 102.0395) (xy 132.35306 102.019815) + (xy 132.307305 101.967011) (xy 132.303065 101.956474) (xy 132.292793 101.927118) (xy 132.21215 101.81785) + (xy 132.102882 101.737207) (xy 132.10288 101.737206) (xy 131.9747 101.692353) (xy 131.94427 101.6895) + (xy 131.944266 101.6895) (xy 131.463463 101.6895) (xy 131.396424 101.669815) (xy 131.350669 101.617011) + (xy 131.340725 101.547853) (xy 131.36678 101.490799) (xy 131.366415 101.490555) (xy 131.367922 101.488299) + (xy 131.36975 101.484297) (xy 131.372746 101.481078) (xy 131.373197 101.480402) (xy 131.373201 101.4804) + (xy 131.428566 101.397539) (xy 131.4431 101.324473) (xy 131.4431 99.819025) (xy 131.4431 99.819022) + (xy 131.443099 99.81902) (xy 131.428567 99.745963) (xy 131.428566 99.745959) (xy 131.373201 99.663098) + (xy 131.317535 99.625904) (xy 131.290339 99.607732) (xy 131.290335 99.607731) (xy 131.217277 99.593199) + (xy 131.217274 99.593199) (xy 130.660726 99.593199) (xy 130.660723 99.593199) (xy 130.587664 99.607731) + (xy 130.58766 99.607732) (xy 130.504799 99.663098) (xy 130.449433 99.745959) (xy 130.449432 99.745963) + (xy 130.4349 99.81902) (xy 130.4349 101.324477) (xy 130.449432 101.397534) (xy 130.449433 101.397538) + (xy 130.467805 101.425034) (xy 130.504799 101.4804) (xy 130.556311 101.514819) (xy 130.574271 101.536309) + (xy 130.575088 101.536362) (xy 130.575681 101.533383) (xy 130.660721 101.550298) (xy 130.660724 101.550299) + (xy 131.153538 101.550299) (xy 131.220577 101.569984) (xy 131.266332 101.622788) (xy 131.276276 101.691946) + (xy 131.247251 101.755502) (xy 131.227174 101.774067) (xy 131.208499 101.78785) (xy 131.16785 101.81785) + (xy 131.087207 101.927117) (xy 131.087206 101.927119) (xy 131.042353 102.055298) (xy 131.042353 102.0553) + (xy 131.0395 102.08573) (xy 131.0395 102.744269) (xy 131.042353 102.774699) (xy 131.042353 102.774701) + (xy 131.087206 102.90288) (xy 131.087207 102.902882) (xy 131.16785 103.01215) (xy 131.219446 103.050229) + (xy 131.219447 103.05023) (xy 131.261697 103.105878) (xy 131.267156 103.175534) (xy 131.234088 103.237083) + (xy 131.219447 103.24977) (xy 131.16785 103.28785) (xy 131.087207 103.397117) (xy 131.087206 103.397119) + (xy 131.042353 103.525298) (xy 131.042353 103.5253) (xy 131.0395 103.55573) (xy 131.0395 104.214269) + (xy 131.042353 104.244699) (xy 131.042353 104.244701) (xy 131.087206 104.37288) (xy 131.087207 104.372882) + (xy 131.16785 104.48215) (xy 131.170777 104.48431) (xy 131.173195 104.487495) (xy 131.174421 104.488721) + (xy 131.174253 104.488888) (xy 131.213026 104.539959) (xy 131.218482 104.609615) (xy 131.185413 104.671163) + (xy 131.171451 104.683345) (xy 131.075313 104.755313) (xy 130.993372 104.864773) (xy 130.981181 104.897459) + (xy 130.93931 104.953392) (xy 130.873845 104.977808) (xy 130.805572 104.962956) (xy 130.756167 104.91355) + (xy 130.748819 104.897459) (xy 130.747072 104.892776) (xy 130.736628 104.864774) (xy 130.654687 104.755313) + (xy 130.654685 104.755312) (xy 130.654685 104.755311) (xy 130.558549 104.683345) (xy 130.516677 104.627412) + (xy 130.511693 104.55772) (xy 130.545178 104.496397) (xy 130.559227 104.484307) (xy 130.56215 104.48215) + (xy 130.642793 104.372882) (xy 130.671473 104.29092) (xy 130.687646 104.244701) (xy 130.687646 104.244699) + (xy 130.6905 104.214269) (xy 130.6905 103.55573) (xy 130.687646 103.5253) (xy 130.687646 103.525298) + (xy 130.642793 103.397119) (xy 130.642792 103.397117) (xy 130.613337 103.357207) (xy 130.56215 103.28785) + (xy 130.510551 103.249768) (xy 130.468302 103.194123) (xy 130.462843 103.124467) (xy 130.49591 103.062918) + (xy 130.510544 103.050236) (xy 130.56215 103.01215) (xy 130.642793 102.902882) (xy 130.675975 102.808054) + (xy 130.687646 102.774701) (xy 130.687646 102.774699) (xy 130.6905 102.744269) (xy 130.6905 102.08573) + (xy 130.687646 102.0553) (xy 130.687646 102.055298) (xy 130.642793 101.927119) (xy 130.642792 101.927117) + (xy 130.56215 101.81785) (xy 130.475171 101.753657) (xy 130.462117 101.736464) (xy 130.450368 101.736255) + (xy 130.446465 101.734961) (xy 130.324701 101.692354) (xy 130.324699 101.692353) (xy 130.29427 101.6895) + (xy 130.294266 101.6895) (xy 130.193463 101.6895) (xy 130.126424 101.669815) (xy 130.080669 101.617011) + (xy 130.070725 101.547853) (xy 130.09678 101.490799) (xy 130.096415 101.490555) (xy 130.097922 101.488299) + (xy 130.09975 101.484297) (xy 130.102746 101.481078) (xy 130.103197 101.480402) (xy 130.103201 101.4804) + (xy 130.158566 101.397539) (xy 130.1731 101.324473) (xy 130.1731 99.819025) (xy 130.1731 99.819022) + (xy 130.173099 99.81902) (xy 130.158567 99.745963) (xy 130.158566 99.745959) (xy 130.103201 99.663098) + (xy 130.047535 99.625904) (xy 130.020339 99.607732) (xy 130.020335 99.607731) (xy 129.947277 99.593199) + (xy 129.947274 99.593199) (xy 129.390726 99.593199) (xy 129.390723 99.593199) (xy 129.317664 99.607731) + (xy 129.31766 99.607732) (xy 129.234799 99.663098) (xy 129.179433 99.745959) (xy 129.179432 99.745963) + (xy 129.1649 99.81902) (xy 129.1649 100.507855) (xy 129.145215 100.574894) (xy 129.092411 100.620649) + (xy 129.023253 100.630593) (xy 128.959697 100.601568) (xy 128.951396 100.592759) (xy 128.951222 100.592934) + (xy 128.939419 100.581131) (xy 128.905934 100.519808) (xy 128.9031 100.49345) (xy 128.9031 99.819022) + (xy 128.903099 99.81902) (xy 128.888567 99.745963) (xy 128.888566 99.745959) (xy 128.833201 99.663098) + (xy 128.777535 99.625904) (xy 128.750339 99.607732) (xy 128.750335 99.607731) (xy 128.677277 99.593199) + (xy 128.677274 99.593199) (xy 128.120726 99.593199) (xy 128.120723 99.593199) (xy 128.047664 99.607731) + (xy 128.04766 99.607732) (xy 127.964796 99.6631) (xy 127.946582 99.690359) (xy 127.892969 99.735163) + (xy 127.823644 99.743869) (xy 127.785029 99.730824) (xy 127.682684 99.67612) (xy 127.517147 99.625904) + (xy 127.484257 99.610349) (xy 127.480341 99.607733) (xy 127.48034 99.607732) (xy 127.407276 99.593199) + (xy 127.407274 99.593199) (xy 126.850726 99.593199) (xy 126.850725 99.593199) (xy 126.839274 99.595477) + (xy 126.832533 99.596818) (xy 126.828516 99.597617) (xy 126.804323 99.6) (xy 126.183677 99.6) (xy 126.159484 99.597617) + (xy 126.155467 99.596818) (xy 126.148726 99.595477) (xy 126.137275 99.593199) (xy 126.137274 99.593199) + (xy 125.580726 99.593199) (xy 125.580725 99.593199) (xy 125.569274 99.595477) (xy 125.562533 99.596818) + (xy 125.558516 99.597617) (xy 125.534323 99.6) (xy 124.913677 99.6) (xy 124.889484 99.597617) (xy 124.885467 99.596818) + (xy 124.878726 99.595477) (xy 124.867275 99.593199) (xy 124.867274 99.593199) (xy 124.310726 99.593199) + (xy 124.310725 99.593199) (xy 124.299274 99.595477) (xy 124.292533 99.596818) (xy 124.288516 99.597617) + (xy 124.264323 99.6) (xy 123.806093 99.6) (xy 123.793939 99.599403) (xy 123.617065 99.581982) (xy 123.593224 99.57724) (xy 123.429001 99.527424) (xy 123.406543 99.518121) (xy 123.255201 99.437227) (xy 123.234989 99.423722) (xy 123.102333 99.314854) (xy 123.085145 99.297666) (xy 122.976277 99.16501) (xy 122.962772 99.144798) (xy 122.881878 98.993456) (xy 122.872575 98.970998) (xy 122.822757 98.806769) (xy 122.818018 98.782941) @@ -160613,13 +164882,15 @@ (xy 127.451656 96.1) (xy 128.076344 96.1) (xy 128.100537 96.102383) (xy 128.120725 96.106399) (xy 128.120726 96.106399) (xy 128.677275 96.106399) (xy 128.697463 96.102383) (xy 128.721656 96.1) (xy 129.346344 96.1) (xy 129.370537 96.102383) (xy 129.390725 96.106399) (xy 129.390726 96.106399) (xy 129.947275 96.106399) (xy 129.967463 96.102383) - (xy 129.991656 96.1) (xy 130.499996 96.1) (xy 130.5 96.1) (xy 130.628554 96.1) (xy 130.660723 96.106399) - (xy 130.660726 96.106399) (xy 131.217276 96.106399) (xy 131.217277 96.106398) (xy 131.249443 96.1) - (xy 131.5 96.1) (xy 131.5 95.006092) (xy 131.500597 94.993938) (xy 131.518018 94.817056) (xy 131.522757 94.793232) - (xy 131.572577 94.628994) (xy 131.581875 94.606549) (xy 131.662775 94.455195) (xy 131.676272 94.434995) - (xy 131.785149 94.302328) (xy 131.802328 94.285149) (xy 131.934995 94.176272) (xy 131.955195 94.162775) - (xy 132.106549 94.081875) (xy 132.128994 94.072577) (xy 132.293232 94.022757) (xy 132.317056 94.018018) - (xy 132.493939 94.000597) (xy 132.506093 94) (xy 142.093907 94) + (xy 129.991656 96.1) (xy 130.499996 96.1) (xy 130.5 96.1) (xy 130.567677 96.093334) (xy 130.604021 96.09512) + (xy 130.660723 96.106399) (xy 130.660726 96.106399) (xy 131.217276 96.106399) (xy 131.217277 96.106398) + (xy 131.29034 96.091865) (xy 131.373201 96.0365) (xy 131.428566 95.953639) (xy 131.4431 95.880573) + (xy 131.4431 95.437716) (xy 131.448439 95.401721) (xy 131.480785 95.29509) (xy 131.5 95.1) (xy 131.5 95.006092) + (xy 131.500597 94.993938) (xy 131.518018 94.817056) (xy 131.522757 94.793232) (xy 131.572577 94.628994) + (xy 131.581875 94.606549) (xy 131.662775 94.455195) (xy 131.676272 94.434995) (xy 131.785149 94.302328) + (xy 131.802328 94.285149) (xy 131.934995 94.176272) (xy 131.955195 94.162775) (xy 132.106549 94.081875) + (xy 132.128994 94.072577) (xy 132.293232 94.022757) (xy 132.317056 94.018018) (xy 132.493939 94.000597) + (xy 132.506093 94) (xy 142.093907 94) ) ) ) @@ -160643,24 +164914,22 @@ ) (polygon (pts - (xy 267.2 197.8) (xy 262.9 197.8) (xy 262.9 187.8) (xy 267.2 187.8) + (xy 267.2 197.5) (xy 262.9 197.5) (xy 262.9 187.8) (xy 267.2 187.8) ) ) (filled_polygon (layer "F.Cu") (pts - (xy 267.2 197.772224) (xy 267.166954 197.73736) (xy 267.148628 197.705178) (xy 267.148625 197.705175) - (xy 267.148624 197.705172) (xy 267.102869 197.652368) (xy 267.070095 197.620743) (xy 266.98176 197.574535) - (xy 266.981759 197.574534) (xy 266.981758 197.574534) (xy 266.981758 197.574533) (xy 266.914726 197.554851) - (xy 266.914714 197.554848) (xy 266.842737 197.5445) (xy 266.842736 197.5445) (xy 263.282825 197.5445) - (xy 263.215786 197.524815) (xy 263.204167 197.516358) (xy 263.202339 197.514858) (xy 263.185144 197.497665) - (xy 263.076277 197.36501) (xy 263.062772 197.344798) (xy 262.981878 197.193456) (xy 262.972575 197.170998) - (xy 262.922757 197.006769) (xy 262.918018 196.982941) (xy 262.900597 196.806061) (xy 262.9 196.793907) - (xy 262.9 188.806092) (xy 262.900597 188.793938) (xy 262.918018 188.617056) (xy 262.922757 188.593232) - (xy 262.972577 188.428994) (xy 262.981875 188.406549) (xy 263.062775 188.255195) (xy 263.076272 188.234995) - (xy 263.185149 188.102328) (xy 263.202328 188.085149) (xy 263.334995 187.976272) (xy 263.355195 187.962775) - (xy 263.506549 187.881875) (xy 263.528994 187.872577) (xy 263.693232 187.822757) (xy 263.717056 187.818018) - (xy 263.893939 187.800597) (xy 263.906093 187.8) (xy 266.199997 187.8) (xy 266.2 187.8) (xy 267.2 187.8) + (xy 267.2 197.5) (xy 266.2 197.5) (xy 263.906093 197.5) (xy 263.893939 197.499403) (xy 263.717065 197.481982) + (xy 263.693224 197.47724) (xy 263.529001 197.427424) (xy 263.506543 197.418121) (xy 263.355201 197.337227) + (xy 263.334989 197.323722) (xy 263.202333 197.214854) (xy 263.185145 197.197666) (xy 263.076277 197.06501) + (xy 263.062772 197.044798) (xy 262.981878 196.893456) (xy 262.972575 196.870998) (xy 262.922757 196.706769) + (xy 262.918018 196.682941) (xy 262.900597 196.506061) (xy 262.9 196.493907) (xy 262.9 188.806092) + (xy 262.900597 188.793938) (xy 262.918018 188.617056) (xy 262.922757 188.593232) (xy 262.972577 188.428994) + (xy 262.981875 188.406549) (xy 263.062775 188.255195) (xy 263.076272 188.234995) (xy 263.185149 188.102328) + (xy 263.202328 188.085149) (xy 263.334995 187.976272) (xy 263.355195 187.962775) (xy 263.506549 187.881875) + (xy 263.528994 187.872577) (xy 263.693232 187.822757) (xy 263.717056 187.818018) (xy 263.893939 187.800597) + (xy 263.906093 187.8) (xy 266.199997 187.8) (xy 266.2 187.8) (xy 267.2 187.8) ) ) ) @@ -160835,71 +165104,72 @@ (xy 259.616466 133.187149) (xy 259.583607 133.370362) (xy 259.580715 133.382776) (xy 259.072832 135.146999) (xy 259.069525 135.156896) (xy 259.015173 135.299356) (xy 259.006128 135.318146) (xy 258.931332 135.444973) (xy 258.919266 135.46198) (xy 258.820894 135.578484) (xy 258.813832 135.586167) (xy 257.00713 137.392868) - (xy 257.006929 137.39307) (xy 257 137.4) (xy 256.993142 137.407134) (xy 256.993128 137.40715) (xy 215.103949 180.991843) - (xy 215.103945 180.991846) (xy 215 181.1) (xy 214.932367 181.233886) (xy 214.932357 181.233903) - (xy 210.207425 190.58734) (xy 210.207421 190.58735) (xy 210.1 190.8) (xy 210.1 191.03824) (xy 210.1 200.993907) - (xy 210.099403 201.006061) (xy 210.081982 201.182934) (xy 210.07724 201.206775) (xy 210.027424 201.370998) - (xy 210.018121 201.393456) (xy 209.937227 201.544798) (xy 209.923722 201.56501) (xy 209.814854 201.697666) - (xy 209.797666 201.714854) (xy 209.66501 201.823722) (xy 209.644798 201.837227) (xy 209.493456 201.918121) - (xy 209.470998 201.927424) (xy 209.306775 201.97724) (xy 209.282934 201.981982) (xy 209.106061 201.999403) - (xy 209.093907 202) (xy 198.2945 202) (xy 198.227461 201.980315) (xy 198.181706 201.927511) (xy 198.1705 201.876) - (xy 198.1705 201.391898) (xy 198.190185 201.324859) (xy 198.206814 201.304222) (xy 199.414217 200.096818) - (xy 199.47554 200.063334) (xy 199.501898 200.0605) (xy 199.648985 200.0605) (xy 199.802365 200.022696) - (xy 199.818886 200.014025) (xy 199.94224 199.949283) (xy 200.060483 199.84453) (xy 200.15022 199.714523) - (xy 200.206237 199.566818) (xy 200.225278 199.41) (xy 200.206237 199.253182) (xy 200.15022 199.105477) - (xy 200.060483 198.97547) (xy 199.94224 198.870717) (xy 199.942238 198.870716) (xy 199.942237 198.870715) - (xy 199.802365 198.797303) (xy 199.648986 198.7595) (xy 199.648985 198.7595) (xy 199.491015 198.7595) - (xy 199.491014 198.7595) (xy 199.337634 198.797303) (xy 199.197762 198.870715) (xy 199.079516 198.975471) - (xy 198.989781 199.105475) (xy 198.98978 199.105476) (xy 198.933763 199.253181) (xy 198.914722 199.41) - (xy 198.920896 199.460854) (xy 198.909435 199.529777) (xy 198.885481 199.56348) (xy 198.270262 200.178699) - (xy 198.208939 200.212184) (xy 198.139247 200.2072) (xy 198.111829 200.189579) (xy 198.110756 200.191186) - (xy 198.100601 200.184401) (xy 198.100601 200.1844) (xy 198.01774 200.129035) (xy 198.017739 200.129034) - (xy 198.017735 200.129033) (xy 197.944677 200.114501) (xy 197.944674 200.114501) (xy 196.345326 200.114501) - (xy 196.345323 200.114501) (xy 196.272264 200.129033) (xy 196.27226 200.129034) (xy 196.189399 200.1844) - (xy 196.134033 200.267261) (xy 196.134032 200.267265) (xy 196.1195 200.340322) (xy 196.1195 201.876) - (xy 196.099815 201.943039) (xy 196.047011 201.988794) (xy 195.9955 202) (xy 195.4145 202) (xy 195.347461 201.980315) - (xy 195.301706 201.927511) (xy 195.2905 201.876) (xy 195.290499 200.643481) (xy 195.290498 200.643474) - (xy 195.275646 200.549695) (xy 195.21805 200.436657) (xy 195.218046 200.436653) (xy 195.218045 200.436651) - (xy 195.128347 200.346953) (xy 195.128344 200.346951) (xy 195.128342 200.346949) (xy 195.042184 200.303049) - (xy 195.015301 200.289351) (xy 194.921524 200.274499) (xy 194.558482 200.274499) (xy 194.487649 200.285717) - (xy 194.464696 200.289353) (xy 194.464695 200.289353) (xy 194.455057 200.29088) (xy 194.454736 200.288858) - (xy 194.397478 200.290488) (xy 194.337649 200.254401) (xy 194.306827 200.191697) (xy 194.314799 200.122284) - (xy 194.318514 200.114299) (xy 194.325646 200.100303) (xy 194.3405 200.006518) (xy 194.340499 198.768481) - (xy 194.325646 198.674695) (xy 194.26805 198.561657) (xy 194.268046 198.561653) (xy 194.268045 198.561651) - (xy 194.201819 198.495425) (xy 194.168334 198.434102) (xy 194.1655 198.407744) (xy 194.1655 197.786899) - (xy 194.185185 197.71986) (xy 194.201819 197.699218) (xy 195.014218 196.886819) (xy 195.075541 196.853334) - (xy 195.101899 196.8505) (xy 195.248985 196.8505) (xy 195.402365 196.812696) (xy 195.471566 196.776376) - (xy 195.54224 196.739283) (xy 195.660483 196.63453) (xy 195.75022 196.504523) (xy 195.806237 196.356818) - (xy 195.825278 196.2) (xy 195.819971 196.156288) (xy 195.806237 196.043181) (xy 195.784992 195.987164) - (xy 195.75022 195.895477) (xy 195.660483 195.76547) (xy 195.54224 195.660717) (xy 195.542238 195.660716) - (xy 195.542237 195.660715) (xy 195.402365 195.587303) (xy 195.248986 195.5495) (xy 195.248985 195.5495) - (xy 195.091015 195.5495) (xy 195.091014 195.5495) (xy 194.937634 195.587303) (xy 194.797762 195.660715) - (xy 194.679516 195.765471) (xy 194.589781 195.895475) (xy 194.58978 195.895476) (xy 194.533763 196.043181) - (xy 194.514722 196.2) (xy 194.520896 196.250854) (xy 194.509435 196.319777) (xy 194.485481 196.35348) - (xy 193.559438 197.279525) (xy 193.489527 197.349435) (xy 193.440089 197.435062) (xy 193.440088 197.435065) - (xy 193.433559 197.459429) (xy 193.43356 197.45943) (xy 193.425218 197.490564) (xy 193.425218 197.490565) - (xy 193.4145 197.530564) (xy 193.4145 198.407744) (xy 193.394815 198.474783) (xy 193.378181 198.495425) - (xy 193.311954 198.561651) (xy 193.311951 198.561656) (xy 193.254352 198.674697) (xy 193.2395 198.768474) - (xy 193.2395 200.006516) (xy 193.24805 200.0605) (xy 193.254354 200.100303) (xy 193.261469 200.114266) - (xy 193.261472 200.114272) (xy 193.274367 200.182941) (xy 193.24809 200.247681) (xy 193.190983 200.287937) - (xy 193.12496 200.290766) (xy 193.124943 200.290879) (xy 193.124389 200.290791) (xy 193.121177 200.290929) - (xy 193.116109 200.289479) (xy 193.021524 200.274499) (xy 192.658482 200.274499) (xy 192.577519 200.287322) - (xy 192.564696 200.289353) (xy 192.451658 200.346949) (xy 192.451657 200.34695) (xy 192.451652 200.346953) - (xy 192.361954 200.436651) (xy 192.361951 200.436656) (xy 192.304352 200.549697) (xy 192.2895 200.643474) - (xy 192.289501 201.876) (xy 192.269816 201.943039) (xy 192.217013 201.988794) (xy 192.165501 202) - (xy 191.0045 202) (xy 190.937461 201.980315) (xy 190.891706 201.927511) (xy 190.8805 201.876) (xy 190.8805 196.3545) - (xy 190.900185 196.287461) (xy 190.952989 196.241706) (xy 191.0045 196.2305) (xy 191.024676 196.2305) - (xy 191.024677 196.230499) (xy 191.09774 196.215966) (xy 191.180601 196.160601) (xy 191.235966 196.07774) - (xy 191.2505 196.004674) (xy 191.2505 194.455326) (xy 191.2505 194.455323) (xy 191.250499 194.455321) - (xy 191.235967 194.382264) (xy 191.235966 194.38226) (xy 191.235599 194.381711) (xy 191.180601 194.299399) - (xy 191.09774 194.244034) (xy 191.097739 194.244033) (xy 191.097735 194.244032) (xy 191.024677 194.2295) - (xy 191.024674 194.2295) (xy 190.7495 194.2295) (xy 190.682461 194.209815) (xy 190.675824 194.202155) - (xy 202.025 194.202155) (xy 202.025 195.2) (xy 202.962639 195.2) (xy 202.955743 195.216649) (xy 202.925 195.371207) - (xy 202.925 195.528793) (xy 202.955743 195.683351) (xy 202.962639 195.7) (xy 202.025 195.7) (xy 202.025 196.697844) - (xy 202.031401 196.757372) (xy 202.031403 196.757379) (xy 202.081645 196.892086) (xy 202.081649 196.892093) - (xy 202.167809 197.007187) (xy 202.167812 197.00719) (xy 202.282906 197.09335) (xy 202.282913 197.093354) - (xy 202.41762 197.143596) (xy 202.417627 197.143598) (xy 202.477155 197.149999) (xy 202.477172 197.15) - (xy 203.475 197.15) (xy 203.475 196.21236) (xy 203.491649 196.219257) (xy 203.646207 196.25) (xy 203.803793 196.25) + (xy 257.000008 137.400061) (xy 256.997516 137.402628) (xy 256.993142 137.407134) (xy 215.103945 180.991846) + (xy 215.078638 181.022438) (xy 215.009134 181.106461) (xy 215.009128 181.10647) (xy 214.932367 181.233886) + (xy 214.932357 181.233903) (xy 210.207425 190.58734) (xy 210.207418 190.587358) (xy 210.127227 190.806481) + (xy 210.127226 190.806485) (xy 210.1 191.03824) (xy 210.1 200.993907) (xy 210.099403 201.006061) + (xy 210.081982 201.182934) (xy 210.07724 201.206775) (xy 210.027424 201.370998) (xy 210.018121 201.393456) + (xy 209.937227 201.544798) (xy 209.923722 201.56501) (xy 209.814854 201.697666) (xy 209.797666 201.714854) + (xy 209.66501 201.823722) (xy 209.644798 201.837227) (xy 209.493456 201.918121) (xy 209.470998 201.927424) + (xy 209.306775 201.97724) (xy 209.282934 201.981982) (xy 209.106061 201.999403) (xy 209.093907 202) + (xy 198.2945 202) (xy 198.227461 201.980315) (xy 198.181706 201.927511) (xy 198.1705 201.876) (xy 198.1705 201.391898) + (xy 198.190185 201.324859) (xy 198.206814 201.304222) (xy 199.414217 200.096818) (xy 199.47554 200.063334) + (xy 199.501898 200.0605) (xy 199.648985 200.0605) (xy 199.802365 200.022696) (xy 199.818886 200.014025) + (xy 199.94224 199.949283) (xy 200.060483 199.84453) (xy 200.15022 199.714523) (xy 200.206237 199.566818) + (xy 200.225278 199.41) (xy 200.206237 199.253182) (xy 200.15022 199.105477) (xy 200.060483 198.97547) + (xy 199.94224 198.870717) (xy 199.942238 198.870716) (xy 199.942237 198.870715) (xy 199.802365 198.797303) + (xy 199.648986 198.7595) (xy 199.648985 198.7595) (xy 199.491015 198.7595) (xy 199.491014 198.7595) + (xy 199.337634 198.797303) (xy 199.197762 198.870715) (xy 199.079516 198.975471) (xy 198.989781 199.105475) + (xy 198.98978 199.105476) (xy 198.933763 199.253181) (xy 198.914722 199.41) (xy 198.920896 199.460854) + (xy 198.909435 199.529777) (xy 198.885481 199.56348) (xy 198.270262 200.178699) (xy 198.208939 200.212184) + (xy 198.139247 200.2072) (xy 198.111829 200.189579) (xy 198.110756 200.191186) (xy 198.100601 200.184401) + (xy 198.100601 200.1844) (xy 198.01774 200.129035) (xy 198.017739 200.129034) (xy 198.017735 200.129033) + (xy 197.944677 200.114501) (xy 197.944674 200.114501) (xy 196.345326 200.114501) (xy 196.345323 200.114501) + (xy 196.272264 200.129033) (xy 196.27226 200.129034) (xy 196.189399 200.1844) (xy 196.134033 200.267261) + (xy 196.134032 200.267265) (xy 196.1195 200.340322) (xy 196.1195 201.876) (xy 196.099815 201.943039) + (xy 196.047011 201.988794) (xy 195.9955 202) (xy 195.4145 202) (xy 195.347461 201.980315) (xy 195.301706 201.927511) + (xy 195.2905 201.876) (xy 195.290499 200.643481) (xy 195.290498 200.643474) (xy 195.275646 200.549695) + (xy 195.21805 200.436657) (xy 195.218046 200.436653) (xy 195.218045 200.436651) (xy 195.128347 200.346953) + (xy 195.128344 200.346951) (xy 195.128342 200.346949) (xy 195.042184 200.303049) (xy 195.015301 200.289351) + (xy 194.921524 200.274499) (xy 194.558482 200.274499) (xy 194.487649 200.285717) (xy 194.464696 200.289353) + (xy 194.464695 200.289353) (xy 194.455057 200.29088) (xy 194.454736 200.288858) (xy 194.397478 200.290488) + (xy 194.337649 200.254401) (xy 194.306827 200.191697) (xy 194.314799 200.122284) (xy 194.318514 200.114299) + (xy 194.325646 200.100303) (xy 194.3405 200.006518) (xy 194.340499 198.768481) (xy 194.325646 198.674695) + (xy 194.26805 198.561657) (xy 194.268046 198.561653) (xy 194.268045 198.561651) (xy 194.201819 198.495425) + (xy 194.168334 198.434102) (xy 194.1655 198.407744) (xy 194.1655 197.786899) (xy 194.185185 197.71986) + (xy 194.201819 197.699218) (xy 195.014218 196.886819) (xy 195.075541 196.853334) (xy 195.101899 196.8505) + (xy 195.248985 196.8505) (xy 195.402365 196.812696) (xy 195.471566 196.776376) (xy 195.54224 196.739283) + (xy 195.660483 196.63453) (xy 195.75022 196.504523) (xy 195.806237 196.356818) (xy 195.825278 196.2) + (xy 195.819971 196.156288) (xy 195.806237 196.043181) (xy 195.784992 195.987164) (xy 195.75022 195.895477) + (xy 195.660483 195.76547) (xy 195.54224 195.660717) (xy 195.542238 195.660716) (xy 195.542237 195.660715) + (xy 195.402365 195.587303) (xy 195.248986 195.5495) (xy 195.248985 195.5495) (xy 195.091015 195.5495) + (xy 195.091014 195.5495) (xy 194.937634 195.587303) (xy 194.797762 195.660715) (xy 194.679516 195.765471) + (xy 194.589781 195.895475) (xy 194.58978 195.895476) (xy 194.533763 196.043181) (xy 194.514722 196.2) + (xy 194.520896 196.250854) (xy 194.509435 196.319777) (xy 194.485481 196.35348) (xy 193.559438 197.279525) + (xy 193.489527 197.349435) (xy 193.440089 197.435062) (xy 193.440088 197.435065) (xy 193.433559 197.459429) + (xy 193.43356 197.45943) (xy 193.425218 197.490564) (xy 193.425218 197.490565) (xy 193.4145 197.530564) + (xy 193.4145 198.407744) (xy 193.394815 198.474783) (xy 193.378181 198.495425) (xy 193.311954 198.561651) + (xy 193.311951 198.561656) (xy 193.254352 198.674697) (xy 193.2395 198.768474) (xy 193.2395 200.006516) + (xy 193.24805 200.0605) (xy 193.254354 200.100303) (xy 193.261469 200.114266) (xy 193.261472 200.114272) + (xy 193.274367 200.182941) (xy 193.24809 200.247681) (xy 193.190983 200.287937) (xy 193.12496 200.290766) + (xy 193.124943 200.290879) (xy 193.124389 200.290791) (xy 193.121177 200.290929) (xy 193.116109 200.289479) + (xy 193.021524 200.274499) (xy 192.658482 200.274499) (xy 192.577519 200.287322) (xy 192.564696 200.289353) + (xy 192.451658 200.346949) (xy 192.451657 200.34695) (xy 192.451652 200.346953) (xy 192.361954 200.436651) + (xy 192.361951 200.436656) (xy 192.304352 200.549697) (xy 192.2895 200.643474) (xy 192.289501 201.876) + (xy 192.269816 201.943039) (xy 192.217013 201.988794) (xy 192.165501 202) (xy 191.0045 202) (xy 190.937461 201.980315) + (xy 190.891706 201.927511) (xy 190.8805 201.876) (xy 190.8805 196.3545) (xy 190.900185 196.287461) + (xy 190.952989 196.241706) (xy 191.0045 196.2305) (xy 191.024676 196.2305) (xy 191.024677 196.230499) + (xy 191.09774 196.215966) (xy 191.180601 196.160601) (xy 191.235966 196.07774) (xy 191.2505 196.004674) + (xy 191.2505 194.455326) (xy 191.2505 194.455323) (xy 191.250499 194.455321) (xy 191.235967 194.382264) + (xy 191.235966 194.38226) (xy 191.235599 194.381711) (xy 191.180601 194.299399) (xy 191.09774 194.244034) + (xy 191.097739 194.244033) (xy 191.097735 194.244032) (xy 191.024677 194.2295) (xy 191.024674 194.2295) + (xy 190.7495 194.2295) (xy 190.682461 194.209815) (xy 190.675824 194.202155) (xy 202.025 194.202155) + (xy 202.025 195.2) (xy 202.962639 195.2) (xy 202.955743 195.216649) (xy 202.925 195.371207) (xy 202.925 195.528793) + (xy 202.955743 195.683351) (xy 202.962639 195.7) (xy 202.025 195.7) (xy 202.025 196.697844) (xy 202.031401 196.757372) + (xy 202.031403 196.757379) (xy 202.081645 196.892086) (xy 202.081649 196.892093) (xy 202.167809 197.007187) + (xy 202.167812 197.00719) (xy 202.282906 197.09335) (xy 202.282913 197.093354) (xy 202.41762 197.143596) + (xy 202.417627 197.143598) (xy 202.477155 197.149999) (xy 202.477172 197.15) (xy 203.475 197.15) + (xy 203.475 196.21236) (xy 203.491649 196.219257) (xy 203.646207 196.25) (xy 203.803793 196.25) (xy 203.958351 196.219257) (xy 203.975 196.21236) (xy 203.975 197.15) (xy 204.972828 197.15) (xy 204.972844 197.149999) (xy 205.032372 197.143598) (xy 205.032379 197.143596) (xy 205.167086 197.093354) (xy 205.167093 197.09335) (xy 205.282187 197.00719) (xy 205.28219 197.007187) (xy 205.36835 196.892093) (xy 205.368354 196.892086) @@ -160995,15 +165265,18 @@ (xy 176.408126 202) (xy 176.391941 201.998939) (xy 176.378917 201.997224) (xy 176.286775 201.985093) (xy 176.255508 201.976715) (xy 176.165081 201.939259) (xy 176.137048 201.923074) (xy 176.059398 201.863491) (xy 176.036508 201.840601) (xy 176.02993 201.832029) (xy 175.976925 201.762951) (xy 175.96074 201.734918) - (xy 175.923284 201.644491) (xy 175.914906 201.613223) (xy 175.9 201.5) (xy 175.9 201) (xy 175.4 201) - (xy 175.399993 201) (xy 168.806093 201) (xy 168.793939 200.999403) (xy 168.617065 200.981982) (xy 168.593224 200.97724) - (xy 168.429001 200.927424) (xy 168.406543 200.918121) (xy 168.255201 200.837227) (xy 168.234989 200.823722) - (xy 168.102333 200.714854) (xy 168.085145 200.697666) (xy 167.976277 200.56501) (xy 167.962772 200.544798) - (xy 167.881877 200.393453) (xy 167.872575 200.370998) (xy 167.869864 200.36206) (xy 167.822757 200.206769) - (xy 167.818018 200.182941) (xy 167.801381 200.014025) (xy 167.800597 200.006061) (xy 167.8 199.993907) - (xy 167.8 194.052155) (xy 169.025 194.052155) (xy 169.025 195.05) (xy 169.962639 195.05) (xy 169.955743 195.066649) - (xy 169.925 195.221207) (xy 169.925 195.378793) (xy 169.955743 195.533351) (xy 169.962639 195.55) - (xy 169.025 195.55) (xy 169.025 196.547844) (xy 169.031401 196.607372) (xy 169.031403 196.607379) + (xy 175.923284 201.644491) (xy 175.914906 201.613223) (xy 175.9 201.5) (xy 175.882963 201.370591) + (xy 175.882961 201.370586) (xy 175.833015 201.250004) (xy 175.833015 201.250003) (xy 175.833013 201.25) + (xy 175.753553 201.146447) (xy 175.65 201.066987) (xy 175.649997 201.066986) (xy 175.649995 201.066984) + (xy 175.529413 201.017038) (xy 175.529408 201.017036) (xy 175.400009 201.000001) (xy 175.400006 201) + (xy 175.4 201) (xy 175.399993 201) (xy 168.806093 201) (xy 168.793939 200.999403) (xy 168.617065 200.981982) + (xy 168.593224 200.97724) (xy 168.429001 200.927424) (xy 168.406543 200.918121) (xy 168.255201 200.837227) + (xy 168.234989 200.823722) (xy 168.102333 200.714854) (xy 168.085145 200.697666) (xy 167.976277 200.56501) + (xy 167.962772 200.544798) (xy 167.881877 200.393453) (xy 167.872575 200.370998) (xy 167.869864 200.36206) + (xy 167.822757 200.206769) (xy 167.818018 200.182941) (xy 167.801381 200.014025) (xy 167.800597 200.006061) + (xy 167.8 199.993907) (xy 167.8 194.052155) (xy 169.025 194.052155) (xy 169.025 195.05) (xy 169.962639 195.05) + (xy 169.955743 195.066649) (xy 169.925 195.221207) (xy 169.925 195.378793) (xy 169.955743 195.533351) + (xy 169.962639 195.55) (xy 169.025 195.55) (xy 169.025 196.547844) (xy 169.031401 196.607372) (xy 169.031403 196.607379) (xy 169.081645 196.742086) (xy 169.081649 196.742093) (xy 169.167809 196.857187) (xy 169.167812 196.85719) (xy 169.282906 196.94335) (xy 169.282913 196.943354) (xy 169.41762 196.993596) (xy 169.417627 196.993598) (xy 169.477155 196.999999) (xy 169.477172 197) (xy 170.475 197) (xy 170.475 196.06236) (xy 170.491649 196.069257) @@ -161045,88 +165318,91 @@ (xy 167.841774 188.677682) (xy 167.890482 188.634531) (xy 167.898928 188.622295) (xy 167.98022 188.504523) (xy 168.036237 188.356818) (xy 168.055278 188.2) (xy 168.049102 188.149144) (xy 168.060561 188.080224) (xy 168.084514 188.046521) (xy 170.094718 186.036319) (xy 170.156041 186.002834) (xy 170.182399 186) - (xy 172.999997 186) (xy 173 186) (xy 174 186) (xy 174 183.864993) (xy 178.925233 183.864993) (xy 178.925233 183.865002) - (xy 178.944273 184.119077) (xy 179.000968 184.367475) (xy 179.000973 184.367492) (xy 179.094058 184.604669) - (xy 179.094057 184.604669) (xy 179.221454 184.825325) (xy 179.221461 184.825336) (xy 179.263452 184.877989) - (xy 179.263453 184.87799) (xy 179.914152 184.22729) (xy 179.921049 184.24394) (xy 180.008599 184.374968) - (xy 180.12003 184.486399) (xy 180.251058 184.573949) (xy 180.267705 184.580844) (xy 179.616813 185.231736) - (xy 179.777616 185.341369) (xy 179.777624 185.341374) (xy 180.007176 185.451919) (xy 180.007174 185.451919) - (xy 180.250652 185.527022) (xy 180.250658 185.527024) (xy 180.502595 185.564997) (xy 180.502604 185.564998) - (xy 180.757396 185.564998) (xy 180.757404 185.564997) (xy 181.009341 185.527024) (xy 181.009347 185.527022) - (xy 181.252824 185.451919) (xy 181.482376 185.341374) (xy 181.482377 185.341373) (xy 181.643185 185.231736) - (xy 180.992294 184.580844) (xy 181.008942 184.573949) (xy 181.13997 184.486399) (xy 181.251401 184.374968) - (xy 181.338951 184.24394) (xy 181.345846 184.227292) (xy 181.996544 184.87799) (xy 181.996546 184.877989) - (xy 182.038544 184.825328) (xy 182.165941 184.604669) (xy 182.259026 184.367492) (xy 182.259031 184.367475) - (xy 182.315726 184.119077) (xy 182.334767 183.865002) (xy 182.334767 183.864993) (xy 182.315726 183.610918) - (xy 182.259031 183.36252) (xy 182.259026 183.362503) (xy 182.165941 183.125326) (xy 182.165942 183.125326) - (xy 182.038545 182.90467) (xy 181.996545 182.852004) (xy 181.345846 183.502703) (xy 181.338951 183.486056) - (xy 181.251401 183.355028) (xy 181.13997 183.243597) (xy 181.008942 183.156047) (xy 180.992293 183.14915) - (xy 181.643185 182.498258) (xy 181.486529 182.391452) (xy 181.442227 182.337423) (xy 181.434167 182.26802) - (xy 181.46491 182.205277) (xy 181.524694 182.169115) (xy 181.55638 182.164998) (xy 181.877828 182.164998) - (xy 181.877844 182.164997) (xy 181.937372 182.158596) (xy 181.937379 182.158594) (xy 182.072086 182.108352) - (xy 182.072093 182.108348) (xy 182.187187 182.022188) (xy 182.18719 182.022185) (xy 182.27335 181.907091) - (xy 182.273354 181.907084) (xy 182.323596 181.772377) (xy 182.323598 181.77237) (xy 182.329999 181.712842) - (xy 182.33 181.712825) (xy 182.33 180.714998) (xy 181.392361 180.714998) (xy 181.399257 180.698349) - (xy 181.43 180.543791) (xy 181.43 180.386205) (xy 181.399257 180.231647) (xy 181.392361 180.214998) - (xy 182.33 180.214998) (xy 182.33 179.21717) (xy 182.329999 179.217153) (xy 182.323598 179.157625) - (xy 182.323596 179.157618) (xy 182.273354 179.022911) (xy 182.27335 179.022904) (xy 182.18719 178.90781) - (xy 182.187187 178.907807) (xy 182.072093 178.821647) (xy 182.072086 178.821643) (xy 181.937379 178.771401) - (xy 181.937372 178.771399) (xy 181.877844 178.764998) (xy 180.88 178.764998) (xy 180.88 179.702637) - (xy 180.863351 179.695741) (xy 180.708793 179.664998) (xy 180.551207 179.664998) (xy 180.396649 179.695741) - (xy 180.38 179.702637) (xy 180.38 178.764998) (xy 179.382155 178.764998) (xy 179.322627 178.771399) - (xy 179.32262 178.771401) (xy 179.187913 178.821643) (xy 179.187906 178.821647) (xy 179.072812 178.907807) - (xy 179.072809 178.90781) (xy 178.986649 179.022904) (xy 178.986645 179.022911) (xy 178.936403 179.157618) - (xy 178.936401 179.157625) (xy 178.93 179.217153) (xy 178.93 180.214998) (xy 179.867639 180.214998) - (xy 179.860743 180.231647) (xy 179.83 180.386205) (xy 179.83 180.543791) (xy 179.860743 180.698349) - (xy 179.867639 180.714998) (xy 178.93 180.714998) (xy 178.93 181.712842) (xy 178.936401 181.77237) - (xy 178.936403 181.772377) (xy 178.986645 181.907084) (xy 178.986649 181.907091) (xy 179.072809 182.022185) - (xy 179.072812 182.022188) (xy 179.187906 182.108348) (xy 179.187913 182.108352) (xy 179.32262 182.158594) - (xy 179.322627 182.158596) (xy 179.382155 182.164997) (xy 179.382172 182.164998) (xy 179.70362 182.164998) - (xy 179.770659 182.184683) (xy 179.816414 182.237487) (xy 179.826358 182.306645) (xy 179.797333 182.370201) - (xy 179.773471 182.391452) (xy 179.616813 182.498257) (xy 180.267706 183.14915) (xy 180.251058 183.156047) - (xy 180.12003 183.243597) (xy 180.008599 183.355028) (xy 179.921049 183.486056) (xy 179.914152 183.502704) - (xy 179.263452 182.852004) (xy 179.221457 182.904665) (xy 179.094058 183.125326) (xy 179.000973 183.362503) - (xy 179.000968 183.36252) (xy 178.944273 183.610918) (xy 178.925233 183.864993) (xy 174 183.864993) - (xy 174 180.872508) (xy 174.019685 180.805469) (xy 174.072489 180.759714) (xy 174.124 180.748508) - (xy 174.176993 180.748508) (xy 174.330373 180.710704) (xy 174.353913 180.698349) (xy 174.470248 180.637291) - (xy 174.588491 180.532538) (xy 174.678228 180.402531) (xy 174.734245 180.254826) (xy 174.750928 180.117424) - (xy 174.778548 180.05325) (xy 174.786331 180.044704) (xy 176.542795 178.28824) (xy 176.604116 178.254757) - (xy 176.673808 178.259741) (xy 176.729741 178.301613) (xy 176.738228 178.314563) (xy 176.755458 178.344821) - (xy 176.755461 178.344825) (xy 176.755463 178.344828) (xy 176.781931 178.375374) (xy 176.801214 178.397628) - (xy 176.801217 178.397631) (xy 176.801218 178.397632) (xy 176.833992 178.429257) (xy 176.922327 178.475465) - (xy 176.922328 178.475465) (xy 176.922328 178.475466) (xy 176.972456 178.490184) (xy 176.989366 178.49515) - (xy 176.98937 178.49515) (xy 176.989372 178.495151) (xy 177.001003 178.496823) (xy 177.061351 178.5055) - (xy 177.061352 178.5055) (xy 187.058709 178.5055) (xy 187.125748 178.525185) (xy 187.171503 178.577989) - (xy 187.174651 178.585528) (xy 187.21978 178.704523) (xy 187.309517 178.83453) (xy 187.42776 178.939283) - (xy 187.427762 178.939284) (xy 187.567634 179.012696) (xy 187.721014 179.0505) (xy 187.721015 179.0505) - (xy 187.878985 179.0505) (xy 188.032365 179.012696) (xy 188.17224 178.939283) (xy 188.290483 178.83453) - (xy 188.294257 178.829061) (xy 188.348537 178.785071) (xy 188.396308 178.7755) (xy 192.151923 178.7755) - (xy 192.218962 178.795185) (xy 192.253972 178.829059) (xy 192.309517 178.90953) (xy 192.42776 179.014283) - (xy 192.427762 179.014284) (xy 192.567634 179.087696) (xy 192.721014 179.1255) (xy 192.721015 179.1255) - (xy 192.878985 179.1255) (xy 193.032365 179.087696) (xy 193.17224 179.014283) (xy 193.290483 178.90953) - (xy 193.38022 178.779523) (xy 193.436237 178.631818) (xy 193.455278 178.475) (xy 193.448253 178.417146) - (xy 193.459713 178.348225) (xy 193.506617 178.296438) (xy 193.574072 178.278231) (xy 193.628972 178.292404) - (xy 193.667635 178.312696) (xy 193.667637 178.312696) (xy 193.667638 178.312697) (xy 193.821014 178.3505) - (xy 193.821015 178.3505) (xy 193.978985 178.3505) (xy 194.125378 178.314418) (xy 194.195179 178.317487) - (xy 194.248764 178.353612) (xy 194.286896 178.397618) (xy 194.286902 178.397625) (xy 194.286907 178.39763) - (xy 194.286909 178.397632) (xy 194.319683 178.429257) (xy 194.408018 178.475465) (xy 194.408019 178.475465) - (xy 194.408019 178.475466) (xy 194.458147 178.490184) (xy 194.475057 178.49515) (xy 194.475061 178.49515) - (xy 194.475063 178.495151) (xy 194.486694 178.496823) (xy 194.547042 178.5055) (xy 194.547043 178.5055) - (xy 206.893538 178.5055) (xy 206.902698 178.505276) (xy 206.905937 178.505198) (xy 206.916261 178.504695) - (xy 206.917983 178.504612) (xy 206.919605 178.504493) (xy 206.930384 178.503706) (xy 207.105685 178.486597) - (xy 207.121882 178.484216) (xy 207.130249 178.482987) (xy 207.130258 178.482985) (xy 207.130273 178.482983) - (xy 207.153907 178.478325) (xy 207.178017 178.472342) (xy 207.340883 178.423411) (xy 207.3643 178.415114) - (xy 207.386588 178.405975) (xy 207.409094 178.395441) (xy 207.564796 178.313104) (xy 207.575643 178.307026) - (xy 207.586016 178.300877) (xy 207.596544 178.294285) (xy 215.353776 173.170681) (xy 215.359108 173.167062) - (xy 215.364236 173.163486) (xy 215.36947 173.159737) (xy 215.443112 173.105575) (xy 215.453296 173.097682) - (xy 215.462978 173.089779) (xy 215.472744 173.081388) (xy 215.540557 173.020091) (xy 215.545279 173.015714) - (xy 215.54981 173.011406) (xy 215.554424 173.006907) (xy 241.671325 146.890006) (xy 241.671324 146.890005) - (xy 241.677091 146.884239) (xy 241.679425 146.881966) (xy 241.68543 146.876273) (xy 241.685435 146.876267) - (xy 241.685504 146.876203) (xy 256.094785 133.215456) (xy 256.749212 132.595025) (xy 256.749212 132.595024) - (xy 256.786444 132.559727) (xy 256.786443 132.559726) (xy 256.786459 132.559711) (xy 256.78646 132.559712) - (xy 256.965988 132.38951) (xy 257.028181 132.357674) (xy 257.051299 132.3555) (xy 258.943887 132.3555) - (xy 258.943907 132.3555) (xy 258.956442 132.355192) (xy 258.968596 132.354595) (xy 258.981105 132.353673) - (xy 259.157978 132.336252) (xy 259.182777 132.332573) (xy 259.182822 132.332564) (xy 259.184277 132.332312) + (xy 172.999997 186) (xy 173 186) (xy 173.19509 185.980785) (xy 173.382683 185.92388) (xy 173.55557 185.83147) + (xy 173.707107 185.707107) (xy 173.83147 185.55557) (xy 173.92388 185.382683) (xy 173.980785 185.19509) + (xy 174 185) (xy 174 183.864993) (xy 178.925233 183.864993) (xy 178.925233 183.865002) (xy 178.944273 184.119077) + (xy 179.000968 184.367475) (xy 179.000973 184.367492) (xy 179.094058 184.604669) (xy 179.094057 184.604669) + (xy 179.221454 184.825325) (xy 179.221461 184.825336) (xy 179.263452 184.877989) (xy 179.263453 184.87799) + (xy 179.914152 184.22729) (xy 179.921049 184.24394) (xy 180.008599 184.374968) (xy 180.12003 184.486399) + (xy 180.251058 184.573949) (xy 180.267705 184.580844) (xy 179.616813 185.231736) (xy 179.777616 185.341369) + (xy 179.777624 185.341374) (xy 180.007176 185.451919) (xy 180.007174 185.451919) (xy 180.250652 185.527022) + (xy 180.250658 185.527024) (xy 180.502595 185.564997) (xy 180.502604 185.564998) (xy 180.757396 185.564998) + (xy 180.757404 185.564997) (xy 181.009341 185.527024) (xy 181.009347 185.527022) (xy 181.252824 185.451919) + (xy 181.482376 185.341374) (xy 181.482377 185.341373) (xy 181.643185 185.231736) (xy 180.992294 184.580844) + (xy 181.008942 184.573949) (xy 181.13997 184.486399) (xy 181.251401 184.374968) (xy 181.338951 184.24394) + (xy 181.345846 184.227292) (xy 181.996544 184.87799) (xy 181.996546 184.877989) (xy 182.038544 184.825328) + (xy 182.165941 184.604669) (xy 182.259026 184.367492) (xy 182.259031 184.367475) (xy 182.315726 184.119077) + (xy 182.334767 183.865002) (xy 182.334767 183.864993) (xy 182.315726 183.610918) (xy 182.259031 183.36252) + (xy 182.259026 183.362503) (xy 182.165941 183.125326) (xy 182.165942 183.125326) (xy 182.038545 182.90467) + (xy 181.996545 182.852004) (xy 181.345846 183.502703) (xy 181.338951 183.486056) (xy 181.251401 183.355028) + (xy 181.13997 183.243597) (xy 181.008942 183.156047) (xy 180.992293 183.14915) (xy 181.643185 182.498258) + (xy 181.486529 182.391452) (xy 181.442227 182.337423) (xy 181.434167 182.26802) (xy 181.46491 182.205277) + (xy 181.524694 182.169115) (xy 181.55638 182.164998) (xy 181.877828 182.164998) (xy 181.877844 182.164997) + (xy 181.937372 182.158596) (xy 181.937379 182.158594) (xy 182.072086 182.108352) (xy 182.072093 182.108348) + (xy 182.187187 182.022188) (xy 182.18719 182.022185) (xy 182.27335 181.907091) (xy 182.273354 181.907084) + (xy 182.323596 181.772377) (xy 182.323598 181.77237) (xy 182.329999 181.712842) (xy 182.33 181.712825) + (xy 182.33 180.714998) (xy 181.392361 180.714998) (xy 181.399257 180.698349) (xy 181.43 180.543791) + (xy 181.43 180.386205) (xy 181.399257 180.231647) (xy 181.392361 180.214998) (xy 182.33 180.214998) + (xy 182.33 179.21717) (xy 182.329999 179.217153) (xy 182.323598 179.157625) (xy 182.323596 179.157618) + (xy 182.273354 179.022911) (xy 182.27335 179.022904) (xy 182.18719 178.90781) (xy 182.187187 178.907807) + (xy 182.072093 178.821647) (xy 182.072086 178.821643) (xy 181.937379 178.771401) (xy 181.937372 178.771399) + (xy 181.877844 178.764998) (xy 180.88 178.764998) (xy 180.88 179.702637) (xy 180.863351 179.695741) + (xy 180.708793 179.664998) (xy 180.551207 179.664998) (xy 180.396649 179.695741) (xy 180.38 179.702637) + (xy 180.38 178.764998) (xy 179.382155 178.764998) (xy 179.322627 178.771399) (xy 179.32262 178.771401) + (xy 179.187913 178.821643) (xy 179.187906 178.821647) (xy 179.072812 178.907807) (xy 179.072809 178.90781) + (xy 178.986649 179.022904) (xy 178.986645 179.022911) (xy 178.936403 179.157618) (xy 178.936401 179.157625) + (xy 178.93 179.217153) (xy 178.93 180.214998) (xy 179.867639 180.214998) (xy 179.860743 180.231647) + (xy 179.83 180.386205) (xy 179.83 180.543791) (xy 179.860743 180.698349) (xy 179.867639 180.714998) + (xy 178.93 180.714998) (xy 178.93 181.712842) (xy 178.936401 181.77237) (xy 178.936403 181.772377) + (xy 178.986645 181.907084) (xy 178.986649 181.907091) (xy 179.072809 182.022185) (xy 179.072812 182.022188) + (xy 179.187906 182.108348) (xy 179.187913 182.108352) (xy 179.32262 182.158594) (xy 179.322627 182.158596) + (xy 179.382155 182.164997) (xy 179.382172 182.164998) (xy 179.70362 182.164998) (xy 179.770659 182.184683) + (xy 179.816414 182.237487) (xy 179.826358 182.306645) (xy 179.797333 182.370201) (xy 179.773471 182.391452) + (xy 179.616813 182.498257) (xy 180.267706 183.14915) (xy 180.251058 183.156047) (xy 180.12003 183.243597) + (xy 180.008599 183.355028) (xy 179.921049 183.486056) (xy 179.914152 183.502704) (xy 179.263452 182.852004) + (xy 179.221457 182.904665) (xy 179.094058 183.125326) (xy 179.000973 183.362503) (xy 179.000968 183.36252) + (xy 178.944273 183.610918) (xy 178.925233 183.864993) (xy 174 183.864993) (xy 174 180.872508) (xy 174.019685 180.805469) + (xy 174.072489 180.759714) (xy 174.124 180.748508) (xy 174.176993 180.748508) (xy 174.330373 180.710704) + (xy 174.353913 180.698349) (xy 174.470248 180.637291) (xy 174.588491 180.532538) (xy 174.678228 180.402531) + (xy 174.734245 180.254826) (xy 174.750928 180.117424) (xy 174.778548 180.05325) (xy 174.786331 180.044704) + (xy 176.542795 178.28824) (xy 176.604116 178.254757) (xy 176.673808 178.259741) (xy 176.729741 178.301613) + (xy 176.738228 178.314563) (xy 176.755458 178.344821) (xy 176.755461 178.344825) (xy 176.755463 178.344828) + (xy 176.781931 178.375374) (xy 176.801214 178.397628) (xy 176.801217 178.397631) (xy 176.801218 178.397632) + (xy 176.833992 178.429257) (xy 176.922327 178.475465) (xy 176.922328 178.475465) (xy 176.922328 178.475466) + (xy 176.972456 178.490184) (xy 176.989366 178.49515) (xy 176.98937 178.49515) (xy 176.989372 178.495151) + (xy 177.001003 178.496823) (xy 177.061351 178.5055) (xy 177.061352 178.5055) (xy 187.058709 178.5055) + (xy 187.125748 178.525185) (xy 187.171503 178.577989) (xy 187.174651 178.585528) (xy 187.21978 178.704523) + (xy 187.309517 178.83453) (xy 187.42776 178.939283) (xy 187.427762 178.939284) (xy 187.567634 179.012696) + (xy 187.721014 179.0505) (xy 187.721015 179.0505) (xy 187.878985 179.0505) (xy 188.032365 179.012696) + (xy 188.17224 178.939283) (xy 188.290483 178.83453) (xy 188.294257 178.829061) (xy 188.348537 178.785071) + (xy 188.396308 178.7755) (xy 192.151923 178.7755) (xy 192.218962 178.795185) (xy 192.253972 178.829059) + (xy 192.309517 178.90953) (xy 192.42776 179.014283) (xy 192.427762 179.014284) (xy 192.567634 179.087696) + (xy 192.721014 179.1255) (xy 192.721015 179.1255) (xy 192.878985 179.1255) (xy 193.032365 179.087696) + (xy 193.17224 179.014283) (xy 193.290483 178.90953) (xy 193.38022 178.779523) (xy 193.436237 178.631818) + (xy 193.455278 178.475) (xy 193.448253 178.417146) (xy 193.459713 178.348225) (xy 193.506617 178.296438) + (xy 193.574072 178.278231) (xy 193.628972 178.292404) (xy 193.667635 178.312696) (xy 193.667637 178.312696) + (xy 193.667638 178.312697) (xy 193.821014 178.3505) (xy 193.821015 178.3505) (xy 193.978985 178.3505) + (xy 194.125378 178.314418) (xy 194.195179 178.317487) (xy 194.248764 178.353612) (xy 194.286896 178.397618) + (xy 194.286902 178.397625) (xy 194.286907 178.39763) (xy 194.286909 178.397632) (xy 194.319683 178.429257) + (xy 194.408018 178.475465) (xy 194.408019 178.475465) (xy 194.408019 178.475466) (xy 194.458147 178.490184) + (xy 194.475057 178.49515) (xy 194.475061 178.49515) (xy 194.475063 178.495151) (xy 194.486694 178.496823) + (xy 194.547042 178.5055) (xy 194.547043 178.5055) (xy 206.893538 178.5055) (xy 206.902698 178.505276) + (xy 206.905937 178.505198) (xy 206.916261 178.504695) (xy 206.917983 178.504612) (xy 206.919605 178.504493) + (xy 206.930384 178.503706) (xy 207.105685 178.486597) (xy 207.121882 178.484216) (xy 207.130249 178.482987) + (xy 207.130258 178.482985) (xy 207.130273 178.482983) (xy 207.153907 178.478325) (xy 207.178017 178.472342) + (xy 207.340883 178.423411) (xy 207.3643 178.415114) (xy 207.386588 178.405975) (xy 207.409094 178.395441) + (xy 207.564796 178.313104) (xy 207.575643 178.307026) (xy 207.586016 178.300877) (xy 207.596544 178.294285) + (xy 215.353776 173.170681) (xy 215.359108 173.167062) (xy 215.364236 173.163486) (xy 215.36947 173.159737) + (xy 215.443112 173.105575) (xy 215.453296 173.097682) (xy 215.462978 173.089779) (xy 215.472744 173.081388) + (xy 215.540557 173.020091) (xy 215.545279 173.015714) (xy 215.54981 173.011406) (xy 215.554424 173.006907) + (xy 241.670483 146.890846) (xy 241.67075 146.89058) (xy 241.677802 146.883621) (xy 241.678836 146.882615) + (xy 241.681517 146.880041) (xy 241.685935 146.875794) (xy 241.686116 146.875621) (xy 256.773408 132.572084) + (xy 256.782272 132.564444) (xy 256.809657 132.543019) (xy 256.809661 132.543018) (xy 256.846673 132.51406) + (xy 256.846674 132.514061) (xy 256.888857 132.481057) (xy 256.90863 132.46841) (xy 257.012901 132.414891) + (xy 257.034709 132.406197) (xy 257.109241 132.384399) (xy 257.147203 132.373296) (xy 257.170258 132.368869) + (xy 257.304953 132.356056) (xy 257.316695 132.3555) (xy 258.943887 132.3555) (xy 258.943907 132.3555) + (xy 258.956442 132.355192) (xy 258.968596 132.354595) (xy 258.981105 132.353673) (xy 259.157978 132.336252) + (xy 259.182777 132.332573) (xy 259.182822 132.332564) (xy 259.184277 132.332312) ) ) ) @@ -161159,46 +165435,50 @@ (xy 145.481922 159.40078) (xy 145.511662 159.40413) (xy 145.633569 159.417866) (xy 145.660635 159.424043) (xy 145.798074 159.472135) (xy 145.823087 159.48418) (xy 145.946377 159.561649) (xy 145.968085 159.578961) (xy 146.071038 159.681914) (xy 146.088351 159.703623) (xy 146.165817 159.826909) (xy 146.177865 159.851927) - (xy 146.225955 159.989361) (xy 146.232133 160.016431) (xy 146.25 160.175) (xy 146.25 160.95) (xy 162.993907 160.95) - (xy 163.006061 160.950597) (xy 163.182941 160.968018) (xy 163.206769 160.972757) (xy 163.371001 161.022576) - (xy 163.393453 161.031877) (xy 163.544798 161.112772) (xy 163.56501 161.126277) (xy 163.697666 161.235145) - (xy 163.714854 161.252333) (xy 163.823722 161.384989) (xy 163.837227 161.405201) (xy 163.918121 161.556543) - (xy 163.927424 161.579001) (xy 163.97724 161.743224) (xy 163.981982 161.767065) (xy 163.999403 161.943938) - (xy 164 161.956092) (xy 164 167.4) (xy 136.112527 167.4) (xy 136.144579 167.393624) (xy 136.144579 167.393623) - (xy 136.144584 167.393623) (xy 136.227445 167.338258) (xy 136.28281 167.255397) (xy 136.297344 167.182331) - (xy 136.297344 166.625783) (xy 136.297344 166.62578) (xy 136.297343 166.625778) (xy 136.282811 166.552721) - (xy 136.28281 166.552717) (xy 136.227445 166.469856) (xy 136.144584 166.414491) (xy 136.144583 166.41449) - (xy 136.144579 166.414489) (xy 136.071521 166.399957) (xy 136.071518 166.399957) (xy 134.56607 166.399957) - (xy 134.566067 166.399957) (xy 134.493008 166.414489) (xy 134.493004 166.41449) (xy 134.458921 166.437263) - (xy 134.442888 166.447976) (xy 134.376213 166.468853) (xy 134.308833 166.450368) (xy 134.262143 166.398389) - (xy 134.25 166.344873) (xy 134.25 166.19324) (xy 134.269685 166.126201) (xy 134.322489 166.080446) - (xy 134.391647 166.070502) (xy 134.442887 166.090136) (xy 134.493004 166.123623) (xy 134.493006 166.123623) - (xy 134.493008 166.123624) (xy 134.566065 166.138156) (xy 134.566068 166.138157) (xy 134.56607 166.138157) - (xy 136.07152 166.138157) (xy 136.071521 166.138156) (xy 136.144584 166.123623) (xy 136.227445 166.068258) - (xy 136.28281 165.985397) (xy 136.297344 165.912331) (xy 136.297344 165.355783) (xy 136.297344 165.35578) - (xy 136.297343 165.355778) (xy 136.282811 165.282721) (xy 136.28281 165.282717) (xy 136.227445 165.199856) - (xy 136.144584 165.144491) (xy 136.144583 165.14449) (xy 136.144579 165.144489) (xy 136.071521 165.129957) - (xy 136.071518 165.129957) (xy 134.56607 165.129957) (xy 134.566067 165.129957) (xy 134.493008 165.144489) - (xy 134.493004 165.14449) (xy 134.458921 165.167263) (xy 134.442888 165.177976) (xy 134.376213 165.198853) - (xy 134.308833 165.180368) (xy 134.262143 165.128389) (xy 134.25 165.074873) (xy 134.25 164.789499) - (xy 134.269685 164.72246) (xy 134.322489 164.676705) (xy 134.374 164.665499) (xy 134.474269 164.665499) - (xy 134.504698 164.662645) (xy 134.5047 164.662645) (xy 134.568789 164.640218) (xy 134.632881 164.617792) - (xy 134.742149 164.537149) (xy 134.822792 164.427881) (xy 134.845218 164.363789) (xy 134.867645 164.2997) - (xy 134.867645 164.299698) (xy 134.870499 164.269268) (xy 134.870499 163.610729) (xy 134.867645 163.580299) - (xy 134.867645 163.580297) (xy 134.822792 163.452118) (xy 134.822791 163.452116) (xy 134.742149 163.342849) - (xy 134.73922 163.340687) (xy 134.736802 163.337502) (xy 134.735578 163.336278) (xy 134.735745 163.33611) - (xy 134.696972 163.285037) (xy 134.691516 163.215381) (xy 134.724586 163.153833) (xy 134.738535 163.141663) - (xy 134.834686 163.069686) (xy 134.916627 162.960225) (xy 134.964411 162.832113) (xy 134.969963 162.780474) - (xy 134.970498 162.7755) (xy 134.970498 162.775493) (xy 134.970499 162.775484) (xy 134.970498 162.184515) - (xy 134.964411 162.127885) (xy 134.955688 162.104499) (xy 134.946587 162.0801) (xy 134.916627 161.999773) - (xy 134.834686 161.890312) (xy 134.76891 161.841073) (xy 134.725227 161.808372) (xy 134.725225 161.808371) - (xy 134.597113 161.760587) (xy 134.597111 161.760586) (xy 134.597109 161.760586) (xy 134.5405 161.754499) - (xy 134.374 161.754499) (xy 134.306961 161.734814) (xy 134.261206 161.68201) (xy 134.25 161.630499) - (xy 134.25 160.406092) (xy 134.250597 160.393938) (xy 134.255175 160.347456) (xy 134.268018 160.217056) - (xy 134.272757 160.193232) (xy 134.322577 160.028994) (xy 134.331875 160.006549) (xy 134.412775 159.855195) - (xy 134.426272 159.834995) (xy 134.535149 159.702328) (xy 134.552328 159.685149) (xy 134.684995 159.576272) - (xy 134.705195 159.562775) (xy 134.856549 159.481875) (xy 134.878994 159.472577) (xy 135.043232 159.422757) - (xy 135.067056 159.418018) (xy 135.243939 159.400597) (xy 135.256093 159.4) (xy 145.468039 159.4) + (xy 146.225955 159.989361) (xy 146.232133 160.016431) (xy 146.25 160.175) (xy 146.25 160.175001) + (xy 146.26943 160.347453) (xy 146.26943 160.347456) (xy 146.326747 160.511256) (xy 146.326748 160.51126) + (xy 146.419081 160.658205) (xy 146.541795 160.780919) (xy 146.596407 160.815234) (xy 146.688739 160.873251) + (xy 146.688743 160.873252) (xy 146.852545 160.930569) (xy 146.912522 160.937326) (xy 147.024994 160.949999) + (xy 147.024997 160.95) (xy 147.025 160.95) (xy 162.993907 160.95) (xy 163.006061 160.950597) (xy 163.182941 160.968018) + (xy 163.206769 160.972757) (xy 163.371001 161.022576) (xy 163.393453 161.031877) (xy 163.544798 161.112772) + (xy 163.56501 161.126277) (xy 163.697666 161.235145) (xy 163.714854 161.252333) (xy 163.823722 161.384989) + (xy 163.837227 161.405201) (xy 163.918121 161.556543) (xy 163.927424 161.579001) (xy 163.97724 161.743224) + (xy 163.981982 161.767065) (xy 163.999403 161.943938) (xy 164 161.956092) (xy 164 167.4) (xy 163 167.4) + (xy 136.112527 167.4) (xy 136.144579 167.393624) (xy 136.144579 167.393623) (xy 136.144584 167.393623) + (xy 136.227445 167.338258) (xy 136.28281 167.255397) (xy 136.297344 167.182331) (xy 136.297344 166.625783) + (xy 136.297344 166.62578) (xy 136.297343 166.625778) (xy 136.282811 166.552721) (xy 136.28281 166.552717) + (xy 136.227445 166.469856) (xy 136.144584 166.414491) (xy 136.144583 166.41449) (xy 136.144579 166.414489) + (xy 136.071521 166.399957) (xy 136.071518 166.399957) (xy 134.56607 166.399957) (xy 134.566067 166.399957) + (xy 134.493008 166.414489) (xy 134.493004 166.41449) (xy 134.458921 166.437263) (xy 134.442888 166.447976) + (xy 134.376213 166.468853) (xy 134.308833 166.450368) (xy 134.262143 166.398389) (xy 134.25 166.344873) + (xy 134.25 166.19324) (xy 134.269685 166.126201) (xy 134.322489 166.080446) (xy 134.391647 166.070502) + (xy 134.442887 166.090136) (xy 134.493004 166.123623) (xy 134.493006 166.123623) (xy 134.493008 166.123624) + (xy 134.566065 166.138156) (xy 134.566068 166.138157) (xy 134.56607 166.138157) (xy 136.07152 166.138157) + (xy 136.071521 166.138156) (xy 136.144584 166.123623) (xy 136.227445 166.068258) (xy 136.28281 165.985397) + (xy 136.297344 165.912331) (xy 136.297344 165.355783) (xy 136.297344 165.35578) (xy 136.297343 165.355778) + (xy 136.282811 165.282721) (xy 136.28281 165.282717) (xy 136.227445 165.199856) (xy 136.144584 165.144491) + (xy 136.144583 165.14449) (xy 136.144579 165.144489) (xy 136.071521 165.129957) (xy 136.071518 165.129957) + (xy 134.56607 165.129957) (xy 134.566067 165.129957) (xy 134.493008 165.144489) (xy 134.493004 165.14449) + (xy 134.458921 165.167263) (xy 134.442888 165.177976) (xy 134.376213 165.198853) (xy 134.308833 165.180368) + (xy 134.262143 165.128389) (xy 134.25 165.074873) (xy 134.25 164.789499) (xy 134.269685 164.72246) + (xy 134.322489 164.676705) (xy 134.374 164.665499) (xy 134.474269 164.665499) (xy 134.504698 164.662645) + (xy 134.5047 164.662645) (xy 134.568789 164.640218) (xy 134.632881 164.617792) (xy 134.742149 164.537149) + (xy 134.822792 164.427881) (xy 134.845218 164.363789) (xy 134.867645 164.2997) (xy 134.867645 164.299698) + (xy 134.870499 164.269268) (xy 134.870499 163.610729) (xy 134.867645 163.580299) (xy 134.867645 163.580297) + (xy 134.822792 163.452118) (xy 134.822791 163.452116) (xy 134.742149 163.342849) (xy 134.73922 163.340687) + (xy 134.736802 163.337502) (xy 134.735578 163.336278) (xy 134.735745 163.33611) (xy 134.696972 163.285037) + (xy 134.691516 163.215381) (xy 134.724586 163.153833) (xy 134.738535 163.141663) (xy 134.834686 163.069686) + (xy 134.916627 162.960225) (xy 134.964411 162.832113) (xy 134.969963 162.780474) (xy 134.970498 162.7755) + (xy 134.970498 162.775493) (xy 134.970499 162.775484) (xy 134.970498 162.184515) (xy 134.964411 162.127885) + (xy 134.955688 162.104499) (xy 134.946587 162.0801) (xy 134.916627 161.999773) (xy 134.834686 161.890312) + (xy 134.76891 161.841073) (xy 134.725227 161.808372) (xy 134.725225 161.808371) (xy 134.597113 161.760587) + (xy 134.597111 161.760586) (xy 134.597109 161.760586) (xy 134.5405 161.754499) (xy 134.374 161.754499) + (xy 134.306961 161.734814) (xy 134.261206 161.68201) (xy 134.25 161.630499) (xy 134.25 160.406092) + (xy 134.250597 160.393938) (xy 134.255175 160.347454) (xy 134.268018 160.217056) (xy 134.272757 160.193232) + (xy 134.322577 160.028994) (xy 134.331875 160.006549) (xy 134.412775 159.855195) (xy 134.426272 159.834995) + (xy 134.535149 159.702328) (xy 134.552328 159.685149) (xy 134.684995 159.576272) (xy 134.705195 159.562775) + (xy 134.856549 159.481875) (xy 134.878994 159.472577) (xy 135.043232 159.422757) (xy 135.067056 159.418018) + (xy 135.243939 159.400597) (xy 135.256093 159.4) (xy 145.468039 159.4) ) ) ) @@ -161264,32 +165544,40 @@ (xy 213.499403 81.093938) (xy 213.5 81.106092) (xy 213.5 90.540617) (xy 213.480315 90.607656) (xy 213.47805 90.611056) (xy 213.419783 90.69547) (xy 213.41978 90.695476) (xy 213.363762 90.843181) (xy 213.344722 90.999999) (xy 213.344722 91) (xy 213.363762 91.156818) (xy 213.41978 91.304523) (xy 213.41978 91.304524) (xy 213.438925 91.33226) - (xy 213.47805 91.388942) (xy 213.499933 91.455295) (xy 213.5 91.459381) (xy 213.5 97) (xy 228.364139 100.525092) - (xy 228.424825 100.559714) (xy 228.427102 100.562142) (xy 228.439147 100.575336) (xy 228.439153 100.575341) - (xy 228.439154 100.575343) (xy 228.458385 100.594292) (xy 228.477967 100.611647) (xy 228.477975 100.611654) - (xy 228.486143 100.618156) (xy 228.499084 100.628458) (xy 228.618371 100.713526) (xy 228.649468 100.735702) - (xy 228.672218 100.750177) (xy 228.672233 100.750186) (xy 228.672239 100.750189) (xy 228.67224 100.75019) - (xy 228.695026 100.763049) (xy 228.719202 100.775055) (xy 228.894783 100.850969) (xy 228.90731 100.855997) - (xy 228.91958 100.860549) (xy 228.932361 100.86491) (xy 232.218235 101.88995) (xy 246.361813 106.302087) - (xy 262.095186 111.210165) (xy 262.095204 111.21017) (xy 262.096781 111.210662) (xy 262.096808 111.21067) - (xy 262.36121 111.293151) (xy 262.419345 111.331906) (xy 262.437292 111.360487) (xy 262.554076 111.61908) - (xy 262.554082 111.619091) (xy 263.839715 114.465853) (xy 263.84306 114.474023) (xy 264.279127 115.657633) - (xy 264.283832 115.727344) (xy 264.250101 115.788532) (xy 264.188644 115.821771) (xy 264.162772 115.8245) - (xy 264.036023 115.8245) (xy 263.991053 115.832004) (xy 263.811173 115.86202) (xy 263.595581 115.936034) - (xy 263.595567 115.93604) (xy 263.395099 116.044527) (xy 263.39509 116.044533) (xy 263.215212 116.184538) - (xy 263.215208 116.184541) (xy 263.060814 116.352257) (xy 262.936137 116.543091) (xy 262.844569 116.751844) - (xy 262.78861 116.97282) (xy 262.788608 116.972831) (xy 262.769786 117.199993) (xy 262.769786 117.200006) - (xy 262.788608 117.427168) (xy 262.78861 117.427179) (xy 262.844569 117.648155) (xy 262.936137 117.856908) - (xy 263.060814 118.047742) (xy 263.215208 118.215458) (xy 263.215212 118.215461) (xy 263.395094 118.355469) - (xy 263.395096 118.35547) (xy 263.395099 118.355472) (xy 263.600084 118.466404) (xy 263.599065 118.468286) - (xy 263.645603 118.507411) (xy 263.666286 118.574149) (xy 263.647604 118.641475) (xy 263.595489 118.688013) - (xy 263.5423 118.7) (xy 260.409756 118.7) (xy 260.390359 118.698473) (xy 260.371258 118.695447) - (xy 260.295792 118.683495) (xy 260.258895 118.671507) (xy 260.182383 118.632522) (xy 260.150997 118.609718) - (xy 260.090281 118.549002) (xy 260.067477 118.517616) (xy 260.062277 118.507411) (xy 260.028491 118.441102) - (xy 260.016504 118.404206) (xy 260.001527 118.309641) (xy 260 118.290244) (xy 260 115.987609) (xy 260.003795 115.957166) - (xy 260.009145 115.93604) (xy 260.01139 115.927176) (xy 260.020124 115.821771) (xy 260.030214 115.700006) - (xy 260.030214 115.699993) (xy 260.01139 115.472827) (xy 260.01139 115.472824) (xy 260.003794 115.442828) - (xy 260 115.412388) (xy 260 115.103758) (xy 260 114.3) (xy 259.21505 114.127155) (xy 259.215047 114.127154) + (xy 213.47805 91.388942) (xy 213.499933 91.455295) (xy 213.5 91.459381) (xy 213.5 96.209418) (xy 213.518211 96.399391) + (xy 213.57218 96.582445) (xy 213.659941 96.751913) (xy 213.778299 96.901622) (xy 213.778302 96.901624) + (xy 213.778304 96.901627) (xy 213.922943 97.026122) (xy 213.922944 97.026123) (xy 214.047323 97.097263) + (xy 214.088602 97.120874) (xy 214.269246 97.18243) (xy 228.364138 100.525092) (xy 228.424825 100.559714) + (xy 228.427102 100.562142) (xy 228.439147 100.575336) (xy 228.439153 100.575341) (xy 228.439154 100.575343) + (xy 228.458385 100.594292) (xy 228.477967 100.611647) (xy 228.477975 100.611654) (xy 228.486143 100.618156) + (xy 228.499084 100.628458) (xy 228.618371 100.713526) (xy 228.649468 100.735702) (xy 228.672218 100.750177) + (xy 228.67223 100.750184) (xy 228.672235 100.750186) (xy 228.67224 100.75019) (xy 228.683954 100.7568) + (xy 228.695013 100.763042) (xy 228.69502 100.763045) (xy 228.695026 100.763049) (xy 228.719201 100.775055) + (xy 228.719222 100.775064) (xy 228.719224 100.775065) (xy 228.894788 100.850972) (xy 228.903371 100.854416) + (xy 228.907304 100.855995) (xy 228.919587 100.860552) (xy 228.932371 100.864914) (xy 243.028757 105.262329) + (xy 262.076061 111.204198) (xy 262.088311 111.208741) (xy 262.226404 111.268419) (xy 262.249157 111.28125) + (xy 262.355248 111.356824) (xy 262.374805 111.374133) (xy 262.462728 111.470275) (xy 262.478224 111.491296) + (xy 262.554233 111.621105) (xy 262.560238 111.632724) (xy 263.839716 114.465855) (xy 263.843061 114.474025) + (xy 264.279127 115.657633) (xy 264.283832 115.727344) (xy 264.250101 115.788532) (xy 264.188644 115.821771) + (xy 264.162772 115.8245) (xy 264.036023 115.8245) (xy 263.991053 115.832004) (xy 263.811173 115.86202) + (xy 263.595581 115.936034) (xy 263.595567 115.93604) (xy 263.395099 116.044527) (xy 263.39509 116.044533) + (xy 263.215212 116.184538) (xy 263.215208 116.184541) (xy 263.060814 116.352257) (xy 262.936137 116.543091) + (xy 262.844569 116.751844) (xy 262.78861 116.97282) (xy 262.788608 116.972831) (xy 262.769786 117.199993) + (xy 262.769786 117.200006) (xy 262.788608 117.427168) (xy 262.78861 117.427179) (xy 262.844569 117.648155) + (xy 262.936137 117.856908) (xy 263.060814 118.047742) (xy 263.215208 118.215458) (xy 263.215212 118.215461) + (xy 263.395094 118.355469) (xy 263.395096 118.35547) (xy 263.395099 118.355472) (xy 263.600084 118.466404) + (xy 263.599065 118.468286) (xy 263.645603 118.507411) (xy 263.666286 118.574149) (xy 263.647604 118.641475) + (xy 263.595489 118.688013) (xy 263.5423 118.7) (xy 260.409756 118.7) (xy 260.390359 118.698473) + (xy 260.371258 118.695447) (xy 260.295792 118.683495) (xy 260.258895 118.671507) (xy 260.182383 118.632522) + (xy 260.150997 118.609718) (xy 260.090281 118.549002) (xy 260.067477 118.517616) (xy 260.062277 118.507411) + (xy 260.028491 118.441102) (xy 260.016504 118.404206) (xy 260.001527 118.309641) (xy 260 118.290244) + (xy 260 115.987609) (xy 260.003795 115.957166) (xy 260.009145 115.93604) (xy 260.01139 115.927176) + (xy 260.020124 115.821771) (xy 260.030214 115.700006) (xy 260.030214 115.699993) (xy 260.01139 115.472827) + (xy 260.01139 115.472824) (xy 260.003794 115.442828) (xy 260 115.412388) (xy 260 115.103758) (xy 259.999999 115.103749) + (xy 259.98135 114.911532) (xy 259.981348 114.911523) (xy 259.926093 114.726463) (xy 259.836293 114.555475) + (xy 259.836292 114.555473) (xy 259.836292 114.555472) (xy 259.715305 114.404945) (xy 259.715301 114.404941) + (xy 259.715299 114.404939) (xy 259.715298 114.404938) (xy 259.567621 114.280468) (xy 259.56762 114.280467) + (xy 259.567618 114.280465) (xy 259.398774 114.186709) (xy 259.398771 114.186708) (xy 259.215047 114.127154) (xy 259.215041 114.127152) (xy 259.215039 114.127152) (xy 201.928687 101.512773) (xy 201.867449 101.479132) (xy 201.83412 101.417724) (xy 201.834957 101.361997) (xy 201.836231 101.35682) (xy 201.836234 101.356815) (xy 201.855275 101.199997) (xy 201.845198 101.117) (xy 201.836234 101.043178) (xy 201.793834 100.931379) @@ -161436,27 +165724,33 @@ (xy 147.827762 74.060714) (xy 147.709516 74.165471) (xy 147.619781 74.295475) (xy 147.61978 74.295476) (xy 147.563762 74.443181) (xy 147.544722 74.599999) (xy 147.544722 74.6) (xy 147.563762 74.756818) (xy 147.602801 74.859754) (xy 147.61978 74.904523) (xy 147.709517 75.03453) (xy 147.82776 75.139283) - (xy 147.827762 75.139284) (xy 147.967634 75.212696) (xy 148 75.220673) (xy 148 75.35) (xy 152.493907 75.35) - (xy 152.506061 75.350597) (xy 152.682941 75.368018) (xy 152.706769 75.372757) (xy 152.871001 75.422576) - (xy 152.893453 75.431877) (xy 153.044798 75.512772) (xy 153.06501 75.526277) (xy 153.197666 75.635145) - (xy 153.214854 75.652333) (xy 153.323722 75.784989) (xy 153.337227 75.805201) (xy 153.418121 75.956543) - (xy 153.427424 75.979001) (xy 153.47724 76.143224) (xy 153.481982 76.167065) (xy 153.499403 76.343938) - (xy 153.5 76.356092) (xy 153.5 77.993038) (xy 153.49922 78.006922) (xy 153.481506 78.16413) (xy 153.475328 78.191201) + (xy 147.827762 75.139284) (xy 147.967634 75.212696) (xy 148.121014 75.2505) (xy 148.121015 75.2505) + (xy 148.278985 75.2505) (xy 148.432365 75.212696) (xy 148.432366 75.212695) (xy 148.434424 75.212188) + (xy 148.504226 75.215257) (xy 148.522546 75.223224) (xy 148.617317 75.27388) (xy 148.80491 75.330785) + (xy 148.804909 75.330785) (xy 148.853682 75.335588) (xy 149 75.35) (xy 152.493907 75.35) (xy 152.506061 75.350597) + (xy 152.682941 75.368018) (xy 152.706769 75.372757) (xy 152.871001 75.422576) (xy 152.893453 75.431877) + (xy 153.044798 75.512772) (xy 153.06501 75.526277) (xy 153.197666 75.635145) (xy 153.214854 75.652333) + (xy 153.323722 75.784989) (xy 153.337227 75.805201) (xy 153.418121 75.956543) (xy 153.427424 75.979001) + (xy 153.47724 76.143224) (xy 153.481982 76.167065) (xy 153.499403 76.343938) (xy 153.5 76.356092) + (xy 153.5 77.993038) (xy 153.49922 78.006922) (xy 153.481506 78.16413) (xy 153.475328 78.191201) (xy 153.425388 78.333921) (xy 153.41334 78.358938) (xy 153.332897 78.486963) (xy 153.315584 78.508672) (xy 153.208672 78.615584) (xy 153.186963 78.632897) (xy 153.058938 78.71334) (xy 153.033921 78.725388) - (xy 152.891201 78.775328) (xy 152.86413 78.781506) (xy 152.7 78.8) (xy 151.9 78.8) (xy 151.9 79.599995) - (xy 151.9 79.893907) (xy 151.899403 79.906061) (xy 151.881982 80.082934) (xy 151.87724 80.106775) - (xy 151.827424 80.270998) (xy 151.818121 80.293456) (xy 151.737227 80.444798) (xy 151.723722 80.46501) - (xy 151.614854 80.597666) (xy 151.597666 80.614854) (xy 151.46501 80.723722) (xy 151.444798 80.737227) - (xy 151.293456 80.818121) (xy 151.270998 80.827424) (xy 151.106775 80.87724) (xy 151.082934 80.881982) - (xy 150.906061 80.899403) (xy 150.893907 80.9) (xy 149.2 80.9) (xy 149.15 81.75) (xy 149.15 81.750001) - (xy 149.119917 81.92872) (xy 149.112664 81.954449) (xy 149.049996 82.110099) (xy 149.037397 82.133677) - (xy 148.942825 82.272278) (xy 148.925465 82.292607) (xy 148.803386 82.407715) (xy 148.782073 82.423851) - (xy 148.638158 82.510122) (xy 148.613881 82.521315) (xy 148.519389 82.55305) (xy 148.479911 82.559502) - (xy 148.219056 82.559502) (xy 148.162762 82.545987) (xy 148.120301 82.524352) (xy 148.026524 82.5095) - (xy 147.663482 82.5095) (xy 147.588885 82.521315) (xy 147.569696 82.524354) (xy 147.456658 82.58195) - (xy 147.456656 82.581951) (xy 147.447963 82.586381) (xy 147.446151 82.582824) (xy 147.398663 82.599794) - (xy 147.391525 82.6) (xy 146.398475 82.6) (xy 146.343345 82.583812) (xy 146.342037 82.586381) (xy 146.333343 82.581951) + (xy 152.891201 78.775328) (xy 152.86413 78.781506) (xy 152.7 78.8) (xy 152.699999 78.8) (xy 152.521988 78.820056) + (xy 152.352891 78.879225) (xy 152.201207 78.974535) (xy 152.074535 79.101207) (xy 151.979225 79.252891) + (xy 151.920056 79.421988) (xy 151.9 79.599995) (xy 151.9 79.893907) (xy 151.899403 79.906061) (xy 151.881982 80.082934) + (xy 151.87724 80.106775) (xy 151.827424 80.270998) (xy 151.818121 80.293456) (xy 151.737227 80.444798) + (xy 151.723722 80.46501) (xy 151.614854 80.597666) (xy 151.597666 80.614854) (xy 151.46501 80.723722) + (xy 151.444798 80.737227) (xy 151.293456 80.818121) (xy 151.270998 80.827424) (xy 151.106775 80.87724) + (xy 151.082934 80.881982) (xy 150.906061 80.899403) (xy 150.893907 80.9) (xy 150.051469 80.9) (xy 149.906309 80.915738) + (xy 149.85792 80.920985) (xy 149.673373 80.982964) (xy 149.506398 81.083058) (xy 149.364754 81.216613) + (xy 149.255025 81.377428) (xy 149.182314 81.55802) (xy 149.15 81.75) (xy 149.15 81.750001) (xy 149.119917 81.92872) + (xy 149.112664 81.954449) (xy 149.049996 82.110099) (xy 149.037397 82.133677) (xy 148.942825 82.272278) + (xy 148.925465 82.292607) (xy 148.803386 82.407715) (xy 148.782073 82.423851) (xy 148.638158 82.510122) + (xy 148.613881 82.521315) (xy 148.519389 82.55305) (xy 148.479911 82.559502) (xy 148.219056 82.559502) + (xy 148.162762 82.545987) (xy 148.120301 82.524352) (xy 148.026524 82.5095) (xy 147.663482 82.5095) + (xy 147.588885 82.521315) (xy 147.569696 82.524354) (xy 147.456658 82.58195) (xy 147.456656 82.581951) + (xy 147.447963 82.586381) (xy 147.446151 82.582824) (xy 147.398663 82.599794) (xy 147.391525 82.6) + (xy 146.398475 82.6) (xy 146.343345 82.583812) (xy 146.342037 82.586381) (xy 146.333343 82.581951) (xy 146.333342 82.58195) (xy 146.262761 82.545987) (xy 146.220301 82.524352) (xy 146.126524 82.5095) (xy 145.763482 82.5095) (xy 145.688885 82.521315) (xy 145.669696 82.524354) (xy 145.556658 82.58195) (xy 145.556656 82.581951) (xy 145.547963 82.586381) (xy 145.546151 82.582824) (xy 145.498663 82.599794) @@ -161569,29 +165863,31 @@ (layer "F.Cu") (pts (xy 116.311971 91.102381) (xy 116.390618 91.118024) (xy 116.435308 91.136535) (xy 116.491626 91.174166) - (xy 116.525833 91.208373) (xy 116.563462 91.264688) (xy 116.581976 91.309387) (xy 116.6 91.4) (xy 116.6 91.7) - (xy 122.193907 91.7) (xy 122.206061 91.700597) (xy 122.382941 91.718018) (xy 122.406769 91.722757) - (xy 122.571001 91.772576) (xy 122.593453 91.781877) (xy 122.744798 91.862772) (xy 122.76501 91.876277) - (xy 122.897666 91.985145) (xy 122.914854 92.002333) (xy 123.023722 92.134989) (xy 123.037227 92.155201) - (xy 123.118121 92.306543) (xy 123.127424 92.329001) (xy 123.17724 92.493224) (xy 123.181982 92.517065) - (xy 123.199403 92.693938) (xy 123.2 92.706092) (xy 123.2 93.740242) (xy 123.198473 93.759641) (xy 123.181047 93.869659) - (xy 123.169059 93.906554) (xy 123.122973 93.997004) (xy 123.100169 94.028391) (xy 123.028391 94.100169) - (xy 122.997004 94.122973) (xy 122.906554 94.169059) (xy 122.869659 94.181047) (xy 122.776669 94.195775) - (xy 122.75 94.2) (xy 122.3 94.2) (xy 122.3 94.65) (xy 122.3 100.493907) (xy 122.299403 100.506061) - (xy 122.281982 100.682934) (xy 122.27724 100.706775) (xy 122.227424 100.870998) (xy 122.218121 100.893456) - (xy 122.137227 101.044798) (xy 122.123722 101.06501) (xy 122.014854 101.197666) (xy 121.997666 101.214854) - (xy 121.86501 101.323722) (xy 121.844798 101.337227) (xy 121.693456 101.418121) (xy 121.670998 101.427424) - (xy 121.506775 101.47724) (xy 121.482934 101.481982) (xy 121.306061 101.499403) (xy 121.293907 101.5) - (xy 113.506093 101.5) (xy 113.493939 101.499403) (xy 113.317065 101.481982) (xy 113.293224 101.47724) - (xy 113.129001 101.427424) (xy 113.106543 101.418121) (xy 112.955201 101.337227) (xy 112.934989 101.323722) - (xy 112.802333 101.214854) (xy 112.785145 101.197666) (xy 112.676277 101.06501) (xy 112.662772 101.044798) - (xy 112.581878 100.893456) (xy 112.572575 100.870998) (xy 112.522757 100.706769) (xy 112.518018 100.682941) - (xy 112.500597 100.506061) (xy 112.5 100.493907) (xy 112.5 92.106092) (xy 112.500597 92.093938) - (xy 112.518018 91.917056) (xy 112.522757 91.893232) (xy 112.572577 91.728994) (xy 112.581875 91.706549) - (xy 112.662775 91.555195) (xy 112.676272 91.534995) (xy 112.785149 91.402328) (xy 112.802328 91.385149) - (xy 112.934995 91.276272) (xy 112.955195 91.262775) (xy 113.106549 91.181875) (xy 113.128994 91.172577) - (xy 113.293232 91.122757) (xy 113.317056 91.118018) (xy 113.493939 91.100597) (xy 113.506093 91.1) - (xy 116.287789 91.1) + (xy 116.525833 91.208373) (xy 116.563462 91.264688) (xy 116.581976 91.309387) (xy 116.6 91.4) (xy 116.622836 91.514805) + (xy 116.687868 91.612132) (xy 116.785195 91.677164) (xy 116.785196 91.677164) (xy 116.785197 91.677165) + (xy 116.899995 91.699999) (xy 116.899999 91.7) (xy 116.9 91.7) (xy 122.193907 91.7) (xy 122.206061 91.700597) + (xy 122.382941 91.718018) (xy 122.406769 91.722757) (xy 122.571001 91.772576) (xy 122.593453 91.781877) + (xy 122.744798 91.862772) (xy 122.76501 91.876277) (xy 122.897666 91.985145) (xy 122.914854 92.002333) + (xy 123.023722 92.134989) (xy 123.037227 92.155201) (xy 123.118121 92.306543) (xy 123.127424 92.329001) + (xy 123.17724 92.493224) (xy 123.181982 92.517065) (xy 123.199403 92.693938) (xy 123.2 92.706092) + (xy 123.2 93.740242) (xy 123.198473 93.759641) (xy 123.181047 93.869659) (xy 123.169059 93.906554) + (xy 123.122973 93.997004) (xy 123.100169 94.028391) (xy 123.028391 94.100169) (xy 122.997004 94.122973) + (xy 122.906554 94.169059) (xy 122.869659 94.181047) (xy 122.776669 94.195775) (xy 122.75 94.2) (xy 122.610944 94.222023) + (xy 122.485498 94.285941) (xy 122.485491 94.285946) (xy 122.385946 94.385491) (xy 122.385941 94.385498) + (xy 122.322023 94.510944) (xy 122.3 94.65) (xy 122.3 100.493907) (xy 122.299403 100.506061) (xy 122.281982 100.682934) + (xy 122.27724 100.706775) (xy 122.227424 100.870998) (xy 122.218121 100.893456) (xy 122.137227 101.044798) + (xy 122.123722 101.06501) (xy 122.014854 101.197666) (xy 121.997666 101.214854) (xy 121.86501 101.323722) + (xy 121.844798 101.337227) (xy 121.693456 101.418121) (xy 121.670998 101.427424) (xy 121.506775 101.47724) + (xy 121.482934 101.481982) (xy 121.306061 101.499403) (xy 121.293907 101.5) (xy 113.506093 101.5) + (xy 113.493939 101.499403) (xy 113.317065 101.481982) (xy 113.293224 101.47724) (xy 113.129001 101.427424) + (xy 113.106543 101.418121) (xy 112.955201 101.337227) (xy 112.934989 101.323722) (xy 112.802333 101.214854) + (xy 112.785145 101.197666) (xy 112.676277 101.06501) (xy 112.662772 101.044798) (xy 112.581878 100.893456) + (xy 112.572575 100.870998) (xy 112.522757 100.706769) (xy 112.518018 100.682941) (xy 112.500597 100.506061) + (xy 112.5 100.493907) (xy 112.5 92.106092) (xy 112.500597 92.093938) (xy 112.518018 91.917056) (xy 112.522757 91.893232) + (xy 112.572577 91.728994) (xy 112.581875 91.706549) (xy 112.662775 91.555195) (xy 112.676272 91.534995) + (xy 112.785149 91.402328) (xy 112.802328 91.385149) (xy 112.934995 91.276272) (xy 112.955195 91.262775) + (xy 113.106549 91.181875) (xy 113.128994 91.172577) (xy 113.293232 91.122757) (xy 113.317056 91.118018) + (xy 113.493939 91.100597) (xy 113.506093 91.1) (xy 116.287789 91.1) ) ) ) @@ -161632,35 +165928,49 @@ (xy 145.369403 182.993627) (xy 145.37 183.005779) (xy 145.37 186.074012) (xy 145.364218 186.10557) (xy 145.365558 186.105901) (xy 145.363762 186.113185) (xy 145.344722 186.269999) (xy 145.344722 186.27) (xy 145.363762 186.426818) (xy 145.365557 186.434096) (xy 145.364215 186.434426) (xy 145.37 186.465986) - (xy 145.37 192.46) (xy 138.98 192.46) (xy 138.98 186.59) (xy 137.98 186.59) (xy 137.979997 186.59) - (xy 127.51069 186.59) (xy 127.51068 186.59) (xy 126.51 186.59) (xy 126.51068 187.590677) (xy 126.51068 187.59068) - (xy 126.51068 187.590685) (xy 126.519315 200.293221) (xy 126.518726 200.30538) (xy 126.50141 200.48235) - (xy 126.496679 200.506205) (xy 126.446935 200.670514) (xy 126.437641 200.692986) (xy 126.356778 200.844441) - (xy 126.343275 200.864667) (xy 126.234415 200.997417) (xy 126.217225 201.014619) (xy 126.084544 201.123573) - (xy 126.064327 201.137089) (xy 125.912934 201.218051) (xy 125.890469 201.227361) (xy 125.726183 201.277221) - (xy 125.702331 201.281967) (xy 125.525389 201.299402) (xy 125.51323 201.3) (xy 122.746683 201.3) - (xy 122.679644 201.280315) (xy 122.672813 201.275595) (xy 122.656982 201.263853) (xy 122.656934 201.263819) - (xy 122.636755 201.250336) (xy 122.636745 201.25033) (xy 122.615239 201.237441) (xy 122.463894 201.156546) - (xy 122.463871 201.156535) (xy 122.441241 201.145831) (xy 122.441238 201.14583) (xy 122.41879 201.13653) - (xy 122.418784 201.136528) (xy 122.395177 201.12808) (xy 122.291518 201.096636) (xy 122.230936 201.078259) - (xy 122.230927 201.078256) (xy 122.230899 201.078249) (xy 122.206627 201.072169) (xy 122.206612 201.072166) - (xy 122.206608 201.072165) (xy 122.18278 201.067426) (xy 122.182756 201.067421) (xy 122.158009 201.063751) - (xy 122.157985 201.063748) (xy 122.157984 201.063748) (xy 122.15798 201.063747) (xy 122.157958 201.063745) - (xy 121.981086 201.046325) (xy 121.968618 201.045406) (xy 121.95645 201.044808) (xy 121.95286 201.04472) - (xy 121.943907 201.0445) (xy 114.176093 201.0445) (xy 114.167448 201.044712) (xy 114.163549 201.044808) - (xy 114.151381 201.045406) (xy 114.138909 201.046326) (xy 114.138907 201.046326) (xy 114.138896 201.046327) - (xy 114.083901 201.051743) (xy 113.962027 201.063746) (xy 113.962 201.063749) (xy 113.937214 201.067427) - (xy 113.937212 201.067427) (xy 113.913392 201.072165) (xy 113.913382 201.072167) (xy 113.889079 201.078254) - (xy 113.889057 201.07826) (xy 113.724821 201.12808) (xy 113.710328 201.133266) (xy 113.640576 201.137316) - (xy 113.589945 201.112412) (xy 113.471481 201.015304) (xy 113.454296 200.998142) (xy 113.4537 200.997417) - (xy 113.345418 200.865673) (xy 113.331913 200.845496) (xy 113.250948 200.69435) (xy 113.241631 200.671919) - (xy 113.191683 200.507889) (xy 113.186917 200.484074) (xy 113.169293 200.307368) (xy 113.168681 200.295225) - (xy 113.160001 193.680665) (xy 113.16 193.679996) (xy 113.16 182.996406) (xy 113.160597 182.98425) - (xy 113.178025 182.807324) (xy 113.182766 182.783498) (xy 113.232604 182.61924) (xy 113.241902 182.596794) - (xy 113.322842 182.445403) (xy 113.336342 182.425205) (xy 113.445256 182.29253) (xy 113.46244 182.275351) - (xy 113.595154 182.166474) (xy 113.615358 182.15298) (xy 113.759643 182.075899) (xy 113.766758 182.072098) - (xy 113.789221 182.0628) (xy 113.953489 182.013014) (xy 113.977328 182.008278) (xy 114.15426 181.990905) - (xy 114.166379 181.990312) + (xy 145.37 192.46) (xy 144.37 192.46) (xy 139.98 192.46) (xy 138.98 192.46) (xy 138.98 187.59) (xy 138.960785 187.39491) + (xy 138.90388 187.207317) (xy 138.811656 187.034778) (xy 138.811473 187.034435) (xy 138.811471 187.034433) + (xy 138.81147 187.03443) (xy 138.687311 186.883141) (xy 138.687107 186.882892) (xy 138.535571 186.758531) + (xy 138.535564 186.758526) (xy 138.36269 186.666123) (xy 138.362687 186.666122) (xy 138.362686 186.666121) + (xy 138.362683 186.66612) (xy 138.17509 186.609215) (xy 138.175088 186.609214) (xy 138.17509 186.609214) + (xy 138.024494 186.594382) (xy 137.98 186.59) (xy 137.979997 186.59) (xy 127.51069 186.59) (xy 127.51068 186.59) + (xy 127.510674 186.59) (xy 127.51066 186.590001) (xy 127.315508 186.60923) (xy 127.127838 186.666186) + (xy 127.127837 186.666187) (xy 126.954899 186.758671) (xy 126.803329 186.883137) (xy 126.803325 186.883141) + (xy 126.678979 187.034775) (xy 126.678976 187.034778) (xy 126.586605 187.207788) (xy 126.542984 187.351872) + (xy 126.529779 187.395493) (xy 126.51068 187.590677) (xy 126.51068 187.590684) (xy 126.51068 187.590685) + (xy 126.519315 200.293221) (xy 126.518726 200.30538) (xy 126.50141 200.48235) (xy 126.496679 200.506205) + (xy 126.446935 200.670514) (xy 126.437641 200.692986) (xy 126.356778 200.844441) (xy 126.343275 200.864667) + (xy 126.234415 200.997417) (xy 126.217225 201.014619) (xy 126.084544 201.123573) (xy 126.064327 201.137089) + (xy 125.912934 201.218051) (xy 125.890469 201.227361) (xy 125.726183 201.277221) (xy 125.702331 201.281967) + (xy 125.525389 201.299402) (xy 125.51323 201.3) (xy 122.746683 201.3) (xy 122.679644 201.280315) + (xy 122.672813 201.275595) (xy 122.672706 201.275516) (xy 122.657974 201.264589) (xy 122.656982 201.263853) + (xy 122.656917 201.263807) (xy 122.636747 201.250331) (xy 122.615267 201.237456) (xy 122.615221 201.23743) + (xy 122.46421 201.156714) (xy 122.464078 201.156643) (xy 122.463809 201.156499) (xy 122.463779 201.156484) + (xy 122.453199 201.151483) (xy 122.441238 201.14583) (xy 122.441229 201.145826) (xy 122.441222 201.145823) + (xy 122.418809 201.136538) (xy 122.418784 201.136528) (xy 122.395177 201.12808) (xy 122.291518 201.096636) + (xy 122.230936 201.078259) (xy 122.230927 201.078256) (xy 122.230899 201.078249) (xy 122.206627 201.072169) + (xy 122.206612 201.072166) (xy 122.206608 201.072165) (xy 122.18278 201.067426) (xy 122.182756 201.067421) + (xy 122.157991 201.063748) (xy 122.157972 201.063746) (xy 121.987749 201.046981) (xy 121.987749 201.04698) + (xy 121.987707 201.046977) (xy 121.981114 201.046327) (xy 121.972324 201.045679) (xy 121.968596 201.045405) + (xy 121.960405 201.045002) (xy 121.956447 201.044808) (xy 121.953935 201.044746) (xy 121.943907 201.0445) + (xy 115.158878 201.0445) (xy 115.158859 201.0445) (xy 115.146337 201.044808) (xy 115.134167 201.045407) + (xy 115.134164 201.045407) (xy 115.134148 201.045408) (xy 115.121617 201.046334) (xy 114.944425 201.063816) + (xy 114.94442 201.063816) (xy 114.944407 201.063818) (xy 114.924059 201.066841) (xy 114.919575 201.067508) + (xy 114.919569 201.067509) (xy 114.919564 201.06751) (xy 114.895707 201.072264) (xy 114.871357 201.078375) + (xy 114.706846 201.128372) (xy 114.70682 201.128381) (xy 114.683234 201.136837) (xy 114.683221 201.136842) + (xy 114.660729 201.146177) (xy 114.638041 201.156929) (xy 114.638035 201.156932) (xy 114.486494 201.238099) + (xy 114.486481 201.238107) (xy 114.464973 201.251026) (xy 114.44472 201.264589) (xy 114.430022 201.275516) + (xy 114.364476 201.299713) (xy 114.356045 201.3) (xy 114.174777 201.3) (xy 114.162633 201.299404) + (xy 113.985905 201.282012) (xy 113.962083 201.277278) (xy 113.797982 201.227543) (xy 113.775543 201.218256) + (xy 113.62429 201.13749) (xy 113.604091 201.124007) (xy 113.471481 201.015304) (xy 113.454296 200.998142) + (xy 113.4537 200.997417) (xy 113.345418 200.865673) (xy 113.331913 200.845496) (xy 113.250948 200.69435) + (xy 113.241631 200.671919) (xy 113.191683 200.507889) (xy 113.186917 200.484074) (xy 113.169293 200.307368) + (xy 113.168681 200.295225) (xy 113.160001 193.680665) (xy 113.16 193.679996) (xy 113.16 182.996406) + (xy 113.160597 182.98425) (xy 113.178025 182.807324) (xy 113.182766 182.783498) (xy 113.232604 182.61924) + (xy 113.241902 182.596794) (xy 113.322842 182.445403) (xy 113.336342 182.425205) (xy 113.445256 182.29253) + (xy 113.46244 182.275351) (xy 113.595154 182.166474) (xy 113.615358 182.15298) (xy 113.759643 182.075899) + (xy 113.766758 182.072098) (xy 113.789221 182.0628) (xy 113.953489 182.013014) (xy 113.977328 182.008278) + (xy 114.15426 181.990905) (xy 114.166379 181.990312) ) ) ) @@ -161691,11 +166001,9 @@ (filled_polygon (layer "F.Cu") (pts - (xy 266.909775 197.819685) (xy 266.95553 197.872489) (xy 266.962801 197.895004) (xy 266.96395 197.897778) - (xy 267.016398 197.976272) (xy 267.019334 197.980666) (xy 267.102224 198.036051) (xy 267.102227 198.036051) - (xy 267.102228 198.036052) (xy 267.199995 198.055499) (xy 267.199998 198.0555) (xy 267.2 198.0555) - (xy 268.517175 198.0555) (xy 268.584214 198.075185) (xy 268.595828 198.083637) (xy 268.597655 198.085136) - (xy 268.614855 198.102334) (xy 268.723722 198.234989) (xy 268.737227 198.255201) (xy 268.818121 198.406543) + (xy 267.906061 197.800597) (xy 268.082941 197.818018) (xy 268.106769 197.822757) (xy 268.271001 197.872576) + (xy 268.293453 197.881877) (xy 268.444798 197.962772) (xy 268.46501 197.976277) (xy 268.597666 198.085145) + (xy 268.614854 198.102333) (xy 268.723722 198.234989) (xy 268.737227 198.255201) (xy 268.818121 198.406543) (xy 268.827424 198.429001) (xy 268.87724 198.593224) (xy 268.881982 198.617065) (xy 268.899403 198.793938) (xy 268.9 198.806092) (xy 268.9 206.227094) (xy 268.880315 206.294133) (xy 268.827511 206.339888) (xy 268.758353 206.349832) (xy 268.694797 206.320807) (xy 268.676734 206.301406) (xy 268.675913 206.300309) @@ -161829,15 +166137,15 @@ (xy 266.04486 199.339815) (xy 266.024218 199.323181) (xy 265.170565 198.469528) (xy 265.170564 198.469527) (xy 265.08494 198.420092) (xy 265.037188 198.407297) (xy 265.037186 198.407296) (xy 265.037184 198.407295) (xy 264.989438 198.394502) (xy 264.989437 198.394502) (xy 264.34298 198.394502) (xy 264.275941 198.374817) - (xy 264.24321 198.344135) (xy 264.172151 198.247853) (xy 264.062882 198.167209) (xy 264.06288 198.167208) - (xy 263.9347 198.122355) (xy 263.90427 198.119502) (xy 263.904266 198.119502) (xy 263.245734 198.119502) - (xy 263.24573 198.119502) (xy 263.2153 198.122355) (xy 263.215298 198.122355) (xy 263.087119 198.167208) - (xy 263.087117 198.167209) (xy 262.97785 198.247852) (xy 262.897207 198.357119) (xy 262.897206 198.357121) - (xy 262.852353 198.4853) (xy 262.852353 198.485302) (xy 262.8495 198.515732) (xy 260.846266 198.515732) - (xy 260.872577 198.428994) (xy 260.881875 198.406549) (xy 260.962775 198.255195) (xy 260.976272 198.234995) - (xy 261.085149 198.102328) (xy 261.102328 198.085149) (xy 261.234995 197.976272) (xy 261.255195 197.962775) - (xy 261.406549 197.881875) (xy 261.428994 197.872577) (xy 261.593232 197.822757) (xy 261.617056 197.818018) - (xy 261.793939 197.800597) (xy 261.806093 197.8) (xy 266.842736 197.8) + (xy 264.24321 198.344135) (xy 264.172151 198.247853) (xy 264.128399 198.215563) (xy 264.062882 198.167209) + (xy 264.06288 198.167208) (xy 263.9347 198.122355) (xy 263.90427 198.119502) (xy 263.904266 198.119502) + (xy 263.245734 198.119502) (xy 263.24573 198.119502) (xy 263.2153 198.122355) (xy 263.215298 198.122355) + (xy 263.087119 198.167208) (xy 263.087117 198.167209) (xy 262.97785 198.247852) (xy 262.897207 198.357119) + (xy 262.897206 198.357121) (xy 262.852353 198.4853) (xy 262.852353 198.485302) (xy 262.8495 198.515732) + (xy 260.846266 198.515732) (xy 260.872577 198.428994) (xy 260.881875 198.406549) (xy 260.962775 198.255195) + (xy 260.976272 198.234995) (xy 261.085149 198.102328) (xy 261.102328 198.085149) (xy 261.234995 197.976272) + (xy 261.255195 197.962775) (xy 261.406549 197.881875) (xy 261.428994 197.872577) (xy 261.593232 197.822757) + (xy 261.617056 197.818018) (xy 261.793939 197.800597) (xy 261.806093 197.8) (xy 267.893907 197.8) ) ) ) @@ -161875,8 +166183,12 @@ (xy 158.793453 203.981877) (xy 158.944798 204.062772) (xy 158.96501 204.076277) (xy 159.097666 204.185145) (xy 159.114854 204.202333) (xy 159.223722 204.334989) (xy 159.237227 204.355201) (xy 159.318121 204.506543) (xy 159.327422 204.528996) (xy 159.331559 204.542632) (xy 159.3369 204.578632) (xy 159.3369 205.644878) - (xy 159.351432 205.717935) (xy 159.351433 205.717939) (xy 159.351434 205.71794) (xy 159.4 205.790625) - (xy 159.4 206.1) (xy 163.793907 206.1) (xy 163.806061 206.100597) (xy 163.982941 206.118018) (xy 164.006769 206.122757) + (xy 159.351432 205.717935) (xy 159.351433 205.717939) (xy 159.351434 205.71794) (xy 159.406799 205.800801) + (xy 159.48966 205.856166) (xy 159.489664 205.856167) (xy 159.562721 205.870699) (xy 159.562724 205.8707) + (xy 159.726013 205.8707) (xy 159.793052 205.890385) (xy 159.804673 205.898842) (xy 159.84443 205.93147) + (xy 159.844433 205.931472) (xy 159.844435 205.931473) (xy 160.017309 206.023876) (xy 160.01731 206.023876) + (xy 160.017317 206.02388) (xy 160.20491 206.080785) (xy 160.204909 206.080785) (xy 160.253682 206.085588) + (xy 160.4 206.1) (xy 163.793907 206.1) (xy 163.806061 206.100597) (xy 163.982941 206.118018) (xy 164.006769 206.122757) (xy 164.171001 206.172576) (xy 164.193453 206.181877) (xy 164.344798 206.262772) (xy 164.36501 206.276277) (xy 164.497666 206.385145) (xy 164.514854 206.402333) (xy 164.623722 206.534989) (xy 164.637227 206.555201) (xy 164.718121 206.706543) (xy 164.727424 206.729001) (xy 164.77724 206.893224) (xy 164.781982 206.917065) @@ -161888,37 +166200,45 @@ (xy 164.629815 211.556271) (xy 164.621353 211.567897) (xy 164.514854 211.697666) (xy 164.497666 211.714854) (xy 164.36501 211.823722) (xy 164.344798 211.837227) (xy 164.193456 211.918121) (xy 164.170998 211.927424) (xy 164.006775 211.97724) (xy 163.982934 211.981982) (xy 163.806061 211.999403) (xy 163.793907 212) - (xy 160.8 212) (xy 160.8 212.85) (xy 160.8 212.850001) (xy 160.780253 213.025255) (xy 160.774075 213.052326) + (xy 161.649993 212) (xy 161.460862 212.021309) (xy 161.460857 212.02131) (xy 161.281198 212.084176) + (xy 161.120033 212.185443) (xy 160.985443 212.320033) (xy 160.884176 212.481198) (xy 160.82131 212.660857) + (xy 160.821309 212.660862) (xy 160.8 212.85) (xy 160.8 212.850001) (xy 160.780253 213.025255) (xy 160.774075 213.052326) (xy 160.720437 213.205615) (xy 160.708389 213.230632) (xy 160.621989 213.368137) (xy 160.604676 213.389846) (xy 160.489846 213.504676) (xy 160.468137 213.521989) (xy 160.330632 213.608389) (xy 160.305615 213.620437) (xy 160.152326 213.674075) (xy 160.125255 213.680253) (xy 159.982001 213.696394) (xy 159.956921 213.69922) - (xy 159.94304 213.7) (xy 156 213.7) (xy 156 213.95) (xy 156 213.950001) (xy 155.985781 214.021481) - (xy 155.967267 214.066179) (xy 155.940481 214.106268) (xy 155.906269 214.140479) (xy 155.871975 214.163394) - (xy 155.866179 214.167267) (xy 155.821482 214.185781) (xy 155.787857 214.192469) (xy 155.761978 214.197617) - (xy 155.737789 214.2) (xy 149.406093 214.2) (xy 149.393939 214.199403) (xy 149.217065 214.181982) - (xy 149.193224 214.17724) (xy 149.029001 214.127424) (xy 149.006543 214.118121) (xy 148.855201 214.037227) - (xy 148.834989 214.023722) (xy 148.702333 213.914854) (xy 148.685145 213.897666) (xy 148.576277 213.76501) - (xy 148.562772 213.744798) (xy 148.481878 213.593456) (xy 148.472575 213.570998) (xy 148.422757 213.406769) - (xy 148.418018 213.382941) (xy 148.400597 213.206061) (xy 148.4 213.193907) (xy 148.4 210.796681) - (xy 148.419685 210.729642) (xy 148.424392 210.722829) (xy 148.436164 210.706957) (xy 148.449669 210.686745) - (xy 148.462558 210.66524) (xy 148.523576 210.551082) (xy 148.543441 210.513919) (xy 148.543448 210.513905) - (xy 148.543452 210.513898) (xy 148.55417 210.491237) (xy 148.563473 210.468779) (xy 148.571922 210.445165) - (xy 148.621738 210.280942) (xy 148.627831 210.256618) (xy 148.632573 210.232777) (xy 148.636252 210.207978) - (xy 148.653673 210.031105) (xy 148.654595 210.018596) (xy 148.655192 210.006442) (xy 148.6555 209.993907) - (xy 148.6555 208.682824) (xy 148.675185 208.615785) (xy 148.683632 208.604177) (xy 148.685135 208.602345) - (xy 148.702328 208.585149) (xy 148.834995 208.476272) (xy 148.855195 208.462775) (xy 149.006549 208.381875) - (xy 149.028994 208.372577) (xy 149.193232 208.322757) (xy 149.217056 208.318018) (xy 149.393939 208.300597) - (xy 149.406093 208.3) (xy 151.599997 208.3) (xy 151.6 208.3) (xy 152.6 208.3) (xy 152.6 207.106092) - (xy 152.600597 207.093938) (xy 152.618018 206.917056) (xy 152.622757 206.893232) (xy 152.672577 206.728994) - (xy 152.681875 206.706549) (xy 152.762775 206.555195) (xy 152.776272 206.534995) (xy 152.885149 206.402328) - (xy 152.902328 206.385149) (xy 153.034995 206.276272) (xy 153.055195 206.262775) (xy 153.206549 206.181875) - (xy 153.228994 206.172577) (xy 153.393232 206.122757) (xy 153.417056 206.118018) (xy 153.593939 206.100597) - (xy 153.606093 206.1) (xy 154.199997 206.1) (xy 154.2 206.1) (xy 155.2 206.1) (xy 155.2 205.793618) - (xy 155.250566 205.71794) (xy 155.2651 205.644874) (xy 155.2651 204.572039) (xy 155.270437 204.536051) - (xy 155.272575 204.529002) (xy 155.281875 204.506549) (xy 155.362775 204.355195) (xy 155.376272 204.334995) - (xy 155.485149 204.202328) (xy 155.502328 204.185149) (xy 155.634995 204.076272) (xy 155.655195 204.062775) - (xy 155.806549 203.981875) (xy 155.828994 203.972577) (xy 155.993232 203.922757) (xy 156.017056 203.918018) - (xy 156.193939 203.900597) (xy 156.206093 203.9) (xy 158.393907 203.9) + (xy 159.94304 213.7) (xy 156.249995 213.7) (xy 156.154329 213.719029) (xy 156.154328 213.719029) + (xy 156.073223 213.773223) (xy 156.01903 213.854327) (xy 156.01903 213.854329) (xy 156 213.95) (xy 156 213.950001) + (xy 155.985781 214.021481) (xy 155.967267 214.066179) (xy 155.940481 214.106268) (xy 155.906269 214.140479) + (xy 155.871975 214.163394) (xy 155.866179 214.167267) (xy 155.821482 214.185781) (xy 155.787857 214.192469) + (xy 155.761978 214.197617) (xy 155.737789 214.2) (xy 149.406093 214.2) (xy 149.393939 214.199403) + (xy 149.217065 214.181982) (xy 149.193224 214.17724) (xy 149.029001 214.127424) (xy 149.006543 214.118121) + (xy 148.855201 214.037227) (xy 148.834989 214.023722) (xy 148.702333 213.914854) (xy 148.685145 213.897666) + (xy 148.576277 213.76501) (xy 148.562772 213.744798) (xy 148.481878 213.593456) (xy 148.472575 213.570998) + (xy 148.422757 213.406769) (xy 148.418018 213.382941) (xy 148.400597 213.206061) (xy 148.4 213.193907) + (xy 148.4 210.796681) (xy 148.419685 210.729642) (xy 148.424392 210.722829) (xy 148.436164 210.706957) + (xy 148.449669 210.686745) (xy 148.462558 210.66524) (xy 148.523576 210.551082) (xy 148.543441 210.513919) + (xy 148.543448 210.513905) (xy 148.543452 210.513898) (xy 148.55417 210.491237) (xy 148.563473 210.468779) + (xy 148.571922 210.445165) (xy 148.621738 210.280942) (xy 148.627831 210.256618) (xy 148.632573 210.232777) + (xy 148.636252 210.207978) (xy 148.653673 210.031105) (xy 148.654595 210.018596) (xy 148.655192 210.006442) + (xy 148.6555 209.993907) (xy 148.6555 208.682824) (xy 148.675185 208.615785) (xy 148.683632 208.604177) + (xy 148.685135 208.602345) (xy 148.702328 208.585149) (xy 148.834995 208.476272) (xy 148.855195 208.462775) + (xy 149.006549 208.381875) (xy 149.028994 208.372577) (xy 149.193232 208.322757) (xy 149.217056 208.318018) + (xy 149.393939 208.300597) (xy 149.406093 208.3) (xy 151.599997 208.3) (xy 151.6 208.3) (xy 151.79509 208.280785) + (xy 151.982683 208.22388) (xy 152.15557 208.13147) (xy 152.307107 208.007107) (xy 152.43147 207.85557) + (xy 152.52388 207.682683) (xy 152.580785 207.49509) (xy 152.6 207.3) (xy 152.6 207.106092) (xy 152.600597 207.093938) + (xy 152.618018 206.917056) (xy 152.622757 206.893232) (xy 152.672577 206.728994) (xy 152.681875 206.706549) + (xy 152.762775 206.555195) (xy 152.776272 206.534995) (xy 152.885149 206.402328) (xy 152.902328 206.385149) + (xy 153.034995 206.276272) (xy 153.055195 206.262775) (xy 153.206549 206.181875) (xy 153.228994 206.172577) + (xy 153.393232 206.122757) (xy 153.417056 206.118018) (xy 153.593939 206.100597) (xy 153.606093 206.1) + (xy 154.199997 206.1) (xy 154.2 206.1) (xy 154.39509 206.080785) (xy 154.582683 206.02388) (xy 154.755564 205.931473) + (xy 154.755565 205.931473) (xy 154.755566 205.931472) (xy 154.75557 205.93147) (xy 154.795323 205.898845) + (xy 154.859633 205.871534) (xy 154.873987 205.8707) (xy 155.039276 205.8707) (xy 155.039277 205.870699) + (xy 155.11234 205.856166) (xy 155.195201 205.800801) (xy 155.250566 205.71794) (xy 155.2651 205.644874) + (xy 155.2651 204.572039) (xy 155.270437 204.536051) (xy 155.272575 204.529002) (xy 155.281875 204.506549) + (xy 155.362775 204.355195) (xy 155.376272 204.334995) (xy 155.485149 204.202328) (xy 155.502328 204.185149) + (xy 155.634995 204.076272) (xy 155.655195 204.062775) (xy 155.806549 203.981875) (xy 155.828994 203.972577) + (xy 155.993232 203.922757) (xy 156.017056 203.918018) (xy 156.193939 203.900597) (xy 156.206093 203.9) + (xy 158.393907 203.9) ) ) ) @@ -161952,126 +166272,128 @@ (xy 263.377862 90.026994) (xy 263.444807 90.062777) (xy 263.46501 90.076277) (xy 263.597666 90.185145) (xy 263.614854 90.202333) (xy 263.723722 90.334989) (xy 263.737227 90.355201) (xy 263.818121 90.506543) (xy 263.827424 90.529001) (xy 263.87724 90.693224) (xy 263.881982 90.717065) (xy 263.899403 90.893938) - (xy 263.9 90.906092) (xy 263.9 96.1) (xy 264.371173 96.251991) (xy 264.376242 96.309933) (xy 264.343734 96.371779) - (xy 264.28295 96.406233) (xy 264.254673 96.4095) (xy 264.00573 96.4095) (xy 263.9753 96.412353) - (xy 263.975298 96.412353) (xy 263.847119 96.457206) (xy 263.847117 96.457207) (xy 263.73785 96.53785) - (xy 263.657207 96.647117) (xy 263.657206 96.647119) (xy 263.612353 96.775298) (xy 263.612353 96.7753) - (xy 263.6095 96.80573) (xy 263.6095 97.464269) (xy 263.612353 97.494699) (xy 263.612353 97.494701) - (xy 263.657206 97.62288) (xy 263.657207 97.622882) (xy 263.737851 97.732151) (xy 263.834133 97.80321) - (xy 263.876384 97.858857) (xy 263.8845 97.90298) (xy 263.8845 98.309435) (xy 263.91009 98.404938) - (xy 263.910091 98.404939) (xy 263.910091 98.40494) (xy 263.959526 98.490563) (xy 264.515481 99.046518) - (xy 264.548966 99.107841) (xy 264.550896 99.149143) (xy 264.544722 99.199997) (xy 264.544722 99.2) - (xy 264.563762 99.356818) (xy 264.588685 99.422533) (xy 264.61978 99.504523) (xy 264.709517 99.63453) - (xy 264.82776 99.739283) (xy 264.827762 99.739284) (xy 264.967634 99.812696) (xy 265.121014 99.8505) - (xy 265.121015 99.8505) (xy 265.278985 99.8505) (xy 265.432365 99.812696) (xy 265.57224 99.739283) - (xy 265.690483 99.63453) (xy 265.78022 99.504523) (xy 265.836237 99.356818) (xy 265.855278 99.2) - (xy 265.836237 99.043182) (xy 265.78022 98.895477) (xy 265.690483 98.76547) (xy 265.57224 98.660717) - (xy 265.572238 98.660716) (xy 265.572237 98.660715) (xy 265.432365 98.587303) (xy 265.278986 98.5495) - (xy 265.278985 98.5495) (xy 265.1319 98.5495) (xy 265.064861 98.529815) (xy 265.044219 98.513181) - (xy 264.671819 98.140781) (xy 264.638334 98.079458) (xy 264.6355 98.0531) (xy 264.6355 97.90298) - (xy 264.655185 97.835941) (xy 264.685867 97.80321) (xy 264.723998 97.775067) (xy 264.78215 97.73215) - (xy 264.862793 97.622882) (xy 264.893305 97.535684) (xy 264.907646 97.494701) (xy 264.907646 97.494699) - (xy 264.9105 97.464269) (xy 264.9105 96.80573) (xy 264.907646 96.7753) (xy 264.907646 96.775298) - (xy 264.862793 96.647119) (xy 264.862792 96.647117) (xy 264.862375 96.646552) (xy 264.862109 96.645826) - (xy 264.858449 96.638899) (xy 264.859396 96.638398) (xy 264.838404 96.580923) (xy 264.853719 96.512752) - (xy 264.90346 96.463684) (xy 264.971832 96.449297) (xy 265.000201 96.454903) (xy 270.1 98.1) (xy 275.60082 99.874458) - (xy 275.612949 99.879086) (xy 275.786536 99.955969) (xy 275.809042 99.96891) (xy 275.957508 100.076418) - (xy 275.976829 100.093765) (xy 276.099646 100.229828) (xy 276.114926 100.25081) (xy 276.206721 100.409481) - (xy 276.217297 100.43319) (xy 276.274034 100.607493) (xy 276.279441 100.63289) (xy 276.299318 100.821682) - (xy 276.3 100.834666) (xy 276.3 121.293907) (xy 276.299403 121.306061) (xy 276.281982 121.482934) - (xy 276.27724 121.506775) (xy 276.227424 121.670998) (xy 276.218121 121.693456) (xy 276.137227 121.844798) - (xy 276.123722 121.86501) (xy 276.014854 121.997666) (xy 275.997666 122.014854) (xy 275.86501 122.123722) - (xy 275.844798 122.137227) (xy 275.693456 122.218121) (xy 275.670998 122.227424) (xy 275.506775 122.27724) - (xy 275.482934 122.281982) (xy 275.306061 122.299403) (xy 275.293907 122.3) (xy 272.233678 122.3) - (xy 272.166639 122.280315) (xy 272.120884 122.227511) (xy 272.11094 122.158353) (xy 272.130576 122.107109) - (xy 272.16508 122.055469) (xy 272.16508 122.055468) (xy 272.165084 122.055463) (xy 272.221658 121.918881) - (xy 272.2505 121.773886) (xy 272.2505 121.626051) (xy 272.2505 121.626048) (xy 272.221659 121.481061) - (xy 272.221658 121.48106) (xy 272.221658 121.481056) (xy 272.214578 121.463963) (xy 272.165085 121.344475) - (xy 272.165083 121.344472) (xy 272.082952 121.221553) (xy 272.082946 121.221546) (xy 271.978421 121.117021) - (xy 271.978414 121.117015) (xy 271.855495 121.034884) (xy 271.855492 121.034882) (xy 271.718916 120.978311) - (xy 271.718906 120.978308) (xy 271.573919 120.949468) (xy 271.573917 120.949468) (xy 271.426082 120.949468) - (xy 271.420321 120.949468) (xy 271.41967 120.9495) (xy 267.869822 120.9495) (xy 267.802783 120.929815) - (xy 267.766013 120.893321) (xy 267.739185 120.852257) (xy 267.584791 120.684541) (xy 267.584787 120.684538) - (xy 267.404909 120.544533) (xy 267.4049 120.544527) (xy 267.204432 120.43604) (xy 267.204429 120.436039) - (xy 267.204426 120.436037) (xy 267.20442 120.436035) (xy 267.204418 120.436034) (xy 266.988826 120.36202) - (xy 266.820188 120.33388) (xy 266.763977 120.3245) (xy 266.536023 120.3245) (xy 266.491053 120.332004) - (xy 266.311173 120.36202) (xy 266.095581 120.436034) (xy 266.095567 120.43604) (xy 265.895099 120.544527) - (xy 265.89509 120.544533) (xy 265.715212 120.684538) (xy 265.715207 120.684543) (xy 265.675779 120.727372) - (xy 265.615892 120.763361) (xy 265.546053 120.76126) (xy 265.488438 120.721734) (xy 265.461338 120.657334) - (xy 265.464346 120.612946) (xy 265.511387 120.427188) (xy 265.511387 120.427187) (xy 265.51139 120.427176) - (xy 265.530214 120.2) (xy 265.530214 120.199993) (xy 265.511391 119.972831) (xy 265.511389 119.97282) - (xy 265.45543 119.751844) (xy 265.410444 119.649286) (xy 265.4 119.599476) (xy 265.4 118.169072) - (xy 265.400641 118.156484) (xy 265.419327 117.973367) (xy 265.424412 117.948709) (xy 265.477798 117.779184) - (xy 265.487759 117.756062) (xy 265.574289 117.60081) (xy 265.588706 117.58019) (xy 265.61263 117.55246) - (xy 265.671325 117.514563) (xy 265.741195 117.514414) (xy 265.741425 117.514481) (xy 265.772055 117.52351) - (xy 265.772059 117.523511) (xy 265.772066 117.523513) (xy 265.795732 117.529276) (xy 265.795743 117.529278) - (xy 265.795766 117.529284) (xy 265.795782 117.529287) (xy 265.818973 117.533774) (xy 265.818988 117.533776) - (xy 265.818995 117.533778) (xy 265.843148 117.537263) (xy 265.918979 117.544531) (xy 265.966627 117.549098) - (xy 265.966637 117.5491) (xy 266.015332 117.553767) (xy 266.01534 117.553767) (xy 266.015355 117.553769) - (xy 266.02752 117.554642) (xy 266.039349 117.555208) (xy 266.05156 117.5555) (xy 266.05158 117.5555) - (xy 267.193887 117.5555) (xy 267.193907 117.5555) (xy 267.206442 117.555192) (xy 267.218596 117.554595) - (xy 267.231105 117.553673) (xy 267.407978 117.536252) (xy 267.432777 117.532573) (xy 267.456618 117.527831) - (xy 267.480942 117.521738) (xy 267.645165 117.471922) (xy 267.668779 117.463473) (xy 267.691237 117.45417) - (xy 267.713898 117.443452) (xy 267.727771 117.436037) (xy 267.779058 117.408623) (xy 267.86524 117.362558) - (xy 267.886745 117.349669) (xy 267.906957 117.336164) (xy 267.927098 117.321226) (xy 268.059754 117.212358) - (xy 268.078332 117.19552) (xy 268.09552 117.178332) (xy 268.112358 117.159754) (xy 268.221226 117.027098) - (xy 268.236164 117.006957) (xy 268.249669 116.986745) (xy 268.262558 116.96524) (xy 268.343452 116.813898) - (xy 268.35417 116.791237) (xy 268.363473 116.768779) (xy 268.371922 116.745165) (xy 268.421738 116.580942) - (xy 268.427831 116.556618) (xy 268.432573 116.532777) (xy 268.436252 116.507978) (xy 268.453673 116.331105) - (xy 268.454595 116.318596) (xy 268.455192 116.306442) (xy 268.4555 116.293907) (xy 268.4555 108.677517) - (xy 268.455156 108.664269) (xy 268.454489 108.651423) (xy 268.453458 108.638202) (xy 268.434 108.451386) - (xy 268.429891 108.425202) (xy 268.424597 108.400064) (xy 268.424592 108.400045) (xy 268.424588 108.400027) - (xy 268.417804 108.374469) (xy 268.400968 108.322149) (xy 271.1995 108.322149) (xy 271.1995 108.57785) - (xy 271.225457 108.775007) (xy 271.232874 108.83134) (xy 271.29905 109.078312) (xy 271.299053 109.078322) - (xy 271.396894 109.314531) (xy 271.396899 109.314542) (xy 271.524734 109.535957) (xy 271.524745 109.535973) - (xy 271.680388 109.738811) (xy 271.680394 109.738818) (xy 271.861181 109.919605) (xy 271.861187 109.91961) - (xy 272.064035 110.075261) (xy 272.064042 110.075265) (xy 272.285457 110.2031) (xy 272.285462 110.203102) - (xy 272.285465 110.203104) (xy 272.521687 110.30095) (xy 272.76866 110.367126) (xy 273.022157 110.4005) - (xy 273.022164 110.4005) (xy 273.277836 110.4005) (xy 273.277843 110.4005) (xy 273.53134 110.367126) - (xy 273.778313 110.30095) (xy 274.014535 110.203104) (xy 274.235965 110.075261) (xy 274.438813 109.91961) - (xy 274.61961 109.738813) (xy 274.775261 109.535965) (xy 274.903104 109.314535) (xy 275.00095 109.078313) - (xy 275.067126 108.83134) (xy 275.1005 108.577843) (xy 275.1005 108.322157) (xy 275.067126 108.06866) - (xy 275.00095 107.821687) (xy 274.903104 107.585465) (xy 274.903102 107.585462) (xy 274.9031 107.585457) - (xy 274.775265 107.364042) (xy 274.775261 107.364035) (xy 274.61961 107.161187) (xy 274.619605 107.161181) - (xy 274.438818 106.980394) (xy 274.438811 106.980388) (xy 274.235973 106.824745) (xy 274.235971 106.824743) - (xy 274.235965 106.824739) (xy 274.23596 106.824736) (xy 274.235957 106.824734) (xy 274.014542 106.696899) - (xy 274.014531 106.696894) (xy 273.778322 106.599053) (xy 273.778315 106.599051) (xy 273.778313 106.59905) - (xy 273.53134 106.532874) (xy 273.475007 106.525457) (xy 273.27785 106.4995) (xy 273.277843 106.4995) - (xy 273.022157 106.4995) (xy 273.022149 106.4995) (xy 272.796826 106.529165) (xy 272.76866 106.532874) - (xy 272.521687 106.59905) (xy 272.521677 106.599053) (xy 272.285468 106.696894) (xy 272.285457 106.696899) - (xy 272.064042 106.824734) (xy 272.064026 106.824745) (xy 271.861188 106.980388) (xy 271.861181 106.980394) - (xy 271.680394 107.161181) (xy 271.680388 107.161188) (xy 271.524745 107.364026) (xy 271.524734 107.364042) - (xy 271.396899 107.585457) (xy 271.396894 107.585468) (xy 271.299053 107.821677) (xy 271.29905 107.821687) - (xy 271.270237 107.929221) (xy 271.232874 108.068661) (xy 271.1995 108.322149) (xy 268.400968 108.322149) - (xy 268.362244 108.201808) (xy 268.362243 108.201806) (xy 268.352836 108.177057) (xy 268.352833 108.177048) - (xy 268.342473 108.15354) (xy 268.33054 108.129873) (xy 268.240607 107.972392) (xy 268.226288 107.95009) - (xy 268.211307 107.929223) (xy 268.211306 107.929221) (xy 268.194762 107.908534) (xy 268.194753 107.908523) - (xy 268.074294 107.77295) (xy 268.055685 107.754075) (xy 268.055684 107.754074) (xy 268.036716 107.736734) - (xy 268.016268 107.719905) (xy 268.016267 107.719903) (xy 267.865242 107.608207) (xy 267.854389 107.600607) - (xy 267.850862 107.598271) (xy 267.843662 107.593504) (xy 267.842175 107.592573) (xy 267.832416 107.586469) - (xy 266.068801 106.545937) (xy 266.058774 106.539348) (xy 253.715705 97.54299) (xy 253.706613 97.535684) - (xy 253.57897 97.422842) (xy 253.563039 97.405836) (xy 253.462347 97.275739) (xy 253.44988 97.256054) - (xy 253.375306 97.109421) (xy 253.366743 97.087756) (xy 253.320914 96.929747) (xy 253.316556 96.906858) - (xy 253.300549 96.737244) (xy 253.3 96.725594) (xy 253.3 91.406092) (xy 253.300597 91.393938) (xy 253.318018 91.217056) - (xy 253.322757 91.193232) (xy 253.372577 91.028994) (xy 253.381875 91.006549) (xy 253.462775 90.855195) - (xy 253.476272 90.834995) (xy 253.585149 90.702328) (xy 253.602328 90.685149) (xy 253.734995 90.576272) - (xy 253.755195 90.562775) (xy 253.906549 90.481875) (xy 253.928994 90.472577) (xy 254.093232 90.422757) - (xy 254.117056 90.418018) (xy 254.293939 90.400597) (xy 254.306093 90.4) (xy 255.067601 90.4) (xy 255.13464 90.419685) - (xy 255.155282 90.436319) (xy 256.02818 91.309217) (xy 256.061665 91.37054) (xy 256.064499 91.396897) - (xy 256.064499 91.489726) (xy 256.0645 91.489733) (xy 256.070907 91.54934) (xy 256.121201 91.684185) - (xy 256.121205 91.684192) (xy 256.207451 91.799401) (xy 256.207454 91.799404) (xy 256.322663 91.88565) - (xy 256.32267 91.885654) (xy 256.457516 91.935948) (xy 256.457515 91.935948) (xy 256.464443 91.936692) - (xy 256.517126 91.942357) (xy 257.512871 91.942356) (xy 257.572482 91.935948) (xy 257.70733 91.885653) - (xy 257.822545 91.799403) (xy 257.890694 91.708367) (xy 257.946625 91.666499) (xy 258.016316 91.661515) - (xy 258.077639 91.695) (xy 258.089224 91.708369) (xy 258.112456 91.739402) (xy 258.227665 91.825648) - (xy 258.227672 91.825652) (xy 258.362518 91.875946) (xy 258.362517 91.875946) (xy 258.369445 91.87669) - (xy 258.422128 91.882355) (xy 259.467873 91.882354) (xy 259.527484 91.875946) (xy 259.662332 91.825651) - (xy 259.777547 91.739401) (xy 259.863797 91.624186) (xy 259.914092 91.489338) (xy 259.920501 91.429728) - (xy 259.9205 90.833983) (xy 259.914092 90.774372) (xy 259.914092 90.774371) (xy 259.883369 90.691998) - (xy 259.878385 90.622306) (xy 259.91187 90.560983) (xy 259.96746 90.52889) (xy 260.002278 90.519561) - (xy 260.002282 90.519558) (xy 260.002286 90.519558) (xy 260.050038 90.506763) (xy 260.135662 90.457328) - (xy 260.205575 90.387415) (xy 260.544317 90.048673) (xy 260.60564 90.015188) (xy 260.631998 90.012354) - (xy 263.319412 90.012354) + (xy 263.9 90.906092) (xy 263.9 95.37183) (xy 263.900001 95.371857) (xy 263.921925 95.580093) (xy 263.986742 95.779221) + (xy 264.091605 95.96048) (xy 264.231915 96.115923) (xy 264.231919 96.115927) (xy 264.231922 96.115929) + (xy 264.231923 96.11593) (xy 264.327399 96.185067) (xy 264.370153 96.240329) (xy 264.376242 96.309933) + (xy 264.343734 96.371779) (xy 264.28295 96.406233) (xy 264.254673 96.4095) (xy 264.00573 96.4095) + (xy 263.9753 96.412353) (xy 263.975298 96.412353) (xy 263.847119 96.457206) (xy 263.847117 96.457207) + (xy 263.73785 96.53785) (xy 263.657207 96.647117) (xy 263.657206 96.647119) (xy 263.612353 96.775298) + (xy 263.612353 96.7753) (xy 263.6095 96.80573) (xy 263.6095 97.464269) (xy 263.612353 97.494699) + (xy 263.612353 97.494701) (xy 263.657206 97.62288) (xy 263.657207 97.622882) (xy 263.737851 97.732151) + (xy 263.834133 97.80321) (xy 263.876384 97.858857) (xy 263.8845 97.90298) (xy 263.8845 98.309435) + (xy 263.91009 98.404938) (xy 263.910091 98.404939) (xy 263.910091 98.40494) (xy 263.959526 98.490563) + (xy 264.515481 99.046518) (xy 264.548966 99.107841) (xy 264.550896 99.149143) (xy 264.544722 99.199997) + (xy 264.544722 99.2) (xy 264.563762 99.356818) (xy 264.588685 99.422533) (xy 264.61978 99.504523) + (xy 264.709517 99.63453) (xy 264.82776 99.739283) (xy 264.827762 99.739284) (xy 264.967634 99.812696) + (xy 265.121014 99.8505) (xy 265.121015 99.8505) (xy 265.278985 99.8505) (xy 265.432365 99.812696) + (xy 265.57224 99.739283) (xy 265.690483 99.63453) (xy 265.78022 99.504523) (xy 265.836237 99.356818) + (xy 265.855278 99.2) (xy 265.836237 99.043182) (xy 265.78022 98.895477) (xy 265.690483 98.76547) + (xy 265.57224 98.660717) (xy 265.572238 98.660716) (xy 265.572237 98.660715) (xy 265.432365 98.587303) + (xy 265.278986 98.5495) (xy 265.278985 98.5495) (xy 265.1319 98.5495) (xy 265.064861 98.529815) + (xy 265.044219 98.513181) (xy 264.671819 98.140781) (xy 264.638334 98.079458) (xy 264.6355 98.0531) + (xy 264.6355 97.90298) (xy 264.655185 97.835941) (xy 264.685867 97.80321) (xy 264.723998 97.775067) + (xy 264.78215 97.73215) (xy 264.862793 97.622882) (xy 264.893305 97.535684) (xy 264.907646 97.494701) + (xy 264.907646 97.494699) (xy 264.9105 97.464269) (xy 264.9105 96.80573) (xy 264.907646 96.7753) + (xy 264.907646 96.775298) (xy 264.862793 96.647119) (xy 264.862792 96.647117) (xy 264.862375 96.646552) + (xy 264.862109 96.645826) (xy 264.858449 96.638899) (xy 264.859396 96.638398) (xy 264.838404 96.580923) + (xy 264.853719 96.512752) (xy 264.90346 96.463684) (xy 264.971832 96.449297) (xy 265.000204 96.454904) + (xy 275.60082 99.874458) (xy 275.612949 99.879086) (xy 275.786536 99.955969) (xy 275.809042 99.96891) + (xy 275.957508 100.076418) (xy 275.976829 100.093765) (xy 276.099646 100.229828) (xy 276.114926 100.25081) + (xy 276.206721 100.409481) (xy 276.217297 100.43319) (xy 276.274034 100.607493) (xy 276.279441 100.63289) + (xy 276.299318 100.821682) (xy 276.3 100.834666) (xy 276.3 121.293907) (xy 276.299403 121.306061) + (xy 276.281982 121.482934) (xy 276.27724 121.506775) (xy 276.227424 121.670998) (xy 276.218121 121.693456) + (xy 276.137227 121.844798) (xy 276.123722 121.86501) (xy 276.014854 121.997666) (xy 275.997666 122.014854) + (xy 275.86501 122.123722) (xy 275.844798 122.137227) (xy 275.693456 122.218121) (xy 275.670998 122.227424) + (xy 275.506775 122.27724) (xy 275.482934 122.281982) (xy 275.306061 122.299403) (xy 275.293907 122.3) + (xy 272.233678 122.3) (xy 272.166639 122.280315) (xy 272.120884 122.227511) (xy 272.11094 122.158353) + (xy 272.130576 122.107109) (xy 272.16508 122.055469) (xy 272.16508 122.055468) (xy 272.165084 122.055463) + (xy 272.221658 121.918881) (xy 272.2505 121.773886) (xy 272.2505 121.626051) (xy 272.2505 121.626048) + (xy 272.221659 121.481061) (xy 272.221658 121.48106) (xy 272.221658 121.481056) (xy 272.214578 121.463963) + (xy 272.165085 121.344475) (xy 272.165083 121.344472) (xy 272.082952 121.221553) (xy 272.082946 121.221546) + (xy 271.978421 121.117021) (xy 271.978414 121.117015) (xy 271.855495 121.034884) (xy 271.855492 121.034882) + (xy 271.718916 120.978311) (xy 271.718906 120.978308) (xy 271.573919 120.949468) (xy 271.573917 120.949468) + (xy 271.426082 120.949468) (xy 271.420321 120.949468) (xy 271.41967 120.9495) (xy 267.869822 120.9495) + (xy 267.802783 120.929815) (xy 267.766013 120.893321) (xy 267.739185 120.852257) (xy 267.584791 120.684541) + (xy 267.584787 120.684538) (xy 267.404909 120.544533) (xy 267.4049 120.544527) (xy 267.204432 120.43604) + (xy 267.204429 120.436039) (xy 267.204426 120.436037) (xy 267.20442 120.436035) (xy 267.204418 120.436034) + (xy 266.988826 120.36202) (xy 266.820188 120.33388) (xy 266.763977 120.3245) (xy 266.536023 120.3245) + (xy 266.491053 120.332004) (xy 266.311173 120.36202) (xy 266.095581 120.436034) (xy 266.095567 120.43604) + (xy 265.895099 120.544527) (xy 265.89509 120.544533) (xy 265.715212 120.684538) (xy 265.715207 120.684543) + (xy 265.675779 120.727372) (xy 265.615892 120.763361) (xy 265.546053 120.76126) (xy 265.488438 120.721734) + (xy 265.461338 120.657334) (xy 265.464346 120.612946) (xy 265.511387 120.427188) (xy 265.511387 120.427187) + (xy 265.51139 120.427176) (xy 265.530214 120.2) (xy 265.530214 120.199993) (xy 265.511391 119.972831) + (xy 265.511389 119.97282) (xy 265.45543 119.751844) (xy 265.410444 119.649286) (xy 265.4 119.599476) + (xy 265.4 118.169072) (xy 265.400641 118.156484) (xy 265.419327 117.973367) (xy 265.424412 117.948709) + (xy 265.477798 117.779184) (xy 265.487759 117.756062) (xy 265.574289 117.60081) (xy 265.588706 117.58019) + (xy 265.61263 117.55246) (xy 265.671325 117.514563) (xy 265.741195 117.514414) (xy 265.741425 117.514481) + (xy 265.772055 117.52351) (xy 265.772059 117.523511) (xy 265.772066 117.523513) (xy 265.795732 117.529276) + (xy 265.795743 117.529278) (xy 265.795766 117.529284) (xy 265.795782 117.529287) (xy 265.818973 117.533774) + (xy 265.818988 117.533776) (xy 265.818995 117.533778) (xy 265.843148 117.537263) (xy 265.918979 117.544531) + (xy 265.966627 117.549098) (xy 265.966637 117.5491) (xy 266.015332 117.553767) (xy 266.01534 117.553767) + (xy 266.015355 117.553769) (xy 266.02752 117.554642) (xy 266.039349 117.555208) (xy 266.05156 117.5555) + (xy 266.05158 117.5555) (xy 267.193887 117.5555) (xy 267.193907 117.5555) (xy 267.206442 117.555192) + (xy 267.218596 117.554595) (xy 267.231105 117.553673) (xy 267.407978 117.536252) (xy 267.432777 117.532573) + (xy 267.456618 117.527831) (xy 267.480942 117.521738) (xy 267.645165 117.471922) (xy 267.668779 117.463473) + (xy 267.691237 117.45417) (xy 267.713898 117.443452) (xy 267.727771 117.436037) (xy 267.779058 117.408623) + (xy 267.86524 117.362558) (xy 267.886745 117.349669) (xy 267.906957 117.336164) (xy 267.927098 117.321226) + (xy 268.059754 117.212358) (xy 268.078332 117.19552) (xy 268.09552 117.178332) (xy 268.112358 117.159754) + (xy 268.221226 117.027098) (xy 268.236164 117.006957) (xy 268.249669 116.986745) (xy 268.262558 116.96524) + (xy 268.343452 116.813898) (xy 268.35417 116.791237) (xy 268.363473 116.768779) (xy 268.371922 116.745165) + (xy 268.421738 116.580942) (xy 268.427831 116.556618) (xy 268.432573 116.532777) (xy 268.436252 116.507978) + (xy 268.453673 116.331105) (xy 268.454595 116.318596) (xy 268.455192 116.306442) (xy 268.4555 116.293907) + (xy 268.4555 108.677517) (xy 268.455156 108.664269) (xy 268.454489 108.651423) (xy 268.453458 108.638202) + (xy 268.434 108.451386) (xy 268.429891 108.425202) (xy 268.424597 108.400064) (xy 268.424592 108.400045) + (xy 268.424588 108.400027) (xy 268.417804 108.374469) (xy 268.400968 108.322149) (xy 271.1995 108.322149) + (xy 271.1995 108.57785) (xy 271.225457 108.775007) (xy 271.232874 108.83134) (xy 271.29905 109.078312) + (xy 271.299053 109.078322) (xy 271.396894 109.314531) (xy 271.396899 109.314542) (xy 271.524734 109.535957) + (xy 271.524745 109.535973) (xy 271.680388 109.738811) (xy 271.680394 109.738818) (xy 271.861181 109.919605) + (xy 271.861187 109.91961) (xy 272.064035 110.075261) (xy 272.064042 110.075265) (xy 272.285457 110.2031) + (xy 272.285462 110.203102) (xy 272.285465 110.203104) (xy 272.521687 110.30095) (xy 272.76866 110.367126) + (xy 273.022157 110.4005) (xy 273.022164 110.4005) (xy 273.277836 110.4005) (xy 273.277843 110.4005) + (xy 273.53134 110.367126) (xy 273.778313 110.30095) (xy 274.014535 110.203104) (xy 274.235965 110.075261) + (xy 274.438813 109.91961) (xy 274.61961 109.738813) (xy 274.775261 109.535965) (xy 274.903104 109.314535) + (xy 275.00095 109.078313) (xy 275.067126 108.83134) (xy 275.1005 108.577843) (xy 275.1005 108.322157) + (xy 275.067126 108.06866) (xy 275.00095 107.821687) (xy 274.903104 107.585465) (xy 274.903102 107.585462) + (xy 274.9031 107.585457) (xy 274.775265 107.364042) (xy 274.775261 107.364035) (xy 274.61961 107.161187) + (xy 274.619605 107.161181) (xy 274.438818 106.980394) (xy 274.438811 106.980388) (xy 274.235973 106.824745) + (xy 274.235971 106.824743) (xy 274.235965 106.824739) (xy 274.23596 106.824736) (xy 274.235957 106.824734) + (xy 274.014542 106.696899) (xy 274.014531 106.696894) (xy 273.778322 106.599053) (xy 273.778315 106.599051) + (xy 273.778313 106.59905) (xy 273.53134 106.532874) (xy 273.475007 106.525457) (xy 273.27785 106.4995) + (xy 273.277843 106.4995) (xy 273.022157 106.4995) (xy 273.022149 106.4995) (xy 272.796826 106.529165) + (xy 272.76866 106.532874) (xy 272.521687 106.59905) (xy 272.521677 106.599053) (xy 272.285468 106.696894) + (xy 272.285457 106.696899) (xy 272.064042 106.824734) (xy 272.064026 106.824745) (xy 271.861188 106.980388) + (xy 271.861181 106.980394) (xy 271.680394 107.161181) (xy 271.680388 107.161188) (xy 271.524745 107.364026) + (xy 271.524734 107.364042) (xy 271.396899 107.585457) (xy 271.396894 107.585468) (xy 271.299053 107.821677) + (xy 271.29905 107.821687) (xy 271.270237 107.929221) (xy 271.232874 108.068661) (xy 271.1995 108.322149) + (xy 268.400968 108.322149) (xy 268.362244 108.201808) (xy 268.362243 108.201806) (xy 268.352836 108.177057) + (xy 268.352833 108.177048) (xy 268.342473 108.15354) (xy 268.33054 108.129873) (xy 268.240607 107.972392) + (xy 268.226288 107.95009) (xy 268.211307 107.929223) (xy 268.211306 107.929221) (xy 268.194762 107.908534) + (xy 268.194753 107.908523) (xy 268.074294 107.77295) (xy 268.055685 107.754075) (xy 268.055684 107.754074) + (xy 268.036716 107.736734) (xy 268.016268 107.719905) (xy 268.016267 107.719903) (xy 267.865242 107.608207) + (xy 267.854389 107.600607) (xy 267.850862 107.598271) (xy 267.843662 107.593504) (xy 267.842175 107.592573) + (xy 267.832416 107.586469) (xy 266.068801 106.545937) (xy 266.058774 106.539348) (xy 253.715705 97.54299) + (xy 253.706613 97.535684) (xy 253.57897 97.422842) (xy 253.563039 97.405836) (xy 253.462347 97.275739) + (xy 253.44988 97.256054) (xy 253.375306 97.109421) (xy 253.366743 97.087756) (xy 253.320914 96.929747) + (xy 253.316556 96.906858) (xy 253.300549 96.737244) (xy 253.3 96.725594) (xy 253.3 91.406092) (xy 253.300597 91.393938) + (xy 253.318018 91.217056) (xy 253.322757 91.193232) (xy 253.372577 91.028994) (xy 253.381875 91.006549) + (xy 253.462775 90.855195) (xy 253.476272 90.834995) (xy 253.585149 90.702328) (xy 253.602328 90.685149) + (xy 253.734995 90.576272) (xy 253.755195 90.562775) (xy 253.906549 90.481875) (xy 253.928994 90.472577) + (xy 254.093232 90.422757) (xy 254.117056 90.418018) (xy 254.293939 90.400597) (xy 254.306093 90.4) + (xy 255.067601 90.4) (xy 255.13464 90.419685) (xy 255.155282 90.436319) (xy 256.02818 91.309217) + (xy 256.061665 91.37054) (xy 256.064499 91.396897) (xy 256.064499 91.489726) (xy 256.0645 91.489733) + (xy 256.070907 91.54934) (xy 256.121201 91.684185) (xy 256.121205 91.684192) (xy 256.207451 91.799401) + (xy 256.207454 91.799404) (xy 256.322663 91.88565) (xy 256.32267 91.885654) (xy 256.457516 91.935948) + (xy 256.457515 91.935948) (xy 256.464443 91.936692) (xy 256.517126 91.942357) (xy 257.512871 91.942356) + (xy 257.572482 91.935948) (xy 257.70733 91.885653) (xy 257.822545 91.799403) (xy 257.890694 91.708367) + (xy 257.946625 91.666499) (xy 258.016316 91.661515) (xy 258.077639 91.695) (xy 258.089224 91.708369) + (xy 258.112456 91.739402) (xy 258.227665 91.825648) (xy 258.227672 91.825652) (xy 258.362518 91.875946) + (xy 258.362517 91.875946) (xy 258.369445 91.87669) (xy 258.422128 91.882355) (xy 259.467873 91.882354) + (xy 259.527484 91.875946) (xy 259.662332 91.825651) (xy 259.777547 91.739401) (xy 259.863797 91.624186) + (xy 259.914092 91.489338) (xy 259.920501 91.429728) (xy 259.9205 90.833983) (xy 259.914092 90.774372) + (xy 259.914092 90.774371) (xy 259.883369 90.691998) (xy 259.878385 90.622306) (xy 259.91187 90.560983) + (xy 259.96746 90.52889) (xy 260.002278 90.519561) (xy 260.002282 90.519558) (xy 260.002286 90.519558) + (xy 260.050038 90.506763) (xy 260.135662 90.457328) (xy 260.205575 90.387415) (xy 260.544317 90.048673) + (xy 260.60564 90.015188) (xy 260.631998 90.012354) (xy 263.319412 90.012354) ) ) ) @@ -162109,40 +166431,44 @@ (xy 127.927424 64.170998) (xy 127.918121 64.193456) (xy 127.837227 64.344798) (xy 127.823722 64.36501) (xy 127.714854 64.497666) (xy 127.697666 64.514854) (xy 127.56501 64.623722) (xy 127.544798 64.637227) (xy 127.393456 64.718121) (xy 127.370998 64.727424) (xy 127.206775 64.77724) (xy 127.182934 64.781982) - (xy 127.006061 64.799403) (xy 126.993907 64.8) (xy 122.7 64.8) (xy 122.7 65.8) (xy 122.7 65.800003) - (xy 122.7 66.893907) (xy 122.699403 66.906061) (xy 122.681982 67.082934) (xy 122.67724 67.106775) - (xy 122.627424 67.270998) (xy 122.618121 67.293456) (xy 122.537227 67.444798) (xy 122.523722 67.46501) - (xy 122.414854 67.597666) (xy 122.397666 67.614854) (xy 122.26501 67.723722) (xy 122.244798 67.737227) - (xy 122.093456 67.818121) (xy 122.070998 67.827424) (xy 121.906775 67.87724) (xy 121.882934 67.881982) - (xy 121.706061 67.899403) (xy 121.693907 67.9) (xy 113.606093 67.9) (xy 113.593939 67.899403) (xy 113.417065 67.881982) - (xy 113.393224 67.87724) (xy 113.229001 67.827424) (xy 113.206543 67.818121) (xy 113.055201 67.737227) - (xy 113.034989 67.723722) (xy 112.902333 67.614854) (xy 112.885145 67.597666) (xy 112.776277 67.46501) - (xy 112.762772 67.444798) (xy 112.681878 67.293456) (xy 112.672575 67.270998) (xy 112.622757 67.106769) - (xy 112.618018 67.082941) (xy 112.600597 66.906061) (xy 112.6 66.893907) (xy 112.6 61.260186) (xy 117.1745 61.260186) - (xy 117.1745 61.529813) (xy 117.204686 61.797719) (xy 117.204688 61.797731) (xy 117.264684 62.060594) - (xy 117.264687 62.060602) (xy 117.353734 62.315082) (xy 117.470714 62.557994) (xy 117.470716 62.557997) - (xy 117.614162 62.786289) (xy 117.782266 62.997085) (xy 117.972915 63.187734) (xy 118.183711 63.355838) - (xy 118.412003 63.499284) (xy 118.654921 63.616267) (xy 118.846049 63.683145) (xy 118.909397 63.705312) - (xy 118.909405 63.705315) (xy 118.909408 63.705315) (xy 118.909409 63.705316) (xy 119.172268 63.765312) - (xy 119.440187 63.795499) (xy 119.440188 63.7955) (xy 119.440191 63.7955) (xy 119.709812 63.7955) - (xy 119.709812 63.795499) (xy 119.977732 63.765312) (xy 120.240591 63.705316) (xy 120.495079 63.616267) - (xy 120.737997 63.499284) (xy 120.966289 63.355838) (xy 121.177085 63.187734) (xy 121.367734 62.997085) - (xy 121.535838 62.786289) (xy 121.679284 62.557997) (xy 121.796267 62.315079) (xy 121.885316 62.060591) - (xy 121.945312 61.797732) (xy 121.9755 61.529809) (xy 121.9755 61.260191) (xy 121.945312 60.992268) - (xy 121.885316 60.729409) (xy 121.796267 60.474921) (xy 121.679284 60.232003) (xy 121.535838 60.003711) - (xy 121.367734 59.792915) (xy 121.177085 59.602266) (xy 120.966289 59.434162) (xy 120.737997 59.290716) - (xy 120.737994 59.290714) (xy 120.495082 59.173734) (xy 120.240602 59.084687) (xy 120.240594 59.084684) - (xy 120.043446 59.039687) (xy 119.977732 59.024688) (xy 119.977728 59.024687) (xy 119.977719 59.024686) - (xy 119.709813 58.9945) (xy 119.709809 58.9945) (xy 119.440191 58.9945) (xy 119.440186 58.9945) - (xy 119.17228 59.024686) (xy 119.172268 59.024688) (xy 118.909405 59.084684) (xy 118.909397 59.084687) - (xy 118.654917 59.173734) (xy 118.412005 59.290714) (xy 118.183712 59.434161) (xy 117.972915 59.602265) - (xy 117.782265 59.792915) (xy 117.614161 60.003712) (xy 117.470714 60.232005) (xy 117.353734 60.474917) - (xy 117.264687 60.729397) (xy 117.264684 60.729405) (xy 117.204688 60.992268) (xy 117.204686 60.99228) - (xy 117.1745 61.260186) (xy 112.6 61.260186) (xy 112.6 57.106092) (xy 112.600597 57.093938) (xy 112.618018 56.917056) - (xy 112.622757 56.893232) (xy 112.672577 56.728994) (xy 112.681875 56.706549) (xy 112.762775 56.555195) - (xy 112.776272 56.534995) (xy 112.885149 56.402328) (xy 112.902328 56.385149) (xy 113.034995 56.276272) - (xy 113.055195 56.262775) (xy 113.206549 56.181875) (xy 113.228994 56.172577) (xy 113.393232 56.122757) - (xy 113.417056 56.118018) (xy 113.593939 56.100597) (xy 113.606093 56.1) (xy 126.993907 56.1) + (xy 127.006061 64.799403) (xy 126.993907 64.8) (xy 123.7 64.8) (xy 123.651844 64.804743) (xy 123.504911 64.819214) + (xy 123.394149 64.852813) (xy 123.317317 64.87612) (xy 123.317314 64.876121) (xy 123.317312 64.876122) + (xy 123.317309 64.876123) (xy 123.144435 64.968526) (xy 123.144428 64.968531) (xy 122.992892 65.092892) + (xy 122.868531 65.244428) (xy 122.868526 65.244435) (xy 122.776123 65.417309) (xy 122.776122 65.417312) + (xy 122.719214 65.604911) (xy 122.7 65.800003) (xy 122.7 66.893907) (xy 122.699403 66.906061) (xy 122.681982 67.082934) + (xy 122.67724 67.106775) (xy 122.627424 67.270998) (xy 122.618121 67.293456) (xy 122.537227 67.444798) + (xy 122.523722 67.46501) (xy 122.414854 67.597666) (xy 122.397666 67.614854) (xy 122.26501 67.723722) + (xy 122.244798 67.737227) (xy 122.093456 67.818121) (xy 122.070998 67.827424) (xy 121.906775 67.87724) + (xy 121.882934 67.881982) (xy 121.706061 67.899403) (xy 121.693907 67.9) (xy 113.606093 67.9) (xy 113.593939 67.899403) + (xy 113.417065 67.881982) (xy 113.393224 67.87724) (xy 113.229001 67.827424) (xy 113.206543 67.818121) + (xy 113.055201 67.737227) (xy 113.034989 67.723722) (xy 112.902333 67.614854) (xy 112.885145 67.597666) + (xy 112.776277 67.46501) (xy 112.762772 67.444798) (xy 112.681878 67.293456) (xy 112.672575 67.270998) + (xy 112.622757 67.106769) (xy 112.618018 67.082941) (xy 112.600597 66.906061) (xy 112.6 66.893907) + (xy 112.6 61.260186) (xy 117.1745 61.260186) (xy 117.1745 61.529813) (xy 117.204686 61.797719) (xy 117.204688 61.797731) + (xy 117.264684 62.060594) (xy 117.264687 62.060602) (xy 117.353734 62.315082) (xy 117.470714 62.557994) + (xy 117.470716 62.557997) (xy 117.614162 62.786289) (xy 117.782266 62.997085) (xy 117.972915 63.187734) + (xy 118.183711 63.355838) (xy 118.412003 63.499284) (xy 118.654921 63.616267) (xy 118.846049 63.683145) + (xy 118.909397 63.705312) (xy 118.909405 63.705315) (xy 118.909408 63.705315) (xy 118.909409 63.705316) + (xy 119.172268 63.765312) (xy 119.440187 63.795499) (xy 119.440188 63.7955) (xy 119.440191 63.7955) + (xy 119.709812 63.7955) (xy 119.709812 63.795499) (xy 119.977732 63.765312) (xy 120.240591 63.705316) + (xy 120.495079 63.616267) (xy 120.737997 63.499284) (xy 120.966289 63.355838) (xy 121.177085 63.187734) + (xy 121.367734 62.997085) (xy 121.535838 62.786289) (xy 121.679284 62.557997) (xy 121.796267 62.315079) + (xy 121.885316 62.060591) (xy 121.945312 61.797732) (xy 121.9755 61.529809) (xy 121.9755 61.260191) + (xy 121.945312 60.992268) (xy 121.885316 60.729409) (xy 121.796267 60.474921) (xy 121.679284 60.232003) + (xy 121.535838 60.003711) (xy 121.367734 59.792915) (xy 121.177085 59.602266) (xy 120.966289 59.434162) + (xy 120.737997 59.290716) (xy 120.737994 59.290714) (xy 120.495082 59.173734) (xy 120.240602 59.084687) + (xy 120.240594 59.084684) (xy 120.043446 59.039687) (xy 119.977732 59.024688) (xy 119.977728 59.024687) + (xy 119.977719 59.024686) (xy 119.709813 58.9945) (xy 119.709809 58.9945) (xy 119.440191 58.9945) + (xy 119.440186 58.9945) (xy 119.17228 59.024686) (xy 119.172268 59.024688) (xy 118.909405 59.084684) + (xy 118.909397 59.084687) (xy 118.654917 59.173734) (xy 118.412005 59.290714) (xy 118.183712 59.434161) + (xy 117.972915 59.602265) (xy 117.782265 59.792915) (xy 117.614161 60.003712) (xy 117.470714 60.232005) + (xy 117.353734 60.474917) (xy 117.264687 60.729397) (xy 117.264684 60.729405) (xy 117.204688 60.992268) + (xy 117.204686 60.99228) (xy 117.1745 61.260186) (xy 112.6 61.260186) (xy 112.6 57.106092) (xy 112.600597 57.093938) + (xy 112.618018 56.917056) (xy 112.622757 56.893232) (xy 112.672577 56.728994) (xy 112.681875 56.706549) + (xy 112.762775 56.555195) (xy 112.776272 56.534995) (xy 112.885149 56.402328) (xy 112.902328 56.385149) + (xy 113.034995 56.276272) (xy 113.055195 56.262775) (xy 113.206549 56.181875) (xy 113.228994 56.172577) + (xy 113.393232 56.122757) (xy 113.417056 56.118018) (xy 113.593939 56.100597) (xy 113.606093 56.1) + (xy 126.993907 56.1) ) ) ) @@ -162176,22 +166502,45 @@ (xy 257.928533 220.300627) (xy 258.011212 220.34482) (xy 258.044798 220.362772) (xy 258.065008 220.376276) (xy 258.174096 220.465802) (xy 258.197666 220.485145) (xy 258.214854 220.502333) (xy 258.323722 220.634989) (xy 258.337227 220.655201) (xy 258.418121 220.806543) (xy 258.427424 220.829001) (xy 258.47724 220.993224) - (xy 258.481982 221.017065) (xy 258.499403 221.193938) (xy 258.5 221.206092) (xy 258.5 222.6) (xy 259.53224 222.566701) - (xy 259.532241 222.566702) (xy 260.17152 222.54608) (xy 261.6 222.5) (xy 261.6 222.35) (xy 261.611497 222.307088) - (xy 261.643588 222.251507) (xy 261.651507 222.243588) (xy 261.707092 222.211496) (xy 261.734236 222.204223) - (xy 261.766325 222.2) (xy 274.693907 222.2) (xy 274.706061 222.200597) (xy 274.882941 222.218018) - (xy 274.906769 222.222757) (xy 275.071001 222.272576) (xy 275.093453 222.281877) (xy 275.220903 222.35) - (xy 275.244798 222.362772) (xy 275.265008 222.376276) (xy 275.276246 222.385498) (xy 275.397666 222.485145) - (xy 275.414854 222.502333) (xy 275.523722 222.634989) (xy 275.537227 222.655201) (xy 275.618121 222.806543) - (xy 275.627424 222.829001) (xy 275.67724 222.993224) (xy 275.681982 223.017065) (xy 275.699403 223.193938) - (xy 275.7 223.206092) (xy 275.7 229.593907) (xy 275.699403 229.606061) (xy 275.681982 229.782934) - (xy 275.67724 229.806775) (xy 275.627424 229.970998) (xy 275.618121 229.993456) (xy 275.537227 230.144798) - (xy 275.523722 230.16501) (xy 275.414854 230.297666) (xy 275.397666 230.314854) (xy 275.26501 230.423722) - (xy 275.244798 230.437227) (xy 275.093456 230.518121) (xy 275.070998 230.527424) (xy 274.906775 230.57724) - (xy 274.882934 230.581982) (xy 274.706061 230.599403) (xy 274.693907 230.6) (xy 259.108558 230.6) - (xy 259.065225 230.592182) (xy 258.967114 230.555588) (xy 258.967112 230.555587) (xy 258.96711 230.555587) - (xy 258.910493 230.5495) (xy 258.319518 230.5495) (xy 258.319509 230.549501) (xy 258.262886 230.555587) - (xy 258.164775 230.592182) (xy 258.121441 230.6) (xy 256.806093 230.6) (xy 256.793939 230.599403) + (xy 258.481982 221.017065) (xy 258.499403 221.193938) (xy 258.5 221.206092) (xy 258.5 221.567222) + (xy 258.520009 221.766264) (xy 258.579236 221.957341) (xy 258.654264 222.09437) (xy 258.6695 222.153921) + (xy 258.6695 222.159678) (xy 258.684032 222.232735) (xy 258.684033 222.232739) (xy 258.684034 222.23274) + (xy 258.739399 222.315601) (xy 258.790882 222.35) (xy 258.82226 222.370966) (xy 258.822264 222.370967) + (xy 258.895314 222.385498) (xy 258.895317 222.385498) (xy 258.895326 222.3855) (xy 258.895334 222.3855) + (xy 258.899476 222.385908) (xy 258.954857 222.408259) (xy 258.956065 222.406372) (xy 258.961304 222.409722) + (xy 259.139767 222.500084) (xy 259.139769 222.500084) (xy 259.13977 222.500085) (xy 259.332658 222.553121) + (xy 259.532241 222.566702) (xy 261.450078 222.504836) (xy 261.525408 222.482466) (xy 261.58007 222.426012) + (xy 261.6 222.35) (xy 261.611497 222.307088) (xy 261.643588 222.251507) (xy 261.651507 222.243588) + (xy 261.707092 222.211496) (xy 261.734236 222.204223) (xy 261.766325 222.2) (xy 274.693907 222.2) + (xy 274.706061 222.200597) (xy 274.882941 222.218018) (xy 274.906769 222.222757) (xy 275.071001 222.272576) + (xy 275.093453 222.281877) (xy 275.220903 222.35) (xy 275.244798 222.362772) (xy 275.265008 222.376276) + (xy 275.276246 222.385498) (xy 275.397666 222.485145) (xy 275.414854 222.502333) (xy 275.523722 222.634989) + (xy 275.537227 222.655201) (xy 275.618121 222.806543) (xy 275.627424 222.829001) (xy 275.67724 222.993224) + (xy 275.681982 223.017065) (xy 275.699403 223.193938) (xy 275.7 223.206092) (xy 275.7 229.593907) + (xy 275.699403 229.606061) (xy 275.681982 229.782934) (xy 275.67724 229.806775) (xy 275.627424 229.970998) + (xy 275.618121 229.993456) (xy 275.537227 230.144798) (xy 275.523722 230.16501) (xy 275.414854 230.297666) + (xy 275.397666 230.314854) (xy 275.26501 230.423722) (xy 275.244798 230.437227) (xy 275.093456 230.518121) + (xy 275.070998 230.527424) (xy 274.906775 230.57724) (xy 274.882934 230.581982) (xy 274.706061 230.599403) + (xy 274.693907 230.6) (xy 265.287118 230.6) (xy 265.239975 230.588381) (xy 265.239376 230.589963) + (xy 265.232366 230.587304) (xy 265.078985 230.5495) (xy 264.921015 230.5495) (xy 264.921013 230.5495) + (xy 264.911197 230.551919) (xy 264.849437 230.551295) (xy 264.797187 230.537295) (xy 264.797186 230.537294) + (xy 264.749436 230.5245) (xy 264.749435 230.5245) (xy 264.63298 230.5245) (xy 264.565941 230.504815) + (xy 264.53321 230.474133) (xy 264.462151 230.377851) (xy 264.352882 230.297207) (xy 264.35288 230.297206) + (xy 264.2247 230.252353) (xy 264.19427 230.2495) (xy 264.194266 230.2495) (xy 263.535734 230.2495) + (xy 263.53573 230.2495) (xy 263.5053 230.252353) (xy 263.505298 230.252353) (xy 263.377119 230.297206) + (xy 263.377117 230.297207) (xy 263.26785 230.37785) (xy 263.23477 230.422672) (xy 263.179122 230.464923) + (xy 263.109466 230.470381) (xy 263.047917 230.437313) (xy 263.03523 230.422672) (xy 263.033811 230.42075) + (xy 263.00215 230.37785) (xy 262.892882 230.297207) (xy 262.89288 230.297206) (xy 262.7647 230.252353) + (xy 262.73427 230.2495) (xy 262.734266 230.2495) (xy 262.075734 230.2495) (xy 262.07573 230.2495) + (xy 262.0453 230.252353) (xy 262.045298 230.252353) (xy 261.917119 230.297206) (xy 261.917117 230.297207) + (xy 261.80785 230.37785) (xy 261.807848 230.377851) (xy 261.773692 230.424133) (xy 261.718044 230.466384) + (xy 261.673921 230.4745) (xy 259.402459 230.4745) (xy 259.33542 230.454815) (xy 259.289665 230.402011) + (xy 259.28679 230.395071) (xy 259.286627 230.394773) (xy 259.286626 230.394771) (xy 259.204687 230.285313) + (xy 259.138911 230.236074) (xy 259.095228 230.203373) (xy 259.095226 230.203372) (xy 258.967114 230.155588) + (xy 258.967112 230.155587) (xy 258.96711 230.155587) (xy 258.910493 230.1495) (xy 258.319518 230.1495) + (xy 258.319509 230.149501) (xy 258.262885 230.155587) (xy 258.134773 230.203372) (xy 258.025313 230.285313) + (xy 257.943373 230.394771) (xy 257.943372 230.394774) (xy 257.896911 230.519337) (xy 257.855042 230.575267) + (xy 257.789578 230.599684) (xy 257.780732 230.6) (xy 256.806093 230.6) (xy 256.793939 230.599403) (xy 256.617065 230.581982) (xy 256.593224 230.57724) (xy 256.429001 230.527424) (xy 256.406543 230.518121) (xy 256.255201 230.437227) (xy 256.234989 230.423722) (xy 256.102333 230.314854) (xy 256.085145 230.297666) (xy 255.976277 230.16501) (xy 255.962772 230.144798) (xy 255.881878 229.993456) (xy 255.872575 229.970998) @@ -162288,78 +166637,83 @@ (xy 137.537227 68.455201) (xy 137.618121 68.606543) (xy 137.627424 68.629001) (xy 137.67724 68.793224) (xy 137.681982 68.817065) (xy 137.699403 68.993938) (xy 137.7 69.006092) (xy 137.7 84.533675) (xy 137.695774 84.56577) (xy 137.688502 84.592908) (xy 137.656409 84.648494) (xy 137.648494 84.656409) (xy 137.592908 84.688502) - (xy 137.55 84.7) (xy 137.4 84.7) (xy 137.4 84.85) (xy 137.4 89.375105) (xy 137.380315 89.442144) - (xy 137.37805 89.445545) (xy 137.329781 89.515475) (xy 137.32978 89.515476) (xy 137.273762 89.663181) - (xy 137.254722 89.819999) (xy 137.254722 89.82) (xy 137.273762 89.976818) (xy 137.32978 90.124523) - (xy 137.329781 90.124524) (xy 137.37805 90.194454) (xy 137.399933 90.260808) (xy 137.4 90.264894) - (xy 137.4 92.993907) (xy 137.399403 93.006061) (xy 137.381982 93.182934) (xy 137.37724 93.206775) - (xy 137.327424 93.370998) (xy 137.318121 93.393456) (xy 137.237227 93.544798) (xy 137.223722 93.56501) - (xy 137.114855 93.697665) (xy 137.097686 93.714837) (xy 137.095859 93.716337) (xy 137.031555 93.743663) - (xy 137.017175 93.7445) (xy 132.506093 93.7445) (xy 132.497448 93.744712) (xy 132.493549 93.744808) - (xy 132.481381 93.745406) (xy 132.468909 93.746326) (xy 132.468907 93.746326) (xy 132.468896 93.746327) - (xy 132.413901 93.751743) (xy 132.292027 93.763746) (xy 132.292 93.763749) (xy 132.267214 93.767427) - (xy 132.267212 93.767427) (xy 132.243392 93.772165) (xy 132.243382 93.772167) (xy 132.219079 93.778254) - (xy 132.219057 93.77826) (xy 132.054824 93.828079) (xy 132.031222 93.836524) (xy 132.031204 93.836531) - (xy 132.008781 93.84582) (xy 132.008773 93.845823) (xy 131.986107 93.856543) (xy 131.834765 93.937437) - (xy 131.813236 93.950341) (xy 131.79306 93.963822) (xy 131.793034 93.96384) (xy 131.772891 93.97878) - (xy 131.747035 94) (xy 131.5 94) (xy 131.5 94.224927) (xy 131.483399 94.236235) (xy 131.413555 94.238104) - (xy 131.376403 94.221338) (xy 131.373201 94.219198) (xy 131.323525 94.186006) (xy 131.290339 94.163832) - (xy 131.290335 94.163831) (xy 131.217277 94.149299) (xy 131.217274 94.149299) (xy 130.660726 94.149299) - (xy 130.660723 94.149299) (xy 130.587664 94.163831) (xy 130.58766 94.163832) (xy 130.504799 94.219198) - (xy 130.449433 94.302059) (xy 130.449432 94.302063) (xy 130.4349 94.37512) (xy 130.4349 95.7205) - (xy 130.415215 95.787539) (xy 130.362411 95.833294) (xy 130.3109 95.8445) (xy 130.2971 95.8445) - (xy 130.230061 95.824815) (xy 130.184306 95.772011) (xy 130.1731 95.7205) (xy 130.1731 94.375122) - (xy 130.173099 94.37512) (xy 130.158567 94.302063) (xy 130.158566 94.302059) (xy 130.139088 94.272908) - (xy 130.103201 94.219198) (xy 130.047835 94.182204) (xy 130.020339 94.163832) (xy 130.020335 94.163831) - (xy 129.947277 94.149299) (xy 129.947274 94.149299) (xy 129.390726 94.149299) (xy 129.390723 94.149299) - (xy 129.317664 94.163831) (xy 129.31766 94.163832) (xy 129.234799 94.219198) (xy 129.179433 94.302059) - (xy 129.179432 94.302063) (xy 129.1649 94.37512) (xy 129.1649 95.7205) (xy 129.145215 95.787539) - (xy 129.092411 95.833294) (xy 129.0409 95.8445) (xy 128.721656 95.8445) (xy 128.704519 95.845342) - (xy 128.696605 95.845731) (xy 128.672423 95.848113) (xy 128.662689 95.849557) (xy 128.644497 95.850899) - (xy 128.153503 95.850899) (xy 128.135311 95.849557) (xy 128.125576 95.848113) (xy 128.101394 95.845731) - (xy 128.094432 95.845389) (xy 128.076344 95.8445) (xy 127.451656 95.8445) (xy 127.434519 95.845342) - (xy 127.426605 95.845731) (xy 127.402423 95.848113) (xy 127.392689 95.849557) (xy 127.374497 95.850899) - (xy 126.883503 95.850899) (xy 126.865311 95.849557) (xy 126.855576 95.848113) (xy 126.831394 95.845731) - (xy 126.824432 95.845389) (xy 126.806344 95.8445) (xy 126.181656 95.8445) (xy 126.164519 95.845342) - (xy 126.156605 95.845731) (xy 126.132423 95.848113) (xy 126.122689 95.849557) (xy 126.104497 95.850899) - (xy 125.613503 95.850899) (xy 125.595311 95.849557) (xy 125.585576 95.848113) (xy 125.561394 95.845731) - (xy 125.554432 95.845389) (xy 125.536344 95.8445) (xy 125.536331 95.8445) (xy 125.379875 95.8445) - (xy 125.312836 95.824815) (xy 125.301327 95.816449) (xy 125.300544 95.815808) (xy 125.283361 95.798673) - (xy 125.174478 95.666418) (xy 125.160962 95.646265) (xy 125.107853 95.547357) (xy 125.0931 95.488696) - (xy 125.0931 94.375122) (xy 125.093099 94.37512) (xy 125.078567 94.302063) (xy 125.078566 94.302059) - (xy 125.059088 94.272908) (xy 125.023201 94.219198) (xy 125.023199 94.219197) (xy 125.016415 94.209043) - (xy 125.019883 94.206725) (xy 124.99741 94.165569) (xy 124.994576 94.139554) (xy 124.986542 91.235097) - (xy 125.006041 91.168007) (xy 125.022855 91.147082) (xy 125.029703 91.140234) (xy 125.049547 91.124118) - (xy 125.084426 91.101329) (xy 125.125372 91.067787) (xy 125.145732 91.049184) (xy 125.200376 90.965803) - (xy 125.226537 90.901016) (xy 125.243893 90.830395) (xy 125.253673 90.731105) (xy 125.254595 90.718594) - (xy 125.255192 90.706439) (xy 125.2555 90.693905) (xy 125.2555 90.174499) (xy 125.275185 90.10746) - (xy 125.327989 90.061705) (xy 125.3795 90.050499) (xy 126.331518 90.050499) (xy 126.331519 90.050499) - (xy 126.425305 90.035646) (xy 126.538343 89.97805) (xy 126.628051 89.888342) (xy 126.685647 89.775304) - (xy 126.685647 89.775302) (xy 126.685648 89.775301) (xy 126.7005 89.681524) (xy 126.700501 89.681519) - (xy 126.7005 89.318482) (xy 126.685647 89.224696) (xy 126.670243 89.194464) (xy 126.657347 89.125795) - (xy 126.683624 89.061055) (xy 126.693037 89.050499) (xy 126.84184 88.901697) (xy 126.90316 88.868214) - (xy 126.929217 88.86538) (xy 129.2 88.86) (xy 129.2 81.6995) (xy 129.219685 81.632461) (xy 129.272489 81.586706) - (xy 129.324 81.5755) (xy 129.803692 81.5755) (xy 129.870731 81.595185) (xy 129.905742 81.629061) - (xy 129.908089 81.632461) (xy 129.909515 81.634528) (xy 129.909517 81.63453) (xy 130.02776 81.739283) - (xy 130.027762 81.739284) (xy 130.167634 81.812696) (xy 130.321014 81.8505) (xy 130.321015 81.8505) - (xy 130.478985 81.8505) (xy 130.632365 81.812696) (xy 130.705586 81.774266) (xy 130.77224 81.739283) - (xy 130.890483 81.63453) (xy 130.98022 81.504523) (xy 131.036237 81.356818) (xy 131.055278 81.2) - (xy 131.043031 81.099131) (xy 131.036237 81.043181) (xy 130.997295 80.9405) (xy 130.98022 80.895477) - (xy 130.890483 80.76547) (xy 130.77224 80.660717) (xy 130.772238 80.660716) (xy 130.772237 80.660715) - (xy 130.632365 80.587303) (xy 130.478986 80.5495) (xy 130.478985 80.5495) (xy 130.321015 80.5495) - (xy 130.321014 80.5495) (xy 130.167634 80.587303) (xy 130.027762 80.660715) (xy 129.909516 80.76547) - (xy 129.907089 80.768987) (xy 129.905742 80.770938) (xy 129.851463 80.814929) (xy 129.803692 80.8245) - (xy 129.324 80.8245) (xy 129.256961 80.804815) (xy 129.211206 80.752011) (xy 129.2 80.7005) (xy 129.2 73.006092) - (xy 129.200597 72.993938) (xy 129.218018 72.817056) (xy 129.222757 72.793232) (xy 129.272577 72.628994) - (xy 129.281875 72.606549) (xy 129.362775 72.455195) (xy 129.376272 72.434995) (xy 129.485149 72.302328) - (xy 129.502367 72.285117) (xy 129.50304 72.284564) (xy 129.504198 72.283616) (xy 129.568519 72.256328) - (xy 129.582825 72.2555) (xy 129.744447 72.2555) (xy 129.744455 72.2555) (xy 129.810948 72.246696) - (xy 129.84491 72.237542) (xy 129.914759 72.2391) (xy 129.97268 72.278176) (xy 129.986538 72.298816) - (xy 130.035231 72.389914) (xy 130.035235 72.389921) (xy 130.161511 72.543788) (xy 130.315378 72.670064) - (xy 130.315385 72.670068) (xy 130.490925 72.763896) (xy 130.490927 72.763897) (xy 130.681407 72.821679) - (xy 130.8795 72.841189) (xy 131.077593 72.821679) (xy 131.268073 72.763897) (xy 131.44362 72.670065) - (xy 131.597488 72.543788) (xy 131.723765 72.38992) (xy 131.817597 72.214373) (xy 131.875379 72.023893) - (xy 131.877732 72) (xy 132 72) (xy 132 71.56191) (xy 132.027505 71.549645) (xy 132.067288 71.527459) + (xy 137.55 84.7) (xy 137.474999 84.720096) (xy 137.474998 84.720096) (xy 137.420096 84.774998) (xy 137.4 84.85) + (xy 137.4 89.375105) (xy 137.380315 89.442144) (xy 137.37805 89.445545) (xy 137.329781 89.515475) + (xy 137.32978 89.515476) (xy 137.273762 89.663181) (xy 137.254722 89.819999) (xy 137.254722 89.82) + (xy 137.273762 89.976818) (xy 137.32978 90.124523) (xy 137.329781 90.124524) (xy 137.37805 90.194454) + (xy 137.399933 90.260808) (xy 137.4 90.264894) (xy 137.4 92.993907) (xy 137.399403 93.006061) (xy 137.381982 93.182934) + (xy 137.37724 93.206775) (xy 137.327424 93.370998) (xy 137.318121 93.393456) (xy 137.237227 93.544798) + (xy 137.223722 93.56501) (xy 137.114855 93.697665) (xy 137.097686 93.714837) (xy 137.095859 93.716337) + (xy 137.031555 93.743663) (xy 137.017175 93.7445) (xy 132.506093 93.7445) (xy 132.497448 93.744712) + (xy 132.493549 93.744808) (xy 132.481381 93.745406) (xy 132.468909 93.746326) (xy 132.468907 93.746326) + (xy 132.468896 93.746327) (xy 132.413901 93.751743) (xy 132.292027 93.763746) (xy 132.292 93.763749) + (xy 132.267214 93.767427) (xy 132.267212 93.767427) (xy 132.243392 93.772165) (xy 132.243382 93.772167) + (xy 132.219079 93.778254) (xy 132.219057 93.77826) (xy 132.054824 93.828079) (xy 132.031222 93.836524) + (xy 132.031204 93.836531) (xy 132.008781 93.84582) (xy 132.008773 93.845823) (xy 131.986107 93.856543) + (xy 131.834765 93.937437) (xy 131.813236 93.950341) (xy 131.79306 93.963822) (xy 131.793034 93.96384) + (xy 131.772891 93.97878) (xy 131.640234 94.087651) (xy 131.640218 94.087665) (xy 131.621654 94.104489) + (xy 131.604489 94.121654) (xy 131.587666 94.140216) (xy 131.58765 94.140235) (xy 131.587645 94.140241) + (xy 131.541144 94.196902) (xy 131.483399 94.236235) (xy 131.413555 94.238104) (xy 131.376403 94.221338) + (xy 131.373201 94.219198) (xy 131.323525 94.186006) (xy 131.290339 94.163832) (xy 131.290335 94.163831) + (xy 131.217277 94.149299) (xy 131.217274 94.149299) (xy 130.660726 94.149299) (xy 130.660723 94.149299) + (xy 130.587664 94.163831) (xy 130.58766 94.163832) (xy 130.504799 94.219198) (xy 130.449433 94.302059) + (xy 130.449432 94.302063) (xy 130.4349 94.37512) (xy 130.4349 95.7205) (xy 130.415215 95.787539) + (xy 130.362411 95.833294) (xy 130.3109 95.8445) (xy 130.2971 95.8445) (xy 130.230061 95.824815) + (xy 130.184306 95.772011) (xy 130.1731 95.7205) (xy 130.1731 94.375122) (xy 130.173099 94.37512) + (xy 130.158567 94.302063) (xy 130.158566 94.302059) (xy 130.139088 94.272908) (xy 130.103201 94.219198) + (xy 130.047835 94.182204) (xy 130.020339 94.163832) (xy 130.020335 94.163831) (xy 129.947277 94.149299) + (xy 129.947274 94.149299) (xy 129.390726 94.149299) (xy 129.390723 94.149299) (xy 129.317664 94.163831) + (xy 129.31766 94.163832) (xy 129.234799 94.219198) (xy 129.179433 94.302059) (xy 129.179432 94.302063) + (xy 129.1649 94.37512) (xy 129.1649 95.7205) (xy 129.145215 95.787539) (xy 129.092411 95.833294) + (xy 129.0409 95.8445) (xy 128.721656 95.8445) (xy 128.704519 95.845342) (xy 128.696605 95.845731) + (xy 128.672423 95.848113) (xy 128.662689 95.849557) (xy 128.644497 95.850899) (xy 128.153503 95.850899) + (xy 128.135311 95.849557) (xy 128.125576 95.848113) (xy 128.101394 95.845731) (xy 128.094432 95.845389) + (xy 128.076344 95.8445) (xy 127.451656 95.8445) (xy 127.434519 95.845342) (xy 127.426605 95.845731) + (xy 127.402423 95.848113) (xy 127.392689 95.849557) (xy 127.374497 95.850899) (xy 126.883503 95.850899) + (xy 126.865311 95.849557) (xy 126.855576 95.848113) (xy 126.831394 95.845731) (xy 126.824432 95.845389) + (xy 126.806344 95.8445) (xy 126.181656 95.8445) (xy 126.164519 95.845342) (xy 126.156605 95.845731) + (xy 126.132423 95.848113) (xy 126.122689 95.849557) (xy 126.104497 95.850899) (xy 125.613503 95.850899) + (xy 125.595311 95.849557) (xy 125.585576 95.848113) (xy 125.561394 95.845731) (xy 125.554432 95.845389) + (xy 125.536344 95.8445) (xy 125.536331 95.8445) (xy 125.379875 95.8445) (xy 125.312836 95.824815) + (xy 125.301327 95.816449) (xy 125.300544 95.815808) (xy 125.283361 95.798673) (xy 125.174478 95.666418) + (xy 125.160962 95.646265) (xy 125.107853 95.547357) (xy 125.0931 95.488696) (xy 125.0931 94.375122) + (xy 125.093099 94.37512) (xy 125.078567 94.302063) (xy 125.078566 94.302059) (xy 125.059088 94.272908) + (xy 125.023201 94.219198) (xy 125.023199 94.219197) (xy 125.016415 94.209043) (xy 125.019883 94.206725) + (xy 124.99741 94.165569) (xy 124.994576 94.139558) (xy 124.986542 91.235097) (xy 125.006041 91.168007) + (xy 125.022855 91.147082) (xy 125.029703 91.140234) (xy 125.049547 91.124118) (xy 125.084426 91.101329) + (xy 125.125372 91.067787) (xy 125.145732 91.049184) (xy 125.200376 90.965803) (xy 125.226537 90.901016) + (xy 125.243893 90.830395) (xy 125.253673 90.731105) (xy 125.254595 90.718594) (xy 125.255192 90.706439) + (xy 125.2555 90.693905) (xy 125.2555 90.174499) (xy 125.275185 90.10746) (xy 125.327989 90.061705) + (xy 125.3795 90.050499) (xy 126.331518 90.050499) (xy 126.331519 90.050499) (xy 126.425305 90.035646) + (xy 126.538343 89.97805) (xy 126.628051 89.888342) (xy 126.685647 89.775304) (xy 126.685647 89.775302) + (xy 126.685648 89.775301) (xy 126.7005 89.681524) (xy 126.700501 89.681519) (xy 126.7005 89.318482) + (xy 126.685647 89.224696) (xy 126.670243 89.194464) (xy 126.657347 89.125795) (xy 126.683624 89.061055) + (xy 126.693037 89.050499) (xy 126.84184 88.901697) (xy 126.90316 88.868214) (xy 126.929217 88.86538) + (xy 128.20237 88.862364) (xy 128.397124 88.842746) (xy 128.584325 88.785565) (xy 128.756801 88.693013) + (xy 128.907944 88.568635) (xy 129.031963 88.417198) (xy 129.124106 88.244503) (xy 129.180843 88.057167) + (xy 129.2 87.862367) (xy 129.2 81.6995) (xy 129.219685 81.632461) (xy 129.272489 81.586706) (xy 129.324 81.5755) + (xy 129.803692 81.5755) (xy 129.870731 81.595185) (xy 129.905742 81.629061) (xy 129.908089 81.632461) + (xy 129.909515 81.634528) (xy 129.909517 81.63453) (xy 130.02776 81.739283) (xy 130.027762 81.739284) + (xy 130.167634 81.812696) (xy 130.321014 81.8505) (xy 130.321015 81.8505) (xy 130.478985 81.8505) + (xy 130.632365 81.812696) (xy 130.705586 81.774266) (xy 130.77224 81.739283) (xy 130.890483 81.63453) + (xy 130.98022 81.504523) (xy 131.036237 81.356818) (xy 131.055278 81.2) (xy 131.043031 81.099131) + (xy 131.036237 81.043181) (xy 130.997295 80.9405) (xy 130.98022 80.895477) (xy 130.890483 80.76547) + (xy 130.77224 80.660717) (xy 130.772238 80.660716) (xy 130.772237 80.660715) (xy 130.632365 80.587303) + (xy 130.478986 80.5495) (xy 130.478985 80.5495) (xy 130.321015 80.5495) (xy 130.321014 80.5495) + (xy 130.167634 80.587303) (xy 130.027762 80.660715) (xy 129.909516 80.76547) (xy 129.907089 80.768987) + (xy 129.905742 80.770938) (xy 129.851463 80.814929) (xy 129.803692 80.8245) (xy 129.324 80.8245) + (xy 129.256961 80.804815) (xy 129.211206 80.752011) (xy 129.2 80.7005) (xy 129.2 73.006092) (xy 129.200597 72.993938) + (xy 129.218018 72.817056) (xy 129.222757 72.793232) (xy 129.272577 72.628994) (xy 129.281875 72.606549) + (xy 129.362775 72.455195) (xy 129.376272 72.434995) (xy 129.485149 72.302328) (xy 129.502367 72.285117) + (xy 129.50304 72.284564) (xy 129.504198 72.283616) (xy 129.568519 72.256328) (xy 129.582825 72.2555) + (xy 129.744447 72.2555) (xy 129.744455 72.2555) (xy 129.810948 72.246696) (xy 129.84491 72.237542) + (xy 129.914759 72.2391) (xy 129.97268 72.278176) (xy 129.986538 72.298816) (xy 130.035231 72.389914) + (xy 130.035235 72.389921) (xy 130.161511 72.543788) (xy 130.315378 72.670064) (xy 130.315385 72.670068) + (xy 130.484441 72.76043) (xy 130.490927 72.763897) (xy 130.681407 72.821679) (xy 130.8795 72.841189) + (xy 131.077593 72.821679) (xy 131.268073 72.763897) (xy 131.44362 72.670065) (xy 131.597488 72.543788) + (xy 131.723765 72.38992) (xy 131.817597 72.214373) (xy 131.875379 72.023893) (xy 131.894889 71.8258) + (xy 131.883156 71.706673) (xy 131.896175 71.638029) (xy 131.94424 71.587319) (xy 131.958303 71.580973) + (xy 131.958129 71.580582) (xy 131.975517 71.572827) (xy 132.027505 71.549645) (xy 132.067288 71.527459) (xy 132.137148 71.45634) (xy 132.175445 71.397901) (xy 132.206244 71.332023) (xy 132.221739 71.280942) (xy 132.227831 71.256618) (xy 132.232573 71.232777) (xy 132.236252 71.207978) (xy 132.253673 71.031105) (xy 132.254595 71.018596) (xy 132.255192 71.006442) (xy 132.2555 70.993907) (xy 132.2555 68.382824) @@ -162407,12 +166761,12 @@ (filled_polygon (layer "F.Cu") (pts - (xy 276.3 177.2) (xy 269.7 177.2) (xy 269.7 175.3555) (xy 270.293887 175.3555) (xy 270.293907 175.3555) - (xy 270.306442 175.355192) (xy 270.318596 175.354595) (xy 270.331105 175.353673) (xy 270.507978 175.336252) - (xy 270.532777 175.332573) (xy 270.556618 175.327831) (xy 270.580942 175.321738) (xy 270.745165 175.271922) - (xy 270.768779 175.263473) (xy 270.791237 175.25417) (xy 270.813898 175.243452) (xy 270.96524 175.162558) - (xy 270.986745 175.149669) (xy 271.006957 175.136164) (xy 271.027098 175.121226) (xy 271.02989 175.118934) - (xy 271.069918 175.1) (xy 276.3 175.1) + (xy 276.3 177.2) (xy 276.05 177.2) (xy 269.95 177.2) (xy 269.7 177.2) (xy 269.7 175.3555) (xy 270.293887 175.3555) + (xy 270.293907 175.3555) (xy 270.306442 175.355192) (xy 270.318596 175.354595) (xy 270.331105 175.353673) + (xy 270.507978 175.336252) (xy 270.532777 175.332573) (xy 270.556618 175.327831) (xy 270.580942 175.321738) + (xy 270.745165 175.271922) (xy 270.768779 175.263473) (xy 270.791237 175.25417) (xy 270.813898 175.243452) + (xy 270.96524 175.162558) (xy 270.986745 175.149669) (xy 271.006957 175.136164) (xy 271.027098 175.121226) + (xy 271.02989 175.118934) (xy 271.069918 175.1) (xy 276.3 175.1) ) ) ) @@ -162465,7 +166819,7 @@ (xy 136.936045 201.89668) (xy 136.891881 201.920286) (xy 136.851781 201.947079) (xy 136.851764 201.947092) (xy 136.813072 201.978845) (xy 136.813053 201.978862) (xy 136.778862 202.013053) (xy 136.778845 202.013072) (xy 136.747092 202.051764) (xy 136.747079 202.051781) (xy 136.720286 202.091881) (xy 136.69668 202.136045) - (xy 136.696678 202.13605) (xy 136.678167 202.180738) (xy 136.663627 202.228674) (xy 136.663625 202.228682) + (xy 136.696678 202.13605) (xy 136.678167 202.180738) (xy 136.663627 202.228671) (xy 136.663625 202.22868) (xy 136.660442 202.244688) (xy 136.628059 202.3066) (xy 136.567344 202.341176) (xy 136.538824 202.3445) (xy 134.774752 202.3445) (xy 134.707713 202.324815) (xy 134.661958 202.272011) (xy 134.650752 202.2205) (xy 134.650752 202.161895) (xy 134.650751 202.161893) (xy 134.636219 202.088836) (xy 134.636218 202.088832) @@ -162478,14 +166832,22 @@ (xy 135.286267 201.32) (xy 135.353306 201.339685) (xy 135.355157 201.340897) (xy 135.402512 201.372538) (xy 135.402515 201.372538) (xy 135.402516 201.372539) (xy 135.475573 201.387071) (xy 135.475576 201.387072) (xy 135.475578 201.387072) (xy 136.124928 201.387072) (xy 136.124929 201.387071) (xy 136.197992 201.372538) - (xy 136.276622 201.32) (xy 136.4 201.32) (xy 136.4 199.816092) (xy 136.400597 199.803938) (xy 136.418018 199.627056) - (xy 136.422757 199.603232) (xy 136.472577 199.438994) (xy 136.481875 199.416549) (xy 136.562775 199.265195) - (xy 136.576272 199.244995) (xy 136.685149 199.112328) (xy 136.702328 199.095149) (xy 136.834995 198.986272) - (xy 136.855195 198.972775) (xy 137.006549 198.891875) (xy 137.028994 198.882577) (xy 137.193232 198.832757) - (xy 137.217056 198.828018) (xy 137.393939 198.810597) (xy 137.406093 198.81) (xy 137.987527 198.81) - (xy 137.987534 198.81) (xy 138.99 198.81) (xy 138.987531 197.807537) (xy 138.981084 195.189999) - (xy 138.981083 195.189997) (xy 138.98 194.75) (xy 138.540005 194.75) (xy 138.539999 194.749999) - (xy 138.539996 194.75) (xy 138.1 194.75) (xy 138.1 195.189994) (xy 138.1 195.763907) (xy 138.099403 195.776061) + (xy 136.280853 201.317173) (xy 136.336218 201.234312) (xy 136.350752 201.161246) (xy 136.350752 200.861898) + (xy 136.350752 200.861895) (xy 136.350751 200.861893) (xy 136.336219 200.788836) (xy 136.336218 200.788835) + (xy 136.336218 200.788832) (xy 136.336216 200.788829) (xy 136.331545 200.777552) (xy 136.335438 200.775939) + (xy 136.321464 200.731363) (xy 136.326782 200.693115) (xy 136.380785 200.51509) (xy 136.4 200.32) + (xy 136.4 199.816092) (xy 136.400597 199.803938) (xy 136.418018 199.627056) (xy 136.422757 199.603232) + (xy 136.472577 199.438994) (xy 136.481875 199.416549) (xy 136.562775 199.265195) (xy 136.576272 199.244995) + (xy 136.685149 199.112328) (xy 136.702328 199.095149) (xy 136.834995 198.986272) (xy 136.855195 198.972775) + (xy 137.006549 198.891875) (xy 137.028994 198.882577) (xy 137.193232 198.832757) (xy 137.217056 198.828018) + (xy 137.393939 198.810597) (xy 137.406093 198.81) (xy 137.987527 198.81) (xy 137.987534 198.81) + (xy 138.182926 198.790725) (xy 138.370786 198.733644) (xy 138.543872 198.640956) (xy 138.695511 198.516235) + (xy 138.819858 198.36429) (xy 138.912119 198.190976) (xy 138.968737 198.002976) (xy 138.987531 197.807537) + (xy 138.981084 195.189999) (xy 138.959227 195.053956) (xy 138.896462 194.931295) (xy 138.798912 194.833984) + (xy 138.798908 194.833982) (xy 138.798907 194.833981) (xy 138.676098 194.771521) (xy 138.539999 194.749999) + (xy 138.539996 194.75) (xy 138.404035 194.771533) (xy 138.32226 194.8132) (xy 138.281374 194.834033) + (xy 138.281373 194.834034) (xy 138.281368 194.834037) (xy 138.184037 194.931368) (xy 138.184034 194.931373) + (xy 138.121533 195.054035) (xy 138.1 195.189994) (xy 138.1 195.763907) (xy 138.099403 195.776061) (xy 138.081982 195.952934) (xy 138.07724 195.976775) (xy 138.027424 196.140998) (xy 138.018121 196.163456) (xy 137.937227 196.314798) (xy 137.923722 196.33501) (xy 137.814854 196.467666) (xy 137.797666 196.484854) (xy 137.66501 196.593722) (xy 137.644798 196.607227) (xy 137.493456 196.688121) (xy 137.470998 196.697424) @@ -162499,7 +166861,9 @@ (xy 135.012775 194.875195) (xy 135.026272 194.854995) (xy 135.135149 194.722328) (xy 135.152328 194.705149) (xy 135.284995 194.596272) (xy 135.305195 194.582775) (xy 135.456549 194.501875) (xy 135.478994 194.492577) (xy 135.643232 194.442757) (xy 135.667056 194.438018) (xy 135.843939 194.420597) (xy 135.856093 194.42) - (xy 137.999997 194.42) (xy 138 194.42) (xy 138.98 194.42) (xy 138.98 192.46) (xy 145.37 192.46) + (xy 137.999997 194.42) (xy 138 194.42) (xy 138.191189 194.40117) (xy 138.37503 194.345402) (xy 138.544459 194.25484) + (xy 138.692965 194.132965) (xy 138.81484 193.984459) (xy 138.905402 193.81503) (xy 138.96117 193.631189) + (xy 138.98 193.44) (xy 138.98 192.46) (xy 145.37 192.46) ) ) ) @@ -162529,16 +166893,16 @@ (filled_polygon (layer "F.Cu") (pts - (xy 258.7 187.8) (xy 254.106093 187.8) (xy 254.093939 187.799403) (xy 253.917065 187.781982) (xy 253.893224 187.77724) - (xy 253.729001 187.727424) (xy 253.706543 187.718121) (xy 253.555201 187.637227) (xy 253.534989 187.623722) - (xy 253.402333 187.514854) (xy 253.385145 187.497666) (xy 253.276277 187.36501) (xy 253.262772 187.344798) - (xy 253.181878 187.193456) (xy 253.172575 187.170998) (xy 253.122757 187.006769) (xy 253.118018 186.982941) - (xy 253.100597 186.806061) (xy 253.1 186.793907) (xy 253.1 184.906092) (xy 253.100597 184.893938) - (xy 253.118018 184.717056) (xy 253.122757 184.693232) (xy 253.172577 184.528994) (xy 253.181875 184.506549) - (xy 253.262775 184.355195) (xy 253.276272 184.334995) (xy 253.385149 184.202328) (xy 253.402328 184.185149) - (xy 253.534995 184.076272) (xy 253.555195 184.062775) (xy 253.706549 183.981875) (xy 253.728994 183.972577) - (xy 253.893232 183.922757) (xy 253.917056 183.918018) (xy 254.093939 183.900597) (xy 254.106093 183.9) - (xy 257.699997 183.9) (xy 257.7 183.9) (xy 258.7 183.9) + (xy 258.7 187.8) (xy 257.7 187.8) (xy 254.106093 187.8) (xy 254.093939 187.799403) (xy 253.917065 187.781982) + (xy 253.893224 187.77724) (xy 253.729001 187.727424) (xy 253.706543 187.718121) (xy 253.555201 187.637227) + (xy 253.534989 187.623722) (xy 253.402333 187.514854) (xy 253.385145 187.497666) (xy 253.276277 187.36501) + (xy 253.262772 187.344798) (xy 253.181878 187.193456) (xy 253.172575 187.170998) (xy 253.122757 187.006769) + (xy 253.118018 186.982941) (xy 253.100597 186.806061) (xy 253.1 186.793907) (xy 253.1 184.906092) + (xy 253.100597 184.893938) (xy 253.118018 184.717056) (xy 253.122757 184.693232) (xy 253.172577 184.528994) + (xy 253.181875 184.506549) (xy 253.262775 184.355195) (xy 253.276272 184.334995) (xy 253.385149 184.202328) + (xy 253.402328 184.185149) (xy 253.534995 184.076272) (xy 253.555195 184.062775) (xy 253.706549 183.981875) + (xy 253.728994 183.972577) (xy 253.893232 183.922757) (xy 253.917056 183.918018) (xy 254.093939 183.900597) + (xy 254.106093 183.9) (xy 257.699997 183.9) (xy 257.7 183.9) (xy 258.7 183.9) ) ) ) @@ -162571,43 +166935,48 @@ (filled_polygon (layer "F.Cu") (pts - (xy 270.3 77.356854) (xy 275.393928 77.356854) (xy 275.406042 77.35745) (xy 275.582942 77.374873) - (xy 275.60677 77.379612) (xy 275.771004 77.429431) (xy 275.793451 77.43873) (xy 275.944805 77.51963) - (xy 275.965011 77.533132) (xy 276.097667 77.642) (xy 276.114855 77.659188) (xy 276.223723 77.791844) - (xy 276.237226 77.812052) (xy 276.315529 77.958546) (xy 276.318122 77.963396) (xy 276.327425 77.985855) - (xy 276.377241 78.150079) (xy 276.381983 78.17392) (xy 276.399403 78.350793) (xy 276.4 78.362947) - (xy 276.4 95.350761) (xy 276.399403 95.362915) (xy 276.381982 95.539789) (xy 276.37724 95.56363) - (xy 276.327424 95.727853) (xy 276.318121 95.750312) (xy 276.237227 95.901653) (xy 276.223722 95.921864) - (xy 276.114854 96.05452) (xy 276.097666 96.071708) (xy 275.96501 96.180576) (xy 275.944799 96.194081) - (xy 275.793458 96.274975) (xy 275.770999 96.284278) (xy 275.606776 96.334094) (xy 275.582935 96.338836) - (xy 275.406061 96.356257) (xy 275.393907 96.356854) (xy 265.548001 96.356854) (xy 265.509933 96.350866) - (xy 265.07864 96.211741) (xy 265.049746 96.204253) (xy 265.049717 96.204246) (xy 265.021424 96.198655) - (xy 265.018906 96.198171) (xy 265.018905 96.19817) (xy 264.919223 96.199271) (xy 264.850848 96.213659) - (xy 264.798941 96.229524) (xy 264.729075 96.230294) (xy 264.704245 96.220298) (xy 264.688236 96.211741) - (xy 264.655203 96.194085) (xy 264.635007 96.180592) (xy 264.631961 96.178093) (xy 264.600335 96.138931) - (xy 264.59858 96.135519) (xy 264.598579 96.135515) (xy 264.536695 96.057356) (xy 264.536694 96.057355) - (xy 264.536691 96.057353) (xy 264.466547 96.018265) (xy 264.431054 95.988613) (xy 264.376276 95.921866) - (xy 264.362771 95.901654) (xy 264.281876 95.750309) (xy 264.272574 95.727854) (xy 264.272574 95.727853) - (xy 264.222756 95.563625) (xy 264.218017 95.539797) (xy 264.200596 95.362915) (xy 264.199999 95.350763) - (xy 264.199999 88.456858) (xy 264.199999 88.456855) (xy 264.199999 87.456855) (xy 263.759389 87.456855) - (xy 263.735601 87.421253) (xy 263.65274 87.365888) (xy 263.652739 87.365887) (xy 263.652735 87.365886) - (xy 263.579677 87.351354) (xy 263.579674 87.351354) (xy 260.743092 87.351354) (xy 260.676053 87.331669) - (xy 260.667606 87.32573) (xy 260.603332 87.276411) (xy 260.580448 87.253528) (xy 260.497018 87.144801) - (xy 260.480836 87.116772) (xy 260.428395 86.990166) (xy 260.420018 86.958903) (xy 260.402131 86.823033) - (xy 260.402131 86.790674) (xy 260.420018 86.654804) (xy 260.428396 86.623539) (xy 260.480837 86.496935) - (xy 260.497022 86.468902) (xy 260.580448 86.360178) (xy 260.603325 86.337301) (xy 260.712056 86.253869) - (xy 260.740075 86.237692) (xy 260.802605 86.211792) (xy 260.850056 86.202354) (xy 263.579676 86.202354) - (xy 263.579677 86.202353) (xy 263.65274 86.18782) (xy 263.699086 86.156853) (xy 264.199999 86.156854) - (xy 264.199999 82.996683) (xy 264.219684 82.929644) (xy 264.224404 82.922813) (xy 264.236145 82.906982) - (xy 264.236164 82.906957) (xy 264.249669 82.886745) (xy 264.262558 82.86524) (xy 264.343452 82.713898) - (xy 264.35417 82.691237) (xy 264.363473 82.668779) (xy 264.371922 82.645165) (xy 264.421738 82.480942) - (xy 264.427831 82.456618) (xy 264.432573 82.432777) (xy 264.436252 82.407978) (xy 264.453673 82.231105) - (xy 264.454595 82.218596) (xy 264.455192 82.206442) (xy 264.4555 82.193907) (xy 264.4555 78.1745) - (xy 264.449661 78.120187) (xy 264.438455 78.068676) (xy 264.431219 78.042302) (xy 264.422244 78.026542) - (xy 264.406177 77.958546) (xy 264.429421 77.892656) (xy 264.447773 77.872367) (xy 264.490482 77.834531) - (xy 264.505998 77.812052) (xy 264.58022 77.704523) (xy 264.63262 77.566352) (xy 264.674798 77.510651) - (xy 264.6901 77.500971) (xy 264.806551 77.438727) (xy 264.829003 77.429429) (xy 264.993219 77.379614) - (xy 264.993224 77.379612) (xy 265.017055 77.374871) (xy 265.16996 77.359811) (xy 265.193937 77.35745) + (xy 275.393928 77.356854) (xy 275.406042 77.35745) (xy 275.582942 77.374873) (xy 275.60677 77.379612) + (xy 275.771004 77.429431) (xy 275.793451 77.43873) (xy 275.944805 77.51963) (xy 275.965011 77.533132) + (xy 276.097667 77.642) (xy 276.114855 77.659188) (xy 276.223723 77.791844) (xy 276.237226 77.812052) + (xy 276.315529 77.958546) (xy 276.318122 77.963396) (xy 276.327425 77.985855) (xy 276.377241 78.150079) + (xy 276.381983 78.17392) (xy 276.399403 78.350793) (xy 276.4 78.362947) (xy 276.4 95.350761) (xy 276.399403 95.362915) + (xy 276.381982 95.539789) (xy 276.37724 95.56363) (xy 276.327424 95.727853) (xy 276.318121 95.750312) + (xy 276.237227 95.901653) (xy 276.223722 95.921864) (xy 276.114854 96.05452) (xy 276.097666 96.071708) + (xy 275.96501 96.180576) (xy 275.944799 96.194081) (xy 275.793458 96.274975) (xy 275.770999 96.284278) + (xy 275.606776 96.334094) (xy 275.582935 96.338836) (xy 275.406061 96.356257) (xy 275.393907 96.356854) + (xy 265.548001 96.356854) (xy 265.509933 96.350866) (xy 265.078666 96.211749) (xy 265.078659 96.211747) + (xy 265.078643 96.211742) (xy 265.05551 96.205747) (xy 265.04974 96.204252) (xy 265.043696 96.203057) + (xy 265.021367 96.198645) (xy 265.018906 96.198171) (xy 265.018902 96.198171) (xy 264.919223 96.199271) + (xy 264.850848 96.213659) (xy 264.798941 96.229524) (xy 264.729075 96.230294) (xy 264.704245 96.220298) + (xy 264.688251 96.211749) (xy 264.655198 96.194082) (xy 264.634985 96.180575) (xy 264.630723 96.177077) + (xy 264.598397 96.136511) (xy 264.572235 96.083987) (xy 264.572235 96.083986) (xy 264.529481 96.028724) + (xy 264.477251 95.978126) (xy 264.477247 95.978123) (xy 264.477245 95.978121) (xy 264.477242 95.978118) + (xy 264.414131 95.932418) (xy 264.394816 95.915077) (xy 264.343996 95.858776) (xy 264.326688 95.834146) + (xy 264.281877 95.750312) (xy 264.281873 95.750304) (xy 264.272576 95.727859) (xy 264.222756 95.563625) + (xy 264.218017 95.539797) (xy 264.200596 95.362915) (xy 264.199999 95.350763) (xy 264.199999 88.456858) + (xy 264.180784 88.261766) (xy 264.180784 88.261765) (xy 264.123879 88.074172) (xy 264.031469 87.901285) + (xy 263.993647 87.855199) (xy 263.907106 87.749747) (xy 263.850835 87.703567) (xy 263.811501 87.645822) + (xy 263.8055 87.607714) (xy 263.8055 87.577177) (xy 263.805499 87.577175) (xy 263.790967 87.504118) + (xy 263.790966 87.504114) (xy 263.735601 87.421253) (xy 263.65274 87.365888) (xy 263.652739 87.365887) + (xy 263.652735 87.365886) (xy 263.579677 87.351354) (xy 263.579674 87.351354) (xy 260.743092 87.351354) + (xy 260.676053 87.331669) (xy 260.667606 87.32573) (xy 260.603332 87.276411) (xy 260.580448 87.253528) + (xy 260.497018 87.144801) (xy 260.480836 87.116772) (xy 260.428395 86.990166) (xy 260.420018 86.958903) + (xy 260.402131 86.823033) (xy 260.402131 86.790674) (xy 260.420018 86.654804) (xy 260.428396 86.623539) + (xy 260.480837 86.496935) (xy 260.497022 86.468902) (xy 260.580448 86.360178) (xy 260.603325 86.337301) + (xy 260.712056 86.253869) (xy 260.740075 86.237692) (xy 260.802605 86.211792) (xy 260.850056 86.202354) + (xy 263.579676 86.202354) (xy 263.579677 86.202353) (xy 263.65274 86.18782) (xy 263.735601 86.132455) + (xy 263.790966 86.049594) (xy 263.803781 85.985165) (xy 263.836165 85.923258) (xy 263.846727 85.913511) + (xy 263.907106 85.863961) (xy 264.031469 85.712424) (xy 264.123879 85.539537) (xy 264.180784 85.351944) + (xy 264.199999 85.156854) (xy 264.199999 82.996683) (xy 264.219684 82.929644) (xy 264.224404 82.922813) + (xy 264.236145 82.906982) (xy 264.236164 82.906957) (xy 264.249669 82.886745) (xy 264.262558 82.86524) + (xy 264.343452 82.713898) (xy 264.35417 82.691237) (xy 264.363473 82.668779) (xy 264.371922 82.645165) + (xy 264.421738 82.480942) (xy 264.427831 82.456618) (xy 264.432573 82.432777) (xy 264.436252 82.407978) + (xy 264.453673 82.231105) (xy 264.454595 82.218596) (xy 264.455192 82.206442) (xy 264.4555 82.193907) + (xy 264.4555 78.1745) (xy 264.449661 78.120187) (xy 264.438455 78.068676) (xy 264.431219 78.042302) + (xy 264.422244 78.026542) (xy 264.406177 77.958546) (xy 264.429421 77.892656) (xy 264.447773 77.872367) + (xy 264.490482 77.834531) (xy 264.505998 77.812052) (xy 264.58022 77.704523) (xy 264.63262 77.566352) + (xy 264.674798 77.510651) (xy 264.6901 77.500971) (xy 264.806551 77.438727) (xy 264.829003 77.429429) + (xy 264.993219 77.379614) (xy 264.993224 77.379612) (xy 265.017055 77.374871) (xy 265.193938 77.357449) (xy 265.20609 77.356853) ) ) @@ -162644,7 +167013,7 @@ (xy 268.117048 126.278416) (xy 268.117052 126.27842) (xy 268.117052 126.278421) (xy 268.221578 126.382947) (xy 268.221581 126.382949) (xy 268.221584 126.382952) (xy 268.344506 126.465084) (xy 268.481088 126.521658) (xy 268.481092 126.521658) (xy 268.481093 126.521659) (xy 268.62608 126.5505) (xy 268.626083 126.5505) - (xy 268.773919 126.5505) (xy 268.871461 126.531096) (xy 268.918912 126.521658) (xy 269.055494 126.465084) + (xy 268.773919 126.5505) (xy 268.891584 126.527094) (xy 268.918912 126.521658) (xy 269.055494 126.465084) (xy 269.178416 126.382952) (xy 269.425049 126.136319) (xy 269.486372 126.102834) (xy 269.51273 126.1) (xy 275.693907 126.1) (xy 275.706061 126.100597) (xy 275.882941 126.118018) (xy 275.906769 126.122757) (xy 276.071001 126.172576) (xy 276.093453 126.181877) (xy 276.244798 126.262772) (xy 276.26501 126.276277) @@ -162671,7 +167040,9 @@ (xy 271.582353 162.105297) (xy 271.582353 162.105299) (xy 271.5795 162.135729) (xy 271.5795 162.794268) (xy 271.582353 162.824698) (xy 271.582353 162.8247) (xy 271.626043 162.949555) (xy 271.627207 162.952881) (xy 271.705048 163.058353) (xy 271.707851 163.06215) (xy 271.806014 163.134597) (xy 271.848265 163.190244) - (xy 271.84903 163.2) (xy 271.3 163.2) (xy 271.3 163.779257) (xy 271.219781 163.895475) (xy 271.21978 163.895476) + (xy 271.853724 163.2599) (xy 271.820657 163.32145) (xy 271.790835 163.343725) (xy 271.744432 163.368528) + (xy 271.744428 163.368531) (xy 271.592892 163.492892) (xy 271.491853 163.616009) (xy 271.453628 163.647139) + (xy 271.427763 163.660714) (xy 271.309516 163.765471) (xy 271.219781 163.895475) (xy 271.21978 163.895476) (xy 271.163762 164.043181) (xy 271.144722 164.199999) (xy 271.144722 164.2) (xy 271.163762 164.356818) (xy 271.21978 164.504523) (xy 271.21978 164.504524) (xy 271.238137 164.531118) (xy 271.27805 164.588942) (xy 271.299933 164.655295) (xy 271.3 164.659381) (xy 271.3 165.040617) (xy 271.280315 165.107656) @@ -162712,66 +167083,79 @@ (xy 265.772238 174.160716) (xy 265.772237 174.160715) (xy 265.632365 174.087303) (xy 265.478986 174.0495) (xy 265.478985 174.0495) (xy 265.321015 174.0495) (xy 265.321014 174.0495) (xy 265.167634 174.087303) (xy 265.081626 174.132445) (xy 265.013118 174.146171) (xy 264.948065 174.120679) (xy 264.90712 174.064063) - (xy 264.9 174.022649) (xy 264.9 173.700003) (xy 264.9 173.7) (xy 264.9 172.7) (xy 263.9 172.7) (xy 263.899997 172.7) - (xy 261.700003 172.7) (xy 261.7 172.7) (xy 260.7 172.7) (xy 260.7 173.7) (xy 260.7 173.700003) (xy 260.7 173.766693) - (xy 260.692182 173.810026) (xy 260.676324 173.852542) (xy 260.669917 173.912141) (xy 260.669916 173.91216) - (xy 260.669916 174.512524) (xy 260.664577 174.548519) (xy 260.627424 174.670997) (xy 260.618121 174.693455) - (xy 260.537227 174.844798) (xy 260.523722 174.86501) (xy 260.414854 174.997666) (xy 260.397666 175.014854) - (xy 260.26501 175.123722) (xy 260.244798 175.137227) (xy 260.093456 175.218121) (xy 260.070998 175.227424) - (xy 259.906775 175.27724) (xy 259.882934 175.281982) (xy 259.706061 175.299403) (xy 259.693907 175.3) - (xy 257.506093 175.3) (xy 257.493939 175.299403) (xy 257.317065 175.281982) (xy 257.293224 175.27724) - (xy 257.129001 175.227424) (xy 257.106543 175.218121) (xy 256.955201 175.137227) (xy 256.934989 175.123722) - (xy 256.802333 175.014854) (xy 256.785145 174.997666) (xy 256.676277 174.86501) (xy 256.662772 174.844798) - (xy 256.642626 174.807107) (xy 256.581877 174.693453) (xy 256.572575 174.670998) (xy 256.553199 174.607124) - (xy 256.540993 174.566883) (xy 256.536559 174.54584) (xy 256.536237 174.543182) (xy 256.525563 174.515039) - (xy 256.52276 174.506779) (xy 256.522661 174.506449) (xy 256.518018 174.482937) (xy 256.500597 174.306061) - (xy 256.5 174.293907) (xy 256.5 173.67509) (xy 256.508057 173.631122) (xy 256.536237 173.556818) - (xy 256.555278 173.4) (xy 256.536237 173.243182) (xy 256.508058 173.168879) (xy 256.5 173.124908) - (xy 256.5 172.37509) (xy 256.508057 172.331122) (xy 256.536237 172.256818) (xy 256.555278 172.1) - (xy 256.536237 171.943182) (xy 256.508058 171.868879) (xy 256.5 171.824908) (xy 256.5 171.07509) - (xy 256.508057 171.031122) (xy 256.536237 170.956818) (xy 256.555278 170.8) (xy 256.536237 170.643182) - (xy 256.508058 170.568879) (xy 256.5 170.524908) (xy 256.5 169.77509) (xy 256.508057 169.731122) - (xy 256.536237 169.656818) (xy 256.555278 169.5) (xy 256.536237 169.343182) (xy 256.508058 169.268879) - (xy 256.5 169.224908) (xy 256.5 168.47509) (xy 256.508057 168.431122) (xy 256.536237 168.356818) - (xy 256.555278 168.2) (xy 256.536237 168.043182) (xy 256.508058 167.968879) (xy 256.5 167.924908) - (xy 256.5 167.17509) (xy 256.508057 167.131122) (xy 256.536237 167.056818) (xy 256.555278 166.9) - (xy 256.536237 166.743182) (xy 256.508058 166.668879) (xy 256.5 166.624908) (xy 256.5 165.87509) - (xy 256.508057 165.831122) (xy 256.536237 165.756818) (xy 256.555278 165.6) (xy 256.536237 165.443182) - (xy 256.508058 165.368879) (xy 256.5 165.324908) (xy 256.5 164.57509) (xy 256.508057 164.531122) - (xy 256.536237 164.456818) (xy 256.555278 164.3) (xy 256.536237 164.143182) (xy 256.508058 164.068879) - (xy 256.5 164.024908) (xy 256.5 161.312519) (xy 256.500577 161.300569) (xy 256.502779 161.277823) - (xy 256.517421 161.12661) (xy 256.522004 161.103164) (xy 256.570195 160.941432) (xy 256.579197 160.919292) - (xy 256.657515 160.769826) (xy 256.670597 160.749822) (xy 256.779908 160.613454) (xy 256.787834 160.60449) - (xy 271.216344 145.79122) (xy 271.216343 145.79122) (xy 271.216349 145.791215) (xy 271.216348 145.791215) - (xy 271.5 145.5) (xy 271.5 142.357786) (xy 271.519685 142.290747) (xy 271.572489 142.244992) (xy 271.641647 142.235048) - (xy 271.705203 142.264073) (xy 271.711681 142.270105) (xy 271.861181 142.419605) (xy 271.861187 142.41961) - (xy 272.064035 142.575261) (xy 272.064042 142.575265) (xy 272.285457 142.7031) (xy 272.285462 142.703102) - (xy 272.285465 142.703104) (xy 272.521687 142.80095) (xy 272.76866 142.867126) (xy 273.022157 142.9005) - (xy 273.022164 142.9005) (xy 273.277836 142.9005) (xy 273.277843 142.9005) (xy 273.53134 142.867126) - (xy 273.778313 142.80095) (xy 274.014535 142.703104) (xy 274.235965 142.575261) (xy 274.438813 142.41961) - (xy 274.61961 142.238813) (xy 274.775261 142.035965) (xy 274.903104 141.814535) (xy 275.00095 141.578313) - (xy 275.067126 141.33134) (xy 275.1005 141.077843) (xy 275.1005 140.822157) (xy 275.067126 140.56866) - (xy 275.00095 140.321687) (xy 274.903104 140.085465) (xy 274.903102 140.085462) (xy 274.9031 140.085457) - (xy 274.775265 139.864042) (xy 274.775261 139.864035) (xy 274.61961 139.661187) (xy 274.619605 139.661181) - (xy 274.438818 139.480394) (xy 274.438811 139.480388) (xy 274.235973 139.324745) (xy 274.235971 139.324743) - (xy 274.235965 139.324739) (xy 274.23596 139.324736) (xy 274.235957 139.324734) (xy 274.014542 139.196899) - (xy 274.014531 139.196894) (xy 273.778322 139.099053) (xy 273.778315 139.099051) (xy 273.778313 139.09905) - (xy 273.53134 139.032874) (xy 273.475007 139.025457) (xy 273.27785 138.9995) (xy 273.277843 138.9995) - (xy 273.022157 138.9995) (xy 273.022149 138.9995) (xy 272.796826 139.029165) (xy 272.76866 139.032874) - (xy 272.521687 139.09905) (xy 272.521677 139.099053) (xy 272.285468 139.196894) (xy 272.285457 139.196899) - (xy 272.064042 139.324734) (xy 272.064026 139.324745) (xy 271.861188 139.480388) (xy 271.861181 139.480394) - (xy 271.711681 139.629895) (xy 271.650358 139.66338) (xy 271.580666 139.658396) (xy 271.524733 139.616524) - (xy 271.500316 139.55106) (xy 271.5 139.542214) (xy 271.5 130.200003) (xy 271.5 129.2) (xy 270.5 129.2) - (xy 270.499997 129.2) (xy 266.406093 129.2) (xy 266.393939 129.199403) (xy 266.217065 129.181982) - (xy 266.193224 129.17724) (xy 266.029001 129.127424) (xy 266.006543 129.118121) (xy 265.855201 129.037227) - (xy 265.834989 129.023722) (xy 265.702333 128.914854) (xy 265.685145 128.897666) (xy 265.576277 128.76501) - (xy 265.562772 128.744798) (xy 265.481878 128.593456) (xy 265.472575 128.570998) (xy 265.422757 128.406769) - (xy 265.418018 128.382941) (xy 265.400597 128.206061) (xy 265.4 128.193907) (xy 265.4 127.106092) - (xy 265.400597 127.093938) (xy 265.401097 127.08886) (xy 265.418018 126.917056) (xy 265.422757 126.893232) - (xy 265.472577 126.728994) (xy 265.481875 126.706549) (xy 265.562775 126.555195) (xy 265.576272 126.534995) - (xy 265.685149 126.402328) (xy 265.702328 126.385149) (xy 265.834995 126.276272) (xy 265.855195 126.262775) - (xy 266.006549 126.181875) (xy 266.028994 126.172577) (xy 266.193232 126.122757) (xy 266.217056 126.118018) - (xy 266.393939 126.100597) (xy 266.406093 126.1) (xy 267.931557 126.1) + (xy 264.9 174.022649) (xy 264.9 173.700003) (xy 264.89891 173.688941) (xy 264.880785 173.50491) + (xy 264.82388 173.317317) (xy 264.814624 173.3) (xy 264.731473 173.144435) (xy 264.731471 173.144433) + (xy 264.73147 173.14443) (xy 264.693648 173.098344) (xy 264.607107 172.992892) (xy 264.455571 172.868531) + (xy 264.455564 172.868526) (xy 264.28269 172.776123) (xy 264.282687 172.776122) (xy 264.282686 172.776121) + (xy 264.282683 172.77612) (xy 264.09509 172.719215) (xy 264.095088 172.719214) (xy 264.09509 172.719214) + (xy 263.944494 172.704382) (xy 263.9 172.7) (xy 263.899997 172.7) (xy 261.700003 172.7) (xy 261.7 172.7) + (xy 261.651844 172.704743) (xy 261.504911 172.719214) (xy 261.394149 172.752813) (xy 261.317317 172.77612) + (xy 261.317314 172.776121) (xy 261.317312 172.776122) (xy 261.317309 172.776123) (xy 261.144435 172.868526) + (xy 261.144428 172.868531) (xy 260.992892 172.992892) (xy 260.868531 173.144428) (xy 260.868526 173.144435) + (xy 260.776123 173.317309) (xy 260.776122 173.317312) (xy 260.719214 173.504911) (xy 260.706784 173.631118) + (xy 260.702454 173.67509) (xy 260.7 173.700003) (xy 260.7 173.766693) (xy 260.692182 173.810026) + (xy 260.676324 173.852542) (xy 260.669917 173.912141) (xy 260.669916 173.91216) (xy 260.669916 174.512524) + (xy 260.664577 174.548519) (xy 260.627424 174.670997) (xy 260.618121 174.693455) (xy 260.537227 174.844798) + (xy 260.523722 174.86501) (xy 260.414854 174.997666) (xy 260.397666 175.014854) (xy 260.26501 175.123722) + (xy 260.244798 175.137227) (xy 260.093456 175.218121) (xy 260.070998 175.227424) (xy 259.906775 175.27724) + (xy 259.882934 175.281982) (xy 259.706061 175.299403) (xy 259.693907 175.3) (xy 257.506093 175.3) + (xy 257.493939 175.299403) (xy 257.317065 175.281982) (xy 257.293224 175.27724) (xy 257.129001 175.227424) + (xy 257.106543 175.218121) (xy 256.955201 175.137227) (xy 256.934989 175.123722) (xy 256.802333 175.014854) + (xy 256.785145 174.997666) (xy 256.676277 174.86501) (xy 256.662772 174.844798) (xy 256.642626 174.807107) + (xy 256.581877 174.693453) (xy 256.572575 174.670998) (xy 256.553199 174.607124) (xy 256.540993 174.566883) + (xy 256.536559 174.54584) (xy 256.536237 174.543182) (xy 256.525563 174.515039) (xy 256.52276 174.506779) + (xy 256.522661 174.506449) (xy 256.518018 174.482937) (xy 256.500597 174.306061) (xy 256.5 174.293907) + (xy 256.5 173.67509) (xy 256.508057 173.631122) (xy 256.536237 173.556818) (xy 256.555278 173.4) + (xy 256.536237 173.243182) (xy 256.508058 173.168879) (xy 256.5 173.124908) (xy 256.5 172.37509) + (xy 256.508057 172.331122) (xy 256.536237 172.256818) (xy 256.555278 172.1) (xy 256.536237 171.943182) + (xy 256.508058 171.868879) (xy 256.5 171.824908) (xy 256.5 171.07509) (xy 256.508057 171.031122) + (xy 256.536237 170.956818) (xy 256.555278 170.8) (xy 256.536237 170.643182) (xy 256.508058 170.568879) + (xy 256.5 170.524908) (xy 256.5 169.77509) (xy 256.508057 169.731122) (xy 256.536237 169.656818) + (xy 256.555278 169.5) (xy 256.536237 169.343182) (xy 256.508058 169.268879) (xy 256.5 169.224908) + (xy 256.5 168.47509) (xy 256.508057 168.431122) (xy 256.536237 168.356818) (xy 256.555278 168.2) + (xy 256.536237 168.043182) (xy 256.508058 167.968879) (xy 256.5 167.924908) (xy 256.5 167.17509) + (xy 256.508057 167.131122) (xy 256.536237 167.056818) (xy 256.555278 166.9) (xy 256.536237 166.743182) + (xy 256.508058 166.668879) (xy 256.5 166.624908) (xy 256.5 165.87509) (xy 256.508057 165.831122) + (xy 256.536237 165.756818) (xy 256.555278 165.6) (xy 256.536237 165.443182) (xy 256.508058 165.368879) + (xy 256.5 165.324908) (xy 256.5 164.57509) (xy 256.508057 164.531122) (xy 256.536237 164.456818) + (xy 256.555278 164.3) (xy 256.536237 164.143182) (xy 256.508058 164.068879) (xy 256.5 164.024908) + (xy 256.5 161.312519) (xy 256.500577 161.300569) (xy 256.502779 161.277823) (xy 256.517421 161.12661) + (xy 256.522004 161.103164) (xy 256.570195 160.941432) (xy 256.579197 160.919292) (xy 256.657515 160.769826) + (xy 256.670597 160.749822) (xy 256.779908 160.613454) (xy 256.787834 160.60449) (xy 271.216344 145.79122) + (xy 271.216343 145.79122) (xy 271.216349 145.791215) (xy 271.336911 145.640811) (xy 271.426377 145.47007) + (xy 271.481422 145.285336) (xy 271.5 145.093473) (xy 271.5 142.357786) (xy 271.519685 142.290747) + (xy 271.572489 142.244992) (xy 271.641647 142.235048) (xy 271.705203 142.264073) (xy 271.711681 142.270105) + (xy 271.861181 142.419605) (xy 271.861187 142.41961) (xy 272.064035 142.575261) (xy 272.064042 142.575265) + (xy 272.285457 142.7031) (xy 272.285462 142.703102) (xy 272.285465 142.703104) (xy 272.521687 142.80095) + (xy 272.76866 142.867126) (xy 273.022157 142.9005) (xy 273.022164 142.9005) (xy 273.277836 142.9005) + (xy 273.277843 142.9005) (xy 273.53134 142.867126) (xy 273.778313 142.80095) (xy 274.014535 142.703104) + (xy 274.235965 142.575261) (xy 274.438813 142.41961) (xy 274.61961 142.238813) (xy 274.775261 142.035965) + (xy 274.903104 141.814535) (xy 275.00095 141.578313) (xy 275.067126 141.33134) (xy 275.1005 141.077843) + (xy 275.1005 140.822157) (xy 275.067126 140.56866) (xy 275.00095 140.321687) (xy 274.903104 140.085465) + (xy 274.903102 140.085462) (xy 274.9031 140.085457) (xy 274.775265 139.864042) (xy 274.775261 139.864035) + (xy 274.61961 139.661187) (xy 274.619605 139.661181) (xy 274.438818 139.480394) (xy 274.438811 139.480388) + (xy 274.235973 139.324745) (xy 274.235971 139.324743) (xy 274.235965 139.324739) (xy 274.23596 139.324736) + (xy 274.235957 139.324734) (xy 274.014542 139.196899) (xy 274.014531 139.196894) (xy 273.778322 139.099053) + (xy 273.778315 139.099051) (xy 273.778313 139.09905) (xy 273.53134 139.032874) (xy 273.475007 139.025457) + (xy 273.27785 138.9995) (xy 273.277843 138.9995) (xy 273.022157 138.9995) (xy 273.022149 138.9995) + (xy 272.796826 139.029165) (xy 272.76866 139.032874) (xy 272.521687 139.09905) (xy 272.521677 139.099053) + (xy 272.285468 139.196894) (xy 272.285457 139.196899) (xy 272.064042 139.324734) (xy 272.064026 139.324745) + (xy 271.861188 139.480388) (xy 271.861181 139.480394) (xy 271.711681 139.629895) (xy 271.650358 139.66338) + (xy 271.580666 139.658396) (xy 271.524733 139.616524) (xy 271.500316 139.55106) (xy 271.5 139.542214) + (xy 271.5 130.200003) (xy 271.480785 130.004911) (xy 271.480785 130.00491) (xy 271.42388 129.817317) + (xy 271.33147 129.64443) (xy 271.293648 129.598344) (xy 271.207107 129.492892) (xy 271.055571 129.368531) + (xy 271.055564 129.368526) (xy 270.88269 129.276123) (xy 270.882687 129.276122) (xy 270.882686 129.276121) + (xy 270.882683 129.27612) (xy 270.69509 129.219215) (xy 270.695088 129.219214) (xy 270.69509 129.219214) + (xy 270.544494 129.204382) (xy 270.5 129.2) (xy 270.499997 129.2) (xy 266.406093 129.2) (xy 266.393939 129.199403) + (xy 266.217065 129.181982) (xy 266.193224 129.17724) (xy 266.029001 129.127424) (xy 266.006543 129.118121) + (xy 265.855201 129.037227) (xy 265.834989 129.023722) (xy 265.702333 128.914854) (xy 265.685145 128.897666) + (xy 265.576277 128.76501) (xy 265.562772 128.744798) (xy 265.481878 128.593456) (xy 265.472575 128.570998) + (xy 265.422757 128.406769) (xy 265.418018 128.382941) (xy 265.400597 128.206061) (xy 265.4 128.193907) + (xy 265.4 127.106092) (xy 265.400597 127.093938) (xy 265.401097 127.08886) (xy 265.418018 126.917056) + (xy 265.422757 126.893232) (xy 265.472577 126.728994) (xy 265.481875 126.706549) (xy 265.562775 126.555195) + (xy 265.576272 126.534995) (xy 265.685149 126.402328) (xy 265.702328 126.385149) (xy 265.834995 126.276272) + (xy 265.855195 126.262775) (xy 266.006549 126.181875) (xy 266.028994 126.172577) (xy 266.193232 126.122757) + (xy 266.217056 126.118018) (xy 266.393939 126.100597) (xy 266.406093 126.1) (xy 267.931557 126.1) ) ) ) @@ -162795,7 +167179,7 @@ ) (polygon (pts - (xy 267.2 195.7) (xy 267.2 197.8) (xy 269.2 197.8) (xy 269.2 213) (xy 259.3 213) (xy 259.3 218.8) + (xy 267.2 195.7) (xy 267.2 197.5) (xy 269.2 197.5) (xy 269.2 213) (xy 259.3 213) (xy 259.3 218.8) (xy 262.8 218.8) (xy 262.8 222.2) (xy 275.7 222.2) (xy 275.7 195.7) ) ) @@ -162852,8 +167236,14 @@ (xy 259.372577 213.628994) (xy 259.381875 213.606549) (xy 259.462775 213.455195) (xy 259.476272 213.434995) (xy 259.585149 213.302328) (xy 259.602328 213.285149) (xy 259.734995 213.176272) (xy 259.755195 213.162775) (xy 259.906549 213.081875) (xy 259.928994 213.072577) (xy 260.093232 213.022757) (xy 260.117056 213.018018) - (xy 260.293939 213.000597) (xy 260.306093 213) (xy 268.199997 213) (xy 268.2 213) (xy 269.2 213) - (xy 269.2 197.8) (xy 268.2 197.8) (xy 268.199997 197.8) (xy 267.2 197.8) (xy 267.2 195.7) (xy 275.7 195.7) + (xy 260.293939 213.000597) (xy 260.306093 213) (xy 268.199997 213) (xy 268.2 213) (xy 268.39509 212.980785) + (xy 268.582683 212.92388) (xy 268.75557 212.83147) (xy 268.907107 212.707107) (xy 269.03147 212.55557) + (xy 269.12388 212.382683) (xy 269.180785 212.19509) (xy 269.2 212) (xy 269.2 198.5) (xy 269.180785 198.30491) + (xy 269.12388 198.117317) (xy 269.03147 197.94443) (xy 268.993648 197.898344) (xy 268.907107 197.792892) + (xy 268.755571 197.668531) (xy 268.755564 197.668526) (xy 268.58269 197.576123) (xy 268.582687 197.576122) + (xy 268.582686 197.576121) (xy 268.582683 197.57612) (xy 268.39509 197.519215) (xy 268.395088 197.519214) + (xy 268.39509 197.519214) (xy 268.244494 197.504382) (xy 268.2 197.5) (xy 268.199997 197.5) (xy 267.2 197.5) + (xy 267.2 195.7) (xy 275.7 195.7) ) ) ) @@ -162892,19 +167282,27 @@ (xy 268.018121 132.806543) (xy 268.027424 132.829001) (xy 268.07724 132.993224) (xy 268.081982 133.017065) (xy 268.099403 133.193938) (xy 268.1 133.206092) (xy 268.1 134.915287) (xy 268.099492 134.926505) (xy 268.084651 135.089884) (xy 268.080608 135.111951) (xy 268.03809 135.264534) (xy 268.030137 135.285513) - (xy 267.960819 135.427941) (xy 267.949219 135.447139) (xy 267.85202 135.579306) (xy 267.844987 135.588012) - (xy 255.35 149.7) (xy 242.851301 163.816177) (xy 242.851297 163.816181) (xy 242.6 164.1) (xy 242.6 164.479088) + (xy 267.960819 135.427941) (xy 267.949219 135.447139) (xy 267.852012 135.579315) (xy 267.844978 135.588025) + (xy 255.35 149.7) (xy 242.851297 163.816181) (xy 242.748449 163.95603) (xy 242.744106 163.961936) + (xy 242.664934 164.12461) (xy 242.664933 164.124615) (xy 242.616367 164.298902) (xy 242.6 164.479088) (xy 242.6 164.479089) (xy 242.6 190.593907) (xy 242.599403 190.606061) (xy 242.581982 190.782934) (xy 242.57724 190.806775) (xy 242.527424 190.970998) (xy 242.518121 190.993456) (xy 242.437227 191.144798) (xy 242.423722 191.16501) (xy 242.314854 191.297666) (xy 242.297666 191.314854) (xy 242.16501 191.423722) (xy 242.144798 191.437227) (xy 241.993456 191.518121) (xy 241.970998 191.527424) (xy 241.806775 191.57724) - (xy 241.782934 191.581982) (xy 241.606061 191.599403) (xy 241.593907 191.6) (xy 230.1 191.6) (xy 230.1 192.6) - (xy 230.1 192.600003) (xy 230.1 204.493907) (xy 230.099403 204.506061) (xy 230.081982 204.682934) - (xy 230.07724 204.706775) (xy 230.027424 204.870998) (xy 230.018121 204.893456) (xy 229.937227 205.044798) - (xy 229.923722 205.06501) (xy 229.814854 205.197666) (xy 229.797666 205.214854) (xy 229.66501 205.323722) - (xy 229.644798 205.337227) (xy 229.493455 205.418121) (xy 229.470998 205.427423) (xy 229.415821 205.444161) - (xy 229.379826 205.449501) (xy 229.203482 205.449501) (xy 229.109695 205.464355) (xy 229.066263 205.486485) - (xy 229.009969 205.5) (xy 223.8 205.5) (xy 223.8 206.5) (xy 223.8 206.500003) (xy 223.8 207.849308) + (xy 241.782934 191.581982) (xy 241.606061 191.599403) (xy 241.593907 191.6) (xy 231.1 191.6) (xy 231.051844 191.604743) + (xy 230.904911 191.619214) (xy 230.794149 191.652813) (xy 230.717317 191.67612) (xy 230.717314 191.676121) + (xy 230.717312 191.676122) (xy 230.717309 191.676123) (xy 230.544435 191.768526) (xy 230.544428 191.768531) + (xy 230.392892 191.892892) (xy 230.268531 192.044428) (xy 230.268526 192.044435) (xy 230.176123 192.217309) + (xy 230.176122 192.217312) (xy 230.119214 192.404911) (xy 230.1 192.600003) (xy 230.1 204.493907) + (xy 230.099403 204.506061) (xy 230.081982 204.682934) (xy 230.07724 204.706775) (xy 230.027424 204.870998) + (xy 230.018121 204.893456) (xy 229.937227 205.044798) (xy 229.923722 205.06501) (xy 229.814854 205.197666) + (xy 229.797666 205.214854) (xy 229.66501 205.323722) (xy 229.644798 205.337227) (xy 229.493455 205.418121) + (xy 229.470998 205.427423) (xy 229.415821 205.444161) (xy 229.379826 205.449501) (xy 229.203482 205.449501) + (xy 229.109695 205.464355) (xy 229.066263 205.486485) (xy 229.009969 205.5) (xy 224.8 205.5) (xy 224.751844 205.504743) + (xy 224.604911 205.519214) (xy 224.494149 205.552813) (xy 224.417317 205.57612) (xy 224.417314 205.576121) + (xy 224.417312 205.576122) (xy 224.417309 205.576123) (xy 224.244435 205.668526) (xy 224.244428 205.668531) + (xy 224.092892 205.792892) (xy 223.968531 205.944428) (xy 223.968526 205.944435) (xy 223.876123 206.117309) + (xy 223.876122 206.117312) (xy 223.819214 206.304911) (xy 223.8 206.500003) (xy 223.8 207.849308) (xy 223.780315 207.916347) (xy 223.744891 207.95241) (xy 223.7048 207.979197) (xy 223.649434 208.062059) (xy 223.649433 208.062063) (xy 223.634901 208.13512) (xy 223.634901 209.507021) (xy 223.615216 209.57406) (xy 223.606754 209.585686) (xy 223.514854 209.697666) (xy 223.497666 209.714854) (xy 223.36501 209.823722) @@ -162922,20 +167320,20 @@ (xy 219.736237 195.356818) (xy 219.755278 195.2) (xy 219.753737 195.187304) (xy 219.736237 195.043181) (xy 219.698812 194.9445) (xy 219.68022 194.895477) (xy 219.680218 194.895474) (xy 219.680216 194.89547) (xy 219.62195 194.811056) (xy 219.600067 194.744702) (xy 219.6 194.740617) (xy 219.6 191.595068) - (xy 219.619685 191.528029) (xy 219.621145 191.525808) (xy 219.798989 191.261912) (xy 219.799841 191.260638) + (xy 219.619685 191.528029) (xy 219.621147 191.525805) (xy 219.798989 191.261912) (xy 219.799841 191.260638) (xy 219.80061 191.259482) (xy 219.801343 191.258375) (xy 219.812486 191.241434) (xy 219.814025 191.239066) (xy 219.815528 191.236725) (xy 219.817085 191.234269) (xy 219.827866 191.217049) (xy 219.828632 191.215817) - (xy 219.829359 191.214641) (xy 219.830092 191.213449) (xy 234.667568 166.915838) (xy 234.667611 166.915768) - (xy 234.698912 166.864508) (xy 234.713273 166.845411) (xy 234.753831 166.801103) (xy 235.801264 165.656818) - (xy 263.760123 135.112722) (xy 263.767803 135.103937) (xy 263.775046 135.09526) (xy 263.782292 135.086167) - (xy 263.882229 134.954721) (xy 263.89546 134.935566) (xy 263.907435 134.916419) (xy 263.918877 134.896121) - (xy 263.99332 134.748723) (xy 263.998336 134.738201) (xy 264.002966 134.72789) (xy 264.007491 134.717166) - (xy 264.390306 133.748867) (xy 264.401826 133.726618) (xy 264.512407 133.557495) (xy 264.565567 133.51216) - (xy 264.57588 133.508093) (xy 264.704426 133.463963) (xy 264.904906 133.355469) (xy 265.084794 133.215456) - (xy 265.239183 133.047745) (xy 265.363862 132.856909) (xy 265.45543 132.648155) (xy 265.51139 132.427176) - (xy 265.516041 132.371034) (xy 265.541194 132.305852) (xy 265.597596 132.264613) (xy 265.603235 132.262734) - (xy 265.732104 132.22322) (xy 265.75616 132.218385) (xy 265.934819 132.200608) (xy 265.947096 132.2) - (xy 267.093907 132.2) + (xy 219.829359 191.214641) (xy 219.830092 191.213449) (xy 234.662824 166.923603) (xy 234.666052 166.918594) + (xy 234.678677 166.9) (xy 234.704838 166.861468) (xy 234.712004 166.851937) (xy 234.756097 166.798836) + (xy 234.759964 166.794401) (xy 263.760123 135.112722) (xy 263.767803 135.103937) (xy 263.775046 135.09526) + (xy 263.782292 135.086167) (xy 263.882229 134.954721) (xy 263.89546 134.935566) (xy 263.907435 134.916419) + (xy 263.918877 134.896121) (xy 263.99332 134.748723) (xy 263.998336 134.738201) (xy 264.002966 134.72789) + (xy 264.007491 134.717166) (xy 264.390306 133.748867) (xy 264.401826 133.726617) (xy 264.512406 133.557495) + (xy 264.565567 133.51216) (xy 264.57588 133.508093) (xy 264.704426 133.463963) (xy 264.904906 133.355469) + (xy 265.084794 133.215456) (xy 265.239183 133.047745) (xy 265.363862 132.856909) (xy 265.45543 132.648155) + (xy 265.51139 132.427176) (xy 265.516041 132.371034) (xy 265.541194 132.305852) (xy 265.597596 132.264613) + (xy 265.603235 132.262734) (xy 265.732104 132.22322) (xy 265.75616 132.218385) (xy 265.934819 132.200608) + (xy 265.947096 132.2) (xy 267.093907 132.2) ) ) ) @@ -162993,65 +167391,81 @@ ) (polygon (pts - (xy 113.17 201.3) (xy 113.17 219.37) (xy 145.14 219.38) (xy 145.14 211.05) (xy 122.95 211.05) (xy 122.95 201.3) + (xy 114.15 201.3) (xy 114.2 219.35) (xy 148.4 219.4) (xy 148.4 211) (xy 122.95 211.05) (xy 122.95 201.3) ) ) (filled_polygon (layer "F.Cu") (pts - (xy 121.956061 201.300597) (xy 122.132941 201.318018) (xy 122.156769 201.322757) (xy 122.321001 201.372576) - (xy 122.343453 201.381877) (xy 122.494798 201.462772) (xy 122.51501 201.476277) (xy 122.647666 201.585145) - (xy 122.664854 201.602333) (xy 122.773722 201.734989) (xy 122.787227 201.755201) (xy 122.868121 201.906543) - (xy 122.877424 201.929001) (xy 122.92724 202.093224) (xy 122.931982 202.117065) (xy 122.949403 202.293938) - (xy 122.95 202.306092) (xy 122.95 211.05) (xy 133.880204 211.05) (xy 133.938657 211.064642) (xy 134.086079 211.143441) + (xy 121.956061 201.300597) (xy 121.964025 201.301381) (xy 122.132941 201.318018) (xy 122.156769 201.322757) + (xy 122.321001 201.372576) (xy 122.343453 201.381877) (xy 122.343985 201.382161) (xy 122.494798 201.462772) + (xy 122.51501 201.476277) (xy 122.647666 201.585145) (xy 122.664854 201.602333) (xy 122.773722 201.734989) + (xy 122.787227 201.755201) (xy 122.868121 201.906543) (xy 122.877424 201.929001) (xy 122.92724 202.093224) + (xy 122.931982 202.117065) (xy 122.949403 202.293938) (xy 122.95 202.306092) (xy 122.95 210.04805) + (xy 122.969262 210.24336) (xy 122.969263 210.243367) (xy 123.026308 210.43117) (xy 123.026308 210.431171) + (xy 123.118935 210.604208) (xy 123.11894 210.604217) (xy 123.243586 210.755832) (xy 123.243588 210.755834) + (xy 123.352308 210.844858) (xy 123.395452 210.880186) (xy 123.496196 210.933859) (xy 123.568678 210.972476) + (xy 123.756596 211.029153) (xy 123.951965 211.048032) (xy 133.843861 211.028597) (xy 133.910937 211.04815) + (xy 133.912961 211.049473) (xy 133.913254 211.049669) (xy 133.920494 211.054008) (xy 133.934731 211.062542) + (xy 133.934747 211.062551) (xy 133.934759 211.062558) (xy 133.934778 211.062568) (xy 134.086079 211.143441) (xy 134.086093 211.143448) (xy 134.086097 211.14345) (xy 134.086101 211.143452) (xy 134.108762 211.15417) (xy 134.13122 211.163473) (xy 134.154834 211.171922) (xy 134.319057 211.221738) (xy 134.343381 211.227831) (xy 134.367222 211.232573) (xy 134.385462 211.235278) (xy 134.39202 211.236252) (xy 134.409984 211.238021) (xy 134.568895 211.253673) (xy 134.581404 211.254595) (xy 134.593558 211.255192) (xy 134.606093 211.2555) - (xy 134.606113 211.2555) (xy 144.69625 211.2555) (xy 144.763289 211.275185) (xy 144.774914 211.283646) - (xy 144.837665 211.335144) (xy 144.854854 211.352333) (xy 144.963722 211.484989) (xy 144.977227 211.505201) - (xy 145.058121 211.656543) (xy 145.067424 211.679001) (xy 145.11724 211.843224) (xy 145.121982 211.867065) - (xy 145.139403 212.043938) (xy 145.14 212.056092) (xy 145.14 218.373591) (xy 145.139403 218.385747) - (xy 145.121975 218.562663) (xy 145.11723 218.58651) (xy 145.067396 218.750753) (xy 145.058091 218.773214) - (xy 144.977162 218.924584) (xy 144.963656 218.944793) (xy 144.854745 219.077465) (xy 144.837549 219.094655) - (xy 144.704852 219.203516) (xy 144.684635 219.217019) (xy 144.53324 219.2979) (xy 144.510776 219.307199) - (xy 144.346509 219.356984) (xy 144.322661 219.36172) (xy 144.145755 219.379091) (xy 144.133598 219.379685) - (xy 141.458461 219.378848) (xy 141.391428 219.359142) (xy 141.34569 219.306324) (xy 141.3345 219.254848) - (xy 141.3345 217.689523) (xy 141.334499 217.689521) (xy 141.319967 217.616464) (xy 141.319966 217.61646) - (xy 141.264601 217.533599) (xy 141.209235 217.496605) (xy 141.181739 217.478233) (xy 141.181735 217.478232) - (xy 141.108677 217.4637) (xy 141.108674 217.4637) (xy 139.539326 217.4637) (xy 139.539323 217.4637) - (xy 139.466264 217.478232) (xy 139.46626 217.478233) (xy 139.383399 217.533599) (xy 139.328033 217.61646) - (xy 139.328032 217.616464) (xy 139.3135 217.689521) (xy 139.3135 219.254137) (xy 139.293815 219.321176) - (xy 139.241011 219.366931) (xy 139.189461 219.378137) (xy 138.151786 219.377813) (xy 138.084753 219.358108) - (xy 138.039015 219.305289) (xy 138.029093 219.236128) (xy 138.055972 219.175148) (xy 138.056398 219.17463) - (xy 138.168265 219.03832) (xy 138.262097 218.862773) (xy 138.319879 218.672293) (xy 138.339389 218.4742) - (xy 138.319879 218.276107) (xy 138.262097 218.085627) (xy 138.168265 217.91008) (xy 138.168264 217.910078) - (xy 138.041988 217.756211) (xy 137.888121 217.629935) (xy 137.888114 217.629931) (xy 137.712574 217.536103) - (xy 137.522095 217.478321) (xy 137.324 217.458811) (xy 137.125904 217.478321) (xy 136.935425 217.536103) - (xy 136.759885 217.629931) (xy 136.759878 217.629935) (xy 136.606011 217.756211) (xy 136.479735 217.910078) - (xy 136.479731 217.910085) (xy 136.385903 218.085625) (xy 136.328121 218.276104) (xy 136.308611 218.4742) - (xy 136.328121 218.672295) (xy 136.385903 218.862774) (xy 136.479731 219.038314) (xy 136.479735 219.038321) - (xy 136.591602 219.17463) (xy 136.618915 219.23894) (xy 136.607124 219.307807) (xy 136.559972 219.359368) - (xy 136.49571 219.377295) (xy 116.789589 219.371131) (xy 114.175771 219.370313) (xy 114.163622 219.369713) - (xy 113.986793 219.352245) (xy 113.962957 219.347497) (xy 113.798784 219.297649) (xy 113.776334 219.288344) - (xy 113.625034 219.207432) (xy 113.604828 219.193925) (xy 113.472221 219.085057) (xy 113.455039 219.06787) - (xy 113.346209 218.935223) (xy 113.332709 218.915013) (xy 113.251847 218.763695) (xy 113.242548 218.741242) - (xy 113.19275 218.577047) (xy 113.18801 218.55321) (xy 113.170597 218.376375) (xy 113.17 218.364223) - (xy 113.17 215.4742) (xy 139.308611 215.4742) (xy 139.328121 215.672295) (xy 139.385903 215.862774) - (xy 139.479731 216.038314) (xy 139.479735 216.038321) (xy 139.606011 216.192188) (xy 139.759878 216.318464) - (xy 139.759885 216.318468) (xy 139.935425 216.412296) (xy 139.935427 216.412297) (xy 140.125907 216.470079) - (xy 140.324 216.489589) (xy 140.522093 216.470079) (xy 140.712573 216.412297) (xy 140.88812 216.318465) - (xy 141.041988 216.192188) (xy 141.168265 216.03832) (xy 141.262097 215.862773) (xy 141.319879 215.672293) - (xy 141.339389 215.4742) (xy 141.319879 215.276107) (xy 141.262097 215.085627) (xy 141.168265 214.91008) - (xy 141.168264 214.910078) (xy 141.041988 214.756211) (xy 140.888121 214.629935) (xy 140.888114 214.629931) - (xy 140.712574 214.536103) (xy 140.522095 214.478321) (xy 140.324 214.458811) (xy 140.125904 214.478321) - (xy 139.935425 214.536103) (xy 139.759885 214.629931) (xy 139.759878 214.629935) (xy 139.606011 214.756211) - (xy 139.479735 214.910078) (xy 139.479731 214.910085) (xy 139.385903 215.085625) (xy 139.328121 215.276104) - (xy 139.308611 215.4742) (xy 113.17 215.4742) (xy 113.17 202.306092) (xy 113.170597 202.293938) - (xy 113.188018 202.117056) (xy 113.192757 202.093232) (xy 113.242577 201.928994) (xy 113.251875 201.906549) - (xy 113.332775 201.755195) (xy 113.346272 201.734995) (xy 113.455149 201.602328) (xy 113.472328 201.585149) - (xy 113.604995 201.476272) (xy 113.625195 201.462775) (xy 113.776549 201.381875) (xy 113.798994 201.372577) - (xy 113.963232 201.322757) (xy 113.987056 201.318018) (xy 114.163939 201.300597) (xy 114.176093 201.3) + (xy 134.606113 211.2555) (xy 147.393887 211.2555) (xy 147.393907 211.2555) (xy 147.406442 211.255192) + (xy 147.418596 211.254595) (xy 147.431105 211.253673) (xy 147.607978 211.236252) (xy 147.632777 211.232573) + (xy 147.656618 211.227831) (xy 147.680942 211.221738) (xy 147.845165 211.171922) (xy 147.857021 211.167679) + (xy 147.926772 211.163627) (xy 147.977355 211.188489) (xy 148.09695 211.286418) (xy 148.114172 211.303605) + (xy 148.116281 211.30617) (xy 148.143653 211.370455) (xy 148.1445 211.384923) (xy 148.1445 213.193907) + (xy 148.144723 213.202984) (xy 148.144808 213.20645) (xy 148.145406 213.218618) (xy 148.146325 213.231086) + (xy 148.163745 213.407958) (xy 148.163751 213.408009) (xy 148.167421 213.432756) (xy 148.167427 213.432785) + (xy 148.172169 213.456627) (xy 148.178249 213.480899) (xy 148.178256 213.480927) (xy 148.178259 213.480936) + (xy 148.228077 213.645165) (xy 148.228079 213.645171) (xy 148.236523 213.668772) (xy 148.236524 213.668775) + (xy 148.245826 213.691231) (xy 148.25655 213.713905) (xy 148.256557 213.713919) (xy 148.33743 213.86522) + (xy 148.337456 213.865267) (xy 148.350331 213.886747) (xy 148.363807 213.906917) (xy 148.363853 213.906982) + (xy 148.375595 213.922813) (xy 148.399722 213.988385) (xy 148.4 213.996683) (xy 148.4 218.392438) + (xy 148.399402 218.404603) (xy 148.381949 218.581639) (xy 148.377198 218.605502) (xy 148.32729 218.769865) + (xy 148.31797 218.79234) (xy 148.236933 218.943782) (xy 148.223405 218.964005) (xy 148.114351 219.096714) + (xy 148.097134 219.113906) (xy 147.964265 219.222767) (xy 147.944024 219.236265) (xy 147.792453 219.317086) + (xy 147.769966 219.326371) (xy 147.605537 219.376036) (xy 147.581668 219.380752) (xy 147.404612 219.397946) + (xy 147.392446 219.398527) (xy 141.458231 219.38985) (xy 141.39122 219.370067) (xy 141.345542 219.317196) + (xy 141.336907 219.264966) (xy 141.3345 219.264966) (xy 141.3345 217.689523) (xy 141.334499 217.689521) + (xy 141.319967 217.616464) (xy 141.319966 217.61646) (xy 141.264601 217.533599) (xy 141.209235 217.496605) + (xy 141.181739 217.478233) (xy 141.181735 217.478232) (xy 141.108677 217.4637) (xy 141.108674 217.4637) + (xy 139.539326 217.4637) (xy 139.539323 217.4637) (xy 139.466264 217.478232) (xy 139.46626 217.478233) + (xy 139.383399 217.533599) (xy 139.328033 217.61646) (xy 139.328032 217.616464) (xy 139.3135 217.689521) + (xy 139.3135 219.262533) (xy 139.293815 219.329572) (xy 139.241011 219.375327) (xy 139.189319 219.386533) + (xy 138.14574 219.385008) (xy 138.078729 219.365225) (xy 138.033051 219.312355) (xy 138.023209 219.243182) + (xy 138.050068 219.182343) (xy 138.168264 219.038321) (xy 138.168268 219.038314) (xy 138.262097 218.862773) + (xy 138.319879 218.672293) (xy 138.339389 218.4742) (xy 138.319879 218.276107) (xy 138.262097 218.085627) + (xy 138.168265 217.91008) (xy 138.168264 217.910078) (xy 138.041988 217.756211) (xy 137.888121 217.629935) + (xy 137.888114 217.629931) (xy 137.712574 217.536103) (xy 137.522095 217.478321) (xy 137.324 217.458811) + (xy 137.125904 217.478321) (xy 136.935425 217.536103) (xy 136.759885 217.629931) (xy 136.759878 217.629935) + (xy 136.606011 217.756211) (xy 136.479735 217.910078) (xy 136.479731 217.910085) (xy 136.385903 218.085625) + (xy 136.328121 218.276104) (xy 136.308611 218.4742) (xy 136.328121 218.672295) (xy 136.385903 218.862774) + (xy 136.479731 219.038314) (xy 136.479735 219.038321) (xy 136.595957 219.179937) (xy 136.62327 219.244247) + (xy 136.611479 219.313115) (xy 136.564327 219.364675) (xy 136.499923 219.382602) (xy 115.201847 219.351464) + (xy 115.189727 219.350852) (xy 115.013351 219.333268) (xy 114.989577 219.328516) (xy 114.825836 219.278726) + (xy 114.803442 219.26944) (xy 114.65251 219.188737) (xy 114.632352 219.175271) (xy 114.500013 219.06675) + (xy 114.482859 219.049619) (xy 114.412466 218.964005) (xy 114.374159 218.917415) (xy 114.36067 218.89728) + (xy 114.279767 218.746445) (xy 114.270458 218.724078) (xy 114.220448 218.560387) (xy 114.215668 218.536633) + (xy 114.197852 218.360273) (xy 114.197225 218.348157) (xy 114.189264 215.4742) (xy 139.308611 215.4742) + (xy 139.328121 215.672295) (xy 139.385903 215.862774) (xy 139.479731 216.038314) (xy 139.479735 216.038321) + (xy 139.606011 216.192188) (xy 139.759878 216.318464) (xy 139.759885 216.318468) (xy 139.935425 216.412296) + (xy 139.935427 216.412297) (xy 140.125907 216.470079) (xy 140.324 216.489589) (xy 140.522093 216.470079) + (xy 140.712573 216.412297) (xy 140.88812 216.318465) (xy 141.041988 216.192188) (xy 141.168265 216.03832) + (xy 141.262097 215.862773) (xy 141.319879 215.672293) (xy 141.339389 215.4742) (xy 141.319879 215.276107) + (xy 141.262097 215.085627) (xy 141.168265 214.91008) (xy 141.168264 214.910078) (xy 141.041988 214.756211) + (xy 140.888121 214.629935) (xy 140.888114 214.629931) (xy 140.712574 214.536103) (xy 140.522095 214.478321) + (xy 140.324 214.458811) (xy 140.125904 214.478321) (xy 139.935425 214.536103) (xy 139.759885 214.629931) + (xy 139.759878 214.629935) (xy 139.606011 214.756211) (xy 139.479735 214.910078) (xy 139.479731 214.910085) + (xy 139.385903 215.085625) (xy 139.328121 215.276104) (xy 139.308611 215.4742) (xy 114.189264 215.4742) + (xy 114.152847 202.327853) (xy 114.15375 202.312581) (xy 114.155278 202.3) (xy 114.155277 202.299997) + (xy 114.155278 202.299995) (xy 114.155278 202.292497) (xy 114.15552 202.292497) (xy 114.155314 202.276316) + (xy 114.170352 202.119456) (xy 114.175042 202.095576) (xy 114.224577 201.930945) (xy 114.233844 201.908443) + (xy 114.314601 201.756662) (xy 114.328083 201.736409) (xy 114.436944 201.603338) (xy 114.45413 201.586104) + (xy 114.586893 201.476879) (xy 114.60712 201.463333) (xy 114.758676 201.382157) (xy 114.781148 201.37283) + (xy 114.945646 201.322837) (xy 114.969511 201.318081) (xy 115.146703 201.300599) (xy 115.158878 201.3) (xy 121.943907 201.3) ) ) @@ -163095,27 +167509,32 @@ (xy 267.754824 185.228079) (xy 267.731222 185.236524) (xy 267.731204 185.236531) (xy 267.708781 185.24582) (xy 267.708773 185.245823) (xy 267.686107 185.256543) (xy 267.534765 185.337437) (xy 267.513236 185.350341) (xy 267.49306 185.363822) (xy 267.493034 185.36384) (xy 267.472909 185.378766) (xy 267.472894 185.378779) - (xy 267.447036 185.4) (xy 267.2 185.4) (xy 267.2 185.479585) (xy 264.216959 185.479585) (xy 264.14992 185.4599) - (xy 264.104165 185.407096) (xy 264.094221 185.337938) (xy 264.100682 185.314384) (xy 264.116022 185.237263) - (xy 264.116023 185.237261) (xy 264.116023 184.437908) (xy 264.116022 184.437906) (xy 264.10149 184.364849) - (xy 264.101489 184.364845) (xy 264.099259 184.361508) (xy 264.046124 184.281984) (xy 263.963263 184.226619) - (xy 263.963262 184.226618) (xy 263.963258 184.226617) (xy 263.8902 184.212085) (xy 263.890197 184.212085) - (xy 263.165849 184.212085) (xy 263.165846 184.212085) (xy 263.092787 184.226617) (xy 263.092783 184.226618) - (xy 263.009922 184.281984) (xy 262.954556 184.364845) (xy 262.954555 184.364849) (xy 262.940023 184.437906) - (xy 262.940023 184.577577) (xy 262.920338 184.644616) (xy 262.903704 184.665258) (xy 262.269438 185.299525) - (xy 262.199526 185.369436) (xy 262.153204 185.449669) (xy 262.15009 185.455062) (xy 262.14794 185.463085) - (xy 262.1248 185.549448) (xy 262.12479 185.549484) (xy 262.1245 185.550565) (xy 262.1245 187.676) - (xy 262.104815 187.743039) (xy 262.052011 187.788794) (xy 262.0005 187.8) (xy 258.7 187.8) (xy 258.7 183.152961) - (xy 258.721226 183.127098) (xy 258.736164 183.106957) (xy 258.749669 183.086745) (xy 258.762558 183.06524) - (xy 258.843452 182.913898) (xy 258.85417 182.891237) (xy 258.863473 182.868779) (xy 258.871922 182.845165) - (xy 258.921738 182.680942) (xy 258.927831 182.656618) (xy 258.932573 182.632777) (xy 258.936252 182.607978) - (xy 258.953673 182.431105) (xy 258.954595 182.418596) (xy 258.955192 182.406442) (xy 258.9555 182.393907) - (xy 258.9555 179.082824) (xy 258.975185 179.015785) (xy 258.983628 179.004182) (xy 258.985131 179.00235) - (xy 259.002367 178.985117) (xy 259.00304 178.984564) (xy 259.004198 178.983616) (xy 259.068519 178.956328) - (xy 259.082825 178.9555) (xy 262.803523 178.9555) (xy 262.857836 178.949661) (xy 262.909347 178.938455) - (xy 262.935721 178.931219) (xy 262.964597 178.914775) (xy 263.022341 178.881894) (xy 263.022342 178.881892) - (xy 263.022351 178.881888) (xy 263.075155 178.836133) (xy 263.10678 178.803359) (xy 263.126048 178.766523) - (xy 263.174564 178.716245) (xy 263.235923 178.7) (xy 267.343039 178.7) + (xy 267.384359 185.451438) (xy 267.320049 185.478751) (xy 267.305694 185.479585) (xy 264.216959 185.479585) + (xy 264.14992 185.4599) (xy 264.104165 185.407096) (xy 264.094221 185.337938) (xy 264.100682 185.314384) + (xy 264.116022 185.237263) (xy 264.116023 185.237261) (xy 264.116023 184.437908) (xy 264.116022 184.437906) + (xy 264.10149 184.364849) (xy 264.101489 184.364845) (xy 264.099259 184.361508) (xy 264.046124 184.281984) + (xy 263.963263 184.226619) (xy 263.963262 184.226618) (xy 263.963258 184.226617) (xy 263.8902 184.212085) + (xy 263.890197 184.212085) (xy 263.165849 184.212085) (xy 263.165846 184.212085) (xy 263.092787 184.226617) + (xy 263.092783 184.226618) (xy 263.009922 184.281984) (xy 262.954556 184.364845) (xy 262.954555 184.364849) + (xy 262.940023 184.437906) (xy 262.940023 184.577577) (xy 262.920338 184.644616) (xy 262.903704 184.665258) + (xy 262.269438 185.299525) (xy 262.199526 185.369436) (xy 262.153204 185.449669) (xy 262.15009 185.455062) + (xy 262.14794 185.463085) (xy 262.1248 185.549448) (xy 262.12479 185.549484) (xy 262.1245 185.550565) + (xy 262.1245 187.676) (xy 262.104815 187.743039) (xy 262.052011 187.788794) (xy 262.0005 187.8) + (xy 259.7 187.8) (xy 258.7 187.8) (xy 258.7 183.152961) (xy 258.721226 183.127098) (xy 258.736164 183.106957) + (xy 258.749669 183.086745) (xy 258.762558 183.06524) (xy 258.843452 182.913898) (xy 258.85417 182.891237) + (xy 258.863473 182.868779) (xy 258.871922 182.845165) (xy 258.921738 182.680942) (xy 258.927831 182.656618) + (xy 258.932573 182.632777) (xy 258.936252 182.607978) (xy 258.953673 182.431105) (xy 258.954595 182.418596) + (xy 258.955192 182.406442) (xy 258.9555 182.393907) (xy 258.9555 179.718647) (xy 258.956097 179.706494) + (xy 258.96982 179.567148) (xy 258.97456 179.543314) (xy 259.009774 179.42723) (xy 259.019064 179.404801) + (xy 259.076242 179.297829) (xy 259.089743 179.277626) (xy 259.166682 179.183873) (xy 259.183873 179.166682) + (xy 259.277626 179.089743) (xy 259.297829 179.076242) (xy 259.404798 179.019066) (xy 259.427236 179.009772) + (xy 259.468318 178.997311) (xy 259.468317 178.99731) (xy 259.470503 178.996646) (xy 259.535505 178.97693) + (xy 259.535534 178.97692) (xy 259.543303 178.974563) (xy 259.567142 178.96982) (xy 259.676886 178.959013) + (xy 259.676888 178.959013) (xy 259.696845 178.957047) (xy 259.706499 178.956097) (xy 259.718648 178.9555) + (xy 262.803523 178.9555) (xy 262.857836 178.949661) (xy 262.909347 178.938455) (xy 262.935721 178.931219) + (xy 262.964597 178.914775) (xy 263.022341 178.881894) (xy 263.022342 178.881892) (xy 263.022351 178.881888) + (xy 263.075155 178.836133) (xy 263.10678 178.803359) (xy 263.126048 178.766523) (xy 263.174564 178.716245) + (xy 263.235923 178.7) (xy 267.343039 178.7) ) ) ) @@ -163150,68 +167569,77 @@ (xy 197.993453 70.981877) (xy 198.144798 71.062772) (xy 198.16501 71.076277) (xy 198.297666 71.185145) (xy 198.314854 71.202333) (xy 198.423722 71.334989) (xy 198.437227 71.355201) (xy 198.518121 71.506543) (xy 198.527424 71.529001) (xy 198.57724 71.693224) (xy 198.581982 71.717065) (xy 198.599403 71.893938) - (xy 198.6 71.906092) (xy 198.6 76.6) (xy 202.823694 76.6) (xy 202.847887 76.602383) (xy 202.881865 76.609142) - (xy 202.881866 76.609142) (xy 203.438415 76.609142) (xy 203.472393 76.602383) (xy 203.496586 76.6) - (xy 204.093694 76.6) (xy 204.117887 76.602383) (xy 204.151865 76.609142) (xy 204.151866 76.609142) - (xy 204.708415 76.609142) (xy 204.742393 76.602383) (xy 204.766586 76.6) (xy 205.363694 76.6) (xy 205.387887 76.602383) - (xy 205.421865 76.609142) (xy 205.421866 76.609142) (xy 205.978415 76.609142) (xy 206.012393 76.602383) - (xy 206.036586 76.6) (xy 206.633694 76.6) (xy 206.657887 76.602383) (xy 206.691865 76.609142) (xy 206.691866 76.609142) - (xy 207.248415 76.609142) (xy 207.282393 76.602383) (xy 207.306586 76.6) (xy 207.903694 76.6) (xy 207.927887 76.602383) - (xy 207.961865 76.609142) (xy 207.961866 76.609142) (xy 208.518415 76.609142) (xy 208.552393 76.602383) - (xy 208.576586 76.6) (xy 209.173694 76.6) (xy 209.197887 76.602383) (xy 209.231865 76.609142) (xy 209.231866 76.609142) - (xy 209.788415 76.609142) (xy 209.822393 76.602383) (xy 209.846586 76.6) (xy 210.443694 76.6) (xy 210.467887 76.602383) - (xy 210.501865 76.609142) (xy 210.501866 76.609142) (xy 211.058415 76.609142) (xy 211.092393 76.602383) - (xy 211.116586 76.6) (xy 211.293907 76.6) (xy 211.306061 76.600597) (xy 211.482941 76.618018) (xy 211.506769 76.622757) - (xy 211.671001 76.672576) (xy 211.693453 76.681877) (xy 211.844798 76.762772) (xy 211.86501 76.776277) - (xy 211.997666 76.885145) (xy 212.014854 76.902333) (xy 212.123722 77.034989) (xy 212.137227 77.055201) - (xy 212.218121 77.206543) (xy 212.227424 77.229001) (xy 212.27724 77.393224) (xy 212.281982 77.417065) - (xy 212.299403 77.593938) (xy 212.3 77.606092) (xy 212.3 79.093907) (xy 212.299403 79.106061) (xy 212.281982 79.282934) - (xy 212.27724 79.306775) (xy 212.227424 79.470998) (xy 212.218121 79.493456) (xy 212.137227 79.644798) - (xy 212.123722 79.66501) (xy 212.014855 79.797665) (xy 211.997686 79.814837) (xy 211.995859 79.816337) - (xy 211.931555 79.843663) (xy 211.917175 79.8445) (xy 211.391222 79.8445) (xy 211.390334 79.844511) - (xy 211.384325 79.844592) (xy 211.377741 79.844768) (xy 211.299589 79.85923) (xy 211.299583 79.859231) - (xy 211.299583 79.859232) (xy 211.245647 79.87826) (xy 211.233682 79.882481) (xy 211.19227 79.901393) - (xy 211.192258 79.901401) (xy 211.116927 79.966676) (xy 211.116923 79.96668) (xy 211.074059 80.021858) - (xy 211.066795 80.033161) (xy 211.063054 80.038982) (xy 211.010252 80.084736) (xy 210.95874 80.095942) - (xy 210.598719 80.095942) (xy 210.53168 80.076257) (xy 210.490965 80.033302) (xy 210.474949 80.005177) - (xy 210.474948 80.005176) (xy 210.474946 80.005172) (xy 210.441589 79.966676) (xy 210.429194 79.952371) - (xy 210.412776 79.936529) (xy 210.396417 79.920743) (xy 210.308082 79.874535) (xy 210.308081 79.874534) - (xy 210.30808 79.874534) (xy 210.30808 79.874533) (xy 210.241048 79.854851) (xy 210.241036 79.854848) - (xy 210.169059 79.8445) (xy 210.169058 79.8445) (xy 210.121222 79.8445) (xy 210.120334 79.844511) - (xy 210.114325 79.844592) (xy 210.107741 79.844768) (xy 210.029589 79.85923) (xy 210.029583 79.859231) - (xy 210.029583 79.859232) (xy 209.975647 79.87826) (xy 209.963682 79.882481) (xy 209.92227 79.901393) - (xy 209.922258 79.901401) (xy 209.846927 79.966676) (xy 209.846923 79.96668) (xy 209.804059 80.021858) - (xy 209.796795 80.033161) (xy 209.793054 80.038982) (xy 209.740252 80.084736) (xy 209.68874 80.095942) - (xy 209.328719 80.095942) (xy 209.26168 80.076257) (xy 209.220965 80.033302) (xy 209.204949 80.005177) - (xy 209.204948 80.005176) (xy 209.204946 80.005172) (xy 209.171589 79.966676) (xy 209.159194 79.952371) - (xy 209.142776 79.936529) (xy 209.126417 79.920743) (xy 209.038082 79.874535) (xy 209.038081 79.874534) - (xy 209.03808 79.874534) (xy 209.03808 79.874533) (xy 208.971048 79.854851) (xy 208.971036 79.854848) - (xy 208.899059 79.8445) (xy 208.899058 79.8445) (xy 205.041222 79.8445) (xy 205.040334 79.844511) - (xy 205.034325 79.844592) (xy 205.027741 79.844768) (xy 204.949589 79.85923) (xy 204.949583 79.859231) - (xy 204.949583 79.859232) (xy 204.895647 79.87826) (xy 204.883682 79.882481) (xy 204.84227 79.901393) - (xy 204.842258 79.901401) (xy 204.766927 79.966676) (xy 204.766923 79.96668) (xy 204.724059 80.021858) - (xy 204.716795 80.033161) (xy 204.713054 80.038982) (xy 204.660252 80.084736) (xy 204.60874 80.095942) - (xy 204.248719 80.095942) (xy 204.18168 80.076257) (xy 204.140965 80.033302) (xy 204.124949 80.005177) - (xy 204.124948 80.005176) (xy 204.124946 80.005172) (xy 204.091589 79.966676) (xy 204.079194 79.952371) - (xy 204.062776 79.936529) (xy 204.046417 79.920743) (xy 203.958082 79.874535) (xy 203.958081 79.874534) - (xy 203.95808 79.874534) (xy 203.95808 79.874533) (xy 203.891048 79.854851) (xy 203.891036 79.854848) - (xy 203.819059 79.8445) (xy 203.819058 79.8445) (xy 203.771222 79.8445) (xy 203.770334 79.844511) - (xy 203.764325 79.844592) (xy 203.757741 79.844768) (xy 203.679589 79.85923) (xy 203.679583 79.859231) - (xy 203.679583 79.859232) (xy 203.625647 79.87826) (xy 203.613682 79.882481) (xy 203.57227 79.901393) - (xy 203.572258 79.901401) (xy 203.496927 79.966676) (xy 203.496923 79.96668) (xy 203.454059 80.021858) - (xy 203.446795 80.033161) (xy 203.443054 80.038982) (xy 203.390252 80.084736) (xy 203.33874 80.095942) - (xy 202.978719 80.095942) (xy 202.91168 80.076257) (xy 202.870965 80.033302) (xy 202.854949 80.005177) - (xy 202.854948 80.005176) (xy 202.854946 80.005172) (xy 202.821589 79.966676) (xy 202.809194 79.952371) - (xy 202.792776 79.936529) (xy 202.776417 79.920743) (xy 202.688082 79.874535) (xy 202.688081 79.874534) - (xy 202.68808 79.874534) (xy 202.68808 79.874533) (xy 202.621048 79.854851) (xy 202.621036 79.854848) - (xy 202.549059 79.8445) (xy 202.549058 79.8445) (xy 200.606093 79.8445) (xy 200.597448 79.844712) - (xy 200.593549 79.844808) (xy 200.581381 79.845406) (xy 200.568909 79.846326) (xy 200.568907 79.846326) - (xy 200.568896 79.846327) (xy 200.513901 79.851743) (xy 200.392027 79.863746) (xy 200.392 79.863749) - (xy 200.367214 79.867427) (xy 200.367212 79.867427) (xy 200.343392 79.872165) (xy 200.343382 79.872167) - (xy 200.319079 79.878254) (xy 200.319057 79.87826) (xy 200.154824 79.928079) (xy 200.131222 79.936524) - (xy 200.131204 79.936531) (xy 200.108781 79.94582) (xy 200.108773 79.945823) (xy 200.086107 79.956543) - (xy 199.934765 80.037437) (xy 199.913236 80.050341) (xy 199.89306 80.063822) (xy 199.893027 80.063846) - (xy 199.87718 80.075599) (xy 199.811608 80.099722) (xy 199.803315 80.1) (xy 195.5 80.1) (xy 195.5 81.1) + (xy 198.6 71.906092) (xy 198.6 75.599996) (xy 198.619214 75.795088) (xy 198.619215 75.79509) (xy 198.67612 75.982683) + (xy 198.676121 75.982686) (xy 198.676122 75.982687) (xy 198.676123 75.98269) (xy 198.768526 76.155564) + (xy 198.768531 76.155571) (xy 198.892892 76.307107) (xy 198.998344 76.393648) (xy 199.04443 76.43147) + (xy 199.044433 76.431471) (xy 199.044435 76.431473) (xy 199.217309 76.523876) (xy 199.21731 76.523876) + (xy 199.217317 76.52388) (xy 199.40491 76.580785) (xy 199.404909 76.580785) (xy 199.453682 76.585588) + (xy 199.6 76.6) (xy 202.823694 76.6) (xy 202.847887 76.602383) (xy 202.881865 76.609142) (xy 202.881866 76.609142) + (xy 203.438415 76.609142) (xy 203.472393 76.602383) (xy 203.496586 76.6) (xy 204.093694 76.6) (xy 204.117887 76.602383) + (xy 204.151865 76.609142) (xy 204.151866 76.609142) (xy 204.708415 76.609142) (xy 204.742393 76.602383) + (xy 204.766586 76.6) (xy 205.363694 76.6) (xy 205.387887 76.602383) (xy 205.421865 76.609142) (xy 205.421866 76.609142) + (xy 205.978415 76.609142) (xy 206.012393 76.602383) (xy 206.036586 76.6) (xy 206.633694 76.6) (xy 206.657887 76.602383) + (xy 206.691865 76.609142) (xy 206.691866 76.609142) (xy 207.248415 76.609142) (xy 207.282393 76.602383) + (xy 207.306586 76.6) (xy 207.903694 76.6) (xy 207.927887 76.602383) (xy 207.961865 76.609142) (xy 207.961866 76.609142) + (xy 208.518415 76.609142) (xy 208.552393 76.602383) (xy 208.576586 76.6) (xy 209.173694 76.6) (xy 209.197887 76.602383) + (xy 209.231865 76.609142) (xy 209.231866 76.609142) (xy 209.788415 76.609142) (xy 209.822393 76.602383) + (xy 209.846586 76.6) (xy 210.443694 76.6) (xy 210.467887 76.602383) (xy 210.501865 76.609142) (xy 210.501866 76.609142) + (xy 211.058415 76.609142) (xy 211.092393 76.602383) (xy 211.116586 76.6) (xy 211.293907 76.6) (xy 211.306061 76.600597) + (xy 211.482941 76.618018) (xy 211.506769 76.622757) (xy 211.671001 76.672576) (xy 211.693453 76.681877) + (xy 211.844798 76.762772) (xy 211.86501 76.776277) (xy 211.997666 76.885145) (xy 212.014854 76.902333) + (xy 212.123722 77.034989) (xy 212.137227 77.055201) (xy 212.218121 77.206543) (xy 212.227424 77.229001) + (xy 212.27724 77.393224) (xy 212.281982 77.417065) (xy 212.299403 77.593938) (xy 212.3 77.606092) + (xy 212.3 79.093907) (xy 212.299403 79.106061) (xy 212.281982 79.282934) (xy 212.27724 79.306775) + (xy 212.227424 79.470998) (xy 212.218121 79.493456) (xy 212.137227 79.644798) (xy 212.123722 79.66501) + (xy 212.014855 79.797665) (xy 211.997686 79.814837) (xy 211.995859 79.816337) (xy 211.931555 79.843663) + (xy 211.917175 79.8445) (xy 211.391222 79.8445) (xy 211.390334 79.844511) (xy 211.384325 79.844592) + (xy 211.377741 79.844768) (xy 211.299589 79.85923) (xy 211.299583 79.859231) (xy 211.299583 79.859232) + (xy 211.245647 79.87826) (xy 211.233682 79.882481) (xy 211.19227 79.901393) (xy 211.192258 79.901401) + (xy 211.116927 79.966676) (xy 211.116923 79.96668) (xy 211.074059 80.021858) (xy 211.066795 80.033161) + (xy 211.063054 80.038982) (xy 211.010252 80.084736) (xy 210.95874 80.095942) (xy 210.598719 80.095942) + (xy 210.53168 80.076257) (xy 210.490965 80.033302) (xy 210.474949 80.005177) (xy 210.474948 80.005176) + (xy 210.474946 80.005172) (xy 210.441589 79.966676) (xy 210.429194 79.952371) (xy 210.412776 79.936529) + (xy 210.396417 79.920743) (xy 210.308082 79.874535) (xy 210.308081 79.874534) (xy 210.30808 79.874534) + (xy 210.30808 79.874533) (xy 210.241048 79.854851) (xy 210.241036 79.854848) (xy 210.169059 79.8445) + (xy 210.169058 79.8445) (xy 210.121222 79.8445) (xy 210.120334 79.844511) (xy 210.114325 79.844592) + (xy 210.107741 79.844768) (xy 210.029589 79.85923) (xy 210.029583 79.859231) (xy 210.029583 79.859232) + (xy 209.975647 79.87826) (xy 209.963682 79.882481) (xy 209.92227 79.901393) (xy 209.922258 79.901401) + (xy 209.846927 79.966676) (xy 209.846923 79.96668) (xy 209.804059 80.021858) (xy 209.796795 80.033161) + (xy 209.793054 80.038982) (xy 209.740252 80.084736) (xy 209.68874 80.095942) (xy 209.328719 80.095942) + (xy 209.26168 80.076257) (xy 209.220965 80.033302) (xy 209.204949 80.005177) (xy 209.204948 80.005176) + (xy 209.204946 80.005172) (xy 209.171589 79.966676) (xy 209.159194 79.952371) (xy 209.142776 79.936529) + (xy 209.126417 79.920743) (xy 209.038082 79.874535) (xy 209.038081 79.874534) (xy 209.03808 79.874534) + (xy 209.03808 79.874533) (xy 208.971048 79.854851) (xy 208.971036 79.854848) (xy 208.899059 79.8445) + (xy 208.899058 79.8445) (xy 205.041222 79.8445) (xy 205.040334 79.844511) (xy 205.034325 79.844592) + (xy 205.027741 79.844768) (xy 204.949589 79.85923) (xy 204.949583 79.859231) (xy 204.949583 79.859232) + (xy 204.895647 79.87826) (xy 204.883682 79.882481) (xy 204.84227 79.901393) (xy 204.842258 79.901401) + (xy 204.766927 79.966676) (xy 204.766923 79.96668) (xy 204.724059 80.021858) (xy 204.716795 80.033161) + (xy 204.713054 80.038982) (xy 204.660252 80.084736) (xy 204.60874 80.095942) (xy 204.248719 80.095942) + (xy 204.18168 80.076257) (xy 204.140965 80.033302) (xy 204.124949 80.005177) (xy 204.124948 80.005176) + (xy 204.124946 80.005172) (xy 204.091589 79.966676) (xy 204.079194 79.952371) (xy 204.062776 79.936529) + (xy 204.046417 79.920743) (xy 203.958082 79.874535) (xy 203.958081 79.874534) (xy 203.95808 79.874534) + (xy 203.95808 79.874533) (xy 203.891048 79.854851) (xy 203.891036 79.854848) (xy 203.819059 79.8445) + (xy 203.819058 79.8445) (xy 203.771222 79.8445) (xy 203.770334 79.844511) (xy 203.764325 79.844592) + (xy 203.757741 79.844768) (xy 203.679589 79.85923) (xy 203.679583 79.859231) (xy 203.679583 79.859232) + (xy 203.625647 79.87826) (xy 203.613682 79.882481) (xy 203.57227 79.901393) (xy 203.572258 79.901401) + (xy 203.496927 79.966676) (xy 203.496923 79.96668) (xy 203.454059 80.021858) (xy 203.446795 80.033161) + (xy 203.443054 80.038982) (xy 203.390252 80.084736) (xy 203.33874 80.095942) (xy 202.978719 80.095942) + (xy 202.91168 80.076257) (xy 202.870965 80.033302) (xy 202.854949 80.005177) (xy 202.854948 80.005176) + (xy 202.854946 80.005172) (xy 202.821589 79.966676) (xy 202.809194 79.952371) (xy 202.792776 79.936529) + (xy 202.776417 79.920743) (xy 202.688082 79.874535) (xy 202.688081 79.874534) (xy 202.68808 79.874534) + (xy 202.68808 79.874533) (xy 202.621048 79.854851) (xy 202.621036 79.854848) (xy 202.549059 79.8445) + (xy 202.549058 79.8445) (xy 200.606093 79.8445) (xy 200.597448 79.844712) (xy 200.593549 79.844808) + (xy 200.581381 79.845406) (xy 200.568909 79.846326) (xy 200.568907 79.846326) (xy 200.568896 79.846327) + (xy 200.513901 79.851743) (xy 200.392027 79.863746) (xy 200.392 79.863749) (xy 200.367214 79.867427) + (xy 200.367212 79.867427) (xy 200.343392 79.872165) (xy 200.343382 79.872167) (xy 200.319079 79.878254) + (xy 200.319057 79.87826) (xy 200.154824 79.928079) (xy 200.131222 79.936524) (xy 200.131204 79.936531) + (xy 200.108781 79.94582) (xy 200.108773 79.945823) (xy 200.086107 79.956543) (xy 199.934765 80.037437) + (xy 199.913236 80.050341) (xy 199.89306 80.063822) (xy 199.893027 80.063846) (xy 199.87718 80.075599) + (xy 199.811608 80.099722) (xy 199.803315 80.1) (xy 196.5 80.1) (xy 196.451844 80.104743) (xy 196.304911 80.119214) + (xy 196.194149 80.152813) (xy 196.117317 80.17612) (xy 196.117314 80.176121) (xy 196.117312 80.176122) + (xy 196.117309 80.176123) (xy 195.944435 80.268526) (xy 195.944428 80.268531) (xy 195.792892 80.392892) + (xy 195.668531 80.544428) (xy 195.668526 80.544435) (xy 195.576123 80.717309) (xy 195.576122 80.717312) + (xy 195.576121 80.717314) (xy 195.57612 80.717317) (xy 195.552813 80.794149) (xy 195.519214 80.904911) (xy 195.5 81.100003) (xy 195.5 84.893907) (xy 195.499403 84.906061) (xy 195.481982 85.082934) (xy 195.47724 85.106775) (xy 195.427424 85.270998) (xy 195.418121 85.293456) (xy 195.337227 85.444798) (xy 195.323722 85.46501) (xy 195.214855 85.597665) (xy 195.197686 85.614837) (xy 195.195859 85.616337) (xy 195.131555 85.643663) @@ -163450,34 +167878,35 @@ (filled_polygon (layer "In1.Cu") (pts - (xy 138.2 198.6) (xy 136.7 198.6) (xy 136.7 200.8) (xy 127.5 200.8) (xy 127.5 189.769998) (xy 129.429318 189.769998) - (xy 129.429318 189.770001) (xy 129.449955 189.92676) (xy 129.449956 189.926762) (xy 129.510464 190.072841) - (xy 129.606718 190.198282) (xy 129.732159 190.294536) (xy 129.878238 190.355044) (xy 129.956619 190.365363) - (xy 130.034999 190.375682) (xy 130.035 190.375682) (xy 130.174492 190.357317) (xy 130.243523 190.368082) - (xy 130.295779 190.414462) (xy 130.314665 190.481731) (xy 130.305235 190.527708) (xy 130.244957 190.673234) - (xy 130.244955 190.673239) (xy 130.224318 190.829998) (xy 130.224318 190.830001) (xy 130.244955 190.98676) - (xy 130.244956 190.986762) (xy 130.305464 191.132841) (xy 130.401718 191.258282) (xy 130.527159 191.354536) - (xy 130.673238 191.415044) (xy 130.751619 191.425363) (xy 130.829999 191.435682) (xy 130.83 191.435682) - (xy 130.830001 191.435682) (xy 130.882254 191.428802) (xy 130.986762 191.415044) (xy 131.132841 191.354536) - (xy 131.258282 191.258282) (xy 131.354536 191.132841) (xy 131.415044 190.986762) (xy 131.435682 190.83) - (xy 131.415044 190.673238) (xy 131.354536 190.527159) (xy 131.258282 190.401718) (xy 131.132841 190.305464) - (xy 130.986762 190.244956) (xy 130.98676 190.244955) (xy 130.830001 190.224318) (xy 130.829999 190.224318) - (xy 130.69051 190.242682) (xy 130.621475 190.231916) (xy 130.569219 190.185536) (xy 130.550334 190.118267) - (xy 130.559764 190.07229) (xy 130.620044 189.926762) (xy 130.640682 189.77) (xy 130.620044 189.613238) - (xy 130.559536 189.467159) (xy 130.463282 189.341718) (xy 130.337841 189.245464) (xy 130.191762 189.184956) - (xy 130.19176 189.184955) (xy 130.035001 189.164318) (xy 130.034999 189.164318) (xy 129.878239 189.184955) - (xy 129.878237 189.184956) (xy 129.73216 189.245463) (xy 129.606718 189.341718) (xy 129.510463 189.46716) - (xy 129.449956 189.613237) (xy 129.449955 189.613239) (xy 129.429318 189.769998) (xy 127.5 189.769998) - (xy 127.5 189.044998) (xy 136.604318 189.044998) (xy 136.604318 189.045001) (xy 136.624955 189.20176) - (xy 136.624956 189.201762) (xy 136.685464 189.347841) (xy 136.781718 189.473282) (xy 136.907159 189.569536) - (xy 137.053238 189.630044) (xy 137.131619 189.640363) (xy 137.209999 189.650682) (xy 137.21 189.650682) - (xy 137.210001 189.650682) (xy 137.262254 189.643802) (xy 137.366762 189.630044) (xy 137.512841 189.569536) - (xy 137.638282 189.473282) (xy 137.734536 189.347841) (xy 137.795044 189.201762) (xy 137.815682 189.045) - (xy 137.795044 188.888238) (xy 137.734536 188.742159) (xy 137.638282 188.616718) (xy 137.512841 188.520464) - (xy 137.366762 188.459956) (xy 137.36676 188.459955) (xy 137.210001 188.439318) (xy 137.209999 188.439318) - (xy 137.053239 188.459955) (xy 137.053237 188.459956) (xy 136.90716 188.520463) (xy 136.781718 188.616718) - (xy 136.685463 188.74216) (xy 136.624956 188.888237) (xy 136.624955 188.888239) (xy 136.604318 189.044998) - (xy 127.5 189.044998) (xy 127.5 187.5) (xy 138.2 187.5) + (xy 138.2 198.6) (xy 138 198.6) (xy 136.9 198.6) (xy 136.823463 198.615224) (xy 136.758579 198.658579) + (xy 136.715224 198.723463) (xy 136.7 198.8) (xy 136.7 200.8) (xy 136.5 200.8) (xy 127.7 200.8) (xy 127.5 200.8) + (xy 127.5 189.769998) (xy 129.429318 189.769998) (xy 129.429318 189.770001) (xy 129.449955 189.92676) + (xy 129.449956 189.926762) (xy 129.510464 190.072841) (xy 129.606718 190.198282) (xy 129.732159 190.294536) + (xy 129.878238 190.355044) (xy 129.956619 190.365363) (xy 130.034999 190.375682) (xy 130.035 190.375682) + (xy 130.174492 190.357317) (xy 130.243523 190.368082) (xy 130.295779 190.414462) (xy 130.314665 190.481731) + (xy 130.305235 190.527708) (xy 130.244957 190.673234) (xy 130.244955 190.673239) (xy 130.224318 190.829998) + (xy 130.224318 190.830001) (xy 130.244955 190.98676) (xy 130.244956 190.986762) (xy 130.305464 191.132841) + (xy 130.401718 191.258282) (xy 130.527159 191.354536) (xy 130.673238 191.415044) (xy 130.751619 191.425363) + (xy 130.829999 191.435682) (xy 130.83 191.435682) (xy 130.830001 191.435682) (xy 130.882254 191.428802) + (xy 130.986762 191.415044) (xy 131.132841 191.354536) (xy 131.258282 191.258282) (xy 131.354536 191.132841) + (xy 131.415044 190.986762) (xy 131.435682 190.83) (xy 131.415044 190.673238) (xy 131.354536 190.527159) + (xy 131.258282 190.401718) (xy 131.132841 190.305464) (xy 130.986762 190.244956) (xy 130.98676 190.244955) + (xy 130.830001 190.224318) (xy 130.829999 190.224318) (xy 130.69051 190.242682) (xy 130.621475 190.231916) + (xy 130.569219 190.185536) (xy 130.550334 190.118267) (xy 130.559764 190.07229) (xy 130.620044 189.926762) + (xy 130.640682 189.77) (xy 130.620044 189.613238) (xy 130.559536 189.467159) (xy 130.463282 189.341718) + (xy 130.337841 189.245464) (xy 130.191762 189.184956) (xy 130.19176 189.184955) (xy 130.035001 189.164318) + (xy 130.034999 189.164318) (xy 129.878239 189.184955) (xy 129.878237 189.184956) (xy 129.73216 189.245463) + (xy 129.606718 189.341718) (xy 129.510463 189.46716) (xy 129.449956 189.613237) (xy 129.449955 189.613239) + (xy 129.429318 189.769998) (xy 127.5 189.769998) (xy 127.5 189.044998) (xy 136.604318 189.044998) + (xy 136.604318 189.045001) (xy 136.624955 189.20176) (xy 136.624956 189.201762) (xy 136.685464 189.347841) + (xy 136.781718 189.473282) (xy 136.907159 189.569536) (xy 137.053238 189.630044) (xy 137.131619 189.640363) + (xy 137.209999 189.650682) (xy 137.21 189.650682) (xy 137.210001 189.650682) (xy 137.262254 189.643802) + (xy 137.366762 189.630044) (xy 137.512841 189.569536) (xy 137.638282 189.473282) (xy 137.734536 189.347841) + (xy 137.795044 189.201762) (xy 137.815682 189.045) (xy 137.795044 188.888238) (xy 137.734536 188.742159) + (xy 137.638282 188.616718) (xy 137.512841 188.520464) (xy 137.366762 188.459956) (xy 137.36676 188.459955) + (xy 137.210001 188.439318) (xy 137.209999 188.439318) (xy 137.053239 188.459955) (xy 137.053237 188.459956) + (xy 136.90716 188.520463) (xy 136.781718 188.616718) (xy 136.685463 188.74216) (xy 136.624956 188.888237) + (xy 136.624955 188.888239) (xy 136.604318 189.044998) (xy 127.5 189.044998) (xy 127.5 187.5) (xy 138.2 187.5) ) ) ) @@ -163532,17 +167961,37 @@ (xy 113.07408 233.424394) (xy 112.894163 233.28971) (xy 112.880792 233.278124) (xy 112.721875 233.119207) (xy 112.710289 233.105836) (xy 112.575605 232.925919) (xy 112.56604 232.911036) (xy 112.45833 232.713782) (xy 112.450983 232.697694) (xy 112.372437 232.487103) (xy 112.367458 232.470144) (xy 112.319683 232.250529) - (xy 112.317165 232.233017) (xy 112.300816 232.004418) (xy 112.3005 231.995572) (xy 112.3005 230.799999) - (xy 204.144722 230.799999) (xy 204.144722 230.8) (xy 204.163762 230.956818) (xy 204.195038 231.039284) - (xy 204.21978 231.104523) (xy 204.309517 231.23453) (xy 204.42776 231.339283) (xy 204.427762 231.339284) - (xy 204.567634 231.412696) (xy 204.721014 231.4505) (xy 204.721015 231.4505) (xy 204.878985 231.4505) - (xy 205.032365 231.412696) (xy 205.17224 231.339283) (xy 205.290483 231.23453) (xy 205.38022 231.104523) - (xy 205.436237 230.956818) (xy 205.455278 230.8) (xy 205.455278 230.799999) (xy 214.344722 230.799999) - (xy 214.344722 230.8) (xy 214.363762 230.956818) (xy 214.395038 231.039284) (xy 214.41978 231.104523) + (xy 112.317165 232.233017) (xy 112.303309 232.039283) (xy 112.300816 232.004418) (xy 112.3005 231.995572) + (xy 112.3005 231.499999) (xy 245.544722 231.499999) (xy 245.544722 231.5) (xy 245.563762 231.656818) + (xy 245.595038 231.739284) (xy 245.61978 231.804523) (xy 245.709517 231.93453) (xy 245.82776 232.039283) + (xy 245.827762 232.039284) (xy 245.967634 232.112696) (xy 246.121014 232.1505) (xy 246.121015 232.1505) + (xy 246.278985 232.1505) (xy 246.432365 232.112696) (xy 246.57224 232.039283) (xy 246.690483 231.93453) + (xy 246.78022 231.804523) (xy 246.836237 231.656818) (xy 246.855278 231.5) (xy 246.844678 231.412696) + (xy 246.836237 231.343181) (xy 246.814992 231.287164) (xy 246.781935 231.199999) (xy 264.344722 231.199999) + (xy 264.344722 231.2) (xy 264.363762 231.356818) (xy 264.418064 231.499999) (xy 264.41978 231.504523) + (xy 264.509517 231.63453) (xy 264.62776 231.739283) (xy 264.627762 231.739284) (xy 264.767634 231.812696) + (xy 264.921014 231.8505) (xy 264.921015 231.8505) (xy 265.078985 231.8505) (xy 265.232365 231.812696) + (xy 265.247937 231.804523) (xy 265.37224 231.739283) (xy 265.490483 231.63453) (xy 265.58022 231.504523) + (xy 265.636237 231.356818) (xy 265.655278 231.2) (xy 265.644678 231.112696) (xy 265.636237 231.043181) + (xy 265.604961 230.960715) (xy 265.58022 230.895477) (xy 265.490483 230.76547) (xy 265.37224 230.660717) + (xy 265.372238 230.660716) (xy 265.372237 230.660715) (xy 265.232365 230.587303) (xy 265.078986 230.5495) + (xy 265.078985 230.5495) (xy 264.921015 230.5495) (xy 264.921014 230.5495) (xy 264.767634 230.587303) + (xy 264.627762 230.660715) (xy 264.509516 230.765471) (xy 264.419781 230.895475) (xy 264.41978 230.895476) + (xy 264.363762 231.043181) (xy 264.344722 231.199999) (xy 246.781935 231.199999) (xy 246.78022 231.195477) + (xy 246.690483 231.06547) (xy 246.57224 230.960717) (xy 246.572238 230.960716) (xy 246.572237 230.960715) + (xy 246.432365 230.887303) (xy 246.278986 230.8495) (xy 246.278985 230.8495) (xy 246.121015 230.8495) + (xy 246.121014 230.8495) (xy 245.967634 230.887303) (xy 245.827762 230.960715) (xy 245.709516 231.065471) + (xy 245.619781 231.195475) (xy 245.61978 231.195476) (xy 245.563762 231.343181) (xy 245.544722 231.499999) + (xy 112.3005 231.499999) (xy 112.3005 230.799999) (xy 204.144722 230.799999) (xy 204.144722 230.8) + (xy 204.163762 230.956818) (xy 204.21978 231.104523) (xy 204.309517 231.23453) (xy 204.42776 231.339283) + (xy 204.427762 231.339284) (xy 204.567634 231.412696) (xy 204.721014 231.4505) (xy 204.721015 231.4505) + (xy 204.878985 231.4505) (xy 205.032365 231.412696) (xy 205.17224 231.339283) (xy 205.290483 231.23453) + (xy 205.38022 231.104523) (xy 205.436237 230.956818) (xy 205.455278 230.8) (xy 205.455278 230.799999) + (xy 214.344722 230.799999) (xy 214.344722 230.8) (xy 214.363762 230.956818) (xy 214.41978 231.104523) (xy 214.509517 231.23453) (xy 214.62776 231.339283) (xy 214.627762 231.339284) (xy 214.767634 231.412696) (xy 214.921014 231.4505) (xy 214.921015 231.4505) (xy 215.078985 231.4505) (xy 215.232365 231.412696) (xy 215.37224 231.339283) (xy 215.490483 231.23453) (xy 215.58022 231.104523) (xy 215.636237 230.956818) - (xy 215.655278 230.8) (xy 215.644678 230.712696) (xy 215.636237 230.643181) (xy 215.614992 230.587164) + (xy 215.655278 230.8) (xy 215.651086 230.765471) (xy 215.636237 230.643181) (xy 215.600708 230.5495) (xy 215.581935 230.499999) (xy 224.44473 230.499999) (xy 224.44473 230.5) (xy 224.46377 230.656818) (xy 224.518072 230.799999) (xy 224.519788 230.804523) (xy 224.609525 230.93453) (xy 224.727768 231.039283) (xy 224.72777 231.039284) (xy 224.867642 231.112696) (xy 225.021022 231.1505) (xy 225.021023 231.1505) @@ -163557,7 +168006,7 @@ (xy 215.232365 230.187303) (xy 215.078986 230.1495) (xy 215.078985 230.1495) (xy 214.921015 230.1495) (xy 214.921014 230.1495) (xy 214.767634 230.187303) (xy 214.627762 230.260715) (xy 214.509516 230.365471) (xy 214.419781 230.495475) (xy 214.41978 230.495476) (xy 214.363762 230.643181) (xy 214.344722 230.799999) - (xy 205.455278 230.799999) (xy 205.444678 230.712696) (xy 205.436237 230.643181) (xy 205.414992 230.587164) + (xy 205.455278 230.799999) (xy 205.451086 230.765471) (xy 205.436237 230.643181) (xy 205.400708 230.5495) (xy 205.38022 230.495477) (xy 205.290483 230.36547) (xy 205.17224 230.260717) (xy 205.172238 230.260716) (xy 205.172237 230.260715) (xy 205.032365 230.187303) (xy 204.878986 230.1495) (xy 204.878985 230.1495) (xy 204.721015 230.1495) (xy 204.721014 230.1495) (xy 204.567634 230.187303) (xy 204.427762 230.260715) @@ -163565,369 +168014,369 @@ (xy 204.144722 230.799999) (xy 112.3005 230.799999) (xy 112.3005 230.099999) (xy 158.944722 230.099999) (xy 158.944722 230.1) (xy 158.963762 230.256818) (xy 159.01978 230.404523) (xy 159.109517 230.53453) (xy 159.22776 230.639283) (xy 159.227762 230.639284) (xy 159.367634 230.712696) (xy 159.521014 230.7505) - (xy 159.521015 230.7505) (xy 159.678985 230.7505) (xy 159.832365 230.712696) (xy 159.97224 230.639283) - (xy 160.090483 230.53453) (xy 160.18022 230.404523) (xy 160.236237 230.256818) (xy 160.255278 230.1) - (xy 160.251086 230.065471) (xy 160.236237 229.943181) (xy 160.200708 229.8495) (xy 160.18022 229.795477) - (xy 160.090483 229.66547) (xy 159.97224 229.560717) (xy 159.972238 229.560716) (xy 159.972237 229.560715) - (xy 159.832365 229.487303) (xy 159.678986 229.4495) (xy 159.678985 229.4495) (xy 159.521015 229.4495) - (xy 159.521014 229.4495) (xy 159.367634 229.487303) (xy 159.227762 229.560715) (xy 159.109516 229.665471) - (xy 159.019781 229.795475) (xy 159.01978 229.795476) (xy 158.963762 229.943181) (xy 158.944722 230.099999) - (xy 112.3005 230.099999) (xy 112.3005 229.399999) (xy 219.944722 229.399999) (xy 219.944722 229.4) - (xy 219.963762 229.556818) (xy 220.01978 229.704523) (xy 220.109517 229.83453) (xy 220.22776 229.939283) - (xy 220.227762 229.939284) (xy 220.367634 230.012696) (xy 220.521014 230.0505) (xy 220.521015 230.0505) - (xy 220.678985 230.0505) (xy 220.832365 230.012696) (xy 220.931401 229.960717) (xy 220.97224 229.939283) - (xy 221.090483 229.83453) (xy 221.18022 229.704523) (xy 221.236237 229.556818) (xy 221.255278 229.4) - (xy 221.244678 229.312696) (xy 221.236237 229.243181) (xy 221.201087 229.1505) (xy 221.18022 229.095477) - (xy 221.090483 228.96547) (xy 220.97224 228.860717) (xy 220.972238 228.860716) (xy 220.972237 228.860715) - (xy 220.832365 228.787303) (xy 220.678986 228.7495) (xy 220.678985 228.7495) (xy 220.521015 228.7495) - (xy 220.521014 228.7495) (xy 220.367634 228.787303) (xy 220.227762 228.860715) (xy 220.22776 228.860717) - (xy 220.124475 228.952219) (xy 220.109516 228.965471) (xy 220.019781 229.095475) (xy 220.01978 229.095476) - (xy 219.963762 229.243181) (xy 219.944722 229.399999) (xy 112.3005 229.399999) (xy 112.3005 226.210186) - (xy 117.1745 226.210186) (xy 117.1745 226.479813) (xy 117.204686 226.747719) (xy 117.204688 226.747731) - (xy 117.264684 227.010594) (xy 117.264687 227.010602) (xy 117.353734 227.265082) (xy 117.470714 227.507994) - (xy 117.470716 227.507997) (xy 117.614162 227.736289) (xy 117.782266 227.947085) (xy 117.972915 228.137734) - (xy 118.183711 228.305838) (xy 118.398775 228.440972) (xy 118.412005 228.449285) (xy 118.49095 228.487303) - (xy 118.654921 228.566267) (xy 118.787608 228.612696) (xy 118.909397 228.655312) (xy 118.909405 228.655315) - (xy 118.909408 228.655315) (xy 118.909409 228.655316) (xy 119.172268 228.715312) (xy 119.440187 228.745499) - (xy 119.440188 228.7455) (xy 119.440191 228.7455) (xy 119.709812 228.7455) (xy 119.709812 228.745499) - (xy 119.977732 228.715312) (xy 120.044822 228.699999) (xy 147.944722 228.699999) (xy 147.944722 228.7) - (xy 147.963762 228.856818) (xy 148.01978 229.004523) (xy 148.109517 229.13453) (xy 148.22776 229.239283) - (xy 148.227762 229.239284) (xy 148.367634 229.312696) (xy 148.521014 229.3505) (xy 148.521015 229.3505) - (xy 148.678985 229.3505) (xy 148.832365 229.312696) (xy 148.97224 229.239283) (xy 149.090483 229.13453) - (xy 149.18022 229.004523) (xy 149.236237 228.856818) (xy 149.255278 228.7) (xy 149.251086 228.665471) - (xy 149.236237 228.543181) (xy 149.200708 228.4495) (xy 149.18022 228.395477) (xy 149.106926 228.289292) - (xy 169.0495 228.289292) (xy 169.0495 228.439107) (xy 169.078723 228.586022) (xy 169.078725 228.58603) - (xy 169.136051 228.724429) (xy 169.136056 228.724438) (xy 169.21928 228.84899) (xy 169.219283 228.848994) - (xy 169.325205 228.954916) (xy 169.325209 228.954919) (xy 169.449761 229.038143) (xy 169.44977 229.038148) - (xy 169.452513 229.039284) (xy 169.58817 229.095475) (xy 169.674748 229.112696) (xy 169.735092 229.124699) - (xy 169.735096 229.1247) (xy 169.735097 229.1247) (xy 169.884904 229.1247) (xy 169.884905 229.124699) - (xy 170.03183 229.095475) (xy 170.170232 229.038147) (xy 170.294791 228.954919) (xy 170.400719 228.848991) - (xy 170.483947 228.724432) (xy 170.541275 228.58603) (xy 170.5705 228.439103) (xy 170.5705 228.289297) - (xy 170.569962 228.286592) (xy 185.413701 228.286592) (xy 185.413701 228.436407) (xy 185.442924 228.583322) - (xy 185.442926 228.58333) (xy 185.500252 228.721729) (xy 185.500257 228.721738) (xy 185.583481 228.84629) - (xy 185.583484 228.846294) (xy 185.689406 228.952216) (xy 185.68941 228.952219) (xy 185.813962 229.035443) - (xy 185.813971 229.035448) (xy 185.82323 229.039283) (xy 185.952371 229.092775) (xy 186.052523 229.112696) - (xy 186.099293 229.121999) (xy 186.099297 229.122) (xy 186.099298 229.122) (xy 186.249105 229.122) - (xy 186.249106 229.121999) (xy 186.396031 229.092775) (xy 186.534433 229.035447) (xy 186.658992 228.952219) - (xy 186.76492 228.846291) (xy 186.848148 228.721732) (xy 186.905476 228.58333) (xy 186.934701 228.436403) - (xy 186.934701 228.286597) (xy 186.905476 228.13967) (xy 186.849267 228.00397) (xy 186.848149 228.00127) - (xy 186.848144 228.001261) (xy 186.847301 227.999999) (xy 202.444722 227.999999) (xy 202.444722 228) - (xy 202.463762 228.156818) (xy 202.51978 228.304523) (xy 202.609517 228.43453) (xy 202.72776 228.539283) - (xy 202.727762 228.539284) (xy 202.867634 228.612696) (xy 203.021014 228.6505) (xy 203.021015 228.6505) - (xy 203.178985 228.6505) (xy 203.332365 228.612696) (xy 203.383187 228.586022) (xy 203.47224 228.539283) - (xy 203.516583 228.499999) (xy 244.844722 228.499999) (xy 244.844722 228.5) (xy 244.863762 228.656818) - (xy 244.916349 228.795476) (xy 244.91978 228.804523) (xy 245.009517 228.93453) (xy 245.12776 229.039283) - (xy 245.127762 229.039284) (xy 245.267634 229.112696) (xy 245.421014 229.1505) (xy 245.421015 229.1505) - (xy 245.578985 229.1505) (xy 245.732365 229.112696) (xy 245.774379 229.090644) (xy 245.842886 229.076918) - (xy 245.90794 229.102409) (xy 245.948885 229.159024) (xy 245.955102 229.185493) (xy 245.961634 229.239283) - (xy 245.963763 229.256818) (xy 246.01978 229.404523) (xy 246.109517 229.53453) (xy 246.22776 229.639283) - (xy 246.227762 229.639284) (xy 246.367634 229.712696) (xy 246.521014 229.7505) (xy 246.521015 229.7505) - (xy 246.678985 229.7505) (xy 246.832365 229.712696) (xy 246.847937 229.704523) (xy 246.97224 229.639283) - (xy 247.090483 229.53453) (xy 247.18022 229.404523) (xy 247.236237 229.256818) (xy 247.255278 229.1) - (xy 247.254729 229.095474) (xy 247.236237 228.943181) (xy 247.204961 228.860715) (xy 247.18022 228.795477) - (xy 247.090483 228.66547) (xy 246.97224 228.560717) (xy 246.972238 228.560716) (xy 246.972237 228.560715) - (xy 246.832365 228.487303) (xy 246.678986 228.4495) (xy 246.678985 228.4495) (xy 246.521015 228.4495) - (xy 246.521014 228.4495) (xy 246.367635 228.487303) (xy 246.325618 228.509356) (xy 246.25711 228.52308) - (xy 246.192057 228.497588) (xy 246.151113 228.440972) (xy 246.144897 228.414505) (xy 246.136237 228.343182) - (xy 246.08022 228.195477) (xy 245.990483 228.06547) (xy 245.87224 227.960717) (xy 245.872238 227.960716) - (xy 245.872237 227.960715) (xy 245.732365 227.887303) (xy 245.578986 227.8495) (xy 245.578985 227.8495) - (xy 245.421015 227.8495) (xy 245.421014 227.8495) (xy 245.267634 227.887303) (xy 245.127762 227.960715) - (xy 245.009516 228.065471) (xy 244.919781 228.195475) (xy 244.91978 228.195476) (xy 244.863762 228.343181) - (xy 244.844722 228.499999) (xy 203.516583 228.499999) (xy 203.590483 228.43453) (xy 203.68022 228.304523) - (xy 203.736237 228.156818) (xy 203.755278 228) (xy 203.740308 227.876705) (xy 203.736237 227.843181) - (xy 203.709803 227.773481) (xy 203.68022 227.695477) (xy 203.590483 227.56547) (xy 203.47224 227.460717) - (xy 203.472238 227.460716) (xy 203.472237 227.460715) (xy 203.332365 227.387303) (xy 203.178986 227.3495) - (xy 203.178985 227.3495) (xy 203.021015 227.3495) (xy 203.021014 227.3495) (xy 202.867634 227.387303) - (xy 202.727762 227.460715) (xy 202.609516 227.565471) (xy 202.519781 227.695475) (xy 202.51978 227.695476) - (xy 202.463762 227.843181) (xy 202.444722 227.999999) (xy 186.847301 227.999999) (xy 186.76492 227.876709) - (xy 186.764917 227.876705) (xy 186.658995 227.770783) (xy 186.658991 227.77078) (xy 186.534439 227.687556) - (xy 186.53443 227.687551) (xy 186.396031 227.630225) (xy 186.396023 227.630223) (xy 186.249108 227.601) - (xy 186.249104 227.601) (xy 186.099298 227.601) (xy 186.099293 227.601) (xy 185.952378 227.630223) - (xy 185.95237 227.630225) (xy 185.813971 227.687551) (xy 185.813962 227.687556) (xy 185.68941 227.77078) - (xy 185.689406 227.770783) (xy 185.583484 227.876705) (xy 185.583481 227.876709) (xy 185.500257 228.001261) - (xy 185.500252 228.00127) (xy 185.442926 228.139669) (xy 185.442924 228.139677) (xy 185.413701 228.286592) - (xy 170.569962 228.286592) (xy 170.541275 228.14237) (xy 170.483947 228.003968) (xy 170.483946 228.003967) - (xy 170.483943 228.003961) (xy 170.400719 227.879409) (xy 170.400716 227.879405) (xy 170.294794 227.773483) - (xy 170.29479 227.77348) (xy 170.170238 227.690256) (xy 170.170229 227.690251) (xy 170.03183 227.632925) - (xy 170.031822 227.632923) (xy 169.884907 227.6037) (xy 169.884903 227.6037) (xy 169.735097 227.6037) - (xy 169.735092 227.6037) (xy 169.588177 227.632923) (xy 169.588169 227.632925) (xy 169.44977 227.690251) - (xy 169.449761 227.690256) (xy 169.325209 227.77348) (xy 169.325205 227.773483) (xy 169.219283 227.879405) - (xy 169.21928 227.879409) (xy 169.136056 228.003961) (xy 169.136051 228.00397) (xy 169.078725 228.142369) - (xy 169.078723 228.142377) (xy 169.0495 228.289292) (xy 149.106926 228.289292) (xy 149.090483 228.26547) - (xy 148.97224 228.160717) (xy 148.972238 228.160716) (xy 148.972237 228.160715) (xy 148.832365 228.087303) - (xy 148.678986 228.0495) (xy 148.678985 228.0495) (xy 148.521015 228.0495) (xy 148.521014 228.0495) - (xy 148.367634 228.087303) (xy 148.227762 228.160715) (xy 148.109516 228.265471) (xy 148.019781 228.395475) - (xy 148.01978 228.395476) (xy 147.963762 228.543181) (xy 147.944722 228.699999) (xy 120.044822 228.699999) - (xy 120.240591 228.655316) (xy 120.495079 228.566267) (xy 120.737997 228.449284) (xy 120.966289 228.305838) - (xy 121.177085 228.137734) (xy 121.367734 227.947085) (xy 121.535838 227.736289) (xy 121.679284 227.507997) - (xy 121.796267 227.265079) (xy 121.885316 227.010591) (xy 121.887734 226.999999) (xy 230.894722 226.999999) - (xy 230.894722 227) (xy 230.913762 227.156818) (xy 230.958461 227.274678) (xy 230.96978 227.304523) - (xy 231.059517 227.43453) (xy 231.17776 227.539283) (xy 231.177762 227.539284) (xy 231.317634 227.612696) - (xy 231.471014 227.6505) (xy 231.471015 227.6505) (xy 231.628985 227.6505) (xy 231.782365 227.612696) - (xy 231.799505 227.6037) (xy 231.92224 227.539283) (xy 232.040483 227.43453) (xy 232.13022 227.304523) - (xy 232.186237 227.156818) (xy 232.205278 227) (xy 232.198932 226.947731) (xy 232.186237 226.843181) - (xy 232.164992 226.787164) (xy 232.13022 226.695477) (xy 232.040483 226.56547) (xy 231.92224 226.460717) - (xy 231.922238 226.460716) (xy 231.922237 226.460715) (xy 231.782365 226.387303) (xy 231.628986 226.3495) - (xy 231.628985 226.3495) (xy 231.471015 226.3495) (xy 231.471014 226.3495) (xy 231.317634 226.387303) - (xy 231.177762 226.460715) (xy 231.059516 226.565471) (xy 230.969781 226.695475) (xy 230.96978 226.695476) - (xy 230.913762 226.843181) (xy 230.894722 226.999999) (xy 121.887734 226.999999) (xy 121.945312 226.747732) - (xy 121.9755 226.479809) (xy 121.9755 226.210191) (xy 121.945312 225.942268) (xy 121.885316 225.679409) - (xy 121.796267 225.424921) (xy 121.736108 225.299999) (xy 157.844722 225.299999) (xy 157.844722 225.3) - (xy 157.863762 225.456818) (xy 157.906459 225.569399) (xy 157.91978 225.604523) (xy 158.009517 225.73453) - (xy 158.12776 225.839283) (xy 158.127762 225.839284) (xy 158.267634 225.912696) (xy 158.421014 225.9505) - (xy 158.421015 225.9505) (xy 158.578985 225.9505) (xy 158.732365 225.912696) (xy 158.795787 225.879409) - (xy 158.87224 225.839283) (xy 158.990483 225.73453) (xy 159.08022 225.604523) (xy 159.136237 225.456818) - (xy 159.147483 225.3642) (xy 169.744659 225.3642) (xy 169.763975 225.560329) (xy 169.821188 225.748933) - (xy 169.914086 225.922732) (xy 169.91409 225.922739) (xy 170.039116 226.075083) (xy 170.19146 226.200109) - (xy 170.191467 226.200113) (xy 170.365266 226.293011) (xy 170.365269 226.293011) (xy 170.365273 226.293014) - (xy 170.553868 226.350224) (xy 170.75 226.369541) (xy 170.946132 226.350224) (xy 171.134727 226.293014) - (xy 171.308538 226.20011) (xy 171.460883 226.075083) (xy 171.58591 225.922738) (xy 171.678814 225.748927) - (xy 171.736024 225.560332) (xy 171.755341 225.3642) (xy 172.744659 225.3642) (xy 172.763975 225.560329) - (xy 172.821188 225.748933) (xy 172.914086 225.922732) (xy 172.91409 225.922739) (xy 173.039116 226.075083) - (xy 173.19146 226.200109) (xy 173.191467 226.200113) (xy 173.365266 226.293011) (xy 173.365269 226.293011) - (xy 173.365273 226.293014) (xy 173.553868 226.350224) (xy 173.75 226.369541) (xy 173.946132 226.350224) - (xy 174.134727 226.293014) (xy 174.308538 226.20011) (xy 174.460883 226.075083) (xy 174.58591 225.922738) - (xy 174.678814 225.748927) (xy 174.736024 225.560332) (xy 174.755341 225.3642) (xy 174.736024 225.168068) - (xy 174.678814 224.979473) (xy 174.678811 224.979469) (xy 174.678811 224.979466) (xy 174.590173 224.813636) - (xy 181.233701 224.813636) (xy 181.233701 225.909363) (xy 181.233702 225.909382) (xy 181.240109 225.968981) - (xy 181.290403 226.103827) (xy 181.290404 226.103828) (xy 181.290405 226.10383) (xy 181.376655 226.219046) - (xy 181.491871 226.305296) (xy 181.491872 226.305296) (xy 181.491873 226.305297) (xy 181.626719 226.355591) - (xy 181.626718 226.355591) (xy 181.633646 226.356335) (xy 181.686329 226.362) (xy 181.686338 226.362) - (xy 182.782064 226.362) (xy 182.782073 226.362) (xy 182.841683 226.355591) (xy 182.976531 226.305296) - (xy 183.091747 226.219046) (xy 183.177997 226.10383) (xy 183.228292 225.968982) (xy 183.230333 225.949999) - (xy 239.094722 225.949999) (xy 239.094722 225.95) (xy 239.113762 226.106818) (xy 239.149144 226.20011) - (xy 239.16978 226.254523) (xy 239.259517 226.38453) (xy 239.37776 226.489283) (xy 239.377762 226.489284) - (xy 239.517634 226.562696) (xy 239.671014 226.6005) (xy 239.671015 226.6005) (xy 239.828985 226.6005) - (xy 239.982365 226.562696) (xy 240.12224 226.489283) (xy 240.240483 226.38453) (xy 240.33022 226.254523) - (xy 240.386237 226.106818) (xy 240.405278 225.95) (xy 240.386237 225.793182) (xy 240.360501 225.725321) - (xy 242.6195 225.725321) (xy 242.6195 227.274678) (xy 242.634032 227.347735) (xy 242.634033 227.347739) - (xy 242.634034 227.34774) (xy 242.689399 227.430601) (xy 242.77226 227.485966) (xy 242.772264 227.485967) - (xy 242.845321 227.500499) (xy 242.845324 227.5005) (xy 242.845326 227.5005) (xy 244.394676 227.5005) - (xy 244.394677 227.500499) (xy 244.46774 227.485966) (xy 244.550601 227.430601) (xy 244.605966 227.34774) - (xy 244.6205 227.274674) (xy 244.6205 226.410186) (xy 267.1745 226.410186) (xy 267.1745 226.679813) - (xy 267.204686 226.947719) (xy 267.204688 226.947731) (xy 267.264684 227.210594) (xy 267.264687 227.210602) - (xy 267.353734 227.465082) (xy 267.470714 227.707994) (xy 267.511864 227.773483) (xy 267.614162 227.936289) - (xy 267.782266 228.147085) (xy 267.972915 228.337734) (xy 268.183711 228.505838) (xy 268.353774 228.612696) - (xy 268.412005 228.649285) (xy 268.445614 228.66547) (xy 268.654921 228.766267) (xy 268.846049 228.833145) - (xy 268.909397 228.855312) (xy 268.909405 228.855315) (xy 268.909408 228.855315) (xy 268.909409 228.855316) - (xy 269.172268 228.915312) (xy 269.440187 228.945499) (xy 269.440188 228.9455) (xy 269.440191 228.9455) - (xy 269.709812 228.9455) (xy 269.709812 228.945499) (xy 269.977732 228.915312) (xy 270.240591 228.855316) - (xy 270.495079 228.766267) (xy 270.737997 228.649284) (xy 270.966289 228.505838) (xy 271.177085 228.337734) - (xy 271.367734 228.147085) (xy 271.535838 227.936289) (xy 271.679284 227.707997) (xy 271.796267 227.465079) - (xy 271.885316 227.210591) (xy 271.945312 226.947732) (xy 271.9755 226.679809) (xy 271.9755 226.410191) - (xy 271.945312 226.142268) (xy 271.885316 225.879409) (xy 271.796267 225.624921) (xy 271.679284 225.382003) - (xy 271.535838 225.153711) (xy 271.367734 224.942915) (xy 271.177085 224.752266) (xy 270.966289 224.584162) - (xy 270.737997 224.440716) (xy 270.737994 224.440714) (xy 270.495082 224.323734) (xy 270.240602 224.234687) - (xy 270.240594 224.234684) (xy 270.043446 224.189687) (xy 269.977732 224.174688) (xy 269.977728 224.174687) - (xy 269.977719 224.174686) (xy 269.709813 224.1445) (xy 269.709809 224.1445) (xy 269.440191 224.1445) - (xy 269.440186 224.1445) (xy 269.17228 224.174686) (xy 269.172268 224.174688) (xy 268.909405 224.234684) - (xy 268.909397 224.234687) (xy 268.654917 224.323734) (xy 268.412005 224.440714) (xy 268.183712 224.584161) - (xy 267.972915 224.752265) (xy 267.782265 224.942915) (xy 267.614161 225.153712) (xy 267.470714 225.382005) - (xy 267.353734 225.624917) (xy 267.264687 225.879397) (xy 267.264684 225.879405) (xy 267.204688 226.142268) - (xy 267.204686 226.14228) (xy 267.1745 226.410186) (xy 244.6205 226.410186) (xy 244.6205 225.725326) - (xy 244.6205 225.725323) (xy 244.620499 225.725321) (xy 244.605967 225.652264) (xy 244.605966 225.65226) - (xy 244.57407 225.604524) (xy 244.550601 225.569399) (xy 244.469891 225.515471) (xy 244.467739 225.514033) - (xy 244.467735 225.514032) (xy 244.394677 225.4995) (xy 244.394674 225.4995) (xy 242.845326 225.4995) - (xy 242.845323 225.4995) (xy 242.772264 225.514032) (xy 242.77226 225.514033) (xy 242.689399 225.569399) - (xy 242.634033 225.65226) (xy 242.634032 225.652264) (xy 242.6195 225.725321) (xy 240.360501 225.725321) - (xy 240.33022 225.645477) (xy 240.240483 225.51547) (xy 240.12224 225.410717) (xy 240.122238 225.410716) - (xy 240.122237 225.410715) (xy 239.982365 225.337303) (xy 239.828986 225.2995) (xy 239.828985 225.2995) - (xy 239.671015 225.2995) (xy 239.671014 225.2995) (xy 239.517634 225.337303) (xy 239.377762 225.410715) - (xy 239.259516 225.515471) (xy 239.169781 225.645475) (xy 239.16978 225.645476) (xy 239.113762 225.793181) - (xy 239.094722 225.949999) (xy 183.230333 225.949999) (xy 183.234701 225.909372) (xy 183.234701 224.813628) - (xy 183.228292 224.754018) (xy 183.212204 224.710883) (xy 183.177998 224.619172) (xy 183.177997 224.619171) - (xy 183.177997 224.61917) (xy 183.091747 224.503954) (xy 182.976531 224.417704) (xy 182.976529 224.417703) - (xy 182.976528 224.417702) (xy 182.841682 224.367408) (xy 182.841683 224.367408) (xy 182.782083 224.361001) - (xy 182.782081 224.361) (xy 182.782073 224.361) (xy 181.686329 224.361) (xy 181.686321 224.361) - (xy 181.686318 224.361001) (xy 181.626719 224.367408) (xy 181.491873 224.417702) (xy 181.491871 224.417704) - (xy 181.376655 224.503954) (xy 181.290405 224.61917) (xy 181.290403 224.619172) (xy 181.240109 224.754018) - (xy 181.233702 224.813617) (xy 181.233701 224.813636) (xy 174.590173 224.813636) (xy 174.585913 224.805667) - (xy 174.585909 224.80566) (xy 174.460883 224.653316) (xy 174.308539 224.52829) (xy 174.308532 224.528286) - (xy 174.134733 224.435388) (xy 174.134727 224.435386) (xy 174.008997 224.397246) (xy 173.946129 224.378175) - (xy 173.75 224.358859) (xy 173.55387 224.378175) (xy 173.365266 224.435388) (xy 173.191467 224.528286) - (xy 173.19146 224.52829) (xy 173.039116 224.653316) (xy 172.91409 224.80566) (xy 172.914086 224.805667) - (xy 172.821188 224.979466) (xy 172.763975 225.16807) (xy 172.744659 225.3642) (xy 171.755341 225.3642) - (xy 171.736024 225.168068) (xy 171.678814 224.979473) (xy 171.678811 224.979469) (xy 171.678811 224.979466) - (xy 171.585913 224.805667) (xy 171.585909 224.80566) (xy 171.460883 224.653316) (xy 171.308539 224.52829) - (xy 171.308532 224.528286) (xy 171.134733 224.435388) (xy 171.134727 224.435386) (xy 171.008997 224.397246) - (xy 170.946129 224.378175) (xy 170.75 224.358859) (xy 170.55387 224.378175) (xy 170.365266 224.435388) - (xy 170.191467 224.528286) (xy 170.19146 224.52829) (xy 170.039116 224.653316) (xy 169.91409 224.80566) - (xy 169.914086 224.805667) (xy 169.821188 224.979466) (xy 169.763975 225.16807) (xy 169.744659 225.3642) - (xy 159.147483 225.3642) (xy 159.155278 225.3) (xy 159.137516 225.153711) (xy 159.136237 225.143181) - (xy 159.084521 225.006818) (xy 159.08022 224.995477) (xy 158.990483 224.86547) (xy 158.87224 224.760717) - (xy 158.872238 224.760716) (xy 158.872237 224.760715) (xy 158.732365 224.687303) (xy 158.578986 224.6495) - (xy 158.578985 224.6495) (xy 158.421015 224.6495) (xy 158.421014 224.6495) (xy 158.267634 224.687303) - (xy 158.127762 224.760715) (xy 158.009516 224.865471) (xy 157.919781 224.995475) (xy 157.91978 224.995476) - (xy 157.863762 225.143181) (xy 157.844722 225.299999) (xy 121.736108 225.299999) (xy 121.679284 225.182003) - (xy 121.535838 224.953711) (xy 121.367734 224.742915) (xy 121.177085 224.552266) (xy 121.168569 224.545475) - (xy 121.055566 224.455358) (xy 120.966289 224.384162) (xy 120.74439 224.244733) (xy 120.737994 224.240714) - (xy 120.495082 224.123734) (xy 120.240602 224.034687) (xy 120.240594 224.034684) (xy 120.043446 223.989687) - (xy 119.977732 223.974688) (xy 119.977728 223.974687) (xy 119.977719 223.974686) (xy 119.709813 223.9445) - (xy 119.709809 223.9445) (xy 119.440191 223.9445) (xy 119.440186 223.9445) (xy 119.17228 223.974686) - (xy 119.172268 223.974688) (xy 118.909405 224.034684) (xy 118.909397 224.034687) (xy 118.654917 224.123734) - (xy 118.412005 224.240714) (xy 118.183712 224.384161) (xy 117.972915 224.552265) (xy 117.782265 224.742915) - (xy 117.614161 224.953712) (xy 117.470714 225.182005) (xy 117.353734 225.424917) (xy 117.264687 225.679397) - (xy 117.264684 225.679405) (xy 117.204688 225.942268) (xy 117.204686 225.94228) (xy 117.1745 226.210186) - (xy 112.3005 226.210186) (xy 112.3005 222.679458) (xy 137.0735 222.679458) (xy 137.0735 222.908941) - (xy 137.095019 223.072383) (xy 137.103452 223.136438) (xy 137.145405 223.293011) (xy 137.162842 223.358087) - (xy 137.25065 223.570076) (xy 137.250657 223.57009) (xy 137.365392 223.768817) (xy 137.505081 223.950861) - (xy 137.505089 223.95087) (xy 137.66733 224.113111) (xy 137.667338 224.113118) (xy 137.667339 224.113119) - (xy 137.681173 224.123734) (xy 137.849382 224.252807) (xy 137.849385 224.252808) (xy 137.849388 224.252811) - (xy 138.048112 224.367544) (xy 138.048117 224.367546) (xy 138.048123 224.367549) (xy 138.13948 224.40539) - (xy 138.260113 224.455358) (xy 138.481762 224.514748) (xy 138.709266 224.5447) (xy 138.709273 224.5447) - (xy 138.938727 224.5447) (xy 138.938734 224.5447) (xy 139.166238 224.514748) (xy 139.387887 224.455358) - (xy 139.599888 224.367544) (xy 139.798612 224.252811) (xy 139.980661 224.113119) (xy 139.980665 224.113114) - (xy 139.98067 224.113111) (xy 140.142911 223.95087) (xy 140.142914 223.950865) (xy 140.142919 223.950861) - (xy 140.282611 223.768812) (xy 140.397344 223.570088) (xy 140.485158 223.358087) (xy 140.544548 223.136438) - (xy 140.5745 222.908934) (xy 140.5745 222.679466) (xy 140.544548 222.451962) (xy 140.521033 222.3642) - (xy 169.744659 222.3642) (xy 169.763975 222.560329) (xy 169.821188 222.748933) (xy 169.914086 222.922732) - (xy 169.91409 222.922739) (xy 170.039116 223.075083) (xy 170.19146 223.200109) (xy 170.191467 223.200113) - (xy 170.365266 223.293011) (xy 170.365269 223.293011) (xy 170.365273 223.293014) (xy 170.553868 223.350224) - (xy 170.75 223.369541) (xy 170.946132 223.350224) (xy 171.134727 223.293014) (xy 171.139779 223.290314) - (xy 171.308532 223.200113) (xy 171.308538 223.20011) (xy 171.460883 223.075083) (xy 171.58591 222.922738) - (xy 171.678814 222.748927) (xy 171.736024 222.560332) (xy 171.755341 222.3642) (xy 171.755075 222.3615) - (xy 181.22886 222.3615) (xy 181.248176 222.557629) (xy 181.305389 222.746233) (xy 181.398287 222.920032) - (xy 181.398291 222.920039) (xy 181.523317 223.072383) (xy 181.675661 223.197409) (xy 181.675668 223.197413) - (xy 181.849467 223.290311) (xy 181.84947 223.290311) (xy 181.849474 223.290314) (xy 182.038069 223.347524) - (xy 182.234201 223.366841) (xy 182.430333 223.347524) (xy 182.618928 223.290314) (xy 182.621168 223.289117) - (xy 182.787682 223.200113) (xy 182.792739 223.19741) (xy 182.945084 223.072383) (xy 183.070111 222.920038) - (xy 183.116563 222.833132) (xy 183.163012 222.746233) (xy 183.163012 222.746232) (xy 183.163015 222.746227) - (xy 183.220225 222.557632) (xy 183.239542 222.3615) (xy 183.220225 222.165368) (xy 183.170061 221.999999) - (xy 231.744722 221.999999) (xy 231.744722 222) (xy 231.763762 222.156818) (xy 231.81978 222.304523) - (xy 231.909517 222.43453) (xy 232.02776 222.539283) (xy 232.027762 222.539284) (xy 232.167634 222.612696) - (xy 232.246796 222.632207) (xy 232.307177 222.667363) (xy 232.338966 222.729582) (xy 232.332071 222.79911) - (xy 232.28868 222.853873) (xy 232.253406 222.869027) (xy 232.253544 222.86936) (xy 232.24226 222.874033) - (xy 232.159399 222.929399) (xy 232.104033 223.01226) (xy 232.104032 223.012264) (xy 232.0895 223.085321) - (xy 232.0895 224.634678) (xy 232.104032 224.707735) (xy 232.104033 224.707739) (xy 232.104034 224.70774) - (xy 232.159399 224.790601) (xy 232.24226 224.845966) (xy 232.242264 224.845967) (xy 232.315321 224.860499) - (xy 232.315324 224.8605) (xy 232.315326 224.8605) (xy 233.864676 224.8605) (xy 233.864677 224.860499) - (xy 233.93774 224.845966) (xy 234.020601 224.790601) (xy 234.075966 224.70774) (xy 234.0905 224.634674) - (xy 234.0905 223.86) (xy 234.584659 223.86) (xy 234.603975 224.056129) (xy 234.603976 224.056132) - (xy 234.65814 224.234687) (xy 234.661188 224.244733) (xy 234.754086 224.418532) (xy 234.75409 224.418539) - (xy 234.879116 224.570883) (xy 235.03146 224.695909) (xy 235.031467 224.695913) (xy 235.205266 224.788811) - (xy 235.205269 224.788811) (xy 235.205273 224.788814) (xy 235.393868 224.846024) (xy 235.59 224.865341) - (xy 235.745772 224.849999) (xy 240.194722 224.849999) (xy 240.194722 224.85) (xy 240.213762 225.006818) - (xy 240.265479 225.143182) (xy 240.26978 225.154523) (xy 240.359517 225.28453) (xy 240.47776 225.389283) - (xy 240.477762 225.389284) (xy 240.617634 225.462696) (xy 240.771014 225.5005) (xy 240.771015 225.5005) - (xy 240.928985 225.5005) (xy 241.082365 225.462696) (xy 241.154338 225.424921) (xy 241.22224 225.389283) - (xy 241.340483 225.28453) (xy 241.43022 225.154523) (xy 241.486237 225.006818) (xy 241.505278 224.85) - (xy 241.499895 224.805662) (xy 241.486237 224.693181) (xy 241.439855 224.570883) (xy 241.43022 224.545477) - (xy 241.340483 224.41547) (xy 241.22224 224.310717) (xy 241.222238 224.310716) (xy 241.222237 224.310715) - (xy 241.082365 224.237303) (xy 240.928986 224.1995) (xy 240.928985 224.1995) (xy 240.771015 224.1995) - (xy 240.771014 224.1995) (xy 240.617634 224.237303) (xy 240.477762 224.310715) (xy 240.359516 224.415471) - (xy 240.269781 224.545475) (xy 240.26978 224.545476) (xy 240.213762 224.693181) (xy 240.194722 224.849999) - (xy 235.745772 224.849999) (xy 235.786132 224.846024) (xy 235.974727 224.788814) (xy 236.027297 224.760715) - (xy 236.061632 224.742362) (xy 236.148538 224.69591) (xy 236.300883 224.570883) (xy 236.42591 224.418538) - (xy 236.518814 224.244727) (xy 236.576024 224.056132) (xy 236.581552 224) (xy 242.614659 224) (xy 242.633975 224.196129) - (xy 242.633976 224.196132) (xy 242.689198 224.378175) (xy 242.691188 224.384733) (xy 242.784086 224.558532) - (xy 242.78409 224.558539) (xy 242.909116 224.710883) (xy 243.06146 224.835909) (xy 243.061467 224.835913) - (xy 243.235266 224.928811) (xy 243.235269 224.928811) (xy 243.235273 224.928814) (xy 243.423868 224.986024) - (xy 243.62 225.005341) (xy 243.816132 224.986024) (xy 244.004727 224.928814) (xy 244.178538 224.83591) - (xy 244.330883 224.710883) (xy 244.45591 224.558538) (xy 244.530745 224.418532) (xy 244.548811 224.384733) - (xy 244.548811 224.384732) (xy 244.548814 224.384727) (xy 244.606024 224.196132) (xy 244.625341 224) - (xy 244.606024 223.803868) (xy 244.548814 223.615273) (xy 244.548811 223.615269) (xy 244.548811 223.615266) - (xy 244.455913 223.441467) (xy 244.455909 223.44146) (xy 244.330883 223.289116) (xy 244.178539 223.16409) - (xy 244.178532 223.164086) (xy 244.004733 223.071188) (xy 244.004727 223.071186) (xy 243.816132 223.013976) - (xy 243.816129 223.013975) (xy 243.62 222.994659) (xy 243.42387 223.013975) (xy 243.235266 223.071188) - (xy 243.061467 223.164086) (xy 243.06146 223.16409) (xy 242.909116 223.289116) (xy 242.78409 223.44146) - (xy 242.784086 223.441467) (xy 242.691188 223.615266) (xy 242.633975 223.80387) (xy 242.614659 224) - (xy 236.581552 224) (xy 236.595341 223.86) (xy 236.576024 223.663868) (xy 236.518814 223.475273) - (xy 236.518811 223.475269) (xy 236.518811 223.475266) (xy 236.425913 223.301467) (xy 236.425909 223.30146) - (xy 236.300883 223.149116) (xy 236.148539 223.02409) (xy 236.148532 223.024086) (xy 235.974733 222.931188) - (xy 235.974727 222.931186) (xy 235.786132 222.873976) (xy 235.786129 222.873975) (xy 235.59 222.854659) - (xy 235.39387 222.873975) (xy 235.205266 222.931188) (xy 235.031467 223.024086) (xy 235.03146 223.02409) - (xy 234.879116 223.149116) (xy 234.75409 223.30146) (xy 234.754086 223.301467) (xy 234.661188 223.475266) - (xy 234.603975 223.66387) (xy 234.584659 223.86) (xy 234.0905 223.86) (xy 234.0905 223.085326) (xy 234.0905 223.085323) - (xy 234.090499 223.085321) (xy 234.075967 223.012264) (xy 234.075966 223.01226) (xy 234.020601 222.929399) - (xy 233.93774 222.874034) (xy 233.937739 222.874033) (xy 233.937735 222.874032) (xy 233.864677 222.8595) - (xy 233.864674 222.8595) (xy 232.652274 222.8595) (xy 232.585235 222.839815) (xy 232.53948 222.787011) - (xy 232.529536 222.717853) (xy 232.558561 222.654297) (xy 232.617339 222.616523) (xy 232.6226 222.615103) - (xy 232.632365 222.612696) (xy 232.77224 222.539283) (xy 232.890483 222.43453) (xy 232.98022 222.304523) - (xy 233.036237 222.156818) (xy 233.055278 222) (xy 233.036237 221.843182) (xy 233.022009 221.805667) - (xy 233.014992 221.787164) (xy 232.98022 221.695477) (xy 232.890483 221.56547) (xy 232.77224 221.460717) - (xy 232.772238 221.460716) (xy 232.772237 221.460715) (xy 232.632365 221.387303) (xy 232.478986 221.3495) - (xy 232.478985 221.3495) (xy 232.321015 221.3495) (xy 232.321014 221.3495) (xy 232.167634 221.387303) - (xy 232.027762 221.460715) (xy 231.909516 221.565471) (xy 231.819781 221.695475) (xy 231.81978 221.695476) - (xy 231.763762 221.843181) (xy 231.744722 221.999999) (xy 183.170061 221.999999) (xy 183.163015 221.976773) - (xy 183.163012 221.976769) (xy 183.163012 221.976766) (xy 183.070114 221.802967) (xy 183.07011 221.80296) - (xy 182.945084 221.650616) (xy 182.79274 221.52559) (xy 182.792733 221.525586) (xy 182.618934 221.432688) - (xy 182.618928 221.432686) (xy 182.493198 221.394546) (xy 182.43033 221.375475) (xy 182.234201 221.356159) - (xy 182.038071 221.375475) (xy 181.849467 221.432688) (xy 181.675668 221.525586) (xy 181.675661 221.52559) - (xy 181.523317 221.650616) (xy 181.398291 221.80296) (xy 181.398287 221.802967) (xy 181.305389 221.976766) - (xy 181.248176 222.16537) (xy 181.22886 222.3615) (xy 171.755075 222.3615) (xy 171.736024 222.168068) - (xy 171.678814 221.979473) (xy 171.678811 221.979469) (xy 171.678811 221.979466) (xy 171.585913 221.805667) - (xy 171.585909 221.80566) (xy 171.460883 221.653316) (xy 171.308539 221.52829) (xy 171.308532 221.528286) - (xy 171.134733 221.435388) (xy 171.134727 221.435386) (xy 170.946132 221.378176) (xy 170.946129 221.378175) - (xy 170.75 221.358859) (xy 170.55387 221.378175) (xy 170.365266 221.435388) (xy 170.191467 221.528286) - (xy 170.19146 221.52829) (xy 170.039116 221.653316) (xy 169.91409 221.80566) (xy 169.914086 221.805667) - (xy 169.821188 221.979466) (xy 169.763975 222.16807) (xy 169.744659 222.3642) (xy 140.521033 222.3642) - (xy 140.485158 222.230313) (xy 140.397344 222.018312) (xy 140.282611 221.819588) (xy 140.282608 221.819585) - (xy 140.282607 221.819582) (xy 140.142918 221.637538) (xy 140.142911 221.63753) (xy 139.98067 221.475289) - (xy 139.980661 221.475281) (xy 139.798617 221.335592) (xy 139.59989 221.220857) (xy 139.599876 221.22085) - (xy 139.387887 221.133042) (xy 139.166238 221.073652) (xy 139.128215 221.068646) (xy 138.938741 221.0437) - (xy 138.938734 221.0437) (xy 138.709266 221.0437) (xy 138.709258 221.0437) (xy 138.492715 221.072209) - (xy 138.481762 221.073652) (xy 138.388076 221.098754) (xy 138.260112 221.133042) (xy 138.048123 221.22085) - (xy 138.048109 221.220857) (xy 137.849382 221.335592) (xy 137.667338 221.475281) (xy 137.505081 221.637538) - (xy 137.365392 221.819582) (xy 137.250657 222.018309) (xy 137.25065 222.018323) (xy 137.162842 222.230312) - (xy 137.162842 222.230313) (xy 137.108124 222.434528) (xy 137.103453 222.451959) (xy 137.103451 222.45197) - (xy 137.0735 222.679458) (xy 112.3005 222.679458) (xy 112.3005 219.719999) (xy 163.404722 219.719999) - (xy 163.404722 219.72) (xy 163.423762 219.876818) (xy 163.47978 220.024523) (xy 163.569517 220.15453) - (xy 163.68776 220.259283) (xy 163.687762 220.259284) (xy 163.827634 220.332696) (xy 163.981014 220.3705) - (xy 163.981015 220.3705) (xy 164.138985 220.3705) (xy 164.292365 220.332696) (xy 164.43224 220.259283) - (xy 164.499159 220.199999) (xy 230.844722 220.199999) (xy 230.844722 220.2) (xy 230.863762 220.356818) - (xy 230.91978 220.504523) (xy 231.009517 220.63453) (xy 231.12776 220.739283) (xy 231.127762 220.739284) - (xy 231.267634 220.812696) (xy 231.421014 220.8505) (xy 231.421015 220.8505) (xy 231.578985 220.8505) - (xy 231.732365 220.812696) (xy 231.87224 220.739283) (xy 231.990483 220.63453) (xy 232.08022 220.504523) - (xy 232.134275 220.361991) (xy 232.62273 220.361991) (xy 232.62273 220.361992) (xy 232.64177 220.51881) - (xy 232.697788 220.666515) (xy 232.787525 220.796522) (xy 232.905768 220.901275) (xy 232.90577 220.901276) - (xy 233.045642 220.974688) (xy 233.199022 221.012492) (xy 233.199023 221.012492) (xy 233.356993 221.012492) - (xy 233.510373 220.974688) (xy 233.650248 220.901275) (xy 233.768491 220.796522) (xy 233.858228 220.666515) - (xy 233.914245 220.51881) (xy 233.933286 220.361992) (xy 233.914245 220.205174) (xy 233.912282 220.199999) - (xy 233.872642 220.095476) (xy 233.858228 220.057469) (xy 233.768491 219.927462) (xy 233.650248 219.822709) - (xy 233.650246 219.822708) (xy 233.650245 219.822707) (xy 233.510373 219.749295) (xy 233.356994 219.711492) - (xy 233.356993 219.711492) (xy 233.199023 219.711492) (xy 233.199022 219.711492) (xy 233.045642 219.749295) - (xy 232.90577 219.822707) (xy 232.787524 219.927463) (xy 232.697789 220.057467) (xy 232.697788 220.057468) - (xy 232.64177 220.205173) (xy 232.62273 220.361991) (xy 232.134275 220.361991) (xy 232.136237 220.356818) - (xy 232.155278 220.2) (xy 232.142587 220.095475) (xy 232.136237 220.043181) (xy 232.101738 219.952216) - (xy 232.08022 219.895477) (xy 231.990483 219.76547) (xy 231.87224 219.660717) (xy 231.872238 219.660716) - (xy 231.872237 219.660715) (xy 231.732365 219.587303) (xy 231.578986 219.5495) (xy 231.578985 219.5495) - (xy 231.421015 219.5495) (xy 231.421014 219.5495) (xy 231.267634 219.587303) (xy 231.127762 219.660715) - (xy 231.009516 219.765471) (xy 230.919781 219.895475) (xy 230.91978 219.895476) (xy 230.863762 220.043181) - (xy 230.844722 220.199999) (xy 164.499159 220.199999) (xy 164.550483 220.15453) (xy 164.64022 220.024523) - (xy 164.696237 219.876818) (xy 164.715278 219.72) (xy 164.698684 219.58333) (xy 164.696237 219.563181) - (xy 164.660961 219.470166) (xy 164.64022 219.415477) (xy 164.553121 219.289292) (xy 169.0495 219.289292) - (xy 169.0495 219.439107) (xy 169.078723 219.586022) (xy 169.078725 219.58603) (xy 169.136051 219.724429) - (xy 169.136056 219.724438) (xy 169.21928 219.84899) (xy 169.219283 219.848994) (xy 169.325205 219.954916) - (xy 169.325209 219.954919) (xy 169.449761 220.038143) (xy 169.44977 220.038148) (xy 169.481123 220.051134) - (xy 169.58817 220.095475) (xy 169.721518 220.121999) (xy 169.735092 220.124699) (xy 169.735096 220.1247) - (xy 169.735097 220.1247) (xy 169.884904 220.1247) (xy 169.884905 220.124699) (xy 170.03183 220.095475) - (xy 170.170232 220.038147) (xy 170.294791 219.954919) (xy 170.400719 219.848991) (xy 170.483947 219.724432) - (xy 170.541275 219.58603) (xy 170.5705 219.439103) (xy 170.5705 219.289297) (xy 170.569962 219.286592) - (xy 185.413701 219.286592) (xy 185.413701 219.436407) (xy 185.442924 219.583322) (xy 185.442926 219.58333) - (xy 185.500252 219.721729) (xy 185.500257 219.721738) (xy 185.583481 219.84629) (xy 185.583484 219.846294) - (xy 185.689406 219.952216) (xy 185.68941 219.952219) (xy 185.813962 220.035443) (xy 185.813971 220.035448) - (xy 185.832643 220.043182) (xy 185.952371 220.092775) (xy 186.099293 220.121999) (xy 186.099297 220.122) - (xy 186.099298 220.122) (xy 186.249105 220.122) (xy 186.249106 220.121999) (xy 186.396031 220.092775) - (xy 186.534433 220.035447) (xy 186.658992 219.952219) (xy 186.76492 219.846291) (xy 186.848148 219.721732) - (xy 186.905476 219.58333) (xy 186.934701 219.436403) (xy 186.934701 219.286597) (xy 186.905476 219.13967) - (xy 186.849267 219.00397) (xy 186.848149 219.00127) (xy 186.848144 219.001261) (xy 186.76492 218.876709) - (xy 186.764917 218.876705) (xy 186.658995 218.770783) (xy 186.658991 218.77078) (xy 186.553061 218.699999) - (xy 187.944722 218.699999) (xy 187.944722 218.7) (xy 187.963762 218.856818) (xy 188.018543 219.001261) - (xy 188.01978 219.004523) (xy 188.109517 219.13453) (xy 188.22776 219.239283) (xy 188.227762 219.239284) - (xy 188.367634 219.312696) (xy 188.521014 219.3505) (xy 188.521015 219.3505) (xy 188.678985 219.3505) - (xy 188.832365 219.312696) (xy 188.97224 219.239283) (xy 189.090483 219.13453) (xy 189.18022 219.004523) - (xy 189.236237 218.856818) (xy 189.255278 218.7) (xy 189.253767 218.687551) (xy 189.236237 218.543181) - (xy 189.231238 218.529999) (xy 232.704722 218.529999) (xy 232.704722 218.53) (xy 232.723762 218.686818) - (xy 232.77978 218.834523) (xy 232.869517 218.96453) (xy 232.98776 219.069283) (xy 232.99986 219.075633) - (xy 233.127634 219.142696) (xy 233.281014 219.1805) (xy 233.281015 219.1805) (xy 233.438985 219.1805) - (xy 233.592365 219.142696) (xy 233.607928 219.134528) (xy 233.73224 219.069283) (xy 233.850483 218.96453) - (xy 233.94022 218.834523) (xy 233.996237 218.686818) (xy 234.015278 218.53) (xy 234.01392 218.518811) - (xy 233.996237 218.373181) (xy 233.968818 218.300883) (xy 233.94022 218.225477) (xy 233.850483 218.09547) + (xy 159.521015 230.7505) (xy 159.678985 230.7505) (xy 159.832365 230.712696) (xy 159.931401 230.660717) + (xy 159.97224 230.639283) (xy 160.090483 230.53453) (xy 160.18022 230.404523) (xy 160.236237 230.256818) + (xy 160.255278 230.1) (xy 160.251086 230.065471) (xy 160.236237 229.943181) (xy 160.200708 229.8495) + (xy 160.18022 229.795477) (xy 160.090483 229.66547) (xy 159.97224 229.560717) (xy 159.972238 229.560716) + (xy 159.972237 229.560715) (xy 159.832365 229.487303) (xy 159.678986 229.4495) (xy 159.678985 229.4495) + (xy 159.521015 229.4495) (xy 159.521014 229.4495) (xy 159.367634 229.487303) (xy 159.227762 229.560715) + (xy 159.109516 229.665471) (xy 159.019781 229.795475) (xy 159.01978 229.795476) (xy 158.963762 229.943181) + (xy 158.944722 230.099999) (xy 112.3005 230.099999) (xy 112.3005 229.399999) (xy 219.944722 229.399999) + (xy 219.944722 229.4) (xy 219.963762 229.556818) (xy 220.01978 229.704523) (xy 220.109517 229.83453) + (xy 220.22776 229.939283) (xy 220.227762 229.939284) (xy 220.367634 230.012696) (xy 220.521014 230.0505) + (xy 220.521015 230.0505) (xy 220.678985 230.0505) (xy 220.832365 230.012696) (xy 220.931401 229.960717) + (xy 220.97224 229.939283) (xy 221.090483 229.83453) (xy 221.18022 229.704523) (xy 221.236237 229.556818) + (xy 221.255278 229.4) (xy 221.244678 229.312696) (xy 221.236237 229.243181) (xy 221.201087 229.1505) + (xy 221.18022 229.095477) (xy 221.090483 228.96547) (xy 220.97224 228.860717) (xy 220.972238 228.860716) + (xy 220.972237 228.860715) (xy 220.832365 228.787303) (xy 220.678986 228.7495) (xy 220.678985 228.7495) + (xy 220.521015 228.7495) (xy 220.521014 228.7495) (xy 220.367634 228.787303) (xy 220.227762 228.860715) + (xy 220.22776 228.860717) (xy 220.124475 228.952219) (xy 220.109516 228.965471) (xy 220.019781 229.095475) + (xy 220.01978 229.095476) (xy 219.963762 229.243181) (xy 219.944722 229.399999) (xy 112.3005 229.399999) + (xy 112.3005 226.210186) (xy 117.1745 226.210186) (xy 117.1745 226.479813) (xy 117.204686 226.747719) + (xy 117.204688 226.747731) (xy 117.264684 227.010594) (xy 117.264687 227.010602) (xy 117.353734 227.265082) + (xy 117.470714 227.507994) (xy 117.470716 227.507997) (xy 117.614162 227.736289) (xy 117.782266 227.947085) + (xy 117.972915 228.137734) (xy 118.183711 228.305838) (xy 118.398775 228.440972) (xy 118.412005 228.449285) + (xy 118.49095 228.487303) (xy 118.654921 228.566267) (xy 118.787608 228.612696) (xy 118.909397 228.655312) + (xy 118.909405 228.655315) (xy 118.909408 228.655315) (xy 118.909409 228.655316) (xy 119.172268 228.715312) + (xy 119.440187 228.745499) (xy 119.440188 228.7455) (xy 119.440191 228.7455) (xy 119.709812 228.7455) + (xy 119.709812 228.745499) (xy 119.977732 228.715312) (xy 120.044822 228.699999) (xy 147.944722 228.699999) + (xy 147.944722 228.7) (xy 147.963762 228.856818) (xy 148.01978 229.004523) (xy 148.109517 229.13453) + (xy 148.22776 229.239283) (xy 148.227762 229.239284) (xy 148.367634 229.312696) (xy 148.521014 229.3505) + (xy 148.521015 229.3505) (xy 148.678985 229.3505) (xy 148.832365 229.312696) (xy 148.97224 229.239283) + (xy 149.090483 229.13453) (xy 149.18022 229.004523) (xy 149.236237 228.856818) (xy 149.255278 228.7) + (xy 149.251086 228.665471) (xy 149.236237 228.543181) (xy 149.200708 228.4495) (xy 149.18022 228.395477) + (xy 149.106926 228.289292) (xy 169.0495 228.289292) (xy 169.0495 228.439107) (xy 169.078723 228.586022) + (xy 169.078725 228.58603) (xy 169.136051 228.724429) (xy 169.136056 228.724438) (xy 169.21928 228.84899) + (xy 169.219283 228.848994) (xy 169.325205 228.954916) (xy 169.325209 228.954919) (xy 169.449761 229.038143) + (xy 169.44977 229.038148) (xy 169.452513 229.039284) (xy 169.58817 229.095475) (xy 169.674748 229.112696) + (xy 169.735092 229.124699) (xy 169.735096 229.1247) (xy 169.735097 229.1247) (xy 169.884904 229.1247) + (xy 169.884905 229.124699) (xy 170.03183 229.095475) (xy 170.170232 229.038147) (xy 170.294791 228.954919) + (xy 170.400719 228.848991) (xy 170.483947 228.724432) (xy 170.541275 228.58603) (xy 170.5705 228.439103) + (xy 170.5705 228.289297) (xy 170.569962 228.286592) (xy 185.413701 228.286592) (xy 185.413701 228.436407) + (xy 185.442924 228.583322) (xy 185.442926 228.58333) (xy 185.500252 228.721729) (xy 185.500257 228.721738) + (xy 185.583481 228.84629) (xy 185.583484 228.846294) (xy 185.689406 228.952216) (xy 185.68941 228.952219) + (xy 185.813962 229.035443) (xy 185.813971 229.035448) (xy 185.82323 229.039283) (xy 185.952371 229.092775) + (xy 186.052523 229.112696) (xy 186.099293 229.121999) (xy 186.099297 229.122) (xy 186.099298 229.122) + (xy 186.249105 229.122) (xy 186.249106 229.121999) (xy 186.396031 229.092775) (xy 186.534433 229.035447) + (xy 186.658992 228.952219) (xy 186.76492 228.846291) (xy 186.848148 228.721732) (xy 186.905476 228.58333) + (xy 186.934701 228.436403) (xy 186.934701 228.286597) (xy 186.905476 228.13967) (xy 186.849267 228.00397) + (xy 186.848149 228.00127) (xy 186.848144 228.001261) (xy 186.847301 227.999999) (xy 202.444722 227.999999) + (xy 202.444722 228) (xy 202.463762 228.156818) (xy 202.51978 228.304523) (xy 202.609517 228.43453) + (xy 202.72776 228.539283) (xy 202.727762 228.539284) (xy 202.867634 228.612696) (xy 203.021014 228.6505) + (xy 203.021015 228.6505) (xy 203.178985 228.6505) (xy 203.332365 228.612696) (xy 203.383187 228.586022) + (xy 203.47224 228.539283) (xy 203.516583 228.499999) (xy 244.844722 228.499999) (xy 244.844722 228.5) + (xy 244.863762 228.656818) (xy 244.916349 228.795476) (xy 244.91978 228.804523) (xy 245.009517 228.93453) + (xy 245.12776 229.039283) (xy 245.127762 229.039284) (xy 245.267634 229.112696) (xy 245.421014 229.1505) + (xy 245.421015 229.1505) (xy 245.578985 229.1505) (xy 245.732365 229.112696) (xy 245.774379 229.090644) + (xy 245.842886 229.076918) (xy 245.90794 229.102409) (xy 245.948885 229.159024) (xy 245.955102 229.185493) + (xy 245.961634 229.239283) (xy 245.963763 229.256818) (xy 246.01978 229.404523) (xy 246.109517 229.53453) + (xy 246.22776 229.639283) (xy 246.227762 229.639284) (xy 246.367634 229.712696) (xy 246.521014 229.7505) + (xy 246.521015 229.7505) (xy 246.678985 229.7505) (xy 246.832365 229.712696) (xy 246.847937 229.704523) + (xy 246.97224 229.639283) (xy 247.090483 229.53453) (xy 247.18022 229.404523) (xy 247.236237 229.256818) + (xy 247.255278 229.1) (xy 247.254729 229.095474) (xy 247.236237 228.943181) (xy 247.204961 228.860715) + (xy 247.18022 228.795477) (xy 247.090483 228.66547) (xy 246.97224 228.560717) (xy 246.972238 228.560716) + (xy 246.972237 228.560715) (xy 246.832365 228.487303) (xy 246.678986 228.4495) (xy 246.678985 228.4495) + (xy 246.521015 228.4495) (xy 246.521014 228.4495) (xy 246.367635 228.487303) (xy 246.325618 228.509356) + (xy 246.25711 228.52308) (xy 246.192057 228.497588) (xy 246.151113 228.440972) (xy 246.144897 228.414505) + (xy 246.136237 228.343182) (xy 246.08022 228.195477) (xy 245.990483 228.06547) (xy 245.87224 227.960717) + (xy 245.872238 227.960716) (xy 245.872237 227.960715) (xy 245.732365 227.887303) (xy 245.578986 227.8495) + (xy 245.578985 227.8495) (xy 245.421015 227.8495) (xy 245.421014 227.8495) (xy 245.267634 227.887303) + (xy 245.127762 227.960715) (xy 245.009516 228.065471) (xy 244.919781 228.195475) (xy 244.91978 228.195476) + (xy 244.863762 228.343181) (xy 244.844722 228.499999) (xy 203.516583 228.499999) (xy 203.590483 228.43453) + (xy 203.68022 228.304523) (xy 203.736237 228.156818) (xy 203.755278 228) (xy 203.740308 227.876705) + (xy 203.736237 227.843181) (xy 203.709803 227.773481) (xy 203.68022 227.695477) (xy 203.590483 227.56547) + (xy 203.47224 227.460717) (xy 203.472238 227.460716) (xy 203.472237 227.460715) (xy 203.332365 227.387303) + (xy 203.178986 227.3495) (xy 203.178985 227.3495) (xy 203.021015 227.3495) (xy 203.021014 227.3495) + (xy 202.867634 227.387303) (xy 202.727762 227.460715) (xy 202.609516 227.565471) (xy 202.519781 227.695475) + (xy 202.51978 227.695476) (xy 202.463762 227.843181) (xy 202.444722 227.999999) (xy 186.847301 227.999999) + (xy 186.76492 227.876709) (xy 186.764917 227.876705) (xy 186.658995 227.770783) (xy 186.658991 227.77078) + (xy 186.534439 227.687556) (xy 186.53443 227.687551) (xy 186.396031 227.630225) (xy 186.396023 227.630223) + (xy 186.249108 227.601) (xy 186.249104 227.601) (xy 186.099298 227.601) (xy 186.099293 227.601) + (xy 185.952378 227.630223) (xy 185.95237 227.630225) (xy 185.813971 227.687551) (xy 185.813962 227.687556) + (xy 185.68941 227.77078) (xy 185.689406 227.770783) (xy 185.583484 227.876705) (xy 185.583481 227.876709) + (xy 185.500257 228.001261) (xy 185.500252 228.00127) (xy 185.442926 228.139669) (xy 185.442924 228.139677) + (xy 185.413701 228.286592) (xy 170.569962 228.286592) (xy 170.541275 228.14237) (xy 170.483947 228.003968) + (xy 170.483946 228.003967) (xy 170.483943 228.003961) (xy 170.400719 227.879409) (xy 170.400716 227.879405) + (xy 170.294794 227.773483) (xy 170.29479 227.77348) (xy 170.170238 227.690256) (xy 170.170229 227.690251) + (xy 170.03183 227.632925) (xy 170.031822 227.632923) (xy 169.884907 227.6037) (xy 169.884903 227.6037) + (xy 169.735097 227.6037) (xy 169.735092 227.6037) (xy 169.588177 227.632923) (xy 169.588169 227.632925) + (xy 169.44977 227.690251) (xy 169.449761 227.690256) (xy 169.325209 227.77348) (xy 169.325205 227.773483) + (xy 169.219283 227.879405) (xy 169.21928 227.879409) (xy 169.136056 228.003961) (xy 169.136051 228.00397) + (xy 169.078725 228.142369) (xy 169.078723 228.142377) (xy 169.0495 228.289292) (xy 149.106926 228.289292) + (xy 149.090483 228.26547) (xy 148.97224 228.160717) (xy 148.972238 228.160716) (xy 148.972237 228.160715) + (xy 148.832365 228.087303) (xy 148.678986 228.0495) (xy 148.678985 228.0495) (xy 148.521015 228.0495) + (xy 148.521014 228.0495) (xy 148.367634 228.087303) (xy 148.227762 228.160715) (xy 148.109516 228.265471) + (xy 148.019781 228.395475) (xy 148.01978 228.395476) (xy 147.963762 228.543181) (xy 147.944722 228.699999) + (xy 120.044822 228.699999) (xy 120.240591 228.655316) (xy 120.495079 228.566267) (xy 120.737997 228.449284) + (xy 120.966289 228.305838) (xy 121.177085 228.137734) (xy 121.367734 227.947085) (xy 121.535838 227.736289) + (xy 121.679284 227.507997) (xy 121.796267 227.265079) (xy 121.885316 227.010591) (xy 121.887734 226.999999) + (xy 230.894722 226.999999) (xy 230.894722 227) (xy 230.913762 227.156818) (xy 230.958461 227.274678) + (xy 230.96978 227.304523) (xy 231.059517 227.43453) (xy 231.17776 227.539283) (xy 231.177762 227.539284) + (xy 231.317634 227.612696) (xy 231.471014 227.6505) (xy 231.471015 227.6505) (xy 231.628985 227.6505) + (xy 231.782365 227.612696) (xy 231.799505 227.6037) (xy 231.92224 227.539283) (xy 232.040483 227.43453) + (xy 232.13022 227.304523) (xy 232.186237 227.156818) (xy 232.205278 227) (xy 232.198932 226.947731) + (xy 232.186237 226.843181) (xy 232.164992 226.787164) (xy 232.13022 226.695477) (xy 232.040483 226.56547) + (xy 231.92224 226.460717) (xy 231.922238 226.460716) (xy 231.922237 226.460715) (xy 231.782365 226.387303) + (xy 231.628986 226.3495) (xy 231.628985 226.3495) (xy 231.471015 226.3495) (xy 231.471014 226.3495) + (xy 231.317634 226.387303) (xy 231.177762 226.460715) (xy 231.059516 226.565471) (xy 230.969781 226.695475) + (xy 230.96978 226.695476) (xy 230.913762 226.843181) (xy 230.894722 226.999999) (xy 121.887734 226.999999) + (xy 121.945312 226.747732) (xy 121.9755 226.479809) (xy 121.9755 226.210191) (xy 121.945312 225.942268) + (xy 121.885316 225.679409) (xy 121.796267 225.424921) (xy 121.736108 225.299999) (xy 157.844722 225.299999) + (xy 157.844722 225.3) (xy 157.863762 225.456818) (xy 157.906459 225.569399) (xy 157.91978 225.604523) + (xy 158.009517 225.73453) (xy 158.12776 225.839283) (xy 158.127762 225.839284) (xy 158.267634 225.912696) + (xy 158.421014 225.9505) (xy 158.421015 225.9505) (xy 158.578985 225.9505) (xy 158.732365 225.912696) + (xy 158.795787 225.879409) (xy 158.87224 225.839283) (xy 158.990483 225.73453) (xy 159.08022 225.604523) + (xy 159.136237 225.456818) (xy 159.147483 225.3642) (xy 169.744659 225.3642) (xy 169.763975 225.560329) + (xy 169.821188 225.748933) (xy 169.914086 225.922732) (xy 169.91409 225.922739) (xy 170.039116 226.075083) + (xy 170.19146 226.200109) (xy 170.191467 226.200113) (xy 170.365266 226.293011) (xy 170.365269 226.293011) + (xy 170.365273 226.293014) (xy 170.553868 226.350224) (xy 170.75 226.369541) (xy 170.946132 226.350224) + (xy 171.134727 226.293014) (xy 171.308538 226.20011) (xy 171.460883 226.075083) (xy 171.58591 225.922738) + (xy 171.678814 225.748927) (xy 171.736024 225.560332) (xy 171.755341 225.3642) (xy 172.744659 225.3642) + (xy 172.763975 225.560329) (xy 172.821188 225.748933) (xy 172.914086 225.922732) (xy 172.91409 225.922739) + (xy 173.039116 226.075083) (xy 173.19146 226.200109) (xy 173.191467 226.200113) (xy 173.365266 226.293011) + (xy 173.365269 226.293011) (xy 173.365273 226.293014) (xy 173.553868 226.350224) (xy 173.75 226.369541) + (xy 173.946132 226.350224) (xy 174.134727 226.293014) (xy 174.308538 226.20011) (xy 174.460883 226.075083) + (xy 174.58591 225.922738) (xy 174.678814 225.748927) (xy 174.736024 225.560332) (xy 174.755341 225.3642) + (xy 174.736024 225.168068) (xy 174.678814 224.979473) (xy 174.678811 224.979469) (xy 174.678811 224.979466) + (xy 174.590173 224.813636) (xy 181.233701 224.813636) (xy 181.233701 225.909363) (xy 181.233702 225.909382) + (xy 181.240109 225.968981) (xy 181.290403 226.103827) (xy 181.290404 226.103828) (xy 181.290405 226.10383) + (xy 181.376655 226.219046) (xy 181.491871 226.305296) (xy 181.491872 226.305296) (xy 181.491873 226.305297) + (xy 181.626719 226.355591) (xy 181.626718 226.355591) (xy 181.633646 226.356335) (xy 181.686329 226.362) + (xy 181.686338 226.362) (xy 182.782064 226.362) (xy 182.782073 226.362) (xy 182.841683 226.355591) + (xy 182.976531 226.305296) (xy 183.091747 226.219046) (xy 183.177997 226.10383) (xy 183.228292 225.968982) + (xy 183.230333 225.949999) (xy 239.094722 225.949999) (xy 239.094722 225.95) (xy 239.113762 226.106818) + (xy 239.149144 226.20011) (xy 239.16978 226.254523) (xy 239.259517 226.38453) (xy 239.37776 226.489283) + (xy 239.377762 226.489284) (xy 239.517634 226.562696) (xy 239.671014 226.6005) (xy 239.671015 226.6005) + (xy 239.828985 226.6005) (xy 239.982365 226.562696) (xy 240.12224 226.489283) (xy 240.240483 226.38453) + (xy 240.33022 226.254523) (xy 240.386237 226.106818) (xy 240.405278 225.95) (xy 240.386237 225.793182) + (xy 240.360501 225.725321) (xy 242.6195 225.725321) (xy 242.6195 227.274678) (xy 242.634032 227.347735) + (xy 242.634033 227.347739) (xy 242.634034 227.34774) (xy 242.689399 227.430601) (xy 242.77226 227.485966) + (xy 242.772264 227.485967) (xy 242.845321 227.500499) (xy 242.845324 227.5005) (xy 242.845326 227.5005) + (xy 244.394676 227.5005) (xy 244.394677 227.500499) (xy 244.46774 227.485966) (xy 244.550601 227.430601) + (xy 244.605966 227.34774) (xy 244.6205 227.274674) (xy 244.6205 226.410186) (xy 267.1745 226.410186) + (xy 267.1745 226.679813) (xy 267.204686 226.947719) (xy 267.204688 226.947731) (xy 267.264684 227.210594) + (xy 267.264687 227.210602) (xy 267.353734 227.465082) (xy 267.470714 227.707994) (xy 267.511864 227.773483) + (xy 267.614162 227.936289) (xy 267.782266 228.147085) (xy 267.972915 228.337734) (xy 268.183711 228.505838) + (xy 268.353774 228.612696) (xy 268.412005 228.649285) (xy 268.445614 228.66547) (xy 268.654921 228.766267) + (xy 268.846049 228.833145) (xy 268.909397 228.855312) (xy 268.909405 228.855315) (xy 268.909408 228.855315) + (xy 268.909409 228.855316) (xy 269.172268 228.915312) (xy 269.440187 228.945499) (xy 269.440188 228.9455) + (xy 269.440191 228.9455) (xy 269.709812 228.9455) (xy 269.709812 228.945499) (xy 269.977732 228.915312) + (xy 270.240591 228.855316) (xy 270.495079 228.766267) (xy 270.737997 228.649284) (xy 270.966289 228.505838) + (xy 271.177085 228.337734) (xy 271.367734 228.147085) (xy 271.535838 227.936289) (xy 271.679284 227.707997) + (xy 271.796267 227.465079) (xy 271.885316 227.210591) (xy 271.945312 226.947732) (xy 271.9755 226.679809) + (xy 271.9755 226.410191) (xy 271.945312 226.142268) (xy 271.885316 225.879409) (xy 271.796267 225.624921) + (xy 271.679284 225.382003) (xy 271.535838 225.153711) (xy 271.367734 224.942915) (xy 271.177085 224.752266) + (xy 270.966289 224.584162) (xy 270.737997 224.440716) (xy 270.737994 224.440714) (xy 270.495082 224.323734) + (xy 270.240602 224.234687) (xy 270.240594 224.234684) (xy 270.043446 224.189687) (xy 269.977732 224.174688) + (xy 269.977728 224.174687) (xy 269.977719 224.174686) (xy 269.709813 224.1445) (xy 269.709809 224.1445) + (xy 269.440191 224.1445) (xy 269.440186 224.1445) (xy 269.17228 224.174686) (xy 269.172268 224.174688) + (xy 268.909405 224.234684) (xy 268.909397 224.234687) (xy 268.654917 224.323734) (xy 268.412005 224.440714) + (xy 268.183712 224.584161) (xy 267.972915 224.752265) (xy 267.782265 224.942915) (xy 267.614161 225.153712) + (xy 267.470714 225.382005) (xy 267.353734 225.624917) (xy 267.264687 225.879397) (xy 267.264684 225.879405) + (xy 267.204688 226.142268) (xy 267.204686 226.14228) (xy 267.1745 226.410186) (xy 244.6205 226.410186) + (xy 244.6205 225.725326) (xy 244.6205 225.725323) (xy 244.620499 225.725321) (xy 244.605967 225.652264) + (xy 244.605966 225.65226) (xy 244.57407 225.604524) (xy 244.550601 225.569399) (xy 244.469891 225.515471) + (xy 244.467739 225.514033) (xy 244.467735 225.514032) (xy 244.394677 225.4995) (xy 244.394674 225.4995) + (xy 242.845326 225.4995) (xy 242.845323 225.4995) (xy 242.772264 225.514032) (xy 242.77226 225.514033) + (xy 242.689399 225.569399) (xy 242.634033 225.65226) (xy 242.634032 225.652264) (xy 242.6195 225.725321) + (xy 240.360501 225.725321) (xy 240.33022 225.645477) (xy 240.240483 225.51547) (xy 240.12224 225.410717) + (xy 240.122238 225.410716) (xy 240.122237 225.410715) (xy 239.982365 225.337303) (xy 239.828986 225.2995) + (xy 239.828985 225.2995) (xy 239.671015 225.2995) (xy 239.671014 225.2995) (xy 239.517634 225.337303) + (xy 239.377762 225.410715) (xy 239.259516 225.515471) (xy 239.169781 225.645475) (xy 239.16978 225.645476) + (xy 239.113762 225.793181) (xy 239.094722 225.949999) (xy 183.230333 225.949999) (xy 183.234701 225.909372) + (xy 183.234701 224.813628) (xy 183.228292 224.754018) (xy 183.212204 224.710883) (xy 183.177998 224.619172) + (xy 183.177997 224.619171) (xy 183.177997 224.61917) (xy 183.091747 224.503954) (xy 182.976531 224.417704) + (xy 182.976529 224.417703) (xy 182.976528 224.417702) (xy 182.841682 224.367408) (xy 182.841683 224.367408) + (xy 182.782083 224.361001) (xy 182.782081 224.361) (xy 182.782073 224.361) (xy 181.686329 224.361) + (xy 181.686321 224.361) (xy 181.686318 224.361001) (xy 181.626719 224.367408) (xy 181.491873 224.417702) + (xy 181.491871 224.417704) (xy 181.376655 224.503954) (xy 181.290405 224.61917) (xy 181.290403 224.619172) + (xy 181.240109 224.754018) (xy 181.233702 224.813617) (xy 181.233701 224.813636) (xy 174.590173 224.813636) + (xy 174.585913 224.805667) (xy 174.585909 224.80566) (xy 174.460883 224.653316) (xy 174.308539 224.52829) + (xy 174.308532 224.528286) (xy 174.134733 224.435388) (xy 174.134727 224.435386) (xy 174.008997 224.397246) + (xy 173.946129 224.378175) (xy 173.75 224.358859) (xy 173.55387 224.378175) (xy 173.365266 224.435388) + (xy 173.191467 224.528286) (xy 173.19146 224.52829) (xy 173.039116 224.653316) (xy 172.91409 224.80566) + (xy 172.914086 224.805667) (xy 172.821188 224.979466) (xy 172.763975 225.16807) (xy 172.744659 225.3642) + (xy 171.755341 225.3642) (xy 171.736024 225.168068) (xy 171.678814 224.979473) (xy 171.678811 224.979469) + (xy 171.678811 224.979466) (xy 171.585913 224.805667) (xy 171.585909 224.80566) (xy 171.460883 224.653316) + (xy 171.308539 224.52829) (xy 171.308532 224.528286) (xy 171.134733 224.435388) (xy 171.134727 224.435386) + (xy 171.008997 224.397246) (xy 170.946129 224.378175) (xy 170.75 224.358859) (xy 170.55387 224.378175) + (xy 170.365266 224.435388) (xy 170.191467 224.528286) (xy 170.19146 224.52829) (xy 170.039116 224.653316) + (xy 169.91409 224.80566) (xy 169.914086 224.805667) (xy 169.821188 224.979466) (xy 169.763975 225.16807) + (xy 169.744659 225.3642) (xy 159.147483 225.3642) (xy 159.155278 225.3) (xy 159.137516 225.153711) + (xy 159.136237 225.143181) (xy 159.084521 225.006818) (xy 159.08022 224.995477) (xy 158.990483 224.86547) + (xy 158.87224 224.760717) (xy 158.872238 224.760716) (xy 158.872237 224.760715) (xy 158.732365 224.687303) + (xy 158.578986 224.6495) (xy 158.578985 224.6495) (xy 158.421015 224.6495) (xy 158.421014 224.6495) + (xy 158.267634 224.687303) (xy 158.127762 224.760715) (xy 158.009516 224.865471) (xy 157.919781 224.995475) + (xy 157.91978 224.995476) (xy 157.863762 225.143181) (xy 157.844722 225.299999) (xy 121.736108 225.299999) + (xy 121.679284 225.182003) (xy 121.535838 224.953711) (xy 121.367734 224.742915) (xy 121.177085 224.552266) + (xy 121.168569 224.545475) (xy 121.055566 224.455358) (xy 120.966289 224.384162) (xy 120.74439 224.244733) + (xy 120.737994 224.240714) (xy 120.495082 224.123734) (xy 120.240602 224.034687) (xy 120.240594 224.034684) + (xy 120.043446 223.989687) (xy 119.977732 223.974688) (xy 119.977728 223.974687) (xy 119.977719 223.974686) + (xy 119.709813 223.9445) (xy 119.709809 223.9445) (xy 119.440191 223.9445) (xy 119.440186 223.9445) + (xy 119.17228 223.974686) (xy 119.172268 223.974688) (xy 118.909405 224.034684) (xy 118.909397 224.034687) + (xy 118.654917 224.123734) (xy 118.412005 224.240714) (xy 118.183712 224.384161) (xy 117.972915 224.552265) + (xy 117.782265 224.742915) (xy 117.614161 224.953712) (xy 117.470714 225.182005) (xy 117.353734 225.424917) + (xy 117.264687 225.679397) (xy 117.264684 225.679405) (xy 117.204688 225.942268) (xy 117.204686 225.94228) + (xy 117.1745 226.210186) (xy 112.3005 226.210186) (xy 112.3005 222.679458) (xy 137.0735 222.679458) + (xy 137.0735 222.908941) (xy 137.095019 223.072383) (xy 137.103452 223.136438) (xy 137.145405 223.293011) + (xy 137.162842 223.358087) (xy 137.25065 223.570076) (xy 137.250657 223.57009) (xy 137.365392 223.768817) + (xy 137.505081 223.950861) (xy 137.505089 223.95087) (xy 137.66733 224.113111) (xy 137.667338 224.113118) + (xy 137.667339 224.113119) (xy 137.681173 224.123734) (xy 137.849382 224.252807) (xy 137.849385 224.252808) + (xy 137.849388 224.252811) (xy 138.048112 224.367544) (xy 138.048117 224.367546) (xy 138.048123 224.367549) + (xy 138.13948 224.40539) (xy 138.260113 224.455358) (xy 138.481762 224.514748) (xy 138.709266 224.5447) + (xy 138.709273 224.5447) (xy 138.938727 224.5447) (xy 138.938734 224.5447) (xy 139.166238 224.514748) + (xy 139.387887 224.455358) (xy 139.599888 224.367544) (xy 139.798612 224.252811) (xy 139.980661 224.113119) + (xy 139.980665 224.113114) (xy 139.98067 224.113111) (xy 140.142911 223.95087) (xy 140.142914 223.950865) + (xy 140.142919 223.950861) (xy 140.282611 223.768812) (xy 140.397344 223.570088) (xy 140.485158 223.358087) + (xy 140.544548 223.136438) (xy 140.5745 222.908934) (xy 140.5745 222.679466) (xy 140.544548 222.451962) + (xy 140.521033 222.3642) (xy 169.744659 222.3642) (xy 169.763975 222.560329) (xy 169.821188 222.748933) + (xy 169.914086 222.922732) (xy 169.91409 222.922739) (xy 170.039116 223.075083) (xy 170.19146 223.200109) + (xy 170.191467 223.200113) (xy 170.365266 223.293011) (xy 170.365269 223.293011) (xy 170.365273 223.293014) + (xy 170.553868 223.350224) (xy 170.75 223.369541) (xy 170.946132 223.350224) (xy 171.134727 223.293014) + (xy 171.139779 223.290314) (xy 171.308532 223.200113) (xy 171.308538 223.20011) (xy 171.460883 223.075083) + (xy 171.58591 222.922738) (xy 171.678814 222.748927) (xy 171.736024 222.560332) (xy 171.755341 222.3642) + (xy 171.755075 222.3615) (xy 181.22886 222.3615) (xy 181.248176 222.557629) (xy 181.305389 222.746233) + (xy 181.398287 222.920032) (xy 181.398291 222.920039) (xy 181.523317 223.072383) (xy 181.675661 223.197409) + (xy 181.675668 223.197413) (xy 181.849467 223.290311) (xy 181.84947 223.290311) (xy 181.849474 223.290314) + (xy 182.038069 223.347524) (xy 182.234201 223.366841) (xy 182.430333 223.347524) (xy 182.618928 223.290314) + (xy 182.621168 223.289117) (xy 182.787682 223.200113) (xy 182.792739 223.19741) (xy 182.945084 223.072383) + (xy 183.070111 222.920038) (xy 183.116563 222.833132) (xy 183.163012 222.746233) (xy 183.163012 222.746232) + (xy 183.163015 222.746227) (xy 183.220225 222.557632) (xy 183.239542 222.3615) (xy 183.220225 222.165368) + (xy 183.170061 221.999999) (xy 231.744722 221.999999) (xy 231.744722 222) (xy 231.763762 222.156818) + (xy 231.81978 222.304523) (xy 231.909517 222.43453) (xy 232.02776 222.539283) (xy 232.027762 222.539284) + (xy 232.167634 222.612696) (xy 232.246796 222.632207) (xy 232.307177 222.667363) (xy 232.338966 222.729582) + (xy 232.332071 222.79911) (xy 232.28868 222.853873) (xy 232.253406 222.869027) (xy 232.253544 222.86936) + (xy 232.24226 222.874033) (xy 232.159399 222.929399) (xy 232.104033 223.01226) (xy 232.104032 223.012264) + (xy 232.0895 223.085321) (xy 232.0895 224.634678) (xy 232.104032 224.707735) (xy 232.104033 224.707739) + (xy 232.104034 224.70774) (xy 232.159399 224.790601) (xy 232.24226 224.845966) (xy 232.242264 224.845967) + (xy 232.315321 224.860499) (xy 232.315324 224.8605) (xy 232.315326 224.8605) (xy 233.864676 224.8605) + (xy 233.864677 224.860499) (xy 233.93774 224.845966) (xy 234.020601 224.790601) (xy 234.075966 224.70774) + (xy 234.0905 224.634674) (xy 234.0905 223.86) (xy 234.584659 223.86) (xy 234.603975 224.056129) + (xy 234.603976 224.056132) (xy 234.65814 224.234687) (xy 234.661188 224.244733) (xy 234.754086 224.418532) + (xy 234.75409 224.418539) (xy 234.879116 224.570883) (xy 235.03146 224.695909) (xy 235.031467 224.695913) + (xy 235.205266 224.788811) (xy 235.205269 224.788811) (xy 235.205273 224.788814) (xy 235.393868 224.846024) + (xy 235.59 224.865341) (xy 235.745772 224.849999) (xy 240.194722 224.849999) (xy 240.194722 224.85) + (xy 240.213762 225.006818) (xy 240.265479 225.143182) (xy 240.26978 225.154523) (xy 240.359517 225.28453) + (xy 240.47776 225.389283) (xy 240.477762 225.389284) (xy 240.617634 225.462696) (xy 240.771014 225.5005) + (xy 240.771015 225.5005) (xy 240.928985 225.5005) (xy 241.082365 225.462696) (xy 241.154338 225.424921) + (xy 241.22224 225.389283) (xy 241.340483 225.28453) (xy 241.43022 225.154523) (xy 241.486237 225.006818) + (xy 241.505278 224.85) (xy 241.499895 224.805662) (xy 241.486237 224.693181) (xy 241.439855 224.570883) + (xy 241.43022 224.545477) (xy 241.340483 224.41547) (xy 241.22224 224.310717) (xy 241.222238 224.310716) + (xy 241.222237 224.310715) (xy 241.082365 224.237303) (xy 240.928986 224.1995) (xy 240.928985 224.1995) + (xy 240.771015 224.1995) (xy 240.771014 224.1995) (xy 240.617634 224.237303) (xy 240.477762 224.310715) + (xy 240.359516 224.415471) (xy 240.269781 224.545475) (xy 240.26978 224.545476) (xy 240.213762 224.693181) + (xy 240.194722 224.849999) (xy 235.745772 224.849999) (xy 235.786132 224.846024) (xy 235.974727 224.788814) + (xy 236.027297 224.760715) (xy 236.061632 224.742362) (xy 236.148538 224.69591) (xy 236.300883 224.570883) + (xy 236.42591 224.418538) (xy 236.518814 224.244727) (xy 236.576024 224.056132) (xy 236.581552 224) + (xy 242.614659 224) (xy 242.633975 224.196129) (xy 242.633976 224.196132) (xy 242.689198 224.378175) + (xy 242.691188 224.384733) (xy 242.784086 224.558532) (xy 242.78409 224.558539) (xy 242.909116 224.710883) + (xy 243.06146 224.835909) (xy 243.061467 224.835913) (xy 243.235266 224.928811) (xy 243.235269 224.928811) + (xy 243.235273 224.928814) (xy 243.423868 224.986024) (xy 243.62 225.005341) (xy 243.816132 224.986024) + (xy 244.004727 224.928814) (xy 244.178538 224.83591) (xy 244.330883 224.710883) (xy 244.45591 224.558538) + (xy 244.530745 224.418532) (xy 244.548811 224.384733) (xy 244.548811 224.384732) (xy 244.548814 224.384727) + (xy 244.606024 224.196132) (xy 244.625341 224) (xy 244.606024 223.803868) (xy 244.548814 223.615273) + (xy 244.548811 223.615269) (xy 244.548811 223.615266) (xy 244.455913 223.441467) (xy 244.455909 223.44146) + (xy 244.330883 223.289116) (xy 244.178539 223.16409) (xy 244.178532 223.164086) (xy 244.004733 223.071188) + (xy 244.004727 223.071186) (xy 243.816132 223.013976) (xy 243.816129 223.013975) (xy 243.62 222.994659) + (xy 243.42387 223.013975) (xy 243.235266 223.071188) (xy 243.061467 223.164086) (xy 243.06146 223.16409) + (xy 242.909116 223.289116) (xy 242.78409 223.44146) (xy 242.784086 223.441467) (xy 242.691188 223.615266) + (xy 242.633975 223.80387) (xy 242.614659 224) (xy 236.581552 224) (xy 236.595341 223.86) (xy 236.576024 223.663868) + (xy 236.518814 223.475273) (xy 236.518811 223.475269) (xy 236.518811 223.475266) (xy 236.425913 223.301467) + (xy 236.425909 223.30146) (xy 236.300883 223.149116) (xy 236.148539 223.02409) (xy 236.148532 223.024086) + (xy 235.974733 222.931188) (xy 235.974727 222.931186) (xy 235.786132 222.873976) (xy 235.786129 222.873975) + (xy 235.59 222.854659) (xy 235.39387 222.873975) (xy 235.205266 222.931188) (xy 235.031467 223.024086) + (xy 235.03146 223.02409) (xy 234.879116 223.149116) (xy 234.75409 223.30146) (xy 234.754086 223.301467) + (xy 234.661188 223.475266) (xy 234.603975 223.66387) (xy 234.584659 223.86) (xy 234.0905 223.86) + (xy 234.0905 223.085326) (xy 234.0905 223.085323) (xy 234.090499 223.085321) (xy 234.075967 223.012264) + (xy 234.075966 223.01226) (xy 234.020601 222.929399) (xy 233.93774 222.874034) (xy 233.937739 222.874033) + (xy 233.937735 222.874032) (xy 233.864677 222.8595) (xy 233.864674 222.8595) (xy 232.652274 222.8595) + (xy 232.585235 222.839815) (xy 232.53948 222.787011) (xy 232.529536 222.717853) (xy 232.558561 222.654297) + (xy 232.617339 222.616523) (xy 232.6226 222.615103) (xy 232.632365 222.612696) (xy 232.77224 222.539283) + (xy 232.890483 222.43453) (xy 232.98022 222.304523) (xy 233.036237 222.156818) (xy 233.055278 222) + (xy 233.036237 221.843182) (xy 233.022009 221.805667) (xy 233.014992 221.787164) (xy 232.98022 221.695477) + (xy 232.890483 221.56547) (xy 232.77224 221.460717) (xy 232.772238 221.460716) (xy 232.772237 221.460715) + (xy 232.632365 221.387303) (xy 232.478986 221.3495) (xy 232.478985 221.3495) (xy 232.321015 221.3495) + (xy 232.321014 221.3495) (xy 232.167634 221.387303) (xy 232.027762 221.460715) (xy 231.909516 221.565471) + (xy 231.819781 221.695475) (xy 231.81978 221.695476) (xy 231.763762 221.843181) (xy 231.744722 221.999999) + (xy 183.170061 221.999999) (xy 183.163015 221.976773) (xy 183.163012 221.976769) (xy 183.163012 221.976766) + (xy 183.070114 221.802967) (xy 183.07011 221.80296) (xy 182.945084 221.650616) (xy 182.79274 221.52559) + (xy 182.792733 221.525586) (xy 182.618934 221.432688) (xy 182.618928 221.432686) (xy 182.493198 221.394546) + (xy 182.43033 221.375475) (xy 182.234201 221.356159) (xy 182.038071 221.375475) (xy 181.849467 221.432688) + (xy 181.675668 221.525586) (xy 181.675661 221.52559) (xy 181.523317 221.650616) (xy 181.398291 221.80296) + (xy 181.398287 221.802967) (xy 181.305389 221.976766) (xy 181.248176 222.16537) (xy 181.22886 222.3615) + (xy 171.755075 222.3615) (xy 171.736024 222.168068) (xy 171.678814 221.979473) (xy 171.678811 221.979469) + (xy 171.678811 221.979466) (xy 171.585913 221.805667) (xy 171.585909 221.80566) (xy 171.460883 221.653316) + (xy 171.308539 221.52829) (xy 171.308532 221.528286) (xy 171.134733 221.435388) (xy 171.134727 221.435386) + (xy 170.946132 221.378176) (xy 170.946129 221.378175) (xy 170.75 221.358859) (xy 170.55387 221.378175) + (xy 170.365266 221.435388) (xy 170.191467 221.528286) (xy 170.19146 221.52829) (xy 170.039116 221.653316) + (xy 169.91409 221.80566) (xy 169.914086 221.805667) (xy 169.821188 221.979466) (xy 169.763975 222.16807) + (xy 169.744659 222.3642) (xy 140.521033 222.3642) (xy 140.485158 222.230313) (xy 140.397344 222.018312) + (xy 140.282611 221.819588) (xy 140.282608 221.819585) (xy 140.282607 221.819582) (xy 140.142918 221.637538) + (xy 140.142911 221.63753) (xy 139.98067 221.475289) (xy 139.980661 221.475281) (xy 139.798617 221.335592) + (xy 139.59989 221.220857) (xy 139.599876 221.22085) (xy 139.387887 221.133042) (xy 139.166238 221.073652) + (xy 139.128215 221.068646) (xy 138.938741 221.0437) (xy 138.938734 221.0437) (xy 138.709266 221.0437) + (xy 138.709258 221.0437) (xy 138.492715 221.072209) (xy 138.481762 221.073652) (xy 138.388076 221.098754) + (xy 138.260112 221.133042) (xy 138.048123 221.22085) (xy 138.048109 221.220857) (xy 137.849382 221.335592) + (xy 137.667338 221.475281) (xy 137.505081 221.637538) (xy 137.365392 221.819582) (xy 137.250657 222.018309) + (xy 137.25065 222.018323) (xy 137.162842 222.230312) (xy 137.162842 222.230313) (xy 137.108124 222.434528) + (xy 137.103453 222.451959) (xy 137.103451 222.45197) (xy 137.0735 222.679458) (xy 112.3005 222.679458) + (xy 112.3005 219.719999) (xy 163.404722 219.719999) (xy 163.404722 219.72) (xy 163.423762 219.876818) + (xy 163.47978 220.024523) (xy 163.569517 220.15453) (xy 163.68776 220.259283) (xy 163.687762 220.259284) + (xy 163.827634 220.332696) (xy 163.981014 220.3705) (xy 163.981015 220.3705) (xy 164.138985 220.3705) + (xy 164.292365 220.332696) (xy 164.43224 220.259283) (xy 164.499159 220.199999) (xy 230.844722 220.199999) + (xy 230.844722 220.2) (xy 230.863762 220.356818) (xy 230.91978 220.504523) (xy 231.009517 220.63453) + (xy 231.12776 220.739283) (xy 231.127762 220.739284) (xy 231.267634 220.812696) (xy 231.421014 220.8505) + (xy 231.421015 220.8505) (xy 231.578985 220.8505) (xy 231.732365 220.812696) (xy 231.87224 220.739283) + (xy 231.990483 220.63453) (xy 232.08022 220.504523) (xy 232.134275 220.361991) (xy 232.62273 220.361991) + (xy 232.62273 220.361992) (xy 232.64177 220.51881) (xy 232.697788 220.666515) (xy 232.787525 220.796522) + (xy 232.905768 220.901275) (xy 232.90577 220.901276) (xy 233.045642 220.974688) (xy 233.199022 221.012492) + (xy 233.199023 221.012492) (xy 233.356993 221.012492) (xy 233.510373 220.974688) (xy 233.650248 220.901275) + (xy 233.768491 220.796522) (xy 233.858228 220.666515) (xy 233.914245 220.51881) (xy 233.933286 220.361992) + (xy 233.914245 220.205174) (xy 233.912282 220.199999) (xy 233.872642 220.095476) (xy 233.858228 220.057469) + (xy 233.768491 219.927462) (xy 233.650248 219.822709) (xy 233.650246 219.822708) (xy 233.650245 219.822707) + (xy 233.510373 219.749295) (xy 233.356994 219.711492) (xy 233.356993 219.711492) (xy 233.199023 219.711492) + (xy 233.199022 219.711492) (xy 233.045642 219.749295) (xy 232.90577 219.822707) (xy 232.787524 219.927463) + (xy 232.697789 220.057467) (xy 232.697788 220.057468) (xy 232.64177 220.205173) (xy 232.62273 220.361991) + (xy 232.134275 220.361991) (xy 232.136237 220.356818) (xy 232.155278 220.2) (xy 232.142587 220.095475) + (xy 232.136237 220.043181) (xy 232.101738 219.952216) (xy 232.08022 219.895477) (xy 231.990483 219.76547) + (xy 231.87224 219.660717) (xy 231.872238 219.660716) (xy 231.872237 219.660715) (xy 231.732365 219.587303) + (xy 231.578986 219.5495) (xy 231.578985 219.5495) (xy 231.421015 219.5495) (xy 231.421014 219.5495) + (xy 231.267634 219.587303) (xy 231.127762 219.660715) (xy 231.009516 219.765471) (xy 230.919781 219.895475) + (xy 230.91978 219.895476) (xy 230.863762 220.043181) (xy 230.844722 220.199999) (xy 164.499159 220.199999) + (xy 164.550483 220.15453) (xy 164.64022 220.024523) (xy 164.696237 219.876818) (xy 164.715278 219.72) + (xy 164.698684 219.58333) (xy 164.696237 219.563181) (xy 164.660961 219.470166) (xy 164.64022 219.415477) + (xy 164.553121 219.289292) (xy 169.0495 219.289292) (xy 169.0495 219.439107) (xy 169.078723 219.586022) + (xy 169.078725 219.58603) (xy 169.136051 219.724429) (xy 169.136056 219.724438) (xy 169.21928 219.84899) + (xy 169.219283 219.848994) (xy 169.325205 219.954916) (xy 169.325209 219.954919) (xy 169.449761 220.038143) + (xy 169.44977 220.038148) (xy 169.481123 220.051134) (xy 169.58817 220.095475) (xy 169.721518 220.121999) + (xy 169.735092 220.124699) (xy 169.735096 220.1247) (xy 169.735097 220.1247) (xy 169.884904 220.1247) + (xy 169.884905 220.124699) (xy 170.03183 220.095475) (xy 170.170232 220.038147) (xy 170.294791 219.954919) + (xy 170.400719 219.848991) (xy 170.483947 219.724432) (xy 170.541275 219.58603) (xy 170.5705 219.439103) + (xy 170.5705 219.289297) (xy 170.569962 219.286592) (xy 185.413701 219.286592) (xy 185.413701 219.436407) + (xy 185.442924 219.583322) (xy 185.442926 219.58333) (xy 185.500252 219.721729) (xy 185.500257 219.721738) + (xy 185.583481 219.84629) (xy 185.583484 219.846294) (xy 185.689406 219.952216) (xy 185.68941 219.952219) + (xy 185.813962 220.035443) (xy 185.813971 220.035448) (xy 185.832643 220.043182) (xy 185.952371 220.092775) + (xy 186.099293 220.121999) (xy 186.099297 220.122) (xy 186.099298 220.122) (xy 186.249105 220.122) + (xy 186.249106 220.121999) (xy 186.396031 220.092775) (xy 186.534433 220.035447) (xy 186.658992 219.952219) + (xy 186.76492 219.846291) (xy 186.848148 219.721732) (xy 186.905476 219.58333) (xy 186.934701 219.436403) + (xy 186.934701 219.286597) (xy 186.905476 219.13967) (xy 186.849267 219.00397) (xy 186.848149 219.00127) + (xy 186.848144 219.001261) (xy 186.76492 218.876709) (xy 186.764917 218.876705) (xy 186.658995 218.770783) + (xy 186.658991 218.77078) (xy 186.553061 218.699999) (xy 187.944722 218.699999) (xy 187.944722 218.7) + (xy 187.963762 218.856818) (xy 188.018543 219.001261) (xy 188.01978 219.004523) (xy 188.109517 219.13453) + (xy 188.22776 219.239283) (xy 188.227762 219.239284) (xy 188.367634 219.312696) (xy 188.521014 219.3505) + (xy 188.521015 219.3505) (xy 188.678985 219.3505) (xy 188.832365 219.312696) (xy 188.97224 219.239283) + (xy 189.090483 219.13453) (xy 189.18022 219.004523) (xy 189.236237 218.856818) (xy 189.255278 218.7) + (xy 189.253767 218.687551) (xy 189.236237 218.543181) (xy 189.231238 218.529999) (xy 232.704722 218.529999) + (xy 232.704722 218.53) (xy 232.723762 218.686818) (xy 232.77978 218.834523) (xy 232.869517 218.96453) + (xy 232.98776 219.069283) (xy 232.99986 219.075633) (xy 233.127634 219.142696) (xy 233.281014 219.1805) + (xy 233.281015 219.1805) (xy 233.438985 219.1805) (xy 233.592365 219.142696) (xy 233.607928 219.134528) + (xy 233.73224 219.069283) (xy 233.850483 218.96453) (xy 233.94022 218.834523) (xy 233.996237 218.686818) + (xy 234.015278 218.53) (xy 233.996237 218.373182) (xy 233.94022 218.225477) (xy 233.850483 218.09547) (xy 233.73224 217.990717) (xy 233.732238 217.990716) (xy 233.732237 217.990715) (xy 233.592365 217.917303) (xy 233.438986 217.8795) (xy 233.438985 217.8795) (xy 233.281015 217.8795) (xy 233.281014 217.8795) (xy 233.127634 217.917303) (xy 232.987762 217.990715) (xy 232.869516 218.095471) (xy 232.779781 218.225475) (xy 232.77978 218.225476) (xy 232.723762 218.373181) (xy 232.704722 218.529999) (xy 189.231238 218.529999) - (xy 189.196248 218.43774) (xy 189.18022 218.395477) (xy 189.090483 218.26547) (xy 188.97224 218.160717) + (xy 189.214992 218.487164) (xy 189.18022 218.395477) (xy 189.090483 218.26547) (xy 188.97224 218.160717) (xy 188.972238 218.160716) (xy 188.972237 218.160715) (xy 188.832365 218.087303) (xy 188.678986 218.0495) (xy 188.678985 218.0495) (xy 188.521015 218.0495) (xy 188.521014 218.0495) (xy 188.367634 218.087303) (xy 188.227762 218.160715) (xy 188.109516 218.265471) (xy 188.019781 218.395475) (xy 188.01978 218.395476) @@ -163949,45 +168398,46 @@ (xy 164.138986 219.0695) (xy 164.138985 219.0695) (xy 163.981015 219.0695) (xy 163.981014 219.0695) (xy 163.827634 219.107303) (xy 163.687762 219.180715) (xy 163.68776 219.180717) (xy 163.599534 219.258878) (xy 163.569516 219.285471) (xy 163.479781 219.415475) (xy 163.47978 219.415476) (xy 163.423762 219.563181) - (xy 163.404722 219.719999) (xy 112.3005 219.719999) (xy 112.3005 216.815321) (xy 113.9595 216.815321) - (xy 113.9595 218.364678) (xy 113.974032 218.437735) (xy 113.974033 218.437739) (xy 113.974034 218.43774) - (xy 114.029399 218.520601) (xy 114.11226 218.575966) (xy 114.112264 218.575967) (xy 114.185321 218.590499) - (xy 114.185324 218.5905) (xy 114.185326 218.5905) (xy 115.734676 218.5905) (xy 115.734677 218.590499) - (xy 115.80774 218.575966) (xy 115.890601 218.520601) (xy 115.945966 218.43774) (xy 115.9605 218.364674) - (xy 115.9605 217.59) (xy 116.454659 217.59) (xy 116.473975 217.786129) (xy 116.531188 217.974733) - (xy 116.624086 218.148532) (xy 116.62409 218.148539) (xy 116.749116 218.300883) (xy 116.90146 218.425909) - (xy 116.901467 218.425913) (xy 117.075266 218.518811) (xy 117.075269 218.518811) (xy 117.075273 218.518814) - (xy 117.263868 218.576024) (xy 117.46 218.595341) (xy 117.656132 218.576024) (xy 117.844727 218.518814) - (xy 118.018538 218.42591) (xy 118.170883 218.300883) (xy 118.29591 218.148538) (xy 118.388814 217.974727) - (xy 118.446024 217.786132) (xy 118.455539 217.689521) (xy 139.3135 217.689521) (xy 139.3135 219.258878) - (xy 139.328032 219.331935) (xy 139.328033 219.331939) (xy 139.328034 219.33194) (xy 139.383399 219.414801) - (xy 139.46626 219.470166) (xy 139.466264 219.470167) (xy 139.539321 219.484699) (xy 139.539324 219.4847) - (xy 139.539326 219.4847) (xy 141.108676 219.4847) (xy 141.108677 219.484699) (xy 141.18174 219.470166) - (xy 141.264601 219.414801) (xy 141.319966 219.33194) (xy 141.3345 219.258874) (xy 141.3345 217.689526) - (xy 141.3345 217.689523) (xy 141.334499 217.689521) (xy 141.319967 217.616464) (xy 141.319966 217.61646) - (xy 141.302286 217.59) (xy 141.264601 217.533599) (xy 141.18174 217.478234) (xy 141.181739 217.478233) + (xy 163.404722 219.719999) (xy 112.3005 219.719999) (xy 112.3005 217.689521) (xy 139.3135 217.689521) + (xy 139.3135 219.258878) (xy 139.328032 219.331935) (xy 139.328033 219.331939) (xy 139.328034 219.33194) + (xy 139.383399 219.414801) (xy 139.46626 219.470166) (xy 139.466264 219.470167) (xy 139.539321 219.484699) + (xy 139.539324 219.4847) (xy 139.539326 219.4847) (xy 141.108676 219.4847) (xy 141.108677 219.484699) + (xy 141.18174 219.470166) (xy 141.264601 219.414801) (xy 141.319966 219.33194) (xy 141.3345 219.258874) + (xy 141.3345 217.689526) (xy 141.3345 217.689523) (xy 141.334499 217.689521) (xy 141.319967 217.616464) + (xy 141.319966 217.61646) (xy 141.264601 217.533599) (xy 141.18174 217.478234) (xy 141.181739 217.478233) (xy 141.181735 217.478232) (xy 141.108677 217.4637) (xy 141.108674 217.4637) (xy 139.539326 217.4637) (xy 139.539323 217.4637) (xy 139.466264 217.478232) (xy 139.46626 217.478233) (xy 139.383399 217.533599) - (xy 139.328033 217.61646) (xy 139.328032 217.616464) (xy 139.3135 217.689521) (xy 118.455539 217.689521) - (xy 118.465341 217.59) (xy 118.446024 217.393868) (xy 118.388814 217.205273) (xy 118.388811 217.205269) - (xy 118.388811 217.205266) (xy 118.295913 217.031467) (xy 118.295909 217.03146) (xy 118.170883 216.879116) - (xy 118.018539 216.75409) (xy 118.018532 216.754086) (xy 117.844733 216.661188) (xy 117.844727 216.661186) - (xy 117.656132 216.603976) (xy 117.656129 216.603975) (xy 117.46 216.584659) (xy 117.26387 216.603975) - (xy 117.075266 216.661188) (xy 116.901467 216.754086) (xy 116.90146 216.75409) (xy 116.749116 216.879116) - (xy 116.62409 217.03146) (xy 116.624086 217.031467) (xy 116.531188 217.205266) (xy 116.473975 217.39387) - (xy 116.454659 217.59) (xy 115.9605 217.59) (xy 115.9605 216.815326) (xy 115.9605 216.815323) (xy 115.960499 216.815321) - (xy 115.945967 216.742264) (xy 115.945966 216.74226) (xy 115.890601 216.659399) (xy 115.80774 216.604034) - (xy 115.807739 216.604033) (xy 115.807735 216.604032) (xy 115.734677 216.5895) (xy 115.734674 216.5895) - (xy 114.185326 216.5895) (xy 114.185323 216.5895) (xy 114.112264 216.604032) (xy 114.11226 216.604033) - (xy 114.029399 216.659399) (xy 113.974033 216.74226) (xy 113.974032 216.742264) (xy 113.9595 216.815321) - (xy 112.3005 216.815321) (xy 112.3005 215.4742) (xy 136.308611 215.4742) (xy 136.328121 215.672295) - (xy 136.385903 215.862774) (xy 136.479731 216.038314) (xy 136.479735 216.038321) (xy 136.606011 216.192188) - (xy 136.759878 216.318464) (xy 136.759885 216.318468) (xy 136.935425 216.412296) (xy 136.935427 216.412297) - (xy 137.125907 216.470079) (xy 137.324 216.489589) (xy 137.522093 216.470079) (xy 137.712573 216.412297) - (xy 137.88812 216.318465) (xy 138.041988 216.192188) (xy 138.168265 216.03832) (xy 138.262097 215.862773) - (xy 138.319879 215.672293) (xy 138.339389 215.4742) (xy 138.319879 215.276107) (xy 138.262097 215.085627) - (xy 138.168265 214.91008) (xy 138.168264 214.910078) (xy 138.041988 214.756211) (xy 137.888121 214.629935) - (xy 137.888114 214.629931) (xy 137.712574 214.536103) (xy 137.522095 214.478321) (xy 137.324 214.458811) + (xy 139.328033 217.61646) (xy 139.328032 217.616464) (xy 139.3135 217.689521) (xy 112.3005 217.689521) + (xy 112.3005 215.4742) (xy 136.308611 215.4742) (xy 136.328121 215.672295) (xy 136.385903 215.862774) + (xy 136.479731 216.038314) (xy 136.479735 216.038321) (xy 136.606011 216.192188) (xy 136.759878 216.318464) + (xy 136.759885 216.318468) (xy 136.935425 216.412296) (xy 136.935427 216.412297) (xy 137.125907 216.470079) + (xy 137.324 216.489589) (xy 137.522093 216.470079) (xy 137.712573 216.412297) (xy 137.88812 216.318465) + (xy 138.013801 216.215321) (xy 146.189501 216.215321) (xy 146.189501 217.764678) (xy 146.204033 217.837735) + (xy 146.204034 217.837739) (xy 146.204035 217.83774) (xy 146.2594 217.920601) (xy 146.342261 217.975966) + (xy 146.342265 217.975967) (xy 146.415322 217.990499) (xy 146.415325 217.9905) (xy 146.415327 217.9905) + (xy 147.964677 217.9905) (xy 147.964678 217.990499) (xy 148.037741 217.975966) (xy 148.120602 217.920601) + (xy 148.175967 217.83774) (xy 148.190501 217.764674) (xy 148.190501 216.215326) (xy 148.190501 216.215323) + (xy 148.1905 216.215321) (xy 148.175968 216.142264) (xy 148.175967 216.14226) (xy 148.120602 216.059399) + (xy 148.037741 216.004034) (xy 148.03774 216.004033) (xy 148.037736 216.004032) (xy 147.964678 215.9895) + (xy 147.964675 215.9895) (xy 146.415327 215.9895) (xy 146.415324 215.9895) (xy 146.342265 216.004032) + (xy 146.342261 216.004033) (xy 146.2594 216.059399) (xy 146.204034 216.14226) (xy 146.204033 216.142264) + (xy 146.189501 216.215321) (xy 138.013801 216.215321) (xy 138.041988 216.192188) (xy 138.168265 216.03832) + (xy 138.262097 215.862773) (xy 138.319879 215.672293) (xy 138.339389 215.4742) (xy 138.319879 215.276107) + (xy 138.262097 215.085627) (xy 138.242273 215.048539) (xy 138.168268 214.910085) (xy 138.168264 214.910078) + (xy 138.041988 214.756211) (xy 137.888121 214.629935) (xy 137.888114 214.629931) (xy 137.712574 214.536103) + (xy 137.560595 214.49) (xy 146.18466 214.49) (xy 146.203976 214.686129) (xy 146.261189 214.874733) + (xy 146.354087 215.048532) (xy 146.354091 215.048539) (xy 146.479117 215.200883) (xy 146.631461 215.325909) + (xy 146.631468 215.325913) (xy 146.805267 215.418811) (xy 146.80527 215.418811) (xy 146.805274 215.418814) + (xy 146.993869 215.476024) (xy 147.190001 215.495341) (xy 147.386133 215.476024) (xy 147.574728 215.418814) + (xy 147.748539 215.32591) (xy 147.900884 215.200883) (xy 148.025911 215.048538) (xy 148.099916 214.910085) + (xy 148.118812 214.874733) (xy 148.118812 214.874732) (xy 148.118815 214.874727) (xy 148.176025 214.686132) + (xy 148.195342 214.49) (xy 148.176025 214.293868) (xy 148.118815 214.105273) (xy 148.118812 214.105269) + (xy 148.118812 214.105266) (xy 148.025914 213.931467) (xy 148.02591 213.93146) (xy 147.900884 213.779116) + (xy 147.74854 213.65409) (xy 147.748533 213.654086) (xy 147.574734 213.561188) (xy 147.574728 213.561186) + (xy 147.386133 213.503976) (xy 147.38613 213.503975) (xy 147.190001 213.484659) (xy 146.993871 213.503975) + (xy 146.805267 213.561188) (xy 146.631468 213.654086) (xy 146.631461 213.65409) (xy 146.479117 213.779116) + (xy 146.354091 213.93146) (xy 146.354087 213.931467) (xy 146.261189 214.105266) (xy 146.203976 214.29387) + (xy 146.18466 214.49) (xy 137.560595 214.49) (xy 137.522095 214.478321) (xy 137.324 214.458811) (xy 137.125904 214.478321) (xy 136.935425 214.536103) (xy 136.759885 214.629931) (xy 136.759878 214.629935) (xy 136.606011 214.756211) (xy 136.479735 214.910078) (xy 136.479731 214.910085) (xy 136.385903 215.085625) (xy 136.328121 215.276104) (xy 136.308611 215.4742) (xy 112.3005 215.4742) (xy 112.3005 213.092733) @@ -164137,37 +168587,37 @@ (xy 169.92893 207.551529) (xy 169.928924 207.551533) (xy 169.739242 207.699169) (xy 169.739239 207.699172) (xy 169.739236 207.699174) (xy 169.739236 207.699175) (xy 169.703294 207.738217) (xy 169.57643 207.876029) (xy 169.576427 207.876033) (xy 169.444951 208.07727) (xy 169.348389 208.29741) (xy 169.289379 208.53044) - (xy 169.269529 208.769994) (xy 112.3005 208.769994) (xy 112.3005 206.549999) (xy 225.804722 206.549999) - (xy 225.804722 206.55) (xy 225.823762 206.706818) (xy 225.87978 206.854523) (xy 225.969517 206.98453) - (xy 226.08776 207.089283) (xy 226.087762 207.089284) (xy 226.227634 207.162696) (xy 226.381014 207.2005) - (xy 226.381015 207.2005) (xy 226.538985 207.2005) (xy 226.692365 207.162696) (xy 226.83224 207.089283) - (xy 226.950483 206.98453) (xy 227.04022 206.854523) (xy 227.096237 206.706818) (xy 227.115278 206.55) - (xy 227.096237 206.393182) (xy 227.04022 206.245477) (xy 226.950483 206.11547) (xy 226.83224 206.010717) - (xy 226.832238 206.010716) (xy 226.832237 206.010715) (xy 226.692365 205.937303) (xy 226.538986 205.8995) - (xy 226.538985 205.8995) (xy 226.381015 205.8995) (xy 226.381014 205.8995) (xy 226.227634 205.937303) - (xy 226.087762 206.010715) (xy 225.969516 206.115471) (xy 225.879781 206.245475) (xy 225.87978 206.245476) - (xy 225.823762 206.393181) (xy 225.804722 206.549999) (xy 112.3005 206.549999) (xy 112.3005 205.869999) - (xy 136.804722 205.869999) (xy 136.804722 205.87) (xy 136.823762 206.026818) (xy 136.870669 206.1505) - (xy 136.87978 206.174523) (xy 136.969517 206.30453) (xy 137.08776 206.409283) (xy 137.087762 206.409284) - (xy 137.227634 206.482696) (xy 137.381014 206.5205) (xy 137.381015 206.5205) (xy 137.538985 206.5205) - (xy 137.692365 206.482696) (xy 137.83224 206.409283) (xy 137.950483 206.30453) (xy 138.04022 206.174523) - (xy 138.096237 206.026818) (xy 138.115278 205.87) (xy 138.096237 205.713182) (xy 138.04022 205.565477) - (xy 137.950483 205.43547) (xy 137.83224 205.330717) (xy 137.832238 205.330716) (xy 137.832237 205.330715) - (xy 137.692365 205.257303) (xy 137.538986 205.2195) (xy 137.538985 205.2195) (xy 137.381015 205.2195) - (xy 137.381014 205.2195) (xy 137.227634 205.257303) (xy 137.087762 205.330715) (xy 136.969516 205.435471) - (xy 136.879781 205.565475) (xy 136.87978 205.565476) (xy 136.823762 205.713181) (xy 136.804722 205.869999) - (xy 112.3005 205.869999) (xy 112.3005 204.889999) (xy 113.274722 204.889999) (xy 113.274722 204.89) - (xy 113.293762 205.046818) (xy 113.34978 205.194523) (xy 113.439517 205.32453) (xy 113.55776 205.429283) - (xy 113.557762 205.429284) (xy 113.697634 205.502696) (xy 113.851014 205.5405) (xy 113.851015 205.5405) - (xy 114.008985 205.5405) (xy 114.162365 205.502696) (xy 114.233292 205.46547) (xy 114.30224 205.429283) - (xy 114.420483 205.32453) (xy 114.51022 205.194523) (xy 114.566237 205.046818) (xy 114.585278 204.89) - (xy 114.580361 204.8495) (xy 114.566237 204.733181) (xy 114.544992 204.677164) (xy 114.51022 204.585477) - (xy 114.420483 204.45547) (xy 114.30224 204.350717) (xy 114.302238 204.350716) (xy 114.302237 204.350715) - (xy 114.162365 204.277303) (xy 114.008986 204.2395) (xy 114.008985 204.2395) (xy 113.851015 204.2395) - (xy 113.851014 204.2395) (xy 113.697634 204.277303) (xy 113.557762 204.350715) (xy 113.439516 204.455471) - (xy 113.349781 204.585475) (xy 113.34978 204.585476) (xy 113.293762 204.733181) (xy 113.274722 204.889999) - (xy 112.3005 204.889999) (xy 112.3005 201.3) (xy 126.5 201.3) (xy 126.5 201.6) (xy 137.4 201.6) - (xy 137.4 201.599999) (xy 185.944722 201.599999) (xy 185.944722 201.6) (xy 185.963762 201.756818) + (xy 169.269529 208.769994) (xy 112.3005 208.769994) (xy 112.3005 205.999999) (xy 116.444722 205.999999) + (xy 116.444722 206) (xy 116.463762 206.156818) (xy 116.51978 206.304523) (xy 116.609517 206.43453) + (xy 116.72776 206.539283) (xy 116.727762 206.539284) (xy 116.867634 206.612696) (xy 117.021014 206.6505) + (xy 117.021015 206.6505) (xy 117.178985 206.6505) (xy 117.332365 206.612696) (xy 117.451823 206.549999) + (xy 225.804722 206.549999) (xy 225.804722 206.55) (xy 225.823762 206.706818) (xy 225.87978 206.854523) + (xy 225.969517 206.98453) (xy 226.08776 207.089283) (xy 226.087762 207.089284) (xy 226.227634 207.162696) + (xy 226.381014 207.2005) (xy 226.381015 207.2005) (xy 226.538985 207.2005) (xy 226.692365 207.162696) + (xy 226.83224 207.089283) (xy 226.950483 206.98453) (xy 227.04022 206.854523) (xy 227.096237 206.706818) + (xy 227.115278 206.55) (xy 227.096237 206.393182) (xy 227.04022 206.245477) (xy 226.950483 206.11547) + (xy 226.83224 206.010717) (xy 226.832238 206.010716) (xy 226.832237 206.010715) (xy 226.692365 205.937303) + (xy 226.538986 205.8995) (xy 226.538985 205.8995) (xy 226.381015 205.8995) (xy 226.381014 205.8995) + (xy 226.227634 205.937303) (xy 226.087762 206.010715) (xy 225.969516 206.115471) (xy 225.879781 206.245475) + (xy 225.87978 206.245476) (xy 225.823762 206.393181) (xy 225.804722 206.549999) (xy 117.451823 206.549999) + (xy 117.47224 206.539283) (xy 117.590483 206.43453) (xy 117.68022 206.304523) (xy 117.736237 206.156818) + (xy 117.755278 206) (xy 117.747666 205.937304) (xy 117.739493 205.869999) (xy 136.804722 205.869999) + (xy 136.804722 205.87) (xy 136.823762 206.026818) (xy 136.870669 206.1505) (xy 136.87978 206.174523) + (xy 136.969517 206.30453) (xy 137.08776 206.409283) (xy 137.087762 206.409284) (xy 137.227634 206.482696) + (xy 137.381014 206.5205) (xy 137.381015 206.5205) (xy 137.538985 206.5205) (xy 137.692365 206.482696) + (xy 137.83224 206.409283) (xy 137.950483 206.30453) (xy 138.04022 206.174523) (xy 138.096237 206.026818) + (xy 138.115278 205.87) (xy 138.096237 205.713182) (xy 138.089522 205.695477) (xy 138.051597 205.595476) + (xy 138.04022 205.565477) (xy 137.950483 205.43547) (xy 137.83224 205.330717) (xy 137.832238 205.330716) + (xy 137.832237 205.330715) (xy 137.692365 205.257303) (xy 137.538986 205.2195) (xy 137.538985 205.2195) + (xy 137.381015 205.2195) (xy 137.381014 205.2195) (xy 137.227634 205.257303) (xy 137.087762 205.330715) + (xy 136.969516 205.435471) (xy 136.879781 205.565475) (xy 136.87978 205.565476) (xy 136.823762 205.713181) + (xy 136.804722 205.869999) (xy 117.739493 205.869999) (xy 117.736237 205.843181) (xy 117.698312 205.743182) + (xy 117.68022 205.695477) (xy 117.590483 205.56547) (xy 117.47224 205.460717) (xy 117.472238 205.460716) + (xy 117.472237 205.460715) (xy 117.332365 205.387303) (xy 117.178986 205.3495) (xy 117.178985 205.3495) + (xy 117.021015 205.3495) (xy 117.021014 205.3495) (xy 116.867634 205.387303) (xy 116.727762 205.460715) + (xy 116.609516 205.565471) (xy 116.519781 205.695475) (xy 116.51978 205.695476) (xy 116.463762 205.843181) + (xy 116.444722 205.999999) (xy 112.3005 205.999999) (xy 112.3005 201.3) (xy 126.5 201.3) (xy 126.5 201.6) + (xy 137.4 201.6) (xy 137.4 201.599999) (xy 185.944722 201.599999) (xy 185.944722 201.6) (xy 185.963762 201.756818) (xy 186.01978 201.904523) (xy 186.109517 202.03453) (xy 186.22776 202.139283) (xy 186.227762 202.139284) (xy 186.367634 202.212696) (xy 186.521014 202.2505) (xy 186.521015 202.2505) (xy 186.678985 202.2505) (xy 186.832365 202.212696) (xy 186.97224 202.139283) (xy 187.090483 202.03453) (xy 187.18022 201.904523) @@ -164342,500 +168792,509 @@ (xy 153.674229 193.758723) (xy 153.534357 193.685311) (xy 153.380978 193.647508) (xy 153.380977 193.647508) (xy 153.223007 193.647508) (xy 153.223006 193.647508) (xy 153.069626 193.685311) (xy 152.929754 193.758723) (xy 152.811508 193.863479) (xy 152.721773 193.993483) (xy 152.721772 193.993484) (xy 152.665754 194.141189) - (xy 152.646714 194.298007) (xy 139 194.298007) (xy 139 191.749999) (xy 189.594722 191.749999) (xy 189.594722 191.75) - (xy 189.613762 191.906818) (xy 189.66978 192.054523) (xy 189.759517 192.18453) (xy 189.87776 192.289283) + (xy 152.646714 194.298007) (xy 139 194.298007) (xy 139 191.699999) (xy 155.149722 191.699999) (xy 155.149722 191.7) + (xy 155.168762 191.856818) (xy 155.187725 191.906818) (xy 155.22478 192.004523) (xy 155.314517 192.13453) + (xy 155.43276 192.239283) (xy 155.432762 192.239284) (xy 155.572634 192.312696) (xy 155.726014 192.3505) + (xy 155.726015 192.3505) (xy 155.883985 192.3505) (xy 156.037365 192.312696) (xy 156.081974 192.289283) + (xy 156.17724 192.239283) (xy 156.295483 192.13453) (xy 156.38522 192.004523) (xy 156.441237 191.856818) + (xy 156.454207 191.749999) (xy 189.594722 191.749999) (xy 189.594722 191.75) (xy 189.613762 191.906818) + (xy 189.650818 192.004524) (xy 189.66978 192.054523) (xy 189.759517 192.18453) (xy 189.87776 192.289283) (xy 189.877762 192.289284) (xy 190.017634 192.362696) (xy 190.171014 192.4005) (xy 190.171015 192.4005) - (xy 190.328985 192.4005) (xy 190.482365 192.362696) (xy 190.62224 192.289283) (xy 190.740483 192.18453) - (xy 190.83022 192.054523) (xy 190.886237 191.906818) (xy 190.905278 191.75) (xy 190.886237 191.593182) - (xy 190.83022 191.445477) (xy 190.740483 191.31547) (xy 190.62224 191.210717) (xy 190.622238 191.210716) - (xy 190.622237 191.210715) (xy 190.482365 191.137303) (xy 190.328986 191.0995) (xy 190.328985 191.0995) - (xy 190.171015 191.0995) (xy 190.171014 191.0995) (xy 190.017634 191.137303) (xy 189.877762 191.210715) - (xy 189.759516 191.315471) (xy 189.669781 191.445475) (xy 189.66978 191.445476) (xy 189.613762 191.593181) - (xy 189.594722 191.749999) (xy 139 191.749999) (xy 139 188.955321) (xy 150.8295 188.955321) (xy 150.8295 190.504678) - (xy 150.844032 190.577735) (xy 150.844033 190.577739) (xy 150.844034 190.57774) (xy 150.899399 190.660601) - (xy 150.98226 190.715966) (xy 150.982264 190.715967) (xy 151.055321 190.730499) (xy 151.055324 190.7305) - (xy 151.055326 190.7305) (xy 152.604676 190.7305) (xy 152.604677 190.730499) (xy 152.67774 190.715966) - (xy 152.760601 190.660601) (xy 152.815966 190.57774) (xy 152.8305 190.504674) (xy 152.8305 189.73) - (xy 153.324659 189.73) (xy 153.343975 189.926129) (xy 153.343976 189.926132) (xy 153.398845 190.107011) - (xy 153.401188 190.114733) (xy 153.494086 190.288532) (xy 153.49409 190.288539) (xy 153.619116 190.440883) - (xy 153.77146 190.565909) (xy 153.771467 190.565913) (xy 153.945266 190.658811) (xy 153.945269 190.658811) - (xy 153.945273 190.658814) (xy 154.133868 190.716024) (xy 154.33 190.735341) (xy 154.526132 190.716024) - (xy 154.714727 190.658814) (xy 154.888538 190.56591) (xy 155.040883 190.440883) (xy 155.16591 190.288538) - (xy 155.258814 190.114727) (xy 155.316024 189.926132) (xy 155.335341 189.73) (xy 155.316024 189.533868) - (xy 155.258814 189.345273) (xy 155.258811 189.345269) (xy 155.258811 189.345266) (xy 155.165913 189.171467) - (xy 155.165909 189.17146) (xy 155.040883 189.019116) (xy 154.888539 188.89409) (xy 154.888532 188.894086) - (xy 154.714733 188.801188) (xy 154.714727 188.801186) (xy 154.526132 188.743976) (xy 154.526129 188.743975) - (xy 154.33 188.724659) (xy 154.13387 188.743975) (xy 153.945266 188.801188) (xy 153.771467 188.894086) - (xy 153.77146 188.89409) (xy 153.619116 189.019116) (xy 153.49409 189.17146) (xy 153.494086 189.171467) - (xy 153.401188 189.345266) (xy 153.343975 189.53387) (xy 153.324659 189.73) (xy 152.8305 189.73) - (xy 152.8305 188.955326) (xy 152.8305 188.955323) (xy 152.830499 188.955321) (xy 152.815967 188.882264) - (xy 152.815966 188.88226) (xy 152.774155 188.819685) (xy 152.760601 188.799399) (xy 152.67774 188.744034) - (xy 152.677739 188.744033) (xy 152.677735 188.744032) (xy 152.604677 188.7295) (xy 152.604674 188.7295) - (xy 151.055326 188.7295) (xy 151.055323 188.7295) (xy 150.982264 188.744032) (xy 150.98226 188.744033) - (xy 150.899399 188.799399) (xy 150.844033 188.88226) (xy 150.844032 188.882264) (xy 150.8295 188.955321) - (xy 139 188.955321) (xy 139 188.509999) (xy 155.174722 188.509999) (xy 155.174722 188.51) (xy 155.193762 188.666818) - (xy 155.223047 188.744034) (xy 155.24978 188.814523) (xy 155.339517 188.94453) (xy 155.45776 189.049283) - (xy 155.457762 189.049284) (xy 155.597634 189.122696) (xy 155.751014 189.1605) (xy 155.751015 189.1605) - (xy 155.908985 189.1605) (xy 156.062365 189.122696) (xy 156.068454 189.1195) (xy 156.20224 189.049283) - (xy 156.320483 188.94453) (xy 156.41022 188.814523) (xy 156.466237 188.666818) (xy 156.485278 188.51) - (xy 156.466679 188.356818) (xy 156.466237 188.353181) (xy 156.438602 188.280315) (xy 156.41022 188.205477) - (xy 156.320483 188.07547) (xy 156.20224 187.970717) (xy 156.202238 187.970716) (xy 156.202237 187.970715) - (xy 156.062365 187.897303) (xy 155.908986 187.8595) (xy 155.908985 187.8595) (xy 155.751015 187.8595) - (xy 155.751014 187.8595) (xy 155.597634 187.897303) (xy 155.457762 187.970715) (xy 155.339516 188.075471) - (xy 155.249781 188.205475) (xy 155.24978 188.205476) (xy 155.193762 188.353181) (xy 155.174722 188.509999) - (xy 139 188.509999) (xy 139 187.699999) (xy 165.744722 187.699999) (xy 165.744722 187.7) (xy 165.763762 187.856818) - (xy 165.779117 187.897304) (xy 165.81978 188.004523) (xy 165.909517 188.13453) (xy 166.02776 188.239283) - (xy 166.027762 188.239284) (xy 166.167634 188.312696) (xy 166.321014 188.3505) (xy 166.321015 188.3505) - (xy 166.478985 188.3505) (xy 166.630567 188.313139) (xy 166.700367 188.316208) (xy 166.757429 188.356528) - (xy 166.776182 188.389565) (xy 166.792391 188.432304) (xy 166.81978 188.504523) (xy 166.909517 188.63453) - (xy 167.02776 188.739283) (xy 167.027762 188.739284) (xy 167.167634 188.812696) (xy 167.321014 188.8505) - (xy 167.321015 188.8505) (xy 167.478985 188.8505) (xy 167.632365 188.812696) (xy 167.6577 188.799399) - (xy 167.77224 188.739283) (xy 167.890483 188.63453) (xy 167.98022 188.504523) (xy 168.036237 188.356818) - (xy 168.055278 188.2) (xy 168.040158 188.07547) (xy 168.036237 188.043181) (xy 168.008754 187.970715) - (xy 167.98022 187.895477) (xy 167.890483 187.76547) (xy 167.77224 187.660717) (xy 167.772238 187.660716) - (xy 167.772237 187.660715) (xy 167.632365 187.587303) (xy 167.478986 187.5495) (xy 167.478985 187.5495) - (xy 167.321015 187.5495) (xy 167.321014 187.5495) (xy 167.169433 187.58686) (xy 167.099631 187.58379) - (xy 167.042569 187.54347) (xy 167.023817 187.510434) (xy 166.98022 187.395477) (xy 166.890483 187.26547) - (xy 166.77224 187.160717) (xy 166.772238 187.160716) (xy 166.772237 187.160715) (xy 166.632365 187.087303) - (xy 166.478986 187.0495) (xy 166.478985 187.0495) (xy 166.321015 187.0495) (xy 166.321014 187.0495) - (xy 166.167634 187.087303) (xy 166.027762 187.160715) (xy 165.909516 187.265471) (xy 165.819781 187.395475) - (xy 165.81978 187.395476) (xy 165.763762 187.543181) (xy 165.744722 187.699999) (xy 139 187.699999) - (xy 139 186.6) (xy 126.8 186.6) (xy 126.5 186.6) (xy 126.5 201.3) (xy 112.3005 201.3) (xy 112.3005 186.269999) - (xy 145.344722 186.269999) (xy 145.344722 186.27) (xy 145.363762 186.426818) (xy 145.41978 186.574523) - (xy 145.509517 186.70453) (xy 145.62776 186.809283) (xy 145.627762 186.809284) (xy 145.767634 186.882696) - (xy 145.921014 186.9205) (xy 145.921015 186.9205) (xy 146.078985 186.9205) (xy 146.232365 186.882696) - (xy 146.37224 186.809283) (xy 146.490483 186.70453) (xy 146.58022 186.574523) (xy 146.636237 186.426818) - (xy 146.653804 186.282142) (xy 149.344722 186.282142) (xy 149.344722 186.282143) (xy 149.363762 186.438961) - (xy 149.415175 186.574523) (xy 149.41978 186.586666) (xy 149.509517 186.716673) (xy 149.62776 186.821426) - (xy 149.627762 186.821427) (xy 149.767634 186.894839) (xy 149.921014 186.932643) (xy 149.921015 186.932643) - (xy 150.078985 186.932643) (xy 150.232365 186.894839) (xy 150.255501 186.882696) (xy 150.37224 186.821426) - (xy 150.490483 186.716673) (xy 150.58022 186.586666) (xy 150.636237 186.438961) (xy 150.655278 186.282143) - (xy 150.653804 186.269999) (xy 150.636237 186.125324) (xy 150.612485 186.062696) (xy 150.58022 185.97762) - (xy 150.490483 185.847613) (xy 150.37224 185.74286) (xy 150.372238 185.742859) (xy 150.372237 185.742858) - (xy 150.232365 185.669446) (xy 150.078986 185.631643) (xy 150.078985 185.631643) (xy 149.921015 185.631643) - (xy 149.921014 185.631643) (xy 149.767634 185.669446) (xy 149.627762 185.742858) (xy 149.509516 185.847614) - (xy 149.419781 185.977618) (xy 149.41978 185.977619) (xy 149.363762 186.125324) (xy 149.344722 186.282142) - (xy 146.653804 186.282142) (xy 146.655278 186.27) (xy 146.637712 186.125325) (xy 146.636237 186.113181) - (xy 146.614992 186.057164) (xy 146.58022 185.965477) (xy 146.490483 185.83547) (xy 146.37224 185.730717) - (xy 146.372238 185.730716) (xy 146.372237 185.730715) (xy 146.232365 185.657303) (xy 146.078986 185.6195) - (xy 146.078985 185.6195) (xy 145.921015 185.6195) (xy 145.921014 185.6195) (xy 145.767634 185.657303) - (xy 145.627762 185.730715) (xy 145.509516 185.835471) (xy 145.419781 185.965475) (xy 145.41978 185.965476) - (xy 145.363762 186.113181) (xy 145.344722 186.269999) (xy 112.3005 186.269999) (xy 112.3005 185.449999) - (xy 156.144722 185.449999) (xy 156.144722 185.45) (xy 156.163762 185.606818) (xy 156.215356 185.742858) - (xy 156.21978 185.754523) (xy 156.309517 185.88453) (xy 156.42776 185.989283) (xy 156.427762 185.989284) - (xy 156.567634 186.062696) (xy 156.721014 186.1005) (xy 156.721015 186.1005) (xy 156.878985 186.1005) - (xy 157.032365 186.062696) (xy 157.17224 185.989283) (xy 157.290483 185.88453) (xy 157.38022 185.754523) - (xy 157.436237 185.606818) (xy 157.455278 185.45) (xy 157.453401 185.434537) (xy 157.436237 185.293181) - (xy 157.400093 185.197879) (xy 157.38022 185.145477) (xy 157.290483 185.01547) (xy 157.17224 184.910717) - (xy 157.172238 184.910716) (xy 157.172237 184.910715) (xy 157.032365 184.837303) (xy 156.878986 184.7995) - (xy 156.878985 184.7995) (xy 156.721015 184.7995) (xy 156.721014 184.7995) (xy 156.567634 184.837303) - (xy 156.427762 184.910715) (xy 156.399415 184.935828) (xy 156.326973 185.000006) (xy 156.309516 185.015471) - (xy 156.219781 185.145475) (xy 156.21978 185.145476) (xy 156.163762 185.293181) (xy 156.144722 185.449999) - (xy 112.3005 185.449999) (xy 112.3005 183.864992) (xy 165.704529 183.864992) (xy 165.704529 183.865003) - (xy 165.724379 184.104557) (xy 165.783389 184.337587) (xy 165.879951 184.557727) (xy 166.011427 184.758964) - (xy 166.011429 184.758967) (xy 166.174236 184.935823) (xy 166.174239 184.935825) (xy 166.174242 184.935828) - (xy 166.363924 185.083464) (xy 166.36393 185.083468) (xy 166.363933 185.08347) (xy 166.575344 185.19788) - (xy 166.575347 185.197881) (xy 166.802699 185.275931) (xy 166.802701 185.275931) (xy 166.802703 185.275932) - (xy 167.039808 185.315498) (xy 167.039809 185.315498) (xy 167.280191 185.315498) (xy 167.280192 185.315498) - (xy 167.517297 185.275932) (xy 167.744656 185.19788) (xy 167.956067 185.08347) (xy 168.145764 184.935823) - (xy 168.145768 184.935817) (xy 168.147566 184.934419) (xy 168.21256 184.908776) (xy 168.2811 184.922342) - (xy 168.331425 184.97081) (xy 168.346825 185.017325) (xy 168.363763 185.156819) (xy 168.408937 185.275932) - (xy 168.41978 185.304523) (xy 168.509517 185.43453) (xy 168.62776 185.539283) (xy 168.627762 185.539284) - (xy 168.767634 185.612696) (xy 168.921014 185.6505) (xy 168.921015 185.6505) (xy 169.078985 185.6505) - (xy 169.232365 185.612696) (xy 169.243564 185.606818) (xy 169.37224 185.539283) (xy 169.490483 185.43453) - (xy 169.58022 185.304523) (xy 169.584053 185.294415) (xy 169.62623 185.238713) (xy 169.691828 185.214655) - (xy 169.760018 185.229881) (xy 169.809152 185.279557) (xy 169.815934 185.294407) (xy 169.819771 185.304524) - (xy 169.819774 185.304532) (xy 169.864641 185.369533) (xy 169.90951 185.434537) (xy 170.027753 185.53929) - (xy 170.027755 185.539291) (xy 170.167627 185.612703) (xy 170.321007 185.650507) (xy 170.321008 185.650507) - (xy 170.478978 185.650507) (xy 170.632358 185.612703) (xy 170.643571 185.606818) (xy 170.772233 185.53929) - (xy 170.890476 185.434537) (xy 170.980213 185.30453) (xy 171.03623 185.156825) (xy 171.055271 185.000007) - (xy 171.03623 184.843189) (xy 171.036227 184.843182) (xy 171.004288 184.758964) (xy 170.980213 184.695484) - (xy 170.890476 184.565477) (xy 170.772233 184.460724) (xy 170.772231 184.460723) (xy 170.77223 184.460722) - (xy 170.632358 184.38731) (xy 170.478979 184.349507) (xy 170.478978 184.349507) (xy 170.321008 184.349507) - (xy 170.321007 184.349507) (xy 170.167627 184.38731) (xy 170.027755 184.460722) (xy 169.909509 184.565478) - (xy 169.819774 184.695482) (xy 169.81977 184.695488) (xy 169.815936 184.705598) (xy 169.773755 184.761298) - (xy 169.708156 184.785351) (xy 169.639966 184.77012) (xy 169.590836 184.720441) (xy 169.584058 184.705598) - (xy 169.58022 184.695477) (xy 169.490483 184.56547) (xy 169.37224 184.460717) (xy 169.372238 184.460716) - (xy 169.372237 184.460715) (xy 169.232365 184.387303) (xy 169.078986 184.3495) (xy 169.078985 184.3495) - (xy 168.921015 184.3495) (xy 168.921014 184.3495) (xy 168.767634 184.387303) (xy 168.767633 184.387304) - (xy 168.732723 184.405626) (xy 168.664215 184.41935) (xy 168.599162 184.393857) (xy 168.558219 184.337241) - (xy 168.554384 184.267477) (xy 168.554893 184.265389) (xy 168.59562 184.104561) (xy 168.615471 183.864998) - (xy 168.615471 183.864992) (xy 179.174529 183.864992) (xy 179.174529 183.865003) (xy 179.194379 184.104557) - (xy 179.253389 184.337587) (xy 179.349951 184.557727) (xy 179.481427 184.758964) (xy 179.481429 184.758967) - (xy 179.644236 184.935823) (xy 179.644239 184.935825) (xy 179.644242 184.935828) (xy 179.833924 185.083464) - (xy 179.83393 185.083468) (xy 179.833933 185.08347) (xy 180.045344 185.19788) (xy 180.045347 185.197881) - (xy 180.272699 185.275931) (xy 180.272701 185.275931) (xy 180.272703 185.275932) (xy 180.509808 185.315498) - (xy 180.509809 185.315498) (xy 180.750191 185.315498) (xy 180.750192 185.315498) (xy 180.987297 185.275932) - (xy 181.214656 185.19788) (xy 181.426067 185.08347) (xy 181.615764 184.935823) (xy 181.778571 184.758967) - (xy 181.910049 184.557726) (xy 182.00661 184.337589) (xy 182.06562 184.104561) (xy 182.085471 183.864998) - (xy 182.06562 183.625435) (xy 182.00661 183.392407) (xy 181.910049 183.17227) (xy 181.85806 183.092696) - (xy 181.778572 182.971031) (xy 181.778571 182.971029) (xy 181.615764 182.794173) (xy 181.615759 182.794169) - (xy 181.615757 182.794167) (xy 181.426075 182.646531) (xy 181.426069 182.646527) (xy 181.214657 182.532116) - (xy 181.214652 182.532114) (xy 180.9873 182.454064) (xy 180.809468 182.424389) (xy 180.750192 182.414498) - (xy 180.509808 182.414498) (xy 180.462387 182.422411) (xy 180.272699 182.454064) (xy 180.045347 182.532114) - (xy 180.045342 182.532116) (xy 179.83393 182.646527) (xy 179.833924 182.646531) (xy 179.644242 182.794167) - (xy 179.644239 182.79417) (xy 179.48143 182.971027) (xy 179.481427 182.971031) (xy 179.349951 183.172268) - (xy 179.253389 183.392408) (xy 179.194379 183.625438) (xy 179.174529 183.864992) (xy 168.615471 183.864992) - (xy 168.59562 183.625435) (xy 168.53661 183.392407) (xy 168.440049 183.17227) (xy 168.38806 183.092696) - (xy 168.308572 182.971031) (xy 168.308571 182.971029) (xy 168.145764 182.794173) (xy 168.145759 182.794169) - (xy 168.145757 182.794167) (xy 167.956075 182.646531) (xy 167.956069 182.646527) (xy 167.744657 182.532116) - (xy 167.744652 182.532114) (xy 167.5173 182.454064) (xy 167.339468 182.424389) (xy 167.280192 182.414498) - (xy 167.039808 182.414498) (xy 166.992387 182.422411) (xy 166.802699 182.454064) (xy 166.575347 182.532114) - (xy 166.575342 182.532116) (xy 166.36393 182.646527) (xy 166.363924 182.646531) (xy 166.174242 182.794167) - (xy 166.174239 182.79417) (xy 166.01143 182.971027) (xy 166.011427 182.971031) (xy 165.879951 183.172268) - (xy 165.783389 183.392408) (xy 165.724379 183.625438) (xy 165.704529 183.864992) (xy 112.3005 183.864992) - (xy 112.3005 180.464992) (xy 165.704529 180.464992) (xy 165.704529 180.465003) (xy 165.724379 180.704557) - (xy 165.783389 180.937587) (xy 165.879951 181.157727) (xy 165.995462 181.334528) (xy 166.011429 181.358967) - (xy 166.174236 181.535823) (xy 166.174239 181.535825) (xy 166.174242 181.535828) (xy 166.363924 181.683464) - (xy 166.36393 181.683468) (xy 166.363933 181.68347) (xy 166.575344 181.79788) (xy 166.575347 181.797881) - (xy 166.802699 181.875931) (xy 166.802701 181.875931) (xy 166.802703 181.875932) (xy 167.039808 181.915498) - (xy 167.039809 181.915498) (xy 167.280191 181.915498) (xy 167.280192 181.915498) (xy 167.517297 181.875932) - (xy 167.744656 181.79788) (xy 167.956067 181.68347) (xy 168.145764 181.535823) (xy 168.308571 181.358967) - (xy 168.440049 181.157726) (xy 168.53661 180.937589) (xy 168.546129 180.899999) (xy 171.944722 180.899999) - (xy 171.944722 180.9) (xy 171.963762 181.056818) (xy 172.01978 181.204523) (xy 172.109517 181.33453) - (xy 172.22776 181.439283) (xy 172.227762 181.439284) (xy 172.367634 181.512696) (xy 172.521014 181.5505) - (xy 172.521015 181.5505) (xy 172.678985 181.5505) (xy 172.832365 181.512696) (xy 172.97224 181.439283) - (xy 173.090483 181.33453) (xy 173.18022 181.204523) (xy 173.236237 181.056818) (xy 173.255278 180.9) - (xy 173.236237 180.743182) (xy 173.18022 180.595477) (xy 173.090483 180.46547) (xy 172.97224 180.360717) - (xy 172.972238 180.360716) (xy 172.972237 180.360715) (xy 172.832365 180.287303) (xy 172.678986 180.2495) - (xy 172.678985 180.2495) (xy 172.521015 180.2495) (xy 172.521014 180.2495) (xy 172.367634 180.287303) - (xy 172.227762 180.360715) (xy 172.109516 180.465471) (xy 172.019781 180.595475) (xy 172.01978 180.595476) - (xy 171.963762 180.743181) (xy 171.944722 180.899999) (xy 168.546129 180.899999) (xy 168.59562 180.704561) - (xy 168.604659 180.595475) (xy 168.615471 180.465003) (xy 168.615471 180.464992) (xy 168.59562 180.225438) - (xy 168.59562 180.225435) (xy 168.563351 180.098007) (xy 173.44273 180.098007) (xy 173.44273 180.098008) - (xy 173.46177 180.254826) (xy 173.501929 180.360715) (xy 173.517788 180.402531) (xy 173.607525 180.532538) - (xy 173.725768 180.637291) (xy 173.72577 180.637292) (xy 173.865642 180.710704) (xy 174.019022 180.748508) - (xy 174.019023 180.748508) (xy 174.176993 180.748508) (xy 174.330373 180.710704) (xy 174.342085 180.704557) - (xy 174.470248 180.637291) (xy 174.588491 180.532538) (xy 174.678228 180.402531) (xy 174.734245 180.254826) - (xy 174.753286 180.098008) (xy 174.734245 179.94119) (xy 174.678228 179.793485) (xy 174.588491 179.663478) - (xy 174.470248 179.558725) (xy 174.470246 179.558724) (xy 174.470245 179.558723) (xy 174.330373 179.485311) - (xy 174.176994 179.447508) (xy 174.176993 179.447508) (xy 174.019023 179.447508) (xy 174.019022 179.447508) - (xy 173.865642 179.485311) (xy 173.72577 179.558723) (xy 173.607524 179.663479) (xy 173.517789 179.793483) - (xy 173.517788 179.793484) (xy 173.46177 179.941189) (xy 173.44273 180.098007) (xy 168.563351 180.098007) - (xy 168.53661 179.992407) (xy 168.440049 179.77227) (xy 168.308571 179.571029) (xy 168.145764 179.394173) - (xy 168.145759 179.394169) (xy 168.145757 179.394167) (xy 167.956075 179.246531) (xy 167.956069 179.246527) - (xy 167.944598 179.240319) (xy 179.1795 179.240319) (xy 179.1795 181.689676) (xy 179.194032 181.762733) - (xy 179.194033 181.762737) (xy 179.194034 181.762738) (xy 179.249399 181.845599) (xy 179.33226 181.900964) - (xy 179.332264 181.900965) (xy 179.405321 181.915497) (xy 179.405324 181.915498) (xy 179.405326 181.915498) - (xy 181.854676 181.915498) (xy 181.854677 181.915497) (xy 181.92774 181.900964) (xy 182.010601 181.845599) - (xy 182.065966 181.762738) (xy 182.0805 181.689672) (xy 182.0805 179.240324) (xy 182.0805 179.240321) - (xy 182.080499 179.240319) (xy 182.065967 179.167262) (xy 182.065966 179.167258) (xy 182.042484 179.132114) - (xy 182.010601 179.084397) (xy 181.92774 179.029032) (xy 181.927739 179.029031) (xy 181.927735 179.02903) - (xy 181.854677 179.014498) (xy 181.854674 179.014498) (xy 179.405326 179.014498) (xy 179.405323 179.014498) - (xy 179.332264 179.02903) (xy 179.33226 179.029031) (xy 179.249399 179.084397) (xy 179.194033 179.167258) - (xy 179.194032 179.167262) (xy 179.1795 179.240319) (xy 167.944598 179.240319) (xy 167.744657 179.132116) - (xy 167.744652 179.132114) (xy 167.5173 179.054064) (xy 167.339468 179.024389) (xy 167.280192 179.014498) - (xy 167.039808 179.014498) (xy 166.992387 179.022411) (xy 166.802699 179.054064) (xy 166.575347 179.132114) - (xy 166.575342 179.132116) (xy 166.36393 179.246527) (xy 166.363924 179.246531) (xy 166.174242 179.394167) - (xy 166.174239 179.39417) (xy 166.01143 179.571027) (xy 166.011427 179.571031) (xy 165.879951 179.772268) - (xy 165.783389 179.992408) (xy 165.724379 180.225438) (xy 165.704529 180.464992) (xy 112.3005 180.464992) - (xy 112.3005 178.399999) (xy 187.144722 178.399999) (xy 187.144722 178.4) (xy 187.163762 178.556818) - (xy 187.21978 178.704523) (xy 187.309517 178.83453) (xy 187.42776 178.939283) (xy 187.427762 178.939284) - (xy 187.567634 179.012696) (xy 187.721014 179.0505) (xy 187.721015 179.0505) (xy 187.878985 179.0505) - (xy 188.032365 179.012696) (xy 188.17224 178.939283) (xy 188.290483 178.83453) (xy 188.38022 178.704523) - (xy 188.436237 178.556818) (xy 188.446172 178.474999) (xy 192.144722 178.474999) (xy 192.144722 178.475) - (xy 192.163762 178.631818) (xy 192.21978 178.779523) (xy 192.309517 178.90953) (xy 192.42776 179.014283) - (xy 192.427762 179.014284) (xy 192.567634 179.087696) (xy 192.721014 179.1255) (xy 192.721015 179.1255) - (xy 192.878985 179.1255) (xy 193.032365 179.087696) (xy 193.038651 179.084397) (xy 193.17224 179.014283) - (xy 193.290483 178.90953) (xy 193.38022 178.779523) (xy 193.436237 178.631818) (xy 193.455278 178.475) - (xy 193.448253 178.417146) (xy 193.459713 178.348226) (xy 193.506616 178.29644) (xy 193.574072 178.278232) - (xy 193.628975 178.292406) (xy 193.667634 178.312696) (xy 193.821014 178.3505) (xy 193.821015 178.3505) - (xy 193.978985 178.3505) (xy 194.132365 178.312696) (xy 194.171024 178.292406) (xy 194.27224 178.239283) - (xy 194.390483 178.13453) (xy 194.48022 178.004523) (xy 194.536237 177.856818) (xy 194.555278 177.7) - (xy 194.536237 177.543182) (xy 194.48022 177.395477) (xy 194.390483 177.26547) (xy 194.27224 177.160717) - (xy 194.272238 177.160716) (xy 194.272237 177.160715) (xy 194.132365 177.087303) (xy 193.978986 177.0495) - (xy 193.978985 177.0495) (xy 193.821015 177.0495) (xy 193.821014 177.0495) (xy 193.667634 177.087303) - (xy 193.527762 177.160715) (xy 193.409516 177.265471) (xy 193.319781 177.395475) (xy 193.31978 177.395476) - (xy 193.263762 177.543181) (xy 193.244722 177.699999) (xy 193.244722 177.7) (xy 193.251746 177.757851) - (xy 193.240285 177.826774) (xy 193.193381 177.87856) (xy 193.125925 177.896767) (xy 193.071025 177.882594) - (xy 193.032364 177.862303) (xy 192.878986 177.8245) (xy 192.878985 177.8245) (xy 192.721015 177.8245) - (xy 192.721014 177.8245) (xy 192.567634 177.862303) (xy 192.427762 177.935715) (xy 192.309516 178.040471) - (xy 192.219781 178.170475) (xy 192.21978 178.170476) (xy 192.163762 178.318181) (xy 192.144722 178.474999) - (xy 188.446172 178.474999) (xy 188.455278 178.4) (xy 188.441854 178.289445) (xy 188.453314 178.220523) - (xy 188.500218 178.168737) (xy 188.56495 178.1505) (xy 188.578985 178.1505) (xy 188.732365 178.112696) - (xy 188.87224 178.039283) (xy 188.990483 177.93453) (xy 189.08022 177.804523) (xy 189.136237 177.656818) - (xy 189.155278 177.5) (xy 189.142587 177.395475) (xy 189.136237 177.343181) (xy 189.106765 177.26547) - (xy 189.08022 177.195477) (xy 188.990483 177.06547) (xy 188.87224 176.960717) (xy 188.872238 176.960716) - (xy 188.872237 176.960715) (xy 188.732365 176.887303) (xy 188.578986 176.8495) (xy 188.578985 176.8495) - (xy 188.421015 176.8495) (xy 188.421014 176.8495) (xy 188.267634 176.887303) (xy 188.127762 176.960715) - (xy 188.009516 177.065471) (xy 187.919781 177.195475) (xy 187.91978 177.195476) (xy 187.863762 177.343181) - (xy 187.857413 177.395476) (xy 187.844722 177.5) (xy 187.858145 177.610554) (xy 187.846686 177.679477) - (xy 187.799782 177.731263) (xy 187.73505 177.7495) (xy 187.721014 177.7495) (xy 187.567634 177.787303) - (xy 187.427762 177.860715) (xy 187.309516 177.965471) (xy 187.219781 178.095475) (xy 187.21978 178.095476) - (xy 187.163762 178.243181) (xy 187.144722 178.399999) (xy 112.3005 178.399999) (xy 112.3005 177.499999) - (xy 174.744718 177.499999) (xy 174.744718 177.5) (xy 174.763758 177.656818) (xy 174.813245 177.787303) - (xy 174.819776 177.804523) (xy 174.909513 177.93453) (xy 175.027756 178.039283) (xy 175.027758 178.039284) - (xy 175.16763 178.112696) (xy 175.32101 178.1505) (xy 175.321011 178.1505) (xy 175.478981 178.1505) - (xy 175.632361 178.112696) (xy 175.772236 178.039283) (xy 175.890479 177.93453) (xy 175.897948 177.923708) - (xy 175.95223 177.879719) (xy 176.021679 177.872059) (xy 176.084244 177.903162) (xy 176.102048 177.923709) - (xy 176.109515 177.934528) (xy 176.109517 177.93453) (xy 176.22776 178.039283) (xy 176.227762 178.039284) - (xy 176.367634 178.112696) (xy 176.521014 178.1505) (xy 176.521015 178.1505) (xy 176.678985 178.1505) - (xy 176.832365 178.112696) (xy 176.97224 178.039283) (xy 177.090483 177.93453) (xy 177.18022 177.804523) - (xy 177.236237 177.656818) (xy 177.255278 177.5) (xy 177.242587 177.395475) (xy 177.236237 177.343181) - (xy 177.206765 177.26547) (xy 177.18022 177.195477) (xy 177.090483 177.06547) (xy 176.97224 176.960717) - (xy 176.972238 176.960716) (xy 176.972237 176.960715) (xy 176.832365 176.887303) (xy 176.678986 176.8495) - (xy 176.678985 176.8495) (xy 176.521015 176.8495) (xy 176.521014 176.8495) (xy 176.367634 176.887303) - (xy 176.227762 176.960715) (xy 176.109514 177.065472) (xy 176.102046 177.076292) (xy 176.047763 177.120281) - (xy 175.978314 177.127939) (xy 175.91575 177.096835) (xy 175.89795 177.076292) (xy 175.890481 177.065472) - (xy 175.872452 177.0495) (xy 175.772236 176.960717) (xy 175.772234 176.960716) (xy 175.772233 176.960715) - (xy 175.632361 176.887303) (xy 175.478982 176.8495) (xy 175.478981 176.8495) (xy 175.321011 176.8495) - (xy 175.32101 176.8495) (xy 175.16763 176.887303) (xy 175.027758 176.960715) (xy 174.909512 177.065471) - (xy 174.819777 177.195475) (xy 174.819776 177.195476) (xy 174.763758 177.343181) (xy 174.744718 177.499999) - (xy 112.3005 177.499999) (xy 112.3005 175.605057) (xy 118.701302 175.605057) (xy 118.720618 175.801186) - (xy 118.777831 175.98979) (xy 118.870729 176.163589) (xy 118.870733 176.163596) (xy 118.995759 176.31594) - (xy 119.148103 176.440966) (xy 119.14811 176.44097) (xy 119.321909 176.533868) (xy 119.321912 176.533868) - (xy 119.321916 176.533871) (xy 119.510511 176.591081) (xy 119.706643 176.610398) (xy 119.902775 176.591081) - (xy 120.09137 176.533871) (xy 120.265181 176.440967) (xy 120.417526 176.31594) (xy 120.542553 176.163595) - (xy 120.635457 175.989784) (xy 120.692667 175.801189) (xy 120.711984 175.605057) (xy 120.692667 175.408925) - (xy 120.635457 175.22033) (xy 120.635454 175.220326) (xy 120.635454 175.220323) (xy 120.542556 175.046524) - (xy 120.542552 175.046517) (xy 120.417526 174.894173) (xy 120.339792 174.830378) (xy 121.206143 174.830378) - (xy 121.206143 176.379735) (xy 121.220675 176.452792) (xy 121.220676 176.452796) (xy 121.220677 176.452797) - (xy 121.276042 176.535658) (xy 121.358903 176.591023) (xy 121.358907 176.591024) (xy 121.431964 176.605556) - (xy 121.431967 176.605557) (xy 121.431969 176.605557) (xy 122.981319 176.605557) (xy 122.98132 176.605556) - (xy 123.054383 176.591023) (xy 123.137244 176.535658) (xy 123.192609 176.452797) (xy 123.207143 176.379731) - (xy 123.207143 174.830383) (xy 123.207143 174.83038) (xy 123.207142 174.830378) (xy 123.19261 174.757321) - (xy 123.192609 174.757317) (xy 123.137244 174.674456) (xy 123.054383 174.619091) (xy 123.054382 174.61909) - (xy 123.054378 174.619089) (xy 122.98132 174.604557) (xy 122.981317 174.604557) (xy 122.669075 174.604557) - (xy 122.602036 174.584872) (xy 122.556281 174.532068) (xy 122.546337 174.46291) (xy 122.575362 174.399354) - (xy 122.586848 174.387741) (xy 122.590473 174.38453) (xy 122.68021 174.254523) (xy 122.736227 174.106818) - (xy 122.755268 173.95) (xy 122.736227 173.793182) (xy 122.68021 173.645477) (xy 122.590473 173.51547) - (xy 122.47223 173.410717) (xy 122.472228 173.410716) (xy 122.472227 173.410715) (xy 122.332355 173.337303) - (xy 122.178976 173.2995) (xy 122.178975 173.2995) (xy 122.021005 173.2995) (xy 122.021004 173.2995) - (xy 121.867624 173.337303) (xy 121.727752 173.410715) (xy 121.609506 173.515471) (xy 121.519771 173.645475) - (xy 121.51977 173.645476) (xy 121.463752 173.793181) (xy 121.444712 173.949999) (xy 121.444712 173.95) - (xy 121.463752 174.106818) (xy 121.51977 174.254523) (xy 121.519771 174.254524) (xy 121.609506 174.384529) - (xy 121.613132 174.387741) (xy 121.650259 174.446931) (xy 121.649491 174.516796) (xy 121.611074 174.575156) - (xy 121.547203 174.603481) (xy 121.530905 174.604557) (xy 121.431966 174.604557) (xy 121.358907 174.619089) - (xy 121.358903 174.61909) (xy 121.276042 174.674456) (xy 121.220676 174.757317) (xy 121.220675 174.757321) - (xy 121.206143 174.830378) (xy 120.339792 174.830378) (xy 120.265182 174.769147) (xy 120.265175 174.769143) - (xy 120.091376 174.676245) (xy 120.09137 174.676243) (xy 119.902775 174.619033) (xy 119.902772 174.619032) - (xy 119.706643 174.599716) (xy 119.510513 174.619032) (xy 119.321909 174.676245) (xy 119.14811 174.769143) - (xy 119.148103 174.769147) (xy 118.995759 174.894173) (xy 118.870733 175.046517) (xy 118.870729 175.046524) - (xy 118.777831 175.220323) (xy 118.720618 175.408927) (xy 118.701302 175.605057) (xy 112.3005 175.605057) - (xy 112.3005 172.399999) (xy 119.944722 172.399999) (xy 119.944722 172.4) (xy 119.963762 172.556818) - (xy 120.01978 172.704523) (xy 120.109517 172.83453) (xy 120.22776 172.939283) (xy 120.227762 172.939284) - (xy 120.367634 173.012696) (xy 120.521014 173.0505) (xy 120.521015 173.0505) (xy 120.678985 173.0505) - (xy 120.832365 173.012696) (xy 120.97224 172.939283) (xy 121.090483 172.83453) (xy 121.18022 172.704523) - (xy 121.236237 172.556818) (xy 121.255278 172.4) (xy 121.236237 172.243182) (xy 121.18022 172.095477) - (xy 121.090483 171.96547) (xy 120.97224 171.860717) (xy 120.972238 171.860716) (xy 120.972237 171.860715) - (xy 120.832365 171.787303) (xy 120.678986 171.7495) (xy 120.678985 171.7495) (xy 120.521015 171.7495) - (xy 120.521014 171.7495) (xy 120.367634 171.787303) (xy 120.227762 171.860715) (xy 120.109516 171.965471) - (xy 120.019781 172.095475) (xy 120.01978 172.095476) (xy 119.963762 172.243181) (xy 119.944722 172.399999) - (xy 112.3005 172.399999) (xy 112.3005 170.965055) (xy 121.371364 170.965055) (xy 121.371364 170.965056) - (xy 121.390404 171.121874) (xy 121.446422 171.269579) (xy 121.536159 171.399586) (xy 121.654402 171.504339) - (xy 121.654404 171.50434) (xy 121.794276 171.577752) (xy 121.947656 171.615556) (xy 121.947657 171.615556) - (xy 122.105627 171.615556) (xy 122.259007 171.577752) (xy 122.398882 171.504339) (xy 122.517125 171.399586) - (xy 122.606862 171.269579) (xy 122.662879 171.121874) (xy 122.68192 170.965056) (xy 122.662879 170.808238) - (xy 122.606862 170.660533) (xy 122.517125 170.530526) (xy 122.398882 170.425773) (xy 122.39888 170.425772) - (xy 122.398879 170.425771) (xy 122.259007 170.352359) (xy 122.105628 170.314556) (xy 122.105627 170.314556) - (xy 121.947657 170.314556) (xy 121.947656 170.314556) (xy 121.794276 170.352359) (xy 121.654404 170.425771) - (xy 121.536158 170.530527) (xy 121.446423 170.660531) (xy 121.446422 170.660532) (xy 121.390404 170.808237) - (xy 121.371364 170.965055) (xy 112.3005 170.965055) (xy 112.3005 169.999999) (xy 189.144722 169.999999) - (xy 189.144722 170) (xy 189.163762 170.156818) (xy 189.21978 170.304523) (xy 189.309517 170.43453) - (xy 189.42776 170.539283) (xy 189.427762 170.539284) (xy 189.567634 170.612696) (xy 189.721014 170.6505) - (xy 189.721015 170.6505) (xy 189.878985 170.6505) (xy 190.032365 170.612696) (xy 190.17224 170.539283) - (xy 190.290483 170.43453) (xy 190.38022 170.304523) (xy 190.436237 170.156818) (xy 190.455278 170) - (xy 190.455278 169.999999) (xy 190.456182 169.992555) (xy 190.459224 169.992924) (xy 190.474963 169.939324) - (xy 190.527767 169.893569) (xy 190.596925 169.883625) (xy 190.636902 169.896566) (xy 190.667635 169.912696) - (xy 190.744325 169.931598) (xy 190.821014 169.9505) (xy 190.821015 169.9505) (xy 190.978985 169.9505) - (xy 191.132365 169.912696) (xy 191.187754 169.883625) (xy 191.27224 169.839283) (xy 191.390483 169.73453) - (xy 191.48022 169.604523) (xy 191.536237 169.456818) (xy 191.555278 169.3) (xy 191.540589 169.179025) - (xy 191.552049 169.110103) (xy 191.598953 169.058317) (xy 191.666409 169.04011) (xy 191.693359 169.043683) - (xy 191.721013 169.050499) (xy 191.721014 169.0505) (xy 191.721015 169.0505) (xy 191.878985 169.0505) - (xy 192.032365 169.012696) (xy 192.043564 169.006818) (xy 192.17224 168.939283) (xy 192.290483 168.83453) - (xy 192.38022 168.704523) (xy 192.436237 168.556818) (xy 192.455278 168.4) (xy 192.436237 168.243182) - (xy 192.436236 168.243179) (xy 192.436236 168.243178) (xy 192.426866 168.21847) (xy 192.425443 168.199999) - (xy 194.944722 168.199999) (xy 194.944722 168.2) (xy 194.963762 168.356818) (xy 195.019266 168.503169) - (xy 195.01978 168.504523) (xy 195.109517 168.63453) (xy 195.22776 168.739283) (xy 195.227762 168.739284) - (xy 195.367634 168.812696) (xy 195.521014 168.8505) (xy 195.521015 168.8505) (xy 195.678985 168.8505) - (xy 195.832365 168.812696) (xy 195.972238 168.739284) (xy 195.972237 168.739284) (xy 195.97224 168.739283) - (xy 196.037129 168.681797) (xy 196.100362 168.652075) (xy 196.169626 168.661259) (xy 196.201579 168.681793) - (xy 196.227236 168.704523) (xy 196.277762 168.749285) (xy 196.417634 168.822696) (xy 196.571014 168.8605) - (xy 196.571015 168.8605) (xy 196.728985 168.8605) (xy 196.882365 168.822696) (xy 196.925793 168.799903) - (xy 197.02224 168.749283) (xy 197.122774 168.660218) (xy 197.186006 168.630498) (xy 197.25527 168.639682) - (xy 197.287224 168.660217) (xy 197.38776 168.749283) (xy 197.387762 168.749284) (xy 197.527634 168.822696) - (xy 197.681014 168.8605) (xy 197.681015 168.8605) (xy 197.838985 168.8605) (xy 197.992365 168.822696) - (xy 198.035793 168.799903) (xy 198.13224 168.749283) (xy 198.250483 168.64453) (xy 198.34022 168.514523) - (xy 198.396237 168.366818) (xy 198.415278 168.21) (xy 198.415278 168.209999) (xy 198.669722 168.209999) - (xy 198.669722 168.21) (xy 198.688762 168.366818) (xy 198.740988 168.504524) (xy 198.74478 168.514523) - (xy 198.834517 168.64453) (xy 198.95276 168.749283) (xy 198.952762 168.749284) (xy 199.092634 168.822696) - (xy 199.246014 168.8605) (xy 199.246015 168.8605) (xy 199.403985 168.8605) (xy 199.44659 168.849999) - (xy 200.844722 168.849999) (xy 200.844722 168.85) (xy 200.863762 169.006818) (xy 200.915479 169.143182) - (xy 200.91978 169.154523) (xy 201.009517 169.28453) (xy 201.12776 169.389283) (xy 201.127762 169.389284) - (xy 201.267634 169.462696) (xy 201.421014 169.5005) (xy 201.421015 169.5005) (xy 201.578985 169.5005) - (xy 201.732365 169.462696) (xy 201.744601 169.456274) (xy 201.87224 169.389283) (xy 201.990483 169.28453) - (xy 202.08022 169.154523) (xy 202.136237 169.006818) (xy 202.155278 168.85) (xy 202.136237 168.693182) - (xy 202.134007 168.687303) (xy 202.082337 168.55106) (xy 202.08022 168.545477) (xy 201.990483 168.41547) - (xy 201.87224 168.310717) (xy 201.872238 168.310716) (xy 201.872237 168.310715) (xy 201.732365 168.237303) - (xy 201.578986 168.1995) (xy 201.578985 168.1995) (xy 201.421015 168.1995) (xy 201.421014 168.1995) - (xy 201.267634 168.237303) (xy 201.127762 168.310715) (xy 201.12776 168.310717) (xy 201.026982 168.399998) - (xy 201.009516 168.415471) (xy 200.919781 168.545475) (xy 200.91978 168.545476) (xy 200.863762 168.693181) - (xy 200.844722 168.849999) (xy 199.44659 168.849999) (xy 199.557365 168.822696) (xy 199.600793 168.799903) - (xy 199.69724 168.749283) (xy 199.815483 168.64453) (xy 199.90522 168.514523) (xy 199.961237 168.366818) - (xy 199.980278 168.21) (xy 199.97935 168.202353) (xy 199.961237 168.053181) (xy 199.923821 167.954524) - (xy 199.90522 167.905477) (xy 199.815483 167.77547) (xy 199.69724 167.670717) (xy 199.697238 167.670716) - (xy 199.697237 167.670715) (xy 199.557365 167.597303) (xy 199.403986 167.5595) (xy 199.403985 167.5595) - (xy 199.246015 167.5595) (xy 199.246014 167.5595) (xy 199.092634 167.597303) (xy 198.952762 167.670715) - (xy 198.834516 167.775471) (xy 198.744781 167.905475) (xy 198.74478 167.905476) (xy 198.688762 168.053181) - (xy 198.669722 168.209999) (xy 198.415278 168.209999) (xy 198.41435 168.202353) (xy 198.396237 168.053181) - (xy 198.358821 167.954524) (xy 198.34022 167.905477) (xy 198.250483 167.77547) (xy 198.13224 167.670717) - (xy 198.132238 167.670716) (xy 198.132237 167.670715) (xy 197.992365 167.597303) (xy 197.838986 167.5595) - (xy 197.838985 167.5595) (xy 197.681015 167.5595) (xy 197.681014 167.5595) (xy 197.527634 167.597303) - (xy 197.387761 167.670715) (xy 197.387759 167.670717) (xy 197.287226 167.75978) (xy 197.223993 167.789501) - (xy 197.154729 167.780317) (xy 197.122774 167.75978) (xy 197.02224 167.670717) (xy 197.022238 167.670715) - (xy 196.882365 167.597303) (xy 196.728986 167.5595) (xy 196.728985 167.5595) (xy 196.571015 167.5595) - (xy 196.571014 167.5595) (xy 196.417634 167.597303) (xy 196.277762 167.670714) (xy 196.212869 167.728204) - (xy 196.149635 167.757924) (xy 196.080372 167.74874) (xy 196.048418 167.728204) (xy 195.983526 167.670715) - (xy 195.972237 167.660714) (xy 195.832365 167.587303) (xy 195.678986 167.5495) (xy 195.678985 167.5495) - (xy 195.521015 167.5495) (xy 195.521014 167.5495) (xy 195.367634 167.587303) (xy 195.227762 167.660715) - (xy 195.173059 167.709177) (xy 195.128402 167.74874) (xy 195.109516 167.765471) (xy 195.019781 167.895475) - (xy 195.01978 167.895476) (xy 194.963762 168.043181) (xy 194.944722 168.199999) (xy 192.425443 168.199999) - (xy 192.421499 168.148807) (xy 192.454647 168.087301) (xy 192.515786 168.05348) (xy 192.542808 168.0505) - (xy 192.578985 168.0505) (xy 192.732365 168.012696) (xy 192.87224 167.939283) (xy 192.990483 167.83453) - (xy 193.08022 167.704523) (xy 193.136237 167.556818) (xy 193.155278 167.4) (xy 193.148694 167.345771) - (xy 193.136237 167.243181) (xy 193.101087 167.1505) (xy 193.08022 167.095477) (xy 192.990483 166.96547) - (xy 192.87224 166.860717) (xy 192.872238 166.860716) (xy 192.872237 166.860715) (xy 192.732365 166.787303) - (xy 192.578986 166.7495) (xy 192.578985 166.7495) (xy 192.421015 166.7495) (xy 192.421014 166.7495) - (xy 192.401825 166.754229) (xy 192.332023 166.751157) (xy 192.274962 166.710836) (xy 192.249058 166.648777) - (xy 192.236237 166.543182) (xy 192.18022 166.395477) (xy 192.090483 166.26547) (xy 191.97224 166.160717) - (xy 191.972238 166.160716) (xy 191.972237 166.160715) (xy 191.832365 166.087303) (xy 191.678986 166.0495) - (xy 191.678985 166.0495) (xy 191.521015 166.0495) (xy 191.521014 166.0495) (xy 191.367634 166.087303) - (xy 191.227762 166.160715) (xy 191.22776 166.160717) (xy 191.110898 166.264247) (xy 191.109516 166.265471) - (xy 191.019781 166.395475) (xy 191.01978 166.395476) (xy 190.963762 166.543181) (xy 190.944722 166.699999) - (xy 190.944722 166.7) (xy 190.963763 166.856819) (xy 190.963764 166.856826) (xy 190.963886 166.857146) - (xy 190.963905 166.857396) (xy 190.965558 166.864102) (xy 190.964442 166.864376) (xy 190.969248 166.92681) - (xy 190.936096 166.988313) (xy 190.874955 167.02213) (xy 190.818267 167.021505) (xy 190.728986 166.9995) - (xy 190.728985 166.9995) (xy 190.571015 166.9995) (xy 190.571014 166.9995) (xy 190.417634 167.037303) - (xy 190.277762 167.110715) (xy 190.159516 167.215471) (xy 190.069781 167.345475) (xy 190.06978 167.345476) - (xy 190.013762 167.493181) (xy 189.994722 167.649999) (xy 189.994722 167.65) (xy 190.013762 167.806818) - (xy 190.051179 167.905476) (xy 190.06978 167.954523) (xy 190.159517 168.08453) (xy 190.27776 168.189283) - (xy 190.277762 168.189284) (xy 190.417634 168.262696) (xy 190.571014 168.3005) (xy 190.571015 168.3005) - (xy 190.728985 168.3005) (xy 190.882365 168.262696) (xy 190.971185 168.216078) (xy 191.039692 168.202353) - (xy 191.104746 168.227845) (xy 191.145691 168.28446) (xy 191.151907 168.34082) (xy 191.144722 168.399998) + (xy 190.328985 192.4005) (xy 190.482365 192.362696) (xy 190.505602 192.3505) (xy 190.62224 192.289283) + (xy 190.740483 192.18453) (xy 190.83022 192.054523) (xy 190.886237 191.906818) (xy 190.905278 191.75) + (xy 190.886237 191.593182) (xy 190.83022 191.445477) (xy 190.740483 191.31547) (xy 190.62224 191.210717) + (xy 190.622238 191.210716) (xy 190.622237 191.210715) (xy 190.482365 191.137303) (xy 190.328986 191.0995) + (xy 190.328985 191.0995) (xy 190.171015 191.0995) (xy 190.171014 191.0995) (xy 190.017634 191.137303) + (xy 189.877762 191.210715) (xy 189.759516 191.315471) (xy 189.669781 191.445475) (xy 189.66978 191.445476) + (xy 189.613762 191.593181) (xy 189.594722 191.749999) (xy 156.454207 191.749999) (xy 156.460278 191.7) + (xy 156.441237 191.543182) (xy 156.38522 191.395477) (xy 156.295483 191.26547) (xy 156.17724 191.160717) + (xy 156.177238 191.160716) (xy 156.177237 191.160715) (xy 156.037365 191.087303) (xy 155.883986 191.0495) + (xy 155.883985 191.0495) (xy 155.726015 191.0495) (xy 155.726014 191.0495) (xy 155.572634 191.087303) + (xy 155.432762 191.160715) (xy 155.314516 191.265471) (xy 155.224781 191.395475) (xy 155.22478 191.395476) + (xy 155.168762 191.543181) (xy 155.149722 191.699999) (xy 139 191.699999) (xy 139 188.955321) (xy 150.8295 188.955321) + (xy 150.8295 190.504678) (xy 150.844032 190.577735) (xy 150.844033 190.577739) (xy 150.844034 190.57774) + (xy 150.899399 190.660601) (xy 150.98226 190.715966) (xy 150.982264 190.715967) (xy 151.055321 190.730499) + (xy 151.055324 190.7305) (xy 151.055326 190.7305) (xy 152.604676 190.7305) (xy 152.604677 190.730499) + (xy 152.67774 190.715966) (xy 152.760601 190.660601) (xy 152.815966 190.57774) (xy 152.8305 190.504674) + (xy 152.8305 189.73) (xy 153.324659 189.73) (xy 153.343975 189.926129) (xy 153.343976 189.926132) + (xy 153.398845 190.107011) (xy 153.401188 190.114733) (xy 153.494086 190.288532) (xy 153.49409 190.288539) + (xy 153.619116 190.440883) (xy 153.77146 190.565909) (xy 153.771467 190.565913) (xy 153.945266 190.658811) + (xy 153.945269 190.658811) (xy 153.945273 190.658814) (xy 154.133868 190.716024) (xy 154.33 190.735341) + (xy 154.526132 190.716024) (xy 154.714727 190.658814) (xy 154.888538 190.56591) (xy 155.040883 190.440883) + (xy 155.16591 190.288538) (xy 155.258814 190.114727) (xy 155.316024 189.926132) (xy 155.335341 189.73) + (xy 155.316024 189.533868) (xy 155.258814 189.345273) (xy 155.258811 189.345269) (xy 155.258811 189.345266) + (xy 155.165913 189.171467) (xy 155.165909 189.17146) (xy 155.040883 189.019116) (xy 154.888539 188.89409) + (xy 154.888532 188.894086) (xy 154.714733 188.801188) (xy 154.714727 188.801186) (xy 154.526132 188.743976) + (xy 154.526129 188.743975) (xy 154.33 188.724659) (xy 154.13387 188.743975) (xy 153.945266 188.801188) + (xy 153.771467 188.894086) (xy 153.77146 188.89409) (xy 153.619116 189.019116) (xy 153.49409 189.17146) + (xy 153.494086 189.171467) (xy 153.401188 189.345266) (xy 153.343975 189.53387) (xy 153.324659 189.73) + (xy 152.8305 189.73) (xy 152.8305 188.955326) (xy 152.8305 188.955323) (xy 152.830499 188.955321) + (xy 152.815967 188.882264) (xy 152.815966 188.88226) (xy 152.774155 188.819685) (xy 152.760601 188.799399) + (xy 152.67774 188.744034) (xy 152.677739 188.744033) (xy 152.677735 188.744032) (xy 152.604677 188.7295) + (xy 152.604674 188.7295) (xy 151.055326 188.7295) (xy 151.055323 188.7295) (xy 150.982264 188.744032) + (xy 150.98226 188.744033) (xy 150.899399 188.799399) (xy 150.844033 188.88226) (xy 150.844032 188.882264) + (xy 150.8295 188.955321) (xy 139 188.955321) (xy 139 187.699999) (xy 165.744722 187.699999) (xy 165.744722 187.7) + (xy 165.763762 187.856818) (xy 165.778424 187.895477) (xy 165.81978 188.004523) (xy 165.909517 188.13453) + (xy 166.02776 188.239283) (xy 166.027762 188.239284) (xy 166.167634 188.312696) (xy 166.321014 188.3505) + (xy 166.321015 188.3505) (xy 166.478985 188.3505) (xy 166.630567 188.313139) (xy 166.700367 188.316208) + (xy 166.757429 188.356528) (xy 166.776182 188.389565) (xy 166.792391 188.432304) (xy 166.81978 188.504523) + (xy 166.909517 188.63453) (xy 167.02776 188.739283) (xy 167.027762 188.739284) (xy 167.167634 188.812696) + (xy 167.321014 188.8505) (xy 167.321015 188.8505) (xy 167.478985 188.8505) (xy 167.632365 188.812696) + (xy 167.6577 188.799399) (xy 167.77224 188.739283) (xy 167.890483 188.63453) (xy 167.98022 188.504523) + (xy 168.036237 188.356818) (xy 168.055278 188.2) (xy 168.036237 188.043182) (xy 167.98022 187.895477) + (xy 167.890483 187.76547) (xy 167.77224 187.660717) (xy 167.772238 187.660716) (xy 167.772237 187.660715) + (xy 167.632365 187.587303) (xy 167.478986 187.5495) (xy 167.478985 187.5495) (xy 167.321015 187.5495) + (xy 167.321014 187.5495) (xy 167.169433 187.58686) (xy 167.099631 187.58379) (xy 167.042569 187.54347) + (xy 167.023817 187.510434) (xy 166.98022 187.395477) (xy 166.890483 187.26547) (xy 166.77224 187.160717) + (xy 166.772238 187.160716) (xy 166.772237 187.160715) (xy 166.632365 187.087303) (xy 166.478986 187.0495) + (xy 166.478985 187.0495) (xy 166.321015 187.0495) (xy 166.321014 187.0495) (xy 166.167634 187.087303) + (xy 166.027762 187.160715) (xy 165.909516 187.265471) (xy 165.819781 187.395475) (xy 165.81978 187.395476) + (xy 165.763762 187.543181) (xy 165.744722 187.699999) (xy 139 187.699999) (xy 139 186.6) (xy 126.8 186.6) + (xy 126.5 186.6) (xy 126.5 201.3) (xy 112.3005 201.3) (xy 112.3005 186.269999) (xy 145.344722 186.269999) + (xy 145.344722 186.27) (xy 145.363762 186.426818) (xy 145.41978 186.574523) (xy 145.509517 186.70453) + (xy 145.62776 186.809283) (xy 145.627762 186.809284) (xy 145.767634 186.882696) (xy 145.921014 186.9205) + (xy 145.921015 186.9205) (xy 146.078985 186.9205) (xy 146.232365 186.882696) (xy 146.37224 186.809283) + (xy 146.490483 186.70453) (xy 146.58022 186.574523) (xy 146.636237 186.426818) (xy 146.653804 186.282142) + (xy 149.344722 186.282142) (xy 149.344722 186.282143) (xy 149.363762 186.438961) (xy 149.415175 186.574523) + (xy 149.41978 186.586666) (xy 149.509517 186.716673) (xy 149.62776 186.821426) (xy 149.627762 186.821427) + (xy 149.767634 186.894839) (xy 149.921014 186.932643) (xy 149.921015 186.932643) (xy 150.078985 186.932643) + (xy 150.232365 186.894839) (xy 150.255501 186.882696) (xy 150.37224 186.821426) (xy 150.490483 186.716673) + (xy 150.58022 186.586666) (xy 150.636237 186.438961) (xy 150.655278 186.282143) (xy 150.653804 186.269999) + (xy 150.636237 186.125324) (xy 150.612485 186.062696) (xy 150.58022 185.97762) (xy 150.490483 185.847613) + (xy 150.37224 185.74286) (xy 150.372238 185.742859) (xy 150.372237 185.742858) (xy 150.232365 185.669446) + (xy 150.078986 185.631643) (xy 150.078985 185.631643) (xy 149.921015 185.631643) (xy 149.921014 185.631643) + (xy 149.767634 185.669446) (xy 149.627762 185.742858) (xy 149.509516 185.847614) (xy 149.419781 185.977618) + (xy 149.41978 185.977619) (xy 149.363762 186.125324) (xy 149.344722 186.282142) (xy 146.653804 186.282142) + (xy 146.655278 186.27) (xy 146.637712 186.125325) (xy 146.636237 186.113181) (xy 146.614992 186.057164) + (xy 146.58022 185.965477) (xy 146.490483 185.83547) (xy 146.37224 185.730717) (xy 146.372238 185.730716) + (xy 146.372237 185.730715) (xy 146.232365 185.657303) (xy 146.078986 185.6195) (xy 146.078985 185.6195) + (xy 145.921015 185.6195) (xy 145.921014 185.6195) (xy 145.767634 185.657303) (xy 145.627762 185.730715) + (xy 145.509516 185.835471) (xy 145.419781 185.965475) (xy 145.41978 185.965476) (xy 145.363762 186.113181) + (xy 145.344722 186.269999) (xy 112.3005 186.269999) (xy 112.3005 185.449999) (xy 156.144722 185.449999) + (xy 156.144722 185.45) (xy 156.163762 185.606818) (xy 156.215356 185.742858) (xy 156.21978 185.754523) + (xy 156.309517 185.88453) (xy 156.42776 185.989283) (xy 156.427762 185.989284) (xy 156.567634 186.062696) + (xy 156.721014 186.1005) (xy 156.721015 186.1005) (xy 156.878985 186.1005) (xy 157.032365 186.062696) + (xy 157.17224 185.989283) (xy 157.290483 185.88453) (xy 157.38022 185.754523) (xy 157.436237 185.606818) + (xy 157.455278 185.45) (xy 157.453401 185.434537) (xy 157.436237 185.293181) (xy 157.400093 185.197879) + (xy 157.38022 185.145477) (xy 157.290483 185.01547) (xy 157.17224 184.910717) (xy 157.172238 184.910716) + (xy 157.172237 184.910715) (xy 157.032365 184.837303) (xy 156.878986 184.7995) (xy 156.878985 184.7995) + (xy 156.721015 184.7995) (xy 156.721014 184.7995) (xy 156.567634 184.837303) (xy 156.427762 184.910715) + (xy 156.399415 184.935828) (xy 156.326973 185.000006) (xy 156.309516 185.015471) (xy 156.219781 185.145475) + (xy 156.21978 185.145476) (xy 156.163762 185.293181) (xy 156.144722 185.449999) (xy 112.3005 185.449999) + (xy 112.3005 183.864992) (xy 165.704529 183.864992) (xy 165.704529 183.865003) (xy 165.724379 184.104557) + (xy 165.783389 184.337587) (xy 165.879951 184.557727) (xy 166.011427 184.758964) (xy 166.011429 184.758967) + (xy 166.174236 184.935823) (xy 166.174239 184.935825) (xy 166.174242 184.935828) (xy 166.363924 185.083464) + (xy 166.36393 185.083468) (xy 166.363933 185.08347) (xy 166.575344 185.19788) (xy 166.575347 185.197881) + (xy 166.802699 185.275931) (xy 166.802701 185.275931) (xy 166.802703 185.275932) (xy 167.039808 185.315498) + (xy 167.039809 185.315498) (xy 167.280191 185.315498) (xy 167.280192 185.315498) (xy 167.517297 185.275932) + (xy 167.744656 185.19788) (xy 167.956067 185.08347) (xy 168.145764 184.935823) (xy 168.145768 184.935817) + (xy 168.147566 184.934419) (xy 168.21256 184.908776) (xy 168.2811 184.922342) (xy 168.331425 184.97081) + (xy 168.346825 185.017325) (xy 168.363763 185.156819) (xy 168.408937 185.275932) (xy 168.41978 185.304523) + (xy 168.509517 185.43453) (xy 168.62776 185.539283) (xy 168.627762 185.539284) (xy 168.767634 185.612696) + (xy 168.921014 185.6505) (xy 168.921015 185.6505) (xy 169.078985 185.6505) (xy 169.232365 185.612696) + (xy 169.243564 185.606818) (xy 169.37224 185.539283) (xy 169.490483 185.43453) (xy 169.58022 185.304523) + (xy 169.584053 185.294415) (xy 169.62623 185.238713) (xy 169.691828 185.214655) (xy 169.760018 185.229881) + (xy 169.809152 185.279557) (xy 169.815934 185.294407) (xy 169.819771 185.304524) (xy 169.819774 185.304532) + (xy 169.864641 185.369533) (xy 169.90951 185.434537) (xy 170.027753 185.53929) (xy 170.027755 185.539291) + (xy 170.167627 185.612703) (xy 170.321007 185.650507) (xy 170.321008 185.650507) (xy 170.478978 185.650507) + (xy 170.632358 185.612703) (xy 170.643571 185.606818) (xy 170.772233 185.53929) (xy 170.890476 185.434537) + (xy 170.980213 185.30453) (xy 171.03623 185.156825) (xy 171.055271 185.000007) (xy 171.03623 184.843189) + (xy 171.036227 184.843182) (xy 171.004288 184.758964) (xy 170.980213 184.695484) (xy 170.890476 184.565477) + (xy 170.772233 184.460724) (xy 170.772231 184.460723) (xy 170.77223 184.460722) (xy 170.632358 184.38731) + (xy 170.478979 184.349507) (xy 170.478978 184.349507) (xy 170.321008 184.349507) (xy 170.321007 184.349507) + (xy 170.167627 184.38731) (xy 170.027755 184.460722) (xy 169.909509 184.565478) (xy 169.819774 184.695482) + (xy 169.81977 184.695488) (xy 169.815936 184.705598) (xy 169.773755 184.761298) (xy 169.708156 184.785351) + (xy 169.639966 184.77012) (xy 169.590836 184.720441) (xy 169.584058 184.705598) (xy 169.58022 184.695477) + (xy 169.490483 184.56547) (xy 169.37224 184.460717) (xy 169.372238 184.460716) (xy 169.372237 184.460715) + (xy 169.232365 184.387303) (xy 169.078986 184.3495) (xy 169.078985 184.3495) (xy 168.921015 184.3495) + (xy 168.921014 184.3495) (xy 168.767634 184.387303) (xy 168.767633 184.387304) (xy 168.732723 184.405626) + (xy 168.664215 184.41935) (xy 168.599162 184.393857) (xy 168.558219 184.337241) (xy 168.554384 184.267477) + (xy 168.554893 184.265389) (xy 168.59562 184.104561) (xy 168.615471 183.864998) (xy 168.615471 183.864992) + (xy 179.174529 183.864992) (xy 179.174529 183.865003) (xy 179.194379 184.104557) (xy 179.253389 184.337587) + (xy 179.349951 184.557727) (xy 179.481427 184.758964) (xy 179.481429 184.758967) (xy 179.644236 184.935823) + (xy 179.644239 184.935825) (xy 179.644242 184.935828) (xy 179.833924 185.083464) (xy 179.83393 185.083468) + (xy 179.833933 185.08347) (xy 180.045344 185.19788) (xy 180.045347 185.197881) (xy 180.272699 185.275931) + (xy 180.272701 185.275931) (xy 180.272703 185.275932) (xy 180.509808 185.315498) (xy 180.509809 185.315498) + (xy 180.750191 185.315498) (xy 180.750192 185.315498) (xy 180.987297 185.275932) (xy 181.214656 185.19788) + (xy 181.426067 185.08347) (xy 181.615764 184.935823) (xy 181.778571 184.758967) (xy 181.910049 184.557726) + (xy 182.00661 184.337589) (xy 182.06562 184.104561) (xy 182.085471 183.864998) (xy 182.06562 183.625435) + (xy 182.00661 183.392407) (xy 181.910049 183.17227) (xy 181.85806 183.092696) (xy 181.778572 182.971031) + (xy 181.778571 182.971029) (xy 181.615764 182.794173) (xy 181.615759 182.794169) (xy 181.615757 182.794167) + (xy 181.426075 182.646531) (xy 181.426069 182.646527) (xy 181.214657 182.532116) (xy 181.214652 182.532114) + (xy 180.9873 182.454064) (xy 180.809468 182.424389) (xy 180.750192 182.414498) (xy 180.509808 182.414498) + (xy 180.462387 182.422411) (xy 180.272699 182.454064) (xy 180.045347 182.532114) (xy 180.045342 182.532116) + (xy 179.83393 182.646527) (xy 179.833924 182.646531) (xy 179.644242 182.794167) (xy 179.644239 182.79417) + (xy 179.48143 182.971027) (xy 179.481427 182.971031) (xy 179.349951 183.172268) (xy 179.253389 183.392408) + (xy 179.194379 183.625438) (xy 179.174529 183.864992) (xy 168.615471 183.864992) (xy 168.59562 183.625435) + (xy 168.53661 183.392407) (xy 168.440049 183.17227) (xy 168.38806 183.092696) (xy 168.308572 182.971031) + (xy 168.308571 182.971029) (xy 168.145764 182.794173) (xy 168.145759 182.794169) (xy 168.145757 182.794167) + (xy 167.956075 182.646531) (xy 167.956069 182.646527) (xy 167.744657 182.532116) (xy 167.744652 182.532114) + (xy 167.5173 182.454064) (xy 167.339468 182.424389) (xy 167.280192 182.414498) (xy 167.039808 182.414498) + (xy 166.992387 182.422411) (xy 166.802699 182.454064) (xy 166.575347 182.532114) (xy 166.575342 182.532116) + (xy 166.36393 182.646527) (xy 166.363924 182.646531) (xy 166.174242 182.794167) (xy 166.174239 182.79417) + (xy 166.01143 182.971027) (xy 166.011427 182.971031) (xy 165.879951 183.172268) (xy 165.783389 183.392408) + (xy 165.724379 183.625438) (xy 165.704529 183.864992) (xy 112.3005 183.864992) (xy 112.3005 180.464992) + (xy 165.704529 180.464992) (xy 165.704529 180.465003) (xy 165.724379 180.704557) (xy 165.783389 180.937587) + (xy 165.879951 181.157727) (xy 165.995462 181.334528) (xy 166.011429 181.358967) (xy 166.174236 181.535823) + (xy 166.174239 181.535825) (xy 166.174242 181.535828) (xy 166.363924 181.683464) (xy 166.36393 181.683468) + (xy 166.363933 181.68347) (xy 166.575344 181.79788) (xy 166.575347 181.797881) (xy 166.802699 181.875931) + (xy 166.802701 181.875931) (xy 166.802703 181.875932) (xy 167.039808 181.915498) (xy 167.039809 181.915498) + (xy 167.280191 181.915498) (xy 167.280192 181.915498) (xy 167.517297 181.875932) (xy 167.744656 181.79788) + (xy 167.956067 181.68347) (xy 168.145764 181.535823) (xy 168.308571 181.358967) (xy 168.440049 181.157726) + (xy 168.53661 180.937589) (xy 168.546129 180.899999) (xy 171.944722 180.899999) (xy 171.944722 180.9) + (xy 171.963762 181.056818) (xy 172.01978 181.204523) (xy 172.109517 181.33453) (xy 172.22776 181.439283) + (xy 172.227762 181.439284) (xy 172.367634 181.512696) (xy 172.521014 181.5505) (xy 172.521015 181.5505) + (xy 172.678985 181.5505) (xy 172.832365 181.512696) (xy 172.97224 181.439283) (xy 173.090483 181.33453) + (xy 173.18022 181.204523) (xy 173.236237 181.056818) (xy 173.255278 180.9) (xy 173.236237 180.743182) + (xy 173.18022 180.595477) (xy 173.090483 180.46547) (xy 172.97224 180.360717) (xy 172.972238 180.360716) + (xy 172.972237 180.360715) (xy 172.832365 180.287303) (xy 172.678986 180.2495) (xy 172.678985 180.2495) + (xy 172.521015 180.2495) (xy 172.521014 180.2495) (xy 172.367634 180.287303) (xy 172.227762 180.360715) + (xy 172.109516 180.465471) (xy 172.019781 180.595475) (xy 172.01978 180.595476) (xy 171.963762 180.743181) + (xy 171.944722 180.899999) (xy 168.546129 180.899999) (xy 168.59562 180.704561) (xy 168.604659 180.595475) + (xy 168.615471 180.465003) (xy 168.615471 180.464992) (xy 168.59562 180.225438) (xy 168.59562 180.225435) + (xy 168.563351 180.098007) (xy 173.44273 180.098007) (xy 173.44273 180.098008) (xy 173.46177 180.254826) + (xy 173.501929 180.360715) (xy 173.517788 180.402531) (xy 173.607525 180.532538) (xy 173.725768 180.637291) + (xy 173.72577 180.637292) (xy 173.865642 180.710704) (xy 174.019022 180.748508) (xy 174.019023 180.748508) + (xy 174.176993 180.748508) (xy 174.330373 180.710704) (xy 174.342085 180.704557) (xy 174.470248 180.637291) + (xy 174.588491 180.532538) (xy 174.678228 180.402531) (xy 174.734245 180.254826) (xy 174.753286 180.098008) + (xy 174.734245 179.94119) (xy 174.678228 179.793485) (xy 174.588491 179.663478) (xy 174.470248 179.558725) + (xy 174.470246 179.558724) (xy 174.470245 179.558723) (xy 174.330373 179.485311) (xy 174.176994 179.447508) + (xy 174.176993 179.447508) (xy 174.019023 179.447508) (xy 174.019022 179.447508) (xy 173.865642 179.485311) + (xy 173.72577 179.558723) (xy 173.607524 179.663479) (xy 173.517789 179.793483) (xy 173.517788 179.793484) + (xy 173.46177 179.941189) (xy 173.44273 180.098007) (xy 168.563351 180.098007) (xy 168.53661 179.992407) + (xy 168.440049 179.77227) (xy 168.308571 179.571029) (xy 168.145764 179.394173) (xy 168.145759 179.394169) + (xy 168.145757 179.394167) (xy 167.956075 179.246531) (xy 167.956069 179.246527) (xy 167.944598 179.240319) + (xy 179.1795 179.240319) (xy 179.1795 181.689676) (xy 179.194032 181.762733) (xy 179.194033 181.762737) + (xy 179.194034 181.762738) (xy 179.249399 181.845599) (xy 179.33226 181.900964) (xy 179.332264 181.900965) + (xy 179.405321 181.915497) (xy 179.405324 181.915498) (xy 179.405326 181.915498) (xy 181.854676 181.915498) + (xy 181.854677 181.915497) (xy 181.92774 181.900964) (xy 182.010601 181.845599) (xy 182.065966 181.762738) + (xy 182.0805 181.689672) (xy 182.0805 179.240324) (xy 182.0805 179.240321) (xy 182.080499 179.240319) + (xy 182.065967 179.167262) (xy 182.065966 179.167258) (xy 182.042484 179.132114) (xy 182.010601 179.084397) + (xy 181.92774 179.029032) (xy 181.927739 179.029031) (xy 181.927735 179.02903) (xy 181.854677 179.014498) + (xy 181.854674 179.014498) (xy 179.405326 179.014498) (xy 179.405323 179.014498) (xy 179.332264 179.02903) + (xy 179.33226 179.029031) (xy 179.249399 179.084397) (xy 179.194033 179.167258) (xy 179.194032 179.167262) + (xy 179.1795 179.240319) (xy 167.944598 179.240319) (xy 167.744657 179.132116) (xy 167.744652 179.132114) + (xy 167.5173 179.054064) (xy 167.339468 179.024389) (xy 167.280192 179.014498) (xy 167.039808 179.014498) + (xy 166.992387 179.022411) (xy 166.802699 179.054064) (xy 166.575347 179.132114) (xy 166.575342 179.132116) + (xy 166.36393 179.246527) (xy 166.363924 179.246531) (xy 166.174242 179.394167) (xy 166.174239 179.39417) + (xy 166.01143 179.571027) (xy 166.011427 179.571031) (xy 165.879951 179.772268) (xy 165.783389 179.992408) + (xy 165.724379 180.225438) (xy 165.704529 180.464992) (xy 112.3005 180.464992) (xy 112.3005 178.399999) + (xy 187.144722 178.399999) (xy 187.144722 178.4) (xy 187.163762 178.556818) (xy 187.21978 178.704523) + (xy 187.309517 178.83453) (xy 187.42776 178.939283) (xy 187.427762 178.939284) (xy 187.567634 179.012696) + (xy 187.721014 179.0505) (xy 187.721015 179.0505) (xy 187.878985 179.0505) (xy 188.032365 179.012696) + (xy 188.17224 178.939283) (xy 188.290483 178.83453) (xy 188.38022 178.704523) (xy 188.436237 178.556818) + (xy 188.446172 178.474999) (xy 192.144722 178.474999) (xy 192.144722 178.475) (xy 192.163762 178.631818) + (xy 192.21978 178.779523) (xy 192.309517 178.90953) (xy 192.42776 179.014283) (xy 192.427762 179.014284) + (xy 192.567634 179.087696) (xy 192.721014 179.1255) (xy 192.721015 179.1255) (xy 192.878985 179.1255) + (xy 193.032365 179.087696) (xy 193.038651 179.084397) (xy 193.17224 179.014283) (xy 193.290483 178.90953) + (xy 193.38022 178.779523) (xy 193.436237 178.631818) (xy 193.455278 178.475) (xy 193.448253 178.417146) + (xy 193.459713 178.348226) (xy 193.506616 178.29644) (xy 193.574072 178.278232) (xy 193.628975 178.292406) + (xy 193.667634 178.312696) (xy 193.821014 178.3505) (xy 193.821015 178.3505) (xy 193.978985 178.3505) + (xy 194.132365 178.312696) (xy 194.171024 178.292406) (xy 194.27224 178.239283) (xy 194.390483 178.13453) + (xy 194.48022 178.004523) (xy 194.536237 177.856818) (xy 194.555278 177.7) (xy 194.536237 177.543182) + (xy 194.48022 177.395477) (xy 194.390483 177.26547) (xy 194.27224 177.160717) (xy 194.272238 177.160716) + (xy 194.272237 177.160715) (xy 194.132365 177.087303) (xy 193.978986 177.0495) (xy 193.978985 177.0495) + (xy 193.821015 177.0495) (xy 193.821014 177.0495) (xy 193.667634 177.087303) (xy 193.527762 177.160715) + (xy 193.409516 177.265471) (xy 193.319781 177.395475) (xy 193.31978 177.395476) (xy 193.263762 177.543181) + (xy 193.244722 177.699999) (xy 193.244722 177.7) (xy 193.251746 177.757851) (xy 193.240285 177.826774) + (xy 193.193381 177.87856) (xy 193.125925 177.896767) (xy 193.071025 177.882594) (xy 193.032364 177.862303) + (xy 192.878986 177.8245) (xy 192.878985 177.8245) (xy 192.721015 177.8245) (xy 192.721014 177.8245) + (xy 192.567634 177.862303) (xy 192.427762 177.935715) (xy 192.309516 178.040471) (xy 192.219781 178.170475) + (xy 192.21978 178.170476) (xy 192.163762 178.318181) (xy 192.144722 178.474999) (xy 188.446172 178.474999) + (xy 188.455278 178.4) (xy 188.441854 178.289445) (xy 188.453314 178.220523) (xy 188.500218 178.168737) + (xy 188.56495 178.1505) (xy 188.578985 178.1505) (xy 188.732365 178.112696) (xy 188.87224 178.039283) + (xy 188.990483 177.93453) (xy 189.08022 177.804523) (xy 189.136237 177.656818) (xy 189.155278 177.5) + (xy 189.142587 177.395475) (xy 189.136237 177.343181) (xy 189.106765 177.26547) (xy 189.08022 177.195477) + (xy 188.990483 177.06547) (xy 188.87224 176.960717) (xy 188.872238 176.960716) (xy 188.872237 176.960715) + (xy 188.732365 176.887303) (xy 188.578986 176.8495) (xy 188.578985 176.8495) (xy 188.421015 176.8495) + (xy 188.421014 176.8495) (xy 188.267634 176.887303) (xy 188.127762 176.960715) (xy 188.009516 177.065471) + (xy 187.919781 177.195475) (xy 187.91978 177.195476) (xy 187.863762 177.343181) (xy 187.857413 177.395476) + (xy 187.844722 177.5) (xy 187.858145 177.610554) (xy 187.846686 177.679477) (xy 187.799782 177.731263) + (xy 187.73505 177.7495) (xy 187.721014 177.7495) (xy 187.567634 177.787303) (xy 187.427762 177.860715) + (xy 187.309516 177.965471) (xy 187.219781 178.095475) (xy 187.21978 178.095476) (xy 187.163762 178.243181) + (xy 187.144722 178.399999) (xy 112.3005 178.399999) (xy 112.3005 177.499999) (xy 174.744718 177.499999) + (xy 174.744718 177.5) (xy 174.763758 177.656818) (xy 174.813245 177.787303) (xy 174.819776 177.804523) + (xy 174.909513 177.93453) (xy 175.027756 178.039283) (xy 175.027758 178.039284) (xy 175.16763 178.112696) + (xy 175.32101 178.1505) (xy 175.321011 178.1505) (xy 175.478981 178.1505) (xy 175.632361 178.112696) + (xy 175.772236 178.039283) (xy 175.890479 177.93453) (xy 175.897948 177.923708) (xy 175.95223 177.879719) + (xy 176.021679 177.872059) (xy 176.084244 177.903162) (xy 176.102048 177.923709) (xy 176.109515 177.934528) + (xy 176.109517 177.93453) (xy 176.22776 178.039283) (xy 176.227762 178.039284) (xy 176.367634 178.112696) + (xy 176.521014 178.1505) (xy 176.521015 178.1505) (xy 176.678985 178.1505) (xy 176.832365 178.112696) + (xy 176.97224 178.039283) (xy 177.090483 177.93453) (xy 177.18022 177.804523) (xy 177.236237 177.656818) + (xy 177.255278 177.5) (xy 177.242587 177.395475) (xy 177.236237 177.343181) (xy 177.206765 177.26547) + (xy 177.18022 177.195477) (xy 177.090483 177.06547) (xy 176.97224 176.960717) (xy 176.972238 176.960716) + (xy 176.972237 176.960715) (xy 176.832365 176.887303) (xy 176.678986 176.8495) (xy 176.678985 176.8495) + (xy 176.521015 176.8495) (xy 176.521014 176.8495) (xy 176.367634 176.887303) (xy 176.227762 176.960715) + (xy 176.109514 177.065472) (xy 176.102046 177.076292) (xy 176.047763 177.120281) (xy 175.978314 177.127939) + (xy 175.91575 177.096835) (xy 175.89795 177.076292) (xy 175.890481 177.065472) (xy 175.872452 177.0495) + (xy 175.772236 176.960717) (xy 175.772234 176.960716) (xy 175.772233 176.960715) (xy 175.632361 176.887303) + (xy 175.478982 176.8495) (xy 175.478981 176.8495) (xy 175.321011 176.8495) (xy 175.32101 176.8495) + (xy 175.16763 176.887303) (xy 175.027758 176.960715) (xy 174.909512 177.065471) (xy 174.819777 177.195475) + (xy 174.819776 177.195476) (xy 174.763758 177.343181) (xy 174.744718 177.499999) (xy 112.3005 177.499999) + (xy 112.3005 175.605057) (xy 118.701302 175.605057) (xy 118.720618 175.801186) (xy 118.777831 175.98979) + (xy 118.870729 176.163589) (xy 118.870733 176.163596) (xy 118.995759 176.31594) (xy 119.148103 176.440966) + (xy 119.14811 176.44097) (xy 119.321909 176.533868) (xy 119.321912 176.533868) (xy 119.321916 176.533871) + (xy 119.510511 176.591081) (xy 119.706643 176.610398) (xy 119.902775 176.591081) (xy 120.09137 176.533871) + (xy 120.265181 176.440967) (xy 120.417526 176.31594) (xy 120.542553 176.163595) (xy 120.635457 175.989784) + (xy 120.692667 175.801189) (xy 120.711984 175.605057) (xy 120.692667 175.408925) (xy 120.635457 175.22033) + (xy 120.635454 175.220326) (xy 120.635454 175.220323) (xy 120.542556 175.046524) (xy 120.542552 175.046517) + (xy 120.417526 174.894173) (xy 120.339792 174.830378) (xy 121.206143 174.830378) (xy 121.206143 176.379735) + (xy 121.220675 176.452792) (xy 121.220676 176.452796) (xy 121.220677 176.452797) (xy 121.276042 176.535658) + (xy 121.358903 176.591023) (xy 121.358907 176.591024) (xy 121.431964 176.605556) (xy 121.431967 176.605557) + (xy 121.431969 176.605557) (xy 122.981319 176.605557) (xy 122.98132 176.605556) (xy 123.054383 176.591023) + (xy 123.137244 176.535658) (xy 123.192609 176.452797) (xy 123.207143 176.379731) (xy 123.207143 174.830383) + (xy 123.207143 174.83038) (xy 123.207142 174.830378) (xy 123.19261 174.757321) (xy 123.192609 174.757317) + (xy 123.137244 174.674456) (xy 123.054383 174.619091) (xy 123.054382 174.61909) (xy 123.054378 174.619089) + (xy 122.98132 174.604557) (xy 122.981317 174.604557) (xy 122.669075 174.604557) (xy 122.602036 174.584872) + (xy 122.556281 174.532068) (xy 122.546337 174.46291) (xy 122.575362 174.399354) (xy 122.586848 174.387741) + (xy 122.590473 174.38453) (xy 122.68021 174.254523) (xy 122.736227 174.106818) (xy 122.755268 173.95) + (xy 122.736227 173.793182) (xy 122.68021 173.645477) (xy 122.590473 173.51547) (xy 122.47223 173.410717) + (xy 122.472228 173.410716) (xy 122.472227 173.410715) (xy 122.332355 173.337303) (xy 122.178976 173.2995) + (xy 122.178975 173.2995) (xy 122.021005 173.2995) (xy 122.021004 173.2995) (xy 121.867624 173.337303) + (xy 121.727752 173.410715) (xy 121.609506 173.515471) (xy 121.519771 173.645475) (xy 121.51977 173.645476) + (xy 121.463752 173.793181) (xy 121.444712 173.949999) (xy 121.444712 173.95) (xy 121.463752 174.106818) + (xy 121.51977 174.254523) (xy 121.519771 174.254524) (xy 121.609506 174.384529) (xy 121.613132 174.387741) + (xy 121.650259 174.446931) (xy 121.649491 174.516796) (xy 121.611074 174.575156) (xy 121.547203 174.603481) + (xy 121.530905 174.604557) (xy 121.431966 174.604557) (xy 121.358907 174.619089) (xy 121.358903 174.61909) + (xy 121.276042 174.674456) (xy 121.220676 174.757317) (xy 121.220675 174.757321) (xy 121.206143 174.830378) + (xy 120.339792 174.830378) (xy 120.265182 174.769147) (xy 120.265175 174.769143) (xy 120.091376 174.676245) + (xy 120.09137 174.676243) (xy 119.902775 174.619033) (xy 119.902772 174.619032) (xy 119.706643 174.599716) + (xy 119.510513 174.619032) (xy 119.321909 174.676245) (xy 119.14811 174.769143) (xy 119.148103 174.769147) + (xy 118.995759 174.894173) (xy 118.870733 175.046517) (xy 118.870729 175.046524) (xy 118.777831 175.220323) + (xy 118.720618 175.408927) (xy 118.701302 175.605057) (xy 112.3005 175.605057) (xy 112.3005 172.399999) + (xy 119.944722 172.399999) (xy 119.944722 172.4) (xy 119.963762 172.556818) (xy 120.01978 172.704523) + (xy 120.109517 172.83453) (xy 120.22776 172.939283) (xy 120.227762 172.939284) (xy 120.367634 173.012696) + (xy 120.521014 173.0505) (xy 120.521015 173.0505) (xy 120.678985 173.0505) (xy 120.832365 173.012696) + (xy 120.97224 172.939283) (xy 121.090483 172.83453) (xy 121.18022 172.704523) (xy 121.236237 172.556818) + (xy 121.255278 172.4) (xy 121.236237 172.243182) (xy 121.18022 172.095477) (xy 121.090483 171.96547) + (xy 120.97224 171.860717) (xy 120.972238 171.860716) (xy 120.972237 171.860715) (xy 120.832365 171.787303) + (xy 120.678986 171.7495) (xy 120.678985 171.7495) (xy 120.521015 171.7495) (xy 120.521014 171.7495) + (xy 120.367634 171.787303) (xy 120.227762 171.860715) (xy 120.109516 171.965471) (xy 120.019781 172.095475) + (xy 120.01978 172.095476) (xy 119.963762 172.243181) (xy 119.944722 172.399999) (xy 112.3005 172.399999) + (xy 112.3005 170.965055) (xy 121.371364 170.965055) (xy 121.371364 170.965056) (xy 121.390404 171.121874) + (xy 121.446422 171.269579) (xy 121.536159 171.399586) (xy 121.654402 171.504339) (xy 121.654404 171.50434) + (xy 121.794276 171.577752) (xy 121.947656 171.615556) (xy 121.947657 171.615556) (xy 122.105627 171.615556) + (xy 122.259007 171.577752) (xy 122.398882 171.504339) (xy 122.517125 171.399586) (xy 122.606862 171.269579) + (xy 122.662879 171.121874) (xy 122.68192 170.965056) (xy 122.662879 170.808238) (xy 122.606862 170.660533) + (xy 122.517125 170.530526) (xy 122.398882 170.425773) (xy 122.39888 170.425772) (xy 122.398879 170.425771) + (xy 122.259007 170.352359) (xy 122.105628 170.314556) (xy 122.105627 170.314556) (xy 121.947657 170.314556) + (xy 121.947656 170.314556) (xy 121.794276 170.352359) (xy 121.654404 170.425771) (xy 121.536158 170.530527) + (xy 121.446423 170.660531) (xy 121.446422 170.660532) (xy 121.390404 170.808237) (xy 121.371364 170.965055) + (xy 112.3005 170.965055) (xy 112.3005 165.499999) (xy 171.844732 165.499999) (xy 171.844732 165.5) + (xy 171.863772 165.656818) (xy 171.893244 165.734528) (xy 171.91979 165.804523) (xy 172.009527 165.93453) + (xy 172.12777 166.039283) (xy 172.127772 166.039284) (xy 172.267644 166.112696) (xy 172.421024 166.1505) + (xy 172.421025 166.1505) (xy 172.578995 166.1505) (xy 172.732375 166.112696) (xy 172.776984 166.089283) + (xy 172.87225 166.039283) (xy 172.916593 165.999999) (xy 175.144722 165.999999) (xy 175.144722 166) + (xy 175.163762 166.156818) (xy 175.21978 166.304523) (xy 175.219781 166.304524) (xy 175.309516 166.434529) + (xy 175.335089 166.457185) (xy 175.372215 166.516375) (xy 175.371447 166.586241) (xy 175.335089 166.642815) + (xy 175.309516 166.66547) (xy 175.219781 166.795475) (xy 175.21978 166.795476) (xy 175.163762 166.943181) + (xy 175.144722 167.099999) (xy 175.144722 167.1) (xy 175.163762 167.256818) (xy 175.21978 167.404523) + (xy 175.219781 167.404524) (xy 175.309516 167.534529) (xy 175.335089 167.557185) (xy 175.372215 167.616375) + (xy 175.371447 167.686241) (xy 175.335089 167.742815) (xy 175.309516 167.76547) (xy 175.219781 167.895475) + (xy 175.21978 167.895476) (xy 175.163762 168.043181) (xy 175.144722 168.199999) (xy 175.144722 168.2) + (xy 175.163762 168.356818) (xy 175.219266 168.503169) (xy 175.21978 168.504523) (xy 175.309517 168.63453) + (xy 175.42776 168.739283) (xy 175.427762 168.739284) (xy 175.567634 168.812696) (xy 175.721014 168.8505) + (xy 175.721015 168.8505) (xy 175.878985 168.8505) (xy 176.032365 168.812696) (xy 176.131401 168.760717) + (xy 176.17224 168.739283) (xy 176.272917 168.650092) (xy 176.8345 168.650092) (xy 176.8345 168.799907) + (xy 176.863723 168.946822) (xy 176.863725 168.94683) (xy 176.921051 169.085229) (xy 176.921056 169.085238) + (xy 177.00428 169.20979) (xy 177.004283 169.209794) (xy 177.110205 169.315716) (xy 177.110209 169.315719) + (xy 177.234761 169.398943) (xy 177.234767 169.398946) (xy 177.234768 169.398947) (xy 177.37317 169.456275) + (xy 177.520092 169.485499) (xy 177.520096 169.4855) (xy 177.520097 169.4855) (xy 177.669904 169.4855) + (xy 177.669905 169.485499) (xy 177.81683 169.456275) (xy 177.955232 169.398947) (xy 178.079791 169.315719) + (xy 178.095511 169.299999) (xy 188.444722 169.299999) (xy 188.444722 169.3) (xy 188.463762 169.456818) + (xy 188.480329 169.5005) (xy 188.51978 169.604523) (xy 188.609517 169.73453) (xy 188.72776 169.839283) + (xy 188.727762 169.839284) (xy 188.867634 169.912696) (xy 189.021014 169.9505) (xy 189.021015 169.9505) + (xy 189.178985 169.9505) (xy 189.332365 169.912696) (xy 189.47224 169.839283) (xy 189.590483 169.73453) + (xy 189.68022 169.604523) (xy 189.736237 169.456818) (xy 189.755278 169.3) (xy 189.755278 169.299999) + (xy 190.244722 169.299999) (xy 190.244722 169.3) (xy 190.263762 169.456818) (xy 190.280329 169.5005) + (xy 190.31978 169.604523) (xy 190.409517 169.73453) (xy 190.52776 169.839283) (xy 190.527762 169.839284) + (xy 190.667634 169.912696) (xy 190.821014 169.9505) (xy 190.821015 169.9505) (xy 190.978985 169.9505) + (xy 191.132365 169.912696) (xy 191.27224 169.839283) (xy 191.390483 169.73453) (xy 191.48022 169.604523) + (xy 191.536237 169.456818) (xy 191.555278 169.3) (xy 191.540589 169.179025) (xy 191.552049 169.110103) + (xy 191.598953 169.058317) (xy 191.666409 169.04011) (xy 191.693359 169.043683) (xy 191.721013 169.050499) + (xy 191.721014 169.0505) (xy 191.721015 169.0505) (xy 191.878985 169.0505) (xy 192.032365 169.012696) + (xy 192.043564 169.006818) (xy 192.17224 168.939283) (xy 192.290483 168.83453) (xy 192.38022 168.704523) + (xy 192.436237 168.556818) (xy 192.455278 168.4) (xy 192.436237 168.243182) (xy 192.436236 168.243179) + (xy 192.436236 168.243178) (xy 192.426866 168.21847) (xy 192.425443 168.199999) (xy 194.944722 168.199999) + (xy 194.944722 168.2) (xy 194.963762 168.356818) (xy 195.019266 168.503169) (xy 195.01978 168.504523) + (xy 195.109517 168.63453) (xy 195.22776 168.739283) (xy 195.227762 168.739284) (xy 195.367634 168.812696) + (xy 195.521014 168.8505) (xy 195.521015 168.8505) (xy 195.678985 168.8505) (xy 195.832365 168.812696) + (xy 195.972238 168.739284) (xy 195.972237 168.739284) (xy 195.97224 168.739283) (xy 196.037129 168.681797) + (xy 196.100362 168.652075) (xy 196.169626 168.661259) (xy 196.201579 168.681793) (xy 196.227236 168.704523) + (xy 196.277762 168.749285) (xy 196.417634 168.822696) (xy 196.571014 168.8605) (xy 196.571015 168.8605) + (xy 196.728985 168.8605) (xy 196.882365 168.822696) (xy 196.925793 168.799903) (xy 197.02224 168.749283) + (xy 197.122774 168.660218) (xy 197.186006 168.630498) (xy 197.25527 168.639682) (xy 197.287224 168.660217) + (xy 197.38776 168.749283) (xy 197.387762 168.749284) (xy 197.527634 168.822696) (xy 197.681014 168.8605) + (xy 197.681015 168.8605) (xy 197.838985 168.8605) (xy 197.992365 168.822696) (xy 198.035793 168.799903) + (xy 198.13224 168.749283) (xy 198.250483 168.64453) (xy 198.34022 168.514523) (xy 198.396237 168.366818) + (xy 198.415278 168.21) (xy 198.415278 168.209999) (xy 198.669722 168.209999) (xy 198.669722 168.21) + (xy 198.688762 168.366818) (xy 198.740988 168.504524) (xy 198.74478 168.514523) (xy 198.834517 168.64453) + (xy 198.95276 168.749283) (xy 198.952762 168.749284) (xy 199.092634 168.822696) (xy 199.246014 168.8605) + (xy 199.246015 168.8605) (xy 199.403985 168.8605) (xy 199.44659 168.849999) (xy 200.844722 168.849999) + (xy 200.844722 168.85) (xy 200.863762 169.006818) (xy 200.915479 169.143182) (xy 200.91978 169.154523) + (xy 201.009517 169.28453) (xy 201.12776 169.389283) (xy 201.127762 169.389284) (xy 201.267634 169.462696) + (xy 201.421014 169.5005) (xy 201.421015 169.5005) (xy 201.578985 169.5005) (xy 201.732365 169.462696) + (xy 201.744601 169.456274) (xy 201.87224 169.389283) (xy 201.990483 169.28453) (xy 202.08022 169.154523) + (xy 202.136237 169.006818) (xy 202.155278 168.85) (xy 202.136237 168.693182) (xy 202.134007 168.687303) + (xy 202.082337 168.55106) (xy 202.08022 168.545477) (xy 201.990483 168.41547) (xy 201.87224 168.310717) + (xy 201.872238 168.310716) (xy 201.872237 168.310715) (xy 201.732365 168.237303) (xy 201.578986 168.1995) + (xy 201.578985 168.1995) (xy 201.421015 168.1995) (xy 201.421014 168.1995) (xy 201.267634 168.237303) + (xy 201.127762 168.310715) (xy 201.009516 168.415471) (xy 200.919781 168.545475) (xy 200.91978 168.545476) + (xy 200.863762 168.693181) (xy 200.844722 168.849999) (xy 199.44659 168.849999) (xy 199.557365 168.822696) + (xy 199.600793 168.799903) (xy 199.69724 168.749283) (xy 199.815483 168.64453) (xy 199.90522 168.514523) + (xy 199.961237 168.366818) (xy 199.980278 168.21) (xy 199.966373 168.095476) (xy 199.961237 168.053181) + (xy 199.938687 167.993723) (xy 199.90522 167.905477) (xy 199.815483 167.77547) (xy 199.69724 167.670717) + (xy 199.697238 167.670716) (xy 199.697237 167.670715) (xy 199.557365 167.597303) (xy 199.403986 167.5595) + (xy 199.403985 167.5595) (xy 199.246015 167.5595) (xy 199.246014 167.5595) (xy 199.092634 167.597303) + (xy 198.952762 167.670715) (xy 198.834516 167.775471) (xy 198.744781 167.905475) (xy 198.74478 167.905476) + (xy 198.688762 168.053181) (xy 198.669722 168.209999) (xy 198.415278 168.209999) (xy 198.401373 168.095476) + (xy 198.396237 168.053181) (xy 198.373687 167.993723) (xy 198.34022 167.905477) (xy 198.250483 167.77547) + (xy 198.13224 167.670717) (xy 198.132238 167.670716) (xy 198.132237 167.670715) (xy 197.992365 167.597303) + (xy 197.838986 167.5595) (xy 197.838985 167.5595) (xy 197.681015 167.5595) (xy 197.681014 167.5595) + (xy 197.527634 167.597303) (xy 197.387761 167.670715) (xy 197.387759 167.670717) (xy 197.287226 167.75978) + (xy 197.223993 167.789501) (xy 197.154729 167.780317) (xy 197.122774 167.75978) (xy 197.02224 167.670717) + (xy 197.022238 167.670715) (xy 196.882365 167.597303) (xy 196.728986 167.5595) (xy 196.728985 167.5595) + (xy 196.571015 167.5595) (xy 196.571014 167.5595) (xy 196.417634 167.597303) (xy 196.277762 167.670714) + (xy 196.212869 167.728204) (xy 196.149635 167.757924) (xy 196.080372 167.74874) (xy 196.048418 167.728204) + (xy 195.983526 167.670715) (xy 195.972237 167.660714) (xy 195.832365 167.587303) (xy 195.678986 167.5495) + (xy 195.678985 167.5495) (xy 195.521015 167.5495) (xy 195.521014 167.5495) (xy 195.367634 167.587303) + (xy 195.227762 167.660715) (xy 195.169084 167.712699) (xy 195.128402 167.74874) (xy 195.109516 167.765471) + (xy 195.019781 167.895475) (xy 195.01978 167.895476) (xy 194.963762 168.043181) (xy 194.944722 168.199999) + (xy 192.425443 168.199999) (xy 192.421499 168.148807) (xy 192.454647 168.087301) (xy 192.515786 168.05348) + (xy 192.542808 168.0505) (xy 192.578985 168.0505) (xy 192.732365 168.012696) (xy 192.87224 167.939283) + (xy 192.990483 167.83453) (xy 193.08022 167.704523) (xy 193.136237 167.556818) (xy 193.155278 167.4) + (xy 193.148694 167.345771) (xy 193.136237 167.243181) (xy 193.101087 167.1505) (xy 193.08022 167.095477) + (xy 192.990483 166.96547) (xy 192.87224 166.860717) (xy 192.872238 166.860716) (xy 192.872237 166.860715) + (xy 192.732365 166.787303) (xy 192.578986 166.7495) (xy 192.578985 166.7495) (xy 192.421015 166.7495) + (xy 192.421014 166.7495) (xy 192.401825 166.754229) (xy 192.332023 166.751157) (xy 192.274962 166.710836) + (xy 192.249058 166.648777) (xy 192.236237 166.543182) (xy 192.18022 166.395477) (xy 192.090483 166.26547) + (xy 191.97224 166.160717) (xy 191.972238 166.160716) (xy 191.972237 166.160715) (xy 191.832365 166.087303) + (xy 191.678986 166.0495) (xy 191.678985 166.0495) (xy 191.521015 166.0495) (xy 191.521014 166.0495) + (xy 191.367634 166.087303) (xy 191.227762 166.160715) (xy 191.22776 166.160717) (xy 191.110898 166.264247) + (xy 191.109516 166.265471) (xy 191.019781 166.395475) (xy 191.01978 166.395476) (xy 190.963762 166.543181) + (xy 190.944722 166.699999) (xy 190.944722 166.7) (xy 190.963762 166.856818) (xy 191.014027 166.989353) + (xy 191.01978 167.004523) (xy 191.109517 167.13453) (xy 191.22776 167.239283) (xy 191.227762 167.239284) + (xy 191.367634 167.312696) (xy 191.521014 167.3505) (xy 191.521015 167.3505) (xy 191.678983 167.3505) + (xy 191.678985 167.3505) (xy 191.698171 167.345771) (xy 191.767971 167.34884) (xy 191.825034 167.389159) + (xy 191.850941 167.451221) (xy 191.863763 167.556819) (xy 191.863763 167.556821) (xy 191.873134 167.58153) + (xy 191.878501 167.651193) (xy 191.845353 167.712699) (xy 191.784214 167.74652) (xy 191.757192 167.7495) + (xy 191.721014 167.7495) (xy 191.567634 167.787303) (xy 191.427762 167.860715) (xy 191.309516 167.965471) + (xy 191.219781 168.095475) (xy 191.21978 168.095476) (xy 191.163762 168.243181) (xy 191.144722 168.399999) (xy 191.144722 168.4) (xy 191.15941 168.520973) (xy 191.147949 168.589896) (xy 191.101045 168.641682) (xy 191.033589 168.659889) (xy 191.006639 168.656316) (xy 190.978985 168.6495) (xy 190.821015 168.6495) (xy 190.821014 168.6495) (xy 190.667634 168.687303) (xy 190.527762 168.760715) (xy 190.409516 168.865471) - (xy 190.319781 168.995475) (xy 190.31978 168.995476) (xy 190.263762 169.143181) (xy 190.243818 169.307445) - (xy 190.240775 169.307075) (xy 190.225037 169.360675) (xy 190.172233 169.40643) (xy 190.103075 169.416374) - (xy 190.063097 169.403433) (xy 190.032364 169.387303) (xy 189.878986 169.3495) (xy 189.878985 169.3495) - (xy 189.721015 169.3495) (xy 189.721014 169.3495) (xy 189.567634 169.387303) (xy 189.427762 169.460715) - (xy 189.309516 169.565471) (xy 189.219781 169.695475) (xy 189.21978 169.695476) (xy 189.163762 169.843181) - (xy 189.144722 169.999999) (xy 112.3005 169.999999) (xy 112.3005 165.499999) (xy 171.844732 165.499999) - (xy 171.844732 165.5) (xy 171.863772 165.656818) (xy 171.893244 165.734528) (xy 171.91979 165.804523) - (xy 172.009527 165.93453) (xy 172.12777 166.039283) (xy 172.127772 166.039284) (xy 172.267644 166.112696) - (xy 172.421024 166.1505) (xy 172.421025 166.1505) (xy 172.578995 166.1505) (xy 172.732375 166.112696) - (xy 172.776984 166.089283) (xy 172.87225 166.039283) (xy 172.916593 165.999999) (xy 175.144722 165.999999) - (xy 175.144722 166) (xy 175.163762 166.156818) (xy 175.21978 166.304523) (xy 175.219781 166.304524) - (xy 175.309516 166.434529) (xy 175.335089 166.457185) (xy 175.372215 166.516375) (xy 175.371447 166.586241) - (xy 175.335089 166.642815) (xy 175.309516 166.66547) (xy 175.219781 166.795475) (xy 175.21978 166.795476) - (xy 175.163762 166.943181) (xy 175.144722 167.099999) (xy 175.144722 167.1) (xy 175.163762 167.256818) - (xy 175.203536 167.361692) (xy 175.21978 167.404523) (xy 175.252013 167.451221) (xy 175.309516 167.534529) - (xy 175.335089 167.557185) (xy 175.372215 167.616375) (xy 175.371447 167.686241) (xy 175.335089 167.742815) - (xy 175.309516 167.76547) (xy 175.219781 167.895475) (xy 175.21978 167.895476) (xy 175.163762 168.043181) - (xy 175.144722 168.199999) (xy 175.144722 168.2) (xy 175.163762 168.356818) (xy 175.219266 168.503169) - (xy 175.21978 168.504523) (xy 175.309517 168.63453) (xy 175.42776 168.739283) (xy 175.427762 168.739284) - (xy 175.567634 168.812696) (xy 175.721014 168.8505) (xy 175.721015 168.8505) (xy 175.878985 168.8505) - (xy 176.032365 168.812696) (xy 176.131401 168.760717) (xy 176.17224 168.739283) (xy 176.272917 168.650092) - (xy 176.8345 168.650092) (xy 176.8345 168.799907) (xy 176.863723 168.946822) (xy 176.863725 168.94683) - (xy 176.921051 169.085229) (xy 176.921056 169.085238) (xy 177.00428 169.20979) (xy 177.004283 169.209794) - (xy 177.110205 169.315716) (xy 177.110209 169.315719) (xy 177.234761 169.398943) (xy 177.23477 169.398948) - (xy 177.266123 169.411934) (xy 177.37317 169.456275) (xy 177.520092 169.485499) (xy 177.520096 169.4855) - (xy 177.520097 169.4855) (xy 177.669904 169.4855) (xy 177.669905 169.485499) (xy 177.81683 169.456275) - (xy 177.955232 169.398947) (xy 178.079791 169.315719) (xy 178.185719 169.209791) (xy 178.268947 169.085232) - (xy 178.326275 168.94683) (xy 178.3555 168.799903) (xy 178.3555 168.650097) (xy 178.326275 168.50317) - (xy 178.268947 168.364768) (xy 178.268946 168.364767) (xy 178.268943 168.364761) (xy 178.185719 168.240209) - (xy 178.185716 168.240205) (xy 178.079794 168.134283) (xy 178.07979 168.13428) (xy 177.955238 168.051056) - (xy 177.955229 168.051051) (xy 177.81683 167.993725) (xy 177.816822 167.993723) (xy 177.669907 167.9645) - (xy 177.669903 167.9645) (xy 177.520097 167.9645) (xy 177.520092 167.9645) (xy 177.373177 167.993723) - (xy 177.373169 167.993725) (xy 177.23477 168.051051) (xy 177.234761 168.051056) (xy 177.110209 168.13428) - (xy 177.110205 168.134283) (xy 177.004283 168.240205) (xy 177.00428 168.240209) (xy 176.921056 168.364761) - (xy 176.921051 168.36477) (xy 176.863725 168.503169) (xy 176.863723 168.503177) (xy 176.8345 168.650092) - (xy 176.272917 168.650092) (xy 176.290483 168.63453) (xy 176.38022 168.504523) (xy 176.436237 168.356818) - (xy 176.455278 168.2) (xy 176.437488 168.05348) (xy 176.436237 168.043181) (xy 176.406397 167.9645) - (xy 176.38022 167.895477) (xy 176.290483 167.76547) (xy 176.26491 167.742814) (xy 176.227785 167.683627) - (xy 176.228552 167.613761) (xy 176.26491 167.557185) (xy 176.290483 167.53453) (xy 176.38022 167.404523) - (xy 176.436237 167.256818) (xy 176.455278 167.1) (xy 176.447666 167.037304) (xy 176.436237 166.943181) - (xy 176.403608 166.857146) (xy 176.38022 166.795477) (xy 176.290483 166.66547) (xy 176.26491 166.642814) - (xy 176.227785 166.583627) (xy 176.228552 166.513761) (xy 176.26491 166.457185) (xy 176.290483 166.43453) - (xy 176.38022 166.304523) (xy 176.436237 166.156818) (xy 176.455278 166) (xy 176.445702 165.921129) - (xy 176.436237 165.843181) (xy 176.411142 165.777011) (xy 176.391417 165.725) (xy 180.529659 165.725) - (xy 180.548975 165.921129) (xy 180.548976 165.921132) (xy 180.5729 166) (xy 180.606188 166.109733) - (xy 180.699086 166.283532) (xy 180.69909 166.283539) (xy 180.824116 166.435883) (xy 180.97646 166.560909) - (xy 180.976467 166.560913) (xy 181.150266 166.653811) (xy 181.150269 166.653811) (xy 181.150273 166.653814) - (xy 181.338868 166.711024) (xy 181.535 166.730341) (xy 181.731132 166.711024) (xy 181.919727 166.653814) - (xy 182.093538 166.56091) (xy 182.245883 166.435883) (xy 182.37091 166.283538) (xy 182.417981 166.195475) - (xy 182.463811 166.109733) (xy 182.463811 166.109732) (xy 182.463814 166.109727) (xy 182.521024 165.921132) - (xy 182.540341 165.725) (xy 182.52803 165.599999) (xy 187.844722 165.599999) (xy 187.844722 165.6) - (xy 187.863762 165.756818) (xy 187.900818 165.854524) (xy 187.91978 165.904523) (xy 188.009517 166.03453) - (xy 188.12776 166.139283) (xy 188.127762 166.139284) (xy 188.267634 166.212696) (xy 188.421014 166.2505) - (xy 188.53505 166.2505) (xy 188.602089 166.270185) (xy 188.647844 166.322989) (xy 188.658145 166.389445) - (xy 188.652507 166.435883) (xy 188.644722 166.5) (xy 188.663762 166.656818) (xy 188.716349 166.795476) - (xy 188.71978 166.804523) (xy 188.809517 166.93453) (xy 188.92776 167.039283) (xy 188.927762 167.039284) - (xy 189.067634 167.112696) (xy 189.221014 167.1505) (xy 189.221015 167.1505) (xy 189.378985 167.1505) - (xy 189.532365 167.112696) (xy 189.556557 167.099999) (xy 189.67224 167.039283) (xy 189.790483 166.93453) - (xy 189.88022 166.804523) (xy 189.936237 166.656818) (xy 189.955278 166.5) (xy 189.947329 166.434529) - (xy 189.936237 166.343181) (xy 189.88675 166.212696) (xy 189.88022 166.195477) (xy 189.790483 166.06547) - (xy 189.67224 165.960717) (xy 189.672238 165.960716) (xy 189.672237 165.960715) (xy 189.532365 165.887303) - (xy 189.378986 165.8495) (xy 189.378985 165.8495) (xy 189.264951 165.8495) (xy 189.197912 165.829815) - (xy 189.152157 165.777011) (xy 189.141855 165.710554) (xy 189.155278 165.6) (xy 189.155278 165.599999) - (xy 189.149207 165.549999) (xy 195.794722 165.549999) (xy 195.794722 165.55) (xy 195.813762 165.706818) - (xy 195.865479 165.843182) (xy 195.86978 165.854523) (xy 195.959517 165.98453) (xy 196.07776 166.089283) - (xy 196.077762 166.089284) (xy 196.217634 166.162696) (xy 196.371014 166.2005) (xy 196.371015 166.2005) - (xy 196.528985 166.2005) (xy 196.531014 166.2) (xy 244.3 166.2) (xy 244.3 188.8) (xy 251.376 188.8) - (xy 251.443039 188.819685) (xy 251.488794 188.872489) (xy 251.5 188.924) (xy 251.5 194.761107) (xy 251.480315 194.828146) - (xy 251.427511 194.873901) (xy 251.358353 194.883845) (xy 251.294797 194.85482) (xy 251.262444 194.810917) - (xy 251.203623 194.676818) (xy 251.195049 194.657272) (xy 251.159285 194.602532) (xy 251.105364 194.52) - (xy 251.063571 194.456031) (xy 250.900764 194.279175) (xy 250.900759 194.279171) (xy 250.900757 194.279169) - (xy 250.711075 194.131533) (xy 250.711069 194.131529) (xy 250.499657 194.017118) (xy 250.499652 194.017116) - (xy 250.2723 193.939066) (xy 250.094468 193.909391) (xy 250.035192 193.8995) (xy 249.794808 193.8995) - (xy 249.748047 193.907303) (xy 249.557699 193.939066) (xy 249.330347 194.017116) (xy 249.330342 194.017118) - (xy 249.11893 194.131529) (xy 249.118924 194.131533) (xy 248.929242 194.279169) (xy 248.929239 194.279172) - (xy 248.929236 194.279174) (xy 248.929236 194.279175) (xy 248.908972 194.301188) (xy 248.76643 194.456029) - (xy 248.766427 194.456033) (xy 248.634951 194.65727) (xy 248.538389 194.87741) (xy 248.479379 195.11044) - (xy 248.459529 195.349994) (xy 248.459529 195.350005) (xy 248.479379 195.589559) (xy 248.538389 195.822589) - (xy 248.634951 196.042729) (xy 248.757629 196.2305) (xy 248.766429 196.243969) (xy 248.929236 196.420825) - (xy 248.929239 196.420827) (xy 248.929242 196.42083) (xy 249.118924 196.568466) (xy 249.11893 196.56847) - (xy 249.118933 196.568472) (xy 249.330344 196.682882) (xy 249.330347 196.682883) (xy 249.557699 196.760933) - (xy 249.557701 196.760933) (xy 249.557703 196.760934) (xy 249.794808 196.8005) (xy 249.794809 196.8005) - (xy 250.035191 196.8005) (xy 250.035192 196.8005) (xy 250.272297 196.760934) (xy 250.499656 196.682882) - (xy 250.711067 196.568472) (xy 250.900764 196.420825) (xy 251.063571 196.243969) (xy 251.195049 196.042728) - (xy 251.262444 195.889081) (xy 251.3074 195.835596) (xy 251.374136 195.814906) (xy 251.441464 195.83358) - (xy 251.488007 195.885691) (xy 251.5 195.938892) (xy 251.5 208.231107) (xy 251.480315 208.298146) - (xy 251.427511 208.343901) (xy 251.358353 208.353845) (xy 251.294797 208.32482) (xy 251.262444 208.280917) - (xy 251.195048 208.12727) (xy 251.063572 207.926033) (xy 251.063571 207.926031) (xy 250.900764 207.749175) - (xy 250.900759 207.749171) (xy 250.900757 207.749169) (xy 250.711075 207.601533) (xy 250.711069 207.601529) - (xy 250.499657 207.487118) (xy 250.499652 207.487116) (xy 250.2723 207.409066) (xy 250.094468 207.379391) - (xy 250.035192 207.3695) (xy 249.794808 207.3695) (xy 249.747387 207.377413) (xy 249.557699 207.409066) - (xy 249.330347 207.487116) (xy 249.330342 207.487118) (xy 249.11893 207.601529) (xy 249.118924 207.601533) - (xy 248.929242 207.749169) (xy 248.929239 207.749172) (xy 248.76643 207.926029) (xy 248.766427 207.926033) - (xy 248.634951 208.12727) (xy 248.538389 208.34741) (xy 248.479379 208.58044) (xy 248.459529 208.819994) - (xy 248.459529 208.820005) (xy 248.479379 209.059559) (xy 248.538389 209.292589) (xy 248.634951 209.512729) - (xy 248.766427 209.713966) (xy 248.766429 209.713969) (xy 248.929236 209.890825) (xy 248.929239 209.890827) - (xy 248.929242 209.89083) (xy 249.118924 210.038466) (xy 249.11893 210.03847) (xy 249.118933 210.038472) - (xy 249.330344 210.152882) (xy 249.347208 210.158671) (xy 249.557699 210.230933) (xy 249.557701 210.230933) - (xy 249.557703 210.230934) (xy 249.794808 210.2705) (xy 249.794809 210.2705) (xy 250.035191 210.2705) - (xy 250.035192 210.2705) (xy 250.272297 210.230934) (xy 250.499656 210.152882) (xy 250.711067 210.038472) - (xy 250.728988 210.024524) (xy 250.775315 209.988466) (xy 250.900764 209.890825) (xy 251.063571 209.713969) - (xy 251.195049 209.512728) (xy 251.262444 209.359081) (xy 251.3074 209.305596) (xy 251.374136 209.284906) - (xy 251.441464 209.30358) (xy 251.488007 209.355691) (xy 251.5 209.408892) (xy 251.5 213.5) (xy 268.5 213.5) - (xy 268.5 213) (xy 252.124 213) (xy 252.056961 212.980315) (xy 252.011206 212.927511) (xy 252 212.876) - (xy 252 209.719999) (xy 256.654722 209.719999) (xy 256.654722 209.72) (xy 256.673762 209.876818) - (xy 256.717 209.990825) (xy 256.72978 210.024523) (xy 256.819517 210.15453) (xy 256.93776 210.259283) - (xy 256.937762 210.259284) (xy 257.077634 210.332696) (xy 257.231014 210.3705) (xy 257.231015 210.3705) - (xy 257.388985 210.3705) (xy 257.542365 210.332696) (xy 257.545724 210.330933) (xy 257.68224 210.259283) - (xy 257.800483 210.15453) (xy 257.89022 210.024523) (xy 257.946237 209.876818) (xy 257.965278 209.72) - (xy 257.946237 209.563182) (xy 257.945302 209.560717) (xy 257.903123 209.4495) (xy 257.89022 209.415477) - (xy 257.800483 209.28547) (xy 257.68224 209.180717) (xy 257.682238 209.180716) (xy 257.682237 209.180715) - (xy 257.542365 209.107303) (xy 257.388986 209.0695) (xy 257.388985 209.0695) (xy 257.231015 209.0695) - (xy 257.231014 209.0695) (xy 257.077634 209.107303) (xy 256.937762 209.180715) (xy 256.819516 209.285471) - (xy 256.729781 209.415475) (xy 256.72978 209.415476) (xy 256.673762 209.563181) (xy 256.654722 209.719999) - (xy 252 209.719999) (xy 252 205.899999) (xy 253.544722 205.899999) (xy 253.544722 205.9) (xy 253.563762 206.056818) + (xy 190.319781 168.995475) (xy 190.31978 168.995476) (xy 190.263762 169.143181) (xy 190.244722 169.299999) + (xy 189.755278 169.299999) (xy 189.736237 169.143182) (xy 189.68022 168.995477) (xy 189.590483 168.86547) + (xy 189.47224 168.760717) (xy 189.472238 168.760716) (xy 189.472237 168.760715) (xy 189.332365 168.687303) + (xy 189.178986 168.6495) (xy 189.178985 168.6495) (xy 189.021015 168.6495) (xy 189.021014 168.6495) + (xy 188.867634 168.687303) (xy 188.727762 168.760715) (xy 188.609516 168.865471) (xy 188.519781 168.995475) + (xy 188.51978 168.995476) (xy 188.463762 169.143181) (xy 188.444722 169.299999) (xy 178.095511 169.299999) + (xy 178.185719 169.209791) (xy 178.268947 169.085232) (xy 178.326275 168.94683) (xy 178.3555 168.799903) + (xy 178.3555 168.650097) (xy 178.326275 168.50317) (xy 178.268947 168.364768) (xy 178.268946 168.364767) + (xy 178.268943 168.364761) (xy 178.185719 168.240209) (xy 178.185716 168.240205) (xy 178.079794 168.134283) + (xy 178.07979 168.13428) (xy 177.955238 168.051056) (xy 177.955229 168.051051) (xy 177.81683 167.993725) + (xy 177.816822 167.993723) (xy 177.669907 167.9645) (xy 177.669903 167.9645) (xy 177.520097 167.9645) + (xy 177.520092 167.9645) (xy 177.373177 167.993723) (xy 177.373169 167.993725) (xy 177.23477 168.051051) + (xy 177.234761 168.051056) (xy 177.110209 168.13428) (xy 177.110205 168.134283) (xy 177.004283 168.240205) + (xy 177.00428 168.240209) (xy 176.921056 168.364761) (xy 176.921051 168.36477) (xy 176.863725 168.503169) + (xy 176.863723 168.503177) (xy 176.8345 168.650092) (xy 176.272917 168.650092) (xy 176.290483 168.63453) + (xy 176.38022 168.504523) (xy 176.436237 168.356818) (xy 176.455278 168.2) (xy 176.442587 168.095475) + (xy 176.436237 168.043181) (xy 176.406397 167.9645) (xy 176.38022 167.895477) (xy 176.290483 167.76547) + (xy 176.26491 167.742814) (xy 176.227785 167.683627) (xy 176.228552 167.613761) (xy 176.26491 167.557185) + (xy 176.290483 167.53453) (xy 176.38022 167.404523) (xy 176.436237 167.256818) (xy 176.455278 167.1) + (xy 176.447666 167.037304) (xy 176.436237 166.943181) (xy 176.404961 166.860715) (xy 176.38022 166.795477) + (xy 176.290483 166.66547) (xy 176.26491 166.642814) (xy 176.227785 166.583627) (xy 176.228552 166.513761) + (xy 176.26491 166.457185) (xy 176.290483 166.43453) (xy 176.38022 166.304523) (xy 176.436237 166.156818) + (xy 176.455278 166) (xy 176.445702 165.921129) (xy 176.436237 165.843181) (xy 176.411142 165.777011) + (xy 176.391417 165.725) (xy 180.529659 165.725) (xy 180.548975 165.921129) (xy 180.548976 165.921132) + (xy 180.5729 166) (xy 180.606188 166.109733) (xy 180.699086 166.283532) (xy 180.69909 166.283539) + (xy 180.824116 166.435883) (xy 180.97646 166.560909) (xy 180.976467 166.560913) (xy 181.150266 166.653811) + (xy 181.150269 166.653811) (xy 181.150273 166.653814) (xy 181.338868 166.711024) (xy 181.535 166.730341) + (xy 181.731132 166.711024) (xy 181.919727 166.653814) (xy 182.093538 166.56091) (xy 182.245883 166.435883) + (xy 182.37091 166.283538) (xy 182.417981 166.195475) (xy 182.463811 166.109733) (xy 182.463811 166.109732) + (xy 182.463814 166.109727) (xy 182.521024 165.921132) (xy 182.540341 165.725) (xy 182.52803 165.599999) + (xy 187.844722 165.599999) (xy 187.844722 165.6) (xy 187.863762 165.756818) (xy 187.900818 165.854524) + (xy 187.91978 165.904523) (xy 188.009517 166.03453) (xy 188.12776 166.139283) (xy 188.127762 166.139284) + (xy 188.267634 166.212696) (xy 188.421014 166.2505) (xy 188.53505 166.2505) (xy 188.602089 166.270185) + (xy 188.647844 166.322989) (xy 188.658145 166.389445) (xy 188.652507 166.435883) (xy 188.644722 166.5) + (xy 188.663762 166.656818) (xy 188.716349 166.795476) (xy 188.71978 166.804523) (xy 188.809517 166.93453) + (xy 188.92776 167.039283) (xy 188.927762 167.039284) (xy 189.067634 167.112696) (xy 189.221014 167.1505) + (xy 189.221015 167.1505) (xy 189.378985 167.1505) (xy 189.513863 167.117256) (xy 189.583664 167.120325) + (xy 189.640726 167.160645) (xy 189.666932 167.225414) (xy 189.65396 167.294069) (xy 189.645588 167.308091) + (xy 189.619786 167.345471) (xy 189.619784 167.345476) (xy 189.563766 167.493181) (xy 189.544726 167.649999) + (xy 189.544726 167.65) (xy 189.563766 167.806818) (xy 189.601183 167.905476) (xy 189.619784 167.954523) + (xy 189.709521 168.08453) (xy 189.827764 168.189283) (xy 189.827766 168.189284) (xy 189.967638 168.262696) + (xy 190.121018 168.3005) (xy 190.121019 168.3005) (xy 190.278989 168.3005) (xy 190.432369 168.262696) + (xy 190.475221 168.240205) (xy 190.572244 168.189283) (xy 190.690487 168.08453) (xy 190.780224 167.954523) + (xy 190.836241 167.806818) (xy 190.855282 167.65) (xy 190.848884 167.597303) (xy 190.836241 167.493181) + (xy 190.814996 167.437164) (xy 190.780224 167.345477) (xy 190.690487 167.21547) (xy 190.572244 167.110717) + (xy 190.572242 167.110716) (xy 190.572241 167.110715) (xy 190.432369 167.037303) (xy 190.27899 166.9995) + (xy 190.278989 166.9995) (xy 190.121019 166.9995) (xy 190.121018 166.9995) (xy 189.98614 167.032743) + (xy 189.916338 167.029673) (xy 189.859276 166.989353) (xy 189.833071 166.924584) (xy 189.846044 166.855929) + (xy 189.854417 166.841905) (xy 189.880218 166.804526) (xy 189.880219 166.804524) (xy 189.88022 166.804523) + (xy 189.936237 166.656818) (xy 189.955278 166.5) (xy 189.947329 166.434529) (xy 189.936237 166.343181) + (xy 189.88675 166.212696) (xy 189.88022 166.195477) (xy 189.790483 166.06547) (xy 189.67224 165.960717) + (xy 189.672238 165.960716) (xy 189.672237 165.960715) (xy 189.532365 165.887303) (xy 189.378986 165.8495) + (xy 189.378985 165.8495) (xy 189.264951 165.8495) (xy 189.197912 165.829815) (xy 189.152157 165.777011) + (xy 189.141855 165.710554) (xy 189.155278 165.6) (xy 189.155278 165.599999) (xy 189.149207 165.549999) + (xy 195.794722 165.549999) (xy 195.794722 165.55) (xy 195.813762 165.706818) (xy 195.865479 165.843182) + (xy 195.86978 165.854523) (xy 195.959517 165.98453) (xy 196.07776 166.089283) (xy 196.077762 166.089284) + (xy 196.217634 166.162696) (xy 196.371014 166.2005) (xy 196.371015 166.2005) (xy 196.528985 166.2005) + (xy 196.531014 166.2) (xy 244.3 166.2) (xy 244.3 188.8) (xy 251.376 188.8) (xy 251.443039 188.819685) + (xy 251.488794 188.872489) (xy 251.5 188.924) (xy 251.5 194.761107) (xy 251.480315 194.828146) (xy 251.427511 194.873901) + (xy 251.358353 194.883845) (xy 251.294797 194.85482) (xy 251.262444 194.810917) (xy 251.203623 194.676818) + (xy 251.195049 194.657272) (xy 251.159285 194.602532) (xy 251.105364 194.52) (xy 251.063571 194.456031) + (xy 250.900764 194.279175) (xy 250.900759 194.279171) (xy 250.900757 194.279169) (xy 250.711075 194.131533) + (xy 250.711069 194.131529) (xy 250.499657 194.017118) (xy 250.499652 194.017116) (xy 250.2723 193.939066) + (xy 250.094468 193.909391) (xy 250.035192 193.8995) (xy 249.794808 193.8995) (xy 249.748047 193.907303) + (xy 249.557699 193.939066) (xy 249.330347 194.017116) (xy 249.330342 194.017118) (xy 249.11893 194.131529) + (xy 249.118924 194.131533) (xy 248.929242 194.279169) (xy 248.929239 194.279172) (xy 248.929236 194.279174) + (xy 248.929236 194.279175) (xy 248.908972 194.301188) (xy 248.76643 194.456029) (xy 248.766427 194.456033) + (xy 248.634951 194.65727) (xy 248.538389 194.87741) (xy 248.479379 195.11044) (xy 248.459529 195.349994) + (xy 248.459529 195.350005) (xy 248.479379 195.589559) (xy 248.538389 195.822589) (xy 248.634951 196.042729) + (xy 248.757629 196.2305) (xy 248.766429 196.243969) (xy 248.929236 196.420825) (xy 248.929239 196.420827) + (xy 248.929242 196.42083) (xy 249.118924 196.568466) (xy 249.11893 196.56847) (xy 249.118933 196.568472) + (xy 249.330344 196.682882) (xy 249.330347 196.682883) (xy 249.557699 196.760933) (xy 249.557701 196.760933) + (xy 249.557703 196.760934) (xy 249.794808 196.8005) (xy 249.794809 196.8005) (xy 250.035191 196.8005) + (xy 250.035192 196.8005) (xy 250.272297 196.760934) (xy 250.499656 196.682882) (xy 250.711067 196.568472) + (xy 250.900764 196.420825) (xy 251.063571 196.243969) (xy 251.195049 196.042728) (xy 251.262444 195.889081) + (xy 251.3074 195.835596) (xy 251.374136 195.814906) (xy 251.441464 195.83358) (xy 251.488007 195.885691) + (xy 251.5 195.938892) (xy 251.5 208.231107) (xy 251.480315 208.298146) (xy 251.427511 208.343901) + (xy 251.358353 208.353845) (xy 251.294797 208.32482) (xy 251.262444 208.280917) (xy 251.195048 208.12727) + (xy 251.063572 207.926033) (xy 251.063571 207.926031) (xy 250.900764 207.749175) (xy 250.900759 207.749171) + (xy 250.900757 207.749169) (xy 250.711075 207.601533) (xy 250.711069 207.601529) (xy 250.499657 207.487118) + (xy 250.499652 207.487116) (xy 250.2723 207.409066) (xy 250.094468 207.379391) (xy 250.035192 207.3695) + (xy 249.794808 207.3695) (xy 249.747387 207.377413) (xy 249.557699 207.409066) (xy 249.330347 207.487116) + (xy 249.330342 207.487118) (xy 249.11893 207.601529) (xy 249.118924 207.601533) (xy 248.929242 207.749169) + (xy 248.929239 207.749172) (xy 248.76643 207.926029) (xy 248.766427 207.926033) (xy 248.634951 208.12727) + (xy 248.538389 208.34741) (xy 248.479379 208.58044) (xy 248.459529 208.819994) (xy 248.459529 208.820005) + (xy 248.479379 209.059559) (xy 248.538389 209.292589) (xy 248.634951 209.512729) (xy 248.766427 209.713966) + (xy 248.766429 209.713969) (xy 248.929236 209.890825) (xy 248.929239 209.890827) (xy 248.929242 209.89083) + (xy 249.118924 210.038466) (xy 249.11893 210.03847) (xy 249.118933 210.038472) (xy 249.330344 210.152882) + (xy 249.347208 210.158671) (xy 249.557699 210.230933) (xy 249.557701 210.230933) (xy 249.557703 210.230934) + (xy 249.794808 210.2705) (xy 249.794809 210.2705) (xy 250.035191 210.2705) (xy 250.035192 210.2705) + (xy 250.272297 210.230934) (xy 250.499656 210.152882) (xy 250.711067 210.038472) (xy 250.728988 210.024524) + (xy 250.775315 209.988466) (xy 250.900764 209.890825) (xy 251.063571 209.713969) (xy 251.195049 209.512728) + (xy 251.262444 209.359081) (xy 251.3074 209.305596) (xy 251.374136 209.284906) (xy 251.441464 209.30358) + (xy 251.488007 209.355691) (xy 251.5 209.408892) (xy 251.5 213.5) (xy 268.5 213.5) (xy 268.5 213) + (xy 252.124 213) (xy 252.056961 212.980315) (xy 252.011206 212.927511) (xy 252 212.876) (xy 252 209.719999) + (xy 256.654722 209.719999) (xy 256.654722 209.72) (xy 256.673762 209.876818) (xy 256.717 209.990825) + (xy 256.72978 210.024523) (xy 256.819517 210.15453) (xy 256.93776 210.259283) (xy 256.937762 210.259284) + (xy 257.077634 210.332696) (xy 257.231014 210.3705) (xy 257.231015 210.3705) (xy 257.388985 210.3705) + (xy 257.542365 210.332696) (xy 257.545724 210.330933) (xy 257.68224 210.259283) (xy 257.800483 210.15453) + (xy 257.89022 210.024523) (xy 257.946237 209.876818) (xy 257.965278 209.72) (xy 257.946237 209.563182) + (xy 257.945302 209.560717) (xy 257.903123 209.4495) (xy 257.89022 209.415477) (xy 257.800483 209.28547) + (xy 257.68224 209.180717) (xy 257.682238 209.180716) (xy 257.682237 209.180715) (xy 257.542365 209.107303) + (xy 257.388986 209.0695) (xy 257.388985 209.0695) (xy 257.231015 209.0695) (xy 257.231014 209.0695) + (xy 257.077634 209.107303) (xy 256.937762 209.180715) (xy 256.819516 209.285471) (xy 256.729781 209.415475) + (xy 256.72978 209.415476) (xy 256.673762 209.563181) (xy 256.654722 209.719999) (xy 252 209.719999) + (xy 252 205.899999) (xy 253.544722 205.899999) (xy 253.544722 205.9) (xy 253.563762 206.056818) (xy 253.608403 206.174524) (xy 253.61978 206.204523) (xy 253.709517 206.33453) (xy 253.82776 206.439283) (xy 253.827762 206.439284) (xy 253.967634 206.512696) (xy 254.121014 206.5505) (xy 254.121015 206.5505) (xy 254.278985 206.5505) (xy 254.432365 206.512696) (xy 254.489524 206.482696) (xy 254.57224 206.439283) (xy 254.690483 206.33453) (xy 254.78022 206.204523) (xy 254.836237 206.056818) (xy 254.855278 205.9) (xy 254.836237 205.743182) (xy 254.78022 205.595477) (xy 254.762634 205.569999) (xy 261.584722 205.569999) - (xy 261.584722 205.57) (xy 261.603762 205.726818) (xy 261.658064 205.869999) (xy 261.65978 205.874523) + (xy 261.584722 205.57) (xy 261.603762 205.726818) (xy 261.647894 205.843182) (xy 261.65978 205.874523) (xy 261.749517 206.00453) (xy 261.86776 206.109283) (xy 261.867762 206.109284) (xy 262.007634 206.182696) (xy 262.161014 206.2205) (xy 262.161015 206.2205) (xy 262.318985 206.2205) (xy 262.472365 206.182696) (xy 262.487937 206.174523) (xy 262.61224 206.109283) (xy 262.730483 206.00453) (xy 262.82022 205.874523) @@ -164860,7 +169319,7 @@ (xy 263.878986 204.8495) (xy 263.878985 204.8495) (xy 263.721015 204.8495) (xy 263.721014 204.8495) (xy 263.567634 204.887303) (xy 263.427762 204.960715) (xy 263.309516 205.065471) (xy 263.219781 205.195475) (xy 263.21978 205.195476) (xy 263.163762 205.343181) (xy 263.144722 205.499999) (xy 262.886779 205.499999) - (xy 262.876237 205.413181) (xy 262.854992 205.357164) (xy 262.82022 205.265477) (xy 262.730483 205.13547) + (xy 262.876237 205.413181) (xy 262.852086 205.3495) (xy 262.82022 205.265477) (xy 262.730483 205.13547) (xy 262.61224 205.030717) (xy 262.612238 205.030716) (xy 262.612237 205.030715) (xy 262.472365 204.957303) (xy 262.318986 204.9195) (xy 262.318985 204.9195) (xy 262.161015 204.9195) (xy 262.161014 204.9195) (xy 262.007634 204.957303) (xy 261.867762 205.030715) (xy 261.749516 205.135471) (xy 261.659781 205.265475) @@ -165447,9 +169906,9 @@ (xy 187.971462 157.187696) (xy 187.972733 157.187029) (xy 188.111337 157.114283) (xy 188.22958 157.00953) (xy 188.319317 156.879523) (xy 188.375334 156.731818) (xy 188.394375 156.575) (xy 188.375334 156.418182) (xy 188.319317 156.270477) (xy 188.232664 156.144938) (xy 188.210782 156.078586) (xy 188.228247 156.010934) - (xy 188.279515 155.963464) (xy 188.334715 155.9505) (xy 188.478985 155.9505) (xy 188.632365 155.912696) - (xy 188.651155 155.902834) (xy 188.77224 155.839283) (xy 188.890483 155.73453) (xy 188.98022 155.604523) - (xy 189.036237 155.456818) (xy 189.046756 155.370189) (xy 192.174532 155.370189) (xy 192.174532 155.37019) + (xy 188.279515 155.963464) (xy 188.334715 155.9505) (xy 188.478983 155.9505) (xy 188.632363 155.912696) + (xy 188.651153 155.902834) (xy 188.772238 155.839283) (xy 188.890481 155.73453) (xy 188.980218 155.604523) + (xy 189.036235 155.456818) (xy 189.046754 155.370189) (xy 192.174532 155.370189) (xy 192.174532 155.37019) (xy 192.193572 155.527008) (xy 192.225921 155.612303) (xy 192.24959 155.674713) (xy 192.339327 155.80472) (xy 192.45757 155.909473) (xy 192.457572 155.909474) (xy 192.597444 155.982886) (xy 192.750824 156.02069) (xy 192.750825 156.02069) (xy 192.908795 156.02069) (xy 193.062175 155.982886) (xy 193.101392 155.962303) @@ -165487,15 +169946,15 @@ (xy 193.202047 154.830905) (xy 193.062175 154.757493) (xy 192.908796 154.71969) (xy 192.908795 154.71969) (xy 192.750825 154.71969) (xy 192.750824 154.71969) (xy 192.597444 154.757493) (xy 192.457572 154.830905) (xy 192.339326 154.935661) (xy 192.249591 155.065665) (xy 192.24959 155.065666) (xy 192.193572 155.213371) - (xy 192.174532 155.370189) (xy 189.046756 155.370189) (xy 189.055278 155.3) (xy 189.04476 155.213371) - (xy 189.036237 155.143181) (xy 189.006839 155.065665) (xy 188.98022 154.995477) (xy 188.890483 154.86547) - (xy 188.77224 154.760717) (xy 188.772238 154.760716) (xy 188.772237 154.760715) (xy 188.632365 154.687303) - (xy 188.478986 154.6495) (xy 188.478985 154.6495) (xy 188.321015 154.6495) (xy 188.321014 154.6495) - (xy 188.167634 154.687303) (xy 188.027762 154.760715) (xy 187.909516 154.865471) (xy 187.819781 154.995475) - (xy 187.81978 154.995476) (xy 187.763762 155.143181) (xy 187.744722 155.299999) (xy 187.744722 155.3) - (xy 187.763762 155.456818) (xy 187.795038 155.539284) (xy 187.81978 155.604523) (xy 187.882559 155.695475) - (xy 187.906432 155.73006) (xy 187.928315 155.796414) (xy 187.91085 155.864066) (xy 187.859582 155.911536) - (xy 187.804382 155.9245) (xy 187.660111 155.9245) (xy 187.506731 155.962303) (xy 187.366859 156.035715) + (xy 192.174532 155.370189) (xy 189.046754 155.370189) (xy 189.055276 155.3) (xy 189.044758 155.213371) + (xy 189.036235 155.143181) (xy 189.006837 155.065665) (xy 188.980218 154.995477) (xy 188.890481 154.86547) + (xy 188.772238 154.760717) (xy 188.772236 154.760716) (xy 188.772235 154.760715) (xy 188.632363 154.687303) + (xy 188.478984 154.6495) (xy 188.478983 154.6495) (xy 188.321013 154.6495) (xy 188.321012 154.6495) + (xy 188.167632 154.687303) (xy 188.02776 154.760715) (xy 187.909514 154.865471) (xy 187.819779 154.995475) + (xy 187.819778 154.995476) (xy 187.76376 155.143181) (xy 187.74472 155.299999) (xy 187.74472 155.3) + (xy 187.76376 155.456818) (xy 187.795036 155.539284) (xy 187.819778 155.604523) (xy 187.882557 155.695475) + (xy 187.90643 155.73006) (xy 187.928313 155.796414) (xy 187.910848 155.864066) (xy 187.85958 155.911536) + (xy 187.80438 155.9245) (xy 187.660111 155.9245) (xy 187.506731 155.962303) (xy 187.366859 156.035715) (xy 187.248613 156.140471) (xy 187.158878 156.270475) (xy 187.158877 156.270476) (xy 187.102859 156.418181) (xy 187.083819 156.574999) (xy 187.083819 156.575) (xy 187.102859 156.731818) (xy 187.15026 156.856801) (xy 187.155627 156.926464) (xy 187.12248 156.98797) (xy 187.061342 157.021792) (xy 186.991624 157.01719) @@ -165671,11 +170130,11 @@ (xy 181.309517 153.73453) (xy 181.42776 153.839283) (xy 181.427762 153.839284) (xy 181.567634 153.912696) (xy 181.721014 153.9505) (xy 181.721015 153.9505) (xy 181.878985 153.9505) (xy 182.032365 153.912696) (xy 182.039859 153.908763) (xy 182.17224 153.839283) (xy 182.290483 153.73453) (xy 182.34883 153.649999) - (xy 187.794722 153.649999) (xy 187.794722 153.65) (xy 187.813762 153.806818) (xy 187.864 153.939283) - (xy 187.86978 153.954523) (xy 187.959517 154.08453) (xy 188.07776 154.189283) (xy 188.077762 154.189284) - (xy 188.217634 154.262696) (xy 188.371014 154.3005) (xy 188.371015 154.3005) (xy 188.528985 154.3005) - (xy 188.682365 154.262696) (xy 188.82224 154.189283) (xy 188.940483 154.08453) (xy 189.03022 153.954523) - (xy 189.086237 153.806818) (xy 189.086938 153.801041) (xy 200.322979 153.801041) (xy 200.342295 153.99717) + (xy 187.744722 153.649999) (xy 187.744722 153.65) (xy 187.763762 153.806818) (xy 187.814 153.939283) + (xy 187.81978 153.954523) (xy 187.909517 154.08453) (xy 188.02776 154.189283) (xy 188.027762 154.189284) + (xy 188.167634 154.262696) (xy 188.321014 154.3005) (xy 188.321015 154.3005) (xy 188.478985 154.3005) + (xy 188.632365 154.262696) (xy 188.77224 154.189283) (xy 188.890483 154.08453) (xy 188.98022 153.954523) + (xy 189.036237 153.806818) (xy 189.036938 153.801041) (xy 200.322979 153.801041) (xy 200.342295 153.99717) (xy 200.342296 153.997173) (xy 200.373808 154.101055) (xy 200.399508 154.185774) (xy 200.492406 154.359573) (xy 200.49241 154.35958) (xy 200.617436 154.511924) (xy 200.76978 154.63695) (xy 200.769787 154.636954) (xy 200.943586 154.729852) (xy 200.943589 154.729852) (xy 200.943593 154.729855) (xy 201.132188 154.787065) @@ -165687,13 +170146,13 @@ (xy 201.713053 152.872229) (xy 201.713047 152.872227) (xy 201.524452 152.815017) (xy 201.524449 152.815016) (xy 201.32832 152.7957) (xy 201.13219 152.815016) (xy 200.943586 152.872229) (xy 200.769787 152.965127) (xy 200.76978 152.965131) (xy 200.617436 153.090157) (xy 200.49241 153.242501) (xy 200.492406 153.242508) - (xy 200.399508 153.416307) (xy 200.342295 153.604911) (xy 200.322979 153.801041) (xy 189.086938 153.801041) - (xy 189.105278 153.65) (xy 189.0915 153.536522) (xy 189.086237 153.493181) (xy 189.053369 153.406517) - (xy 189.03022 153.345477) (xy 188.940483 153.21547) (xy 188.82224 153.110717) (xy 188.822238 153.110716) - (xy 188.822237 153.110715) (xy 188.682365 153.037303) (xy 188.528986 152.9995) (xy 188.528985 152.9995) - (xy 188.371015 152.9995) (xy 188.371014 152.9995) (xy 188.217634 153.037303) (xy 188.077762 153.110715) - (xy 187.959516 153.215471) (xy 187.869781 153.345475) (xy 187.86978 153.345476) (xy 187.813762 153.493181) - (xy 187.794722 153.649999) (xy 182.34883 153.649999) (xy 182.38022 153.604523) (xy 182.436237 153.456818) + (xy 200.399508 153.416307) (xy 200.342295 153.604911) (xy 200.322979 153.801041) (xy 189.036938 153.801041) + (xy 189.055278 153.65) (xy 189.0415 153.536522) (xy 189.036237 153.493181) (xy 189.003369 153.406517) + (xy 188.98022 153.345477) (xy 188.890483 153.21547) (xy 188.77224 153.110717) (xy 188.772238 153.110716) + (xy 188.772237 153.110715) (xy 188.632365 153.037303) (xy 188.478986 152.9995) (xy 188.478985 152.9995) + (xy 188.321015 152.9995) (xy 188.321014 152.9995) (xy 188.167634 153.037303) (xy 188.027762 153.110715) + (xy 187.909516 153.215471) (xy 187.819781 153.345475) (xy 187.81978 153.345476) (xy 187.763762 153.493181) + (xy 187.744722 153.649999) (xy 182.34883 153.649999) (xy 182.38022 153.604523) (xy 182.436237 153.456818) (xy 182.455278 153.3) (xy 182.454525 153.293794) (xy 182.436237 153.143181) (xy 182.406765 153.06547) (xy 182.38022 152.995477) (xy 182.290483 152.86547) (xy 182.17224 152.760717) (xy 182.172238 152.760716) (xy 182.172237 152.760715) (xy 182.032365 152.687303) (xy 181.878986 152.6495) (xy 181.878985 152.6495) @@ -167464,465 +171923,466 @@ (xy 166.575341 117.892118) (xy 166.363929 118.006529) (xy 166.363923 118.006533) (xy 166.174241 118.154169) (xy 166.174238 118.154172) (xy 166.011429 118.331029) (xy 166.011426 118.331033) (xy 165.87995 118.53227) (xy 165.783388 118.75241) (xy 165.724378 118.98544) (xy 165.704528 119.224994) (xy 112.3005 119.224994) - (xy 112.3005 115.299999) (xy 113.744722 115.299999) (xy 113.744722 115.3) (xy 113.763762 115.456818) - (xy 113.812542 115.585437) (xy 113.81978 115.604523) (xy 113.909517 115.73453) (xy 114.02776 115.839283) - (xy 114.027762 115.839284) (xy 114.167634 115.912696) (xy 114.233585 115.92895) (xy 114.286229 115.941926) - (xy 114.34661 115.977082) (xy 114.378399 116.039301) (xy 114.371504 116.108829) (xy 114.328113 116.163592) - (xy 114.286233 116.182719) (xy 114.267635 116.187303) (xy 114.267634 116.187303) (xy 114.127762 116.260715) - (xy 114.088526 116.295475) (xy 114.019181 116.356909) (xy 114.009516 116.365471) (xy 113.919781 116.495475) - (xy 113.91978 116.495476) (xy 113.863762 116.643181) (xy 113.844722 116.799999) (xy 113.844722 116.8) - (xy 113.863762 116.956818) (xy 113.898979 117.049676) (xy 113.91978 117.104523) (xy 114.009517 117.23453) - (xy 114.12776 117.339283) (xy 114.127762 117.339284) (xy 114.267634 117.412696) (xy 114.421014 117.4505) - (xy 114.421015 117.4505) (xy 114.578985 117.4505) (xy 114.732365 117.412696) (xy 114.87224 117.339283) - (xy 114.990483 117.23453) (xy 115.08022 117.104523) (xy 115.136237 116.956818) (xy 115.155278 116.8) - (xy 115.140497 116.678262) (xy 115.136237 116.643181) (xy 115.114992 116.587164) (xy 115.08022 116.495477) - (xy 114.990483 116.36547) (xy 114.87224 116.260717) (xy 114.872238 116.260716) (xy 114.872237 116.260715) - (xy 114.732366 116.187304) (xy 114.613769 116.158073) (xy 114.553389 116.122917) (xy 114.5216 116.060698) - (xy 114.528496 115.991169) (xy 114.571887 115.936406) (xy 114.613771 115.917279) (xy 114.632365 115.912696) - (xy 114.77224 115.839283) (xy 114.890483 115.73453) (xy 114.98022 115.604523) (xy 115.036237 115.456818) - (xy 115.046172 115.374999) (xy 133.044722 115.374999) (xy 133.044722 115.375) (xy 133.063762 115.531818) - (xy 133.11978 115.679523) (xy 133.157747 115.734528) (xy 133.209515 115.809528) (xy 133.209517 115.80953) - (xy 133.226979 115.825) (xy 133.305637 115.894684) (xy 133.342764 115.953874) (xy 133.341996 116.023739) - (xy 133.305637 116.080316) (xy 133.209516 116.16547) (xy 133.119781 116.295475) (xy 133.11978 116.295476) - (xy 133.063762 116.443181) (xy 133.044722 116.599999) (xy 133.044722 116.6) (xy 133.063762 116.756818) - (xy 133.101175 116.855466) (xy 133.11978 116.904523) (xy 133.209517 117.03453) (xy 133.32776 117.139283) - (xy 133.327762 117.139284) (xy 133.467634 117.212696) (xy 133.621014 117.2505) (xy 133.621015 117.2505) - (xy 133.778985 117.2505) (xy 133.932365 117.212696) (xy 133.956568 117.199993) (xy 134.07224 117.139283) - (xy 134.190483 117.03453) (xy 134.28022 116.904523) (xy 134.336237 116.756818) (xy 134.355278 116.6) - (xy 134.345289 116.517728) (xy 134.336237 116.443181) (xy 134.303518 116.356909) (xy 134.28022 116.295477) - (xy 134.190483 116.16547) (xy 134.09436 116.080314) (xy 134.057236 116.021127) (xy 134.058003 115.951261) - (xy 134.09436 115.894685) (xy 134.173027 115.824994) (xy 165.704528 115.824994) (xy 165.704528 115.825005) - (xy 165.724378 116.064559) (xy 165.783388 116.297589) (xy 165.87995 116.517729) (xy 166.009133 116.715456) - (xy 166.011428 116.718969) (xy 166.174235 116.895825) (xy 166.174238 116.895827) (xy 166.174241 116.89583) - (xy 166.363923 117.043466) (xy 166.363929 117.04347) (xy 166.363932 117.043472) (xy 166.575343 117.157882) - (xy 166.575346 117.157883) (xy 166.802698 117.235933) (xy 166.8027 117.235933) (xy 166.802702 117.235934) - (xy 167.039807 117.2755) (xy 167.039808 117.2755) (xy 167.28019 117.2755) (xy 167.280191 117.2755) - (xy 167.517296 117.235934) (xy 167.744655 117.157882) (xy 167.956066 117.043472) (xy 167.963124 117.037979) - (xy 168.019767 116.993891) (xy 168.145763 116.895825) (xy 168.30857 116.718969) (xy 168.440048 116.517728) - (xy 168.536609 116.297591) (xy 168.595619 116.064563) (xy 168.607004 115.927168) (xy 168.61547 115.825005) - (xy 168.61547 115.824994) (xy 168.602236 115.665291) (xy 168.595619 115.585437) (xy 168.536609 115.352409) - (xy 168.440048 115.132272) (xy 168.399674 115.070476) (xy 168.350674 114.995476) (xy 168.30857 114.931031) - (xy 168.145763 114.754175) (xy 168.145758 114.754171) (xy 168.145756 114.754169) (xy 167.956074 114.606533) - (xy 167.956068 114.606529) (xy 167.944597 114.600321) (xy 179.179499 114.600321) (xy 179.179499 117.049678) - (xy 179.194031 117.122735) (xy 179.194032 117.122739) (xy 179.194033 117.12274) (xy 179.249398 117.205601) - (xy 179.332259 117.260966) (xy 179.332263 117.260967) (xy 179.40532 117.275499) (xy 179.405323 117.2755) - (xy 179.405325 117.2755) (xy 181.854675 117.2755) (xy 181.854676 117.275499) (xy 181.927739 117.260966) - (xy 182.0106 117.205601) (xy 182.065965 117.12274) (xy 182.080499 117.049674) (xy 182.080499 115.699993) - (xy 257.269786 115.699993) (xy 257.269786 115.700006) (xy 257.288608 115.927168) (xy 257.28861 115.927179) - (xy 257.344569 116.148155) (xy 257.436137 116.356908) (xy 257.560814 116.547742) (xy 257.560817 116.547745) - (xy 257.680966 116.678262) (xy 257.715208 116.715458) (xy 257.715212 116.715461) (xy 257.89509 116.855466) - (xy 257.895094 116.855469) (xy 257.895096 116.85547) (xy 257.895099 116.855472) (xy 257.969669 116.895827) - (xy 258.095574 116.963963) (xy 258.207529 117.002397) (xy 258.311173 117.037979) (xy 258.311175 117.037979) - (xy 258.311177 117.03798) (xy 258.536023 117.0755) (xy 258.536024 117.0755) (xy 258.763976 117.0755) - (xy 258.763977 117.0755) (xy 258.988823 117.03798) (xy 259.204426 116.963963) (xy 259.404906 116.855469) - (xy 259.584794 116.715456) (xy 259.62422 116.672627) (xy 259.684105 116.636639) (xy 259.753943 116.638739) - (xy 259.811559 116.678262) (xy 259.838661 116.742662) (xy 259.835654 116.787052) (xy 259.78861 116.97282) - (xy 259.788608 116.972831) (xy 259.769786 117.199993) (xy 259.769786 117.200006) (xy 259.788608 117.427168) - (xy 259.78861 117.427176) (xy 259.794516 117.4505) (xy 259.835654 117.612946) (xy 259.833029 117.682767) - (xy 259.793073 117.740084) (xy 259.728472 117.766701) (xy 259.659736 117.754167) (xy 259.624219 117.727371) - (xy 259.584794 117.684544) (xy 259.584789 117.68454) (xy 259.584787 117.684538) (xy 259.404909 117.544533) - (xy 259.4049 117.544527) (xy 259.204432 117.43604) (xy 259.204429 117.436039) (xy 259.204426 117.436037) - (xy 259.20442 117.436035) (xy 259.204418 117.436034) (xy 258.988826 117.36202) (xy 258.820188 117.33388) - (xy 258.763977 117.3245) (xy 258.536023 117.3245) (xy 258.491053 117.332004) (xy 258.311173 117.36202) - (xy 258.095581 117.436034) (xy 258.095567 117.43604) (xy 257.895099 117.544527) (xy 257.89509 117.544533) - (xy 257.715212 117.684538) (xy 257.715208 117.684541) (xy 257.560814 117.852257) (xy 257.436137 118.043091) - (xy 257.344569 118.251844) (xy 257.28861 118.47282) (xy 257.288608 118.472831) (xy 257.269786 118.699993) - (xy 257.269786 118.700006) (xy 257.288608 118.927168) (xy 257.28861 118.927179) (xy 257.344569 119.148155) - (xy 257.436137 119.356908) (xy 257.560814 119.547742) (xy 257.560817 119.547745) (xy 257.680966 119.678262) - (xy 257.715208 119.715458) (xy 257.715212 119.715461) (xy 257.895094 119.855469) (xy 257.895096 119.85547) - (xy 257.895099 119.855472) (xy 258.010139 119.917728) (xy 258.095574 119.963963) (xy 258.163584 119.987311) - (xy 258.311173 120.037979) (xy 258.311175 120.037979) (xy 258.311177 120.03798) (xy 258.536023 120.0755) - (xy 258.536024 120.0755) (xy 258.763976 120.0755) (xy 258.763977 120.0755) (xy 258.988823 120.03798) - (xy 259.204426 119.963963) (xy 259.404906 119.855469) (xy 259.584794 119.715456) (xy 259.62422 119.672627) - (xy 259.684105 119.636639) (xy 259.753943 119.638739) (xy 259.811559 119.678262) (xy 259.838661 119.742662) - (xy 259.835654 119.787052) (xy 259.78861 119.97282) (xy 259.788608 119.972831) (xy 259.769786 120.199993) - (xy 259.769786 120.200006) (xy 259.788608 120.427168) (xy 259.78861 120.427176) (xy 259.832377 120.600008) - (xy 259.835654 120.612946) (xy 259.833029 120.682767) (xy 259.793073 120.740084) (xy 259.728472 120.766701) - (xy 259.659736 120.754167) (xy 259.624219 120.727371) (xy 259.584794 120.684544) (xy 259.584789 120.68454) - (xy 259.584787 120.684538) (xy 259.404909 120.544533) (xy 259.4049 120.544527) (xy 259.204432 120.43604) - (xy 259.204429 120.436039) (xy 259.204426 120.436037) (xy 259.20442 120.436035) (xy 259.204418 120.436034) - (xy 258.988826 120.36202) (xy 258.820188 120.33388) (xy 258.763977 120.3245) (xy 258.536023 120.3245) - (xy 258.491053 120.332004) (xy 258.311173 120.36202) (xy 258.095581 120.436034) (xy 258.095567 120.43604) - (xy 257.895099 120.544527) (xy 257.89509 120.544533) (xy 257.715212 120.684538) (xy 257.715208 120.684541) - (xy 257.560814 120.852257) (xy 257.436137 121.043091) (xy 257.344569 121.251844) (xy 257.28861 121.47282) - (xy 257.288608 121.472831) (xy 257.269786 121.699993) (xy 257.269786 121.700006) (xy 257.288608 121.927168) - (xy 257.28861 121.927179) (xy 257.344569 122.148155) (xy 257.436137 122.356908) (xy 257.560814 122.547742) - (xy 257.560817 122.547745) (xy 257.680966 122.678262) (xy 257.715208 122.715458) (xy 257.715212 122.715461) - (xy 257.839636 122.812304) (xy 257.895094 122.855469) (xy 257.895096 122.85547) (xy 257.895099 122.855472) - (xy 258.011646 122.918543) (xy 258.095574 122.963963) (xy 258.172786 122.99047) (xy 258.311173 123.037979) - (xy 258.311175 123.037979) (xy 258.311177 123.03798) (xy 258.536023 123.0755) (xy 258.536024 123.0755) - (xy 258.763976 123.0755) (xy 258.763977 123.0755) (xy 258.988823 123.03798) (xy 259.204426 122.963963) - (xy 259.404906 122.855469) (xy 259.584794 122.715456) (xy 259.62422 122.672627) (xy 259.684105 122.636639) - (xy 259.753943 122.638739) (xy 259.811559 122.678262) (xy 259.838661 122.742662) (xy 259.835654 122.787052) - (xy 259.78861 122.97282) (xy 259.788608 122.972831) (xy 259.769786 123.199993) (xy 259.769786 123.200006) - (xy 259.788608 123.427168) (xy 259.78861 123.427176) (xy 259.808087 123.50409) (xy 259.835654 123.612946) - (xy 259.833029 123.682767) (xy 259.793073 123.740084) (xy 259.728472 123.766701) (xy 259.659736 123.754167) - (xy 259.624219 123.727371) (xy 259.584794 123.684544) (xy 259.584789 123.68454) (xy 259.584787 123.684538) - (xy 259.404909 123.544533) (xy 259.4049 123.544527) (xy 259.204432 123.43604) (xy 259.204429 123.436039) - (xy 259.204426 123.436037) (xy 259.20442 123.436035) (xy 259.204418 123.436034) (xy 258.988826 123.36202) - (xy 258.820188 123.33388) (xy 258.763977 123.3245) (xy 258.536023 123.3245) (xy 258.491053 123.332004) - (xy 258.311173 123.36202) (xy 258.095581 123.436034) (xy 258.095567 123.43604) (xy 257.895099 123.544527) - (xy 257.89509 123.544533) (xy 257.715212 123.684538) (xy 257.715208 123.684541) (xy 257.560814 123.852257) - (xy 257.436137 124.043091) (xy 257.344569 124.251844) (xy 257.28861 124.47282) (xy 257.288608 124.472831) - (xy 257.269786 124.699993) (xy 257.269786 124.700006) (xy 257.288608 124.927168) (xy 257.28861 124.927179) - (xy 257.344569 125.148155) (xy 257.436137 125.356908) (xy 257.560814 125.547742) (xy 257.560817 125.547745) - (xy 257.680966 125.678262) (xy 257.715208 125.715458) (xy 257.715212 125.715461) (xy 257.89509 125.855466) - (xy 257.895094 125.855469) (xy 257.895096 125.85547) (xy 257.895099 125.855472) (xy 257.904791 125.860717) - (xy 258.095574 125.963963) (xy 258.207529 126.002397) (xy 258.311173 126.037979) (xy 258.311175 126.037979) - (xy 258.311177 126.03798) (xy 258.536023 126.0755) (xy 258.536024 126.0755) (xy 258.763976 126.0755) - (xy 258.763977 126.0755) (xy 258.988823 126.03798) (xy 259.204426 125.963963) (xy 259.404906 125.855469) - (xy 259.584794 125.715456) (xy 259.62422 125.672627) (xy 259.684105 125.636639) (xy 259.753943 125.638739) - (xy 259.811559 125.678262) (xy 259.838661 125.742662) (xy 259.835654 125.787052) (xy 259.78861 125.97282) - (xy 259.788608 125.972831) (xy 259.769786 126.199993) (xy 259.769786 126.200006) (xy 259.788608 126.427168) - (xy 259.78861 126.427176) (xy 259.831229 126.595475) (xy 259.835654 126.612946) (xy 259.833029 126.682767) - (xy 259.793073 126.740084) (xy 259.728472 126.766701) (xy 259.659736 126.754167) (xy 259.624219 126.727371) - (xy 259.617818 126.720418) (xy 259.584794 126.684544) (xy 259.584789 126.68454) (xy 259.584787 126.684538) - (xy 259.404909 126.544533) (xy 259.4049 126.544527) (xy 259.204432 126.43604) (xy 259.204429 126.436039) - (xy 259.204426 126.436037) (xy 259.20442 126.436035) (xy 259.204418 126.436034) (xy 258.988826 126.36202) - (xy 258.820188 126.33388) (xy 258.763977 126.3245) (xy 258.536023 126.3245) (xy 258.491053 126.332004) - (xy 258.311173 126.36202) (xy 258.095581 126.436034) (xy 258.095567 126.43604) (xy 257.895099 126.544527) - (xy 257.89509 126.544533) (xy 257.715212 126.684538) (xy 257.715208 126.684541) (xy 257.560814 126.852257) - (xy 257.436137 127.043091) (xy 257.344569 127.251844) (xy 257.28861 127.47282) (xy 257.288608 127.472831) - (xy 257.269786 127.699993) (xy 257.269786 127.700006) (xy 257.288608 127.927168) (xy 257.28861 127.927179) - (xy 257.344569 128.148155) (xy 257.436137 128.356908) (xy 257.560814 128.547742) (xy 257.604757 128.595477) - (xy 257.680966 128.678262) (xy 257.715208 128.715458) (xy 257.715212 128.715461) (xy 257.773357 128.760717) - (xy 257.895094 128.855469) (xy 257.895096 128.85547) (xy 257.895099 128.855472) (xy 257.977378 128.899999) - (xy 258.095574 128.963963) (xy 258.156075 128.984733) (xy 258.311173 129.037979) (xy 258.311175 129.037979) - (xy 258.311177 129.03798) (xy 258.536023 129.0755) (xy 258.536024 129.0755) (xy 258.763976 129.0755) - (xy 258.763977 129.0755) (xy 258.988823 129.03798) (xy 259.204426 128.963963) (xy 259.404906 128.855469) - (xy 259.584794 128.715456) (xy 259.62422 128.672627) (xy 259.684105 128.636639) (xy 259.753943 128.638739) - (xy 259.811559 128.678262) (xy 259.838661 128.742662) (xy 259.835654 128.787052) (xy 259.78861 128.97282) - (xy 259.788608 128.972831) (xy 259.769786 129.199993) (xy 259.769786 129.200006) (xy 259.788608 129.427168) - (xy 259.78861 129.427176) (xy 259.833831 129.60575) (xy 259.835654 129.612946) (xy 259.833029 129.682767) - (xy 259.793073 129.740084) (xy 259.728472 129.766701) (xy 259.659736 129.754167) (xy 259.624219 129.727371) - (xy 259.614504 129.716818) (xy 259.584794 129.684544) (xy 259.584789 129.68454) (xy 259.584787 129.684538) - (xy 259.404909 129.544533) (xy 259.4049 129.544527) (xy 259.204432 129.43604) (xy 259.204429 129.436039) - (xy 259.204426 129.436037) (xy 259.20442 129.436035) (xy 259.204418 129.436034) (xy 258.988826 129.36202) - (xy 258.820188 129.33388) (xy 258.763977 129.3245) (xy 258.536023 129.3245) (xy 258.491053 129.332004) - (xy 258.311173 129.36202) (xy 258.095581 129.436034) (xy 258.095567 129.43604) (xy 257.895099 129.544527) - (xy 257.89509 129.544533) (xy 257.715212 129.684538) (xy 257.715208 129.684541) (xy 257.560814 129.852257) - (xy 257.436137 130.043091) (xy 257.344569 130.251844) (xy 257.28861 130.47282) (xy 257.288608 130.472831) - (xy 257.269786 130.699993) (xy 257.269786 130.700006) (xy 257.288608 130.927168) (xy 257.28861 130.927179) - (xy 257.344569 131.148155) (xy 257.436137 131.356908) (xy 257.560814 131.547742) (xy 257.604757 131.595477) - (xy 257.705142 131.704524) (xy 257.715208 131.715458) (xy 257.715212 131.715461) (xy 257.870638 131.836434) - (xy 257.895094 131.855469) (xy 257.895096 131.85547) (xy 257.895099 131.855472) (xy 257.930589 131.874678) - (xy 258.095574 131.963963) (xy 258.207529 132.002397) (xy 258.311173 132.037979) (xy 258.311175 132.037979) - (xy 258.311177 132.03798) (xy 258.536023 132.0755) (xy 258.536024 132.0755) (xy 258.763976 132.0755) - (xy 258.763977 132.0755) (xy 258.988823 132.03798) (xy 259.204426 131.963963) (xy 259.404906 131.855469) - (xy 259.584794 131.715456) (xy 259.62422 131.672627) (xy 259.684105 131.636639) (xy 259.753943 131.638739) - (xy 259.811559 131.678262) (xy 259.838661 131.742662) (xy 259.835654 131.787052) (xy 259.78861 131.97282) - (xy 259.788608 131.972831) (xy 259.769786 132.199993) (xy 259.769786 132.200006) (xy 259.788608 132.427168) - (xy 259.78861 132.427176) (xy 259.822427 132.560717) (xy 259.835654 132.612946) (xy 259.833029 132.682767) - (xy 259.793073 132.740084) (xy 259.728472 132.766701) (xy 259.659736 132.754167) (xy 259.624219 132.727371) - (xy 259.61903 132.721734) (xy 259.584794 132.684544) (xy 259.584789 132.68454) (xy 259.584787 132.684538) - (xy 259.404909 132.544533) (xy 259.4049 132.544527) (xy 259.204432 132.43604) (xy 259.204429 132.436039) - (xy 259.204426 132.436037) (xy 259.20442 132.436035) (xy 259.204418 132.436034) (xy 258.988826 132.36202) - (xy 258.820188 132.33388) (xy 258.763977 132.3245) (xy 258.536023 132.3245) (xy 258.491053 132.332004) - (xy 258.311173 132.36202) (xy 258.095581 132.436034) (xy 258.095567 132.43604) (xy 257.895099 132.544527) - (xy 257.89509 132.544533) (xy 257.715212 132.684538) (xy 257.715208 132.684541) (xy 257.560814 132.852257) - (xy 257.436137 133.043091) (xy 257.344569 133.251844) (xy 257.28861 133.47282) (xy 257.288608 133.472831) - (xy 257.269786 133.699993) (xy 257.269786 133.700006) (xy 257.288608 133.927168) (xy 257.28861 133.927179) - (xy 257.344569 134.148155) (xy 257.436137 134.356908) (xy 257.560814 134.547742) (xy 257.715208 134.715458) - (xy 257.715212 134.715461) (xy 257.779465 134.765471) (xy 257.895094 134.855469) (xy 257.895096 134.85547) - (xy 257.895099 134.855472) (xy 258.011646 134.918543) (xy 258.095574 134.963963) (xy 258.207529 135.002397) - (xy 258.311173 135.037979) (xy 258.311175 135.037979) (xy 258.311177 135.03798) (xy 258.536023 135.0755) - (xy 258.536024 135.0755) (xy 258.763976 135.0755) (xy 258.763977 135.0755) (xy 258.988823 135.03798) - (xy 259.204426 134.963963) (xy 259.404906 134.855469) (xy 259.584794 134.715456) (xy 259.739183 134.547745) - (xy 259.863862 134.356909) (xy 259.95543 134.148155) (xy 260.01139 133.927176) (xy 260.011391 133.927168) - (xy 260.030214 133.700006) (xy 260.030214 133.699993) (xy 260.011391 133.472831) (xy 260.011387 133.472811) - (xy 259.964346 133.287053) (xy 259.96697 133.217233) (xy 260.006926 133.159915) (xy 260.071527 133.133298) - (xy 260.140263 133.145832) (xy 260.17578 133.172628) (xy 260.215206 133.215456) (xy 260.215209 133.215458) - (xy 260.215212 133.215461) (xy 260.389689 133.351262) (xy 260.395094 133.355469) (xy 260.395096 133.35547) - (xy 260.395099 133.355472) (xy 260.477378 133.399999) (xy 260.595574 133.463963) (xy 260.661781 133.486692) - (xy 260.811173 133.537979) (xy 260.811175 133.537979) (xy 260.811177 133.53798) (xy 261.036023 133.5755) - (xy 261.036024 133.5755) (xy 261.263976 133.5755) (xy 261.263977 133.5755) (xy 261.488823 133.53798) - (xy 261.704426 133.463963) (xy 261.904906 133.355469) (xy 262.084794 133.215456) (xy 262.239183 133.047745) - (xy 262.363862 132.856909) (xy 262.45543 132.648155) (xy 262.51139 132.427176) (xy 262.519898 132.3245) - (xy 262.526424 132.245745) (xy 262.543679 132.201026) (xy 262.755527 132.201026) (xy 262.771456 132.230994) - (xy 262.773576 132.245745) (xy 262.788608 132.427168) (xy 262.78861 132.427179) (xy 262.844569 132.648155) - (xy 262.936137 132.856908) (xy 263.060814 133.047742) (xy 263.12411 133.1165) (xy 263.1947 133.193181) - (xy 263.215208 133.215458) (xy 263.215212 133.215461) (xy 263.389689 133.351262) (xy 263.395094 133.355469) - (xy 263.395096 133.35547) (xy 263.395099 133.355472) (xy 263.477378 133.399999) (xy 263.595574 133.463963) - (xy 263.661781 133.486692) (xy 263.811173 133.537979) (xy 263.811175 133.537979) (xy 263.811177 133.53798) - (xy 264.036023 133.5755) (xy 264.036024 133.5755) (xy 264.263976 133.5755) (xy 264.263977 133.5755) - (xy 264.488823 133.53798) (xy 264.704426 133.463963) (xy 264.904906 133.355469) (xy 265.084794 133.215456) - (xy 265.12422 133.172627) (xy 265.184105 133.136639) (xy 265.253943 133.138739) (xy 265.311559 133.178262) - (xy 265.338661 133.242662) (xy 265.335654 133.287052) (xy 265.28861 133.47282) (xy 265.288608 133.472831) - (xy 265.269786 133.699993) (xy 265.269786 133.700006) (xy 265.288608 133.927168) (xy 265.28861 133.927179) - (xy 265.344569 134.148155) (xy 265.436137 134.356908) (xy 265.560814 134.547742) (xy 265.715208 134.715458) - (xy 265.715212 134.715461) (xy 265.779465 134.765471) (xy 265.895094 134.855469) (xy 265.895096 134.85547) - (xy 265.895099 134.855472) (xy 266.011646 134.918543) (xy 266.095574 134.963963) (xy 266.207529 135.002397) - (xy 266.311173 135.037979) (xy 266.311175 135.037979) (xy 266.311177 135.03798) (xy 266.536023 135.0755) - (xy 266.536024 135.0755) (xy 266.763976 135.0755) (xy 266.763977 135.0755) (xy 266.988823 135.03798) - (xy 267.204426 134.963963) (xy 267.404906 134.855469) (xy 267.584794 134.715456) (xy 267.739183 134.547745) - (xy 267.863862 134.356909) (xy 267.95543 134.148155) (xy 268.01139 133.927176) (xy 268.011391 133.927168) - (xy 268.030214 133.700006) (xy 268.030214 133.699993) (xy 268.011391 133.472831) (xy 268.011389 133.47282) - (xy 267.95543 133.251844) (xy 267.863862 133.043091) (xy 267.739185 132.852257) (xy 267.651322 132.756813) - (xy 267.584794 132.684544) (xy 267.584793 132.684543) (xy 267.584791 132.684541) (xy 267.584787 132.684538) - (xy 267.404909 132.544533) (xy 267.4049 132.544527) (xy 267.204432 132.43604) (xy 267.204429 132.436039) - (xy 267.204426 132.436037) (xy 267.20442 132.436035) (xy 267.204418 132.436034) (xy 266.988826 132.36202) - (xy 266.820188 132.33388) (xy 266.763977 132.3245) (xy 266.536023 132.3245) (xy 266.491053 132.332004) - (xy 266.311173 132.36202) (xy 266.095581 132.436034) (xy 266.095567 132.43604) (xy 265.895099 132.544527) - (xy 265.89509 132.544533) (xy 265.715212 132.684538) (xy 265.715207 132.684543) (xy 265.675779 132.727372) - (xy 265.615892 132.763361) (xy 265.546053 132.76126) (xy 265.488438 132.721734) (xy 265.461338 132.657334) - (xy 265.464346 132.612946) (xy 265.477573 132.560717) (xy 265.51139 132.427176) (xy 265.519898 132.3245) - (xy 265.530214 132.200006) (xy 265.530214 132.199993) (xy 265.511391 131.972831) (xy 265.511387 131.972811) - (xy 265.464346 131.787053) (xy 265.46697 131.717233) (xy 265.506926 131.659915) (xy 265.571527 131.633298) - (xy 265.640263 131.645832) (xy 265.67578 131.672628) (xy 265.715206 131.715456) (xy 265.715209 131.715458) - (xy 265.715212 131.715461) (xy 265.870638 131.836434) (xy 265.895094 131.855469) (xy 265.895096 131.85547) - (xy 265.895099 131.855472) (xy 265.930589 131.874678) (xy 266.095574 131.963963) (xy 266.207529 132.002397) - (xy 266.311173 132.037979) (xy 266.311175 132.037979) (xy 266.311177 132.03798) (xy 266.536023 132.0755) - (xy 266.536024 132.0755) (xy 266.763976 132.0755) (xy 266.763977 132.0755) (xy 266.988823 132.03798) - (xy 267.204426 131.963963) (xy 267.404906 131.855469) (xy 267.584794 131.715456) (xy 267.739183 131.547745) - (xy 267.863862 131.356909) (xy 267.95543 131.148155) (xy 268.01139 130.927176) (xy 268.026106 130.749579) - (xy 268.030214 130.700006) (xy 268.030214 130.699993) (xy 268.011391 130.472831) (xy 268.011389 130.47282) - (xy 267.95543 130.251844) (xy 267.863862 130.043091) (xy 267.739185 129.852257) (xy 267.660425 129.766701) - (xy 267.584794 129.684544) (xy 267.584793 129.684543) (xy 267.584791 129.684541) (xy 267.584787 129.684538) - (xy 267.404909 129.544533) (xy 267.4049 129.544527) (xy 267.204432 129.43604) (xy 267.204429 129.436039) - (xy 267.204426 129.436037) (xy 267.20442 129.436035) (xy 267.204418 129.436034) (xy 266.988826 129.36202) - (xy 266.820188 129.33388) (xy 266.763977 129.3245) (xy 266.536023 129.3245) (xy 266.491053 129.332004) - (xy 266.311173 129.36202) (xy 266.095581 129.436034) (xy 266.095567 129.43604) (xy 265.895099 129.544527) - (xy 265.89509 129.544533) (xy 265.715212 129.684538) (xy 265.715208 129.684541) (xy 265.560814 129.852257) - (xy 265.436137 130.043091) (xy 265.344569 130.251844) (xy 265.28861 130.47282) (xy 265.288608 130.472831) - (xy 265.269786 130.699993) (xy 265.269786 130.700006) (xy 265.288608 130.927168) (xy 265.28861 130.927176) - (xy 265.33323 131.103376) (xy 265.335654 131.112946) (xy 265.333029 131.182767) (xy 265.293073 131.240084) - (xy 265.228472 131.266701) (xy 265.159736 131.254167) (xy 265.124219 131.227371) (xy 265.108627 131.210434) - (xy 265.084794 131.184544) (xy 265.084789 131.18454) (xy 265.084787 131.184538) (xy 264.904909 131.044533) - (xy 264.9049 131.044527) (xy 264.704432 130.93604) (xy 264.704429 130.936039) (xy 264.704426 130.936037) - (xy 264.70442 130.936035) (xy 264.704418 130.936034) (xy 264.488826 130.86202) (xy 264.320188 130.83388) - (xy 264.263977 130.8245) (xy 264.036023 130.8245) (xy 263.991053 130.832004) (xy 263.811173 130.86202) - (xy 263.595581 130.936034) (xy 263.595567 130.93604) (xy 263.395099 131.044527) (xy 263.39509 131.044533) - (xy 263.215212 131.184538) (xy 263.215208 131.184541) (xy 263.060814 131.352257) (xy 262.936137 131.543091) - (xy 262.844569 131.751844) (xy 262.78861 131.97282) (xy 262.788608 131.972831) (xy 262.773576 132.154254) - (xy 262.755527 132.201026) (xy 262.543679 132.201026) (xy 262.544472 132.198972) (xy 262.528544 132.169005) - (xy 262.526424 132.154254) (xy 262.511391 131.972831) (xy 262.511389 131.97282) (xy 262.45543 131.751844) - (xy 262.363862 131.543091) (xy 262.239185 131.352257) (xy 262.155416 131.26126) (xy 262.084794 131.184544) - (xy 262.084793 131.184543) (xy 262.084791 131.184541) (xy 262.084787 131.184538) (xy 261.904909 131.044533) - (xy 261.9049 131.044527) (xy 261.704432 130.93604) (xy 261.704429 130.936039) (xy 261.704426 130.936037) - (xy 261.70442 130.936035) (xy 261.704418 130.936034) (xy 261.488826 130.86202) (xy 261.320188 130.83388) - (xy 261.263977 130.8245) (xy 261.036023 130.8245) (xy 260.991053 130.832004) (xy 260.811173 130.86202) - (xy 260.595581 130.936034) (xy 260.595567 130.93604) (xy 260.395099 131.044527) (xy 260.39509 131.044533) - (xy 260.215212 131.184538) (xy 260.215207 131.184543) (xy 260.175779 131.227372) (xy 260.115892 131.263361) - (xy 260.046053 131.26126) (xy 259.988438 131.221734) (xy 259.961338 131.157334) (xy 259.964346 131.112946) - (xy 259.96677 131.103376) (xy 260.01139 130.927176) (xy 260.026106 130.749579) (xy 260.030214 130.700006) - (xy 260.030214 130.699993) (xy 260.011391 130.472831) (xy 260.011387 130.472811) (xy 259.964346 130.287053) - (xy 259.96697 130.217233) (xy 260.006926 130.159915) (xy 260.071527 130.133298) (xy 260.140263 130.145832) - (xy 260.17578 130.172628) (xy 260.215206 130.215456) (xy 260.215209 130.215458) (xy 260.215212 130.215461) - (xy 260.38654 130.348811) (xy 260.395094 130.355469) (xy 260.395096 130.35547) (xy 260.395099 130.355472) - (xy 260.485228 130.404247) (xy 260.595574 130.463963) (xy 260.663561 130.487303) (xy 260.811173 130.537979) - (xy 260.811175 130.537979) (xy 260.811177 130.53798) (xy 261.036023 130.5755) (xy 261.036024 130.5755) - (xy 261.263976 130.5755) (xy 261.263977 130.5755) (xy 261.488823 130.53798) (xy 261.704426 130.463963) - (xy 261.904906 130.355469) (xy 262.084794 130.215456) (xy 262.239183 130.047745) (xy 262.363862 129.856909) - (xy 262.45543 129.648155) (xy 262.51139 129.427176) (xy 262.511391 129.427168) (xy 262.530214 129.200006) - (xy 262.530214 129.199993) (xy 262.511391 128.972831) (xy 262.511389 128.97282) (xy 262.45543 128.751844) - (xy 262.363862 128.543091) (xy 262.239185 128.352257) (xy 262.113082 128.215273) (xy 262.084794 128.184544) - (xy 262.084793 128.184543) (xy 262.084791 128.184541) (xy 262.084787 128.184538) (xy 261.904909 128.044533) - (xy 261.9049 128.044527) (xy 261.704432 127.93604) (xy 261.704429 127.936039) (xy 261.704426 127.936037) - (xy 261.70442 127.936035) (xy 261.704418 127.936034) (xy 261.488826 127.86202) (xy 261.320188 127.83388) - (xy 261.263977 127.8245) (xy 261.036023 127.8245) (xy 260.991053 127.832004) (xy 260.811173 127.86202) - (xy 260.595581 127.936034) (xy 260.595567 127.93604) (xy 260.395099 128.044527) (xy 260.39509 128.044533) - (xy 260.215212 128.184538) (xy 260.215207 128.184543) (xy 260.175779 128.227372) (xy 260.115892 128.263361) - (xy 260.046053 128.26126) (xy 259.988438 128.221734) (xy 259.961338 128.157334) (xy 259.964346 128.112946) - (xy 259.982449 128.041462) (xy 260.01139 127.927176) (xy 260.011391 127.927168) (xy 260.030214 127.700006) - (xy 260.030214 127.699993) (xy 260.011391 127.472831) (xy 260.011387 127.472811) (xy 259.964346 127.287053) - (xy 259.96697 127.217233) (xy 260.006926 127.159915) (xy 260.071527 127.133298) (xy 260.140263 127.145832) - (xy 260.17578 127.172628) (xy 260.215206 127.215456) (xy 260.215209 127.215458) (xy 260.215212 127.215461) - (xy 260.39509 127.355466) (xy 260.395094 127.355469) (xy 260.395096 127.35547) (xy 260.395099 127.355472) - (xy 260.511646 127.418543) (xy 260.595574 127.463963) (xy 260.707529 127.502397) (xy 260.811173 127.537979) - (xy 260.811175 127.537979) (xy 260.811177 127.53798) (xy 261.036023 127.5755) (xy 261.036024 127.5755) - (xy 261.263976 127.5755) (xy 261.263977 127.5755) (xy 261.488823 127.53798) (xy 261.704426 127.463963) - (xy 261.904906 127.355469) (xy 262.084794 127.215456) (xy 262.239183 127.047745) (xy 262.363862 126.856909) - (xy 262.45543 126.648155) (xy 262.51139 126.427176) (xy 262.513642 126.399999) (xy 262.526424 126.245745) - (xy 262.543679 126.201026) (xy 262.755527 126.201026) (xy 262.771456 126.230994) (xy 262.773576 126.245745) - (xy 262.788608 126.427168) (xy 262.78861 126.427179) (xy 262.844569 126.648155) (xy 262.936137 126.856908) - (xy 263.060814 127.047742) (xy 263.097233 127.087303) (xy 263.205142 127.204524) (xy 263.215208 127.215458) - (xy 263.215212 127.215461) (xy 263.39509 127.355466) (xy 263.395094 127.355469) (xy 263.395096 127.35547) - (xy 263.395099 127.355472) (xy 263.511646 127.418543) (xy 263.595574 127.463963) (xy 263.707529 127.502397) - (xy 263.811173 127.537979) (xy 263.811175 127.537979) (xy 263.811177 127.53798) (xy 264.036023 127.5755) - (xy 264.036024 127.5755) (xy 264.263976 127.5755) (xy 264.263977 127.5755) (xy 264.488823 127.53798) - (xy 264.704426 127.463963) (xy 264.904906 127.355469) (xy 265.084794 127.215456) (xy 265.12422 127.172627) - (xy 265.184105 127.136639) (xy 265.253943 127.138739) (xy 265.311559 127.178262) (xy 265.338661 127.242662) - (xy 265.335654 127.287052) (xy 265.28861 127.47282) (xy 265.288608 127.472831) (xy 265.269786 127.699993) - (xy 265.269786 127.700006) (xy 265.288608 127.927168) (xy 265.28861 127.927179) (xy 265.344569 128.148155) - (xy 265.436137 128.356908) (xy 265.560814 128.547742) (xy 265.604757 128.595477) (xy 265.680966 128.678262) - (xy 265.715208 128.715458) (xy 265.715212 128.715461) (xy 265.773357 128.760717) (xy 265.895094 128.855469) - (xy 265.895096 128.85547) (xy 265.895099 128.855472) (xy 265.977378 128.899999) (xy 266.095574 128.963963) - (xy 266.156075 128.984733) (xy 266.311173 129.037979) (xy 266.311175 129.037979) (xy 266.311177 129.03798) - (xy 266.536023 129.0755) (xy 266.536024 129.0755) (xy 266.763976 129.0755) (xy 266.763977 129.0755) - (xy 266.988823 129.03798) (xy 267.204426 128.963963) (xy 267.404906 128.855469) (xy 267.584794 128.715456) - (xy 267.739183 128.547745) (xy 267.863862 128.356909) (xy 267.95543 128.148155) (xy 268.01139 127.927176) - (xy 268.011391 127.927168) (xy 268.030214 127.700006) (xy 268.030214 127.699993) (xy 268.011391 127.472831) - (xy 268.011389 127.47282) (xy 267.95543 127.251844) (xy 267.863862 127.043091) (xy 267.739185 126.852257) - (xy 267.655416 126.76126) (xy 267.584794 126.684544) (xy 267.584793 126.684543) (xy 267.584791 126.684541) - (xy 267.584787 126.684538) (xy 267.404909 126.544533) (xy 267.4049 126.544527) (xy 267.204432 126.43604) - (xy 267.204429 126.436039) (xy 267.204426 126.436037) (xy 267.20442 126.436035) (xy 267.204418 126.436034) - (xy 266.988826 126.36202) (xy 266.820188 126.33388) (xy 266.763977 126.3245) (xy 266.536023 126.3245) - (xy 266.491053 126.332004) (xy 266.311173 126.36202) (xy 266.095581 126.436034) (xy 266.095567 126.43604) - (xy 265.895099 126.544527) (xy 265.89509 126.544533) (xy 265.715212 126.684538) (xy 265.715207 126.684543) - (xy 265.675779 126.727372) (xy 265.615892 126.763361) (xy 265.546053 126.76126) (xy 265.488438 126.721734) - (xy 265.461338 126.657334) (xy 265.464346 126.612946) (xy 265.468771 126.595475) (xy 265.51139 126.427176) - (xy 265.513642 126.399999) (xy 265.530214 126.200006) (xy 265.530214 126.199993) (xy 265.511391 125.972831) - (xy 265.511387 125.972811) (xy 265.464346 125.787053) (xy 265.46697 125.717233) (xy 265.506926 125.659915) - (xy 265.571527 125.633298) (xy 265.640263 125.645832) (xy 265.67578 125.672628) (xy 265.715206 125.715456) - (xy 265.715209 125.715458) (xy 265.715212 125.715461) (xy 265.89509 125.855466) (xy 265.895094 125.855469) - (xy 265.895096 125.85547) (xy 265.895099 125.855472) (xy 265.904791 125.860717) (xy 266.095574 125.963963) - (xy 266.207529 126.002397) (xy 266.311173 126.037979) (xy 266.311175 126.037979) (xy 266.311177 126.03798) - (xy 266.536023 126.0755) (xy 266.536024 126.0755) (xy 266.763976 126.0755) (xy 266.763977 126.0755) - (xy 266.988823 126.03798) (xy 267.204426 125.963963) (xy 267.404906 125.855469) (xy 267.476174 125.799999) - (xy 268.044722 125.799999) (xy 268.044722 125.8) (xy 268.063762 125.956818) (xy 268.116349 126.095476) - (xy 268.11978 126.104523) (xy 268.209517 126.23453) (xy 268.32776 126.339283) (xy 268.327762 126.339284) - (xy 268.467634 126.412696) (xy 268.621014 126.4505) (xy 268.621015 126.4505) (xy 268.778985 126.4505) - (xy 268.932365 126.412696) (xy 268.956557 126.399999) (xy 269.07224 126.339283) (xy 269.190483 126.23453) - (xy 269.28022 126.104523) (xy 269.336237 125.956818) (xy 269.355278 125.8) (xy 269.353737 125.787304) - (xy 269.336237 125.643181) (xy 269.301087 125.5505) (xy 269.28022 125.495477) (xy 269.190483 125.36547) - (xy 269.07224 125.260717) (xy 269.072238 125.260716) (xy 269.072237 125.260715) (xy 268.932365 125.187303) - (xy 268.778986 125.1495) (xy 268.778985 125.1495) (xy 268.621015 125.1495) (xy 268.621014 125.1495) - (xy 268.467634 125.187303) (xy 268.327762 125.260715) (xy 268.31862 125.268814) (xy 268.219181 125.356909) - (xy 268.209516 125.365471) (xy 268.119781 125.495475) (xy 268.11978 125.495476) (xy 268.063762 125.643181) - (xy 268.044722 125.799999) (xy 267.476174 125.799999) (xy 267.584794 125.715456) (xy 267.739183 125.547745) - (xy 267.863862 125.356909) (xy 267.95543 125.148155) (xy 268.01139 124.927176) (xy 268.013763 124.898538) - (xy 268.030214 124.700006) (xy 268.030214 124.699993) (xy 268.011391 124.472831) (xy 268.011389 124.47282) - (xy 267.95543 124.251844) (xy 267.863862 124.043091) (xy 267.739185 123.852257) (xy 267.691078 123.799999) - (xy 269.644718 123.799999) (xy 269.644718 123.8) (xy 269.663758 123.956818) (xy 269.698243 124.047745) - (xy 269.719776 124.104523) (xy 269.809513 124.23453) (xy 269.927756 124.339283) (xy 269.927758 124.339284) - (xy 270.06763 124.412696) (xy 270.22101 124.4505) (xy 270.221011 124.4505) (xy 270.378981 124.4505) - (xy 270.532361 124.412696) (xy 270.631397 124.360717) (xy 270.672236 124.339283) (xy 270.790479 124.23453) - (xy 270.880216 124.104523) (xy 270.936233 123.956818) (xy 270.955274 123.8) (xy 270.941255 123.684538) - (xy 270.936233 123.643181) (xy 270.89882 123.544533) (xy 270.880216 123.495477) (xy 270.790479 123.36547) - (xy 270.672236 123.260717) (xy 270.672234 123.260716) (xy 270.672233 123.260715) (xy 270.532361 123.187303) - (xy 270.378982 123.1495) (xy 270.378981 123.1495) (xy 270.221011 123.1495) (xy 270.22101 123.1495) - (xy 270.06763 123.187303) (xy 269.927758 123.260715) (xy 269.855759 123.3245) (xy 269.820316 123.3559) - (xy 269.809512 123.365471) (xy 269.719777 123.495475) (xy 269.719776 123.495476) (xy 269.663758 123.643181) - (xy 269.644718 123.799999) (xy 267.691078 123.799999) (xy 267.660425 123.766701) (xy 267.584794 123.684544) - (xy 267.584793 123.684543) (xy 267.584791 123.684541) (xy 267.584787 123.684538) (xy 267.404909 123.544533) - (xy 267.4049 123.544527) (xy 267.204432 123.43604) (xy 267.204429 123.436039) (xy 267.204426 123.436037) - (xy 267.20442 123.436035) (xy 267.204418 123.436034) (xy 266.988826 123.36202) (xy 266.820188 123.33388) - (xy 266.763977 123.3245) (xy 266.536023 123.3245) (xy 266.491053 123.332004) (xy 266.311173 123.36202) - (xy 266.095581 123.436034) (xy 266.095567 123.43604) (xy 265.895099 123.544527) (xy 265.89509 123.544533) - (xy 265.715212 123.684538) (xy 265.715208 123.684541) (xy 265.560814 123.852257) (xy 265.436137 124.043091) - (xy 265.344569 124.251844) (xy 265.28861 124.47282) (xy 265.288608 124.472831) (xy 265.269786 124.699993) - (xy 265.269786 124.700006) (xy 265.288608 124.927168) (xy 265.28861 124.927176) (xy 265.335654 125.112946) - (xy 265.333029 125.182767) (xy 265.293073 125.240084) (xy 265.228472 125.266701) (xy 265.159736 125.254167) - (xy 265.124219 125.227371) (xy 265.11903 125.221734) (xy 265.084794 125.184544) (xy 265.084789 125.18454) - (xy 265.084787 125.184538) (xy 264.904909 125.044533) (xy 264.9049 125.044527) (xy 264.704432 124.93604) - (xy 264.704429 124.936039) (xy 264.704426 124.936037) (xy 264.70442 124.936035) (xy 264.704418 124.936034) - (xy 264.488826 124.86202) (xy 264.320188 124.83388) (xy 264.263977 124.8245) (xy 264.036023 124.8245) - (xy 263.991053 124.832004) (xy 263.811173 124.86202) (xy 263.595581 124.936034) (xy 263.595567 124.93604) - (xy 263.395099 125.044527) (xy 263.39509 125.044533) (xy 263.215212 125.184538) (xy 263.215208 125.184541) - (xy 263.060814 125.352257) (xy 262.936137 125.543091) (xy 262.844569 125.751844) (xy 262.78861 125.97282) - (xy 262.788608 125.972831) (xy 262.773576 126.154254) (xy 262.755527 126.201026) (xy 262.543679 126.201026) - (xy 262.544472 126.198972) (xy 262.528544 126.169005) (xy 262.526424 126.154254) (xy 262.511391 125.972831) - (xy 262.511389 125.97282) (xy 262.45543 125.751844) (xy 262.363862 125.543091) (xy 262.239185 125.352257) - (xy 262.154914 125.260715) (xy 262.084794 125.184544) (xy 262.084793 125.184543) (xy 262.084791 125.184541) - (xy 262.084787 125.184538) (xy 261.904909 125.044533) (xy 261.9049 125.044527) (xy 261.704432 124.93604) - (xy 261.704429 124.936039) (xy 261.704426 124.936037) (xy 261.70442 124.936035) (xy 261.704418 124.936034) - (xy 261.488826 124.86202) (xy 261.320188 124.83388) (xy 261.263977 124.8245) (xy 261.036023 124.8245) - (xy 260.991053 124.832004) (xy 260.811173 124.86202) (xy 260.595581 124.936034) (xy 260.595567 124.93604) - (xy 260.395099 125.044527) (xy 260.39509 125.044533) (xy 260.215212 125.184538) (xy 260.215207 125.184543) - (xy 260.175779 125.227372) (xy 260.115892 125.263361) (xy 260.046053 125.26126) (xy 259.988438 125.221734) - (xy 259.961338 125.157334) (xy 259.964346 125.112946) (xy 260.011387 124.927188) (xy 260.011389 124.927179) - (xy 260.01139 124.927176) (xy 260.013763 124.898538) (xy 260.030214 124.700006) (xy 260.030214 124.699993) - (xy 260.011391 124.472831) (xy 260.011387 124.472811) (xy 259.964346 124.287053) (xy 259.96697 124.217233) - (xy 260.006926 124.159915) (xy 260.071527 124.133298) (xy 260.140263 124.145832) (xy 260.17578 124.172628) - (xy 260.215206 124.215456) (xy 260.215209 124.215458) (xy 260.215212 124.215461) (xy 260.39509 124.355466) - (xy 260.395094 124.355469) (xy 260.395096 124.35547) (xy 260.395099 124.355472) (xy 260.404791 124.360717) - (xy 260.595574 124.463963) (xy 260.707529 124.502397) (xy 260.811173 124.537979) (xy 260.811175 124.537979) - (xy 260.811177 124.53798) (xy 261.036023 124.5755) (xy 261.036024 124.5755) (xy 261.263976 124.5755) - (xy 261.263977 124.5755) (xy 261.488823 124.53798) (xy 261.704426 124.463963) (xy 261.904906 124.355469) - (xy 262.084794 124.215456) (xy 262.239183 124.047745) (xy 262.363862 123.856909) (xy 262.45543 123.648155) - (xy 262.51139 123.427176) (xy 262.511391 123.427168) (xy 262.530214 123.200006) (xy 262.530214 123.199993) - (xy 262.511391 122.972831) (xy 262.511389 122.97282) (xy 262.45543 122.751844) (xy 262.363862 122.543091) - (xy 262.239185 122.352257) (xy 262.084791 122.184541) (xy 262.084787 122.184538) (xy 261.904909 122.044533) - (xy 261.9049 122.044527) (xy 261.704432 121.93604) (xy 261.704429 121.936039) (xy 261.704426 121.936037) - (xy 261.70442 121.936035) (xy 261.704418 121.936034) (xy 261.488826 121.86202) (xy 261.320188 121.83388) - (xy 261.263977 121.8245) (xy 261.036023 121.8245) (xy 260.991053 121.832004) (xy 260.811173 121.86202) - (xy 260.595581 121.936034) (xy 260.595567 121.93604) (xy 260.395099 122.044527) (xy 260.39509 122.044533) - (xy 260.215212 122.184538) (xy 260.215207 122.184543) (xy 260.175779 122.227372) (xy 260.115892 122.263361) - (xy 260.046053 122.26126) (xy 259.988438 122.221734) (xy 259.961338 122.157334) (xy 259.964346 122.112946) - (xy 260.011387 121.927188) (xy 260.011389 121.927179) (xy 260.01139 121.927176) (xy 260.017223 121.856786) - (xy 260.030214 121.700006) (xy 260.030214 121.699993) (xy 265.269786 121.699993) (xy 265.269786 121.700006) - (xy 265.288608 121.927168) (xy 265.28861 121.927179) (xy 265.344569 122.148155) (xy 265.436137 122.356908) - (xy 265.560814 122.547742) (xy 265.560817 122.547745) (xy 265.680966 122.678262) (xy 265.715208 122.715458) - (xy 265.715212 122.715461) (xy 265.839636 122.812304) (xy 265.895094 122.855469) (xy 265.895096 122.85547) - (xy 265.895099 122.855472) (xy 266.011646 122.918543) (xy 266.095574 122.963963) (xy 266.172786 122.99047) - (xy 266.311173 123.037979) (xy 266.311175 123.037979) (xy 266.311177 123.03798) (xy 266.536023 123.0755) - (xy 266.536024 123.0755) (xy 266.763976 123.0755) (xy 266.763977 123.0755) (xy 266.988823 123.03798) - (xy 267.204426 122.963963) (xy 267.404906 122.855469) (xy 267.584794 122.715456) (xy 267.739183 122.547745) - (xy 267.863862 122.356909) (xy 267.95543 122.148155) (xy 268.01139 121.927176) (xy 268.017223 121.856786) - (xy 268.030214 121.700006) (xy 268.030214 121.699993) (xy 268.030212 121.699967) (xy 270.844722 121.699967) - (xy 270.844722 121.699968) (xy 270.863762 121.856786) (xy 270.89505 121.939284) (xy 270.91978 122.004491) - (xy 271.009517 122.134498) (xy 271.12776 122.239251) (xy 271.127762 122.239252) (xy 271.267634 122.312664) - (xy 271.421014 122.350468) (xy 271.421015 122.350468) (xy 271.578985 122.350468) (xy 271.732365 122.312664) - (xy 271.87224 122.239251) (xy 271.990483 122.134498) (xy 272.08022 122.004491) (xy 272.136237 121.856786) - (xy 272.155278 121.699968) (xy 272.147333 121.63453) (xy 272.136237 121.543149) (xy 272.114992 121.487132) - (xy 272.08022 121.395445) (xy 271.990483 121.265438) (xy 271.87224 121.160685) (xy 271.872238 121.160684) - (xy 271.872237 121.160683) (xy 271.732365 121.087271) (xy 271.578986 121.049468) (xy 271.578985 121.049468) - (xy 271.421015 121.049468) (xy 271.421014 121.049468) (xy 271.267634 121.087271) (xy 271.127762 121.160683) - (xy 271.065933 121.215458) (xy 271.024861 121.251845) (xy 271.009516 121.265439) (xy 270.919781 121.395443) - (xy 270.91978 121.395444) (xy 270.863762 121.543149) (xy 270.844722 121.699967) (xy 268.030212 121.699967) - (xy 268.011391 121.472831) (xy 268.011389 121.47282) (xy 267.95543 121.251844) (xy 267.863862 121.043091) - (xy 267.739185 120.852257) (xy 267.651334 120.756826) (xy 267.584794 120.684544) (xy 267.584793 120.684543) - (xy 267.584791 120.684541) (xy 267.584787 120.684538) (xy 267.404909 120.544533) (xy 267.4049 120.544527) - (xy 267.204432 120.43604) (xy 267.204429 120.436039) (xy 267.204426 120.436037) (xy 267.20442 120.436035) - (xy 267.204418 120.436034) (xy 266.988826 120.36202) (xy 266.820188 120.33388) (xy 266.763977 120.3245) - (xy 266.536023 120.3245) (xy 266.491053 120.332004) (xy 266.311173 120.36202) (xy 266.095581 120.436034) - (xy 266.095567 120.43604) (xy 265.895099 120.544527) (xy 265.89509 120.544533) (xy 265.715212 120.684538) - (xy 265.715208 120.684541) (xy 265.560814 120.852257) (xy 265.436137 121.043091) (xy 265.344569 121.251844) - (xy 265.28861 121.47282) (xy 265.288608 121.472831) (xy 265.269786 121.699993) (xy 260.030214 121.699993) - (xy 260.011391 121.472831) (xy 260.011387 121.472811) (xy 259.964346 121.287053) (xy 259.96697 121.217233) - (xy 260.006926 121.159915) (xy 260.071527 121.133298) (xy 260.140263 121.145832) (xy 260.17578 121.172628) - (xy 260.215206 121.215456) (xy 260.215209 121.215458) (xy 260.215212 121.215461) (xy 260.279424 121.265439) - (xy 260.395094 121.355469) (xy 260.395096 121.35547) (xy 260.395099 121.355472) (xy 260.468963 121.395445) - (xy 260.595574 121.463963) (xy 260.707529 121.502397) (xy 260.811173 121.537979) (xy 260.811175 121.537979) - (xy 260.811177 121.53798) (xy 261.036023 121.5755) (xy 261.036024 121.5755) (xy 261.263976 121.5755) - (xy 261.263977 121.5755) (xy 261.488823 121.53798) (xy 261.704426 121.463963) (xy 261.904906 121.355469) - (xy 262.084794 121.215456) (xy 262.239183 121.047745) (xy 262.363862 120.856909) (xy 262.45543 120.648155) - (xy 262.51139 120.427176) (xy 262.519898 120.3245) (xy 262.530214 120.200006) (xy 262.530214 120.199993) - (xy 262.511391 119.972831) (xy 262.511389 119.97282) (xy 262.45543 119.751844) (xy 262.363862 119.543091) - (xy 262.239185 119.352257) (xy 262.084791 119.184541) (xy 262.084787 119.184538) (xy 261.904909 119.044533) - (xy 261.9049 119.044527) (xy 261.704432 118.93604) (xy 261.704429 118.936039) (xy 261.704426 118.936037) - (xy 261.70442 118.936035) (xy 261.704418 118.936034) (xy 261.488826 118.86202) (xy 261.320188 118.83388) - (xy 261.263977 118.8245) (xy 261.036023 118.8245) (xy 260.991053 118.832004) (xy 260.811173 118.86202) - (xy 260.595581 118.936034) (xy 260.595567 118.93604) (xy 260.395099 119.044527) (xy 260.39509 119.044533) - (xy 260.215212 119.184538) (xy 260.215207 119.184543) (xy 260.175779 119.227372) (xy 260.115892 119.263361) - (xy 260.046053 119.26126) (xy 259.988438 119.221734) (xy 259.961338 119.157334) (xy 259.964346 119.112946) - (xy 260.011387 118.927188) (xy 260.011389 118.927179) (xy 260.01139 118.927176) (xy 260.019898 118.8245) - (xy 260.030214 118.700006) (xy 260.030214 118.699993) (xy 265.269786 118.699993) (xy 265.269786 118.700006) - (xy 265.288608 118.927168) (xy 265.28861 118.927179) (xy 265.344569 119.148155) (xy 265.436137 119.356908) - (xy 265.560814 119.547742) (xy 265.560817 119.547745) (xy 265.680966 119.678262) (xy 265.715208 119.715458) - (xy 265.715212 119.715461) (xy 265.895094 119.855469) (xy 265.895096 119.85547) (xy 265.895099 119.855472) - (xy 266.010139 119.917728) (xy 266.095574 119.963963) (xy 266.163584 119.987311) (xy 266.311173 120.037979) - (xy 266.311175 120.037979) (xy 266.311177 120.03798) (xy 266.536023 120.0755) (xy 266.536024 120.0755) - (xy 266.763976 120.0755) (xy 266.763977 120.0755) (xy 266.988823 120.03798) (xy 267.204426 119.963963) - (xy 267.404906 119.855469) (xy 267.584794 119.715456) (xy 267.739183 119.547745) (xy 267.863862 119.356909) - (xy 267.95543 119.148155) (xy 268.01139 118.927176) (xy 268.019898 118.8245) (xy 268.030214 118.700006) - (xy 268.030214 118.699993) (xy 268.011391 118.472831) (xy 268.011389 118.47282) (xy 267.95543 118.251844) - (xy 267.863862 118.043091) (xy 267.739185 117.852257) (xy 267.660425 117.766701) (xy 267.584794 117.684544) - (xy 267.584793 117.684543) (xy 267.584791 117.684541) (xy 267.584787 117.684538) (xy 267.404909 117.544533) - (xy 267.4049 117.544527) (xy 267.204432 117.43604) (xy 267.204429 117.436039) (xy 267.204426 117.436037) - (xy 267.20442 117.436035) (xy 267.204418 117.436034) (xy 266.988826 117.36202) (xy 266.820188 117.33388) - (xy 266.763977 117.3245) (xy 266.536023 117.3245) (xy 266.491053 117.332004) (xy 266.311173 117.36202) - (xy 266.095581 117.436034) (xy 266.095567 117.43604) (xy 265.895099 117.544527) (xy 265.89509 117.544533) - (xy 265.715212 117.684538) (xy 265.715208 117.684541) (xy 265.560814 117.852257) (xy 265.436137 118.043091) - (xy 265.344569 118.251844) (xy 265.28861 118.47282) (xy 265.288608 118.472831) (xy 265.269786 118.699993) - (xy 260.030214 118.699993) (xy 260.011391 118.472831) (xy 260.011387 118.472811) (xy 259.964346 118.287053) - (xy 259.96697 118.217233) (xy 260.006926 118.159915) (xy 260.071527 118.133298) (xy 260.140263 118.145832) - (xy 260.17578 118.172628) (xy 260.215206 118.215456) (xy 260.215209 118.215458) (xy 260.215212 118.215461) - (xy 260.363696 118.331031) (xy 260.395094 118.355469) (xy 260.395096 118.35547) (xy 260.395099 118.355472) - (xy 260.511646 118.418543) (xy 260.595574 118.463963) (xy 260.707529 118.502397) (xy 260.811173 118.537979) - (xy 260.811175 118.537979) (xy 260.811177 118.53798) (xy 261.036023 118.5755) (xy 261.036024 118.5755) - (xy 261.263976 118.5755) (xy 261.263977 118.5755) (xy 261.488823 118.53798) (xy 261.704426 118.463963) - (xy 261.904906 118.355469) (xy 262.084794 118.215456) (xy 262.239183 118.047745) (xy 262.363862 117.856909) - (xy 262.45543 117.648155) (xy 262.51139 117.427176) (xy 262.523958 117.2755) (xy 262.530214 117.200006) - (xy 262.530214 117.199993) (xy 262.511391 116.972831) (xy 262.511389 116.97282) (xy 262.45543 116.751844) - (xy 262.363862 116.543091) (xy 262.239185 116.352257) (xy 262.084791 116.184541) (xy 262.084787 116.184538) + (xy 112.3005 115.364999) (xy 114.194722 115.364999) (xy 114.194722 115.365) (xy 114.213762 115.521818) + (xy 114.26978 115.669523) (xy 114.359517 115.79953) (xy 114.47776 115.904283) (xy 114.477762 115.904284) + (xy 114.617632 115.977695) (xy 114.617634 115.977695) (xy 114.617635 115.977696) (xy 114.624345 115.979349) + (xy 114.625372 115.979603) (xy 114.685753 116.01476) (xy 114.71754 116.07698) (xy 114.710644 116.146508) + (xy 114.667252 116.201271) (xy 114.625372 116.220397) (xy 114.617632 116.222304) (xy 114.477762 116.295715) + (xy 114.359516 116.400471) (xy 114.269781 116.530475) (xy 114.26978 116.530476) (xy 114.213762 116.678181) + (xy 114.194722 116.834999) (xy 114.194722 116.835) (xy 114.213762 116.991818) (xy 114.235706 117.049678) + (xy 114.26978 117.139523) (xy 114.359517 117.26953) (xy 114.47776 117.374283) (xy 114.477762 117.374284) + (xy 114.617634 117.447696) (xy 114.771014 117.4855) (xy 114.771015 117.4855) (xy 114.928985 117.4855) + (xy 115.082365 117.447696) (xy 115.121477 117.427168) (xy 115.22224 117.374283) (xy 115.340483 117.26953) + (xy 115.43022 117.139523) (xy 115.486237 116.991818) (xy 115.505278 116.835) (xy 115.49119 116.718969) + (xy 115.486237 116.678181) (xy 115.464992 116.622164) (xy 115.43022 116.530477) (xy 115.340483 116.40047) + (xy 115.22224 116.295717) (xy 115.222238 116.295716) (xy 115.222237 116.295715) (xy 115.082365 116.222303) + (xy 115.082366 116.222303) (xy 115.074629 116.220397) (xy 115.014248 116.185241) (xy 114.982459 116.123022) + (xy 114.989355 116.053493) (xy 115.032746 115.99873) (xy 115.074629 115.979603) (xy 115.082365 115.977696) + (xy 115.132732 115.951261) (xy 115.22224 115.904283) (xy 115.340483 115.79953) (xy 115.43022 115.669523) + (xy 115.486237 115.521818) (xy 115.504064 115.374999) (xy 133.044722 115.374999) (xy 133.044722 115.375) + (xy 133.063762 115.531818) (xy 133.115988 115.669524) (xy 133.11978 115.679523) (xy 133.164648 115.744526) + (xy 133.209515 115.809528) (xy 133.209517 115.80953) (xy 133.226979 115.825) (xy 133.305637 115.894684) + (xy 133.342764 115.953874) (xy 133.341996 116.023739) (xy 133.305637 116.080316) (xy 133.209516 116.16547) + (xy 133.119781 116.295475) (xy 133.11978 116.295476) (xy 133.063762 116.443181) (xy 133.044722 116.599999) + (xy 133.044722 116.6) (xy 133.063762 116.756818) (xy 133.093413 116.834999) (xy 133.11978 116.904523) + (xy 133.209517 117.03453) (xy 133.32776 117.139283) (xy 133.327762 117.139284) (xy 133.467634 117.212696) + (xy 133.621014 117.2505) (xy 133.621015 117.2505) (xy 133.778985 117.2505) (xy 133.932365 117.212696) + (xy 133.956568 117.199993) (xy 134.07224 117.139283) (xy 134.190483 117.03453) (xy 134.28022 116.904523) + (xy 134.336237 116.756818) (xy 134.355278 116.6) (xy 134.346837 116.530477) (xy 134.336237 116.443181) + (xy 134.303518 116.356909) (xy 134.28022 116.295477) (xy 134.190483 116.16547) (xy 134.09436 116.080314) + (xy 134.057236 116.021127) (xy 134.058003 115.951261) (xy 134.09436 115.894685) (xy 134.173027 115.824994) + (xy 165.704528 115.824994) (xy 165.704528 115.825005) (xy 165.724378 116.064559) (xy 165.783388 116.297589) + (xy 165.87995 116.517729) (xy 166.009133 116.715456) (xy 166.011428 116.718969) (xy 166.174235 116.895825) + (xy 166.174238 116.895827) (xy 166.174241 116.89583) (xy 166.363923 117.043466) (xy 166.363929 117.04347) + (xy 166.363932 117.043472) (xy 166.575343 117.157882) (xy 166.575346 117.157883) (xy 166.802698 117.235933) + (xy 166.8027 117.235933) (xy 166.802702 117.235934) (xy 167.039807 117.2755) (xy 167.039808 117.2755) + (xy 167.28019 117.2755) (xy 167.280191 117.2755) (xy 167.517296 117.235934) (xy 167.744655 117.157882) + (xy 167.956066 117.043472) (xy 167.963124 117.037979) (xy 168.022431 116.991818) (xy 168.145763 116.895825) + (xy 168.30857 116.718969) (xy 168.440048 116.517728) (xy 168.536609 116.297591) (xy 168.595619 116.064563) + (xy 168.6089 115.904284) (xy 168.61547 115.825005) (xy 168.61547 115.824994) (xy 168.595619 115.58544) + (xy 168.595619 115.585437) (xy 168.536609 115.352409) (xy 168.440048 115.132272) (xy 168.399674 115.070476) + (xy 168.308571 114.931033) (xy 168.30857 114.931031) (xy 168.145763 114.754175) (xy 168.145758 114.754171) + (xy 168.145756 114.754169) (xy 167.956074 114.606533) (xy 167.956068 114.606529) (xy 167.944597 114.600321) + (xy 179.179499 114.600321) (xy 179.179499 117.049678) (xy 179.194031 117.122735) (xy 179.194032 117.122739) + (xy 179.212404 117.150235) (xy 179.249398 117.205601) (xy 179.332259 117.260966) (xy 179.332263 117.260967) + (xy 179.40532 117.275499) (xy 179.405323 117.2755) (xy 179.405325 117.2755) (xy 181.854675 117.2755) + (xy 181.854676 117.275499) (xy 181.927739 117.260966) (xy 182.0106 117.205601) (xy 182.065965 117.12274) + (xy 182.080499 117.049674) (xy 182.080499 115.699993) (xy 257.269786 115.699993) (xy 257.269786 115.700006) + (xy 257.288608 115.927168) (xy 257.28861 115.927179) (xy 257.344569 116.148155) (xy 257.436137 116.356908) + (xy 257.560814 116.547742) (xy 257.560817 116.547745) (xy 257.680966 116.678262) (xy 257.715208 116.715458) + (xy 257.715212 116.715461) (xy 257.89509 116.855466) (xy 257.895094 116.855469) (xy 257.895096 116.85547) + (xy 257.895099 116.855472) (xy 257.969669 116.895827) (xy 258.095574 116.963963) (xy 258.207529 117.002397) + (xy 258.311173 117.037979) (xy 258.311175 117.037979) (xy 258.311177 117.03798) (xy 258.536023 117.0755) + (xy 258.536024 117.0755) (xy 258.763976 117.0755) (xy 258.763977 117.0755) (xy 258.988823 117.03798) + (xy 259.204426 116.963963) (xy 259.404906 116.855469) (xy 259.584794 116.715456) (xy 259.62422 116.672627) + (xy 259.684105 116.636639) (xy 259.753943 116.638739) (xy 259.811559 116.678262) (xy 259.838661 116.742662) + (xy 259.835654 116.787052) (xy 259.78861 116.97282) (xy 259.788608 116.972831) (xy 259.769786 117.199993) + (xy 259.769786 117.200006) (xy 259.788608 117.427168) (xy 259.78861 117.427176) (xy 259.835654 117.612946) + (xy 259.833029 117.682767) (xy 259.793073 117.740084) (xy 259.728472 117.766701) (xy 259.659736 117.754167) + (xy 259.624219 117.727371) (xy 259.584794 117.684544) (xy 259.584789 117.68454) (xy 259.584787 117.684538) + (xy 259.404909 117.544533) (xy 259.4049 117.544527) (xy 259.204432 117.43604) (xy 259.204429 117.436039) + (xy 259.204426 117.436037) (xy 259.20442 117.436035) (xy 259.204418 117.436034) (xy 258.988826 117.36202) + (xy 258.820188 117.33388) (xy 258.763977 117.3245) (xy 258.536023 117.3245) (xy 258.491053 117.332004) + (xy 258.311173 117.36202) (xy 258.095581 117.436034) (xy 258.095567 117.43604) (xy 257.895099 117.544527) + (xy 257.89509 117.544533) (xy 257.715212 117.684538) (xy 257.715208 117.684541) (xy 257.560814 117.852257) + (xy 257.436137 118.043091) (xy 257.344569 118.251844) (xy 257.28861 118.47282) (xy 257.288608 118.472831) + (xy 257.269786 118.699993) (xy 257.269786 118.700006) (xy 257.288608 118.927168) (xy 257.28861 118.927179) + (xy 257.344569 119.148155) (xy 257.436137 119.356908) (xy 257.560814 119.547742) (xy 257.560817 119.547745) + (xy 257.680966 119.678262) (xy 257.715208 119.715458) (xy 257.715212 119.715461) (xy 257.895094 119.855469) + (xy 257.895096 119.85547) (xy 257.895099 119.855472) (xy 258.010139 119.917728) (xy 258.095574 119.963963) + (xy 258.163584 119.987311) (xy 258.311173 120.037979) (xy 258.311175 120.037979) (xy 258.311177 120.03798) + (xy 258.536023 120.0755) (xy 258.536024 120.0755) (xy 258.763976 120.0755) (xy 258.763977 120.0755) + (xy 258.988823 120.03798) (xy 259.204426 119.963963) (xy 259.404906 119.855469) (xy 259.584794 119.715456) + (xy 259.62422 119.672627) (xy 259.684105 119.636639) (xy 259.753943 119.638739) (xy 259.811559 119.678262) + (xy 259.838661 119.742662) (xy 259.835654 119.787052) (xy 259.78861 119.97282) (xy 259.788608 119.972831) + (xy 259.769786 120.199993) (xy 259.769786 120.200006) (xy 259.788608 120.427168) (xy 259.78861 120.427176) + (xy 259.832377 120.600008) (xy 259.835654 120.612946) (xy 259.833029 120.682767) (xy 259.793073 120.740084) + (xy 259.728472 120.766701) (xy 259.659736 120.754167) (xy 259.624219 120.727371) (xy 259.584794 120.684544) + (xy 259.584789 120.68454) (xy 259.584787 120.684538) (xy 259.404909 120.544533) (xy 259.4049 120.544527) + (xy 259.204432 120.43604) (xy 259.204429 120.436039) (xy 259.204426 120.436037) (xy 259.20442 120.436035) + (xy 259.204418 120.436034) (xy 258.988826 120.36202) (xy 258.820188 120.33388) (xy 258.763977 120.3245) + (xy 258.536023 120.3245) (xy 258.491053 120.332004) (xy 258.311173 120.36202) (xy 258.095581 120.436034) + (xy 258.095567 120.43604) (xy 257.895099 120.544527) (xy 257.89509 120.544533) (xy 257.715212 120.684538) + (xy 257.715208 120.684541) (xy 257.560814 120.852257) (xy 257.436137 121.043091) (xy 257.344569 121.251844) + (xy 257.28861 121.47282) (xy 257.288608 121.472831) (xy 257.269786 121.699993) (xy 257.269786 121.700006) + (xy 257.288608 121.927168) (xy 257.28861 121.927179) (xy 257.344569 122.148155) (xy 257.436137 122.356908) + (xy 257.560814 122.547742) (xy 257.560817 122.547745) (xy 257.680966 122.678262) (xy 257.715208 122.715458) + (xy 257.715212 122.715461) (xy 257.839636 122.812304) (xy 257.895094 122.855469) (xy 257.895096 122.85547) + (xy 257.895099 122.855472) (xy 258.011646 122.918543) (xy 258.095574 122.963963) (xy 258.172786 122.99047) + (xy 258.311173 123.037979) (xy 258.311175 123.037979) (xy 258.311177 123.03798) (xy 258.536023 123.0755) + (xy 258.536024 123.0755) (xy 258.763976 123.0755) (xy 258.763977 123.0755) (xy 258.988823 123.03798) + (xy 259.204426 122.963963) (xy 259.404906 122.855469) (xy 259.584794 122.715456) (xy 259.62422 122.672627) + (xy 259.684105 122.636639) (xy 259.753943 122.638739) (xy 259.811559 122.678262) (xy 259.838661 122.742662) + (xy 259.835654 122.787052) (xy 259.78861 122.97282) (xy 259.788608 122.972831) (xy 259.769786 123.199993) + (xy 259.769786 123.200006) (xy 259.788608 123.427168) (xy 259.78861 123.427176) (xy 259.808087 123.50409) + (xy 259.835654 123.612946) (xy 259.833029 123.682767) (xy 259.793073 123.740084) (xy 259.728472 123.766701) + (xy 259.659736 123.754167) (xy 259.624219 123.727371) (xy 259.584794 123.684544) (xy 259.584789 123.68454) + (xy 259.584787 123.684538) (xy 259.404909 123.544533) (xy 259.4049 123.544527) (xy 259.204432 123.43604) + (xy 259.204429 123.436039) (xy 259.204426 123.436037) (xy 259.20442 123.436035) (xy 259.204418 123.436034) + (xy 258.988826 123.36202) (xy 258.820188 123.33388) (xy 258.763977 123.3245) (xy 258.536023 123.3245) + (xy 258.491053 123.332004) (xy 258.311173 123.36202) (xy 258.095581 123.436034) (xy 258.095567 123.43604) + (xy 257.895099 123.544527) (xy 257.89509 123.544533) (xy 257.715212 123.684538) (xy 257.715208 123.684541) + (xy 257.560814 123.852257) (xy 257.436137 124.043091) (xy 257.344569 124.251844) (xy 257.28861 124.47282) + (xy 257.288608 124.472831) (xy 257.269786 124.699993) (xy 257.269786 124.700006) (xy 257.288608 124.927168) + (xy 257.28861 124.927179) (xy 257.344569 125.148155) (xy 257.436137 125.356908) (xy 257.560814 125.547742) + (xy 257.560817 125.547745) (xy 257.680966 125.678262) (xy 257.715208 125.715458) (xy 257.715212 125.715461) + (xy 257.89509 125.855466) (xy 257.895094 125.855469) (xy 257.895096 125.85547) (xy 257.895099 125.855472) + (xy 257.904791 125.860717) (xy 258.095574 125.963963) (xy 258.207529 126.002397) (xy 258.311173 126.037979) + (xy 258.311175 126.037979) (xy 258.311177 126.03798) (xy 258.536023 126.0755) (xy 258.536024 126.0755) + (xy 258.763976 126.0755) (xy 258.763977 126.0755) (xy 258.988823 126.03798) (xy 259.204426 125.963963) + (xy 259.404906 125.855469) (xy 259.584794 125.715456) (xy 259.62422 125.672627) (xy 259.684105 125.636639) + (xy 259.753943 125.638739) (xy 259.811559 125.678262) (xy 259.838661 125.742662) (xy 259.835654 125.787052) + (xy 259.78861 125.97282) (xy 259.788608 125.972831) (xy 259.769786 126.199993) (xy 259.769786 126.200006) + (xy 259.788608 126.427168) (xy 259.78861 126.427176) (xy 259.831229 126.595475) (xy 259.835654 126.612946) + (xy 259.833029 126.682767) (xy 259.793073 126.740084) (xy 259.728472 126.766701) (xy 259.659736 126.754167) + (xy 259.624219 126.727371) (xy 259.617818 126.720418) (xy 259.584794 126.684544) (xy 259.584789 126.68454) + (xy 259.584787 126.684538) (xy 259.404909 126.544533) (xy 259.4049 126.544527) (xy 259.204432 126.43604) + (xy 259.204429 126.436039) (xy 259.204426 126.436037) (xy 259.20442 126.436035) (xy 259.204418 126.436034) + (xy 258.988826 126.36202) (xy 258.820188 126.33388) (xy 258.763977 126.3245) (xy 258.536023 126.3245) + (xy 258.491053 126.332004) (xy 258.311173 126.36202) (xy 258.095581 126.436034) (xy 258.095567 126.43604) + (xy 257.895099 126.544527) (xy 257.89509 126.544533) (xy 257.715212 126.684538) (xy 257.715208 126.684541) + (xy 257.560814 126.852257) (xy 257.436137 127.043091) (xy 257.344569 127.251844) (xy 257.28861 127.47282) + (xy 257.288608 127.472831) (xy 257.269786 127.699993) (xy 257.269786 127.700006) (xy 257.288608 127.927168) + (xy 257.28861 127.927179) (xy 257.344569 128.148155) (xy 257.436137 128.356908) (xy 257.560814 128.547742) + (xy 257.604757 128.595477) (xy 257.680966 128.678262) (xy 257.715208 128.715458) (xy 257.715212 128.715461) + (xy 257.773357 128.760717) (xy 257.895094 128.855469) (xy 257.895096 128.85547) (xy 257.895099 128.855472) + (xy 257.977378 128.899999) (xy 258.095574 128.963963) (xy 258.156075 128.984733) (xy 258.311173 129.037979) + (xy 258.311175 129.037979) (xy 258.311177 129.03798) (xy 258.536023 129.0755) (xy 258.536024 129.0755) + (xy 258.763976 129.0755) (xy 258.763977 129.0755) (xy 258.988823 129.03798) (xy 259.204426 128.963963) + (xy 259.404906 128.855469) (xy 259.584794 128.715456) (xy 259.62422 128.672627) (xy 259.684105 128.636639) + (xy 259.753943 128.638739) (xy 259.811559 128.678262) (xy 259.838661 128.742662) (xy 259.835654 128.787052) + (xy 259.78861 128.97282) (xy 259.788608 128.972831) (xy 259.769786 129.199993) (xy 259.769786 129.200006) + (xy 259.788608 129.427168) (xy 259.78861 129.427176) (xy 259.833831 129.60575) (xy 259.835654 129.612946) + (xy 259.833029 129.682767) (xy 259.793073 129.740084) (xy 259.728472 129.766701) (xy 259.659736 129.754167) + (xy 259.624219 129.727371) (xy 259.614504 129.716818) (xy 259.584794 129.684544) (xy 259.584789 129.68454) + (xy 259.584787 129.684538) (xy 259.404909 129.544533) (xy 259.4049 129.544527) (xy 259.204432 129.43604) + (xy 259.204429 129.436039) (xy 259.204426 129.436037) (xy 259.20442 129.436035) (xy 259.204418 129.436034) + (xy 258.988826 129.36202) (xy 258.820188 129.33388) (xy 258.763977 129.3245) (xy 258.536023 129.3245) + (xy 258.491053 129.332004) (xy 258.311173 129.36202) (xy 258.095581 129.436034) (xy 258.095567 129.43604) + (xy 257.895099 129.544527) (xy 257.89509 129.544533) (xy 257.715212 129.684538) (xy 257.715208 129.684541) + (xy 257.560814 129.852257) (xy 257.436137 130.043091) (xy 257.344569 130.251844) (xy 257.28861 130.47282) + (xy 257.288608 130.472831) (xy 257.269786 130.699993) (xy 257.269786 130.700006) (xy 257.288608 130.927168) + (xy 257.28861 130.927179) (xy 257.344569 131.148155) (xy 257.436137 131.356908) (xy 257.560814 131.547742) + (xy 257.604757 131.595477) (xy 257.705142 131.704524) (xy 257.715208 131.715458) (xy 257.715212 131.715461) + (xy 257.870638 131.836434) (xy 257.895094 131.855469) (xy 257.895096 131.85547) (xy 257.895099 131.855472) + (xy 257.930589 131.874678) (xy 258.095574 131.963963) (xy 258.207529 132.002397) (xy 258.311173 132.037979) + (xy 258.311175 132.037979) (xy 258.311177 132.03798) (xy 258.536023 132.0755) (xy 258.536024 132.0755) + (xy 258.763976 132.0755) (xy 258.763977 132.0755) (xy 258.988823 132.03798) (xy 259.204426 131.963963) + (xy 259.404906 131.855469) (xy 259.584794 131.715456) (xy 259.62422 131.672627) (xy 259.684105 131.636639) + (xy 259.753943 131.638739) (xy 259.811559 131.678262) (xy 259.838661 131.742662) (xy 259.835654 131.787052) + (xy 259.78861 131.97282) (xy 259.788608 131.972831) (xy 259.769786 132.199993) (xy 259.769786 132.200006) + (xy 259.788608 132.427168) (xy 259.78861 132.427176) (xy 259.822427 132.560717) (xy 259.835654 132.612946) + (xy 259.833029 132.682767) (xy 259.793073 132.740084) (xy 259.728472 132.766701) (xy 259.659736 132.754167) + (xy 259.624219 132.727371) (xy 259.61903 132.721734) (xy 259.584794 132.684544) (xy 259.584789 132.68454) + (xy 259.584787 132.684538) (xy 259.404909 132.544533) (xy 259.4049 132.544527) (xy 259.204432 132.43604) + (xy 259.204429 132.436039) (xy 259.204426 132.436037) (xy 259.20442 132.436035) (xy 259.204418 132.436034) + (xy 258.988826 132.36202) (xy 258.820188 132.33388) (xy 258.763977 132.3245) (xy 258.536023 132.3245) + (xy 258.491053 132.332004) (xy 258.311173 132.36202) (xy 258.095581 132.436034) (xy 258.095567 132.43604) + (xy 257.895099 132.544527) (xy 257.89509 132.544533) (xy 257.715212 132.684538) (xy 257.715208 132.684541) + (xy 257.560814 132.852257) (xy 257.436137 133.043091) (xy 257.344569 133.251844) (xy 257.28861 133.47282) + (xy 257.288608 133.472831) (xy 257.269786 133.699993) (xy 257.269786 133.700006) (xy 257.288608 133.927168) + (xy 257.28861 133.927179) (xy 257.344569 134.148155) (xy 257.436137 134.356908) (xy 257.560814 134.547742) + (xy 257.715208 134.715458) (xy 257.715212 134.715461) (xy 257.779465 134.765471) (xy 257.895094 134.855469) + (xy 257.895096 134.85547) (xy 257.895099 134.855472) (xy 258.011646 134.918543) (xy 258.095574 134.963963) + (xy 258.207529 135.002397) (xy 258.311173 135.037979) (xy 258.311175 135.037979) (xy 258.311177 135.03798) + (xy 258.536023 135.0755) (xy 258.536024 135.0755) (xy 258.763976 135.0755) (xy 258.763977 135.0755) + (xy 258.988823 135.03798) (xy 259.204426 134.963963) (xy 259.404906 134.855469) (xy 259.584794 134.715456) + (xy 259.739183 134.547745) (xy 259.863862 134.356909) (xy 259.95543 134.148155) (xy 260.01139 133.927176) + (xy 260.011391 133.927168) (xy 260.030214 133.700006) (xy 260.030214 133.699993) (xy 260.011391 133.472831) + (xy 260.011387 133.472811) (xy 259.964346 133.287053) (xy 259.96697 133.217233) (xy 260.006926 133.159915) + (xy 260.071527 133.133298) (xy 260.140263 133.145832) (xy 260.17578 133.172628) (xy 260.215206 133.215456) + (xy 260.215209 133.215458) (xy 260.215212 133.215461) (xy 260.389689 133.351262) (xy 260.395094 133.355469) + (xy 260.395096 133.35547) (xy 260.395099 133.355472) (xy 260.477378 133.399999) (xy 260.595574 133.463963) + (xy 260.661781 133.486692) (xy 260.811173 133.537979) (xy 260.811175 133.537979) (xy 260.811177 133.53798) + (xy 261.036023 133.5755) (xy 261.036024 133.5755) (xy 261.263976 133.5755) (xy 261.263977 133.5755) + (xy 261.488823 133.53798) (xy 261.704426 133.463963) (xy 261.904906 133.355469) (xy 262.084794 133.215456) + (xy 262.239183 133.047745) (xy 262.363862 132.856909) (xy 262.45543 132.648155) (xy 262.51139 132.427176) + (xy 262.519898 132.3245) (xy 262.526424 132.245745) (xy 262.543679 132.201026) (xy 262.755527 132.201026) + (xy 262.771456 132.230994) (xy 262.773576 132.245745) (xy 262.788608 132.427168) (xy 262.78861 132.427179) + (xy 262.844569 132.648155) (xy 262.936137 132.856908) (xy 263.060814 133.047742) (xy 263.12411 133.1165) + (xy 263.1947 133.193181) (xy 263.215208 133.215458) (xy 263.215212 133.215461) (xy 263.389689 133.351262) + (xy 263.395094 133.355469) (xy 263.395096 133.35547) (xy 263.395099 133.355472) (xy 263.477378 133.399999) + (xy 263.595574 133.463963) (xy 263.661781 133.486692) (xy 263.811173 133.537979) (xy 263.811175 133.537979) + (xy 263.811177 133.53798) (xy 264.036023 133.5755) (xy 264.036024 133.5755) (xy 264.263976 133.5755) + (xy 264.263977 133.5755) (xy 264.488823 133.53798) (xy 264.704426 133.463963) (xy 264.904906 133.355469) + (xy 265.084794 133.215456) (xy 265.12422 133.172627) (xy 265.184105 133.136639) (xy 265.253943 133.138739) + (xy 265.311559 133.178262) (xy 265.338661 133.242662) (xy 265.335654 133.287052) (xy 265.28861 133.47282) + (xy 265.288608 133.472831) (xy 265.269786 133.699993) (xy 265.269786 133.700006) (xy 265.288608 133.927168) + (xy 265.28861 133.927179) (xy 265.344569 134.148155) (xy 265.436137 134.356908) (xy 265.560814 134.547742) + (xy 265.715208 134.715458) (xy 265.715212 134.715461) (xy 265.779465 134.765471) (xy 265.895094 134.855469) + (xy 265.895096 134.85547) (xy 265.895099 134.855472) (xy 266.011646 134.918543) (xy 266.095574 134.963963) + (xy 266.207529 135.002397) (xy 266.311173 135.037979) (xy 266.311175 135.037979) (xy 266.311177 135.03798) + (xy 266.536023 135.0755) (xy 266.536024 135.0755) (xy 266.763976 135.0755) (xy 266.763977 135.0755) + (xy 266.988823 135.03798) (xy 267.204426 134.963963) (xy 267.404906 134.855469) (xy 267.584794 134.715456) + (xy 267.739183 134.547745) (xy 267.863862 134.356909) (xy 267.95543 134.148155) (xy 268.01139 133.927176) + (xy 268.011391 133.927168) (xy 268.030214 133.700006) (xy 268.030214 133.699993) (xy 268.011391 133.472831) + (xy 268.011389 133.47282) (xy 267.95543 133.251844) (xy 267.863862 133.043091) (xy 267.739185 132.852257) + (xy 267.651322 132.756813) (xy 267.584794 132.684544) (xy 267.584793 132.684543) (xy 267.584791 132.684541) + (xy 267.584787 132.684538) (xy 267.404909 132.544533) (xy 267.4049 132.544527) (xy 267.204432 132.43604) + (xy 267.204429 132.436039) (xy 267.204426 132.436037) (xy 267.20442 132.436035) (xy 267.204418 132.436034) + (xy 266.988826 132.36202) (xy 266.820188 132.33388) (xy 266.763977 132.3245) (xy 266.536023 132.3245) + (xy 266.491053 132.332004) (xy 266.311173 132.36202) (xy 266.095581 132.436034) (xy 266.095567 132.43604) + (xy 265.895099 132.544527) (xy 265.89509 132.544533) (xy 265.715212 132.684538) (xy 265.715207 132.684543) + (xy 265.675779 132.727372) (xy 265.615892 132.763361) (xy 265.546053 132.76126) (xy 265.488438 132.721734) + (xy 265.461338 132.657334) (xy 265.464346 132.612946) (xy 265.477573 132.560717) (xy 265.51139 132.427176) + (xy 265.519898 132.3245) (xy 265.530214 132.200006) (xy 265.530214 132.199993) (xy 265.511391 131.972831) + (xy 265.511387 131.972811) (xy 265.464346 131.787053) (xy 265.46697 131.717233) (xy 265.506926 131.659915) + (xy 265.571527 131.633298) (xy 265.640263 131.645832) (xy 265.67578 131.672628) (xy 265.715206 131.715456) + (xy 265.715209 131.715458) (xy 265.715212 131.715461) (xy 265.870638 131.836434) (xy 265.895094 131.855469) + (xy 265.895096 131.85547) (xy 265.895099 131.855472) (xy 265.930589 131.874678) (xy 266.095574 131.963963) + (xy 266.207529 132.002397) (xy 266.311173 132.037979) (xy 266.311175 132.037979) (xy 266.311177 132.03798) + (xy 266.536023 132.0755) (xy 266.536024 132.0755) (xy 266.763976 132.0755) (xy 266.763977 132.0755) + (xy 266.988823 132.03798) (xy 267.204426 131.963963) (xy 267.404906 131.855469) (xy 267.584794 131.715456) + (xy 267.739183 131.547745) (xy 267.863862 131.356909) (xy 267.95543 131.148155) (xy 268.01139 130.927176) + (xy 268.026106 130.749579) (xy 268.030214 130.700006) (xy 268.030214 130.699993) (xy 268.011391 130.472831) + (xy 268.011389 130.47282) (xy 267.95543 130.251844) (xy 267.863862 130.043091) (xy 267.739185 129.852257) + (xy 267.660425 129.766701) (xy 267.584794 129.684544) (xy 267.584793 129.684543) (xy 267.584791 129.684541) + (xy 267.584787 129.684538) (xy 267.404909 129.544533) (xy 267.4049 129.544527) (xy 267.204432 129.43604) + (xy 267.204429 129.436039) (xy 267.204426 129.436037) (xy 267.20442 129.436035) (xy 267.204418 129.436034) + (xy 266.988826 129.36202) (xy 266.820188 129.33388) (xy 266.763977 129.3245) (xy 266.536023 129.3245) + (xy 266.491053 129.332004) (xy 266.311173 129.36202) (xy 266.095581 129.436034) (xy 266.095567 129.43604) + (xy 265.895099 129.544527) (xy 265.89509 129.544533) (xy 265.715212 129.684538) (xy 265.715208 129.684541) + (xy 265.560814 129.852257) (xy 265.436137 130.043091) (xy 265.344569 130.251844) (xy 265.28861 130.47282) + (xy 265.288608 130.472831) (xy 265.269786 130.699993) (xy 265.269786 130.700006) (xy 265.288608 130.927168) + (xy 265.28861 130.927176) (xy 265.33323 131.103376) (xy 265.335654 131.112946) (xy 265.333029 131.182767) + (xy 265.293073 131.240084) (xy 265.228472 131.266701) (xy 265.159736 131.254167) (xy 265.124219 131.227371) + (xy 265.108627 131.210434) (xy 265.084794 131.184544) (xy 265.084789 131.18454) (xy 265.084787 131.184538) + (xy 264.904909 131.044533) (xy 264.9049 131.044527) (xy 264.704432 130.93604) (xy 264.704429 130.936039) + (xy 264.704426 130.936037) (xy 264.70442 130.936035) (xy 264.704418 130.936034) (xy 264.488826 130.86202) + (xy 264.320188 130.83388) (xy 264.263977 130.8245) (xy 264.036023 130.8245) (xy 263.991053 130.832004) + (xy 263.811173 130.86202) (xy 263.595581 130.936034) (xy 263.595567 130.93604) (xy 263.395099 131.044527) + (xy 263.39509 131.044533) (xy 263.215212 131.184538) (xy 263.215208 131.184541) (xy 263.060814 131.352257) + (xy 262.936137 131.543091) (xy 262.844569 131.751844) (xy 262.78861 131.97282) (xy 262.788608 131.972831) + (xy 262.773576 132.154254) (xy 262.755527 132.201026) (xy 262.543679 132.201026) (xy 262.544472 132.198972) + (xy 262.528544 132.169005) (xy 262.526424 132.154254) (xy 262.511391 131.972831) (xy 262.511389 131.97282) + (xy 262.45543 131.751844) (xy 262.363862 131.543091) (xy 262.239185 131.352257) (xy 262.155416 131.26126) + (xy 262.084794 131.184544) (xy 262.084793 131.184543) (xy 262.084791 131.184541) (xy 262.084787 131.184538) + (xy 261.904909 131.044533) (xy 261.9049 131.044527) (xy 261.704432 130.93604) (xy 261.704429 130.936039) + (xy 261.704426 130.936037) (xy 261.70442 130.936035) (xy 261.704418 130.936034) (xy 261.488826 130.86202) + (xy 261.320188 130.83388) (xy 261.263977 130.8245) (xy 261.036023 130.8245) (xy 260.991053 130.832004) + (xy 260.811173 130.86202) (xy 260.595581 130.936034) (xy 260.595567 130.93604) (xy 260.395099 131.044527) + (xy 260.39509 131.044533) (xy 260.215212 131.184538) (xy 260.215207 131.184543) (xy 260.175779 131.227372) + (xy 260.115892 131.263361) (xy 260.046053 131.26126) (xy 259.988438 131.221734) (xy 259.961338 131.157334) + (xy 259.964346 131.112946) (xy 259.96677 131.103376) (xy 260.01139 130.927176) (xy 260.026106 130.749579) + (xy 260.030214 130.700006) (xy 260.030214 130.699993) (xy 260.011391 130.472831) (xy 260.011387 130.472811) + (xy 259.964346 130.287053) (xy 259.96697 130.217233) (xy 260.006926 130.159915) (xy 260.071527 130.133298) + (xy 260.140263 130.145832) (xy 260.17578 130.172628) (xy 260.215206 130.215456) (xy 260.215209 130.215458) + (xy 260.215212 130.215461) (xy 260.38654 130.348811) (xy 260.395094 130.355469) (xy 260.395096 130.35547) + (xy 260.395099 130.355472) (xy 260.485228 130.404247) (xy 260.595574 130.463963) (xy 260.663561 130.487303) + (xy 260.811173 130.537979) (xy 260.811175 130.537979) (xy 260.811177 130.53798) (xy 261.036023 130.5755) + (xy 261.036024 130.5755) (xy 261.263976 130.5755) (xy 261.263977 130.5755) (xy 261.488823 130.53798) + (xy 261.704426 130.463963) (xy 261.904906 130.355469) (xy 262.084794 130.215456) (xy 262.239183 130.047745) + (xy 262.363862 129.856909) (xy 262.45543 129.648155) (xy 262.51139 129.427176) (xy 262.511391 129.427168) + (xy 262.530214 129.200006) (xy 262.530214 129.199993) (xy 262.511391 128.972831) (xy 262.511389 128.97282) + (xy 262.45543 128.751844) (xy 262.363862 128.543091) (xy 262.239185 128.352257) (xy 262.113082 128.215273) + (xy 262.084794 128.184544) (xy 262.084793 128.184543) (xy 262.084791 128.184541) (xy 262.084787 128.184538) + (xy 261.904909 128.044533) (xy 261.9049 128.044527) (xy 261.704432 127.93604) (xy 261.704429 127.936039) + (xy 261.704426 127.936037) (xy 261.70442 127.936035) (xy 261.704418 127.936034) (xy 261.488826 127.86202) + (xy 261.320188 127.83388) (xy 261.263977 127.8245) (xy 261.036023 127.8245) (xy 260.991053 127.832004) + (xy 260.811173 127.86202) (xy 260.595581 127.936034) (xy 260.595567 127.93604) (xy 260.395099 128.044527) + (xy 260.39509 128.044533) (xy 260.215212 128.184538) (xy 260.215207 128.184543) (xy 260.175779 128.227372) + (xy 260.115892 128.263361) (xy 260.046053 128.26126) (xy 259.988438 128.221734) (xy 259.961338 128.157334) + (xy 259.964346 128.112946) (xy 259.982449 128.041462) (xy 260.01139 127.927176) (xy 260.011391 127.927168) + (xy 260.030214 127.700006) (xy 260.030214 127.699993) (xy 260.011391 127.472831) (xy 260.011387 127.472811) + (xy 259.964346 127.287053) (xy 259.96697 127.217233) (xy 260.006926 127.159915) (xy 260.071527 127.133298) + (xy 260.140263 127.145832) (xy 260.17578 127.172628) (xy 260.215206 127.215456) (xy 260.215209 127.215458) + (xy 260.215212 127.215461) (xy 260.39509 127.355466) (xy 260.395094 127.355469) (xy 260.395096 127.35547) + (xy 260.395099 127.355472) (xy 260.511646 127.418543) (xy 260.595574 127.463963) (xy 260.707529 127.502397) + (xy 260.811173 127.537979) (xy 260.811175 127.537979) (xy 260.811177 127.53798) (xy 261.036023 127.5755) + (xy 261.036024 127.5755) (xy 261.263976 127.5755) (xy 261.263977 127.5755) (xy 261.488823 127.53798) + (xy 261.704426 127.463963) (xy 261.904906 127.355469) (xy 262.084794 127.215456) (xy 262.239183 127.047745) + (xy 262.363862 126.856909) (xy 262.45543 126.648155) (xy 262.51139 126.427176) (xy 262.513642 126.399999) + (xy 262.526424 126.245745) (xy 262.543679 126.201026) (xy 262.755527 126.201026) (xy 262.771456 126.230994) + (xy 262.773576 126.245745) (xy 262.788608 126.427168) (xy 262.78861 126.427179) (xy 262.844569 126.648155) + (xy 262.936137 126.856908) (xy 263.060814 127.047742) (xy 263.097233 127.087303) (xy 263.205142 127.204524) + (xy 263.215208 127.215458) (xy 263.215212 127.215461) (xy 263.39509 127.355466) (xy 263.395094 127.355469) + (xy 263.395096 127.35547) (xy 263.395099 127.355472) (xy 263.511646 127.418543) (xy 263.595574 127.463963) + (xy 263.707529 127.502397) (xy 263.811173 127.537979) (xy 263.811175 127.537979) (xy 263.811177 127.53798) + (xy 264.036023 127.5755) (xy 264.036024 127.5755) (xy 264.263976 127.5755) (xy 264.263977 127.5755) + (xy 264.488823 127.53798) (xy 264.704426 127.463963) (xy 264.904906 127.355469) (xy 265.084794 127.215456) + (xy 265.12422 127.172627) (xy 265.184105 127.136639) (xy 265.253943 127.138739) (xy 265.311559 127.178262) + (xy 265.338661 127.242662) (xy 265.335654 127.287052) (xy 265.28861 127.47282) (xy 265.288608 127.472831) + (xy 265.269786 127.699993) (xy 265.269786 127.700006) (xy 265.288608 127.927168) (xy 265.28861 127.927179) + (xy 265.344569 128.148155) (xy 265.436137 128.356908) (xy 265.560814 128.547742) (xy 265.604757 128.595477) + (xy 265.680966 128.678262) (xy 265.715208 128.715458) (xy 265.715212 128.715461) (xy 265.773357 128.760717) + (xy 265.895094 128.855469) (xy 265.895096 128.85547) (xy 265.895099 128.855472) (xy 265.977378 128.899999) + (xy 266.095574 128.963963) (xy 266.156075 128.984733) (xy 266.311173 129.037979) (xy 266.311175 129.037979) + (xy 266.311177 129.03798) (xy 266.536023 129.0755) (xy 266.536024 129.0755) (xy 266.763976 129.0755) + (xy 266.763977 129.0755) (xy 266.988823 129.03798) (xy 267.204426 128.963963) (xy 267.404906 128.855469) + (xy 267.584794 128.715456) (xy 267.739183 128.547745) (xy 267.863862 128.356909) (xy 267.95543 128.148155) + (xy 268.01139 127.927176) (xy 268.011391 127.927168) (xy 268.030214 127.700006) (xy 268.030214 127.699993) + (xy 268.011391 127.472831) (xy 268.011389 127.47282) (xy 267.95543 127.251844) (xy 267.863862 127.043091) + (xy 267.739185 126.852257) (xy 267.655416 126.76126) (xy 267.584794 126.684544) (xy 267.584793 126.684543) + (xy 267.584791 126.684541) (xy 267.584787 126.684538) (xy 267.404909 126.544533) (xy 267.4049 126.544527) + (xy 267.204432 126.43604) (xy 267.204429 126.436039) (xy 267.204426 126.436037) (xy 267.20442 126.436035) + (xy 267.204418 126.436034) (xy 266.988826 126.36202) (xy 266.820188 126.33388) (xy 266.763977 126.3245) + (xy 266.536023 126.3245) (xy 266.491053 126.332004) (xy 266.311173 126.36202) (xy 266.095581 126.436034) + (xy 266.095567 126.43604) (xy 265.895099 126.544527) (xy 265.89509 126.544533) (xy 265.715212 126.684538) + (xy 265.715207 126.684543) (xy 265.675779 126.727372) (xy 265.615892 126.763361) (xy 265.546053 126.76126) + (xy 265.488438 126.721734) (xy 265.461338 126.657334) (xy 265.464346 126.612946) (xy 265.468771 126.595475) + (xy 265.51139 126.427176) (xy 265.513642 126.399999) (xy 265.530214 126.200006) (xy 265.530214 126.199993) + (xy 265.511391 125.972831) (xy 265.511387 125.972811) (xy 265.464346 125.787053) (xy 265.46697 125.717233) + (xy 265.506926 125.659915) (xy 265.571527 125.633298) (xy 265.640263 125.645832) (xy 265.67578 125.672628) + (xy 265.715206 125.715456) (xy 265.715209 125.715458) (xy 265.715212 125.715461) (xy 265.89509 125.855466) + (xy 265.895094 125.855469) (xy 265.895096 125.85547) (xy 265.895099 125.855472) (xy 265.904791 125.860717) + (xy 266.095574 125.963963) (xy 266.207529 126.002397) (xy 266.311173 126.037979) (xy 266.311175 126.037979) + (xy 266.311177 126.03798) (xy 266.536023 126.0755) (xy 266.536024 126.0755) (xy 266.763976 126.0755) + (xy 266.763977 126.0755) (xy 266.988823 126.03798) (xy 267.204426 125.963963) (xy 267.404906 125.855469) + (xy 267.476174 125.799999) (xy 268.044722 125.799999) (xy 268.044722 125.8) (xy 268.063762 125.956818) + (xy 268.116349 126.095476) (xy 268.11978 126.104523) (xy 268.209517 126.23453) (xy 268.32776 126.339283) + (xy 268.327762 126.339284) (xy 268.467634 126.412696) (xy 268.621014 126.4505) (xy 268.621015 126.4505) + (xy 268.778985 126.4505) (xy 268.932365 126.412696) (xy 268.956557 126.399999) (xy 269.07224 126.339283) + (xy 269.190483 126.23453) (xy 269.28022 126.104523) (xy 269.336237 125.956818) (xy 269.355278 125.8) + (xy 269.353737 125.787304) (xy 269.336237 125.643181) (xy 269.301087 125.5505) (xy 269.28022 125.495477) + (xy 269.190483 125.36547) (xy 269.07224 125.260717) (xy 269.072238 125.260716) (xy 269.072237 125.260715) + (xy 268.932365 125.187303) (xy 268.778986 125.1495) (xy 268.778985 125.1495) (xy 268.621015 125.1495) + (xy 268.621014 125.1495) (xy 268.467634 125.187303) (xy 268.327762 125.260715) (xy 268.31862 125.268814) + (xy 268.219181 125.356909) (xy 268.209516 125.365471) (xy 268.119781 125.495475) (xy 268.11978 125.495476) + (xy 268.063762 125.643181) (xy 268.044722 125.799999) (xy 267.476174 125.799999) (xy 267.584794 125.715456) + (xy 267.739183 125.547745) (xy 267.863862 125.356909) (xy 267.95543 125.148155) (xy 268.01139 124.927176) + (xy 268.013763 124.898538) (xy 268.030214 124.700006) (xy 268.030214 124.699993) (xy 268.011391 124.472831) + (xy 268.011389 124.47282) (xy 267.95543 124.251844) (xy 267.863862 124.043091) (xy 267.739185 123.852257) + (xy 267.691078 123.799999) (xy 269.644718 123.799999) (xy 269.644718 123.8) (xy 269.663758 123.956818) + (xy 269.698243 124.047745) (xy 269.719776 124.104523) (xy 269.809513 124.23453) (xy 269.927756 124.339283) + (xy 269.927758 124.339284) (xy 270.06763 124.412696) (xy 270.22101 124.4505) (xy 270.221011 124.4505) + (xy 270.378981 124.4505) (xy 270.532361 124.412696) (xy 270.631397 124.360717) (xy 270.672236 124.339283) + (xy 270.790479 124.23453) (xy 270.880216 124.104523) (xy 270.936233 123.956818) (xy 270.955274 123.8) + (xy 270.941255 123.684538) (xy 270.936233 123.643181) (xy 270.89882 123.544533) (xy 270.880216 123.495477) + (xy 270.790479 123.36547) (xy 270.672236 123.260717) (xy 270.672234 123.260716) (xy 270.672233 123.260715) + (xy 270.532361 123.187303) (xy 270.378982 123.1495) (xy 270.378981 123.1495) (xy 270.221011 123.1495) + (xy 270.22101 123.1495) (xy 270.06763 123.187303) (xy 269.927758 123.260715) (xy 269.855759 123.3245) + (xy 269.820316 123.3559) (xy 269.809512 123.365471) (xy 269.719777 123.495475) (xy 269.719776 123.495476) + (xy 269.663758 123.643181) (xy 269.644718 123.799999) (xy 267.691078 123.799999) (xy 267.660425 123.766701) + (xy 267.584794 123.684544) (xy 267.584793 123.684543) (xy 267.584791 123.684541) (xy 267.584787 123.684538) + (xy 267.404909 123.544533) (xy 267.4049 123.544527) (xy 267.204432 123.43604) (xy 267.204429 123.436039) + (xy 267.204426 123.436037) (xy 267.20442 123.436035) (xy 267.204418 123.436034) (xy 266.988826 123.36202) + (xy 266.820188 123.33388) (xy 266.763977 123.3245) (xy 266.536023 123.3245) (xy 266.491053 123.332004) + (xy 266.311173 123.36202) (xy 266.095581 123.436034) (xy 266.095567 123.43604) (xy 265.895099 123.544527) + (xy 265.89509 123.544533) (xy 265.715212 123.684538) (xy 265.715208 123.684541) (xy 265.560814 123.852257) + (xy 265.436137 124.043091) (xy 265.344569 124.251844) (xy 265.28861 124.47282) (xy 265.288608 124.472831) + (xy 265.269786 124.699993) (xy 265.269786 124.700006) (xy 265.288608 124.927168) (xy 265.28861 124.927176) + (xy 265.335654 125.112946) (xy 265.333029 125.182767) (xy 265.293073 125.240084) (xy 265.228472 125.266701) + (xy 265.159736 125.254167) (xy 265.124219 125.227371) (xy 265.11903 125.221734) (xy 265.084794 125.184544) + (xy 265.084789 125.18454) (xy 265.084787 125.184538) (xy 264.904909 125.044533) (xy 264.9049 125.044527) + (xy 264.704432 124.93604) (xy 264.704429 124.936039) (xy 264.704426 124.936037) (xy 264.70442 124.936035) + (xy 264.704418 124.936034) (xy 264.488826 124.86202) (xy 264.320188 124.83388) (xy 264.263977 124.8245) + (xy 264.036023 124.8245) (xy 263.991053 124.832004) (xy 263.811173 124.86202) (xy 263.595581 124.936034) + (xy 263.595567 124.93604) (xy 263.395099 125.044527) (xy 263.39509 125.044533) (xy 263.215212 125.184538) + (xy 263.215208 125.184541) (xy 263.060814 125.352257) (xy 262.936137 125.543091) (xy 262.844569 125.751844) + (xy 262.78861 125.97282) (xy 262.788608 125.972831) (xy 262.773576 126.154254) (xy 262.755527 126.201026) + (xy 262.543679 126.201026) (xy 262.544472 126.198972) (xy 262.528544 126.169005) (xy 262.526424 126.154254) + (xy 262.511391 125.972831) (xy 262.511389 125.97282) (xy 262.45543 125.751844) (xy 262.363862 125.543091) + (xy 262.239185 125.352257) (xy 262.154914 125.260715) (xy 262.084794 125.184544) (xy 262.084793 125.184543) + (xy 262.084791 125.184541) (xy 262.084787 125.184538) (xy 261.904909 125.044533) (xy 261.9049 125.044527) + (xy 261.704432 124.93604) (xy 261.704429 124.936039) (xy 261.704426 124.936037) (xy 261.70442 124.936035) + (xy 261.704418 124.936034) (xy 261.488826 124.86202) (xy 261.320188 124.83388) (xy 261.263977 124.8245) + (xy 261.036023 124.8245) (xy 260.991053 124.832004) (xy 260.811173 124.86202) (xy 260.595581 124.936034) + (xy 260.595567 124.93604) (xy 260.395099 125.044527) (xy 260.39509 125.044533) (xy 260.215212 125.184538) + (xy 260.215207 125.184543) (xy 260.175779 125.227372) (xy 260.115892 125.263361) (xy 260.046053 125.26126) + (xy 259.988438 125.221734) (xy 259.961338 125.157334) (xy 259.964346 125.112946) (xy 260.011387 124.927188) + (xy 260.011389 124.927179) (xy 260.01139 124.927176) (xy 260.013763 124.898538) (xy 260.030214 124.700006) + (xy 260.030214 124.699993) (xy 260.011391 124.472831) (xy 260.011387 124.472811) (xy 259.964346 124.287053) + (xy 259.96697 124.217233) (xy 260.006926 124.159915) (xy 260.071527 124.133298) (xy 260.140263 124.145832) + (xy 260.17578 124.172628) (xy 260.215206 124.215456) (xy 260.215209 124.215458) (xy 260.215212 124.215461) + (xy 260.39509 124.355466) (xy 260.395094 124.355469) (xy 260.395096 124.35547) (xy 260.395099 124.355472) + (xy 260.404791 124.360717) (xy 260.595574 124.463963) (xy 260.707529 124.502397) (xy 260.811173 124.537979) + (xy 260.811175 124.537979) (xy 260.811177 124.53798) (xy 261.036023 124.5755) (xy 261.036024 124.5755) + (xy 261.263976 124.5755) (xy 261.263977 124.5755) (xy 261.488823 124.53798) (xy 261.704426 124.463963) + (xy 261.904906 124.355469) (xy 262.084794 124.215456) (xy 262.239183 124.047745) (xy 262.363862 123.856909) + (xy 262.45543 123.648155) (xy 262.51139 123.427176) (xy 262.511391 123.427168) (xy 262.530214 123.200006) + (xy 262.530214 123.199993) (xy 262.511391 122.972831) (xy 262.511389 122.97282) (xy 262.45543 122.751844) + (xy 262.363862 122.543091) (xy 262.239185 122.352257) (xy 262.084791 122.184541) (xy 262.084787 122.184538) + (xy 261.904909 122.044533) (xy 261.9049 122.044527) (xy 261.704432 121.93604) (xy 261.704429 121.936039) + (xy 261.704426 121.936037) (xy 261.70442 121.936035) (xy 261.704418 121.936034) (xy 261.488826 121.86202) + (xy 261.320188 121.83388) (xy 261.263977 121.8245) (xy 261.036023 121.8245) (xy 260.991053 121.832004) + (xy 260.811173 121.86202) (xy 260.595581 121.936034) (xy 260.595567 121.93604) (xy 260.395099 122.044527) + (xy 260.39509 122.044533) (xy 260.215212 122.184538) (xy 260.215207 122.184543) (xy 260.175779 122.227372) + (xy 260.115892 122.263361) (xy 260.046053 122.26126) (xy 259.988438 122.221734) (xy 259.961338 122.157334) + (xy 259.964346 122.112946) (xy 260.011387 121.927188) (xy 260.011389 121.927179) (xy 260.01139 121.927176) + (xy 260.017223 121.856786) (xy 260.030214 121.700006) (xy 260.030214 121.699993) (xy 265.269786 121.699993) + (xy 265.269786 121.700006) (xy 265.288608 121.927168) (xy 265.28861 121.927179) (xy 265.344569 122.148155) + (xy 265.436137 122.356908) (xy 265.560814 122.547742) (xy 265.560817 122.547745) (xy 265.680966 122.678262) + (xy 265.715208 122.715458) (xy 265.715212 122.715461) (xy 265.839636 122.812304) (xy 265.895094 122.855469) + (xy 265.895096 122.85547) (xy 265.895099 122.855472) (xy 266.011646 122.918543) (xy 266.095574 122.963963) + (xy 266.172786 122.99047) (xy 266.311173 123.037979) (xy 266.311175 123.037979) (xy 266.311177 123.03798) + (xy 266.536023 123.0755) (xy 266.536024 123.0755) (xy 266.763976 123.0755) (xy 266.763977 123.0755) + (xy 266.988823 123.03798) (xy 267.204426 122.963963) (xy 267.404906 122.855469) (xy 267.584794 122.715456) + (xy 267.739183 122.547745) (xy 267.863862 122.356909) (xy 267.95543 122.148155) (xy 268.01139 121.927176) + (xy 268.017223 121.856786) (xy 268.030214 121.700006) (xy 268.030214 121.699993) (xy 268.030212 121.699967) + (xy 270.844722 121.699967) (xy 270.844722 121.699968) (xy 270.863762 121.856786) (xy 270.89505 121.939284) + (xy 270.91978 122.004491) (xy 271.009517 122.134498) (xy 271.12776 122.239251) (xy 271.127762 122.239252) + (xy 271.267634 122.312664) (xy 271.421014 122.350468) (xy 271.421015 122.350468) (xy 271.578985 122.350468) + (xy 271.732365 122.312664) (xy 271.87224 122.239251) (xy 271.990483 122.134498) (xy 272.08022 122.004491) + (xy 272.136237 121.856786) (xy 272.155278 121.699968) (xy 272.147333 121.63453) (xy 272.136237 121.543149) + (xy 272.114992 121.487132) (xy 272.08022 121.395445) (xy 271.990483 121.265438) (xy 271.87224 121.160685) + (xy 271.872238 121.160684) (xy 271.872237 121.160683) (xy 271.732365 121.087271) (xy 271.578986 121.049468) + (xy 271.578985 121.049468) (xy 271.421015 121.049468) (xy 271.421014 121.049468) (xy 271.267634 121.087271) + (xy 271.127762 121.160683) (xy 271.065933 121.215458) (xy 271.024861 121.251845) (xy 271.009516 121.265439) + (xy 270.919781 121.395443) (xy 270.91978 121.395444) (xy 270.863762 121.543149) (xy 270.844722 121.699967) + (xy 268.030212 121.699967) (xy 268.011391 121.472831) (xy 268.011389 121.47282) (xy 267.95543 121.251844) + (xy 267.863862 121.043091) (xy 267.739185 120.852257) (xy 267.651334 120.756826) (xy 267.584794 120.684544) + (xy 267.584793 120.684543) (xy 267.584791 120.684541) (xy 267.584787 120.684538) (xy 267.404909 120.544533) + (xy 267.4049 120.544527) (xy 267.204432 120.43604) (xy 267.204429 120.436039) (xy 267.204426 120.436037) + (xy 267.20442 120.436035) (xy 267.204418 120.436034) (xy 266.988826 120.36202) (xy 266.820188 120.33388) + (xy 266.763977 120.3245) (xy 266.536023 120.3245) (xy 266.491053 120.332004) (xy 266.311173 120.36202) + (xy 266.095581 120.436034) (xy 266.095567 120.43604) (xy 265.895099 120.544527) (xy 265.89509 120.544533) + (xy 265.715212 120.684538) (xy 265.715208 120.684541) (xy 265.560814 120.852257) (xy 265.436137 121.043091) + (xy 265.344569 121.251844) (xy 265.28861 121.47282) (xy 265.288608 121.472831) (xy 265.269786 121.699993) + (xy 260.030214 121.699993) (xy 260.011391 121.472831) (xy 260.011387 121.472811) (xy 259.964346 121.287053) + (xy 259.96697 121.217233) (xy 260.006926 121.159915) (xy 260.071527 121.133298) (xy 260.140263 121.145832) + (xy 260.17578 121.172628) (xy 260.215206 121.215456) (xy 260.215209 121.215458) (xy 260.215212 121.215461) + (xy 260.279424 121.265439) (xy 260.395094 121.355469) (xy 260.395096 121.35547) (xy 260.395099 121.355472) + (xy 260.468963 121.395445) (xy 260.595574 121.463963) (xy 260.707529 121.502397) (xy 260.811173 121.537979) + (xy 260.811175 121.537979) (xy 260.811177 121.53798) (xy 261.036023 121.5755) (xy 261.036024 121.5755) + (xy 261.263976 121.5755) (xy 261.263977 121.5755) (xy 261.488823 121.53798) (xy 261.704426 121.463963) + (xy 261.904906 121.355469) (xy 262.084794 121.215456) (xy 262.239183 121.047745) (xy 262.363862 120.856909) + (xy 262.45543 120.648155) (xy 262.51139 120.427176) (xy 262.519898 120.3245) (xy 262.530214 120.200006) + (xy 262.530214 120.199993) (xy 262.511391 119.972831) (xy 262.511389 119.97282) (xy 262.45543 119.751844) + (xy 262.363862 119.543091) (xy 262.239185 119.352257) (xy 262.084791 119.184541) (xy 262.084787 119.184538) + (xy 261.904909 119.044533) (xy 261.9049 119.044527) (xy 261.704432 118.93604) (xy 261.704429 118.936039) + (xy 261.704426 118.936037) (xy 261.70442 118.936035) (xy 261.704418 118.936034) (xy 261.488826 118.86202) + (xy 261.320188 118.83388) (xy 261.263977 118.8245) (xy 261.036023 118.8245) (xy 260.991053 118.832004) + (xy 260.811173 118.86202) (xy 260.595581 118.936034) (xy 260.595567 118.93604) (xy 260.395099 119.044527) + (xy 260.39509 119.044533) (xy 260.215212 119.184538) (xy 260.215207 119.184543) (xy 260.175779 119.227372) + (xy 260.115892 119.263361) (xy 260.046053 119.26126) (xy 259.988438 119.221734) (xy 259.961338 119.157334) + (xy 259.964346 119.112946) (xy 260.011387 118.927188) (xy 260.011389 118.927179) (xy 260.01139 118.927176) + (xy 260.019898 118.8245) (xy 260.030214 118.700006) (xy 260.030214 118.699993) (xy 265.269786 118.699993) + (xy 265.269786 118.700006) (xy 265.288608 118.927168) (xy 265.28861 118.927179) (xy 265.344569 119.148155) + (xy 265.436137 119.356908) (xy 265.560814 119.547742) (xy 265.560817 119.547745) (xy 265.680966 119.678262) + (xy 265.715208 119.715458) (xy 265.715212 119.715461) (xy 265.895094 119.855469) (xy 265.895096 119.85547) + (xy 265.895099 119.855472) (xy 266.010139 119.917728) (xy 266.095574 119.963963) (xy 266.163584 119.987311) + (xy 266.311173 120.037979) (xy 266.311175 120.037979) (xy 266.311177 120.03798) (xy 266.536023 120.0755) + (xy 266.536024 120.0755) (xy 266.763976 120.0755) (xy 266.763977 120.0755) (xy 266.988823 120.03798) + (xy 267.204426 119.963963) (xy 267.404906 119.855469) (xy 267.584794 119.715456) (xy 267.739183 119.547745) + (xy 267.863862 119.356909) (xy 267.95543 119.148155) (xy 268.01139 118.927176) (xy 268.019898 118.8245) + (xy 268.030214 118.700006) (xy 268.030214 118.699993) (xy 268.011391 118.472831) (xy 268.011389 118.47282) + (xy 267.95543 118.251844) (xy 267.863862 118.043091) (xy 267.739185 117.852257) (xy 267.660425 117.766701) + (xy 267.584794 117.684544) (xy 267.584793 117.684543) (xy 267.584791 117.684541) (xy 267.584787 117.684538) + (xy 267.404909 117.544533) (xy 267.4049 117.544527) (xy 267.204432 117.43604) (xy 267.204429 117.436039) + (xy 267.204426 117.436037) (xy 267.20442 117.436035) (xy 267.204418 117.436034) (xy 266.988826 117.36202) + (xy 266.820188 117.33388) (xy 266.763977 117.3245) (xy 266.536023 117.3245) (xy 266.491053 117.332004) + (xy 266.311173 117.36202) (xy 266.095581 117.436034) (xy 266.095567 117.43604) (xy 265.895099 117.544527) + (xy 265.89509 117.544533) (xy 265.715212 117.684538) (xy 265.715208 117.684541) (xy 265.560814 117.852257) + (xy 265.436137 118.043091) (xy 265.344569 118.251844) (xy 265.28861 118.47282) (xy 265.288608 118.472831) + (xy 265.269786 118.699993) (xy 260.030214 118.699993) (xy 260.011391 118.472831) (xy 260.011387 118.472811) + (xy 259.964346 118.287053) (xy 259.96697 118.217233) (xy 260.006926 118.159915) (xy 260.071527 118.133298) + (xy 260.140263 118.145832) (xy 260.17578 118.172628) (xy 260.215206 118.215456) (xy 260.215209 118.215458) + (xy 260.215212 118.215461) (xy 260.363696 118.331031) (xy 260.395094 118.355469) (xy 260.395096 118.35547) + (xy 260.395099 118.355472) (xy 260.511646 118.418543) (xy 260.595574 118.463963) (xy 260.707529 118.502397) + (xy 260.811173 118.537979) (xy 260.811175 118.537979) (xy 260.811177 118.53798) (xy 261.036023 118.5755) + (xy 261.036024 118.5755) (xy 261.263976 118.5755) (xy 261.263977 118.5755) (xy 261.488823 118.53798) + (xy 261.704426 118.463963) (xy 261.904906 118.355469) (xy 262.084794 118.215456) (xy 262.239183 118.047745) + (xy 262.363862 117.856909) (xy 262.45543 117.648155) (xy 262.51139 117.427176) (xy 262.523958 117.2755) + (xy 262.530214 117.200006) (xy 262.530214 117.199993) (xy 262.511391 116.972831) (xy 262.511389 116.97282) + (xy 262.45543 116.751844) (xy 262.363862 116.543091) (xy 262.239185 116.352257) (xy 262.12422 116.227372) + (xy 262.084794 116.184544) (xy 262.084793 116.184543) (xy 262.084791 116.184541) (xy 262.084787 116.184538) (xy 261.904909 116.044533) (xy 261.9049 116.044527) (xy 261.704432 115.93604) (xy 261.704429 115.936039) (xy 261.704426 115.936037) (xy 261.70442 115.936035) (xy 261.704418 115.936034) (xy 261.488826 115.86202) (xy 261.320188 115.83388) (xy 261.263977 115.8245) (xy 261.036023 115.8245) (xy 260.991053 115.832004) (xy 260.811173 115.86202) (xy 260.595581 115.936034) (xy 260.595567 115.93604) (xy 260.395099 116.044527) (xy 260.39509 116.044533) (xy 260.215212 116.184538) (xy 260.215207 116.184543) (xy 260.175779 116.227372) (xy 260.115892 116.263361) (xy 260.046053 116.26126) (xy 259.988438 116.221734) (xy 259.961338 116.157334) - (xy 259.964346 116.112946) (xy 259.976599 116.064563) (xy 260.01139 115.927176) (xy 260.01221 115.917279) + (xy 259.964346 116.112946) (xy 259.976599 116.064563) (xy 260.01139 115.927176) (xy 260.011391 115.927168) (xy 260.030214 115.700006) (xy 260.030214 115.699993) (xy 265.269786 115.699993) (xy 265.269786 115.700006) (xy 265.288608 115.927168) (xy 265.28861 115.927179) (xy 265.344569 116.148155) (xy 265.436137 116.356908) (xy 265.560814 116.547742) (xy 265.560817 116.547745) (xy 265.680966 116.678262) (xy 265.715208 116.715458) @@ -167931,28 +172391,30 @@ (xy 266.311173 117.037979) (xy 266.311175 117.037979) (xy 266.311177 117.03798) (xy 266.536023 117.0755) (xy 266.536024 117.0755) (xy 266.763976 117.0755) (xy 266.763977 117.0755) (xy 266.988823 117.03798) (xy 267.204426 116.963963) (xy 267.404906 116.855469) (xy 267.584794 116.715456) (xy 267.739183 116.547745) - (xy 267.863862 116.356909) (xy 267.95543 116.148155) (xy 268.01139 115.927176) (xy 268.01221 115.917279) + (xy 267.863862 116.356909) (xy 267.95543 116.148155) (xy 268.01139 115.927176) (xy 268.011391 115.927168) (xy 268.030214 115.700006) (xy 268.030214 115.699993) (xy 268.011391 115.472831) (xy 268.011389 115.47282) - (xy 267.95543 115.251844) (xy 267.863862 115.043091) (xy 267.739185 114.852257) (xy 267.584791 114.684541) - (xy 267.584787 114.684538) (xy 267.404909 114.544533) (xy 267.4049 114.544527) (xy 267.204432 114.43604) - (xy 267.204429 114.436039) (xy 267.204426 114.436037) (xy 267.20442 114.436035) (xy 267.204418 114.436034) - (xy 266.988826 114.36202) (xy 266.820188 114.33388) (xy 266.763977 114.3245) (xy 266.536023 114.3245) - (xy 266.491053 114.332004) (xy 266.311173 114.36202) (xy 266.095581 114.436034) (xy 266.095567 114.43604) - (xy 265.895099 114.544527) (xy 265.89509 114.544533) (xy 265.715212 114.684538) (xy 265.715208 114.684541) - (xy 265.560814 114.852257) (xy 265.436137 115.043091) (xy 265.344569 115.251844) (xy 265.28861 115.47282) - (xy 265.288608 115.472831) (xy 265.269786 115.699993) (xy 260.030214 115.699993) (xy 260.011391 115.472831) - (xy 260.011389 115.47282) (xy 259.95543 115.251844) (xy 259.863862 115.043091) (xy 259.739185 114.852257) - (xy 259.584791 114.684541) (xy 259.584787 114.684538) (xy 259.404909 114.544533) (xy 259.4049 114.544527) - (xy 259.204432 114.43604) (xy 259.204429 114.436039) (xy 259.204426 114.436037) (xy 259.20442 114.436035) - (xy 259.204418 114.436034) (xy 258.988826 114.36202) (xy 258.820188 114.33388) (xy 258.763977 114.3245) - (xy 258.536023 114.3245) (xy 258.491053 114.332004) (xy 258.311173 114.36202) (xy 258.095581 114.436034) - (xy 258.095567 114.43604) (xy 257.895099 114.544527) (xy 257.89509 114.544533) (xy 257.715212 114.684538) - (xy 257.715208 114.684541) (xy 257.560814 114.852257) (xy 257.436137 115.043091) (xy 257.344569 115.251844) - (xy 257.28861 115.47282) (xy 257.288608 115.472831) (xy 257.269786 115.699993) (xy 182.080499 115.699993) - (xy 182.080499 114.600326) (xy 182.080499 114.600323) (xy 182.080498 114.600321) (xy 182.080434 114.599999) - (xy 187.544722 114.599999) (xy 187.544722 114.6) (xy 187.563762 114.756818) (xy 187.61978 114.904523) - (xy 187.709517 115.03453) (xy 187.82776 115.139283) (xy 187.827762 115.139284) (xy 187.967634 115.212696) - (xy 188.121014 115.2505) (xy 188.121015 115.2505) (xy 188.278985 115.2505) (xy 188.432365 115.212696) + (xy 267.95543 115.251844) (xy 267.863862 115.043091) (xy 267.739185 114.852257) (xy 267.648888 114.754169) + (xy 267.584794 114.684544) (xy 267.584793 114.684543) (xy 267.584791 114.684541) (xy 267.584787 114.684538) + (xy 267.404909 114.544533) (xy 267.4049 114.544527) (xy 267.204432 114.43604) (xy 267.204429 114.436039) + (xy 267.204426 114.436037) (xy 267.20442 114.436035) (xy 267.204418 114.436034) (xy 266.988826 114.36202) + (xy 266.820188 114.33388) (xy 266.763977 114.3245) (xy 266.536023 114.3245) (xy 266.491053 114.332004) + (xy 266.311173 114.36202) (xy 266.095581 114.436034) (xy 266.095567 114.43604) (xy 265.895099 114.544527) + (xy 265.89509 114.544533) (xy 265.715212 114.684538) (xy 265.715208 114.684541) (xy 265.560814 114.852257) + (xy 265.436137 115.043091) (xy 265.344569 115.251844) (xy 265.28861 115.47282) (xy 265.288608 115.472831) + (xy 265.269786 115.699993) (xy 260.030214 115.699993) (xy 260.011391 115.472831) (xy 260.011389 115.47282) + (xy 259.95543 115.251844) (xy 259.863862 115.043091) (xy 259.739185 114.852257) (xy 259.648888 114.754169) + (xy 259.584794 114.684544) (xy 259.584793 114.684543) (xy 259.584791 114.684541) (xy 259.584787 114.684538) + (xy 259.404909 114.544533) (xy 259.4049 114.544527) (xy 259.204432 114.43604) (xy 259.204429 114.436039) + (xy 259.204426 114.436037) (xy 259.20442 114.436035) (xy 259.204418 114.436034) (xy 258.988826 114.36202) + (xy 258.820188 114.33388) (xy 258.763977 114.3245) (xy 258.536023 114.3245) (xy 258.491053 114.332004) + (xy 258.311173 114.36202) (xy 258.095581 114.436034) (xy 258.095567 114.43604) (xy 257.895099 114.544527) + (xy 257.89509 114.544533) (xy 257.715212 114.684538) (xy 257.715208 114.684541) (xy 257.560814 114.852257) + (xy 257.436137 115.043091) (xy 257.344569 115.251844) (xy 257.28861 115.47282) (xy 257.288608 115.472831) + (xy 257.269786 115.699993) (xy 182.080499 115.699993) (xy 182.080499 114.600326) (xy 182.080499 114.600323) + (xy 182.080498 114.600321) (xy 182.080434 114.599999) (xy 187.544722 114.599999) (xy 187.544722 114.6) + (xy 187.563762 114.756818) (xy 187.593685 114.835717) (xy 187.61978 114.904523) (xy 187.709517 115.03453) + (xy 187.82776 115.139283) (xy 187.827762 115.139284) (xy 187.967634 115.212696) (xy 188.121014 115.2505) + (xy 188.121015 115.2505) (xy 188.278985 115.2505) (xy 188.432365 115.212696) (xy 188.440966 115.208182) (xy 188.57224 115.139283) (xy 188.690483 115.03453) (xy 188.78022 114.904523) (xy 188.836237 114.756818) (xy 188.855278 114.6) (xy 188.848543 114.544527) (xy 188.836237 114.443181) (xy 188.791227 114.3245) (xy 188.78022 114.295477) (xy 188.690483 114.16547) (xy 188.57224 114.060717) (xy 188.572238 114.060716) @@ -167970,17 +172432,17 @@ (xy 166.174241 114.754169) (xy 166.174238 114.754172) (xy 166.011429 114.931029) (xy 166.011426 114.931033) (xy 165.87995 115.13227) (xy 165.783388 115.35241) (xy 165.724378 115.58544) (xy 165.704528 115.824994) (xy 134.173027 115.824994) (xy 134.190483 115.80953) (xy 134.28022 115.679523) (xy 134.336237 115.531818) - (xy 134.355278 115.375) (xy 134.346172 115.3) (xy 134.336237 115.218181) (xy 134.306315 115.139284) + (xy 134.355278 115.375) (xy 134.340325 115.251845) (xy 134.336237 115.218181) (xy 134.306315 115.139284) (xy 134.28022 115.070477) (xy 134.190483 114.94047) (xy 134.07224 114.835717) (xy 134.072238 114.835716) (xy 134.072237 114.835715) (xy 133.932365 114.762303) (xy 133.778986 114.7245) (xy 133.778985 114.7245) (xy 133.621015 114.7245) (xy 133.621014 114.7245) (xy 133.467634 114.762303) (xy 133.327762 114.835715) (xy 133.209516 114.940471) (xy 133.119781 115.070475) (xy 133.11978 115.070476) (xy 133.063762 115.218181) - (xy 133.044722 115.374999) (xy 115.046172 115.374999) (xy 115.055278 115.3) (xy 115.045344 115.218181) - (xy 115.036237 115.143181) (xy 115.008663 115.070475) (xy 114.98022 114.995477) (xy 114.890483 114.86547) - (xy 114.77224 114.760717) (xy 114.772238 114.760716) (xy 114.772237 114.760715) (xy 114.632365 114.687303) - (xy 114.478986 114.6495) (xy 114.478985 114.6495) (xy 114.321015 114.6495) (xy 114.321014 114.6495) - (xy 114.167634 114.687303) (xy 114.027762 114.760715) (xy 113.909516 114.865471) (xy 113.819781 114.995475) - (xy 113.81978 114.995476) (xy 113.763762 115.143181) (xy 113.744722 115.299999) (xy 112.3005 115.299999) + (xy 133.044722 115.374999) (xy 115.504064 115.374999) (xy 115.505278 115.365) (xy 115.491539 115.251844) + (xy 115.486237 115.208181) (xy 115.434012 115.070476) (xy 115.43022 115.060477) (xy 115.340483 114.93047) + (xy 115.22224 114.825717) (xy 115.222238 114.825716) (xy 115.222237 114.825715) (xy 115.082365 114.752303) + (xy 114.928986 114.7145) (xy 114.928985 114.7145) (xy 114.771015 114.7145) (xy 114.771014 114.7145) + (xy 114.617634 114.752303) (xy 114.477762 114.825715) (xy 114.359516 114.930471) (xy 114.269781 115.060475) + (xy 114.26978 115.060476) (xy 114.213762 115.208181) (xy 114.194722 115.364999) (xy 112.3005 115.364999) (xy 112.3005 111.085321) (xy 114.6395 111.085321) (xy 114.6395 112.634678) (xy 114.654032 112.707735) (xy 114.654033 112.707739) (xy 114.654034 112.70774) (xy 114.709399 112.790601) (xy 114.79226 112.845966) (xy 114.792264 112.845967) (xy 114.865321 112.860499) (xy 114.865324 112.8605) (xy 114.865326 112.8605) @@ -168021,12 +172483,11 @@ (xy 116.570601 110.929399) (xy 116.48774 110.874034) (xy 116.487739 110.874033) (xy 116.487735 110.874032) (xy 116.414677 110.8595) (xy 116.414674 110.8595) (xy 114.865326 110.8595) (xy 114.865323 110.8595) (xy 114.792264 110.874032) (xy 114.79226 110.874033) (xy 114.709399 110.929399) (xy 114.654033 111.01226) - (xy 114.654032 111.012264) (xy 114.6395 111.085321) (xy 112.3005 111.085321) (xy 112.3005 109.309999) - (xy 112.804722 109.309999) (xy 112.804722 109.31) (xy 112.823762 109.466818) (xy 112.874272 109.599999) - (xy 112.87978 109.614523) (xy 112.969517 109.74453) (xy 113.08776 109.849283) (xy 113.087762 109.849284) - (xy 113.227634 109.922696) (xy 113.381014 109.9605) (xy 113.381015 109.9605) (xy 113.538985 109.9605) - (xy 113.692365 109.922696) (xy 113.72699 109.904523) (xy 113.83224 109.849283) (xy 113.950483 109.74453) - (xy 114.04022 109.614523) (xy 114.045728 109.599999) (xy 131.044722 109.599999) (xy 131.044722 109.6) + (xy 114.654032 111.012264) (xy 114.6395 111.085321) (xy 112.3005 111.085321) (xy 112.3005 108.999999) + (xy 112.804722 108.999999) (xy 112.804722 109) (xy 112.823762 109.156818) (xy 112.876349 109.295476) + (xy 112.87978 109.304523) (xy 112.969517 109.43453) (xy 113.08776 109.539283) (xy 113.087762 109.539284) + (xy 113.227634 109.612696) (xy 113.381014 109.6505) (xy 113.381015 109.6505) (xy 113.538985 109.6505) + (xy 113.692365 109.612696) (xy 113.716557 109.599999) (xy 131.044722 109.599999) (xy 131.044722 109.6) (xy 131.063762 109.756818) (xy 131.11978 109.904523) (xy 131.209517 110.03453) (xy 131.32776 110.139283) (xy 131.327762 110.139284) (xy 131.467634 110.212696) (xy 131.621014 110.2505) (xy 131.621015 110.2505) (xy 131.778985 110.2505) (xy 131.932365 110.212696) (xy 131.950648 110.2031) (xy 132.07224 110.139283) @@ -168034,320 +172495,320 @@ (xy 132.336237 109.443182) (xy 132.28022 109.295477) (xy 132.190483 109.16547) (xy 132.07224 109.060717) (xy 132.072238 109.060716) (xy 132.072237 109.060715) (xy 131.932365 108.987303) (xy 131.778986 108.9495) (xy 131.778985 108.9495) (xy 131.621015 108.9495) (xy 131.621014 108.9495) (xy 131.467634 108.987303) - (xy 131.327762 109.060715) (xy 131.32776 109.060717) (xy 131.223388 109.153182) (xy 131.209516 109.165471) - (xy 131.119781 109.295475) (xy 131.11978 109.295476) (xy 131.063762 109.443181) (xy 131.044722 109.599999) - (xy 114.045728 109.599999) (xy 114.096237 109.466818) (xy 114.115278 109.31) (xy 114.113515 109.295476) - (xy 114.096237 109.153181) (xy 114.067843 109.078313) (xy 114.04022 109.005477) (xy 113.950483 108.87547) - (xy 113.83224 108.770717) (xy 113.832238 108.770716) (xy 113.832237 108.770715) (xy 113.692365 108.697303) - (xy 113.538986 108.6595) (xy 113.538985 108.6595) (xy 113.381015 108.6595) (xy 113.381014 108.6595) - (xy 113.227634 108.697303) (xy 113.087762 108.770715) (xy 112.969516 108.875471) (xy 112.879781 109.005475) - (xy 112.87978 109.005476) (xy 112.823762 109.153181) (xy 112.804722 109.309999) (xy 112.3005 109.309999) - (xy 112.3005 108.179999) (xy 127.984722 108.179999) (xy 127.984722 108.18) (xy 128.003762 108.336818) - (xy 128.034395 108.417589) (xy 128.05978 108.484523) (xy 128.149517 108.61453) (xy 128.26776 108.719283) + (xy 131.327762 109.060715) (xy 131.209516 109.165471) (xy 131.119781 109.295475) (xy 131.11978 109.295476) + (xy 131.063762 109.443181) (xy 131.044722 109.599999) (xy 113.716557 109.599999) (xy 113.83224 109.539283) + (xy 113.950483 109.43453) (xy 114.04022 109.304523) (xy 114.096237 109.156818) (xy 114.115278 109) + (xy 114.113737 108.987304) (xy 114.096237 108.843181) (xy 114.074992 108.787164) (xy 114.04022 108.695477) + (xy 113.950483 108.56547) (xy 113.83224 108.460717) (xy 113.832238 108.460716) (xy 113.832237 108.460715) + (xy 113.692365 108.387303) (xy 113.538986 108.3495) (xy 113.538985 108.3495) (xy 113.381015 108.3495) + (xy 113.381014 108.3495) (xy 113.227634 108.387303) (xy 113.087762 108.460715) (xy 112.969516 108.565471) + (xy 112.879781 108.695475) (xy 112.87978 108.695476) (xy 112.823762 108.843181) (xy 112.804722 108.999999) + (xy 112.3005 108.999999) (xy 112.3005 108.179999) (xy 127.984722 108.179999) (xy 127.984722 108.18) + (xy 128.003762 108.336818) (xy 128.05978 108.484523) (xy 128.149517 108.61453) (xy 128.26776 108.719283) (xy 128.267762 108.719284) (xy 128.407634 108.792696) (xy 128.561014 108.8305) (xy 128.561015 108.8305) - (xy 128.718985 108.8305) (xy 128.872365 108.792696) (xy 128.914242 108.770717) (xy 129.01224 108.719283) - (xy 129.130483 108.61453) (xy 129.22022 108.484523) (xy 129.276237 108.336818) (xy 129.295278 108.18) - (xy 129.276237 108.023182) (xy 129.246584 107.944994) (xy 165.704529 107.944994) (xy 165.704529 107.945005) - (xy 165.724379 108.184559) (xy 165.783389 108.417589) (xy 165.879951 108.637729) (xy 165.981197 108.792696) - (xy 166.011429 108.838969) (xy 166.174236 109.015825) (xy 166.174239 109.015827) (xy 166.174242 109.01583) - (xy 166.363924 109.163466) (xy 166.36393 109.16347) (xy 166.363933 109.163472) (xy 166.575344 109.277882) - (xy 166.575347 109.277883) (xy 166.802699 109.355933) (xy 166.802701 109.355933) (xy 166.802703 109.355934) - (xy 167.039808 109.3955) (xy 167.039809 109.3955) (xy 167.280191 109.3955) (xy 167.280192 109.3955) - (xy 167.517297 109.355934) (xy 167.744656 109.277882) (xy 167.956067 109.163472) (xy 168.145764 109.015825) - (xy 168.308571 108.838969) (xy 168.440049 108.637728) (xy 168.53661 108.417591) (xy 168.59562 108.184563) - (xy 168.615471 107.945) (xy 168.615471 107.944994) (xy 179.174529 107.944994) (xy 179.174529 107.945005) - (xy 179.194379 108.184559) (xy 179.253389 108.417589) (xy 179.349951 108.637729) (xy 179.451197 108.792696) - (xy 179.481429 108.838969) (xy 179.644236 109.015825) (xy 179.644239 109.015827) (xy 179.644242 109.01583) - (xy 179.833924 109.163466) (xy 179.83393 109.16347) (xy 179.833933 109.163472) (xy 180.045344 109.277882) - (xy 180.045347 109.277883) (xy 180.272699 109.355933) (xy 180.272701 109.355933) (xy 180.272703 109.355934) - (xy 180.509808 109.3955) (xy 180.509809 109.3955) (xy 180.750191 109.3955) (xy 180.750192 109.3955) - (xy 180.987297 109.355934) (xy 181.214656 109.277882) (xy 181.426067 109.163472) (xy 181.615764 109.015825) - (xy 181.778571 108.838969) (xy 181.910049 108.637728) (xy 182.00661 108.417591) (xy 182.030779 108.322149) - (xy 271.1995 108.322149) (xy 271.1995 108.57785) (xy 271.218121 108.719283) (xy 271.232874 108.83134) - (xy 271.282307 109.015827) (xy 271.29905 109.078312) (xy 271.299053 109.078322) (xy 271.396894 109.314531) - (xy 271.396899 109.314542) (xy 271.524734 109.535957) (xy 271.524745 109.535973) (xy 271.680388 109.738811) - (xy 271.680394 109.738818) (xy 271.861181 109.919605) (xy 271.861188 109.919611) (xy 271.914476 109.9605) - (xy 272.064035 110.075261) (xy 272.064042 110.075265) (xy 272.285457 110.2031) (xy 272.285462 110.203102) - (xy 272.285465 110.203104) (xy 272.521687 110.30095) (xy 272.76866 110.367126) (xy 273.022157 110.4005) - (xy 273.022164 110.4005) (xy 273.277836 110.4005) (xy 273.277843 110.4005) (xy 273.53134 110.367126) - (xy 273.778313 110.30095) (xy 274.014535 110.203104) (xy 274.235965 110.075261) (xy 274.438813 109.91961) - (xy 274.61961 109.738813) (xy 274.775261 109.535965) (xy 274.903104 109.314535) (xy 275.00095 109.078313) - (xy 275.067126 108.83134) (xy 275.1005 108.577843) (xy 275.1005 108.322157) (xy 275.067126 108.06866) - (xy 275.00095 107.821687) (xy 274.903104 107.585465) (xy 274.903102 107.585462) (xy 274.9031 107.585457) - (xy 274.775265 107.364042) (xy 274.775261 107.364035) (xy 274.61961 107.161187) (xy 274.619605 107.161181) - (xy 274.438818 106.980394) (xy 274.438811 106.980388) (xy 274.235973 106.824745) (xy 274.235971 106.824743) - (xy 274.235965 106.824739) (xy 274.23596 106.824736) (xy 274.235957 106.824734) (xy 274.014542 106.696899) - (xy 274.014531 106.696894) (xy 273.778322 106.599053) (xy 273.778315 106.599051) (xy 273.778313 106.59905) - (xy 273.53134 106.532874) (xy 273.475007 106.525457) (xy 273.27785 106.4995) (xy 273.277843 106.4995) - (xy 273.022157 106.4995) (xy 273.022149 106.4995) (xy 272.796826 106.529165) (xy 272.76866 106.532874) - (xy 272.521687 106.59905) (xy 272.521677 106.599053) (xy 272.285468 106.696894) (xy 272.285457 106.696899) - (xy 272.064042 106.824734) (xy 272.064026 106.824745) (xy 271.861188 106.980388) (xy 271.861181 106.980394) - (xy 271.680394 107.161181) (xy 271.680388 107.161188) (xy 271.524745 107.364026) (xy 271.524734 107.364042) - (xy 271.396899 107.585457) (xy 271.396894 107.585468) (xy 271.299053 107.821677) (xy 271.29905 107.821687) - (xy 271.266009 107.945) (xy 271.232874 108.068661) (xy 271.1995 108.322149) (xy 182.030779 108.322149) - (xy 182.06562 108.184563) (xy 182.085471 107.945) (xy 182.06562 107.705437) (xy 182.00661 107.472409) - (xy 181.910049 107.252272) (xy 181.778571 107.051031) (xy 181.615764 106.874175) (xy 181.615759 106.874171) - (xy 181.615757 106.874169) (xy 181.426075 106.726533) (xy 181.426069 106.726529) (xy 181.214657 106.612118) - (xy 181.214652 106.612116) (xy 180.9873 106.534066) (xy 180.780155 106.4995) (xy 180.750192 106.4945) - (xy 180.509808 106.4945) (xy 180.479845 106.4995) (xy 180.272699 106.534066) (xy 180.045347 106.612116) - (xy 180.045342 106.612118) (xy 179.83393 106.726529) (xy 179.833924 106.726533) (xy 179.644242 106.874169) - (xy 179.644239 106.874172) (xy 179.48143 107.051029) (xy 179.481427 107.051033) (xy 179.349951 107.25227) - (xy 179.253389 107.47241) (xy 179.194379 107.70544) (xy 179.174529 107.944994) (xy 168.615471 107.944994) - (xy 168.59562 107.705437) (xy 168.53661 107.472409) (xy 168.440049 107.252272) (xy 168.308571 107.051031) - (xy 168.145764 106.874175) (xy 168.145759 106.874171) (xy 168.145757 106.874169) (xy 167.956075 106.726533) - (xy 167.956069 106.726529) (xy 167.744657 106.612118) (xy 167.744652 106.612116) (xy 167.5173 106.534066) - (xy 167.310155 106.4995) (xy 167.280192 106.4945) (xy 167.039808 106.4945) (xy 167.009845 106.4995) - (xy 166.802699 106.534066) (xy 166.575347 106.612116) (xy 166.575342 106.612118) (xy 166.36393 106.726529) - (xy 166.363924 106.726533) (xy 166.174242 106.874169) (xy 166.174239 106.874172) (xy 166.01143 107.051029) - (xy 166.011427 107.051033) (xy 165.879951 107.25227) (xy 165.783389 107.47241) (xy 165.724379 107.70544) - (xy 165.704529 107.944994) (xy 129.246584 107.944994) (xy 129.22022 107.875477) (xy 129.130483 107.74547) - (xy 129.01224 107.640717) (xy 129.012238 107.640716) (xy 129.012237 107.640715) (xy 128.872365 107.567303) - (xy 128.718986 107.5295) (xy 128.718985 107.5295) (xy 128.561015 107.5295) (xy 128.561014 107.5295) - (xy 128.407634 107.567303) (xy 128.267762 107.640715) (xy 128.149516 107.745471) (xy 128.059781 107.875475) - (xy 128.05978 107.875476) (xy 128.003762 108.023181) (xy 127.984722 108.179999) (xy 112.3005 108.179999) - (xy 112.3005 104.544994) (xy 165.704529 104.544994) (xy 165.704529 104.545005) (xy 165.724379 104.784559) - (xy 165.783389 105.017589) (xy 165.879951 105.237729) (xy 166.011427 105.438966) (xy 166.011429 105.438969) - (xy 166.174236 105.615825) (xy 166.174239 105.615827) (xy 166.174242 105.61583) (xy 166.363924 105.763466) - (xy 166.36393 105.76347) (xy 166.363933 105.763472) (xy 166.575344 105.877882) (xy 166.575347 105.877883) - (xy 166.802699 105.955933) (xy 166.802701 105.955933) (xy 166.802703 105.955934) (xy 167.039808 105.9955) - (xy 167.039809 105.9955) (xy 167.280191 105.9955) (xy 167.280192 105.9955) (xy 167.517297 105.955934) - (xy 167.744656 105.877882) (xy 167.956067 105.763472) (xy 168.145764 105.615825) (xy 168.308571 105.438969) - (xy 168.440049 105.237728) (xy 168.53661 105.017591) (xy 168.59562 104.784563) (xy 168.615471 104.545) - (xy 168.59562 104.305437) (xy 168.53661 104.072409) (xy 168.440049 103.852272) (xy 168.308571 103.651031) - (xy 168.145764 103.474175) (xy 168.145759 103.474171) (xy 168.145757 103.474169) (xy 167.956075 103.326533) - (xy 167.956069 103.326529) (xy 167.944598 103.320321) (xy 179.1795 103.320321) (xy 179.1795 105.769678) - (xy 179.194032 105.842735) (xy 179.194033 105.842739) (xy 179.194034 105.84274) (xy 179.249399 105.925601) - (xy 179.33226 105.980966) (xy 179.332264 105.980967) (xy 179.405321 105.995499) (xy 179.405324 105.9955) - (xy 179.405326 105.9955) (xy 181.854676 105.9955) (xy 181.854677 105.995499) (xy 181.92774 105.980966) - (xy 182.010601 105.925601) (xy 182.065966 105.84274) (xy 182.0805 105.769674) (xy 182.0805 103.320326) - (xy 182.0805 103.320323) (xy 182.080499 103.320321) (xy 182.065967 103.247264) (xy 182.065966 103.24726) - (xy 182.042484 103.212116) (xy 182.010601 103.164399) (xy 181.92774 103.109034) (xy 181.927739 103.109033) - (xy 181.927735 103.109032) (xy 181.854677 103.0945) (xy 181.854674 103.0945) (xy 179.405326 103.0945) - (xy 179.405323 103.0945) (xy 179.332264 103.109032) (xy 179.33226 103.109033) (xy 179.249399 103.164399) - (xy 179.194033 103.24726) (xy 179.194032 103.247264) (xy 179.1795 103.320321) (xy 167.944598 103.320321) - (xy 167.744657 103.212118) (xy 167.744652 103.212116) (xy 167.5173 103.134066) (xy 167.339468 103.104391) - (xy 167.280192 103.0945) (xy 167.039808 103.0945) (xy 166.992387 103.102413) (xy 166.802699 103.134066) - (xy 166.575347 103.212116) (xy 166.575342 103.212118) (xy 166.36393 103.326529) (xy 166.363924 103.326533) - (xy 166.174242 103.474169) (xy 166.174239 103.474172) (xy 166.01143 103.651029) (xy 166.011427 103.651033) - (xy 165.879951 103.85227) (xy 165.783389 104.07241) (xy 165.724379 104.30544) (xy 165.704529 104.544994) - (xy 112.3005 104.544994) (xy 112.3005 102.299999) (xy 122.034722 102.299999) (xy 122.034722 102.3) - (xy 122.053762 102.456818) (xy 122.10978 102.604523) (xy 122.199517 102.73453) (xy 122.31776 102.839283) - (xy 122.317762 102.839284) (xy 122.457634 102.912696) (xy 122.611014 102.9505) (xy 122.611015 102.9505) - (xy 122.768985 102.9505) (xy 122.922365 102.912696) (xy 123.06224 102.839283) (xy 123.180483 102.73453) - (xy 123.27022 102.604523) (xy 123.326237 102.456818) (xy 123.345278 102.3) (xy 123.326237 102.143182) - (xy 123.27022 101.995477) (xy 123.180483 101.86547) (xy 123.06224 101.760717) (xy 123.062238 101.760716) - (xy 123.062237 101.760715) (xy 122.922365 101.687303) (xy 122.768986 101.6495) (xy 122.768985 101.6495) - (xy 122.611015 101.6495) (xy 122.611014 101.6495) (xy 122.457634 101.687303) (xy 122.317762 101.760715) - (xy 122.199516 101.865471) (xy 122.109781 101.995475) (xy 122.10978 101.995476) (xy 122.053762 102.143181) - (xy 122.034722 102.299999) (xy 112.3005 102.299999) (xy 112.3005 101.199996) (xy 200.544719 101.199996) - (xy 200.544719 101.199997) (xy 200.563759 101.356815) (xy 200.619777 101.50452) (xy 200.709514 101.634527) - (xy 200.827757 101.73928) (xy 200.827759 101.739281) (xy 200.967631 101.812693) (xy 201.121011 101.850497) - (xy 201.121012 101.850497) (xy 201.278982 101.850497) (xy 201.432362 101.812693) (xy 201.572237 101.73928) - (xy 201.69048 101.634527) (xy 201.780217 101.50452) (xy 201.836234 101.356815) (xy 201.855275 101.199997) - (xy 201.836234 101.043179) (xy 201.780217 100.895474) (xy 201.69048 100.765467) (xy 201.572237 100.660714) - (xy 201.572235 100.660713) (xy 201.572234 100.660712) (xy 201.432362 100.5873) (xy 201.278983 100.549497) - (xy 201.278982 100.549497) (xy 201.121012 100.549497) (xy 201.121011 100.549497) (xy 200.967631 100.5873) - (xy 200.827759 100.660712) (xy 200.709513 100.765468) (xy 200.619778 100.895472) (xy 200.619777 100.895473) - (xy 200.563759 101.043178) (xy 200.544719 101.199996) (xy 112.3005 101.199996) (xy 112.3005 99.439999) - (xy 162.174722 99.439999) (xy 162.174722 99.44) (xy 162.193762 99.596818) (xy 162.247793 99.739283) - (xy 162.24978 99.744523) (xy 162.339517 99.87453) (xy 162.45776 99.979283) (xy 162.457762 99.979284) - (xy 162.597634 100.052696) (xy 162.751014 100.0905) (xy 162.751015 100.0905) (xy 162.908985 100.0905) - (xy 163.062365 100.052696) (xy 163.20224 99.979283) (xy 163.320483 99.87453) (xy 163.40644 99.749999) - (xy 199.094722 99.749999) (xy 199.094722 99.75) (xy 199.113762 99.906818) (xy 199.148548 99.998539) - (xy 199.16978 100.054523) (xy 199.259517 100.18453) (xy 199.37776 100.289283) (xy 199.377762 100.289284) - (xy 199.517634 100.362696) (xy 199.671014 100.4005) (xy 199.671015 100.4005) (xy 199.828985 100.4005) - (xy 199.982365 100.362696) (xy 200.12224 100.289283) (xy 200.240483 100.18453) (xy 200.33022 100.054523) - (xy 200.386237 99.906818) (xy 200.405278 99.75) (xy 200.386679 99.596818) (xy 200.386237 99.593181) - (xy 200.364992 99.537164) (xy 200.33022 99.445477) (xy 200.32644 99.44) (xy 257.874659 99.44) (xy 257.893975 99.636129) - (xy 257.893976 99.636132) (xy 257.947536 99.812696) (xy 257.951188 99.824733) (xy 258.044086 99.998532) - (xy 258.04409 99.998539) (xy 258.169116 100.150883) (xy 258.32146 100.275909) (xy 258.321467 100.275913) - (xy 258.495266 100.368811) (xy 258.495269 100.368811) (xy 258.495273 100.368814) (xy 258.683868 100.426024) - (xy 258.88 100.445341) (xy 259.076132 100.426024) (xy 259.264727 100.368814) (xy 259.438538 100.27591) - (xy 259.590883 100.150883) (xy 259.71591 99.998538) (xy 259.808814 99.824727) (xy 259.866024 99.636132) - (xy 259.885341 99.44) (xy 259.866024 99.243868) (xy 259.808814 99.055273) (xy 259.808811 99.055269) - (xy 259.808811 99.055266) (xy 259.715913 98.881467) (xy 259.715909 98.88146) (xy 259.590883 98.729116) - (xy 259.513149 98.665321) (xy 260.3795 98.665321) (xy 260.3795 100.214678) (xy 260.394032 100.287735) - (xy 260.394033 100.287739) (xy 260.412405 100.315235) (xy 260.449399 100.370601) (xy 260.494147 100.4005) - (xy 260.53226 100.425966) (xy 260.532264 100.425967) (xy 260.605321 100.440499) (xy 260.605324 100.4405) - (xy 260.605326 100.4405) (xy 262.154676 100.4405) (xy 262.154677 100.440499) (xy 262.22774 100.425966) - (xy 262.310601 100.370601) (xy 262.365966 100.28774) (xy 262.3805 100.214674) (xy 262.3805 99.199999) - (xy 264.544722 99.199999) (xy 264.544722 99.2) (xy 264.563762 99.356818) (xy 264.603084 99.460499) - (xy 264.61978 99.504523) (xy 264.709517 99.63453) (xy 264.82776 99.739283) (xy 264.827762 99.739284) - (xy 264.967634 99.812696) (xy 265.121014 99.8505) (xy 265.121015 99.8505) (xy 265.278985 99.8505) - (xy 265.432365 99.812696) (xy 265.57224 99.739283) (xy 265.690483 99.63453) (xy 265.78022 99.504523) - (xy 265.836237 99.356818) (xy 265.855278 99.2) (xy 265.847666 99.137304) (xy 265.836237 99.043181) - (xy 265.782207 98.900717) (xy 265.78022 98.895477) (xy 265.690483 98.76547) (xy 265.57224 98.660717) - (xy 265.572238 98.660716) (xy 265.572237 98.660715) (xy 265.432365 98.587303) (xy 265.278986 98.5495) - (xy 265.278985 98.5495) (xy 265.121015 98.5495) (xy 265.121014 98.5495) (xy 264.967634 98.587303) - (xy 264.827762 98.660715) (xy 264.709516 98.765471) (xy 264.619781 98.895475) (xy 264.61978 98.895476) - (xy 264.563762 99.043181) (xy 264.544722 99.199999) (xy 262.3805 99.199999) (xy 262.3805 98.665326) - (xy 262.3805 98.665323) (xy 262.380499 98.665321) (xy 262.365967 98.592264) (xy 262.365966 98.59226) - (xy 262.337395 98.5495) (xy 262.310601 98.509399) (xy 262.22774 98.454034) (xy 262.227739 98.454033) - (xy 262.227735 98.454032) (xy 262.154677 98.4395) (xy 262.154674 98.4395) (xy 260.605326 98.4395) - (xy 260.605323 98.4395) (xy 260.532264 98.454032) (xy 260.53226 98.454033) (xy 260.449399 98.509399) - (xy 260.394033 98.59226) (xy 260.394032 98.592264) (xy 260.3795 98.665321) (xy 259.513149 98.665321) - (xy 259.438539 98.60409) (xy 259.438532 98.604086) (xy 259.264733 98.511188) (xy 259.264727 98.511186) - (xy 259.076132 98.453976) (xy 259.076129 98.453975) (xy 258.88 98.434659) (xy 258.68387 98.453975) - (xy 258.495266 98.511188) (xy 258.321467 98.604086) (xy 258.32146 98.60409) (xy 258.169116 98.729116) - (xy 258.04409 98.88146) (xy 258.044086 98.881467) (xy 257.951188 99.055266) (xy 257.893975 99.24387) - (xy 257.874659 99.44) (xy 200.32644 99.44) (xy 200.240483 99.31547) (xy 200.12224 99.210717) (xy 200.122238 99.210716) - (xy 200.122237 99.210715) (xy 199.982365 99.137303) (xy 199.828986 99.0995) (xy 199.828985 99.0995) - (xy 199.671015 99.0995) (xy 199.671014 99.0995) (xy 199.517634 99.137303) (xy 199.377762 99.210715) - (xy 199.298931 99.280552) (xy 199.268243 99.30774) (xy 199.259516 99.315471) (xy 199.169781 99.445475) - (xy 199.16978 99.445476) (xy 199.113762 99.593181) (xy 199.094722 99.749999) (xy 163.40644 99.749999) - (xy 163.41022 99.744523) (xy 163.466237 99.596818) (xy 163.485278 99.44) (xy 163.470158 99.31547) - (xy 163.466237 99.283181) (xy 163.43469 99.199999) (xy 163.41022 99.135477) (xy 163.320483 99.00547) - (xy 163.20224 98.900717) (xy 163.202238 98.900716) (xy 163.202237 98.900715) (xy 163.062365 98.827303) - (xy 162.908986 98.7895) (xy 162.908985 98.7895) (xy 162.751015 98.7895) (xy 162.751014 98.7895) - (xy 162.597634 98.827303) (xy 162.457762 98.900715) (xy 162.339516 99.005471) (xy 162.249781 99.135475) - (xy 162.24978 99.135476) (xy 162.193762 99.283181) (xy 162.174722 99.439999) (xy 112.3005 99.439999) - (xy 112.3005 97.685321) (xy 164.3195 97.685321) (xy 164.3195 99.234678) (xy 164.334032 99.307735) - (xy 164.334033 99.307739) (xy 164.352405 99.335235) (xy 164.389399 99.390601) (xy 164.46333 99.439999) - (xy 164.47226 99.445966) (xy 164.472264 99.445967) (xy 164.545321 99.460499) (xy 164.545324 99.4605) - (xy 164.545326 99.4605) (xy 166.094676 99.4605) (xy 166.094677 99.460499) (xy 166.16774 99.445966) - (xy 166.250601 99.390601) (xy 166.305966 99.30774) (xy 166.3205 99.234674) (xy 166.3205 97.685326) - (xy 166.3205 97.685323) (xy 166.320499 97.685321) (xy 166.305967 97.612264) (xy 166.305966 97.61226) - (xy 166.250601 97.529399) (xy 166.16774 97.474034) (xy 166.167739 97.474033) (xy 166.167735 97.474032) - (xy 166.094677 97.4595) (xy 166.094674 97.4595) (xy 164.545326 97.4595) (xy 164.545323 97.4595) - (xy 164.472264 97.474032) (xy 164.47226 97.474033) (xy 164.389399 97.529399) (xy 164.334033 97.61226) - (xy 164.334032 97.612264) (xy 164.3195 97.685321) (xy 112.3005 97.685321) (xy 112.3005 95.96) (xy 164.314659 95.96) - (xy 164.333975 96.156129) (xy 164.391188 96.344733) (xy 164.484086 96.518532) (xy 164.48409 96.518539) - (xy 164.609116 96.670883) (xy 164.76146 96.795909) (xy 164.761467 96.795913) (xy 164.935266 96.888811) - (xy 164.935269 96.888811) (xy 164.935273 96.888814) (xy 165.123868 96.946024) (xy 165.32 96.965341) - (xy 165.516132 96.946024) (xy 165.704727 96.888814) (xy 165.870888 96.799999) (xy 222.144722 96.799999) - (xy 222.144722 96.8) (xy 222.163762 96.956818) (xy 222.21978 97.104523) (xy 222.309517 97.23453) - (xy 222.42776 97.339283) (xy 222.427762 97.339284) (xy 222.567634 97.412696) (xy 222.721014 97.4505) - (xy 222.721015 97.4505) (xy 222.878985 97.4505) (xy 223.032365 97.412696) (xy 223.17224 97.339283) - (xy 223.290483 97.23453) (xy 223.38022 97.104523) (xy 223.436237 96.956818) (xy 223.455278 96.8) - (xy 223.454781 96.79591) (xy 223.436237 96.643182) (xy 223.436237 96.643181) (xy 223.409765 96.573383) - (xy 223.404399 96.503721) (xy 223.437546 96.442215) (xy 223.498684 96.408394) (xy 223.559972 96.412438) - (xy 223.560351 96.410901) (xy 223.721014 96.4505) (xy 223.721015 96.4505) (xy 223.878985 96.4505) - (xy 224.032365 96.412696) (xy 224.040562 96.408394) (xy 224.17224 96.339283) (xy 224.290483 96.23453) - (xy 224.38022 96.104523) (xy 224.436237 95.956818) (xy 224.455278 95.8) (xy 224.436237 95.643182) - (xy 224.38022 95.495477) (xy 224.290483 95.36547) (xy 224.17224 95.260717) (xy 224.172238 95.260716) - (xy 224.172237 95.260715) (xy 224.032365 95.187303) (xy 223.878986 95.1495) (xy 223.878985 95.1495) - (xy 223.721015 95.1495) (xy 223.721014 95.1495) (xy 223.567634 95.187303) (xy 223.427762 95.260715) - (xy 223.309516 95.365471) (xy 223.219781 95.495475) (xy 223.21978 95.495476) (xy 223.163762 95.643181) - (xy 223.144722 95.799999) (xy 223.144722 95.8) (xy 223.163763 95.956818) (xy 223.190233 96.026615) - (xy 223.1956 96.096278) (xy 223.162452 96.157785) (xy 223.101314 96.191606) (xy 223.040028 96.18756) - (xy 223.039649 96.189099) (xy 222.878986 96.1495) (xy 222.878985 96.1495) (xy 222.721015 96.1495) - (xy 222.721014 96.1495) (xy 222.567634 96.187303) (xy 222.427762 96.260715) (xy 222.42776 96.260717) - (xy 222.332925 96.344733) (xy 222.309516 96.365471) (xy 222.219781 96.495475) (xy 222.21978 96.495476) - (xy 222.163762 96.643181) (xy 222.144722 96.799999) (xy 165.870888 96.799999) (xy 165.878538 96.79591) - (xy 166.030883 96.670883) (xy 166.15591 96.518538) (xy 166.248814 96.344727) (xy 166.306024 96.156132) - (xy 166.325341 95.96) (xy 166.306024 95.763868) (xy 166.256315 95.599999) (xy 220.944722 95.599999) - (xy 220.944722 95.6) (xy 220.963762 95.756818) (xy 221.01978 95.904523) (xy 221.109517 96.03453) - (xy 221.22776 96.139283) (xy 221.227762 96.139284) (xy 221.367634 96.212696) (xy 221.521014 96.2505) - (xy 221.521015 96.2505) (xy 221.678985 96.2505) (xy 221.832365 96.212696) (xy 221.872548 96.191606) - (xy 221.97224 96.139283) (xy 222.090483 96.03453) (xy 222.18022 95.904523) (xy 222.236237 95.756818) - (xy 222.255278 95.6) (xy 222.242587 95.495475) (xy 222.236237 95.443181) (xy 222.206765 95.36547) - (xy 222.18022 95.295477) (xy 222.161707 95.268656) (xy 222.139825 95.202301) (xy 222.157291 95.13465) - (xy 222.208559 95.087181) (xy 222.277353 95.074964) (xy 222.321379 95.088419) (xy 222.367635 95.112696) - (xy 222.367637 95.112696) (xy 222.367638 95.112697) (xy 222.521014 95.1505) (xy 222.521015 95.1505) - (xy 222.678985 95.1505) (xy 222.832365 95.112696) (xy 222.97224 95.039283) (xy 223.090483 94.93453) - (xy 223.18022 94.804523) (xy 223.236237 94.656818) (xy 223.255278 94.5) (xy 223.255278 94.499999) - (xy 224.244722 94.499999) (xy 224.244722 94.5) (xy 224.263762 94.656818) (xy 224.31978 94.804523) - (xy 224.409517 94.93453) (xy 224.52776 95.039283) (xy 224.527762 95.039284) (xy 224.667634 95.112696) - (xy 224.821014 95.1505) (xy 224.821015 95.1505) (xy 224.978985 95.1505) (xy 225.132365 95.112696) - (xy 225.27224 95.039283) (xy 225.390483 94.93453) (xy 225.48022 94.804523) (xy 225.536237 94.656818) - (xy 225.555278 94.5) (xy 225.536237 94.343182) (xy 225.48022 94.195477) (xy 225.390483 94.06547) - (xy 225.27224 93.960717) (xy 225.272238 93.960716) (xy 225.272237 93.960715) (xy 225.132365 93.887303) - (xy 224.978986 93.8495) (xy 224.978985 93.8495) (xy 224.821015 93.8495) (xy 224.821014 93.8495) - (xy 224.667634 93.887303) (xy 224.527762 93.960715) (xy 224.409516 94.065471) (xy 224.319781 94.195475) - (xy 224.31978 94.195476) (xy 224.263762 94.343181) (xy 224.244722 94.499999) (xy 223.255278 94.499999) - (xy 223.236237 94.343182) (xy 223.18022 94.195477) (xy 223.090483 94.06547) (xy 222.97224 93.960717) - (xy 222.972238 93.960716) (xy 222.972237 93.960715) (xy 222.832365 93.887303) (xy 222.678986 93.8495) - (xy 222.678985 93.8495) (xy 222.521015 93.8495) (xy 222.521014 93.8495) (xy 222.367634 93.887303) - (xy 222.227762 93.960715) (xy 222.109516 94.065471) (xy 222.019781 94.195475) (xy 222.01978 94.195476) - (xy 221.963762 94.343181) (xy 221.944722 94.499999) (xy 221.944722 94.5) (xy 221.963762 94.656818) - (xy 222.01978 94.804523) (xy 222.019782 94.804527) (xy 222.038292 94.831344) (xy 222.060174 94.897698) - (xy 222.042708 94.96535) (xy 221.991439 95.012819) (xy 221.922646 95.025034) (xy 221.878615 95.011578) - (xy 221.832365 94.987304) (xy 221.832364 94.987303) (xy 221.832363 94.987303) (xy 221.678986 94.9495) - (xy 221.678985 94.9495) (xy 221.521015 94.9495) (xy 221.521014 94.9495) (xy 221.367634 94.987303) - (xy 221.227762 95.060715) (xy 221.109516 95.165471) (xy 221.019781 95.295475) (xy 221.01978 95.295476) - (xy 220.963762 95.443181) (xy 220.944722 95.599999) (xy 166.256315 95.599999) (xy 166.248814 95.575273) - (xy 166.248811 95.575269) (xy 166.248811 95.575266) (xy 166.155913 95.401467) (xy 166.155909 95.40146) - (xy 166.030883 95.249116) (xy 165.878539 95.12409) (xy 165.878532 95.124086) (xy 165.704733 95.031188) - (xy 165.704727 95.031186) (xy 165.516132 94.973976) (xy 165.516129 94.973975) (xy 165.32 94.954659) - (xy 165.12387 94.973975) (xy 164.935266 95.031188) (xy 164.761467 95.124086) (xy 164.76146 95.12409) - (xy 164.609116 95.249116) (xy 164.48409 95.40146) (xy 164.484086 95.401467) (xy 164.391188 95.575266) - (xy 164.333975 95.76387) (xy 164.314659 95.96) (xy 112.3005 95.96) (xy 112.3005 93.869999) (xy 163.594722 93.869999) - (xy 163.594722 93.87) (xy 163.613762 94.026818) (xy 163.66978 94.174523) (xy 163.759517 94.30453) - (xy 163.87776 94.409283) (xy 163.877762 94.409284) (xy 164.017634 94.482696) (xy 164.171014 94.5205) - (xy 164.171015 94.5205) (xy 164.328985 94.5205) (xy 164.482365 94.482696) (xy 164.62224 94.409283) - (xy 164.740483 94.30453) (xy 164.83022 94.174523) (xy 164.886237 94.026818) (xy 164.905278 93.87) - (xy 164.886237 93.713182) (xy 164.881551 93.700827) (xy 164.856408 93.63453) (xy 164.83022 93.565477) - (xy 164.740483 93.43547) (xy 164.62224 93.330717) (xy 164.622238 93.330716) (xy 164.622237 93.330715) - (xy 164.482365 93.257303) (xy 164.328986 93.2195) (xy 164.328985 93.2195) (xy 164.171015 93.2195) - (xy 164.171014 93.2195) (xy 164.017634 93.257303) (xy 163.877762 93.330715) (xy 163.759516 93.435471) - (xy 163.669781 93.565475) (xy 163.66978 93.565476) (xy 163.613762 93.713181) (xy 163.594722 93.869999) - (xy 112.3005 93.869999) (xy 112.3005 92.699999) (xy 167.044722 92.699999) (xy 167.044722 92.7) (xy 167.063762 92.856818) - (xy 167.078424 92.895477) (xy 167.11978 93.004523) (xy 167.209517 93.13453) (xy 167.32776 93.239283) - (xy 167.327762 93.239284) (xy 167.467634 93.312696) (xy 167.621014 93.3505) (xy 167.621015 93.3505) - (xy 167.778985 93.3505) (xy 167.932365 93.312696) (xy 168.07224 93.239283) (xy 168.190483 93.13453) - (xy 168.28022 93.004523) (xy 168.336237 92.856818) (xy 168.355278 92.7) (xy 168.345564 92.619994) - (xy 176.729529 92.619994) (xy 176.729529 92.620005) (xy 176.749379 92.859559) (xy 176.808389 93.092589) - (xy 176.904951 93.312729) (xy 176.985143 93.435471) (xy 177.036429 93.513969) (xy 177.199236 93.690825) - (xy 177.199239 93.690827) (xy 177.199242 93.69083) (xy 177.388924 93.838466) (xy 177.38893 93.83847) - (xy 177.388933 93.838472) (xy 177.600344 93.952882) (xy 177.600347 93.952883) (xy 177.827699 94.030933) - (xy 177.827701 94.030933) (xy 177.827703 94.030934) (xy 178.064808 94.0705) (xy 178.064809 94.0705) - (xy 178.305191 94.0705) (xy 178.305192 94.0705) (xy 178.542297 94.030934) (xy 178.769656 93.952882) - (xy 178.981067 93.838472) (xy 179.170764 93.690825) (xy 179.333571 93.513969) (xy 179.465049 93.312728) - (xy 179.56161 93.092591) (xy 179.62062 92.859563) (xy 179.637097 92.660717) (xy 179.640471 92.620005) - (xy 179.640471 92.619994) (xy 179.621449 92.39044) (xy 179.62062 92.380437) (xy 179.56161 92.147409) - (xy 179.465049 91.927272) (xy 179.333571 91.726031) (xy 179.170764 91.549175) (xy 179.170759 91.549171) - (xy 179.170757 91.549169) (xy 178.981075 91.401533) (xy 178.981069 91.401529) (xy 178.969598 91.395321) - (xy 180.1345 91.395321) (xy 180.1345 93.844678) (xy 180.149032 93.917735) (xy 180.149033 93.917739) - (xy 180.167405 93.945235) (xy 180.204399 94.000601) (xy 180.264763 94.040934) (xy 180.28726 94.055966) - (xy 180.287264 94.055967) (xy 180.360321 94.070499) (xy 180.360324 94.0705) (xy 180.360326 94.0705) - (xy 182.809676 94.0705) (xy 182.809677 94.070499) (xy 182.88274 94.055966) (xy 182.965601 94.000601) - (xy 183.020966 93.91774) (xy 183.0355 93.844674) (xy 183.0355 92.619994) (xy 185.91953 92.619994) - (xy 185.91953 92.620005) (xy 185.93938 92.859559) (xy 185.99839 93.092589) (xy 186.094952 93.312729) - (xy 186.175144 93.435471) (xy 186.22643 93.513969) (xy 186.389237 93.690825) (xy 186.38924 93.690827) - (xy 186.389243 93.69083) (xy 186.578925 93.838466) (xy 186.578931 93.83847) (xy 186.578934 93.838472) - (xy 186.790345 93.952882) (xy 186.790348 93.952883) (xy 187.0177 94.030933) (xy 187.017702 94.030933) - (xy 187.017704 94.030934) (xy 187.254809 94.0705) (xy 187.25481 94.0705) (xy 187.495192 94.0705) - (xy 187.495193 94.0705) (xy 187.732298 94.030934) (xy 187.959657 93.952882) (xy 188.171068 93.838472) - (xy 188.360765 93.690825) (xy 188.523572 93.513969) (xy 188.65505 93.312728) (xy 188.751611 93.092591) - (xy 188.810621 92.859563) (xy 188.827098 92.660717) (xy 188.830472 92.620005) (xy 188.830472 92.619994) - (xy 188.81145 92.39044) (xy 188.810621 92.380437) (xy 188.751611 92.147409) (xy 188.65505 91.927272) - (xy 188.523572 91.726031) (xy 188.360765 91.549175) (xy 188.36076 91.549171) (xy 188.360758 91.549169) - (xy 188.171076 91.401533) (xy 188.17107 91.401529) (xy 188.159599 91.395321) (xy 189.324501 91.395321) - (xy 189.324501 93.844678) (xy 189.339033 93.917735) (xy 189.339034 93.917739) (xy 189.357406 93.945235) - (xy 189.3944 94.000601) (xy 189.454764 94.040934) (xy 189.477261 94.055966) (xy 189.477265 94.055967) - (xy 189.550322 94.070499) (xy 189.550325 94.0705) (xy 189.550327 94.0705) (xy 191.999677 94.0705) - (xy 191.999678 94.070499) (xy 192.072741 94.055966) (xy 192.155602 94.000601) (xy 192.210967 93.91774) - (xy 192.225501 93.844674) (xy 192.225501 93.199999) (xy 223.245722 93.199999) (xy 223.245722 93.2) - (xy 223.264762 93.356818) (xy 223.294592 93.435471) (xy 223.32078 93.504523) (xy 223.410517 93.63453) - (xy 223.52876 93.739283) (xy 223.528762 93.739284) (xy 223.668634 93.812696) (xy 223.822014 93.8505) - (xy 223.822015 93.8505) (xy 223.979985 93.8505) (xy 224.133365 93.812696) (xy 224.27324 93.739283) - (xy 224.391483 93.63453) (xy 224.48122 93.504523) (xy 224.537237 93.356818) (xy 224.556278 93.2) - (xy 224.537237 93.043182) (xy 224.48122 92.895477) (xy 224.391483 92.76547) (xy 224.27324 92.660717) - (xy 224.273238 92.660716) (xy 224.273237 92.660715) (xy 224.214704 92.629994) (xy 233.979529 92.629994) - (xy 233.979529 92.630005) (xy 233.999379 92.869559) (xy 234.058389 93.102589) (xy 234.154951 93.322729) - (xy 234.173095 93.3505) (xy 234.286429 93.523969) (xy 234.449236 93.700825) (xy 234.449239 93.700827) - (xy 234.449242 93.70083) (xy 234.638924 93.848466) (xy 234.63893 93.84847) (xy 234.638933 93.848472) - (xy 234.850344 93.962882) (xy 234.850347 93.962883) (xy 235.077699 94.040933) (xy 235.077701 94.040933) - (xy 235.077703 94.040934) (xy 235.314808 94.0805) (xy 235.314809 94.0805) (xy 235.555191 94.0805) - (xy 235.555192 94.0805) (xy 235.792297 94.040934) (xy 236.019656 93.962882) (xy 236.231067 93.848472) - (xy 236.420764 93.700825) (xy 236.583571 93.523969) (xy 236.715049 93.322728) (xy 236.81161 93.102591) - (xy 236.87062 92.869563) (xy 236.890471 92.63) (xy 236.889642 92.62) (xy 236.877237 92.470291) (xy 236.87062 92.390437) - (xy 236.81161 92.157409) (xy 236.715049 91.937272) (xy 236.708514 91.92727) (xy 236.583572 91.736033) - (xy 236.583571 91.736031) (xy 236.420764 91.559175) (xy 236.420759 91.559171) (xy 236.420757 91.559169) - (xy 236.231075 91.411533) (xy 236.231069 91.411529) (xy 236.219598 91.405321) (xy 237.3845 91.405321) - (xy 237.3845 93.854678) (xy 237.399032 93.927735) (xy 237.399033 93.927739) (xy 237.399034 93.92774) - (xy 237.454399 94.010601) (xy 237.522294 94.055966) (xy 237.53726 94.065966) (xy 237.537264 94.065967) - (xy 237.610321 94.080499) (xy 237.610324 94.0805) (xy 237.610326 94.0805) (xy 240.059676 94.0805) - (xy 240.059677 94.080499) (xy 240.13274 94.065966) (xy 240.215601 94.010601) (xy 240.270966 93.92774) - (xy 240.2855 93.854674) (xy 240.2855 92.629994) (xy 244.269529 92.629994) (xy 244.269529 92.630005) - (xy 244.289379 92.869559) (xy 244.348389 93.102589) (xy 244.444951 93.322729) (xy 244.463095 93.3505) - (xy 244.576429 93.523969) (xy 244.739236 93.700825) (xy 244.739239 93.700827) (xy 244.739242 93.70083) - (xy 244.928924 93.848466) (xy 244.92893 93.84847) (xy 244.928933 93.848472) (xy 245.140344 93.962882) - (xy 245.140347 93.962883) (xy 245.367699 94.040933) (xy 245.367701 94.040933) (xy 245.367703 94.040934) - (xy 245.604808 94.0805) (xy 245.604809 94.0805) (xy 245.845191 94.0805) (xy 245.845192 94.0805) - (xy 246.082297 94.040934) (xy 246.309656 93.962882) (xy 246.521067 93.848472) (xy 246.710764 93.700825) - (xy 246.873571 93.523969) (xy 247.005049 93.322728) (xy 247.10161 93.102591) (xy 247.16062 92.869563) - (xy 247.180471 92.63) (xy 247.179642 92.62) (xy 247.167237 92.470291) (xy 247.16062 92.390437) (xy 247.10161 92.157409) + (xy 128.718985 108.8305) (xy 128.872365 108.792696) (xy 129.01224 108.719283) (xy 129.130483 108.61453) + (xy 129.22022 108.484523) (xy 129.276237 108.336818) (xy 129.295278 108.18) (xy 129.276237 108.023182) + (xy 129.246584 107.944994) (xy 165.704529 107.944994) (xy 165.704529 107.945005) (xy 165.724379 108.184559) + (xy 165.783389 108.417589) (xy 165.879951 108.637729) (xy 165.933234 108.719284) (xy 166.011429 108.838969) + (xy 166.174236 109.015825) (xy 166.174239 109.015827) (xy 166.174242 109.01583) (xy 166.363924 109.163466) + (xy 166.36393 109.16347) (xy 166.363933 109.163472) (xy 166.575344 109.277882) (xy 166.575347 109.277883) + (xy 166.802699 109.355933) (xy 166.802701 109.355933) (xy 166.802703 109.355934) (xy 167.039808 109.3955) + (xy 167.039809 109.3955) (xy 167.280191 109.3955) (xy 167.280192 109.3955) (xy 167.517297 109.355934) + (xy 167.744656 109.277882) (xy 167.956067 109.163472) (xy 168.145764 109.015825) (xy 168.308571 108.838969) + (xy 168.440049 108.637728) (xy 168.53661 108.417591) (xy 168.59562 108.184563) (xy 168.615471 107.945) + (xy 168.615471 107.944994) (xy 179.174529 107.944994) (xy 179.174529 107.945005) (xy 179.194379 108.184559) + (xy 179.253389 108.417589) (xy 179.349951 108.637729) (xy 179.403234 108.719284) (xy 179.481429 108.838969) + (xy 179.644236 109.015825) (xy 179.644239 109.015827) (xy 179.644242 109.01583) (xy 179.833924 109.163466) + (xy 179.83393 109.16347) (xy 179.833933 109.163472) (xy 180.045344 109.277882) (xy 180.045347 109.277883) + (xy 180.272699 109.355933) (xy 180.272701 109.355933) (xy 180.272703 109.355934) (xy 180.509808 109.3955) + (xy 180.509809 109.3955) (xy 180.750191 109.3955) (xy 180.750192 109.3955) (xy 180.987297 109.355934) + (xy 181.214656 109.277882) (xy 181.426067 109.163472) (xy 181.615764 109.015825) (xy 181.778571 108.838969) + (xy 181.910049 108.637728) (xy 182.00661 108.417591) (xy 182.030779 108.322149) (xy 271.1995 108.322149) + (xy 271.1995 108.57785) (xy 271.214987 108.695476) (xy 271.232874 108.83134) (xy 271.282307 109.015827) + (xy 271.29905 109.078312) (xy 271.299053 109.078322) (xy 271.396894 109.314531) (xy 271.396899 109.314542) + (xy 271.524734 109.535957) (xy 271.524745 109.535973) (xy 271.680388 109.738811) (xy 271.680394 109.738818) + (xy 271.861181 109.919605) (xy 271.861187 109.91961) (xy 272.064035 110.075261) (xy 272.064042 110.075265) + (xy 272.285457 110.2031) (xy 272.285462 110.203102) (xy 272.285465 110.203104) (xy 272.521687 110.30095) + (xy 272.76866 110.367126) (xy 273.022157 110.4005) (xy 273.022164 110.4005) (xy 273.277836 110.4005) + (xy 273.277843 110.4005) (xy 273.53134 110.367126) (xy 273.778313 110.30095) (xy 274.014535 110.203104) + (xy 274.235965 110.075261) (xy 274.438813 109.91961) (xy 274.61961 109.738813) (xy 274.775261 109.535965) + (xy 274.903104 109.314535) (xy 275.00095 109.078313) (xy 275.067126 108.83134) (xy 275.1005 108.577843) + (xy 275.1005 108.322157) (xy 275.067126 108.06866) (xy 275.00095 107.821687) (xy 274.903104 107.585465) + (xy 274.903102 107.585462) (xy 274.9031 107.585457) (xy 274.775265 107.364042) (xy 274.775261 107.364035) + (xy 274.61961 107.161187) (xy 274.619605 107.161181) (xy 274.438818 106.980394) (xy 274.438811 106.980388) + (xy 274.235973 106.824745) (xy 274.235971 106.824743) (xy 274.235965 106.824739) (xy 274.23596 106.824736) + (xy 274.235957 106.824734) (xy 274.014542 106.696899) (xy 274.014531 106.696894) (xy 273.778322 106.599053) + (xy 273.778315 106.599051) (xy 273.778313 106.59905) (xy 273.53134 106.532874) (xy 273.475007 106.525457) + (xy 273.27785 106.4995) (xy 273.277843 106.4995) (xy 273.022157 106.4995) (xy 273.022149 106.4995) + (xy 272.796826 106.529165) (xy 272.76866 106.532874) (xy 272.521687 106.59905) (xy 272.521677 106.599053) + (xy 272.285468 106.696894) (xy 272.285457 106.696899) (xy 272.064042 106.824734) (xy 272.064026 106.824745) + (xy 271.861188 106.980388) (xy 271.861181 106.980394) (xy 271.680394 107.161181) (xy 271.680388 107.161188) + (xy 271.524745 107.364026) (xy 271.524734 107.364042) (xy 271.396899 107.585457) (xy 271.396894 107.585468) + (xy 271.299053 107.821677) (xy 271.29905 107.821687) (xy 271.266009 107.945) (xy 271.232874 108.068661) + (xy 271.1995 108.322149) (xy 182.030779 108.322149) (xy 182.06562 108.184563) (xy 182.085471 107.945) + (xy 182.06562 107.705437) (xy 182.00661 107.472409) (xy 181.910049 107.252272) (xy 181.778571 107.051031) + (xy 181.615764 106.874175) (xy 181.615759 106.874171) (xy 181.615757 106.874169) (xy 181.426075 106.726533) + (xy 181.426069 106.726529) (xy 181.214657 106.612118) (xy 181.214652 106.612116) (xy 180.9873 106.534066) + (xy 180.780155 106.4995) (xy 180.750192 106.4945) (xy 180.509808 106.4945) (xy 180.479845 106.4995) + (xy 180.272699 106.534066) (xy 180.045347 106.612116) (xy 180.045342 106.612118) (xy 179.83393 106.726529) + (xy 179.833924 106.726533) (xy 179.644242 106.874169) (xy 179.644239 106.874172) (xy 179.48143 107.051029) + (xy 179.481427 107.051033) (xy 179.349951 107.25227) (xy 179.253389 107.47241) (xy 179.194379 107.70544) + (xy 179.174529 107.944994) (xy 168.615471 107.944994) (xy 168.59562 107.705437) (xy 168.53661 107.472409) + (xy 168.440049 107.252272) (xy 168.308571 107.051031) (xy 168.145764 106.874175) (xy 168.145759 106.874171) + (xy 168.145757 106.874169) (xy 167.956075 106.726533) (xy 167.956069 106.726529) (xy 167.744657 106.612118) + (xy 167.744652 106.612116) (xy 167.5173 106.534066) (xy 167.310155 106.4995) (xy 167.280192 106.4945) + (xy 167.039808 106.4945) (xy 167.009845 106.4995) (xy 166.802699 106.534066) (xy 166.575347 106.612116) + (xy 166.575342 106.612118) (xy 166.36393 106.726529) (xy 166.363924 106.726533) (xy 166.174242 106.874169) + (xy 166.174239 106.874172) (xy 166.01143 107.051029) (xy 166.011427 107.051033) (xy 165.879951 107.25227) + (xy 165.783389 107.47241) (xy 165.724379 107.70544) (xy 165.704529 107.944994) (xy 129.246584 107.944994) + (xy 129.22022 107.875477) (xy 129.130483 107.74547) (xy 129.01224 107.640717) (xy 129.012238 107.640716) + (xy 129.012237 107.640715) (xy 128.872365 107.567303) (xy 128.718986 107.5295) (xy 128.718985 107.5295) + (xy 128.561015 107.5295) (xy 128.561014 107.5295) (xy 128.407634 107.567303) (xy 128.267762 107.640715) + (xy 128.149516 107.745471) (xy 128.059781 107.875475) (xy 128.05978 107.875476) (xy 128.003762 108.023181) + (xy 127.984722 108.179999) (xy 112.3005 108.179999) (xy 112.3005 104.544994) (xy 165.704529 104.544994) + (xy 165.704529 104.545005) (xy 165.724379 104.784559) (xy 165.783389 105.017589) (xy 165.879951 105.237729) + (xy 166.011427 105.438966) (xy 166.011429 105.438969) (xy 166.174236 105.615825) (xy 166.174239 105.615827) + (xy 166.174242 105.61583) (xy 166.363924 105.763466) (xy 166.36393 105.76347) (xy 166.363933 105.763472) + (xy 166.575344 105.877882) (xy 166.575347 105.877883) (xy 166.802699 105.955933) (xy 166.802701 105.955933) + (xy 166.802703 105.955934) (xy 167.039808 105.9955) (xy 167.039809 105.9955) (xy 167.280191 105.9955) + (xy 167.280192 105.9955) (xy 167.517297 105.955934) (xy 167.744656 105.877882) (xy 167.956067 105.763472) + (xy 168.145764 105.615825) (xy 168.308571 105.438969) (xy 168.440049 105.237728) (xy 168.53661 105.017591) + (xy 168.59562 104.784563) (xy 168.615471 104.545) (xy 168.59562 104.305437) (xy 168.53661 104.072409) + (xy 168.440049 103.852272) (xy 168.308571 103.651031) (xy 168.145764 103.474175) (xy 168.145759 103.474171) + (xy 168.145757 103.474169) (xy 167.956075 103.326533) (xy 167.956069 103.326529) (xy 167.944598 103.320321) + (xy 179.1795 103.320321) (xy 179.1795 105.769678) (xy 179.194032 105.842735) (xy 179.194033 105.842739) + (xy 179.194034 105.84274) (xy 179.249399 105.925601) (xy 179.33226 105.980966) (xy 179.332264 105.980967) + (xy 179.405321 105.995499) (xy 179.405324 105.9955) (xy 179.405326 105.9955) (xy 181.854676 105.9955) + (xy 181.854677 105.995499) (xy 181.92774 105.980966) (xy 182.010601 105.925601) (xy 182.065966 105.84274) + (xy 182.0805 105.769674) (xy 182.0805 103.320326) (xy 182.0805 103.320323) (xy 182.080499 103.320321) + (xy 182.065967 103.247264) (xy 182.065966 103.24726) (xy 182.042484 103.212116) (xy 182.010601 103.164399) + (xy 181.92774 103.109034) (xy 181.927739 103.109033) (xy 181.927735 103.109032) (xy 181.854677 103.0945) + (xy 181.854674 103.0945) (xy 179.405326 103.0945) (xy 179.405323 103.0945) (xy 179.332264 103.109032) + (xy 179.33226 103.109033) (xy 179.249399 103.164399) (xy 179.194033 103.24726) (xy 179.194032 103.247264) + (xy 179.1795 103.320321) (xy 167.944598 103.320321) (xy 167.744657 103.212118) (xy 167.744652 103.212116) + (xy 167.5173 103.134066) (xy 167.339468 103.104391) (xy 167.280192 103.0945) (xy 167.039808 103.0945) + (xy 166.992387 103.102413) (xy 166.802699 103.134066) (xy 166.575347 103.212116) (xy 166.575342 103.212118) + (xy 166.36393 103.326529) (xy 166.363924 103.326533) (xy 166.174242 103.474169) (xy 166.174239 103.474172) + (xy 166.01143 103.651029) (xy 166.011427 103.651033) (xy 165.879951 103.85227) (xy 165.783389 104.07241) + (xy 165.724379 104.30544) (xy 165.704529 104.544994) (xy 112.3005 104.544994) (xy 112.3005 102.299999) + (xy 122.034722 102.299999) (xy 122.034722 102.3) (xy 122.053762 102.456818) (xy 122.10978 102.604523) + (xy 122.199517 102.73453) (xy 122.31776 102.839283) (xy 122.317762 102.839284) (xy 122.457634 102.912696) + (xy 122.611014 102.9505) (xy 122.611015 102.9505) (xy 122.768985 102.9505) (xy 122.922365 102.912696) + (xy 123.06224 102.839283) (xy 123.180483 102.73453) (xy 123.27022 102.604523) (xy 123.326237 102.456818) + (xy 123.345278 102.3) (xy 123.326237 102.143182) (xy 123.27022 101.995477) (xy 123.180483 101.86547) + (xy 123.06224 101.760717) (xy 123.062238 101.760716) (xy 123.062237 101.760715) (xy 122.922365 101.687303) + (xy 122.768986 101.6495) (xy 122.768985 101.6495) (xy 122.611015 101.6495) (xy 122.611014 101.6495) + (xy 122.457634 101.687303) (xy 122.317762 101.760715) (xy 122.199516 101.865471) (xy 122.109781 101.995475) + (xy 122.10978 101.995476) (xy 122.053762 102.143181) (xy 122.034722 102.299999) (xy 112.3005 102.299999) + (xy 112.3005 101.199996) (xy 200.544719 101.199996) (xy 200.544719 101.199997) (xy 200.563759 101.356815) + (xy 200.619777 101.50452) (xy 200.709514 101.634527) (xy 200.827757 101.73928) (xy 200.827759 101.739281) + (xy 200.967631 101.812693) (xy 201.121011 101.850497) (xy 201.121012 101.850497) (xy 201.278982 101.850497) + (xy 201.432362 101.812693) (xy 201.572237 101.73928) (xy 201.69048 101.634527) (xy 201.780217 101.50452) + (xy 201.836234 101.356815) (xy 201.855275 101.199997) (xy 201.836234 101.043179) (xy 201.780217 100.895474) + (xy 201.69048 100.765467) (xy 201.572237 100.660714) (xy 201.572235 100.660713) (xy 201.572234 100.660712) + (xy 201.432362 100.5873) (xy 201.278983 100.549497) (xy 201.278982 100.549497) (xy 201.121012 100.549497) + (xy 201.121011 100.549497) (xy 200.967631 100.5873) (xy 200.827759 100.660712) (xy 200.709513 100.765468) + (xy 200.619778 100.895472) (xy 200.619777 100.895473) (xy 200.563759 101.043178) (xy 200.544719 101.199996) + (xy 112.3005 101.199996) (xy 112.3005 99.439999) (xy 162.174722 99.439999) (xy 162.174722 99.44) + (xy 162.193762 99.596818) (xy 162.247793 99.739283) (xy 162.24978 99.744523) (xy 162.339517 99.87453) + (xy 162.45776 99.979283) (xy 162.457762 99.979284) (xy 162.597634 100.052696) (xy 162.751014 100.0905) + (xy 162.751015 100.0905) (xy 162.908985 100.0905) (xy 163.062365 100.052696) (xy 163.20224 99.979283) + (xy 163.320483 99.87453) (xy 163.40644 99.749999) (xy 199.094722 99.749999) (xy 199.094722 99.75) + (xy 199.113762 99.906818) (xy 199.148548 99.998539) (xy 199.16978 100.054523) (xy 199.259517 100.18453) + (xy 199.37776 100.289283) (xy 199.377762 100.289284) (xy 199.517634 100.362696) (xy 199.671014 100.4005) + (xy 199.671015 100.4005) (xy 199.828985 100.4005) (xy 199.982365 100.362696) (xy 200.12224 100.289283) + (xy 200.240483 100.18453) (xy 200.33022 100.054523) (xy 200.386237 99.906818) (xy 200.405278 99.75) + (xy 200.386679 99.596818) (xy 200.386237 99.593181) (xy 200.364992 99.537164) (xy 200.33022 99.445477) + (xy 200.32644 99.44) (xy 257.874659 99.44) (xy 257.893975 99.636129) (xy 257.893976 99.636132) (xy 257.947536 99.812696) + (xy 257.951188 99.824733) (xy 258.044086 99.998532) (xy 258.04409 99.998539) (xy 258.169116 100.150883) + (xy 258.32146 100.275909) (xy 258.321467 100.275913) (xy 258.495266 100.368811) (xy 258.495269 100.368811) + (xy 258.495273 100.368814) (xy 258.683868 100.426024) (xy 258.88 100.445341) (xy 259.076132 100.426024) + (xy 259.264727 100.368814) (xy 259.438538 100.27591) (xy 259.590883 100.150883) (xy 259.71591 99.998538) + (xy 259.808814 99.824727) (xy 259.866024 99.636132) (xy 259.885341 99.44) (xy 259.866024 99.243868) + (xy 259.808814 99.055273) (xy 259.808811 99.055269) (xy 259.808811 99.055266) (xy 259.715913 98.881467) + (xy 259.715909 98.88146) (xy 259.590883 98.729116) (xy 259.513149 98.665321) (xy 260.3795 98.665321) + (xy 260.3795 100.214678) (xy 260.394032 100.287735) (xy 260.394033 100.287739) (xy 260.412405 100.315235) + (xy 260.449399 100.370601) (xy 260.494147 100.4005) (xy 260.53226 100.425966) (xy 260.532264 100.425967) + (xy 260.605321 100.440499) (xy 260.605324 100.4405) (xy 260.605326 100.4405) (xy 262.154676 100.4405) + (xy 262.154677 100.440499) (xy 262.22774 100.425966) (xy 262.310601 100.370601) (xy 262.365966 100.28774) + (xy 262.3805 100.214674) (xy 262.3805 99.199999) (xy 264.544722 99.199999) (xy 264.544722 99.2) + (xy 264.563762 99.356818) (xy 264.603084 99.460499) (xy 264.61978 99.504523) (xy 264.709517 99.63453) + (xy 264.82776 99.739283) (xy 264.827762 99.739284) (xy 264.967634 99.812696) (xy 265.121014 99.8505) + (xy 265.121015 99.8505) (xy 265.278985 99.8505) (xy 265.432365 99.812696) (xy 265.57224 99.739283) + (xy 265.690483 99.63453) (xy 265.78022 99.504523) (xy 265.836237 99.356818) (xy 265.855278 99.2) + (xy 265.847666 99.137304) (xy 265.836237 99.043181) (xy 265.782207 98.900717) (xy 265.78022 98.895477) + (xy 265.690483 98.76547) (xy 265.57224 98.660717) (xy 265.572238 98.660716) (xy 265.572237 98.660715) + (xy 265.432365 98.587303) (xy 265.278986 98.5495) (xy 265.278985 98.5495) (xy 265.121015 98.5495) + (xy 265.121014 98.5495) (xy 264.967634 98.587303) (xy 264.827762 98.660715) (xy 264.709516 98.765471) + (xy 264.619781 98.895475) (xy 264.61978 98.895476) (xy 264.563762 99.043181) (xy 264.544722 99.199999) + (xy 262.3805 99.199999) (xy 262.3805 98.665326) (xy 262.3805 98.665323) (xy 262.380499 98.665321) + (xy 262.365967 98.592264) (xy 262.365966 98.59226) (xy 262.337395 98.5495) (xy 262.310601 98.509399) + (xy 262.22774 98.454034) (xy 262.227739 98.454033) (xy 262.227735 98.454032) (xy 262.154677 98.4395) + (xy 262.154674 98.4395) (xy 260.605326 98.4395) (xy 260.605323 98.4395) (xy 260.532264 98.454032) + (xy 260.53226 98.454033) (xy 260.449399 98.509399) (xy 260.394033 98.59226) (xy 260.394032 98.592264) + (xy 260.3795 98.665321) (xy 259.513149 98.665321) (xy 259.438539 98.60409) (xy 259.438532 98.604086) + (xy 259.264733 98.511188) (xy 259.264727 98.511186) (xy 259.076132 98.453976) (xy 259.076129 98.453975) + (xy 258.88 98.434659) (xy 258.68387 98.453975) (xy 258.495266 98.511188) (xy 258.321467 98.604086) + (xy 258.32146 98.60409) (xy 258.169116 98.729116) (xy 258.04409 98.88146) (xy 258.044086 98.881467) + (xy 257.951188 99.055266) (xy 257.893975 99.24387) (xy 257.874659 99.44) (xy 200.32644 99.44) (xy 200.240483 99.31547) + (xy 200.12224 99.210717) (xy 200.122238 99.210716) (xy 200.122237 99.210715) (xy 199.982365 99.137303) + (xy 199.828986 99.0995) (xy 199.828985 99.0995) (xy 199.671015 99.0995) (xy 199.671014 99.0995) + (xy 199.517634 99.137303) (xy 199.377762 99.210715) (xy 199.298931 99.280552) (xy 199.268243 99.30774) + (xy 199.259516 99.315471) (xy 199.169781 99.445475) (xy 199.16978 99.445476) (xy 199.113762 99.593181) + (xy 199.094722 99.749999) (xy 163.40644 99.749999) (xy 163.41022 99.744523) (xy 163.466237 99.596818) + (xy 163.485278 99.44) (xy 163.470158 99.31547) (xy 163.466237 99.283181) (xy 163.43469 99.199999) + (xy 163.41022 99.135477) (xy 163.320483 99.00547) (xy 163.20224 98.900717) (xy 163.202238 98.900716) + (xy 163.202237 98.900715) (xy 163.062365 98.827303) (xy 162.908986 98.7895) (xy 162.908985 98.7895) + (xy 162.751015 98.7895) (xy 162.751014 98.7895) (xy 162.597634 98.827303) (xy 162.457762 98.900715) + (xy 162.339516 99.005471) (xy 162.249781 99.135475) (xy 162.24978 99.135476) (xy 162.193762 99.283181) + (xy 162.174722 99.439999) (xy 112.3005 99.439999) (xy 112.3005 97.685321) (xy 164.3195 97.685321) + (xy 164.3195 99.234678) (xy 164.334032 99.307735) (xy 164.334033 99.307739) (xy 164.352405 99.335235) + (xy 164.389399 99.390601) (xy 164.46333 99.439999) (xy 164.47226 99.445966) (xy 164.472264 99.445967) + (xy 164.545321 99.460499) (xy 164.545324 99.4605) (xy 164.545326 99.4605) (xy 166.094676 99.4605) + (xy 166.094677 99.460499) (xy 166.16774 99.445966) (xy 166.250601 99.390601) (xy 166.305966 99.30774) + (xy 166.3205 99.234674) (xy 166.3205 97.685326) (xy 166.3205 97.685323) (xy 166.320499 97.685321) + (xy 166.305967 97.612264) (xy 166.305966 97.61226) (xy 166.250601 97.529399) (xy 166.16774 97.474034) + (xy 166.167739 97.474033) (xy 166.167735 97.474032) (xy 166.094677 97.4595) (xy 166.094674 97.4595) + (xy 164.545326 97.4595) (xy 164.545323 97.4595) (xy 164.472264 97.474032) (xy 164.47226 97.474033) + (xy 164.389399 97.529399) (xy 164.334033 97.61226) (xy 164.334032 97.612264) (xy 164.3195 97.685321) + (xy 112.3005 97.685321) (xy 112.3005 95.96) (xy 164.314659 95.96) (xy 164.333975 96.156129) (xy 164.391188 96.344733) + (xy 164.484086 96.518532) (xy 164.48409 96.518539) (xy 164.609116 96.670883) (xy 164.76146 96.795909) + (xy 164.761467 96.795913) (xy 164.935266 96.888811) (xy 164.935269 96.888811) (xy 164.935273 96.888814) + (xy 165.123868 96.946024) (xy 165.32 96.965341) (xy 165.516132 96.946024) (xy 165.704727 96.888814) + (xy 165.870888 96.799999) (xy 222.144722 96.799999) (xy 222.144722 96.8) (xy 222.163762 96.956818) + (xy 222.21978 97.104523) (xy 222.309517 97.23453) (xy 222.42776 97.339283) (xy 222.427762 97.339284) + (xy 222.567634 97.412696) (xy 222.721014 97.4505) (xy 222.721015 97.4505) (xy 222.878985 97.4505) + (xy 223.032365 97.412696) (xy 223.17224 97.339283) (xy 223.290483 97.23453) (xy 223.38022 97.104523) + (xy 223.436237 96.956818) (xy 223.455278 96.8) (xy 223.454781 96.79591) (xy 223.436237 96.643182) + (xy 223.436237 96.643181) (xy 223.409765 96.573383) (xy 223.404399 96.503721) (xy 223.437546 96.442215) + (xy 223.498684 96.408394) (xy 223.559972 96.412438) (xy 223.560351 96.410901) (xy 223.721014 96.4505) + (xy 223.721015 96.4505) (xy 223.878985 96.4505) (xy 224.032365 96.412696) (xy 224.040562 96.408394) + (xy 224.17224 96.339283) (xy 224.290483 96.23453) (xy 224.38022 96.104523) (xy 224.436237 95.956818) + (xy 224.455278 95.8) (xy 224.436237 95.643182) (xy 224.38022 95.495477) (xy 224.290483 95.36547) + (xy 224.17224 95.260717) (xy 224.172238 95.260716) (xy 224.172237 95.260715) (xy 224.032365 95.187303) + (xy 223.878986 95.1495) (xy 223.878985 95.1495) (xy 223.721015 95.1495) (xy 223.721014 95.1495) + (xy 223.567634 95.187303) (xy 223.427762 95.260715) (xy 223.309516 95.365471) (xy 223.219781 95.495475) + (xy 223.21978 95.495476) (xy 223.163762 95.643181) (xy 223.144722 95.799999) (xy 223.144722 95.8) + (xy 223.163763 95.956818) (xy 223.190233 96.026615) (xy 223.1956 96.096278) (xy 223.162452 96.157785) + (xy 223.101314 96.191606) (xy 223.040028 96.18756) (xy 223.039649 96.189099) (xy 222.878986 96.1495) + (xy 222.878985 96.1495) (xy 222.721015 96.1495) (xy 222.721014 96.1495) (xy 222.567634 96.187303) + (xy 222.427762 96.260715) (xy 222.42776 96.260717) (xy 222.332925 96.344733) (xy 222.309516 96.365471) + (xy 222.219781 96.495475) (xy 222.21978 96.495476) (xy 222.163762 96.643181) (xy 222.144722 96.799999) + (xy 165.870888 96.799999) (xy 165.878538 96.79591) (xy 166.030883 96.670883) (xy 166.15591 96.518538) + (xy 166.248814 96.344727) (xy 166.306024 96.156132) (xy 166.325341 95.96) (xy 166.306024 95.763868) + (xy 166.256315 95.599999) (xy 220.944722 95.599999) (xy 220.944722 95.6) (xy 220.963762 95.756818) + (xy 221.01978 95.904523) (xy 221.109517 96.03453) (xy 221.22776 96.139283) (xy 221.227762 96.139284) + (xy 221.367634 96.212696) (xy 221.521014 96.2505) (xy 221.521015 96.2505) (xy 221.678985 96.2505) + (xy 221.832365 96.212696) (xy 221.872548 96.191606) (xy 221.97224 96.139283) (xy 222.090483 96.03453) + (xy 222.18022 95.904523) (xy 222.236237 95.756818) (xy 222.255278 95.6) (xy 222.242587 95.495475) + (xy 222.236237 95.443181) (xy 222.206765 95.36547) (xy 222.18022 95.295477) (xy 222.161707 95.268656) + (xy 222.139825 95.202301) (xy 222.157291 95.13465) (xy 222.208559 95.087181) (xy 222.277353 95.074964) + (xy 222.321379 95.088419) (xy 222.367635 95.112696) (xy 222.367637 95.112696) (xy 222.367638 95.112697) + (xy 222.521014 95.1505) (xy 222.521015 95.1505) (xy 222.678985 95.1505) (xy 222.832365 95.112696) + (xy 222.97224 95.039283) (xy 223.090483 94.93453) (xy 223.18022 94.804523) (xy 223.236237 94.656818) + (xy 223.255278 94.5) (xy 223.255278 94.499999) (xy 224.244722 94.499999) (xy 224.244722 94.5) (xy 224.263762 94.656818) + (xy 224.31978 94.804523) (xy 224.409517 94.93453) (xy 224.52776 95.039283) (xy 224.527762 95.039284) + (xy 224.667634 95.112696) (xy 224.821014 95.1505) (xy 224.821015 95.1505) (xy 224.978985 95.1505) + (xy 225.132365 95.112696) (xy 225.27224 95.039283) (xy 225.390483 94.93453) (xy 225.48022 94.804523) + (xy 225.536237 94.656818) (xy 225.555278 94.5) (xy 225.536237 94.343182) (xy 225.48022 94.195477) + (xy 225.390483 94.06547) (xy 225.27224 93.960717) (xy 225.272238 93.960716) (xy 225.272237 93.960715) + (xy 225.132365 93.887303) (xy 224.978986 93.8495) (xy 224.978985 93.8495) (xy 224.821015 93.8495) + (xy 224.821014 93.8495) (xy 224.667634 93.887303) (xy 224.527762 93.960715) (xy 224.409516 94.065471) + (xy 224.319781 94.195475) (xy 224.31978 94.195476) (xy 224.263762 94.343181) (xy 224.244722 94.499999) + (xy 223.255278 94.499999) (xy 223.236237 94.343182) (xy 223.18022 94.195477) (xy 223.090483 94.06547) + (xy 222.97224 93.960717) (xy 222.972238 93.960716) (xy 222.972237 93.960715) (xy 222.832365 93.887303) + (xy 222.678986 93.8495) (xy 222.678985 93.8495) (xy 222.521015 93.8495) (xy 222.521014 93.8495) + (xy 222.367634 93.887303) (xy 222.227762 93.960715) (xy 222.109516 94.065471) (xy 222.019781 94.195475) + (xy 222.01978 94.195476) (xy 221.963762 94.343181) (xy 221.944722 94.499999) (xy 221.944722 94.5) + (xy 221.963762 94.656818) (xy 222.01978 94.804523) (xy 222.019782 94.804527) (xy 222.038292 94.831344) + (xy 222.060174 94.897698) (xy 222.042708 94.96535) (xy 221.991439 95.012819) (xy 221.922646 95.025034) + (xy 221.878615 95.011578) (xy 221.832365 94.987304) (xy 221.832364 94.987303) (xy 221.832363 94.987303) + (xy 221.678986 94.9495) (xy 221.678985 94.9495) (xy 221.521015 94.9495) (xy 221.521014 94.9495) + (xy 221.367634 94.987303) (xy 221.227762 95.060715) (xy 221.109516 95.165471) (xy 221.019781 95.295475) + (xy 221.01978 95.295476) (xy 220.963762 95.443181) (xy 220.944722 95.599999) (xy 166.256315 95.599999) + (xy 166.248814 95.575273) (xy 166.248811 95.575269) (xy 166.248811 95.575266) (xy 166.155913 95.401467) + (xy 166.155909 95.40146) (xy 166.030883 95.249116) (xy 165.878539 95.12409) (xy 165.878532 95.124086) + (xy 165.704733 95.031188) (xy 165.704727 95.031186) (xy 165.516132 94.973976) (xy 165.516129 94.973975) + (xy 165.32 94.954659) (xy 165.12387 94.973975) (xy 164.935266 95.031188) (xy 164.761467 95.124086) + (xy 164.76146 95.12409) (xy 164.609116 95.249116) (xy 164.48409 95.40146) (xy 164.484086 95.401467) + (xy 164.391188 95.575266) (xy 164.333975 95.76387) (xy 164.314659 95.96) (xy 112.3005 95.96) (xy 112.3005 93.869999) + (xy 163.594722 93.869999) (xy 163.594722 93.87) (xy 163.613762 94.026818) (xy 163.66978 94.174523) + (xy 163.759517 94.30453) (xy 163.87776 94.409283) (xy 163.877762 94.409284) (xy 164.017634 94.482696) + (xy 164.171014 94.5205) (xy 164.171015 94.5205) (xy 164.328985 94.5205) (xy 164.482365 94.482696) + (xy 164.62224 94.409283) (xy 164.740483 94.30453) (xy 164.83022 94.174523) (xy 164.886237 94.026818) + (xy 164.905278 93.87) (xy 164.886237 93.713182) (xy 164.881551 93.700827) (xy 164.856408 93.63453) + (xy 164.83022 93.565477) (xy 164.740483 93.43547) (xy 164.62224 93.330717) (xy 164.622238 93.330716) + (xy 164.622237 93.330715) (xy 164.482365 93.257303) (xy 164.328986 93.2195) (xy 164.328985 93.2195) + (xy 164.171015 93.2195) (xy 164.171014 93.2195) (xy 164.017634 93.257303) (xy 163.877762 93.330715) + (xy 163.759516 93.435471) (xy 163.669781 93.565475) (xy 163.66978 93.565476) (xy 163.613762 93.713181) + (xy 163.594722 93.869999) (xy 112.3005 93.869999) (xy 112.3005 92.699999) (xy 167.044722 92.699999) + (xy 167.044722 92.7) (xy 167.063762 92.856818) (xy 167.078424 92.895477) (xy 167.11978 93.004523) + (xy 167.209517 93.13453) (xy 167.32776 93.239283) (xy 167.327762 93.239284) (xy 167.467634 93.312696) + (xy 167.621014 93.3505) (xy 167.621015 93.3505) (xy 167.778985 93.3505) (xy 167.932365 93.312696) + (xy 168.07224 93.239283) (xy 168.190483 93.13453) (xy 168.28022 93.004523) (xy 168.336237 92.856818) + (xy 168.355278 92.7) (xy 168.345564 92.619994) (xy 176.729529 92.619994) (xy 176.729529 92.620005) + (xy 176.749379 92.859559) (xy 176.808389 93.092589) (xy 176.904951 93.312729) (xy 176.985143 93.435471) + (xy 177.036429 93.513969) (xy 177.199236 93.690825) (xy 177.199239 93.690827) (xy 177.199242 93.69083) + (xy 177.388924 93.838466) (xy 177.38893 93.83847) (xy 177.388933 93.838472) (xy 177.600344 93.952882) + (xy 177.600347 93.952883) (xy 177.827699 94.030933) (xy 177.827701 94.030933) (xy 177.827703 94.030934) + (xy 178.064808 94.0705) (xy 178.064809 94.0705) (xy 178.305191 94.0705) (xy 178.305192 94.0705) + (xy 178.542297 94.030934) (xy 178.769656 93.952882) (xy 178.981067 93.838472) (xy 179.170764 93.690825) + (xy 179.333571 93.513969) (xy 179.465049 93.312728) (xy 179.56161 93.092591) (xy 179.62062 92.859563) + (xy 179.637097 92.660717) (xy 179.640471 92.620005) (xy 179.640471 92.619994) (xy 179.621449 92.39044) + (xy 179.62062 92.380437) (xy 179.56161 92.147409) (xy 179.465049 91.927272) (xy 179.333571 91.726031) + (xy 179.170764 91.549175) (xy 179.170759 91.549171) (xy 179.170757 91.549169) (xy 178.981075 91.401533) + (xy 178.981069 91.401529) (xy 178.969598 91.395321) (xy 180.1345 91.395321) (xy 180.1345 93.844678) + (xy 180.149032 93.917735) (xy 180.149033 93.917739) (xy 180.167405 93.945235) (xy 180.204399 94.000601) + (xy 180.264763 94.040934) (xy 180.28726 94.055966) (xy 180.287264 94.055967) (xy 180.360321 94.070499) + (xy 180.360324 94.0705) (xy 180.360326 94.0705) (xy 182.809676 94.0705) (xy 182.809677 94.070499) + (xy 182.88274 94.055966) (xy 182.965601 94.000601) (xy 183.020966 93.91774) (xy 183.0355 93.844674) + (xy 183.0355 92.619994) (xy 185.91953 92.619994) (xy 185.91953 92.620005) (xy 185.93938 92.859559) + (xy 185.99839 93.092589) (xy 186.094952 93.312729) (xy 186.175144 93.435471) (xy 186.22643 93.513969) + (xy 186.389237 93.690825) (xy 186.38924 93.690827) (xy 186.389243 93.69083) (xy 186.578925 93.838466) + (xy 186.578931 93.83847) (xy 186.578934 93.838472) (xy 186.790345 93.952882) (xy 186.790348 93.952883) + (xy 187.0177 94.030933) (xy 187.017702 94.030933) (xy 187.017704 94.030934) (xy 187.254809 94.0705) + (xy 187.25481 94.0705) (xy 187.495192 94.0705) (xy 187.495193 94.0705) (xy 187.732298 94.030934) + (xy 187.959657 93.952882) (xy 188.171068 93.838472) (xy 188.360765 93.690825) (xy 188.523572 93.513969) + (xy 188.65505 93.312728) (xy 188.751611 93.092591) (xy 188.810621 92.859563) (xy 188.827098 92.660717) + (xy 188.830472 92.620005) (xy 188.830472 92.619994) (xy 188.81145 92.39044) (xy 188.810621 92.380437) + (xy 188.751611 92.147409) (xy 188.65505 91.927272) (xy 188.523572 91.726031) (xy 188.360765 91.549175) + (xy 188.36076 91.549171) (xy 188.360758 91.549169) (xy 188.171076 91.401533) (xy 188.17107 91.401529) + (xy 188.159599 91.395321) (xy 189.324501 91.395321) (xy 189.324501 93.844678) (xy 189.339033 93.917735) + (xy 189.339034 93.917739) (xy 189.357406 93.945235) (xy 189.3944 94.000601) (xy 189.454764 94.040934) + (xy 189.477261 94.055966) (xy 189.477265 94.055967) (xy 189.550322 94.070499) (xy 189.550325 94.0705) + (xy 189.550327 94.0705) (xy 191.999677 94.0705) (xy 191.999678 94.070499) (xy 192.072741 94.055966) + (xy 192.155602 94.000601) (xy 192.210967 93.91774) (xy 192.225501 93.844674) (xy 192.225501 93.199999) + (xy 223.245722 93.199999) (xy 223.245722 93.2) (xy 223.264762 93.356818) (xy 223.294592 93.435471) + (xy 223.32078 93.504523) (xy 223.410517 93.63453) (xy 223.52876 93.739283) (xy 223.528762 93.739284) + (xy 223.668634 93.812696) (xy 223.822014 93.8505) (xy 223.822015 93.8505) (xy 223.979985 93.8505) + (xy 224.133365 93.812696) (xy 224.27324 93.739283) (xy 224.391483 93.63453) (xy 224.48122 93.504523) + (xy 224.537237 93.356818) (xy 224.556278 93.2) (xy 224.537237 93.043182) (xy 224.48122 92.895477) + (xy 224.391483 92.76547) (xy 224.27324 92.660717) (xy 224.273238 92.660716) (xy 224.273237 92.660715) + (xy 224.214704 92.629994) (xy 233.979529 92.629994) (xy 233.979529 92.630005) (xy 233.999379 92.869559) + (xy 234.058389 93.102589) (xy 234.154951 93.322729) (xy 234.173095 93.3505) (xy 234.286429 93.523969) + (xy 234.449236 93.700825) (xy 234.449239 93.700827) (xy 234.449242 93.70083) (xy 234.638924 93.848466) + (xy 234.63893 93.84847) (xy 234.638933 93.848472) (xy 234.850344 93.962882) (xy 234.850347 93.962883) + (xy 235.077699 94.040933) (xy 235.077701 94.040933) (xy 235.077703 94.040934) (xy 235.314808 94.0805) + (xy 235.314809 94.0805) (xy 235.555191 94.0805) (xy 235.555192 94.0805) (xy 235.792297 94.040934) + (xy 236.019656 93.962882) (xy 236.231067 93.848472) (xy 236.420764 93.700825) (xy 236.583571 93.523969) + (xy 236.715049 93.322728) (xy 236.81161 93.102591) (xy 236.87062 92.869563) (xy 236.890471 92.63) + (xy 236.889642 92.62) (xy 236.877237 92.470291) (xy 236.87062 92.390437) (xy 236.81161 92.157409) + (xy 236.715049 91.937272) (xy 236.708514 91.92727) (xy 236.583572 91.736033) (xy 236.583571 91.736031) + (xy 236.420764 91.559175) (xy 236.420759 91.559171) (xy 236.420757 91.559169) (xy 236.231075 91.411533) + (xy 236.231069 91.411529) (xy 236.219598 91.405321) (xy 237.3845 91.405321) (xy 237.3845 93.854678) + (xy 237.399032 93.927735) (xy 237.399033 93.927739) (xy 237.399034 93.92774) (xy 237.454399 94.010601) + (xy 237.522294 94.055966) (xy 237.53726 94.065966) (xy 237.537264 94.065967) (xy 237.610321 94.080499) + (xy 237.610324 94.0805) (xy 237.610326 94.0805) (xy 240.059676 94.0805) (xy 240.059677 94.080499) + (xy 240.13274 94.065966) (xy 240.215601 94.010601) (xy 240.270966 93.92774) (xy 240.2855 93.854674) + (xy 240.2855 92.629994) (xy 244.269529 92.629994) (xy 244.269529 92.630005) (xy 244.289379 92.869559) + (xy 244.348389 93.102589) (xy 244.444951 93.322729) (xy 244.463095 93.3505) (xy 244.576429 93.523969) + (xy 244.739236 93.700825) (xy 244.739239 93.700827) (xy 244.739242 93.70083) (xy 244.928924 93.848466) + (xy 244.92893 93.84847) (xy 244.928933 93.848472) (xy 245.140344 93.962882) (xy 245.140347 93.962883) + (xy 245.367699 94.040933) (xy 245.367701 94.040933) (xy 245.367703 94.040934) (xy 245.604808 94.0805) + (xy 245.604809 94.0805) (xy 245.845191 94.0805) (xy 245.845192 94.0805) (xy 246.082297 94.040934) + (xy 246.309656 93.962882) (xy 246.521067 93.848472) (xy 246.710764 93.700825) (xy 246.873571 93.523969) + (xy 247.005049 93.322728) (xy 247.10161 93.102591) (xy 247.16062 92.869563) (xy 247.180471 92.63) + (xy 247.179642 92.62) (xy 247.167237 92.470291) (xy 247.16062 92.390437) (xy 247.10161 92.157409) (xy 247.005049 91.937272) (xy 246.998514 91.92727) (xy 246.873572 91.736033) (xy 246.873571 91.736031) (xy 246.710764 91.559175) (xy 246.710759 91.559171) (xy 246.710757 91.559169) (xy 246.521075 91.411533) (xy 246.521069 91.411529) (xy 246.509598 91.405321) (xy 247.6745 91.405321) (xy 247.6745 93.854678) @@ -169366,17 +173827,37 @@ (xy 113.07408 233.424394) (xy 112.894163 233.28971) (xy 112.880792 233.278124) (xy 112.721875 233.119207) (xy 112.710289 233.105836) (xy 112.575605 232.925919) (xy 112.56604 232.911036) (xy 112.45833 232.713782) (xy 112.450983 232.697694) (xy 112.372437 232.487103) (xy 112.367458 232.470144) (xy 112.319683 232.250529) - (xy 112.317165 232.233017) (xy 112.300816 232.004418) (xy 112.3005 231.995572) (xy 112.3005 230.799999) - (xy 204.144722 230.799999) (xy 204.144722 230.8) (xy 204.163762 230.956818) (xy 204.195038 231.039284) - (xy 204.21978 231.104523) (xy 204.309517 231.23453) (xy 204.42776 231.339283) (xy 204.427762 231.339284) - (xy 204.567634 231.412696) (xy 204.721014 231.4505) (xy 204.721015 231.4505) (xy 204.878985 231.4505) - (xy 205.032365 231.412696) (xy 205.17224 231.339283) (xy 205.290483 231.23453) (xy 205.38022 231.104523) - (xy 205.436237 230.956818) (xy 205.455278 230.8) (xy 205.455278 230.799999) (xy 214.344722 230.799999) - (xy 214.344722 230.8) (xy 214.363762 230.956818) (xy 214.395038 231.039284) (xy 214.41978 231.104523) + (xy 112.317165 232.233017) (xy 112.303309 232.039283) (xy 112.300816 232.004418) (xy 112.3005 231.995572) + (xy 112.3005 231.499999) (xy 245.544722 231.499999) (xy 245.544722 231.5) (xy 245.563762 231.656818) + (xy 245.595038 231.739284) (xy 245.61978 231.804523) (xy 245.709517 231.93453) (xy 245.82776 232.039283) + (xy 245.827762 232.039284) (xy 245.967634 232.112696) (xy 246.121014 232.1505) (xy 246.121015 232.1505) + (xy 246.278985 232.1505) (xy 246.432365 232.112696) (xy 246.57224 232.039283) (xy 246.690483 231.93453) + (xy 246.78022 231.804523) (xy 246.836237 231.656818) (xy 246.855278 231.5) (xy 246.844678 231.412696) + (xy 246.836237 231.343181) (xy 246.814992 231.287164) (xy 246.781935 231.199999) (xy 264.344722 231.199999) + (xy 264.344722 231.2) (xy 264.363762 231.356818) (xy 264.418064 231.499999) (xy 264.41978 231.504523) + (xy 264.509517 231.63453) (xy 264.62776 231.739283) (xy 264.627762 231.739284) (xy 264.767634 231.812696) + (xy 264.921014 231.8505) (xy 264.921015 231.8505) (xy 265.078985 231.8505) (xy 265.232365 231.812696) + (xy 265.247937 231.804523) (xy 265.37224 231.739283) (xy 265.490483 231.63453) (xy 265.58022 231.504523) + (xy 265.636237 231.356818) (xy 265.655278 231.2) (xy 265.644678 231.112696) (xy 265.636237 231.043181) + (xy 265.604961 230.960715) (xy 265.58022 230.895477) (xy 265.490483 230.76547) (xy 265.37224 230.660717) + (xy 265.372238 230.660716) (xy 265.372237 230.660715) (xy 265.232365 230.587303) (xy 265.078986 230.5495) + (xy 265.078985 230.5495) (xy 264.921015 230.5495) (xy 264.921014 230.5495) (xy 264.767634 230.587303) + (xy 264.627762 230.660715) (xy 264.509516 230.765471) (xy 264.419781 230.895475) (xy 264.41978 230.895476) + (xy 264.363762 231.043181) (xy 264.344722 231.199999) (xy 246.781935 231.199999) (xy 246.78022 231.195477) + (xy 246.690483 231.06547) (xy 246.57224 230.960717) (xy 246.572238 230.960716) (xy 246.572237 230.960715) + (xy 246.432365 230.887303) (xy 246.278986 230.8495) (xy 246.278985 230.8495) (xy 246.121015 230.8495) + (xy 246.121014 230.8495) (xy 245.967634 230.887303) (xy 245.827762 230.960715) (xy 245.709516 231.065471) + (xy 245.619781 231.195475) (xy 245.61978 231.195476) (xy 245.563762 231.343181) (xy 245.544722 231.499999) + (xy 112.3005 231.499999) (xy 112.3005 230.799999) (xy 204.144722 230.799999) (xy 204.144722 230.8) + (xy 204.163762 230.956818) (xy 204.21978 231.104523) (xy 204.309517 231.23453) (xy 204.42776 231.339283) + (xy 204.427762 231.339284) (xy 204.567634 231.412696) (xy 204.721014 231.4505) (xy 204.721015 231.4505) + (xy 204.878985 231.4505) (xy 205.032365 231.412696) (xy 205.17224 231.339283) (xy 205.290483 231.23453) + (xy 205.38022 231.104523) (xy 205.436237 230.956818) (xy 205.455278 230.8) (xy 205.455278 230.799999) + (xy 214.344722 230.799999) (xy 214.344722 230.8) (xy 214.363762 230.956818) (xy 214.41978 231.104523) (xy 214.509517 231.23453) (xy 214.62776 231.339283) (xy 214.627762 231.339284) (xy 214.767634 231.412696) (xy 214.921014 231.4505) (xy 214.921015 231.4505) (xy 215.078985 231.4505) (xy 215.232365 231.412696) (xy 215.37224 231.339283) (xy 215.490483 231.23453) (xy 215.58022 231.104523) (xy 215.636237 230.956818) - (xy 215.655278 230.8) (xy 215.644678 230.712696) (xy 215.636237 230.643181) (xy 215.614992 230.587164) + (xy 215.655278 230.8) (xy 215.651086 230.765471) (xy 215.636237 230.643181) (xy 215.600708 230.5495) (xy 215.581935 230.499999) (xy 224.44473 230.499999) (xy 224.44473 230.5) (xy 224.46377 230.656818) (xy 224.518072 230.799999) (xy 224.519788 230.804523) (xy 224.609525 230.93453) (xy 224.727768 231.039283) (xy 224.72777 231.039284) (xy 224.867642 231.112696) (xy 225.021022 231.1505) (xy 225.021023 231.1505) @@ -169391,7 +173872,7 @@ (xy 215.232365 230.187303) (xy 215.078986 230.1495) (xy 215.078985 230.1495) (xy 214.921015 230.1495) (xy 214.921014 230.1495) (xy 214.767634 230.187303) (xy 214.627762 230.260715) (xy 214.509516 230.365471) (xy 214.419781 230.495475) (xy 214.41978 230.495476) (xy 214.363762 230.643181) (xy 214.344722 230.799999) - (xy 205.455278 230.799999) (xy 205.444678 230.712696) (xy 205.436237 230.643181) (xy 205.414992 230.587164) + (xy 205.455278 230.799999) (xy 205.451086 230.765471) (xy 205.436237 230.643181) (xy 205.400708 230.5495) (xy 205.38022 230.495477) (xy 205.290483 230.36547) (xy 205.17224 230.260717) (xy 205.172238 230.260716) (xy 205.172237 230.260715) (xy 205.032365 230.187303) (xy 204.878986 230.1495) (xy 204.878985 230.1495) (xy 204.721015 230.1495) (xy 204.721014 230.1495) (xy 204.567634 230.187303) (xy 204.427762 230.260715) @@ -169399,369 +173880,369 @@ (xy 204.144722 230.799999) (xy 112.3005 230.799999) (xy 112.3005 230.099999) (xy 158.944722 230.099999) (xy 158.944722 230.1) (xy 158.963762 230.256818) (xy 159.01978 230.404523) (xy 159.109517 230.53453) (xy 159.22776 230.639283) (xy 159.227762 230.639284) (xy 159.367634 230.712696) (xy 159.521014 230.7505) - (xy 159.521015 230.7505) (xy 159.678985 230.7505) (xy 159.832365 230.712696) (xy 159.97224 230.639283) - (xy 160.090483 230.53453) (xy 160.18022 230.404523) (xy 160.236237 230.256818) (xy 160.255278 230.1) - (xy 160.251086 230.065471) (xy 160.236237 229.943181) (xy 160.200708 229.8495) (xy 160.18022 229.795477) - (xy 160.090483 229.66547) (xy 159.97224 229.560717) (xy 159.972238 229.560716) (xy 159.972237 229.560715) - (xy 159.832365 229.487303) (xy 159.678986 229.4495) (xy 159.678985 229.4495) (xy 159.521015 229.4495) - (xy 159.521014 229.4495) (xy 159.367634 229.487303) (xy 159.227762 229.560715) (xy 159.109516 229.665471) - (xy 159.019781 229.795475) (xy 159.01978 229.795476) (xy 158.963762 229.943181) (xy 158.944722 230.099999) - (xy 112.3005 230.099999) (xy 112.3005 229.399999) (xy 219.944722 229.399999) (xy 219.944722 229.4) - (xy 219.963762 229.556818) (xy 220.01978 229.704523) (xy 220.109517 229.83453) (xy 220.22776 229.939283) - (xy 220.227762 229.939284) (xy 220.367634 230.012696) (xy 220.521014 230.0505) (xy 220.521015 230.0505) - (xy 220.678985 230.0505) (xy 220.832365 230.012696) (xy 220.931401 229.960717) (xy 220.97224 229.939283) - (xy 221.090483 229.83453) (xy 221.18022 229.704523) (xy 221.236237 229.556818) (xy 221.255278 229.4) - (xy 221.244678 229.312696) (xy 221.236237 229.243181) (xy 221.201087 229.1505) (xy 221.18022 229.095477) - (xy 221.090483 228.96547) (xy 220.97224 228.860717) (xy 220.972238 228.860716) (xy 220.972237 228.860715) - (xy 220.832365 228.787303) (xy 220.678986 228.7495) (xy 220.678985 228.7495) (xy 220.521015 228.7495) - (xy 220.521014 228.7495) (xy 220.367634 228.787303) (xy 220.227762 228.860715) (xy 220.22776 228.860717) - (xy 220.124475 228.952219) (xy 220.109516 228.965471) (xy 220.019781 229.095475) (xy 220.01978 229.095476) - (xy 219.963762 229.243181) (xy 219.944722 229.399999) (xy 112.3005 229.399999) (xy 112.3005 226.210186) - (xy 117.1745 226.210186) (xy 117.1745 226.479813) (xy 117.204686 226.747719) (xy 117.204688 226.747731) - (xy 117.264684 227.010594) (xy 117.264687 227.010602) (xy 117.353734 227.265082) (xy 117.470714 227.507994) - (xy 117.470716 227.507997) (xy 117.614162 227.736289) (xy 117.782266 227.947085) (xy 117.972915 228.137734) - (xy 118.183711 228.305838) (xy 118.398775 228.440972) (xy 118.412005 228.449285) (xy 118.49095 228.487303) - (xy 118.654921 228.566267) (xy 118.787608 228.612696) (xy 118.909397 228.655312) (xy 118.909405 228.655315) - (xy 118.909408 228.655315) (xy 118.909409 228.655316) (xy 119.172268 228.715312) (xy 119.440187 228.745499) - (xy 119.440188 228.7455) (xy 119.440191 228.7455) (xy 119.709812 228.7455) (xy 119.709812 228.745499) - (xy 119.977732 228.715312) (xy 120.044822 228.699999) (xy 147.944722 228.699999) (xy 147.944722 228.7) - (xy 147.963762 228.856818) (xy 148.01978 229.004523) (xy 148.109517 229.13453) (xy 148.22776 229.239283) - (xy 148.227762 229.239284) (xy 148.367634 229.312696) (xy 148.521014 229.3505) (xy 148.521015 229.3505) - (xy 148.678985 229.3505) (xy 148.832365 229.312696) (xy 148.97224 229.239283) (xy 149.090483 229.13453) - (xy 149.18022 229.004523) (xy 149.236237 228.856818) (xy 149.255278 228.7) (xy 149.251086 228.665471) - (xy 149.236237 228.543181) (xy 149.200708 228.4495) (xy 149.18022 228.395477) (xy 149.106926 228.289292) - (xy 169.0495 228.289292) (xy 169.0495 228.439107) (xy 169.078723 228.586022) (xy 169.078725 228.58603) - (xy 169.136051 228.724429) (xy 169.136056 228.724438) (xy 169.21928 228.84899) (xy 169.219283 228.848994) - (xy 169.325205 228.954916) (xy 169.325209 228.954919) (xy 169.449761 229.038143) (xy 169.44977 229.038148) - (xy 169.452513 229.039284) (xy 169.58817 229.095475) (xy 169.674748 229.112696) (xy 169.735092 229.124699) - (xy 169.735096 229.1247) (xy 169.735097 229.1247) (xy 169.884904 229.1247) (xy 169.884905 229.124699) - (xy 170.03183 229.095475) (xy 170.170232 229.038147) (xy 170.294791 228.954919) (xy 170.400719 228.848991) - (xy 170.483947 228.724432) (xy 170.541275 228.58603) (xy 170.5705 228.439103) (xy 170.5705 228.289297) - (xy 170.569962 228.286592) (xy 185.413701 228.286592) (xy 185.413701 228.436407) (xy 185.442924 228.583322) - (xy 185.442926 228.58333) (xy 185.500252 228.721729) (xy 185.500257 228.721738) (xy 185.583481 228.84629) - (xy 185.583484 228.846294) (xy 185.689406 228.952216) (xy 185.68941 228.952219) (xy 185.813962 229.035443) - (xy 185.813971 229.035448) (xy 185.82323 229.039283) (xy 185.952371 229.092775) (xy 186.052523 229.112696) - (xy 186.099293 229.121999) (xy 186.099297 229.122) (xy 186.099298 229.122) (xy 186.249105 229.122) - (xy 186.249106 229.121999) (xy 186.396031 229.092775) (xy 186.534433 229.035447) (xy 186.658992 228.952219) - (xy 186.76492 228.846291) (xy 186.848148 228.721732) (xy 186.905476 228.58333) (xy 186.934701 228.436403) - (xy 186.934701 228.286597) (xy 186.905476 228.13967) (xy 186.849267 228.00397) (xy 186.848149 228.00127) - (xy 186.848144 228.001261) (xy 186.847301 227.999999) (xy 202.444722 227.999999) (xy 202.444722 228) - (xy 202.463762 228.156818) (xy 202.51978 228.304523) (xy 202.609517 228.43453) (xy 202.72776 228.539283) - (xy 202.727762 228.539284) (xy 202.867634 228.612696) (xy 203.021014 228.6505) (xy 203.021015 228.6505) - (xy 203.178985 228.6505) (xy 203.332365 228.612696) (xy 203.383187 228.586022) (xy 203.47224 228.539283) - (xy 203.516583 228.499999) (xy 244.844722 228.499999) (xy 244.844722 228.5) (xy 244.863762 228.656818) - (xy 244.916349 228.795476) (xy 244.91978 228.804523) (xy 245.009517 228.93453) (xy 245.12776 229.039283) - (xy 245.127762 229.039284) (xy 245.267634 229.112696) (xy 245.421014 229.1505) (xy 245.421015 229.1505) - (xy 245.578985 229.1505) (xy 245.732365 229.112696) (xy 245.774379 229.090644) (xy 245.842886 229.076918) - (xy 245.90794 229.102409) (xy 245.948885 229.159024) (xy 245.955102 229.185493) (xy 245.961634 229.239283) - (xy 245.963763 229.256818) (xy 246.01978 229.404523) (xy 246.109517 229.53453) (xy 246.22776 229.639283) - (xy 246.227762 229.639284) (xy 246.367634 229.712696) (xy 246.521014 229.7505) (xy 246.521015 229.7505) - (xy 246.678985 229.7505) (xy 246.832365 229.712696) (xy 246.847937 229.704523) (xy 246.97224 229.639283) - (xy 247.090483 229.53453) (xy 247.18022 229.404523) (xy 247.236237 229.256818) (xy 247.255278 229.1) - (xy 247.254729 229.095474) (xy 247.236237 228.943181) (xy 247.204961 228.860715) (xy 247.18022 228.795477) - (xy 247.090483 228.66547) (xy 246.97224 228.560717) (xy 246.972238 228.560716) (xy 246.972237 228.560715) - (xy 246.832365 228.487303) (xy 246.678986 228.4495) (xy 246.678985 228.4495) (xy 246.521015 228.4495) - (xy 246.521014 228.4495) (xy 246.367635 228.487303) (xy 246.325618 228.509356) (xy 246.25711 228.52308) - (xy 246.192057 228.497588) (xy 246.151113 228.440972) (xy 246.144897 228.414505) (xy 246.136237 228.343182) - (xy 246.08022 228.195477) (xy 245.990483 228.06547) (xy 245.87224 227.960717) (xy 245.872238 227.960716) - (xy 245.872237 227.960715) (xy 245.732365 227.887303) (xy 245.578986 227.8495) (xy 245.578985 227.8495) - (xy 245.421015 227.8495) (xy 245.421014 227.8495) (xy 245.267634 227.887303) (xy 245.127762 227.960715) - (xy 245.009516 228.065471) (xy 244.919781 228.195475) (xy 244.91978 228.195476) (xy 244.863762 228.343181) - (xy 244.844722 228.499999) (xy 203.516583 228.499999) (xy 203.590483 228.43453) (xy 203.68022 228.304523) - (xy 203.736237 228.156818) (xy 203.755278 228) (xy 203.740308 227.876705) (xy 203.736237 227.843181) - (xy 203.709803 227.773481) (xy 203.68022 227.695477) (xy 203.590483 227.56547) (xy 203.47224 227.460717) - (xy 203.472238 227.460716) (xy 203.472237 227.460715) (xy 203.332365 227.387303) (xy 203.178986 227.3495) - (xy 203.178985 227.3495) (xy 203.021015 227.3495) (xy 203.021014 227.3495) (xy 202.867634 227.387303) - (xy 202.727762 227.460715) (xy 202.609516 227.565471) (xy 202.519781 227.695475) (xy 202.51978 227.695476) - (xy 202.463762 227.843181) (xy 202.444722 227.999999) (xy 186.847301 227.999999) (xy 186.76492 227.876709) - (xy 186.764917 227.876705) (xy 186.658995 227.770783) (xy 186.658991 227.77078) (xy 186.534439 227.687556) - (xy 186.53443 227.687551) (xy 186.396031 227.630225) (xy 186.396023 227.630223) (xy 186.249108 227.601) - (xy 186.249104 227.601) (xy 186.099298 227.601) (xy 186.099293 227.601) (xy 185.952378 227.630223) - (xy 185.95237 227.630225) (xy 185.813971 227.687551) (xy 185.813962 227.687556) (xy 185.68941 227.77078) - (xy 185.689406 227.770783) (xy 185.583484 227.876705) (xy 185.583481 227.876709) (xy 185.500257 228.001261) - (xy 185.500252 228.00127) (xy 185.442926 228.139669) (xy 185.442924 228.139677) (xy 185.413701 228.286592) - (xy 170.569962 228.286592) (xy 170.541275 228.14237) (xy 170.483947 228.003968) (xy 170.483946 228.003967) - (xy 170.483943 228.003961) (xy 170.400719 227.879409) (xy 170.400716 227.879405) (xy 170.294794 227.773483) - (xy 170.29479 227.77348) (xy 170.170238 227.690256) (xy 170.170229 227.690251) (xy 170.03183 227.632925) - (xy 170.031822 227.632923) (xy 169.884907 227.6037) (xy 169.884903 227.6037) (xy 169.735097 227.6037) - (xy 169.735092 227.6037) (xy 169.588177 227.632923) (xy 169.588169 227.632925) (xy 169.44977 227.690251) - (xy 169.449761 227.690256) (xy 169.325209 227.77348) (xy 169.325205 227.773483) (xy 169.219283 227.879405) - (xy 169.21928 227.879409) (xy 169.136056 228.003961) (xy 169.136051 228.00397) (xy 169.078725 228.142369) - (xy 169.078723 228.142377) (xy 169.0495 228.289292) (xy 149.106926 228.289292) (xy 149.090483 228.26547) - (xy 148.97224 228.160717) (xy 148.972238 228.160716) (xy 148.972237 228.160715) (xy 148.832365 228.087303) - (xy 148.678986 228.0495) (xy 148.678985 228.0495) (xy 148.521015 228.0495) (xy 148.521014 228.0495) - (xy 148.367634 228.087303) (xy 148.227762 228.160715) (xy 148.109516 228.265471) (xy 148.019781 228.395475) - (xy 148.01978 228.395476) (xy 147.963762 228.543181) (xy 147.944722 228.699999) (xy 120.044822 228.699999) - (xy 120.240591 228.655316) (xy 120.495079 228.566267) (xy 120.737997 228.449284) (xy 120.966289 228.305838) - (xy 121.177085 228.137734) (xy 121.367734 227.947085) (xy 121.535838 227.736289) (xy 121.679284 227.507997) - (xy 121.796267 227.265079) (xy 121.885316 227.010591) (xy 121.887734 226.999999) (xy 230.894722 226.999999) - (xy 230.894722 227) (xy 230.913762 227.156818) (xy 230.958461 227.274678) (xy 230.96978 227.304523) - (xy 231.059517 227.43453) (xy 231.17776 227.539283) (xy 231.177762 227.539284) (xy 231.317634 227.612696) - (xy 231.471014 227.6505) (xy 231.471015 227.6505) (xy 231.628985 227.6505) (xy 231.782365 227.612696) - (xy 231.799505 227.6037) (xy 231.92224 227.539283) (xy 232.040483 227.43453) (xy 232.13022 227.304523) - (xy 232.186237 227.156818) (xy 232.205278 227) (xy 232.198932 226.947731) (xy 232.186237 226.843181) - (xy 232.164992 226.787164) (xy 232.13022 226.695477) (xy 232.040483 226.56547) (xy 231.92224 226.460717) - (xy 231.922238 226.460716) (xy 231.922237 226.460715) (xy 231.782365 226.387303) (xy 231.628986 226.3495) - (xy 231.628985 226.3495) (xy 231.471015 226.3495) (xy 231.471014 226.3495) (xy 231.317634 226.387303) - (xy 231.177762 226.460715) (xy 231.059516 226.565471) (xy 230.969781 226.695475) (xy 230.96978 226.695476) - (xy 230.913762 226.843181) (xy 230.894722 226.999999) (xy 121.887734 226.999999) (xy 121.945312 226.747732) - (xy 121.9755 226.479809) (xy 121.9755 226.210191) (xy 121.945312 225.942268) (xy 121.885316 225.679409) - (xy 121.796267 225.424921) (xy 121.736108 225.299999) (xy 157.844722 225.299999) (xy 157.844722 225.3) - (xy 157.863762 225.456818) (xy 157.906459 225.569399) (xy 157.91978 225.604523) (xy 158.009517 225.73453) - (xy 158.12776 225.839283) (xy 158.127762 225.839284) (xy 158.267634 225.912696) (xy 158.421014 225.9505) - (xy 158.421015 225.9505) (xy 158.578985 225.9505) (xy 158.732365 225.912696) (xy 158.795787 225.879409) - (xy 158.87224 225.839283) (xy 158.990483 225.73453) (xy 159.08022 225.604523) (xy 159.136237 225.456818) - (xy 159.147483 225.3642) (xy 169.744659 225.3642) (xy 169.763975 225.560329) (xy 169.821188 225.748933) - (xy 169.914086 225.922732) (xy 169.91409 225.922739) (xy 170.039116 226.075083) (xy 170.19146 226.200109) - (xy 170.191467 226.200113) (xy 170.365266 226.293011) (xy 170.365269 226.293011) (xy 170.365273 226.293014) - (xy 170.553868 226.350224) (xy 170.75 226.369541) (xy 170.946132 226.350224) (xy 171.134727 226.293014) - (xy 171.308538 226.20011) (xy 171.460883 226.075083) (xy 171.58591 225.922738) (xy 171.678814 225.748927) - (xy 171.736024 225.560332) (xy 171.755341 225.3642) (xy 172.744659 225.3642) (xy 172.763975 225.560329) - (xy 172.821188 225.748933) (xy 172.914086 225.922732) (xy 172.91409 225.922739) (xy 173.039116 226.075083) - (xy 173.19146 226.200109) (xy 173.191467 226.200113) (xy 173.365266 226.293011) (xy 173.365269 226.293011) - (xy 173.365273 226.293014) (xy 173.553868 226.350224) (xy 173.75 226.369541) (xy 173.946132 226.350224) - (xy 174.134727 226.293014) (xy 174.308538 226.20011) (xy 174.460883 226.075083) (xy 174.58591 225.922738) - (xy 174.678814 225.748927) (xy 174.736024 225.560332) (xy 174.755341 225.3642) (xy 174.736024 225.168068) - (xy 174.678814 224.979473) (xy 174.678811 224.979469) (xy 174.678811 224.979466) (xy 174.590173 224.813636) - (xy 181.233701 224.813636) (xy 181.233701 225.909363) (xy 181.233702 225.909382) (xy 181.240109 225.968981) - (xy 181.290403 226.103827) (xy 181.290404 226.103828) (xy 181.290405 226.10383) (xy 181.376655 226.219046) - (xy 181.491871 226.305296) (xy 181.491872 226.305296) (xy 181.491873 226.305297) (xy 181.626719 226.355591) - (xy 181.626718 226.355591) (xy 181.633646 226.356335) (xy 181.686329 226.362) (xy 181.686338 226.362) - (xy 182.782064 226.362) (xy 182.782073 226.362) (xy 182.841683 226.355591) (xy 182.976531 226.305296) - (xy 183.091747 226.219046) (xy 183.177997 226.10383) (xy 183.228292 225.968982) (xy 183.230333 225.949999) - (xy 239.094722 225.949999) (xy 239.094722 225.95) (xy 239.113762 226.106818) (xy 239.149144 226.20011) - (xy 239.16978 226.254523) (xy 239.259517 226.38453) (xy 239.37776 226.489283) (xy 239.377762 226.489284) - (xy 239.517634 226.562696) (xy 239.671014 226.6005) (xy 239.671015 226.6005) (xy 239.828985 226.6005) - (xy 239.982365 226.562696) (xy 240.12224 226.489283) (xy 240.240483 226.38453) (xy 240.33022 226.254523) - (xy 240.386237 226.106818) (xy 240.405278 225.95) (xy 240.386237 225.793182) (xy 240.360501 225.725321) - (xy 242.6195 225.725321) (xy 242.6195 227.274678) (xy 242.634032 227.347735) (xy 242.634033 227.347739) - (xy 242.634034 227.34774) (xy 242.689399 227.430601) (xy 242.77226 227.485966) (xy 242.772264 227.485967) - (xy 242.845321 227.500499) (xy 242.845324 227.5005) (xy 242.845326 227.5005) (xy 244.394676 227.5005) - (xy 244.394677 227.500499) (xy 244.46774 227.485966) (xy 244.550601 227.430601) (xy 244.605966 227.34774) - (xy 244.6205 227.274674) (xy 244.6205 226.410186) (xy 267.1745 226.410186) (xy 267.1745 226.679813) - (xy 267.204686 226.947719) (xy 267.204688 226.947731) (xy 267.264684 227.210594) (xy 267.264687 227.210602) - (xy 267.353734 227.465082) (xy 267.470714 227.707994) (xy 267.511864 227.773483) (xy 267.614162 227.936289) - (xy 267.782266 228.147085) (xy 267.972915 228.337734) (xy 268.183711 228.505838) (xy 268.353774 228.612696) - (xy 268.412005 228.649285) (xy 268.445614 228.66547) (xy 268.654921 228.766267) (xy 268.846049 228.833145) - (xy 268.909397 228.855312) (xy 268.909405 228.855315) (xy 268.909408 228.855315) (xy 268.909409 228.855316) - (xy 269.172268 228.915312) (xy 269.440187 228.945499) (xy 269.440188 228.9455) (xy 269.440191 228.9455) - (xy 269.709812 228.9455) (xy 269.709812 228.945499) (xy 269.977732 228.915312) (xy 270.240591 228.855316) - (xy 270.495079 228.766267) (xy 270.737997 228.649284) (xy 270.966289 228.505838) (xy 271.177085 228.337734) - (xy 271.367734 228.147085) (xy 271.535838 227.936289) (xy 271.679284 227.707997) (xy 271.796267 227.465079) - (xy 271.885316 227.210591) (xy 271.945312 226.947732) (xy 271.9755 226.679809) (xy 271.9755 226.410191) - (xy 271.945312 226.142268) (xy 271.885316 225.879409) (xy 271.796267 225.624921) (xy 271.679284 225.382003) - (xy 271.535838 225.153711) (xy 271.367734 224.942915) (xy 271.177085 224.752266) (xy 270.966289 224.584162) - (xy 270.737997 224.440716) (xy 270.737994 224.440714) (xy 270.495082 224.323734) (xy 270.240602 224.234687) - (xy 270.240594 224.234684) (xy 270.043446 224.189687) (xy 269.977732 224.174688) (xy 269.977728 224.174687) - (xy 269.977719 224.174686) (xy 269.709813 224.1445) (xy 269.709809 224.1445) (xy 269.440191 224.1445) - (xy 269.440186 224.1445) (xy 269.17228 224.174686) (xy 269.172268 224.174688) (xy 268.909405 224.234684) - (xy 268.909397 224.234687) (xy 268.654917 224.323734) (xy 268.412005 224.440714) (xy 268.183712 224.584161) - (xy 267.972915 224.752265) (xy 267.782265 224.942915) (xy 267.614161 225.153712) (xy 267.470714 225.382005) - (xy 267.353734 225.624917) (xy 267.264687 225.879397) (xy 267.264684 225.879405) (xy 267.204688 226.142268) - (xy 267.204686 226.14228) (xy 267.1745 226.410186) (xy 244.6205 226.410186) (xy 244.6205 225.725326) - (xy 244.6205 225.725323) (xy 244.620499 225.725321) (xy 244.605967 225.652264) (xy 244.605966 225.65226) - (xy 244.57407 225.604524) (xy 244.550601 225.569399) (xy 244.469891 225.515471) (xy 244.467739 225.514033) - (xy 244.467735 225.514032) (xy 244.394677 225.4995) (xy 244.394674 225.4995) (xy 242.845326 225.4995) - (xy 242.845323 225.4995) (xy 242.772264 225.514032) (xy 242.77226 225.514033) (xy 242.689399 225.569399) - (xy 242.634033 225.65226) (xy 242.634032 225.652264) (xy 242.6195 225.725321) (xy 240.360501 225.725321) - (xy 240.33022 225.645477) (xy 240.240483 225.51547) (xy 240.12224 225.410717) (xy 240.122238 225.410716) - (xy 240.122237 225.410715) (xy 239.982365 225.337303) (xy 239.828986 225.2995) (xy 239.828985 225.2995) - (xy 239.671015 225.2995) (xy 239.671014 225.2995) (xy 239.517634 225.337303) (xy 239.377762 225.410715) - (xy 239.259516 225.515471) (xy 239.169781 225.645475) (xy 239.16978 225.645476) (xy 239.113762 225.793181) - (xy 239.094722 225.949999) (xy 183.230333 225.949999) (xy 183.234701 225.909372) (xy 183.234701 224.813628) - (xy 183.228292 224.754018) (xy 183.212204 224.710883) (xy 183.177998 224.619172) (xy 183.177997 224.619171) - (xy 183.177997 224.61917) (xy 183.091747 224.503954) (xy 182.976531 224.417704) (xy 182.976529 224.417703) - (xy 182.976528 224.417702) (xy 182.841682 224.367408) (xy 182.841683 224.367408) (xy 182.782083 224.361001) - (xy 182.782081 224.361) (xy 182.782073 224.361) (xy 181.686329 224.361) (xy 181.686321 224.361) - (xy 181.686318 224.361001) (xy 181.626719 224.367408) (xy 181.491873 224.417702) (xy 181.491871 224.417704) - (xy 181.376655 224.503954) (xy 181.290405 224.61917) (xy 181.290403 224.619172) (xy 181.240109 224.754018) - (xy 181.233702 224.813617) (xy 181.233701 224.813636) (xy 174.590173 224.813636) (xy 174.585913 224.805667) - (xy 174.585909 224.80566) (xy 174.460883 224.653316) (xy 174.308539 224.52829) (xy 174.308532 224.528286) - (xy 174.134733 224.435388) (xy 174.134727 224.435386) (xy 174.008997 224.397246) (xy 173.946129 224.378175) - (xy 173.75 224.358859) (xy 173.55387 224.378175) (xy 173.365266 224.435388) (xy 173.191467 224.528286) - (xy 173.19146 224.52829) (xy 173.039116 224.653316) (xy 172.91409 224.80566) (xy 172.914086 224.805667) - (xy 172.821188 224.979466) (xy 172.763975 225.16807) (xy 172.744659 225.3642) (xy 171.755341 225.3642) - (xy 171.736024 225.168068) (xy 171.678814 224.979473) (xy 171.678811 224.979469) (xy 171.678811 224.979466) - (xy 171.585913 224.805667) (xy 171.585909 224.80566) (xy 171.460883 224.653316) (xy 171.308539 224.52829) - (xy 171.308532 224.528286) (xy 171.134733 224.435388) (xy 171.134727 224.435386) (xy 171.008997 224.397246) - (xy 170.946129 224.378175) (xy 170.75 224.358859) (xy 170.55387 224.378175) (xy 170.365266 224.435388) - (xy 170.191467 224.528286) (xy 170.19146 224.52829) (xy 170.039116 224.653316) (xy 169.91409 224.80566) - (xy 169.914086 224.805667) (xy 169.821188 224.979466) (xy 169.763975 225.16807) (xy 169.744659 225.3642) - (xy 159.147483 225.3642) (xy 159.155278 225.3) (xy 159.137516 225.153711) (xy 159.136237 225.143181) - (xy 159.084521 225.006818) (xy 159.08022 224.995477) (xy 158.990483 224.86547) (xy 158.87224 224.760717) - (xy 158.872238 224.760716) (xy 158.872237 224.760715) (xy 158.732365 224.687303) (xy 158.578986 224.6495) - (xy 158.578985 224.6495) (xy 158.421015 224.6495) (xy 158.421014 224.6495) (xy 158.267634 224.687303) - (xy 158.127762 224.760715) (xy 158.009516 224.865471) (xy 157.919781 224.995475) (xy 157.91978 224.995476) - (xy 157.863762 225.143181) (xy 157.844722 225.299999) (xy 121.736108 225.299999) (xy 121.679284 225.182003) - (xy 121.535838 224.953711) (xy 121.367734 224.742915) (xy 121.177085 224.552266) (xy 121.168569 224.545475) - (xy 121.055566 224.455358) (xy 120.966289 224.384162) (xy 120.74439 224.244733) (xy 120.737994 224.240714) - (xy 120.495082 224.123734) (xy 120.240602 224.034687) (xy 120.240594 224.034684) (xy 120.043446 223.989687) - (xy 119.977732 223.974688) (xy 119.977728 223.974687) (xy 119.977719 223.974686) (xy 119.709813 223.9445) - (xy 119.709809 223.9445) (xy 119.440191 223.9445) (xy 119.440186 223.9445) (xy 119.17228 223.974686) - (xy 119.172268 223.974688) (xy 118.909405 224.034684) (xy 118.909397 224.034687) (xy 118.654917 224.123734) - (xy 118.412005 224.240714) (xy 118.183712 224.384161) (xy 117.972915 224.552265) (xy 117.782265 224.742915) - (xy 117.614161 224.953712) (xy 117.470714 225.182005) (xy 117.353734 225.424917) (xy 117.264687 225.679397) - (xy 117.264684 225.679405) (xy 117.204688 225.942268) (xy 117.204686 225.94228) (xy 117.1745 226.210186) - (xy 112.3005 226.210186) (xy 112.3005 222.679458) (xy 137.0735 222.679458) (xy 137.0735 222.908941) - (xy 137.095019 223.072383) (xy 137.103452 223.136438) (xy 137.145405 223.293011) (xy 137.162842 223.358087) - (xy 137.25065 223.570076) (xy 137.250657 223.57009) (xy 137.365392 223.768817) (xy 137.505081 223.950861) - (xy 137.505089 223.95087) (xy 137.66733 224.113111) (xy 137.667338 224.113118) (xy 137.667339 224.113119) - (xy 137.681173 224.123734) (xy 137.849382 224.252807) (xy 137.849385 224.252808) (xy 137.849388 224.252811) - (xy 138.048112 224.367544) (xy 138.048117 224.367546) (xy 138.048123 224.367549) (xy 138.13948 224.40539) - (xy 138.260113 224.455358) (xy 138.481762 224.514748) (xy 138.709266 224.5447) (xy 138.709273 224.5447) - (xy 138.938727 224.5447) (xy 138.938734 224.5447) (xy 139.166238 224.514748) (xy 139.387887 224.455358) - (xy 139.599888 224.367544) (xy 139.798612 224.252811) (xy 139.980661 224.113119) (xy 139.980665 224.113114) - (xy 139.98067 224.113111) (xy 140.142911 223.95087) (xy 140.142914 223.950865) (xy 140.142919 223.950861) - (xy 140.282611 223.768812) (xy 140.397344 223.570088) (xy 140.485158 223.358087) (xy 140.544548 223.136438) - (xy 140.5745 222.908934) (xy 140.5745 222.679466) (xy 140.544548 222.451962) (xy 140.521033 222.3642) - (xy 169.744659 222.3642) (xy 169.763975 222.560329) (xy 169.821188 222.748933) (xy 169.914086 222.922732) - (xy 169.91409 222.922739) (xy 170.039116 223.075083) (xy 170.19146 223.200109) (xy 170.191467 223.200113) - (xy 170.365266 223.293011) (xy 170.365269 223.293011) (xy 170.365273 223.293014) (xy 170.553868 223.350224) - (xy 170.75 223.369541) (xy 170.946132 223.350224) (xy 171.134727 223.293014) (xy 171.139779 223.290314) - (xy 171.308532 223.200113) (xy 171.308538 223.20011) (xy 171.460883 223.075083) (xy 171.58591 222.922738) - (xy 171.678814 222.748927) (xy 171.736024 222.560332) (xy 171.755341 222.3642) (xy 171.755075 222.3615) - (xy 181.22886 222.3615) (xy 181.248176 222.557629) (xy 181.305389 222.746233) (xy 181.398287 222.920032) - (xy 181.398291 222.920039) (xy 181.523317 223.072383) (xy 181.675661 223.197409) (xy 181.675668 223.197413) - (xy 181.849467 223.290311) (xy 181.84947 223.290311) (xy 181.849474 223.290314) (xy 182.038069 223.347524) - (xy 182.234201 223.366841) (xy 182.430333 223.347524) (xy 182.618928 223.290314) (xy 182.621168 223.289117) - (xy 182.787682 223.200113) (xy 182.792739 223.19741) (xy 182.945084 223.072383) (xy 183.070111 222.920038) - (xy 183.116563 222.833132) (xy 183.163012 222.746233) (xy 183.163012 222.746232) (xy 183.163015 222.746227) - (xy 183.220225 222.557632) (xy 183.239542 222.3615) (xy 183.220225 222.165368) (xy 183.170061 221.999999) - (xy 231.744722 221.999999) (xy 231.744722 222) (xy 231.763762 222.156818) (xy 231.81978 222.304523) - (xy 231.909517 222.43453) (xy 232.02776 222.539283) (xy 232.027762 222.539284) (xy 232.167634 222.612696) - (xy 232.246796 222.632207) (xy 232.307177 222.667363) (xy 232.338966 222.729582) (xy 232.332071 222.79911) - (xy 232.28868 222.853873) (xy 232.253406 222.869027) (xy 232.253544 222.86936) (xy 232.24226 222.874033) - (xy 232.159399 222.929399) (xy 232.104033 223.01226) (xy 232.104032 223.012264) (xy 232.0895 223.085321) - (xy 232.0895 224.634678) (xy 232.104032 224.707735) (xy 232.104033 224.707739) (xy 232.104034 224.70774) - (xy 232.159399 224.790601) (xy 232.24226 224.845966) (xy 232.242264 224.845967) (xy 232.315321 224.860499) - (xy 232.315324 224.8605) (xy 232.315326 224.8605) (xy 233.864676 224.8605) (xy 233.864677 224.860499) - (xy 233.93774 224.845966) (xy 234.020601 224.790601) (xy 234.075966 224.70774) (xy 234.0905 224.634674) - (xy 234.0905 223.86) (xy 234.584659 223.86) (xy 234.603975 224.056129) (xy 234.603976 224.056132) - (xy 234.65814 224.234687) (xy 234.661188 224.244733) (xy 234.754086 224.418532) (xy 234.75409 224.418539) - (xy 234.879116 224.570883) (xy 235.03146 224.695909) (xy 235.031467 224.695913) (xy 235.205266 224.788811) - (xy 235.205269 224.788811) (xy 235.205273 224.788814) (xy 235.393868 224.846024) (xy 235.59 224.865341) - (xy 235.745772 224.849999) (xy 240.194722 224.849999) (xy 240.194722 224.85) (xy 240.213762 225.006818) - (xy 240.265479 225.143182) (xy 240.26978 225.154523) (xy 240.359517 225.28453) (xy 240.47776 225.389283) - (xy 240.477762 225.389284) (xy 240.617634 225.462696) (xy 240.771014 225.5005) (xy 240.771015 225.5005) - (xy 240.928985 225.5005) (xy 241.082365 225.462696) (xy 241.154338 225.424921) (xy 241.22224 225.389283) - (xy 241.340483 225.28453) (xy 241.43022 225.154523) (xy 241.486237 225.006818) (xy 241.505278 224.85) - (xy 241.499895 224.805662) (xy 241.486237 224.693181) (xy 241.439855 224.570883) (xy 241.43022 224.545477) - (xy 241.340483 224.41547) (xy 241.22224 224.310717) (xy 241.222238 224.310716) (xy 241.222237 224.310715) - (xy 241.082365 224.237303) (xy 240.928986 224.1995) (xy 240.928985 224.1995) (xy 240.771015 224.1995) - (xy 240.771014 224.1995) (xy 240.617634 224.237303) (xy 240.477762 224.310715) (xy 240.359516 224.415471) - (xy 240.269781 224.545475) (xy 240.26978 224.545476) (xy 240.213762 224.693181) (xy 240.194722 224.849999) - (xy 235.745772 224.849999) (xy 235.786132 224.846024) (xy 235.974727 224.788814) (xy 236.027297 224.760715) - (xy 236.061632 224.742362) (xy 236.148538 224.69591) (xy 236.300883 224.570883) (xy 236.42591 224.418538) - (xy 236.518814 224.244727) (xy 236.576024 224.056132) (xy 236.581552 224) (xy 242.614659 224) (xy 242.633975 224.196129) - (xy 242.633976 224.196132) (xy 242.689198 224.378175) (xy 242.691188 224.384733) (xy 242.784086 224.558532) - (xy 242.78409 224.558539) (xy 242.909116 224.710883) (xy 243.06146 224.835909) (xy 243.061467 224.835913) - (xy 243.235266 224.928811) (xy 243.235269 224.928811) (xy 243.235273 224.928814) (xy 243.423868 224.986024) - (xy 243.62 225.005341) (xy 243.816132 224.986024) (xy 244.004727 224.928814) (xy 244.178538 224.83591) - (xy 244.330883 224.710883) (xy 244.45591 224.558538) (xy 244.530745 224.418532) (xy 244.548811 224.384733) - (xy 244.548811 224.384732) (xy 244.548814 224.384727) (xy 244.606024 224.196132) (xy 244.625341 224) - (xy 244.606024 223.803868) (xy 244.548814 223.615273) (xy 244.548811 223.615269) (xy 244.548811 223.615266) - (xy 244.455913 223.441467) (xy 244.455909 223.44146) (xy 244.330883 223.289116) (xy 244.178539 223.16409) - (xy 244.178532 223.164086) (xy 244.004733 223.071188) (xy 244.004727 223.071186) (xy 243.816132 223.013976) - (xy 243.816129 223.013975) (xy 243.62 222.994659) (xy 243.42387 223.013975) (xy 243.235266 223.071188) - (xy 243.061467 223.164086) (xy 243.06146 223.16409) (xy 242.909116 223.289116) (xy 242.78409 223.44146) - (xy 242.784086 223.441467) (xy 242.691188 223.615266) (xy 242.633975 223.80387) (xy 242.614659 224) - (xy 236.581552 224) (xy 236.595341 223.86) (xy 236.576024 223.663868) (xy 236.518814 223.475273) - (xy 236.518811 223.475269) (xy 236.518811 223.475266) (xy 236.425913 223.301467) (xy 236.425909 223.30146) - (xy 236.300883 223.149116) (xy 236.148539 223.02409) (xy 236.148532 223.024086) (xy 235.974733 222.931188) - (xy 235.974727 222.931186) (xy 235.786132 222.873976) (xy 235.786129 222.873975) (xy 235.59 222.854659) - (xy 235.39387 222.873975) (xy 235.205266 222.931188) (xy 235.031467 223.024086) (xy 235.03146 223.02409) - (xy 234.879116 223.149116) (xy 234.75409 223.30146) (xy 234.754086 223.301467) (xy 234.661188 223.475266) - (xy 234.603975 223.66387) (xy 234.584659 223.86) (xy 234.0905 223.86) (xy 234.0905 223.085326) (xy 234.0905 223.085323) - (xy 234.090499 223.085321) (xy 234.075967 223.012264) (xy 234.075966 223.01226) (xy 234.020601 222.929399) - (xy 233.93774 222.874034) (xy 233.937739 222.874033) (xy 233.937735 222.874032) (xy 233.864677 222.8595) - (xy 233.864674 222.8595) (xy 232.652274 222.8595) (xy 232.585235 222.839815) (xy 232.53948 222.787011) - (xy 232.529536 222.717853) (xy 232.558561 222.654297) (xy 232.617339 222.616523) (xy 232.6226 222.615103) - (xy 232.632365 222.612696) (xy 232.77224 222.539283) (xy 232.890483 222.43453) (xy 232.98022 222.304523) - (xy 233.036237 222.156818) (xy 233.055278 222) (xy 233.036237 221.843182) (xy 233.022009 221.805667) - (xy 233.014992 221.787164) (xy 232.98022 221.695477) (xy 232.890483 221.56547) (xy 232.77224 221.460717) - (xy 232.772238 221.460716) (xy 232.772237 221.460715) (xy 232.632365 221.387303) (xy 232.478986 221.3495) - (xy 232.478985 221.3495) (xy 232.321015 221.3495) (xy 232.321014 221.3495) (xy 232.167634 221.387303) - (xy 232.027762 221.460715) (xy 231.909516 221.565471) (xy 231.819781 221.695475) (xy 231.81978 221.695476) - (xy 231.763762 221.843181) (xy 231.744722 221.999999) (xy 183.170061 221.999999) (xy 183.163015 221.976773) - (xy 183.163012 221.976769) (xy 183.163012 221.976766) (xy 183.070114 221.802967) (xy 183.07011 221.80296) - (xy 182.945084 221.650616) (xy 182.79274 221.52559) (xy 182.792733 221.525586) (xy 182.618934 221.432688) - (xy 182.618928 221.432686) (xy 182.493198 221.394546) (xy 182.43033 221.375475) (xy 182.234201 221.356159) - (xy 182.038071 221.375475) (xy 181.849467 221.432688) (xy 181.675668 221.525586) (xy 181.675661 221.52559) - (xy 181.523317 221.650616) (xy 181.398291 221.80296) (xy 181.398287 221.802967) (xy 181.305389 221.976766) - (xy 181.248176 222.16537) (xy 181.22886 222.3615) (xy 171.755075 222.3615) (xy 171.736024 222.168068) - (xy 171.678814 221.979473) (xy 171.678811 221.979469) (xy 171.678811 221.979466) (xy 171.585913 221.805667) - (xy 171.585909 221.80566) (xy 171.460883 221.653316) (xy 171.308539 221.52829) (xy 171.308532 221.528286) - (xy 171.134733 221.435388) (xy 171.134727 221.435386) (xy 170.946132 221.378176) (xy 170.946129 221.378175) - (xy 170.75 221.358859) (xy 170.55387 221.378175) (xy 170.365266 221.435388) (xy 170.191467 221.528286) - (xy 170.19146 221.52829) (xy 170.039116 221.653316) (xy 169.91409 221.80566) (xy 169.914086 221.805667) - (xy 169.821188 221.979466) (xy 169.763975 222.16807) (xy 169.744659 222.3642) (xy 140.521033 222.3642) - (xy 140.485158 222.230313) (xy 140.397344 222.018312) (xy 140.282611 221.819588) (xy 140.282608 221.819585) - (xy 140.282607 221.819582) (xy 140.142918 221.637538) (xy 140.142911 221.63753) (xy 139.98067 221.475289) - (xy 139.980661 221.475281) (xy 139.798617 221.335592) (xy 139.59989 221.220857) (xy 139.599876 221.22085) - (xy 139.387887 221.133042) (xy 139.166238 221.073652) (xy 139.128215 221.068646) (xy 138.938741 221.0437) - (xy 138.938734 221.0437) (xy 138.709266 221.0437) (xy 138.709258 221.0437) (xy 138.492715 221.072209) - (xy 138.481762 221.073652) (xy 138.388076 221.098754) (xy 138.260112 221.133042) (xy 138.048123 221.22085) - (xy 138.048109 221.220857) (xy 137.849382 221.335592) (xy 137.667338 221.475281) (xy 137.505081 221.637538) - (xy 137.365392 221.819582) (xy 137.250657 222.018309) (xy 137.25065 222.018323) (xy 137.162842 222.230312) - (xy 137.162842 222.230313) (xy 137.108124 222.434528) (xy 137.103453 222.451959) (xy 137.103451 222.45197) - (xy 137.0735 222.679458) (xy 112.3005 222.679458) (xy 112.3005 219.719999) (xy 163.404722 219.719999) - (xy 163.404722 219.72) (xy 163.423762 219.876818) (xy 163.47978 220.024523) (xy 163.569517 220.15453) - (xy 163.68776 220.259283) (xy 163.687762 220.259284) (xy 163.827634 220.332696) (xy 163.981014 220.3705) - (xy 163.981015 220.3705) (xy 164.138985 220.3705) (xy 164.292365 220.332696) (xy 164.43224 220.259283) - (xy 164.499159 220.199999) (xy 230.844722 220.199999) (xy 230.844722 220.2) (xy 230.863762 220.356818) - (xy 230.91978 220.504523) (xy 231.009517 220.63453) (xy 231.12776 220.739283) (xy 231.127762 220.739284) - (xy 231.267634 220.812696) (xy 231.421014 220.8505) (xy 231.421015 220.8505) (xy 231.578985 220.8505) - (xy 231.732365 220.812696) (xy 231.87224 220.739283) (xy 231.990483 220.63453) (xy 232.08022 220.504523) - (xy 232.134275 220.361991) (xy 232.62273 220.361991) (xy 232.62273 220.361992) (xy 232.64177 220.51881) - (xy 232.697788 220.666515) (xy 232.787525 220.796522) (xy 232.905768 220.901275) (xy 232.90577 220.901276) - (xy 233.045642 220.974688) (xy 233.199022 221.012492) (xy 233.199023 221.012492) (xy 233.356993 221.012492) - (xy 233.510373 220.974688) (xy 233.650248 220.901275) (xy 233.768491 220.796522) (xy 233.858228 220.666515) - (xy 233.914245 220.51881) (xy 233.933286 220.361992) (xy 233.914245 220.205174) (xy 233.912282 220.199999) - (xy 233.872642 220.095476) (xy 233.858228 220.057469) (xy 233.768491 219.927462) (xy 233.650248 219.822709) - (xy 233.650246 219.822708) (xy 233.650245 219.822707) (xy 233.510373 219.749295) (xy 233.356994 219.711492) - (xy 233.356993 219.711492) (xy 233.199023 219.711492) (xy 233.199022 219.711492) (xy 233.045642 219.749295) - (xy 232.90577 219.822707) (xy 232.787524 219.927463) (xy 232.697789 220.057467) (xy 232.697788 220.057468) - (xy 232.64177 220.205173) (xy 232.62273 220.361991) (xy 232.134275 220.361991) (xy 232.136237 220.356818) - (xy 232.155278 220.2) (xy 232.142587 220.095475) (xy 232.136237 220.043181) (xy 232.101738 219.952216) - (xy 232.08022 219.895477) (xy 231.990483 219.76547) (xy 231.87224 219.660717) (xy 231.872238 219.660716) - (xy 231.872237 219.660715) (xy 231.732365 219.587303) (xy 231.578986 219.5495) (xy 231.578985 219.5495) - (xy 231.421015 219.5495) (xy 231.421014 219.5495) (xy 231.267634 219.587303) (xy 231.127762 219.660715) - (xy 231.009516 219.765471) (xy 230.919781 219.895475) (xy 230.91978 219.895476) (xy 230.863762 220.043181) - (xy 230.844722 220.199999) (xy 164.499159 220.199999) (xy 164.550483 220.15453) (xy 164.64022 220.024523) - (xy 164.696237 219.876818) (xy 164.715278 219.72) (xy 164.698684 219.58333) (xy 164.696237 219.563181) - (xy 164.660961 219.470166) (xy 164.64022 219.415477) (xy 164.553121 219.289292) (xy 169.0495 219.289292) - (xy 169.0495 219.439107) (xy 169.078723 219.586022) (xy 169.078725 219.58603) (xy 169.136051 219.724429) - (xy 169.136056 219.724438) (xy 169.21928 219.84899) (xy 169.219283 219.848994) (xy 169.325205 219.954916) - (xy 169.325209 219.954919) (xy 169.449761 220.038143) (xy 169.44977 220.038148) (xy 169.481123 220.051134) - (xy 169.58817 220.095475) (xy 169.721518 220.121999) (xy 169.735092 220.124699) (xy 169.735096 220.1247) - (xy 169.735097 220.1247) (xy 169.884904 220.1247) (xy 169.884905 220.124699) (xy 170.03183 220.095475) - (xy 170.170232 220.038147) (xy 170.294791 219.954919) (xy 170.400719 219.848991) (xy 170.483947 219.724432) - (xy 170.541275 219.58603) (xy 170.5705 219.439103) (xy 170.5705 219.289297) (xy 170.569962 219.286592) - (xy 185.413701 219.286592) (xy 185.413701 219.436407) (xy 185.442924 219.583322) (xy 185.442926 219.58333) - (xy 185.500252 219.721729) (xy 185.500257 219.721738) (xy 185.583481 219.84629) (xy 185.583484 219.846294) - (xy 185.689406 219.952216) (xy 185.68941 219.952219) (xy 185.813962 220.035443) (xy 185.813971 220.035448) - (xy 185.832643 220.043182) (xy 185.952371 220.092775) (xy 186.099293 220.121999) (xy 186.099297 220.122) - (xy 186.099298 220.122) (xy 186.249105 220.122) (xy 186.249106 220.121999) (xy 186.396031 220.092775) - (xy 186.534433 220.035447) (xy 186.658992 219.952219) (xy 186.76492 219.846291) (xy 186.848148 219.721732) - (xy 186.905476 219.58333) (xy 186.934701 219.436403) (xy 186.934701 219.286597) (xy 186.905476 219.13967) - (xy 186.849267 219.00397) (xy 186.848149 219.00127) (xy 186.848144 219.001261) (xy 186.76492 218.876709) - (xy 186.764917 218.876705) (xy 186.658995 218.770783) (xy 186.658991 218.77078) (xy 186.553061 218.699999) - (xy 187.944722 218.699999) (xy 187.944722 218.7) (xy 187.963762 218.856818) (xy 188.018543 219.001261) - (xy 188.01978 219.004523) (xy 188.109517 219.13453) (xy 188.22776 219.239283) (xy 188.227762 219.239284) - (xy 188.367634 219.312696) (xy 188.521014 219.3505) (xy 188.521015 219.3505) (xy 188.678985 219.3505) - (xy 188.832365 219.312696) (xy 188.97224 219.239283) (xy 189.090483 219.13453) (xy 189.18022 219.004523) - (xy 189.236237 218.856818) (xy 189.255278 218.7) (xy 189.253767 218.687551) (xy 189.236237 218.543181) - (xy 189.231238 218.529999) (xy 232.704722 218.529999) (xy 232.704722 218.53) (xy 232.723762 218.686818) - (xy 232.77978 218.834523) (xy 232.869517 218.96453) (xy 232.98776 219.069283) (xy 232.99986 219.075633) - (xy 233.127634 219.142696) (xy 233.281014 219.1805) (xy 233.281015 219.1805) (xy 233.438985 219.1805) - (xy 233.592365 219.142696) (xy 233.607928 219.134528) (xy 233.73224 219.069283) (xy 233.850483 218.96453) - (xy 233.94022 218.834523) (xy 233.996237 218.686818) (xy 234.015278 218.53) (xy 234.01392 218.518811) - (xy 233.996237 218.373181) (xy 233.968818 218.300883) (xy 233.94022 218.225477) (xy 233.850483 218.09547) + (xy 159.521015 230.7505) (xy 159.678985 230.7505) (xy 159.832365 230.712696) (xy 159.931401 230.660717) + (xy 159.97224 230.639283) (xy 160.090483 230.53453) (xy 160.18022 230.404523) (xy 160.236237 230.256818) + (xy 160.255278 230.1) (xy 160.251086 230.065471) (xy 160.236237 229.943181) (xy 160.200708 229.8495) + (xy 160.18022 229.795477) (xy 160.090483 229.66547) (xy 159.97224 229.560717) (xy 159.972238 229.560716) + (xy 159.972237 229.560715) (xy 159.832365 229.487303) (xy 159.678986 229.4495) (xy 159.678985 229.4495) + (xy 159.521015 229.4495) (xy 159.521014 229.4495) (xy 159.367634 229.487303) (xy 159.227762 229.560715) + (xy 159.109516 229.665471) (xy 159.019781 229.795475) (xy 159.01978 229.795476) (xy 158.963762 229.943181) + (xy 158.944722 230.099999) (xy 112.3005 230.099999) (xy 112.3005 229.399999) (xy 219.944722 229.399999) + (xy 219.944722 229.4) (xy 219.963762 229.556818) (xy 220.01978 229.704523) (xy 220.109517 229.83453) + (xy 220.22776 229.939283) (xy 220.227762 229.939284) (xy 220.367634 230.012696) (xy 220.521014 230.0505) + (xy 220.521015 230.0505) (xy 220.678985 230.0505) (xy 220.832365 230.012696) (xy 220.931401 229.960717) + (xy 220.97224 229.939283) (xy 221.090483 229.83453) (xy 221.18022 229.704523) (xy 221.236237 229.556818) + (xy 221.255278 229.4) (xy 221.244678 229.312696) (xy 221.236237 229.243181) (xy 221.201087 229.1505) + (xy 221.18022 229.095477) (xy 221.090483 228.96547) (xy 220.97224 228.860717) (xy 220.972238 228.860716) + (xy 220.972237 228.860715) (xy 220.832365 228.787303) (xy 220.678986 228.7495) (xy 220.678985 228.7495) + (xy 220.521015 228.7495) (xy 220.521014 228.7495) (xy 220.367634 228.787303) (xy 220.227762 228.860715) + (xy 220.22776 228.860717) (xy 220.124475 228.952219) (xy 220.109516 228.965471) (xy 220.019781 229.095475) + (xy 220.01978 229.095476) (xy 219.963762 229.243181) (xy 219.944722 229.399999) (xy 112.3005 229.399999) + (xy 112.3005 226.210186) (xy 117.1745 226.210186) (xy 117.1745 226.479813) (xy 117.204686 226.747719) + (xy 117.204688 226.747731) (xy 117.264684 227.010594) (xy 117.264687 227.010602) (xy 117.353734 227.265082) + (xy 117.470714 227.507994) (xy 117.470716 227.507997) (xy 117.614162 227.736289) (xy 117.782266 227.947085) + (xy 117.972915 228.137734) (xy 118.183711 228.305838) (xy 118.398775 228.440972) (xy 118.412005 228.449285) + (xy 118.49095 228.487303) (xy 118.654921 228.566267) (xy 118.787608 228.612696) (xy 118.909397 228.655312) + (xy 118.909405 228.655315) (xy 118.909408 228.655315) (xy 118.909409 228.655316) (xy 119.172268 228.715312) + (xy 119.440187 228.745499) (xy 119.440188 228.7455) (xy 119.440191 228.7455) (xy 119.709812 228.7455) + (xy 119.709812 228.745499) (xy 119.977732 228.715312) (xy 120.044822 228.699999) (xy 147.944722 228.699999) + (xy 147.944722 228.7) (xy 147.963762 228.856818) (xy 148.01978 229.004523) (xy 148.109517 229.13453) + (xy 148.22776 229.239283) (xy 148.227762 229.239284) (xy 148.367634 229.312696) (xy 148.521014 229.3505) + (xy 148.521015 229.3505) (xy 148.678985 229.3505) (xy 148.832365 229.312696) (xy 148.97224 229.239283) + (xy 149.090483 229.13453) (xy 149.18022 229.004523) (xy 149.236237 228.856818) (xy 149.255278 228.7) + (xy 149.251086 228.665471) (xy 149.236237 228.543181) (xy 149.200708 228.4495) (xy 149.18022 228.395477) + (xy 149.106926 228.289292) (xy 169.0495 228.289292) (xy 169.0495 228.439107) (xy 169.078723 228.586022) + (xy 169.078725 228.58603) (xy 169.136051 228.724429) (xy 169.136056 228.724438) (xy 169.21928 228.84899) + (xy 169.219283 228.848994) (xy 169.325205 228.954916) (xy 169.325209 228.954919) (xy 169.449761 229.038143) + (xy 169.44977 229.038148) (xy 169.452513 229.039284) (xy 169.58817 229.095475) (xy 169.674748 229.112696) + (xy 169.735092 229.124699) (xy 169.735096 229.1247) (xy 169.735097 229.1247) (xy 169.884904 229.1247) + (xy 169.884905 229.124699) (xy 170.03183 229.095475) (xy 170.170232 229.038147) (xy 170.294791 228.954919) + (xy 170.400719 228.848991) (xy 170.483947 228.724432) (xy 170.541275 228.58603) (xy 170.5705 228.439103) + (xy 170.5705 228.289297) (xy 170.569962 228.286592) (xy 185.413701 228.286592) (xy 185.413701 228.436407) + (xy 185.442924 228.583322) (xy 185.442926 228.58333) (xy 185.500252 228.721729) (xy 185.500257 228.721738) + (xy 185.583481 228.84629) (xy 185.583484 228.846294) (xy 185.689406 228.952216) (xy 185.68941 228.952219) + (xy 185.813962 229.035443) (xy 185.813971 229.035448) (xy 185.82323 229.039283) (xy 185.952371 229.092775) + (xy 186.052523 229.112696) (xy 186.099293 229.121999) (xy 186.099297 229.122) (xy 186.099298 229.122) + (xy 186.249105 229.122) (xy 186.249106 229.121999) (xy 186.396031 229.092775) (xy 186.534433 229.035447) + (xy 186.658992 228.952219) (xy 186.76492 228.846291) (xy 186.848148 228.721732) (xy 186.905476 228.58333) + (xy 186.934701 228.436403) (xy 186.934701 228.286597) (xy 186.905476 228.13967) (xy 186.849267 228.00397) + (xy 186.848149 228.00127) (xy 186.848144 228.001261) (xy 186.847301 227.999999) (xy 202.444722 227.999999) + (xy 202.444722 228) (xy 202.463762 228.156818) (xy 202.51978 228.304523) (xy 202.609517 228.43453) + (xy 202.72776 228.539283) (xy 202.727762 228.539284) (xy 202.867634 228.612696) (xy 203.021014 228.6505) + (xy 203.021015 228.6505) (xy 203.178985 228.6505) (xy 203.332365 228.612696) (xy 203.383187 228.586022) + (xy 203.47224 228.539283) (xy 203.516583 228.499999) (xy 244.844722 228.499999) (xy 244.844722 228.5) + (xy 244.863762 228.656818) (xy 244.916349 228.795476) (xy 244.91978 228.804523) (xy 245.009517 228.93453) + (xy 245.12776 229.039283) (xy 245.127762 229.039284) (xy 245.267634 229.112696) (xy 245.421014 229.1505) + (xy 245.421015 229.1505) (xy 245.578985 229.1505) (xy 245.732365 229.112696) (xy 245.774379 229.090644) + (xy 245.842886 229.076918) (xy 245.90794 229.102409) (xy 245.948885 229.159024) (xy 245.955102 229.185493) + (xy 245.961634 229.239283) (xy 245.963763 229.256818) (xy 246.01978 229.404523) (xy 246.109517 229.53453) + (xy 246.22776 229.639283) (xy 246.227762 229.639284) (xy 246.367634 229.712696) (xy 246.521014 229.7505) + (xy 246.521015 229.7505) (xy 246.678985 229.7505) (xy 246.832365 229.712696) (xy 246.847937 229.704523) + (xy 246.97224 229.639283) (xy 247.090483 229.53453) (xy 247.18022 229.404523) (xy 247.236237 229.256818) + (xy 247.255278 229.1) (xy 247.254729 229.095474) (xy 247.236237 228.943181) (xy 247.204961 228.860715) + (xy 247.18022 228.795477) (xy 247.090483 228.66547) (xy 246.97224 228.560717) (xy 246.972238 228.560716) + (xy 246.972237 228.560715) (xy 246.832365 228.487303) (xy 246.678986 228.4495) (xy 246.678985 228.4495) + (xy 246.521015 228.4495) (xy 246.521014 228.4495) (xy 246.367635 228.487303) (xy 246.325618 228.509356) + (xy 246.25711 228.52308) (xy 246.192057 228.497588) (xy 246.151113 228.440972) (xy 246.144897 228.414505) + (xy 246.136237 228.343182) (xy 246.08022 228.195477) (xy 245.990483 228.06547) (xy 245.87224 227.960717) + (xy 245.872238 227.960716) (xy 245.872237 227.960715) (xy 245.732365 227.887303) (xy 245.578986 227.8495) + (xy 245.578985 227.8495) (xy 245.421015 227.8495) (xy 245.421014 227.8495) (xy 245.267634 227.887303) + (xy 245.127762 227.960715) (xy 245.009516 228.065471) (xy 244.919781 228.195475) (xy 244.91978 228.195476) + (xy 244.863762 228.343181) (xy 244.844722 228.499999) (xy 203.516583 228.499999) (xy 203.590483 228.43453) + (xy 203.68022 228.304523) (xy 203.736237 228.156818) (xy 203.755278 228) (xy 203.740308 227.876705) + (xy 203.736237 227.843181) (xy 203.709803 227.773481) (xy 203.68022 227.695477) (xy 203.590483 227.56547) + (xy 203.47224 227.460717) (xy 203.472238 227.460716) (xy 203.472237 227.460715) (xy 203.332365 227.387303) + (xy 203.178986 227.3495) (xy 203.178985 227.3495) (xy 203.021015 227.3495) (xy 203.021014 227.3495) + (xy 202.867634 227.387303) (xy 202.727762 227.460715) (xy 202.609516 227.565471) (xy 202.519781 227.695475) + (xy 202.51978 227.695476) (xy 202.463762 227.843181) (xy 202.444722 227.999999) (xy 186.847301 227.999999) + (xy 186.76492 227.876709) (xy 186.764917 227.876705) (xy 186.658995 227.770783) (xy 186.658991 227.77078) + (xy 186.534439 227.687556) (xy 186.53443 227.687551) (xy 186.396031 227.630225) (xy 186.396023 227.630223) + (xy 186.249108 227.601) (xy 186.249104 227.601) (xy 186.099298 227.601) (xy 186.099293 227.601) + (xy 185.952378 227.630223) (xy 185.95237 227.630225) (xy 185.813971 227.687551) (xy 185.813962 227.687556) + (xy 185.68941 227.77078) (xy 185.689406 227.770783) (xy 185.583484 227.876705) (xy 185.583481 227.876709) + (xy 185.500257 228.001261) (xy 185.500252 228.00127) (xy 185.442926 228.139669) (xy 185.442924 228.139677) + (xy 185.413701 228.286592) (xy 170.569962 228.286592) (xy 170.541275 228.14237) (xy 170.483947 228.003968) + (xy 170.483946 228.003967) (xy 170.483943 228.003961) (xy 170.400719 227.879409) (xy 170.400716 227.879405) + (xy 170.294794 227.773483) (xy 170.29479 227.77348) (xy 170.170238 227.690256) (xy 170.170229 227.690251) + (xy 170.03183 227.632925) (xy 170.031822 227.632923) (xy 169.884907 227.6037) (xy 169.884903 227.6037) + (xy 169.735097 227.6037) (xy 169.735092 227.6037) (xy 169.588177 227.632923) (xy 169.588169 227.632925) + (xy 169.44977 227.690251) (xy 169.449761 227.690256) (xy 169.325209 227.77348) (xy 169.325205 227.773483) + (xy 169.219283 227.879405) (xy 169.21928 227.879409) (xy 169.136056 228.003961) (xy 169.136051 228.00397) + (xy 169.078725 228.142369) (xy 169.078723 228.142377) (xy 169.0495 228.289292) (xy 149.106926 228.289292) + (xy 149.090483 228.26547) (xy 148.97224 228.160717) (xy 148.972238 228.160716) (xy 148.972237 228.160715) + (xy 148.832365 228.087303) (xy 148.678986 228.0495) (xy 148.678985 228.0495) (xy 148.521015 228.0495) + (xy 148.521014 228.0495) (xy 148.367634 228.087303) (xy 148.227762 228.160715) (xy 148.109516 228.265471) + (xy 148.019781 228.395475) (xy 148.01978 228.395476) (xy 147.963762 228.543181) (xy 147.944722 228.699999) + (xy 120.044822 228.699999) (xy 120.240591 228.655316) (xy 120.495079 228.566267) (xy 120.737997 228.449284) + (xy 120.966289 228.305838) (xy 121.177085 228.137734) (xy 121.367734 227.947085) (xy 121.535838 227.736289) + (xy 121.679284 227.507997) (xy 121.796267 227.265079) (xy 121.885316 227.010591) (xy 121.887734 226.999999) + (xy 230.894722 226.999999) (xy 230.894722 227) (xy 230.913762 227.156818) (xy 230.958461 227.274678) + (xy 230.96978 227.304523) (xy 231.059517 227.43453) (xy 231.17776 227.539283) (xy 231.177762 227.539284) + (xy 231.317634 227.612696) (xy 231.471014 227.6505) (xy 231.471015 227.6505) (xy 231.628985 227.6505) + (xy 231.782365 227.612696) (xy 231.799505 227.6037) (xy 231.92224 227.539283) (xy 232.040483 227.43453) + (xy 232.13022 227.304523) (xy 232.186237 227.156818) (xy 232.205278 227) (xy 232.198932 226.947731) + (xy 232.186237 226.843181) (xy 232.164992 226.787164) (xy 232.13022 226.695477) (xy 232.040483 226.56547) + (xy 231.92224 226.460717) (xy 231.922238 226.460716) (xy 231.922237 226.460715) (xy 231.782365 226.387303) + (xy 231.628986 226.3495) (xy 231.628985 226.3495) (xy 231.471015 226.3495) (xy 231.471014 226.3495) + (xy 231.317634 226.387303) (xy 231.177762 226.460715) (xy 231.059516 226.565471) (xy 230.969781 226.695475) + (xy 230.96978 226.695476) (xy 230.913762 226.843181) (xy 230.894722 226.999999) (xy 121.887734 226.999999) + (xy 121.945312 226.747732) (xy 121.9755 226.479809) (xy 121.9755 226.210191) (xy 121.945312 225.942268) + (xy 121.885316 225.679409) (xy 121.796267 225.424921) (xy 121.736108 225.299999) (xy 157.844722 225.299999) + (xy 157.844722 225.3) (xy 157.863762 225.456818) (xy 157.906459 225.569399) (xy 157.91978 225.604523) + (xy 158.009517 225.73453) (xy 158.12776 225.839283) (xy 158.127762 225.839284) (xy 158.267634 225.912696) + (xy 158.421014 225.9505) (xy 158.421015 225.9505) (xy 158.578985 225.9505) (xy 158.732365 225.912696) + (xy 158.795787 225.879409) (xy 158.87224 225.839283) (xy 158.990483 225.73453) (xy 159.08022 225.604523) + (xy 159.136237 225.456818) (xy 159.147483 225.3642) (xy 169.744659 225.3642) (xy 169.763975 225.560329) + (xy 169.821188 225.748933) (xy 169.914086 225.922732) (xy 169.91409 225.922739) (xy 170.039116 226.075083) + (xy 170.19146 226.200109) (xy 170.191467 226.200113) (xy 170.365266 226.293011) (xy 170.365269 226.293011) + (xy 170.365273 226.293014) (xy 170.553868 226.350224) (xy 170.75 226.369541) (xy 170.946132 226.350224) + (xy 171.134727 226.293014) (xy 171.308538 226.20011) (xy 171.460883 226.075083) (xy 171.58591 225.922738) + (xy 171.678814 225.748927) (xy 171.736024 225.560332) (xy 171.755341 225.3642) (xy 172.744659 225.3642) + (xy 172.763975 225.560329) (xy 172.821188 225.748933) (xy 172.914086 225.922732) (xy 172.91409 225.922739) + (xy 173.039116 226.075083) (xy 173.19146 226.200109) (xy 173.191467 226.200113) (xy 173.365266 226.293011) + (xy 173.365269 226.293011) (xy 173.365273 226.293014) (xy 173.553868 226.350224) (xy 173.75 226.369541) + (xy 173.946132 226.350224) (xy 174.134727 226.293014) (xy 174.308538 226.20011) (xy 174.460883 226.075083) + (xy 174.58591 225.922738) (xy 174.678814 225.748927) (xy 174.736024 225.560332) (xy 174.755341 225.3642) + (xy 174.736024 225.168068) (xy 174.678814 224.979473) (xy 174.678811 224.979469) (xy 174.678811 224.979466) + (xy 174.590173 224.813636) (xy 181.233701 224.813636) (xy 181.233701 225.909363) (xy 181.233702 225.909382) + (xy 181.240109 225.968981) (xy 181.290403 226.103827) (xy 181.290404 226.103828) (xy 181.290405 226.10383) + (xy 181.376655 226.219046) (xy 181.491871 226.305296) (xy 181.491872 226.305296) (xy 181.491873 226.305297) + (xy 181.626719 226.355591) (xy 181.626718 226.355591) (xy 181.633646 226.356335) (xy 181.686329 226.362) + (xy 181.686338 226.362) (xy 182.782064 226.362) (xy 182.782073 226.362) (xy 182.841683 226.355591) + (xy 182.976531 226.305296) (xy 183.091747 226.219046) (xy 183.177997 226.10383) (xy 183.228292 225.968982) + (xy 183.230333 225.949999) (xy 239.094722 225.949999) (xy 239.094722 225.95) (xy 239.113762 226.106818) + (xy 239.149144 226.20011) (xy 239.16978 226.254523) (xy 239.259517 226.38453) (xy 239.37776 226.489283) + (xy 239.377762 226.489284) (xy 239.517634 226.562696) (xy 239.671014 226.6005) (xy 239.671015 226.6005) + (xy 239.828985 226.6005) (xy 239.982365 226.562696) (xy 240.12224 226.489283) (xy 240.240483 226.38453) + (xy 240.33022 226.254523) (xy 240.386237 226.106818) (xy 240.405278 225.95) (xy 240.386237 225.793182) + (xy 240.360501 225.725321) (xy 242.6195 225.725321) (xy 242.6195 227.274678) (xy 242.634032 227.347735) + (xy 242.634033 227.347739) (xy 242.634034 227.34774) (xy 242.689399 227.430601) (xy 242.77226 227.485966) + (xy 242.772264 227.485967) (xy 242.845321 227.500499) (xy 242.845324 227.5005) (xy 242.845326 227.5005) + (xy 244.394676 227.5005) (xy 244.394677 227.500499) (xy 244.46774 227.485966) (xy 244.550601 227.430601) + (xy 244.605966 227.34774) (xy 244.6205 227.274674) (xy 244.6205 226.410186) (xy 267.1745 226.410186) + (xy 267.1745 226.679813) (xy 267.204686 226.947719) (xy 267.204688 226.947731) (xy 267.264684 227.210594) + (xy 267.264687 227.210602) (xy 267.353734 227.465082) (xy 267.470714 227.707994) (xy 267.511864 227.773483) + (xy 267.614162 227.936289) (xy 267.782266 228.147085) (xy 267.972915 228.337734) (xy 268.183711 228.505838) + (xy 268.353774 228.612696) (xy 268.412005 228.649285) (xy 268.445614 228.66547) (xy 268.654921 228.766267) + (xy 268.846049 228.833145) (xy 268.909397 228.855312) (xy 268.909405 228.855315) (xy 268.909408 228.855315) + (xy 268.909409 228.855316) (xy 269.172268 228.915312) (xy 269.440187 228.945499) (xy 269.440188 228.9455) + (xy 269.440191 228.9455) (xy 269.709812 228.9455) (xy 269.709812 228.945499) (xy 269.977732 228.915312) + (xy 270.240591 228.855316) (xy 270.495079 228.766267) (xy 270.737997 228.649284) (xy 270.966289 228.505838) + (xy 271.177085 228.337734) (xy 271.367734 228.147085) (xy 271.535838 227.936289) (xy 271.679284 227.707997) + (xy 271.796267 227.465079) (xy 271.885316 227.210591) (xy 271.945312 226.947732) (xy 271.9755 226.679809) + (xy 271.9755 226.410191) (xy 271.945312 226.142268) (xy 271.885316 225.879409) (xy 271.796267 225.624921) + (xy 271.679284 225.382003) (xy 271.535838 225.153711) (xy 271.367734 224.942915) (xy 271.177085 224.752266) + (xy 270.966289 224.584162) (xy 270.737997 224.440716) (xy 270.737994 224.440714) (xy 270.495082 224.323734) + (xy 270.240602 224.234687) (xy 270.240594 224.234684) (xy 270.043446 224.189687) (xy 269.977732 224.174688) + (xy 269.977728 224.174687) (xy 269.977719 224.174686) (xy 269.709813 224.1445) (xy 269.709809 224.1445) + (xy 269.440191 224.1445) (xy 269.440186 224.1445) (xy 269.17228 224.174686) (xy 269.172268 224.174688) + (xy 268.909405 224.234684) (xy 268.909397 224.234687) (xy 268.654917 224.323734) (xy 268.412005 224.440714) + (xy 268.183712 224.584161) (xy 267.972915 224.752265) (xy 267.782265 224.942915) (xy 267.614161 225.153712) + (xy 267.470714 225.382005) (xy 267.353734 225.624917) (xy 267.264687 225.879397) (xy 267.264684 225.879405) + (xy 267.204688 226.142268) (xy 267.204686 226.14228) (xy 267.1745 226.410186) (xy 244.6205 226.410186) + (xy 244.6205 225.725326) (xy 244.6205 225.725323) (xy 244.620499 225.725321) (xy 244.605967 225.652264) + (xy 244.605966 225.65226) (xy 244.57407 225.604524) (xy 244.550601 225.569399) (xy 244.469891 225.515471) + (xy 244.467739 225.514033) (xy 244.467735 225.514032) (xy 244.394677 225.4995) (xy 244.394674 225.4995) + (xy 242.845326 225.4995) (xy 242.845323 225.4995) (xy 242.772264 225.514032) (xy 242.77226 225.514033) + (xy 242.689399 225.569399) (xy 242.634033 225.65226) (xy 242.634032 225.652264) (xy 242.6195 225.725321) + (xy 240.360501 225.725321) (xy 240.33022 225.645477) (xy 240.240483 225.51547) (xy 240.12224 225.410717) + (xy 240.122238 225.410716) (xy 240.122237 225.410715) (xy 239.982365 225.337303) (xy 239.828986 225.2995) + (xy 239.828985 225.2995) (xy 239.671015 225.2995) (xy 239.671014 225.2995) (xy 239.517634 225.337303) + (xy 239.377762 225.410715) (xy 239.259516 225.515471) (xy 239.169781 225.645475) (xy 239.16978 225.645476) + (xy 239.113762 225.793181) (xy 239.094722 225.949999) (xy 183.230333 225.949999) (xy 183.234701 225.909372) + (xy 183.234701 224.813628) (xy 183.228292 224.754018) (xy 183.212204 224.710883) (xy 183.177998 224.619172) + (xy 183.177997 224.619171) (xy 183.177997 224.61917) (xy 183.091747 224.503954) (xy 182.976531 224.417704) + (xy 182.976529 224.417703) (xy 182.976528 224.417702) (xy 182.841682 224.367408) (xy 182.841683 224.367408) + (xy 182.782083 224.361001) (xy 182.782081 224.361) (xy 182.782073 224.361) (xy 181.686329 224.361) + (xy 181.686321 224.361) (xy 181.686318 224.361001) (xy 181.626719 224.367408) (xy 181.491873 224.417702) + (xy 181.491871 224.417704) (xy 181.376655 224.503954) (xy 181.290405 224.61917) (xy 181.290403 224.619172) + (xy 181.240109 224.754018) (xy 181.233702 224.813617) (xy 181.233701 224.813636) (xy 174.590173 224.813636) + (xy 174.585913 224.805667) (xy 174.585909 224.80566) (xy 174.460883 224.653316) (xy 174.308539 224.52829) + (xy 174.308532 224.528286) (xy 174.134733 224.435388) (xy 174.134727 224.435386) (xy 174.008997 224.397246) + (xy 173.946129 224.378175) (xy 173.75 224.358859) (xy 173.55387 224.378175) (xy 173.365266 224.435388) + (xy 173.191467 224.528286) (xy 173.19146 224.52829) (xy 173.039116 224.653316) (xy 172.91409 224.80566) + (xy 172.914086 224.805667) (xy 172.821188 224.979466) (xy 172.763975 225.16807) (xy 172.744659 225.3642) + (xy 171.755341 225.3642) (xy 171.736024 225.168068) (xy 171.678814 224.979473) (xy 171.678811 224.979469) + (xy 171.678811 224.979466) (xy 171.585913 224.805667) (xy 171.585909 224.80566) (xy 171.460883 224.653316) + (xy 171.308539 224.52829) (xy 171.308532 224.528286) (xy 171.134733 224.435388) (xy 171.134727 224.435386) + (xy 171.008997 224.397246) (xy 170.946129 224.378175) (xy 170.75 224.358859) (xy 170.55387 224.378175) + (xy 170.365266 224.435388) (xy 170.191467 224.528286) (xy 170.19146 224.52829) (xy 170.039116 224.653316) + (xy 169.91409 224.80566) (xy 169.914086 224.805667) (xy 169.821188 224.979466) (xy 169.763975 225.16807) + (xy 169.744659 225.3642) (xy 159.147483 225.3642) (xy 159.155278 225.3) (xy 159.137516 225.153711) + (xy 159.136237 225.143181) (xy 159.084521 225.006818) (xy 159.08022 224.995477) (xy 158.990483 224.86547) + (xy 158.87224 224.760717) (xy 158.872238 224.760716) (xy 158.872237 224.760715) (xy 158.732365 224.687303) + (xy 158.578986 224.6495) (xy 158.578985 224.6495) (xy 158.421015 224.6495) (xy 158.421014 224.6495) + (xy 158.267634 224.687303) (xy 158.127762 224.760715) (xy 158.009516 224.865471) (xy 157.919781 224.995475) + (xy 157.91978 224.995476) (xy 157.863762 225.143181) (xy 157.844722 225.299999) (xy 121.736108 225.299999) + (xy 121.679284 225.182003) (xy 121.535838 224.953711) (xy 121.367734 224.742915) (xy 121.177085 224.552266) + (xy 121.168569 224.545475) (xy 121.055566 224.455358) (xy 120.966289 224.384162) (xy 120.74439 224.244733) + (xy 120.737994 224.240714) (xy 120.495082 224.123734) (xy 120.240602 224.034687) (xy 120.240594 224.034684) + (xy 120.043446 223.989687) (xy 119.977732 223.974688) (xy 119.977728 223.974687) (xy 119.977719 223.974686) + (xy 119.709813 223.9445) (xy 119.709809 223.9445) (xy 119.440191 223.9445) (xy 119.440186 223.9445) + (xy 119.17228 223.974686) (xy 119.172268 223.974688) (xy 118.909405 224.034684) (xy 118.909397 224.034687) + (xy 118.654917 224.123734) (xy 118.412005 224.240714) (xy 118.183712 224.384161) (xy 117.972915 224.552265) + (xy 117.782265 224.742915) (xy 117.614161 224.953712) (xy 117.470714 225.182005) (xy 117.353734 225.424917) + (xy 117.264687 225.679397) (xy 117.264684 225.679405) (xy 117.204688 225.942268) (xy 117.204686 225.94228) + (xy 117.1745 226.210186) (xy 112.3005 226.210186) (xy 112.3005 222.679458) (xy 137.0735 222.679458) + (xy 137.0735 222.908941) (xy 137.095019 223.072383) (xy 137.103452 223.136438) (xy 137.145405 223.293011) + (xy 137.162842 223.358087) (xy 137.25065 223.570076) (xy 137.250657 223.57009) (xy 137.365392 223.768817) + (xy 137.505081 223.950861) (xy 137.505089 223.95087) (xy 137.66733 224.113111) (xy 137.667338 224.113118) + (xy 137.667339 224.113119) (xy 137.681173 224.123734) (xy 137.849382 224.252807) (xy 137.849385 224.252808) + (xy 137.849388 224.252811) (xy 138.048112 224.367544) (xy 138.048117 224.367546) (xy 138.048123 224.367549) + (xy 138.13948 224.40539) (xy 138.260113 224.455358) (xy 138.481762 224.514748) (xy 138.709266 224.5447) + (xy 138.709273 224.5447) (xy 138.938727 224.5447) (xy 138.938734 224.5447) (xy 139.166238 224.514748) + (xy 139.387887 224.455358) (xy 139.599888 224.367544) (xy 139.798612 224.252811) (xy 139.980661 224.113119) + (xy 139.980665 224.113114) (xy 139.98067 224.113111) (xy 140.142911 223.95087) (xy 140.142914 223.950865) + (xy 140.142919 223.950861) (xy 140.282611 223.768812) (xy 140.397344 223.570088) (xy 140.485158 223.358087) + (xy 140.544548 223.136438) (xy 140.5745 222.908934) (xy 140.5745 222.679466) (xy 140.544548 222.451962) + (xy 140.521033 222.3642) (xy 169.744659 222.3642) (xy 169.763975 222.560329) (xy 169.821188 222.748933) + (xy 169.914086 222.922732) (xy 169.91409 222.922739) (xy 170.039116 223.075083) (xy 170.19146 223.200109) + (xy 170.191467 223.200113) (xy 170.365266 223.293011) (xy 170.365269 223.293011) (xy 170.365273 223.293014) + (xy 170.553868 223.350224) (xy 170.75 223.369541) (xy 170.946132 223.350224) (xy 171.134727 223.293014) + (xy 171.139779 223.290314) (xy 171.308532 223.200113) (xy 171.308538 223.20011) (xy 171.460883 223.075083) + (xy 171.58591 222.922738) (xy 171.678814 222.748927) (xy 171.736024 222.560332) (xy 171.755341 222.3642) + (xy 171.755075 222.3615) (xy 181.22886 222.3615) (xy 181.248176 222.557629) (xy 181.305389 222.746233) + (xy 181.398287 222.920032) (xy 181.398291 222.920039) (xy 181.523317 223.072383) (xy 181.675661 223.197409) + (xy 181.675668 223.197413) (xy 181.849467 223.290311) (xy 181.84947 223.290311) (xy 181.849474 223.290314) + (xy 182.038069 223.347524) (xy 182.234201 223.366841) (xy 182.430333 223.347524) (xy 182.618928 223.290314) + (xy 182.621168 223.289117) (xy 182.787682 223.200113) (xy 182.792739 223.19741) (xy 182.945084 223.072383) + (xy 183.070111 222.920038) (xy 183.116563 222.833132) (xy 183.163012 222.746233) (xy 183.163012 222.746232) + (xy 183.163015 222.746227) (xy 183.220225 222.557632) (xy 183.239542 222.3615) (xy 183.220225 222.165368) + (xy 183.170061 221.999999) (xy 231.744722 221.999999) (xy 231.744722 222) (xy 231.763762 222.156818) + (xy 231.81978 222.304523) (xy 231.909517 222.43453) (xy 232.02776 222.539283) (xy 232.027762 222.539284) + (xy 232.167634 222.612696) (xy 232.246796 222.632207) (xy 232.307177 222.667363) (xy 232.338966 222.729582) + (xy 232.332071 222.79911) (xy 232.28868 222.853873) (xy 232.253406 222.869027) (xy 232.253544 222.86936) + (xy 232.24226 222.874033) (xy 232.159399 222.929399) (xy 232.104033 223.01226) (xy 232.104032 223.012264) + (xy 232.0895 223.085321) (xy 232.0895 224.634678) (xy 232.104032 224.707735) (xy 232.104033 224.707739) + (xy 232.104034 224.70774) (xy 232.159399 224.790601) (xy 232.24226 224.845966) (xy 232.242264 224.845967) + (xy 232.315321 224.860499) (xy 232.315324 224.8605) (xy 232.315326 224.8605) (xy 233.864676 224.8605) + (xy 233.864677 224.860499) (xy 233.93774 224.845966) (xy 234.020601 224.790601) (xy 234.075966 224.70774) + (xy 234.0905 224.634674) (xy 234.0905 223.86) (xy 234.584659 223.86) (xy 234.603975 224.056129) + (xy 234.603976 224.056132) (xy 234.65814 224.234687) (xy 234.661188 224.244733) (xy 234.754086 224.418532) + (xy 234.75409 224.418539) (xy 234.879116 224.570883) (xy 235.03146 224.695909) (xy 235.031467 224.695913) + (xy 235.205266 224.788811) (xy 235.205269 224.788811) (xy 235.205273 224.788814) (xy 235.393868 224.846024) + (xy 235.59 224.865341) (xy 235.745772 224.849999) (xy 240.194722 224.849999) (xy 240.194722 224.85) + (xy 240.213762 225.006818) (xy 240.265479 225.143182) (xy 240.26978 225.154523) (xy 240.359517 225.28453) + (xy 240.47776 225.389283) (xy 240.477762 225.389284) (xy 240.617634 225.462696) (xy 240.771014 225.5005) + (xy 240.771015 225.5005) (xy 240.928985 225.5005) (xy 241.082365 225.462696) (xy 241.154338 225.424921) + (xy 241.22224 225.389283) (xy 241.340483 225.28453) (xy 241.43022 225.154523) (xy 241.486237 225.006818) + (xy 241.505278 224.85) (xy 241.499895 224.805662) (xy 241.486237 224.693181) (xy 241.439855 224.570883) + (xy 241.43022 224.545477) (xy 241.340483 224.41547) (xy 241.22224 224.310717) (xy 241.222238 224.310716) + (xy 241.222237 224.310715) (xy 241.082365 224.237303) (xy 240.928986 224.1995) (xy 240.928985 224.1995) + (xy 240.771015 224.1995) (xy 240.771014 224.1995) (xy 240.617634 224.237303) (xy 240.477762 224.310715) + (xy 240.359516 224.415471) (xy 240.269781 224.545475) (xy 240.26978 224.545476) (xy 240.213762 224.693181) + (xy 240.194722 224.849999) (xy 235.745772 224.849999) (xy 235.786132 224.846024) (xy 235.974727 224.788814) + (xy 236.027297 224.760715) (xy 236.061632 224.742362) (xy 236.148538 224.69591) (xy 236.300883 224.570883) + (xy 236.42591 224.418538) (xy 236.518814 224.244727) (xy 236.576024 224.056132) (xy 236.581552 224) + (xy 242.614659 224) (xy 242.633975 224.196129) (xy 242.633976 224.196132) (xy 242.689198 224.378175) + (xy 242.691188 224.384733) (xy 242.784086 224.558532) (xy 242.78409 224.558539) (xy 242.909116 224.710883) + (xy 243.06146 224.835909) (xy 243.061467 224.835913) (xy 243.235266 224.928811) (xy 243.235269 224.928811) + (xy 243.235273 224.928814) (xy 243.423868 224.986024) (xy 243.62 225.005341) (xy 243.816132 224.986024) + (xy 244.004727 224.928814) (xy 244.178538 224.83591) (xy 244.330883 224.710883) (xy 244.45591 224.558538) + (xy 244.530745 224.418532) (xy 244.548811 224.384733) (xy 244.548811 224.384732) (xy 244.548814 224.384727) + (xy 244.606024 224.196132) (xy 244.625341 224) (xy 244.606024 223.803868) (xy 244.548814 223.615273) + (xy 244.548811 223.615269) (xy 244.548811 223.615266) (xy 244.455913 223.441467) (xy 244.455909 223.44146) + (xy 244.330883 223.289116) (xy 244.178539 223.16409) (xy 244.178532 223.164086) (xy 244.004733 223.071188) + (xy 244.004727 223.071186) (xy 243.816132 223.013976) (xy 243.816129 223.013975) (xy 243.62 222.994659) + (xy 243.42387 223.013975) (xy 243.235266 223.071188) (xy 243.061467 223.164086) (xy 243.06146 223.16409) + (xy 242.909116 223.289116) (xy 242.78409 223.44146) (xy 242.784086 223.441467) (xy 242.691188 223.615266) + (xy 242.633975 223.80387) (xy 242.614659 224) (xy 236.581552 224) (xy 236.595341 223.86) (xy 236.576024 223.663868) + (xy 236.518814 223.475273) (xy 236.518811 223.475269) (xy 236.518811 223.475266) (xy 236.425913 223.301467) + (xy 236.425909 223.30146) (xy 236.300883 223.149116) (xy 236.148539 223.02409) (xy 236.148532 223.024086) + (xy 235.974733 222.931188) (xy 235.974727 222.931186) (xy 235.786132 222.873976) (xy 235.786129 222.873975) + (xy 235.59 222.854659) (xy 235.39387 222.873975) (xy 235.205266 222.931188) (xy 235.031467 223.024086) + (xy 235.03146 223.02409) (xy 234.879116 223.149116) (xy 234.75409 223.30146) (xy 234.754086 223.301467) + (xy 234.661188 223.475266) (xy 234.603975 223.66387) (xy 234.584659 223.86) (xy 234.0905 223.86) + (xy 234.0905 223.085326) (xy 234.0905 223.085323) (xy 234.090499 223.085321) (xy 234.075967 223.012264) + (xy 234.075966 223.01226) (xy 234.020601 222.929399) (xy 233.93774 222.874034) (xy 233.937739 222.874033) + (xy 233.937735 222.874032) (xy 233.864677 222.8595) (xy 233.864674 222.8595) (xy 232.652274 222.8595) + (xy 232.585235 222.839815) (xy 232.53948 222.787011) (xy 232.529536 222.717853) (xy 232.558561 222.654297) + (xy 232.617339 222.616523) (xy 232.6226 222.615103) (xy 232.632365 222.612696) (xy 232.77224 222.539283) + (xy 232.890483 222.43453) (xy 232.98022 222.304523) (xy 233.036237 222.156818) (xy 233.055278 222) + (xy 233.036237 221.843182) (xy 233.022009 221.805667) (xy 233.014992 221.787164) (xy 232.98022 221.695477) + (xy 232.890483 221.56547) (xy 232.77224 221.460717) (xy 232.772238 221.460716) (xy 232.772237 221.460715) + (xy 232.632365 221.387303) (xy 232.478986 221.3495) (xy 232.478985 221.3495) (xy 232.321015 221.3495) + (xy 232.321014 221.3495) (xy 232.167634 221.387303) (xy 232.027762 221.460715) (xy 231.909516 221.565471) + (xy 231.819781 221.695475) (xy 231.81978 221.695476) (xy 231.763762 221.843181) (xy 231.744722 221.999999) + (xy 183.170061 221.999999) (xy 183.163015 221.976773) (xy 183.163012 221.976769) (xy 183.163012 221.976766) + (xy 183.070114 221.802967) (xy 183.07011 221.80296) (xy 182.945084 221.650616) (xy 182.79274 221.52559) + (xy 182.792733 221.525586) (xy 182.618934 221.432688) (xy 182.618928 221.432686) (xy 182.493198 221.394546) + (xy 182.43033 221.375475) (xy 182.234201 221.356159) (xy 182.038071 221.375475) (xy 181.849467 221.432688) + (xy 181.675668 221.525586) (xy 181.675661 221.52559) (xy 181.523317 221.650616) (xy 181.398291 221.80296) + (xy 181.398287 221.802967) (xy 181.305389 221.976766) (xy 181.248176 222.16537) (xy 181.22886 222.3615) + (xy 171.755075 222.3615) (xy 171.736024 222.168068) (xy 171.678814 221.979473) (xy 171.678811 221.979469) + (xy 171.678811 221.979466) (xy 171.585913 221.805667) (xy 171.585909 221.80566) (xy 171.460883 221.653316) + (xy 171.308539 221.52829) (xy 171.308532 221.528286) (xy 171.134733 221.435388) (xy 171.134727 221.435386) + (xy 170.946132 221.378176) (xy 170.946129 221.378175) (xy 170.75 221.358859) (xy 170.55387 221.378175) + (xy 170.365266 221.435388) (xy 170.191467 221.528286) (xy 170.19146 221.52829) (xy 170.039116 221.653316) + (xy 169.91409 221.80566) (xy 169.914086 221.805667) (xy 169.821188 221.979466) (xy 169.763975 222.16807) + (xy 169.744659 222.3642) (xy 140.521033 222.3642) (xy 140.485158 222.230313) (xy 140.397344 222.018312) + (xy 140.282611 221.819588) (xy 140.282608 221.819585) (xy 140.282607 221.819582) (xy 140.142918 221.637538) + (xy 140.142911 221.63753) (xy 139.98067 221.475289) (xy 139.980661 221.475281) (xy 139.798617 221.335592) + (xy 139.59989 221.220857) (xy 139.599876 221.22085) (xy 139.387887 221.133042) (xy 139.166238 221.073652) + (xy 139.128215 221.068646) (xy 138.938741 221.0437) (xy 138.938734 221.0437) (xy 138.709266 221.0437) + (xy 138.709258 221.0437) (xy 138.492715 221.072209) (xy 138.481762 221.073652) (xy 138.388076 221.098754) + (xy 138.260112 221.133042) (xy 138.048123 221.22085) (xy 138.048109 221.220857) (xy 137.849382 221.335592) + (xy 137.667338 221.475281) (xy 137.505081 221.637538) (xy 137.365392 221.819582) (xy 137.250657 222.018309) + (xy 137.25065 222.018323) (xy 137.162842 222.230312) (xy 137.162842 222.230313) (xy 137.108124 222.434528) + (xy 137.103453 222.451959) (xy 137.103451 222.45197) (xy 137.0735 222.679458) (xy 112.3005 222.679458) + (xy 112.3005 219.719999) (xy 163.404722 219.719999) (xy 163.404722 219.72) (xy 163.423762 219.876818) + (xy 163.47978 220.024523) (xy 163.569517 220.15453) (xy 163.68776 220.259283) (xy 163.687762 220.259284) + (xy 163.827634 220.332696) (xy 163.981014 220.3705) (xy 163.981015 220.3705) (xy 164.138985 220.3705) + (xy 164.292365 220.332696) (xy 164.43224 220.259283) (xy 164.499159 220.199999) (xy 230.844722 220.199999) + (xy 230.844722 220.2) (xy 230.863762 220.356818) (xy 230.91978 220.504523) (xy 231.009517 220.63453) + (xy 231.12776 220.739283) (xy 231.127762 220.739284) (xy 231.267634 220.812696) (xy 231.421014 220.8505) + (xy 231.421015 220.8505) (xy 231.578985 220.8505) (xy 231.732365 220.812696) (xy 231.87224 220.739283) + (xy 231.990483 220.63453) (xy 232.08022 220.504523) (xy 232.134275 220.361991) (xy 232.62273 220.361991) + (xy 232.62273 220.361992) (xy 232.64177 220.51881) (xy 232.697788 220.666515) (xy 232.787525 220.796522) + (xy 232.905768 220.901275) (xy 232.90577 220.901276) (xy 233.045642 220.974688) (xy 233.199022 221.012492) + (xy 233.199023 221.012492) (xy 233.356993 221.012492) (xy 233.510373 220.974688) (xy 233.650248 220.901275) + (xy 233.768491 220.796522) (xy 233.858228 220.666515) (xy 233.914245 220.51881) (xy 233.933286 220.361992) + (xy 233.914245 220.205174) (xy 233.912282 220.199999) (xy 233.872642 220.095476) (xy 233.858228 220.057469) + (xy 233.768491 219.927462) (xy 233.650248 219.822709) (xy 233.650246 219.822708) (xy 233.650245 219.822707) + (xy 233.510373 219.749295) (xy 233.356994 219.711492) (xy 233.356993 219.711492) (xy 233.199023 219.711492) + (xy 233.199022 219.711492) (xy 233.045642 219.749295) (xy 232.90577 219.822707) (xy 232.787524 219.927463) + (xy 232.697789 220.057467) (xy 232.697788 220.057468) (xy 232.64177 220.205173) (xy 232.62273 220.361991) + (xy 232.134275 220.361991) (xy 232.136237 220.356818) (xy 232.155278 220.2) (xy 232.142587 220.095475) + (xy 232.136237 220.043181) (xy 232.101738 219.952216) (xy 232.08022 219.895477) (xy 231.990483 219.76547) + (xy 231.87224 219.660717) (xy 231.872238 219.660716) (xy 231.872237 219.660715) (xy 231.732365 219.587303) + (xy 231.578986 219.5495) (xy 231.578985 219.5495) (xy 231.421015 219.5495) (xy 231.421014 219.5495) + (xy 231.267634 219.587303) (xy 231.127762 219.660715) (xy 231.009516 219.765471) (xy 230.919781 219.895475) + (xy 230.91978 219.895476) (xy 230.863762 220.043181) (xy 230.844722 220.199999) (xy 164.499159 220.199999) + (xy 164.550483 220.15453) (xy 164.64022 220.024523) (xy 164.696237 219.876818) (xy 164.715278 219.72) + (xy 164.698684 219.58333) (xy 164.696237 219.563181) (xy 164.660961 219.470166) (xy 164.64022 219.415477) + (xy 164.553121 219.289292) (xy 169.0495 219.289292) (xy 169.0495 219.439107) (xy 169.078723 219.586022) + (xy 169.078725 219.58603) (xy 169.136051 219.724429) (xy 169.136056 219.724438) (xy 169.21928 219.84899) + (xy 169.219283 219.848994) (xy 169.325205 219.954916) (xy 169.325209 219.954919) (xy 169.449761 220.038143) + (xy 169.44977 220.038148) (xy 169.481123 220.051134) (xy 169.58817 220.095475) (xy 169.721518 220.121999) + (xy 169.735092 220.124699) (xy 169.735096 220.1247) (xy 169.735097 220.1247) (xy 169.884904 220.1247) + (xy 169.884905 220.124699) (xy 170.03183 220.095475) (xy 170.170232 220.038147) (xy 170.294791 219.954919) + (xy 170.400719 219.848991) (xy 170.483947 219.724432) (xy 170.541275 219.58603) (xy 170.5705 219.439103) + (xy 170.5705 219.289297) (xy 170.569962 219.286592) (xy 185.413701 219.286592) (xy 185.413701 219.436407) + (xy 185.442924 219.583322) (xy 185.442926 219.58333) (xy 185.500252 219.721729) (xy 185.500257 219.721738) + (xy 185.583481 219.84629) (xy 185.583484 219.846294) (xy 185.689406 219.952216) (xy 185.68941 219.952219) + (xy 185.813962 220.035443) (xy 185.813971 220.035448) (xy 185.832643 220.043182) (xy 185.952371 220.092775) + (xy 186.099293 220.121999) (xy 186.099297 220.122) (xy 186.099298 220.122) (xy 186.249105 220.122) + (xy 186.249106 220.121999) (xy 186.396031 220.092775) (xy 186.534433 220.035447) (xy 186.658992 219.952219) + (xy 186.76492 219.846291) (xy 186.848148 219.721732) (xy 186.905476 219.58333) (xy 186.934701 219.436403) + (xy 186.934701 219.286597) (xy 186.905476 219.13967) (xy 186.849267 219.00397) (xy 186.848149 219.00127) + (xy 186.848144 219.001261) (xy 186.76492 218.876709) (xy 186.764917 218.876705) (xy 186.658995 218.770783) + (xy 186.658991 218.77078) (xy 186.553061 218.699999) (xy 187.944722 218.699999) (xy 187.944722 218.7) + (xy 187.963762 218.856818) (xy 188.018543 219.001261) (xy 188.01978 219.004523) (xy 188.109517 219.13453) + (xy 188.22776 219.239283) (xy 188.227762 219.239284) (xy 188.367634 219.312696) (xy 188.521014 219.3505) + (xy 188.521015 219.3505) (xy 188.678985 219.3505) (xy 188.832365 219.312696) (xy 188.97224 219.239283) + (xy 189.090483 219.13453) (xy 189.18022 219.004523) (xy 189.236237 218.856818) (xy 189.255278 218.7) + (xy 189.253767 218.687551) (xy 189.236237 218.543181) (xy 189.231238 218.529999) (xy 232.704722 218.529999) + (xy 232.704722 218.53) (xy 232.723762 218.686818) (xy 232.77978 218.834523) (xy 232.869517 218.96453) + (xy 232.98776 219.069283) (xy 232.99986 219.075633) (xy 233.127634 219.142696) (xy 233.281014 219.1805) + (xy 233.281015 219.1805) (xy 233.438985 219.1805) (xy 233.592365 219.142696) (xy 233.607928 219.134528) + (xy 233.73224 219.069283) (xy 233.850483 218.96453) (xy 233.94022 218.834523) (xy 233.996237 218.686818) + (xy 234.015278 218.53) (xy 233.996237 218.373182) (xy 233.94022 218.225477) (xy 233.850483 218.09547) (xy 233.73224 217.990717) (xy 233.732238 217.990716) (xy 233.732237 217.990715) (xy 233.592365 217.917303) (xy 233.438986 217.8795) (xy 233.438985 217.8795) (xy 233.281015 217.8795) (xy 233.281014 217.8795) (xy 233.127634 217.917303) (xy 232.987762 217.990715) (xy 232.869516 218.095471) (xy 232.779781 218.225475) (xy 232.77978 218.225476) (xy 232.723762 218.373181) (xy 232.704722 218.529999) (xy 189.231238 218.529999) - (xy 189.196248 218.43774) (xy 189.18022 218.395477) (xy 189.090483 218.26547) (xy 188.97224 218.160717) + (xy 189.214992 218.487164) (xy 189.18022 218.395477) (xy 189.090483 218.26547) (xy 188.97224 218.160717) (xy 188.972238 218.160716) (xy 188.972237 218.160715) (xy 188.832365 218.087303) (xy 188.678986 218.0495) (xy 188.678985 218.0495) (xy 188.521015 218.0495) (xy 188.521014 218.0495) (xy 188.367634 218.087303) (xy 188.227762 218.160715) (xy 188.109516 218.265471) (xy 188.019781 218.395475) (xy 188.01978 218.395476) @@ -169783,45 +174264,46 @@ (xy 164.138986 219.0695) (xy 164.138985 219.0695) (xy 163.981015 219.0695) (xy 163.981014 219.0695) (xy 163.827634 219.107303) (xy 163.687762 219.180715) (xy 163.68776 219.180717) (xy 163.599534 219.258878) (xy 163.569516 219.285471) (xy 163.479781 219.415475) (xy 163.47978 219.415476) (xy 163.423762 219.563181) - (xy 163.404722 219.719999) (xy 112.3005 219.719999) (xy 112.3005 216.815321) (xy 113.9595 216.815321) - (xy 113.9595 218.364678) (xy 113.974032 218.437735) (xy 113.974033 218.437739) (xy 113.974034 218.43774) - (xy 114.029399 218.520601) (xy 114.11226 218.575966) (xy 114.112264 218.575967) (xy 114.185321 218.590499) - (xy 114.185324 218.5905) (xy 114.185326 218.5905) (xy 115.734676 218.5905) (xy 115.734677 218.590499) - (xy 115.80774 218.575966) (xy 115.890601 218.520601) (xy 115.945966 218.43774) (xy 115.9605 218.364674) - (xy 115.9605 217.59) (xy 116.454659 217.59) (xy 116.473975 217.786129) (xy 116.531188 217.974733) - (xy 116.624086 218.148532) (xy 116.62409 218.148539) (xy 116.749116 218.300883) (xy 116.90146 218.425909) - (xy 116.901467 218.425913) (xy 117.075266 218.518811) (xy 117.075269 218.518811) (xy 117.075273 218.518814) - (xy 117.263868 218.576024) (xy 117.46 218.595341) (xy 117.656132 218.576024) (xy 117.844727 218.518814) - (xy 118.018538 218.42591) (xy 118.170883 218.300883) (xy 118.29591 218.148538) (xy 118.388814 217.974727) - (xy 118.446024 217.786132) (xy 118.455539 217.689521) (xy 139.3135 217.689521) (xy 139.3135 219.258878) - (xy 139.328032 219.331935) (xy 139.328033 219.331939) (xy 139.328034 219.33194) (xy 139.383399 219.414801) - (xy 139.46626 219.470166) (xy 139.466264 219.470167) (xy 139.539321 219.484699) (xy 139.539324 219.4847) - (xy 139.539326 219.4847) (xy 141.108676 219.4847) (xy 141.108677 219.484699) (xy 141.18174 219.470166) - (xy 141.264601 219.414801) (xy 141.319966 219.33194) (xy 141.3345 219.258874) (xy 141.3345 217.689526) - (xy 141.3345 217.689523) (xy 141.334499 217.689521) (xy 141.319967 217.616464) (xy 141.319966 217.61646) - (xy 141.302286 217.59) (xy 141.264601 217.533599) (xy 141.18174 217.478234) (xy 141.181739 217.478233) + (xy 163.404722 219.719999) (xy 112.3005 219.719999) (xy 112.3005 217.689521) (xy 139.3135 217.689521) + (xy 139.3135 219.258878) (xy 139.328032 219.331935) (xy 139.328033 219.331939) (xy 139.328034 219.33194) + (xy 139.383399 219.414801) (xy 139.46626 219.470166) (xy 139.466264 219.470167) (xy 139.539321 219.484699) + (xy 139.539324 219.4847) (xy 139.539326 219.4847) (xy 141.108676 219.4847) (xy 141.108677 219.484699) + (xy 141.18174 219.470166) (xy 141.264601 219.414801) (xy 141.319966 219.33194) (xy 141.3345 219.258874) + (xy 141.3345 217.689526) (xy 141.3345 217.689523) (xy 141.334499 217.689521) (xy 141.319967 217.616464) + (xy 141.319966 217.61646) (xy 141.264601 217.533599) (xy 141.18174 217.478234) (xy 141.181739 217.478233) (xy 141.181735 217.478232) (xy 141.108677 217.4637) (xy 141.108674 217.4637) (xy 139.539326 217.4637) (xy 139.539323 217.4637) (xy 139.466264 217.478232) (xy 139.46626 217.478233) (xy 139.383399 217.533599) - (xy 139.328033 217.61646) (xy 139.328032 217.616464) (xy 139.3135 217.689521) (xy 118.455539 217.689521) - (xy 118.465341 217.59) (xy 118.446024 217.393868) (xy 118.388814 217.205273) (xy 118.388811 217.205269) - (xy 118.388811 217.205266) (xy 118.295913 217.031467) (xy 118.295909 217.03146) (xy 118.170883 216.879116) - (xy 118.018539 216.75409) (xy 118.018532 216.754086) (xy 117.844733 216.661188) (xy 117.844727 216.661186) - (xy 117.656132 216.603976) (xy 117.656129 216.603975) (xy 117.46 216.584659) (xy 117.26387 216.603975) - (xy 117.075266 216.661188) (xy 116.901467 216.754086) (xy 116.90146 216.75409) (xy 116.749116 216.879116) - (xy 116.62409 217.03146) (xy 116.624086 217.031467) (xy 116.531188 217.205266) (xy 116.473975 217.39387) - (xy 116.454659 217.59) (xy 115.9605 217.59) (xy 115.9605 216.815326) (xy 115.9605 216.815323) (xy 115.960499 216.815321) - (xy 115.945967 216.742264) (xy 115.945966 216.74226) (xy 115.890601 216.659399) (xy 115.80774 216.604034) - (xy 115.807739 216.604033) (xy 115.807735 216.604032) (xy 115.734677 216.5895) (xy 115.734674 216.5895) - (xy 114.185326 216.5895) (xy 114.185323 216.5895) (xy 114.112264 216.604032) (xy 114.11226 216.604033) - (xy 114.029399 216.659399) (xy 113.974033 216.74226) (xy 113.974032 216.742264) (xy 113.9595 216.815321) - (xy 112.3005 216.815321) (xy 112.3005 215.4742) (xy 136.308611 215.4742) (xy 136.328121 215.672295) - (xy 136.385903 215.862774) (xy 136.479731 216.038314) (xy 136.479735 216.038321) (xy 136.606011 216.192188) - (xy 136.759878 216.318464) (xy 136.759885 216.318468) (xy 136.935425 216.412296) (xy 136.935427 216.412297) - (xy 137.125907 216.470079) (xy 137.324 216.489589) (xy 137.522093 216.470079) (xy 137.712573 216.412297) - (xy 137.88812 216.318465) (xy 138.041988 216.192188) (xy 138.168265 216.03832) (xy 138.262097 215.862773) - (xy 138.319879 215.672293) (xy 138.339389 215.4742) (xy 138.319879 215.276107) (xy 138.262097 215.085627) - (xy 138.168265 214.91008) (xy 138.168264 214.910078) (xy 138.041988 214.756211) (xy 137.888121 214.629935) - (xy 137.888114 214.629931) (xy 137.712574 214.536103) (xy 137.522095 214.478321) (xy 137.324 214.458811) + (xy 139.328033 217.61646) (xy 139.328032 217.616464) (xy 139.3135 217.689521) (xy 112.3005 217.689521) + (xy 112.3005 215.4742) (xy 136.308611 215.4742) (xy 136.328121 215.672295) (xy 136.385903 215.862774) + (xy 136.479731 216.038314) (xy 136.479735 216.038321) (xy 136.606011 216.192188) (xy 136.759878 216.318464) + (xy 136.759885 216.318468) (xy 136.935425 216.412296) (xy 136.935427 216.412297) (xy 137.125907 216.470079) + (xy 137.324 216.489589) (xy 137.522093 216.470079) (xy 137.712573 216.412297) (xy 137.88812 216.318465) + (xy 138.013801 216.215321) (xy 146.189501 216.215321) (xy 146.189501 217.764678) (xy 146.204033 217.837735) + (xy 146.204034 217.837739) (xy 146.204035 217.83774) (xy 146.2594 217.920601) (xy 146.342261 217.975966) + (xy 146.342265 217.975967) (xy 146.415322 217.990499) (xy 146.415325 217.9905) (xy 146.415327 217.9905) + (xy 147.964677 217.9905) (xy 147.964678 217.990499) (xy 148.037741 217.975966) (xy 148.120602 217.920601) + (xy 148.175967 217.83774) (xy 148.190501 217.764674) (xy 148.190501 216.215326) (xy 148.190501 216.215323) + (xy 148.1905 216.215321) (xy 148.175968 216.142264) (xy 148.175967 216.14226) (xy 148.120602 216.059399) + (xy 148.037741 216.004034) (xy 148.03774 216.004033) (xy 148.037736 216.004032) (xy 147.964678 215.9895) + (xy 147.964675 215.9895) (xy 146.415327 215.9895) (xy 146.415324 215.9895) (xy 146.342265 216.004032) + (xy 146.342261 216.004033) (xy 146.2594 216.059399) (xy 146.204034 216.14226) (xy 146.204033 216.142264) + (xy 146.189501 216.215321) (xy 138.013801 216.215321) (xy 138.041988 216.192188) (xy 138.168265 216.03832) + (xy 138.262097 215.862773) (xy 138.319879 215.672293) (xy 138.339389 215.4742) (xy 138.319879 215.276107) + (xy 138.262097 215.085627) (xy 138.242273 215.048539) (xy 138.168268 214.910085) (xy 138.168264 214.910078) + (xy 138.041988 214.756211) (xy 137.888121 214.629935) (xy 137.888114 214.629931) (xy 137.712574 214.536103) + (xy 137.560595 214.49) (xy 146.18466 214.49) (xy 146.203976 214.686129) (xy 146.261189 214.874733) + (xy 146.354087 215.048532) (xy 146.354091 215.048539) (xy 146.479117 215.200883) (xy 146.631461 215.325909) + (xy 146.631468 215.325913) (xy 146.805267 215.418811) (xy 146.80527 215.418811) (xy 146.805274 215.418814) + (xy 146.993869 215.476024) (xy 147.190001 215.495341) (xy 147.386133 215.476024) (xy 147.574728 215.418814) + (xy 147.748539 215.32591) (xy 147.900884 215.200883) (xy 148.025911 215.048538) (xy 148.099916 214.910085) + (xy 148.118812 214.874733) (xy 148.118812 214.874732) (xy 148.118815 214.874727) (xy 148.176025 214.686132) + (xy 148.195342 214.49) (xy 148.176025 214.293868) (xy 148.118815 214.105273) (xy 148.118812 214.105269) + (xy 148.118812 214.105266) (xy 148.025914 213.931467) (xy 148.02591 213.93146) (xy 147.900884 213.779116) + (xy 147.74854 213.65409) (xy 147.748533 213.654086) (xy 147.574734 213.561188) (xy 147.574728 213.561186) + (xy 147.386133 213.503976) (xy 147.38613 213.503975) (xy 147.190001 213.484659) (xy 146.993871 213.503975) + (xy 146.805267 213.561188) (xy 146.631468 213.654086) (xy 146.631461 213.65409) (xy 146.479117 213.779116) + (xy 146.354091 213.93146) (xy 146.354087 213.931467) (xy 146.261189 214.105266) (xy 146.203976 214.29387) + (xy 146.18466 214.49) (xy 137.560595 214.49) (xy 137.522095 214.478321) (xy 137.324 214.458811) (xy 137.125904 214.478321) (xy 136.935425 214.536103) (xy 136.759885 214.629931) (xy 136.759878 214.629935) (xy 136.606011 214.756211) (xy 136.479735 214.910078) (xy 136.479731 214.910085) (xy 136.385903 215.085625) (xy 136.328121 215.276104) (xy 136.308611 215.4742) (xy 112.3005 215.4742) (xy 112.3005 213.092733) @@ -169971,37 +174453,37 @@ (xy 169.92893 207.551529) (xy 169.928924 207.551533) (xy 169.739242 207.699169) (xy 169.739239 207.699172) (xy 169.739236 207.699174) (xy 169.739236 207.699175) (xy 169.703294 207.738217) (xy 169.57643 207.876029) (xy 169.576427 207.876033) (xy 169.444951 208.07727) (xy 169.348389 208.29741) (xy 169.289379 208.53044) - (xy 169.269529 208.769994) (xy 112.3005 208.769994) (xy 112.3005 206.549999) (xy 225.804722 206.549999) - (xy 225.804722 206.55) (xy 225.823762 206.706818) (xy 225.87978 206.854523) (xy 225.969517 206.98453) - (xy 226.08776 207.089283) (xy 226.087762 207.089284) (xy 226.227634 207.162696) (xy 226.381014 207.2005) - (xy 226.381015 207.2005) (xy 226.538985 207.2005) (xy 226.692365 207.162696) (xy 226.83224 207.089283) - (xy 226.950483 206.98453) (xy 227.04022 206.854523) (xy 227.096237 206.706818) (xy 227.115278 206.55) - (xy 227.096237 206.393182) (xy 227.04022 206.245477) (xy 226.950483 206.11547) (xy 226.83224 206.010717) - (xy 226.832238 206.010716) (xy 226.832237 206.010715) (xy 226.692365 205.937303) (xy 226.538986 205.8995) - (xy 226.538985 205.8995) (xy 226.381015 205.8995) (xy 226.381014 205.8995) (xy 226.227634 205.937303) - (xy 226.087762 206.010715) (xy 225.969516 206.115471) (xy 225.879781 206.245475) (xy 225.87978 206.245476) - (xy 225.823762 206.393181) (xy 225.804722 206.549999) (xy 112.3005 206.549999) (xy 112.3005 205.869999) - (xy 136.804722 205.869999) (xy 136.804722 205.87) (xy 136.823762 206.026818) (xy 136.870669 206.1505) - (xy 136.87978 206.174523) (xy 136.969517 206.30453) (xy 137.08776 206.409283) (xy 137.087762 206.409284) - (xy 137.227634 206.482696) (xy 137.381014 206.5205) (xy 137.381015 206.5205) (xy 137.538985 206.5205) - (xy 137.692365 206.482696) (xy 137.83224 206.409283) (xy 137.950483 206.30453) (xy 138.04022 206.174523) - (xy 138.096237 206.026818) (xy 138.115278 205.87) (xy 138.096237 205.713182) (xy 138.04022 205.565477) - (xy 137.950483 205.43547) (xy 137.83224 205.330717) (xy 137.832238 205.330716) (xy 137.832237 205.330715) - (xy 137.692365 205.257303) (xy 137.538986 205.2195) (xy 137.538985 205.2195) (xy 137.381015 205.2195) - (xy 137.381014 205.2195) (xy 137.227634 205.257303) (xy 137.087762 205.330715) (xy 136.969516 205.435471) - (xy 136.879781 205.565475) (xy 136.87978 205.565476) (xy 136.823762 205.713181) (xy 136.804722 205.869999) - (xy 112.3005 205.869999) (xy 112.3005 204.889999) (xy 113.274722 204.889999) (xy 113.274722 204.89) - (xy 113.293762 205.046818) (xy 113.34978 205.194523) (xy 113.439517 205.32453) (xy 113.55776 205.429283) - (xy 113.557762 205.429284) (xy 113.697634 205.502696) (xy 113.851014 205.5405) (xy 113.851015 205.5405) - (xy 114.008985 205.5405) (xy 114.162365 205.502696) (xy 114.233292 205.46547) (xy 114.30224 205.429283) - (xy 114.420483 205.32453) (xy 114.51022 205.194523) (xy 114.566237 205.046818) (xy 114.585278 204.89) - (xy 114.580361 204.8495) (xy 114.566237 204.733181) (xy 114.544992 204.677164) (xy 114.51022 204.585477) - (xy 114.420483 204.45547) (xy 114.30224 204.350717) (xy 114.302238 204.350716) (xy 114.302237 204.350715) - (xy 114.162365 204.277303) (xy 114.008986 204.2395) (xy 114.008985 204.2395) (xy 113.851015 204.2395) - (xy 113.851014 204.2395) (xy 113.697634 204.277303) (xy 113.557762 204.350715) (xy 113.439516 204.455471) - (xy 113.349781 204.585475) (xy 113.34978 204.585476) (xy 113.293762 204.733181) (xy 113.274722 204.889999) - (xy 112.3005 204.889999) (xy 112.3005 201.3) (xy 126.5 201.3) (xy 126.5 201.6) (xy 137.4 201.6) - (xy 137.4 201.599999) (xy 185.944722 201.599999) (xy 185.944722 201.6) (xy 185.963762 201.756818) + (xy 169.269529 208.769994) (xy 112.3005 208.769994) (xy 112.3005 205.999999) (xy 116.444722 205.999999) + (xy 116.444722 206) (xy 116.463762 206.156818) (xy 116.51978 206.304523) (xy 116.609517 206.43453) + (xy 116.72776 206.539283) (xy 116.727762 206.539284) (xy 116.867634 206.612696) (xy 117.021014 206.6505) + (xy 117.021015 206.6505) (xy 117.178985 206.6505) (xy 117.332365 206.612696) (xy 117.451823 206.549999) + (xy 225.804722 206.549999) (xy 225.804722 206.55) (xy 225.823762 206.706818) (xy 225.87978 206.854523) + (xy 225.969517 206.98453) (xy 226.08776 207.089283) (xy 226.087762 207.089284) (xy 226.227634 207.162696) + (xy 226.381014 207.2005) (xy 226.381015 207.2005) (xy 226.538985 207.2005) (xy 226.692365 207.162696) + (xy 226.83224 207.089283) (xy 226.950483 206.98453) (xy 227.04022 206.854523) (xy 227.096237 206.706818) + (xy 227.115278 206.55) (xy 227.096237 206.393182) (xy 227.04022 206.245477) (xy 226.950483 206.11547) + (xy 226.83224 206.010717) (xy 226.832238 206.010716) (xy 226.832237 206.010715) (xy 226.692365 205.937303) + (xy 226.538986 205.8995) (xy 226.538985 205.8995) (xy 226.381015 205.8995) (xy 226.381014 205.8995) + (xy 226.227634 205.937303) (xy 226.087762 206.010715) (xy 225.969516 206.115471) (xy 225.879781 206.245475) + (xy 225.87978 206.245476) (xy 225.823762 206.393181) (xy 225.804722 206.549999) (xy 117.451823 206.549999) + (xy 117.47224 206.539283) (xy 117.590483 206.43453) (xy 117.68022 206.304523) (xy 117.736237 206.156818) + (xy 117.755278 206) (xy 117.747666 205.937304) (xy 117.739493 205.869999) (xy 136.804722 205.869999) + (xy 136.804722 205.87) (xy 136.823762 206.026818) (xy 136.870669 206.1505) (xy 136.87978 206.174523) + (xy 136.969517 206.30453) (xy 137.08776 206.409283) (xy 137.087762 206.409284) (xy 137.227634 206.482696) + (xy 137.381014 206.5205) (xy 137.381015 206.5205) (xy 137.538985 206.5205) (xy 137.692365 206.482696) + (xy 137.83224 206.409283) (xy 137.950483 206.30453) (xy 138.04022 206.174523) (xy 138.096237 206.026818) + (xy 138.115278 205.87) (xy 138.096237 205.713182) (xy 138.089522 205.695477) (xy 138.051597 205.595476) + (xy 138.04022 205.565477) (xy 137.950483 205.43547) (xy 137.83224 205.330717) (xy 137.832238 205.330716) + (xy 137.832237 205.330715) (xy 137.692365 205.257303) (xy 137.538986 205.2195) (xy 137.538985 205.2195) + (xy 137.381015 205.2195) (xy 137.381014 205.2195) (xy 137.227634 205.257303) (xy 137.087762 205.330715) + (xy 136.969516 205.435471) (xy 136.879781 205.565475) (xy 136.87978 205.565476) (xy 136.823762 205.713181) + (xy 136.804722 205.869999) (xy 117.739493 205.869999) (xy 117.736237 205.843181) (xy 117.698312 205.743182) + (xy 117.68022 205.695477) (xy 117.590483 205.56547) (xy 117.47224 205.460717) (xy 117.472238 205.460716) + (xy 117.472237 205.460715) (xy 117.332365 205.387303) (xy 117.178986 205.3495) (xy 117.178985 205.3495) + (xy 117.021015 205.3495) (xy 117.021014 205.3495) (xy 116.867634 205.387303) (xy 116.727762 205.460715) + (xy 116.609516 205.565471) (xy 116.519781 205.695475) (xy 116.51978 205.695476) (xy 116.463762 205.843181) + (xy 116.444722 205.999999) (xy 112.3005 205.999999) (xy 112.3005 201.3) (xy 126.5 201.3) (xy 126.5 201.6) + (xy 137.4 201.6) (xy 137.4 201.599999) (xy 185.944722 201.599999) (xy 185.944722 201.6) (xy 185.963762 201.756818) (xy 186.01978 201.904523) (xy 186.109517 202.03453) (xy 186.22776 202.139283) (xy 186.227762 202.139284) (xy 186.367634 202.212696) (xy 186.521014 202.2505) (xy 186.521015 202.2505) (xy 186.678985 202.2505) (xy 186.832365 202.212696) (xy 186.97224 202.139283) (xy 187.090483 202.03453) (xy 187.18022 201.904523) @@ -170176,500 +174658,509 @@ (xy 153.674229 193.758723) (xy 153.534357 193.685311) (xy 153.380978 193.647508) (xy 153.380977 193.647508) (xy 153.223007 193.647508) (xy 153.223006 193.647508) (xy 153.069626 193.685311) (xy 152.929754 193.758723) (xy 152.811508 193.863479) (xy 152.721773 193.993483) (xy 152.721772 193.993484) (xy 152.665754 194.141189) - (xy 152.646714 194.298007) (xy 139 194.298007) (xy 139 191.749999) (xy 189.594722 191.749999) (xy 189.594722 191.75) - (xy 189.613762 191.906818) (xy 189.66978 192.054523) (xy 189.759517 192.18453) (xy 189.87776 192.289283) + (xy 152.646714 194.298007) (xy 139 194.298007) (xy 139 191.699999) (xy 155.149722 191.699999) (xy 155.149722 191.7) + (xy 155.168762 191.856818) (xy 155.187725 191.906818) (xy 155.22478 192.004523) (xy 155.314517 192.13453) + (xy 155.43276 192.239283) (xy 155.432762 192.239284) (xy 155.572634 192.312696) (xy 155.726014 192.3505) + (xy 155.726015 192.3505) (xy 155.883985 192.3505) (xy 156.037365 192.312696) (xy 156.081974 192.289283) + (xy 156.17724 192.239283) (xy 156.295483 192.13453) (xy 156.38522 192.004523) (xy 156.441237 191.856818) + (xy 156.454207 191.749999) (xy 189.594722 191.749999) (xy 189.594722 191.75) (xy 189.613762 191.906818) + (xy 189.650818 192.004524) (xy 189.66978 192.054523) (xy 189.759517 192.18453) (xy 189.87776 192.289283) (xy 189.877762 192.289284) (xy 190.017634 192.362696) (xy 190.171014 192.4005) (xy 190.171015 192.4005) - (xy 190.328985 192.4005) (xy 190.482365 192.362696) (xy 190.62224 192.289283) (xy 190.740483 192.18453) - (xy 190.83022 192.054523) (xy 190.886237 191.906818) (xy 190.905278 191.75) (xy 190.886237 191.593182) - (xy 190.83022 191.445477) (xy 190.740483 191.31547) (xy 190.62224 191.210717) (xy 190.622238 191.210716) - (xy 190.622237 191.210715) (xy 190.482365 191.137303) (xy 190.328986 191.0995) (xy 190.328985 191.0995) - (xy 190.171015 191.0995) (xy 190.171014 191.0995) (xy 190.017634 191.137303) (xy 189.877762 191.210715) - (xy 189.759516 191.315471) (xy 189.669781 191.445475) (xy 189.66978 191.445476) (xy 189.613762 191.593181) - (xy 189.594722 191.749999) (xy 139 191.749999) (xy 139 188.955321) (xy 150.8295 188.955321) (xy 150.8295 190.504678) - (xy 150.844032 190.577735) (xy 150.844033 190.577739) (xy 150.844034 190.57774) (xy 150.899399 190.660601) - (xy 150.98226 190.715966) (xy 150.982264 190.715967) (xy 151.055321 190.730499) (xy 151.055324 190.7305) - (xy 151.055326 190.7305) (xy 152.604676 190.7305) (xy 152.604677 190.730499) (xy 152.67774 190.715966) - (xy 152.760601 190.660601) (xy 152.815966 190.57774) (xy 152.8305 190.504674) (xy 152.8305 189.73) - (xy 153.324659 189.73) (xy 153.343975 189.926129) (xy 153.343976 189.926132) (xy 153.398845 190.107011) - (xy 153.401188 190.114733) (xy 153.494086 190.288532) (xy 153.49409 190.288539) (xy 153.619116 190.440883) - (xy 153.77146 190.565909) (xy 153.771467 190.565913) (xy 153.945266 190.658811) (xy 153.945269 190.658811) - (xy 153.945273 190.658814) (xy 154.133868 190.716024) (xy 154.33 190.735341) (xy 154.526132 190.716024) - (xy 154.714727 190.658814) (xy 154.888538 190.56591) (xy 155.040883 190.440883) (xy 155.16591 190.288538) - (xy 155.258814 190.114727) (xy 155.316024 189.926132) (xy 155.335341 189.73) (xy 155.316024 189.533868) - (xy 155.258814 189.345273) (xy 155.258811 189.345269) (xy 155.258811 189.345266) (xy 155.165913 189.171467) - (xy 155.165909 189.17146) (xy 155.040883 189.019116) (xy 154.888539 188.89409) (xy 154.888532 188.894086) - (xy 154.714733 188.801188) (xy 154.714727 188.801186) (xy 154.526132 188.743976) (xy 154.526129 188.743975) - (xy 154.33 188.724659) (xy 154.13387 188.743975) (xy 153.945266 188.801188) (xy 153.771467 188.894086) - (xy 153.77146 188.89409) (xy 153.619116 189.019116) (xy 153.49409 189.17146) (xy 153.494086 189.171467) - (xy 153.401188 189.345266) (xy 153.343975 189.53387) (xy 153.324659 189.73) (xy 152.8305 189.73) - (xy 152.8305 188.955326) (xy 152.8305 188.955323) (xy 152.830499 188.955321) (xy 152.815967 188.882264) - (xy 152.815966 188.88226) (xy 152.774155 188.819685) (xy 152.760601 188.799399) (xy 152.67774 188.744034) - (xy 152.677739 188.744033) (xy 152.677735 188.744032) (xy 152.604677 188.7295) (xy 152.604674 188.7295) - (xy 151.055326 188.7295) (xy 151.055323 188.7295) (xy 150.982264 188.744032) (xy 150.98226 188.744033) - (xy 150.899399 188.799399) (xy 150.844033 188.88226) (xy 150.844032 188.882264) (xy 150.8295 188.955321) - (xy 139 188.955321) (xy 139 188.509999) (xy 155.174722 188.509999) (xy 155.174722 188.51) (xy 155.193762 188.666818) - (xy 155.223047 188.744034) (xy 155.24978 188.814523) (xy 155.339517 188.94453) (xy 155.45776 189.049283) - (xy 155.457762 189.049284) (xy 155.597634 189.122696) (xy 155.751014 189.1605) (xy 155.751015 189.1605) - (xy 155.908985 189.1605) (xy 156.062365 189.122696) (xy 156.068454 189.1195) (xy 156.20224 189.049283) - (xy 156.320483 188.94453) (xy 156.41022 188.814523) (xy 156.466237 188.666818) (xy 156.485278 188.51) - (xy 156.466679 188.356818) (xy 156.466237 188.353181) (xy 156.438602 188.280315) (xy 156.41022 188.205477) - (xy 156.320483 188.07547) (xy 156.20224 187.970717) (xy 156.202238 187.970716) (xy 156.202237 187.970715) - (xy 156.062365 187.897303) (xy 155.908986 187.8595) (xy 155.908985 187.8595) (xy 155.751015 187.8595) - (xy 155.751014 187.8595) (xy 155.597634 187.897303) (xy 155.457762 187.970715) (xy 155.339516 188.075471) - (xy 155.249781 188.205475) (xy 155.24978 188.205476) (xy 155.193762 188.353181) (xy 155.174722 188.509999) - (xy 139 188.509999) (xy 139 187.699999) (xy 165.744722 187.699999) (xy 165.744722 187.7) (xy 165.763762 187.856818) - (xy 165.779117 187.897304) (xy 165.81978 188.004523) (xy 165.909517 188.13453) (xy 166.02776 188.239283) - (xy 166.027762 188.239284) (xy 166.167634 188.312696) (xy 166.321014 188.3505) (xy 166.321015 188.3505) - (xy 166.478985 188.3505) (xy 166.630567 188.313139) (xy 166.700367 188.316208) (xy 166.757429 188.356528) - (xy 166.776182 188.389565) (xy 166.792391 188.432304) (xy 166.81978 188.504523) (xy 166.909517 188.63453) - (xy 167.02776 188.739283) (xy 167.027762 188.739284) (xy 167.167634 188.812696) (xy 167.321014 188.8505) - (xy 167.321015 188.8505) (xy 167.478985 188.8505) (xy 167.632365 188.812696) (xy 167.6577 188.799399) - (xy 167.77224 188.739283) (xy 167.890483 188.63453) (xy 167.98022 188.504523) (xy 168.036237 188.356818) - (xy 168.055278 188.2) (xy 168.040158 188.07547) (xy 168.036237 188.043181) (xy 168.008754 187.970715) - (xy 167.98022 187.895477) (xy 167.890483 187.76547) (xy 167.77224 187.660717) (xy 167.772238 187.660716) - (xy 167.772237 187.660715) (xy 167.632365 187.587303) (xy 167.478986 187.5495) (xy 167.478985 187.5495) - (xy 167.321015 187.5495) (xy 167.321014 187.5495) (xy 167.169433 187.58686) (xy 167.099631 187.58379) - (xy 167.042569 187.54347) (xy 167.023817 187.510434) (xy 166.98022 187.395477) (xy 166.890483 187.26547) - (xy 166.77224 187.160717) (xy 166.772238 187.160716) (xy 166.772237 187.160715) (xy 166.632365 187.087303) - (xy 166.478986 187.0495) (xy 166.478985 187.0495) (xy 166.321015 187.0495) (xy 166.321014 187.0495) - (xy 166.167634 187.087303) (xy 166.027762 187.160715) (xy 165.909516 187.265471) (xy 165.819781 187.395475) - (xy 165.81978 187.395476) (xy 165.763762 187.543181) (xy 165.744722 187.699999) (xy 139 187.699999) - (xy 139 186.6) (xy 126.8 186.6) (xy 126.5 186.6) (xy 126.5 201.3) (xy 112.3005 201.3) (xy 112.3005 186.269999) - (xy 145.344722 186.269999) (xy 145.344722 186.27) (xy 145.363762 186.426818) (xy 145.41978 186.574523) - (xy 145.509517 186.70453) (xy 145.62776 186.809283) (xy 145.627762 186.809284) (xy 145.767634 186.882696) - (xy 145.921014 186.9205) (xy 145.921015 186.9205) (xy 146.078985 186.9205) (xy 146.232365 186.882696) - (xy 146.37224 186.809283) (xy 146.490483 186.70453) (xy 146.58022 186.574523) (xy 146.636237 186.426818) - (xy 146.653804 186.282142) (xy 149.344722 186.282142) (xy 149.344722 186.282143) (xy 149.363762 186.438961) - (xy 149.415175 186.574523) (xy 149.41978 186.586666) (xy 149.509517 186.716673) (xy 149.62776 186.821426) - (xy 149.627762 186.821427) (xy 149.767634 186.894839) (xy 149.921014 186.932643) (xy 149.921015 186.932643) - (xy 150.078985 186.932643) (xy 150.232365 186.894839) (xy 150.255501 186.882696) (xy 150.37224 186.821426) - (xy 150.490483 186.716673) (xy 150.58022 186.586666) (xy 150.636237 186.438961) (xy 150.655278 186.282143) - (xy 150.653804 186.269999) (xy 150.636237 186.125324) (xy 150.612485 186.062696) (xy 150.58022 185.97762) - (xy 150.490483 185.847613) (xy 150.37224 185.74286) (xy 150.372238 185.742859) (xy 150.372237 185.742858) - (xy 150.232365 185.669446) (xy 150.078986 185.631643) (xy 150.078985 185.631643) (xy 149.921015 185.631643) - (xy 149.921014 185.631643) (xy 149.767634 185.669446) (xy 149.627762 185.742858) (xy 149.509516 185.847614) - (xy 149.419781 185.977618) (xy 149.41978 185.977619) (xy 149.363762 186.125324) (xy 149.344722 186.282142) - (xy 146.653804 186.282142) (xy 146.655278 186.27) (xy 146.637712 186.125325) (xy 146.636237 186.113181) - (xy 146.614992 186.057164) (xy 146.58022 185.965477) (xy 146.490483 185.83547) (xy 146.37224 185.730717) - (xy 146.372238 185.730716) (xy 146.372237 185.730715) (xy 146.232365 185.657303) (xy 146.078986 185.6195) - (xy 146.078985 185.6195) (xy 145.921015 185.6195) (xy 145.921014 185.6195) (xy 145.767634 185.657303) - (xy 145.627762 185.730715) (xy 145.509516 185.835471) (xy 145.419781 185.965475) (xy 145.41978 185.965476) - (xy 145.363762 186.113181) (xy 145.344722 186.269999) (xy 112.3005 186.269999) (xy 112.3005 185.449999) - (xy 156.144722 185.449999) (xy 156.144722 185.45) (xy 156.163762 185.606818) (xy 156.215356 185.742858) - (xy 156.21978 185.754523) (xy 156.309517 185.88453) (xy 156.42776 185.989283) (xy 156.427762 185.989284) - (xy 156.567634 186.062696) (xy 156.721014 186.1005) (xy 156.721015 186.1005) (xy 156.878985 186.1005) - (xy 157.032365 186.062696) (xy 157.17224 185.989283) (xy 157.290483 185.88453) (xy 157.38022 185.754523) - (xy 157.436237 185.606818) (xy 157.455278 185.45) (xy 157.453401 185.434537) (xy 157.436237 185.293181) - (xy 157.400093 185.197879) (xy 157.38022 185.145477) (xy 157.290483 185.01547) (xy 157.17224 184.910717) - (xy 157.172238 184.910716) (xy 157.172237 184.910715) (xy 157.032365 184.837303) (xy 156.878986 184.7995) - (xy 156.878985 184.7995) (xy 156.721015 184.7995) (xy 156.721014 184.7995) (xy 156.567634 184.837303) - (xy 156.427762 184.910715) (xy 156.399415 184.935828) (xy 156.326973 185.000006) (xy 156.309516 185.015471) - (xy 156.219781 185.145475) (xy 156.21978 185.145476) (xy 156.163762 185.293181) (xy 156.144722 185.449999) - (xy 112.3005 185.449999) (xy 112.3005 183.864992) (xy 165.704529 183.864992) (xy 165.704529 183.865003) - (xy 165.724379 184.104557) (xy 165.783389 184.337587) (xy 165.879951 184.557727) (xy 166.011427 184.758964) - (xy 166.011429 184.758967) (xy 166.174236 184.935823) (xy 166.174239 184.935825) (xy 166.174242 184.935828) - (xy 166.363924 185.083464) (xy 166.36393 185.083468) (xy 166.363933 185.08347) (xy 166.575344 185.19788) - (xy 166.575347 185.197881) (xy 166.802699 185.275931) (xy 166.802701 185.275931) (xy 166.802703 185.275932) - (xy 167.039808 185.315498) (xy 167.039809 185.315498) (xy 167.280191 185.315498) (xy 167.280192 185.315498) - (xy 167.517297 185.275932) (xy 167.744656 185.19788) (xy 167.956067 185.08347) (xy 168.145764 184.935823) - (xy 168.145768 184.935817) (xy 168.147566 184.934419) (xy 168.21256 184.908776) (xy 168.2811 184.922342) - (xy 168.331425 184.97081) (xy 168.346825 185.017325) (xy 168.363763 185.156819) (xy 168.408937 185.275932) - (xy 168.41978 185.304523) (xy 168.509517 185.43453) (xy 168.62776 185.539283) (xy 168.627762 185.539284) - (xy 168.767634 185.612696) (xy 168.921014 185.6505) (xy 168.921015 185.6505) (xy 169.078985 185.6505) - (xy 169.232365 185.612696) (xy 169.243564 185.606818) (xy 169.37224 185.539283) (xy 169.490483 185.43453) - (xy 169.58022 185.304523) (xy 169.584053 185.294415) (xy 169.62623 185.238713) (xy 169.691828 185.214655) - (xy 169.760018 185.229881) (xy 169.809152 185.279557) (xy 169.815934 185.294407) (xy 169.819771 185.304524) - (xy 169.819774 185.304532) (xy 169.864641 185.369533) (xy 169.90951 185.434537) (xy 170.027753 185.53929) - (xy 170.027755 185.539291) (xy 170.167627 185.612703) (xy 170.321007 185.650507) (xy 170.321008 185.650507) - (xy 170.478978 185.650507) (xy 170.632358 185.612703) (xy 170.643571 185.606818) (xy 170.772233 185.53929) - (xy 170.890476 185.434537) (xy 170.980213 185.30453) (xy 171.03623 185.156825) (xy 171.055271 185.000007) - (xy 171.03623 184.843189) (xy 171.036227 184.843182) (xy 171.004288 184.758964) (xy 170.980213 184.695484) - (xy 170.890476 184.565477) (xy 170.772233 184.460724) (xy 170.772231 184.460723) (xy 170.77223 184.460722) - (xy 170.632358 184.38731) (xy 170.478979 184.349507) (xy 170.478978 184.349507) (xy 170.321008 184.349507) - (xy 170.321007 184.349507) (xy 170.167627 184.38731) (xy 170.027755 184.460722) (xy 169.909509 184.565478) - (xy 169.819774 184.695482) (xy 169.81977 184.695488) (xy 169.815936 184.705598) (xy 169.773755 184.761298) - (xy 169.708156 184.785351) (xy 169.639966 184.77012) (xy 169.590836 184.720441) (xy 169.584058 184.705598) - (xy 169.58022 184.695477) (xy 169.490483 184.56547) (xy 169.37224 184.460717) (xy 169.372238 184.460716) - (xy 169.372237 184.460715) (xy 169.232365 184.387303) (xy 169.078986 184.3495) (xy 169.078985 184.3495) - (xy 168.921015 184.3495) (xy 168.921014 184.3495) (xy 168.767634 184.387303) (xy 168.767633 184.387304) - (xy 168.732723 184.405626) (xy 168.664215 184.41935) (xy 168.599162 184.393857) (xy 168.558219 184.337241) - (xy 168.554384 184.267477) (xy 168.554893 184.265389) (xy 168.59562 184.104561) (xy 168.615471 183.864998) - (xy 168.615471 183.864992) (xy 179.174529 183.864992) (xy 179.174529 183.865003) (xy 179.194379 184.104557) - (xy 179.253389 184.337587) (xy 179.349951 184.557727) (xy 179.481427 184.758964) (xy 179.481429 184.758967) - (xy 179.644236 184.935823) (xy 179.644239 184.935825) (xy 179.644242 184.935828) (xy 179.833924 185.083464) - (xy 179.83393 185.083468) (xy 179.833933 185.08347) (xy 180.045344 185.19788) (xy 180.045347 185.197881) - (xy 180.272699 185.275931) (xy 180.272701 185.275931) (xy 180.272703 185.275932) (xy 180.509808 185.315498) - (xy 180.509809 185.315498) (xy 180.750191 185.315498) (xy 180.750192 185.315498) (xy 180.987297 185.275932) - (xy 181.214656 185.19788) (xy 181.426067 185.08347) (xy 181.615764 184.935823) (xy 181.778571 184.758967) - (xy 181.910049 184.557726) (xy 182.00661 184.337589) (xy 182.06562 184.104561) (xy 182.085471 183.864998) - (xy 182.06562 183.625435) (xy 182.00661 183.392407) (xy 181.910049 183.17227) (xy 181.85806 183.092696) - (xy 181.778572 182.971031) (xy 181.778571 182.971029) (xy 181.615764 182.794173) (xy 181.615759 182.794169) - (xy 181.615757 182.794167) (xy 181.426075 182.646531) (xy 181.426069 182.646527) (xy 181.214657 182.532116) - (xy 181.214652 182.532114) (xy 180.9873 182.454064) (xy 180.809468 182.424389) (xy 180.750192 182.414498) - (xy 180.509808 182.414498) (xy 180.462387 182.422411) (xy 180.272699 182.454064) (xy 180.045347 182.532114) - (xy 180.045342 182.532116) (xy 179.83393 182.646527) (xy 179.833924 182.646531) (xy 179.644242 182.794167) - (xy 179.644239 182.79417) (xy 179.48143 182.971027) (xy 179.481427 182.971031) (xy 179.349951 183.172268) - (xy 179.253389 183.392408) (xy 179.194379 183.625438) (xy 179.174529 183.864992) (xy 168.615471 183.864992) - (xy 168.59562 183.625435) (xy 168.53661 183.392407) (xy 168.440049 183.17227) (xy 168.38806 183.092696) - (xy 168.308572 182.971031) (xy 168.308571 182.971029) (xy 168.145764 182.794173) (xy 168.145759 182.794169) - (xy 168.145757 182.794167) (xy 167.956075 182.646531) (xy 167.956069 182.646527) (xy 167.744657 182.532116) - (xy 167.744652 182.532114) (xy 167.5173 182.454064) (xy 167.339468 182.424389) (xy 167.280192 182.414498) - (xy 167.039808 182.414498) (xy 166.992387 182.422411) (xy 166.802699 182.454064) (xy 166.575347 182.532114) - (xy 166.575342 182.532116) (xy 166.36393 182.646527) (xy 166.363924 182.646531) (xy 166.174242 182.794167) - (xy 166.174239 182.79417) (xy 166.01143 182.971027) (xy 166.011427 182.971031) (xy 165.879951 183.172268) - (xy 165.783389 183.392408) (xy 165.724379 183.625438) (xy 165.704529 183.864992) (xy 112.3005 183.864992) - (xy 112.3005 180.464992) (xy 165.704529 180.464992) (xy 165.704529 180.465003) (xy 165.724379 180.704557) - (xy 165.783389 180.937587) (xy 165.879951 181.157727) (xy 165.995462 181.334528) (xy 166.011429 181.358967) - (xy 166.174236 181.535823) (xy 166.174239 181.535825) (xy 166.174242 181.535828) (xy 166.363924 181.683464) - (xy 166.36393 181.683468) (xy 166.363933 181.68347) (xy 166.575344 181.79788) (xy 166.575347 181.797881) - (xy 166.802699 181.875931) (xy 166.802701 181.875931) (xy 166.802703 181.875932) (xy 167.039808 181.915498) - (xy 167.039809 181.915498) (xy 167.280191 181.915498) (xy 167.280192 181.915498) (xy 167.517297 181.875932) - (xy 167.744656 181.79788) (xy 167.956067 181.68347) (xy 168.145764 181.535823) (xy 168.308571 181.358967) - (xy 168.440049 181.157726) (xy 168.53661 180.937589) (xy 168.546129 180.899999) (xy 171.944722 180.899999) - (xy 171.944722 180.9) (xy 171.963762 181.056818) (xy 172.01978 181.204523) (xy 172.109517 181.33453) - (xy 172.22776 181.439283) (xy 172.227762 181.439284) (xy 172.367634 181.512696) (xy 172.521014 181.5505) - (xy 172.521015 181.5505) (xy 172.678985 181.5505) (xy 172.832365 181.512696) (xy 172.97224 181.439283) - (xy 173.090483 181.33453) (xy 173.18022 181.204523) (xy 173.236237 181.056818) (xy 173.255278 180.9) - (xy 173.236237 180.743182) (xy 173.18022 180.595477) (xy 173.090483 180.46547) (xy 172.97224 180.360717) - (xy 172.972238 180.360716) (xy 172.972237 180.360715) (xy 172.832365 180.287303) (xy 172.678986 180.2495) - (xy 172.678985 180.2495) (xy 172.521015 180.2495) (xy 172.521014 180.2495) (xy 172.367634 180.287303) - (xy 172.227762 180.360715) (xy 172.109516 180.465471) (xy 172.019781 180.595475) (xy 172.01978 180.595476) - (xy 171.963762 180.743181) (xy 171.944722 180.899999) (xy 168.546129 180.899999) (xy 168.59562 180.704561) - (xy 168.604659 180.595475) (xy 168.615471 180.465003) (xy 168.615471 180.464992) (xy 168.59562 180.225438) - (xy 168.59562 180.225435) (xy 168.563351 180.098007) (xy 173.44273 180.098007) (xy 173.44273 180.098008) - (xy 173.46177 180.254826) (xy 173.501929 180.360715) (xy 173.517788 180.402531) (xy 173.607525 180.532538) - (xy 173.725768 180.637291) (xy 173.72577 180.637292) (xy 173.865642 180.710704) (xy 174.019022 180.748508) - (xy 174.019023 180.748508) (xy 174.176993 180.748508) (xy 174.330373 180.710704) (xy 174.342085 180.704557) - (xy 174.470248 180.637291) (xy 174.588491 180.532538) (xy 174.678228 180.402531) (xy 174.734245 180.254826) - (xy 174.753286 180.098008) (xy 174.734245 179.94119) (xy 174.678228 179.793485) (xy 174.588491 179.663478) - (xy 174.470248 179.558725) (xy 174.470246 179.558724) (xy 174.470245 179.558723) (xy 174.330373 179.485311) - (xy 174.176994 179.447508) (xy 174.176993 179.447508) (xy 174.019023 179.447508) (xy 174.019022 179.447508) - (xy 173.865642 179.485311) (xy 173.72577 179.558723) (xy 173.607524 179.663479) (xy 173.517789 179.793483) - (xy 173.517788 179.793484) (xy 173.46177 179.941189) (xy 173.44273 180.098007) (xy 168.563351 180.098007) - (xy 168.53661 179.992407) (xy 168.440049 179.77227) (xy 168.308571 179.571029) (xy 168.145764 179.394173) - (xy 168.145759 179.394169) (xy 168.145757 179.394167) (xy 167.956075 179.246531) (xy 167.956069 179.246527) - (xy 167.944598 179.240319) (xy 179.1795 179.240319) (xy 179.1795 181.689676) (xy 179.194032 181.762733) - (xy 179.194033 181.762737) (xy 179.194034 181.762738) (xy 179.249399 181.845599) (xy 179.33226 181.900964) - (xy 179.332264 181.900965) (xy 179.405321 181.915497) (xy 179.405324 181.915498) (xy 179.405326 181.915498) - (xy 181.854676 181.915498) (xy 181.854677 181.915497) (xy 181.92774 181.900964) (xy 182.010601 181.845599) - (xy 182.065966 181.762738) (xy 182.0805 181.689672) (xy 182.0805 179.240324) (xy 182.0805 179.240321) - (xy 182.080499 179.240319) (xy 182.065967 179.167262) (xy 182.065966 179.167258) (xy 182.042484 179.132114) - (xy 182.010601 179.084397) (xy 181.92774 179.029032) (xy 181.927739 179.029031) (xy 181.927735 179.02903) - (xy 181.854677 179.014498) (xy 181.854674 179.014498) (xy 179.405326 179.014498) (xy 179.405323 179.014498) - (xy 179.332264 179.02903) (xy 179.33226 179.029031) (xy 179.249399 179.084397) (xy 179.194033 179.167258) - (xy 179.194032 179.167262) (xy 179.1795 179.240319) (xy 167.944598 179.240319) (xy 167.744657 179.132116) - (xy 167.744652 179.132114) (xy 167.5173 179.054064) (xy 167.339468 179.024389) (xy 167.280192 179.014498) - (xy 167.039808 179.014498) (xy 166.992387 179.022411) (xy 166.802699 179.054064) (xy 166.575347 179.132114) - (xy 166.575342 179.132116) (xy 166.36393 179.246527) (xy 166.363924 179.246531) (xy 166.174242 179.394167) - (xy 166.174239 179.39417) (xy 166.01143 179.571027) (xy 166.011427 179.571031) (xy 165.879951 179.772268) - (xy 165.783389 179.992408) (xy 165.724379 180.225438) (xy 165.704529 180.464992) (xy 112.3005 180.464992) - (xy 112.3005 178.399999) (xy 187.144722 178.399999) (xy 187.144722 178.4) (xy 187.163762 178.556818) - (xy 187.21978 178.704523) (xy 187.309517 178.83453) (xy 187.42776 178.939283) (xy 187.427762 178.939284) - (xy 187.567634 179.012696) (xy 187.721014 179.0505) (xy 187.721015 179.0505) (xy 187.878985 179.0505) - (xy 188.032365 179.012696) (xy 188.17224 178.939283) (xy 188.290483 178.83453) (xy 188.38022 178.704523) - (xy 188.436237 178.556818) (xy 188.446172 178.474999) (xy 192.144722 178.474999) (xy 192.144722 178.475) - (xy 192.163762 178.631818) (xy 192.21978 178.779523) (xy 192.309517 178.90953) (xy 192.42776 179.014283) - (xy 192.427762 179.014284) (xy 192.567634 179.087696) (xy 192.721014 179.1255) (xy 192.721015 179.1255) - (xy 192.878985 179.1255) (xy 193.032365 179.087696) (xy 193.038651 179.084397) (xy 193.17224 179.014283) - (xy 193.290483 178.90953) (xy 193.38022 178.779523) (xy 193.436237 178.631818) (xy 193.455278 178.475) - (xy 193.448253 178.417146) (xy 193.459713 178.348226) (xy 193.506616 178.29644) (xy 193.574072 178.278232) - (xy 193.628975 178.292406) (xy 193.667634 178.312696) (xy 193.821014 178.3505) (xy 193.821015 178.3505) - (xy 193.978985 178.3505) (xy 194.132365 178.312696) (xy 194.171024 178.292406) (xy 194.27224 178.239283) - (xy 194.390483 178.13453) (xy 194.48022 178.004523) (xy 194.536237 177.856818) (xy 194.555278 177.7) - (xy 194.536237 177.543182) (xy 194.48022 177.395477) (xy 194.390483 177.26547) (xy 194.27224 177.160717) - (xy 194.272238 177.160716) (xy 194.272237 177.160715) (xy 194.132365 177.087303) (xy 193.978986 177.0495) - (xy 193.978985 177.0495) (xy 193.821015 177.0495) (xy 193.821014 177.0495) (xy 193.667634 177.087303) - (xy 193.527762 177.160715) (xy 193.409516 177.265471) (xy 193.319781 177.395475) (xy 193.31978 177.395476) - (xy 193.263762 177.543181) (xy 193.244722 177.699999) (xy 193.244722 177.7) (xy 193.251746 177.757851) - (xy 193.240285 177.826774) (xy 193.193381 177.87856) (xy 193.125925 177.896767) (xy 193.071025 177.882594) - (xy 193.032364 177.862303) (xy 192.878986 177.8245) (xy 192.878985 177.8245) (xy 192.721015 177.8245) - (xy 192.721014 177.8245) (xy 192.567634 177.862303) (xy 192.427762 177.935715) (xy 192.309516 178.040471) - (xy 192.219781 178.170475) (xy 192.21978 178.170476) (xy 192.163762 178.318181) (xy 192.144722 178.474999) - (xy 188.446172 178.474999) (xy 188.455278 178.4) (xy 188.441854 178.289445) (xy 188.453314 178.220523) - (xy 188.500218 178.168737) (xy 188.56495 178.1505) (xy 188.578985 178.1505) (xy 188.732365 178.112696) - (xy 188.87224 178.039283) (xy 188.990483 177.93453) (xy 189.08022 177.804523) (xy 189.136237 177.656818) - (xy 189.155278 177.5) (xy 189.142587 177.395475) (xy 189.136237 177.343181) (xy 189.106765 177.26547) - (xy 189.08022 177.195477) (xy 188.990483 177.06547) (xy 188.87224 176.960717) (xy 188.872238 176.960716) - (xy 188.872237 176.960715) (xy 188.732365 176.887303) (xy 188.578986 176.8495) (xy 188.578985 176.8495) - (xy 188.421015 176.8495) (xy 188.421014 176.8495) (xy 188.267634 176.887303) (xy 188.127762 176.960715) - (xy 188.009516 177.065471) (xy 187.919781 177.195475) (xy 187.91978 177.195476) (xy 187.863762 177.343181) - (xy 187.857413 177.395476) (xy 187.844722 177.5) (xy 187.858145 177.610554) (xy 187.846686 177.679477) - (xy 187.799782 177.731263) (xy 187.73505 177.7495) (xy 187.721014 177.7495) (xy 187.567634 177.787303) - (xy 187.427762 177.860715) (xy 187.309516 177.965471) (xy 187.219781 178.095475) (xy 187.21978 178.095476) - (xy 187.163762 178.243181) (xy 187.144722 178.399999) (xy 112.3005 178.399999) (xy 112.3005 177.499999) - (xy 174.744718 177.499999) (xy 174.744718 177.5) (xy 174.763758 177.656818) (xy 174.813245 177.787303) - (xy 174.819776 177.804523) (xy 174.909513 177.93453) (xy 175.027756 178.039283) (xy 175.027758 178.039284) - (xy 175.16763 178.112696) (xy 175.32101 178.1505) (xy 175.321011 178.1505) (xy 175.478981 178.1505) - (xy 175.632361 178.112696) (xy 175.772236 178.039283) (xy 175.890479 177.93453) (xy 175.897948 177.923708) - (xy 175.95223 177.879719) (xy 176.021679 177.872059) (xy 176.084244 177.903162) (xy 176.102048 177.923709) - (xy 176.109515 177.934528) (xy 176.109517 177.93453) (xy 176.22776 178.039283) (xy 176.227762 178.039284) - (xy 176.367634 178.112696) (xy 176.521014 178.1505) (xy 176.521015 178.1505) (xy 176.678985 178.1505) - (xy 176.832365 178.112696) (xy 176.97224 178.039283) (xy 177.090483 177.93453) (xy 177.18022 177.804523) - (xy 177.236237 177.656818) (xy 177.255278 177.5) (xy 177.242587 177.395475) (xy 177.236237 177.343181) - (xy 177.206765 177.26547) (xy 177.18022 177.195477) (xy 177.090483 177.06547) (xy 176.97224 176.960717) - (xy 176.972238 176.960716) (xy 176.972237 176.960715) (xy 176.832365 176.887303) (xy 176.678986 176.8495) - (xy 176.678985 176.8495) (xy 176.521015 176.8495) (xy 176.521014 176.8495) (xy 176.367634 176.887303) - (xy 176.227762 176.960715) (xy 176.109514 177.065472) (xy 176.102046 177.076292) (xy 176.047763 177.120281) - (xy 175.978314 177.127939) (xy 175.91575 177.096835) (xy 175.89795 177.076292) (xy 175.890481 177.065472) - (xy 175.872452 177.0495) (xy 175.772236 176.960717) (xy 175.772234 176.960716) (xy 175.772233 176.960715) - (xy 175.632361 176.887303) (xy 175.478982 176.8495) (xy 175.478981 176.8495) (xy 175.321011 176.8495) - (xy 175.32101 176.8495) (xy 175.16763 176.887303) (xy 175.027758 176.960715) (xy 174.909512 177.065471) - (xy 174.819777 177.195475) (xy 174.819776 177.195476) (xy 174.763758 177.343181) (xy 174.744718 177.499999) - (xy 112.3005 177.499999) (xy 112.3005 175.605057) (xy 118.701302 175.605057) (xy 118.720618 175.801186) - (xy 118.777831 175.98979) (xy 118.870729 176.163589) (xy 118.870733 176.163596) (xy 118.995759 176.31594) - (xy 119.148103 176.440966) (xy 119.14811 176.44097) (xy 119.321909 176.533868) (xy 119.321912 176.533868) - (xy 119.321916 176.533871) (xy 119.510511 176.591081) (xy 119.706643 176.610398) (xy 119.902775 176.591081) - (xy 120.09137 176.533871) (xy 120.265181 176.440967) (xy 120.417526 176.31594) (xy 120.542553 176.163595) - (xy 120.635457 175.989784) (xy 120.692667 175.801189) (xy 120.711984 175.605057) (xy 120.692667 175.408925) - (xy 120.635457 175.22033) (xy 120.635454 175.220326) (xy 120.635454 175.220323) (xy 120.542556 175.046524) - (xy 120.542552 175.046517) (xy 120.417526 174.894173) (xy 120.339792 174.830378) (xy 121.206143 174.830378) - (xy 121.206143 176.379735) (xy 121.220675 176.452792) (xy 121.220676 176.452796) (xy 121.220677 176.452797) - (xy 121.276042 176.535658) (xy 121.358903 176.591023) (xy 121.358907 176.591024) (xy 121.431964 176.605556) - (xy 121.431967 176.605557) (xy 121.431969 176.605557) (xy 122.981319 176.605557) (xy 122.98132 176.605556) - (xy 123.054383 176.591023) (xy 123.137244 176.535658) (xy 123.192609 176.452797) (xy 123.207143 176.379731) - (xy 123.207143 174.830383) (xy 123.207143 174.83038) (xy 123.207142 174.830378) (xy 123.19261 174.757321) - (xy 123.192609 174.757317) (xy 123.137244 174.674456) (xy 123.054383 174.619091) (xy 123.054382 174.61909) - (xy 123.054378 174.619089) (xy 122.98132 174.604557) (xy 122.981317 174.604557) (xy 122.669075 174.604557) - (xy 122.602036 174.584872) (xy 122.556281 174.532068) (xy 122.546337 174.46291) (xy 122.575362 174.399354) - (xy 122.586848 174.387741) (xy 122.590473 174.38453) (xy 122.68021 174.254523) (xy 122.736227 174.106818) - (xy 122.755268 173.95) (xy 122.736227 173.793182) (xy 122.68021 173.645477) (xy 122.590473 173.51547) - (xy 122.47223 173.410717) (xy 122.472228 173.410716) (xy 122.472227 173.410715) (xy 122.332355 173.337303) - (xy 122.178976 173.2995) (xy 122.178975 173.2995) (xy 122.021005 173.2995) (xy 122.021004 173.2995) - (xy 121.867624 173.337303) (xy 121.727752 173.410715) (xy 121.609506 173.515471) (xy 121.519771 173.645475) - (xy 121.51977 173.645476) (xy 121.463752 173.793181) (xy 121.444712 173.949999) (xy 121.444712 173.95) - (xy 121.463752 174.106818) (xy 121.51977 174.254523) (xy 121.519771 174.254524) (xy 121.609506 174.384529) - (xy 121.613132 174.387741) (xy 121.650259 174.446931) (xy 121.649491 174.516796) (xy 121.611074 174.575156) - (xy 121.547203 174.603481) (xy 121.530905 174.604557) (xy 121.431966 174.604557) (xy 121.358907 174.619089) - (xy 121.358903 174.61909) (xy 121.276042 174.674456) (xy 121.220676 174.757317) (xy 121.220675 174.757321) - (xy 121.206143 174.830378) (xy 120.339792 174.830378) (xy 120.265182 174.769147) (xy 120.265175 174.769143) - (xy 120.091376 174.676245) (xy 120.09137 174.676243) (xy 119.902775 174.619033) (xy 119.902772 174.619032) - (xy 119.706643 174.599716) (xy 119.510513 174.619032) (xy 119.321909 174.676245) (xy 119.14811 174.769143) - (xy 119.148103 174.769147) (xy 118.995759 174.894173) (xy 118.870733 175.046517) (xy 118.870729 175.046524) - (xy 118.777831 175.220323) (xy 118.720618 175.408927) (xy 118.701302 175.605057) (xy 112.3005 175.605057) - (xy 112.3005 172.399999) (xy 119.944722 172.399999) (xy 119.944722 172.4) (xy 119.963762 172.556818) - (xy 120.01978 172.704523) (xy 120.109517 172.83453) (xy 120.22776 172.939283) (xy 120.227762 172.939284) - (xy 120.367634 173.012696) (xy 120.521014 173.0505) (xy 120.521015 173.0505) (xy 120.678985 173.0505) - (xy 120.832365 173.012696) (xy 120.97224 172.939283) (xy 121.090483 172.83453) (xy 121.18022 172.704523) - (xy 121.236237 172.556818) (xy 121.255278 172.4) (xy 121.236237 172.243182) (xy 121.18022 172.095477) - (xy 121.090483 171.96547) (xy 120.97224 171.860717) (xy 120.972238 171.860716) (xy 120.972237 171.860715) - (xy 120.832365 171.787303) (xy 120.678986 171.7495) (xy 120.678985 171.7495) (xy 120.521015 171.7495) - (xy 120.521014 171.7495) (xy 120.367634 171.787303) (xy 120.227762 171.860715) (xy 120.109516 171.965471) - (xy 120.019781 172.095475) (xy 120.01978 172.095476) (xy 119.963762 172.243181) (xy 119.944722 172.399999) - (xy 112.3005 172.399999) (xy 112.3005 170.965055) (xy 121.371364 170.965055) (xy 121.371364 170.965056) - (xy 121.390404 171.121874) (xy 121.446422 171.269579) (xy 121.536159 171.399586) (xy 121.654402 171.504339) - (xy 121.654404 171.50434) (xy 121.794276 171.577752) (xy 121.947656 171.615556) (xy 121.947657 171.615556) - (xy 122.105627 171.615556) (xy 122.259007 171.577752) (xy 122.398882 171.504339) (xy 122.517125 171.399586) - (xy 122.606862 171.269579) (xy 122.662879 171.121874) (xy 122.68192 170.965056) (xy 122.662879 170.808238) - (xy 122.606862 170.660533) (xy 122.517125 170.530526) (xy 122.398882 170.425773) (xy 122.39888 170.425772) - (xy 122.398879 170.425771) (xy 122.259007 170.352359) (xy 122.105628 170.314556) (xy 122.105627 170.314556) - (xy 121.947657 170.314556) (xy 121.947656 170.314556) (xy 121.794276 170.352359) (xy 121.654404 170.425771) - (xy 121.536158 170.530527) (xy 121.446423 170.660531) (xy 121.446422 170.660532) (xy 121.390404 170.808237) - (xy 121.371364 170.965055) (xy 112.3005 170.965055) (xy 112.3005 169.999999) (xy 189.144722 169.999999) - (xy 189.144722 170) (xy 189.163762 170.156818) (xy 189.21978 170.304523) (xy 189.309517 170.43453) - (xy 189.42776 170.539283) (xy 189.427762 170.539284) (xy 189.567634 170.612696) (xy 189.721014 170.6505) - (xy 189.721015 170.6505) (xy 189.878985 170.6505) (xy 190.032365 170.612696) (xy 190.17224 170.539283) - (xy 190.290483 170.43453) (xy 190.38022 170.304523) (xy 190.436237 170.156818) (xy 190.455278 170) - (xy 190.455278 169.999999) (xy 190.456182 169.992555) (xy 190.459224 169.992924) (xy 190.474963 169.939324) - (xy 190.527767 169.893569) (xy 190.596925 169.883625) (xy 190.636902 169.896566) (xy 190.667635 169.912696) - (xy 190.744325 169.931598) (xy 190.821014 169.9505) (xy 190.821015 169.9505) (xy 190.978985 169.9505) - (xy 191.132365 169.912696) (xy 191.187754 169.883625) (xy 191.27224 169.839283) (xy 191.390483 169.73453) - (xy 191.48022 169.604523) (xy 191.536237 169.456818) (xy 191.555278 169.3) (xy 191.540589 169.179025) - (xy 191.552049 169.110103) (xy 191.598953 169.058317) (xy 191.666409 169.04011) (xy 191.693359 169.043683) - (xy 191.721013 169.050499) (xy 191.721014 169.0505) (xy 191.721015 169.0505) (xy 191.878985 169.0505) - (xy 192.032365 169.012696) (xy 192.043564 169.006818) (xy 192.17224 168.939283) (xy 192.290483 168.83453) - (xy 192.38022 168.704523) (xy 192.436237 168.556818) (xy 192.455278 168.4) (xy 192.436237 168.243182) - (xy 192.436236 168.243179) (xy 192.436236 168.243178) (xy 192.426866 168.21847) (xy 192.425443 168.199999) - (xy 194.944722 168.199999) (xy 194.944722 168.2) (xy 194.963762 168.356818) (xy 195.019266 168.503169) - (xy 195.01978 168.504523) (xy 195.109517 168.63453) (xy 195.22776 168.739283) (xy 195.227762 168.739284) - (xy 195.367634 168.812696) (xy 195.521014 168.8505) (xy 195.521015 168.8505) (xy 195.678985 168.8505) - (xy 195.832365 168.812696) (xy 195.972238 168.739284) (xy 195.972237 168.739284) (xy 195.97224 168.739283) - (xy 196.037129 168.681797) (xy 196.100362 168.652075) (xy 196.169626 168.661259) (xy 196.201579 168.681793) - (xy 196.227236 168.704523) (xy 196.277762 168.749285) (xy 196.417634 168.822696) (xy 196.571014 168.8605) - (xy 196.571015 168.8605) (xy 196.728985 168.8605) (xy 196.882365 168.822696) (xy 196.925793 168.799903) - (xy 197.02224 168.749283) (xy 197.122774 168.660218) (xy 197.186006 168.630498) (xy 197.25527 168.639682) - (xy 197.287224 168.660217) (xy 197.38776 168.749283) (xy 197.387762 168.749284) (xy 197.527634 168.822696) - (xy 197.681014 168.8605) (xy 197.681015 168.8605) (xy 197.838985 168.8605) (xy 197.992365 168.822696) - (xy 198.035793 168.799903) (xy 198.13224 168.749283) (xy 198.250483 168.64453) (xy 198.34022 168.514523) - (xy 198.396237 168.366818) (xy 198.415278 168.21) (xy 198.415278 168.209999) (xy 198.669722 168.209999) - (xy 198.669722 168.21) (xy 198.688762 168.366818) (xy 198.740988 168.504524) (xy 198.74478 168.514523) - (xy 198.834517 168.64453) (xy 198.95276 168.749283) (xy 198.952762 168.749284) (xy 199.092634 168.822696) - (xy 199.246014 168.8605) (xy 199.246015 168.8605) (xy 199.403985 168.8605) (xy 199.44659 168.849999) - (xy 200.844722 168.849999) (xy 200.844722 168.85) (xy 200.863762 169.006818) (xy 200.915479 169.143182) - (xy 200.91978 169.154523) (xy 201.009517 169.28453) (xy 201.12776 169.389283) (xy 201.127762 169.389284) - (xy 201.267634 169.462696) (xy 201.421014 169.5005) (xy 201.421015 169.5005) (xy 201.578985 169.5005) - (xy 201.732365 169.462696) (xy 201.744601 169.456274) (xy 201.87224 169.389283) (xy 201.990483 169.28453) - (xy 202.08022 169.154523) (xy 202.136237 169.006818) (xy 202.155278 168.85) (xy 202.136237 168.693182) - (xy 202.134007 168.687303) (xy 202.082337 168.55106) (xy 202.08022 168.545477) (xy 201.990483 168.41547) - (xy 201.87224 168.310717) (xy 201.872238 168.310716) (xy 201.872237 168.310715) (xy 201.732365 168.237303) - (xy 201.578986 168.1995) (xy 201.578985 168.1995) (xy 201.421015 168.1995) (xy 201.421014 168.1995) - (xy 201.267634 168.237303) (xy 201.127762 168.310715) (xy 201.12776 168.310717) (xy 201.026982 168.399998) - (xy 201.009516 168.415471) (xy 200.919781 168.545475) (xy 200.91978 168.545476) (xy 200.863762 168.693181) - (xy 200.844722 168.849999) (xy 199.44659 168.849999) (xy 199.557365 168.822696) (xy 199.600793 168.799903) - (xy 199.69724 168.749283) (xy 199.815483 168.64453) (xy 199.90522 168.514523) (xy 199.961237 168.366818) - (xy 199.980278 168.21) (xy 199.97935 168.202353) (xy 199.961237 168.053181) (xy 199.923821 167.954524) - (xy 199.90522 167.905477) (xy 199.815483 167.77547) (xy 199.69724 167.670717) (xy 199.697238 167.670716) - (xy 199.697237 167.670715) (xy 199.557365 167.597303) (xy 199.403986 167.5595) (xy 199.403985 167.5595) - (xy 199.246015 167.5595) (xy 199.246014 167.5595) (xy 199.092634 167.597303) (xy 198.952762 167.670715) - (xy 198.834516 167.775471) (xy 198.744781 167.905475) (xy 198.74478 167.905476) (xy 198.688762 168.053181) - (xy 198.669722 168.209999) (xy 198.415278 168.209999) (xy 198.41435 168.202353) (xy 198.396237 168.053181) - (xy 198.358821 167.954524) (xy 198.34022 167.905477) (xy 198.250483 167.77547) (xy 198.13224 167.670717) - (xy 198.132238 167.670716) (xy 198.132237 167.670715) (xy 197.992365 167.597303) (xy 197.838986 167.5595) - (xy 197.838985 167.5595) (xy 197.681015 167.5595) (xy 197.681014 167.5595) (xy 197.527634 167.597303) - (xy 197.387761 167.670715) (xy 197.387759 167.670717) (xy 197.287226 167.75978) (xy 197.223993 167.789501) - (xy 197.154729 167.780317) (xy 197.122774 167.75978) (xy 197.02224 167.670717) (xy 197.022238 167.670715) - (xy 196.882365 167.597303) (xy 196.728986 167.5595) (xy 196.728985 167.5595) (xy 196.571015 167.5595) - (xy 196.571014 167.5595) (xy 196.417634 167.597303) (xy 196.277762 167.670714) (xy 196.212869 167.728204) - (xy 196.149635 167.757924) (xy 196.080372 167.74874) (xy 196.048418 167.728204) (xy 195.983526 167.670715) - (xy 195.972237 167.660714) (xy 195.832365 167.587303) (xy 195.678986 167.5495) (xy 195.678985 167.5495) - (xy 195.521015 167.5495) (xy 195.521014 167.5495) (xy 195.367634 167.587303) (xy 195.227762 167.660715) - (xy 195.173059 167.709177) (xy 195.128402 167.74874) (xy 195.109516 167.765471) (xy 195.019781 167.895475) - (xy 195.01978 167.895476) (xy 194.963762 168.043181) (xy 194.944722 168.199999) (xy 192.425443 168.199999) - (xy 192.421499 168.148807) (xy 192.454647 168.087301) (xy 192.515786 168.05348) (xy 192.542808 168.0505) - (xy 192.578985 168.0505) (xy 192.732365 168.012696) (xy 192.87224 167.939283) (xy 192.990483 167.83453) - (xy 193.08022 167.704523) (xy 193.136237 167.556818) (xy 193.155278 167.4) (xy 193.148694 167.345771) - (xy 193.136237 167.243181) (xy 193.101087 167.1505) (xy 193.08022 167.095477) (xy 192.990483 166.96547) - (xy 192.87224 166.860717) (xy 192.872238 166.860716) (xy 192.872237 166.860715) (xy 192.732365 166.787303) - (xy 192.578986 166.7495) (xy 192.578985 166.7495) (xy 192.421015 166.7495) (xy 192.421014 166.7495) - (xy 192.401825 166.754229) (xy 192.332023 166.751157) (xy 192.274962 166.710836) (xy 192.249058 166.648777) - (xy 192.236237 166.543182) (xy 192.18022 166.395477) (xy 192.090483 166.26547) (xy 191.97224 166.160717) - (xy 191.972238 166.160716) (xy 191.972237 166.160715) (xy 191.832365 166.087303) (xy 191.678986 166.0495) - (xy 191.678985 166.0495) (xy 191.521015 166.0495) (xy 191.521014 166.0495) (xy 191.367634 166.087303) - (xy 191.227762 166.160715) (xy 191.22776 166.160717) (xy 191.110898 166.264247) (xy 191.109516 166.265471) - (xy 191.019781 166.395475) (xy 191.01978 166.395476) (xy 190.963762 166.543181) (xy 190.944722 166.699999) - (xy 190.944722 166.7) (xy 190.963763 166.856819) (xy 190.963764 166.856826) (xy 190.963886 166.857146) - (xy 190.963905 166.857396) (xy 190.965558 166.864102) (xy 190.964442 166.864376) (xy 190.969248 166.92681) - (xy 190.936096 166.988313) (xy 190.874955 167.02213) (xy 190.818267 167.021505) (xy 190.728986 166.9995) - (xy 190.728985 166.9995) (xy 190.571015 166.9995) (xy 190.571014 166.9995) (xy 190.417634 167.037303) - (xy 190.277762 167.110715) (xy 190.159516 167.215471) (xy 190.069781 167.345475) (xy 190.06978 167.345476) - (xy 190.013762 167.493181) (xy 189.994722 167.649999) (xy 189.994722 167.65) (xy 190.013762 167.806818) - (xy 190.051179 167.905476) (xy 190.06978 167.954523) (xy 190.159517 168.08453) (xy 190.27776 168.189283) - (xy 190.277762 168.189284) (xy 190.417634 168.262696) (xy 190.571014 168.3005) (xy 190.571015 168.3005) - (xy 190.728985 168.3005) (xy 190.882365 168.262696) (xy 190.971185 168.216078) (xy 191.039692 168.202353) - (xy 191.104746 168.227845) (xy 191.145691 168.28446) (xy 191.151907 168.34082) (xy 191.144722 168.399998) + (xy 190.328985 192.4005) (xy 190.482365 192.362696) (xy 190.505602 192.3505) (xy 190.62224 192.289283) + (xy 190.740483 192.18453) (xy 190.83022 192.054523) (xy 190.886237 191.906818) (xy 190.905278 191.75) + (xy 190.886237 191.593182) (xy 190.83022 191.445477) (xy 190.740483 191.31547) (xy 190.62224 191.210717) + (xy 190.622238 191.210716) (xy 190.622237 191.210715) (xy 190.482365 191.137303) (xy 190.328986 191.0995) + (xy 190.328985 191.0995) (xy 190.171015 191.0995) (xy 190.171014 191.0995) (xy 190.017634 191.137303) + (xy 189.877762 191.210715) (xy 189.759516 191.315471) (xy 189.669781 191.445475) (xy 189.66978 191.445476) + (xy 189.613762 191.593181) (xy 189.594722 191.749999) (xy 156.454207 191.749999) (xy 156.460278 191.7) + (xy 156.441237 191.543182) (xy 156.38522 191.395477) (xy 156.295483 191.26547) (xy 156.17724 191.160717) + (xy 156.177238 191.160716) (xy 156.177237 191.160715) (xy 156.037365 191.087303) (xy 155.883986 191.0495) + (xy 155.883985 191.0495) (xy 155.726015 191.0495) (xy 155.726014 191.0495) (xy 155.572634 191.087303) + (xy 155.432762 191.160715) (xy 155.314516 191.265471) (xy 155.224781 191.395475) (xy 155.22478 191.395476) + (xy 155.168762 191.543181) (xy 155.149722 191.699999) (xy 139 191.699999) (xy 139 188.955321) (xy 150.8295 188.955321) + (xy 150.8295 190.504678) (xy 150.844032 190.577735) (xy 150.844033 190.577739) (xy 150.844034 190.57774) + (xy 150.899399 190.660601) (xy 150.98226 190.715966) (xy 150.982264 190.715967) (xy 151.055321 190.730499) + (xy 151.055324 190.7305) (xy 151.055326 190.7305) (xy 152.604676 190.7305) (xy 152.604677 190.730499) + (xy 152.67774 190.715966) (xy 152.760601 190.660601) (xy 152.815966 190.57774) (xy 152.8305 190.504674) + (xy 152.8305 189.73) (xy 153.324659 189.73) (xy 153.343975 189.926129) (xy 153.343976 189.926132) + (xy 153.398845 190.107011) (xy 153.401188 190.114733) (xy 153.494086 190.288532) (xy 153.49409 190.288539) + (xy 153.619116 190.440883) (xy 153.77146 190.565909) (xy 153.771467 190.565913) (xy 153.945266 190.658811) + (xy 153.945269 190.658811) (xy 153.945273 190.658814) (xy 154.133868 190.716024) (xy 154.33 190.735341) + (xy 154.526132 190.716024) (xy 154.714727 190.658814) (xy 154.888538 190.56591) (xy 155.040883 190.440883) + (xy 155.16591 190.288538) (xy 155.258814 190.114727) (xy 155.316024 189.926132) (xy 155.335341 189.73) + (xy 155.316024 189.533868) (xy 155.258814 189.345273) (xy 155.258811 189.345269) (xy 155.258811 189.345266) + (xy 155.165913 189.171467) (xy 155.165909 189.17146) (xy 155.040883 189.019116) (xy 154.888539 188.89409) + (xy 154.888532 188.894086) (xy 154.714733 188.801188) (xy 154.714727 188.801186) (xy 154.526132 188.743976) + (xy 154.526129 188.743975) (xy 154.33 188.724659) (xy 154.13387 188.743975) (xy 153.945266 188.801188) + (xy 153.771467 188.894086) (xy 153.77146 188.89409) (xy 153.619116 189.019116) (xy 153.49409 189.17146) + (xy 153.494086 189.171467) (xy 153.401188 189.345266) (xy 153.343975 189.53387) (xy 153.324659 189.73) + (xy 152.8305 189.73) (xy 152.8305 188.955326) (xy 152.8305 188.955323) (xy 152.830499 188.955321) + (xy 152.815967 188.882264) (xy 152.815966 188.88226) (xy 152.774155 188.819685) (xy 152.760601 188.799399) + (xy 152.67774 188.744034) (xy 152.677739 188.744033) (xy 152.677735 188.744032) (xy 152.604677 188.7295) + (xy 152.604674 188.7295) (xy 151.055326 188.7295) (xy 151.055323 188.7295) (xy 150.982264 188.744032) + (xy 150.98226 188.744033) (xy 150.899399 188.799399) (xy 150.844033 188.88226) (xy 150.844032 188.882264) + (xy 150.8295 188.955321) (xy 139 188.955321) (xy 139 187.699999) (xy 165.744722 187.699999) (xy 165.744722 187.7) + (xy 165.763762 187.856818) (xy 165.778424 187.895477) (xy 165.81978 188.004523) (xy 165.909517 188.13453) + (xy 166.02776 188.239283) (xy 166.027762 188.239284) (xy 166.167634 188.312696) (xy 166.321014 188.3505) + (xy 166.321015 188.3505) (xy 166.478985 188.3505) (xy 166.630567 188.313139) (xy 166.700367 188.316208) + (xy 166.757429 188.356528) (xy 166.776182 188.389565) (xy 166.792391 188.432304) (xy 166.81978 188.504523) + (xy 166.909517 188.63453) (xy 167.02776 188.739283) (xy 167.027762 188.739284) (xy 167.167634 188.812696) + (xy 167.321014 188.8505) (xy 167.321015 188.8505) (xy 167.478985 188.8505) (xy 167.632365 188.812696) + (xy 167.6577 188.799399) (xy 167.77224 188.739283) (xy 167.890483 188.63453) (xy 167.98022 188.504523) + (xy 168.036237 188.356818) (xy 168.055278 188.2) (xy 168.036237 188.043182) (xy 167.98022 187.895477) + (xy 167.890483 187.76547) (xy 167.77224 187.660717) (xy 167.772238 187.660716) (xy 167.772237 187.660715) + (xy 167.632365 187.587303) (xy 167.478986 187.5495) (xy 167.478985 187.5495) (xy 167.321015 187.5495) + (xy 167.321014 187.5495) (xy 167.169433 187.58686) (xy 167.099631 187.58379) (xy 167.042569 187.54347) + (xy 167.023817 187.510434) (xy 166.98022 187.395477) (xy 166.890483 187.26547) (xy 166.77224 187.160717) + (xy 166.772238 187.160716) (xy 166.772237 187.160715) (xy 166.632365 187.087303) (xy 166.478986 187.0495) + (xy 166.478985 187.0495) (xy 166.321015 187.0495) (xy 166.321014 187.0495) (xy 166.167634 187.087303) + (xy 166.027762 187.160715) (xy 165.909516 187.265471) (xy 165.819781 187.395475) (xy 165.81978 187.395476) + (xy 165.763762 187.543181) (xy 165.744722 187.699999) (xy 139 187.699999) (xy 139 186.6) (xy 126.8 186.6) + (xy 126.5 186.6) (xy 126.5 201.3) (xy 112.3005 201.3) (xy 112.3005 186.269999) (xy 145.344722 186.269999) + (xy 145.344722 186.27) (xy 145.363762 186.426818) (xy 145.41978 186.574523) (xy 145.509517 186.70453) + (xy 145.62776 186.809283) (xy 145.627762 186.809284) (xy 145.767634 186.882696) (xy 145.921014 186.9205) + (xy 145.921015 186.9205) (xy 146.078985 186.9205) (xy 146.232365 186.882696) (xy 146.37224 186.809283) + (xy 146.490483 186.70453) (xy 146.58022 186.574523) (xy 146.636237 186.426818) (xy 146.653804 186.282142) + (xy 149.344722 186.282142) (xy 149.344722 186.282143) (xy 149.363762 186.438961) (xy 149.415175 186.574523) + (xy 149.41978 186.586666) (xy 149.509517 186.716673) (xy 149.62776 186.821426) (xy 149.627762 186.821427) + (xy 149.767634 186.894839) (xy 149.921014 186.932643) (xy 149.921015 186.932643) (xy 150.078985 186.932643) + (xy 150.232365 186.894839) (xy 150.255501 186.882696) (xy 150.37224 186.821426) (xy 150.490483 186.716673) + (xy 150.58022 186.586666) (xy 150.636237 186.438961) (xy 150.655278 186.282143) (xy 150.653804 186.269999) + (xy 150.636237 186.125324) (xy 150.612485 186.062696) (xy 150.58022 185.97762) (xy 150.490483 185.847613) + (xy 150.37224 185.74286) (xy 150.372238 185.742859) (xy 150.372237 185.742858) (xy 150.232365 185.669446) + (xy 150.078986 185.631643) (xy 150.078985 185.631643) (xy 149.921015 185.631643) (xy 149.921014 185.631643) + (xy 149.767634 185.669446) (xy 149.627762 185.742858) (xy 149.509516 185.847614) (xy 149.419781 185.977618) + (xy 149.41978 185.977619) (xy 149.363762 186.125324) (xy 149.344722 186.282142) (xy 146.653804 186.282142) + (xy 146.655278 186.27) (xy 146.637712 186.125325) (xy 146.636237 186.113181) (xy 146.614992 186.057164) + (xy 146.58022 185.965477) (xy 146.490483 185.83547) (xy 146.37224 185.730717) (xy 146.372238 185.730716) + (xy 146.372237 185.730715) (xy 146.232365 185.657303) (xy 146.078986 185.6195) (xy 146.078985 185.6195) + (xy 145.921015 185.6195) (xy 145.921014 185.6195) (xy 145.767634 185.657303) (xy 145.627762 185.730715) + (xy 145.509516 185.835471) (xy 145.419781 185.965475) (xy 145.41978 185.965476) (xy 145.363762 186.113181) + (xy 145.344722 186.269999) (xy 112.3005 186.269999) (xy 112.3005 185.449999) (xy 156.144722 185.449999) + (xy 156.144722 185.45) (xy 156.163762 185.606818) (xy 156.215356 185.742858) (xy 156.21978 185.754523) + (xy 156.309517 185.88453) (xy 156.42776 185.989283) (xy 156.427762 185.989284) (xy 156.567634 186.062696) + (xy 156.721014 186.1005) (xy 156.721015 186.1005) (xy 156.878985 186.1005) (xy 157.032365 186.062696) + (xy 157.17224 185.989283) (xy 157.290483 185.88453) (xy 157.38022 185.754523) (xy 157.436237 185.606818) + (xy 157.455278 185.45) (xy 157.453401 185.434537) (xy 157.436237 185.293181) (xy 157.400093 185.197879) + (xy 157.38022 185.145477) (xy 157.290483 185.01547) (xy 157.17224 184.910717) (xy 157.172238 184.910716) + (xy 157.172237 184.910715) (xy 157.032365 184.837303) (xy 156.878986 184.7995) (xy 156.878985 184.7995) + (xy 156.721015 184.7995) (xy 156.721014 184.7995) (xy 156.567634 184.837303) (xy 156.427762 184.910715) + (xy 156.399415 184.935828) (xy 156.326973 185.000006) (xy 156.309516 185.015471) (xy 156.219781 185.145475) + (xy 156.21978 185.145476) (xy 156.163762 185.293181) (xy 156.144722 185.449999) (xy 112.3005 185.449999) + (xy 112.3005 183.864992) (xy 165.704529 183.864992) (xy 165.704529 183.865003) (xy 165.724379 184.104557) + (xy 165.783389 184.337587) (xy 165.879951 184.557727) (xy 166.011427 184.758964) (xy 166.011429 184.758967) + (xy 166.174236 184.935823) (xy 166.174239 184.935825) (xy 166.174242 184.935828) (xy 166.363924 185.083464) + (xy 166.36393 185.083468) (xy 166.363933 185.08347) (xy 166.575344 185.19788) (xy 166.575347 185.197881) + (xy 166.802699 185.275931) (xy 166.802701 185.275931) (xy 166.802703 185.275932) (xy 167.039808 185.315498) + (xy 167.039809 185.315498) (xy 167.280191 185.315498) (xy 167.280192 185.315498) (xy 167.517297 185.275932) + (xy 167.744656 185.19788) (xy 167.956067 185.08347) (xy 168.145764 184.935823) (xy 168.145768 184.935817) + (xy 168.147566 184.934419) (xy 168.21256 184.908776) (xy 168.2811 184.922342) (xy 168.331425 184.97081) + (xy 168.346825 185.017325) (xy 168.363763 185.156819) (xy 168.408937 185.275932) (xy 168.41978 185.304523) + (xy 168.509517 185.43453) (xy 168.62776 185.539283) (xy 168.627762 185.539284) (xy 168.767634 185.612696) + (xy 168.921014 185.6505) (xy 168.921015 185.6505) (xy 169.078985 185.6505) (xy 169.232365 185.612696) + (xy 169.243564 185.606818) (xy 169.37224 185.539283) (xy 169.490483 185.43453) (xy 169.58022 185.304523) + (xy 169.584053 185.294415) (xy 169.62623 185.238713) (xy 169.691828 185.214655) (xy 169.760018 185.229881) + (xy 169.809152 185.279557) (xy 169.815934 185.294407) (xy 169.819771 185.304524) (xy 169.819774 185.304532) + (xy 169.864641 185.369533) (xy 169.90951 185.434537) (xy 170.027753 185.53929) (xy 170.027755 185.539291) + (xy 170.167627 185.612703) (xy 170.321007 185.650507) (xy 170.321008 185.650507) (xy 170.478978 185.650507) + (xy 170.632358 185.612703) (xy 170.643571 185.606818) (xy 170.772233 185.53929) (xy 170.890476 185.434537) + (xy 170.980213 185.30453) (xy 171.03623 185.156825) (xy 171.055271 185.000007) (xy 171.03623 184.843189) + (xy 171.036227 184.843182) (xy 171.004288 184.758964) (xy 170.980213 184.695484) (xy 170.890476 184.565477) + (xy 170.772233 184.460724) (xy 170.772231 184.460723) (xy 170.77223 184.460722) (xy 170.632358 184.38731) + (xy 170.478979 184.349507) (xy 170.478978 184.349507) (xy 170.321008 184.349507) (xy 170.321007 184.349507) + (xy 170.167627 184.38731) (xy 170.027755 184.460722) (xy 169.909509 184.565478) (xy 169.819774 184.695482) + (xy 169.81977 184.695488) (xy 169.815936 184.705598) (xy 169.773755 184.761298) (xy 169.708156 184.785351) + (xy 169.639966 184.77012) (xy 169.590836 184.720441) (xy 169.584058 184.705598) (xy 169.58022 184.695477) + (xy 169.490483 184.56547) (xy 169.37224 184.460717) (xy 169.372238 184.460716) (xy 169.372237 184.460715) + (xy 169.232365 184.387303) (xy 169.078986 184.3495) (xy 169.078985 184.3495) (xy 168.921015 184.3495) + (xy 168.921014 184.3495) (xy 168.767634 184.387303) (xy 168.767633 184.387304) (xy 168.732723 184.405626) + (xy 168.664215 184.41935) (xy 168.599162 184.393857) (xy 168.558219 184.337241) (xy 168.554384 184.267477) + (xy 168.554893 184.265389) (xy 168.59562 184.104561) (xy 168.615471 183.864998) (xy 168.615471 183.864992) + (xy 179.174529 183.864992) (xy 179.174529 183.865003) (xy 179.194379 184.104557) (xy 179.253389 184.337587) + (xy 179.349951 184.557727) (xy 179.481427 184.758964) (xy 179.481429 184.758967) (xy 179.644236 184.935823) + (xy 179.644239 184.935825) (xy 179.644242 184.935828) (xy 179.833924 185.083464) (xy 179.83393 185.083468) + (xy 179.833933 185.08347) (xy 180.045344 185.19788) (xy 180.045347 185.197881) (xy 180.272699 185.275931) + (xy 180.272701 185.275931) (xy 180.272703 185.275932) (xy 180.509808 185.315498) (xy 180.509809 185.315498) + (xy 180.750191 185.315498) (xy 180.750192 185.315498) (xy 180.987297 185.275932) (xy 181.214656 185.19788) + (xy 181.426067 185.08347) (xy 181.615764 184.935823) (xy 181.778571 184.758967) (xy 181.910049 184.557726) + (xy 182.00661 184.337589) (xy 182.06562 184.104561) (xy 182.085471 183.864998) (xy 182.06562 183.625435) + (xy 182.00661 183.392407) (xy 181.910049 183.17227) (xy 181.85806 183.092696) (xy 181.778572 182.971031) + (xy 181.778571 182.971029) (xy 181.615764 182.794173) (xy 181.615759 182.794169) (xy 181.615757 182.794167) + (xy 181.426075 182.646531) (xy 181.426069 182.646527) (xy 181.214657 182.532116) (xy 181.214652 182.532114) + (xy 180.9873 182.454064) (xy 180.809468 182.424389) (xy 180.750192 182.414498) (xy 180.509808 182.414498) + (xy 180.462387 182.422411) (xy 180.272699 182.454064) (xy 180.045347 182.532114) (xy 180.045342 182.532116) + (xy 179.83393 182.646527) (xy 179.833924 182.646531) (xy 179.644242 182.794167) (xy 179.644239 182.79417) + (xy 179.48143 182.971027) (xy 179.481427 182.971031) (xy 179.349951 183.172268) (xy 179.253389 183.392408) + (xy 179.194379 183.625438) (xy 179.174529 183.864992) (xy 168.615471 183.864992) (xy 168.59562 183.625435) + (xy 168.53661 183.392407) (xy 168.440049 183.17227) (xy 168.38806 183.092696) (xy 168.308572 182.971031) + (xy 168.308571 182.971029) (xy 168.145764 182.794173) (xy 168.145759 182.794169) (xy 168.145757 182.794167) + (xy 167.956075 182.646531) (xy 167.956069 182.646527) (xy 167.744657 182.532116) (xy 167.744652 182.532114) + (xy 167.5173 182.454064) (xy 167.339468 182.424389) (xy 167.280192 182.414498) (xy 167.039808 182.414498) + (xy 166.992387 182.422411) (xy 166.802699 182.454064) (xy 166.575347 182.532114) (xy 166.575342 182.532116) + (xy 166.36393 182.646527) (xy 166.363924 182.646531) (xy 166.174242 182.794167) (xy 166.174239 182.79417) + (xy 166.01143 182.971027) (xy 166.011427 182.971031) (xy 165.879951 183.172268) (xy 165.783389 183.392408) + (xy 165.724379 183.625438) (xy 165.704529 183.864992) (xy 112.3005 183.864992) (xy 112.3005 180.464992) + (xy 165.704529 180.464992) (xy 165.704529 180.465003) (xy 165.724379 180.704557) (xy 165.783389 180.937587) + (xy 165.879951 181.157727) (xy 165.995462 181.334528) (xy 166.011429 181.358967) (xy 166.174236 181.535823) + (xy 166.174239 181.535825) (xy 166.174242 181.535828) (xy 166.363924 181.683464) (xy 166.36393 181.683468) + (xy 166.363933 181.68347) (xy 166.575344 181.79788) (xy 166.575347 181.797881) (xy 166.802699 181.875931) + (xy 166.802701 181.875931) (xy 166.802703 181.875932) (xy 167.039808 181.915498) (xy 167.039809 181.915498) + (xy 167.280191 181.915498) (xy 167.280192 181.915498) (xy 167.517297 181.875932) (xy 167.744656 181.79788) + (xy 167.956067 181.68347) (xy 168.145764 181.535823) (xy 168.308571 181.358967) (xy 168.440049 181.157726) + (xy 168.53661 180.937589) (xy 168.546129 180.899999) (xy 171.944722 180.899999) (xy 171.944722 180.9) + (xy 171.963762 181.056818) (xy 172.01978 181.204523) (xy 172.109517 181.33453) (xy 172.22776 181.439283) + (xy 172.227762 181.439284) (xy 172.367634 181.512696) (xy 172.521014 181.5505) (xy 172.521015 181.5505) + (xy 172.678985 181.5505) (xy 172.832365 181.512696) (xy 172.97224 181.439283) (xy 173.090483 181.33453) + (xy 173.18022 181.204523) (xy 173.236237 181.056818) (xy 173.255278 180.9) (xy 173.236237 180.743182) + (xy 173.18022 180.595477) (xy 173.090483 180.46547) (xy 172.97224 180.360717) (xy 172.972238 180.360716) + (xy 172.972237 180.360715) (xy 172.832365 180.287303) (xy 172.678986 180.2495) (xy 172.678985 180.2495) + (xy 172.521015 180.2495) (xy 172.521014 180.2495) (xy 172.367634 180.287303) (xy 172.227762 180.360715) + (xy 172.109516 180.465471) (xy 172.019781 180.595475) (xy 172.01978 180.595476) (xy 171.963762 180.743181) + (xy 171.944722 180.899999) (xy 168.546129 180.899999) (xy 168.59562 180.704561) (xy 168.604659 180.595475) + (xy 168.615471 180.465003) (xy 168.615471 180.464992) (xy 168.59562 180.225438) (xy 168.59562 180.225435) + (xy 168.563351 180.098007) (xy 173.44273 180.098007) (xy 173.44273 180.098008) (xy 173.46177 180.254826) + (xy 173.501929 180.360715) (xy 173.517788 180.402531) (xy 173.607525 180.532538) (xy 173.725768 180.637291) + (xy 173.72577 180.637292) (xy 173.865642 180.710704) (xy 174.019022 180.748508) (xy 174.019023 180.748508) + (xy 174.176993 180.748508) (xy 174.330373 180.710704) (xy 174.342085 180.704557) (xy 174.470248 180.637291) + (xy 174.588491 180.532538) (xy 174.678228 180.402531) (xy 174.734245 180.254826) (xy 174.753286 180.098008) + (xy 174.734245 179.94119) (xy 174.678228 179.793485) (xy 174.588491 179.663478) (xy 174.470248 179.558725) + (xy 174.470246 179.558724) (xy 174.470245 179.558723) (xy 174.330373 179.485311) (xy 174.176994 179.447508) + (xy 174.176993 179.447508) (xy 174.019023 179.447508) (xy 174.019022 179.447508) (xy 173.865642 179.485311) + (xy 173.72577 179.558723) (xy 173.607524 179.663479) (xy 173.517789 179.793483) (xy 173.517788 179.793484) + (xy 173.46177 179.941189) (xy 173.44273 180.098007) (xy 168.563351 180.098007) (xy 168.53661 179.992407) + (xy 168.440049 179.77227) (xy 168.308571 179.571029) (xy 168.145764 179.394173) (xy 168.145759 179.394169) + (xy 168.145757 179.394167) (xy 167.956075 179.246531) (xy 167.956069 179.246527) (xy 167.944598 179.240319) + (xy 179.1795 179.240319) (xy 179.1795 181.689676) (xy 179.194032 181.762733) (xy 179.194033 181.762737) + (xy 179.194034 181.762738) (xy 179.249399 181.845599) (xy 179.33226 181.900964) (xy 179.332264 181.900965) + (xy 179.405321 181.915497) (xy 179.405324 181.915498) (xy 179.405326 181.915498) (xy 181.854676 181.915498) + (xy 181.854677 181.915497) (xy 181.92774 181.900964) (xy 182.010601 181.845599) (xy 182.065966 181.762738) + (xy 182.0805 181.689672) (xy 182.0805 179.240324) (xy 182.0805 179.240321) (xy 182.080499 179.240319) + (xy 182.065967 179.167262) (xy 182.065966 179.167258) (xy 182.042484 179.132114) (xy 182.010601 179.084397) + (xy 181.92774 179.029032) (xy 181.927739 179.029031) (xy 181.927735 179.02903) (xy 181.854677 179.014498) + (xy 181.854674 179.014498) (xy 179.405326 179.014498) (xy 179.405323 179.014498) (xy 179.332264 179.02903) + (xy 179.33226 179.029031) (xy 179.249399 179.084397) (xy 179.194033 179.167258) (xy 179.194032 179.167262) + (xy 179.1795 179.240319) (xy 167.944598 179.240319) (xy 167.744657 179.132116) (xy 167.744652 179.132114) + (xy 167.5173 179.054064) (xy 167.339468 179.024389) (xy 167.280192 179.014498) (xy 167.039808 179.014498) + (xy 166.992387 179.022411) (xy 166.802699 179.054064) (xy 166.575347 179.132114) (xy 166.575342 179.132116) + (xy 166.36393 179.246527) (xy 166.363924 179.246531) (xy 166.174242 179.394167) (xy 166.174239 179.39417) + (xy 166.01143 179.571027) (xy 166.011427 179.571031) (xy 165.879951 179.772268) (xy 165.783389 179.992408) + (xy 165.724379 180.225438) (xy 165.704529 180.464992) (xy 112.3005 180.464992) (xy 112.3005 178.399999) + (xy 187.144722 178.399999) (xy 187.144722 178.4) (xy 187.163762 178.556818) (xy 187.21978 178.704523) + (xy 187.309517 178.83453) (xy 187.42776 178.939283) (xy 187.427762 178.939284) (xy 187.567634 179.012696) + (xy 187.721014 179.0505) (xy 187.721015 179.0505) (xy 187.878985 179.0505) (xy 188.032365 179.012696) + (xy 188.17224 178.939283) (xy 188.290483 178.83453) (xy 188.38022 178.704523) (xy 188.436237 178.556818) + (xy 188.446172 178.474999) (xy 192.144722 178.474999) (xy 192.144722 178.475) (xy 192.163762 178.631818) + (xy 192.21978 178.779523) (xy 192.309517 178.90953) (xy 192.42776 179.014283) (xy 192.427762 179.014284) + (xy 192.567634 179.087696) (xy 192.721014 179.1255) (xy 192.721015 179.1255) (xy 192.878985 179.1255) + (xy 193.032365 179.087696) (xy 193.038651 179.084397) (xy 193.17224 179.014283) (xy 193.290483 178.90953) + (xy 193.38022 178.779523) (xy 193.436237 178.631818) (xy 193.455278 178.475) (xy 193.448253 178.417146) + (xy 193.459713 178.348226) (xy 193.506616 178.29644) (xy 193.574072 178.278232) (xy 193.628975 178.292406) + (xy 193.667634 178.312696) (xy 193.821014 178.3505) (xy 193.821015 178.3505) (xy 193.978985 178.3505) + (xy 194.132365 178.312696) (xy 194.171024 178.292406) (xy 194.27224 178.239283) (xy 194.390483 178.13453) + (xy 194.48022 178.004523) (xy 194.536237 177.856818) (xy 194.555278 177.7) (xy 194.536237 177.543182) + (xy 194.48022 177.395477) (xy 194.390483 177.26547) (xy 194.27224 177.160717) (xy 194.272238 177.160716) + (xy 194.272237 177.160715) (xy 194.132365 177.087303) (xy 193.978986 177.0495) (xy 193.978985 177.0495) + (xy 193.821015 177.0495) (xy 193.821014 177.0495) (xy 193.667634 177.087303) (xy 193.527762 177.160715) + (xy 193.409516 177.265471) (xy 193.319781 177.395475) (xy 193.31978 177.395476) (xy 193.263762 177.543181) + (xy 193.244722 177.699999) (xy 193.244722 177.7) (xy 193.251746 177.757851) (xy 193.240285 177.826774) + (xy 193.193381 177.87856) (xy 193.125925 177.896767) (xy 193.071025 177.882594) (xy 193.032364 177.862303) + (xy 192.878986 177.8245) (xy 192.878985 177.8245) (xy 192.721015 177.8245) (xy 192.721014 177.8245) + (xy 192.567634 177.862303) (xy 192.427762 177.935715) (xy 192.309516 178.040471) (xy 192.219781 178.170475) + (xy 192.21978 178.170476) (xy 192.163762 178.318181) (xy 192.144722 178.474999) (xy 188.446172 178.474999) + (xy 188.455278 178.4) (xy 188.441854 178.289445) (xy 188.453314 178.220523) (xy 188.500218 178.168737) + (xy 188.56495 178.1505) (xy 188.578985 178.1505) (xy 188.732365 178.112696) (xy 188.87224 178.039283) + (xy 188.990483 177.93453) (xy 189.08022 177.804523) (xy 189.136237 177.656818) (xy 189.155278 177.5) + (xy 189.142587 177.395475) (xy 189.136237 177.343181) (xy 189.106765 177.26547) (xy 189.08022 177.195477) + (xy 188.990483 177.06547) (xy 188.87224 176.960717) (xy 188.872238 176.960716) (xy 188.872237 176.960715) + (xy 188.732365 176.887303) (xy 188.578986 176.8495) (xy 188.578985 176.8495) (xy 188.421015 176.8495) + (xy 188.421014 176.8495) (xy 188.267634 176.887303) (xy 188.127762 176.960715) (xy 188.009516 177.065471) + (xy 187.919781 177.195475) (xy 187.91978 177.195476) (xy 187.863762 177.343181) (xy 187.857413 177.395476) + (xy 187.844722 177.5) (xy 187.858145 177.610554) (xy 187.846686 177.679477) (xy 187.799782 177.731263) + (xy 187.73505 177.7495) (xy 187.721014 177.7495) (xy 187.567634 177.787303) (xy 187.427762 177.860715) + (xy 187.309516 177.965471) (xy 187.219781 178.095475) (xy 187.21978 178.095476) (xy 187.163762 178.243181) + (xy 187.144722 178.399999) (xy 112.3005 178.399999) (xy 112.3005 177.499999) (xy 174.744718 177.499999) + (xy 174.744718 177.5) (xy 174.763758 177.656818) (xy 174.813245 177.787303) (xy 174.819776 177.804523) + (xy 174.909513 177.93453) (xy 175.027756 178.039283) (xy 175.027758 178.039284) (xy 175.16763 178.112696) + (xy 175.32101 178.1505) (xy 175.321011 178.1505) (xy 175.478981 178.1505) (xy 175.632361 178.112696) + (xy 175.772236 178.039283) (xy 175.890479 177.93453) (xy 175.897948 177.923708) (xy 175.95223 177.879719) + (xy 176.021679 177.872059) (xy 176.084244 177.903162) (xy 176.102048 177.923709) (xy 176.109515 177.934528) + (xy 176.109517 177.93453) (xy 176.22776 178.039283) (xy 176.227762 178.039284) (xy 176.367634 178.112696) + (xy 176.521014 178.1505) (xy 176.521015 178.1505) (xy 176.678985 178.1505) (xy 176.832365 178.112696) + (xy 176.97224 178.039283) (xy 177.090483 177.93453) (xy 177.18022 177.804523) (xy 177.236237 177.656818) + (xy 177.255278 177.5) (xy 177.242587 177.395475) (xy 177.236237 177.343181) (xy 177.206765 177.26547) + (xy 177.18022 177.195477) (xy 177.090483 177.06547) (xy 176.97224 176.960717) (xy 176.972238 176.960716) + (xy 176.972237 176.960715) (xy 176.832365 176.887303) (xy 176.678986 176.8495) (xy 176.678985 176.8495) + (xy 176.521015 176.8495) (xy 176.521014 176.8495) (xy 176.367634 176.887303) (xy 176.227762 176.960715) + (xy 176.109514 177.065472) (xy 176.102046 177.076292) (xy 176.047763 177.120281) (xy 175.978314 177.127939) + (xy 175.91575 177.096835) (xy 175.89795 177.076292) (xy 175.890481 177.065472) (xy 175.872452 177.0495) + (xy 175.772236 176.960717) (xy 175.772234 176.960716) (xy 175.772233 176.960715) (xy 175.632361 176.887303) + (xy 175.478982 176.8495) (xy 175.478981 176.8495) (xy 175.321011 176.8495) (xy 175.32101 176.8495) + (xy 175.16763 176.887303) (xy 175.027758 176.960715) (xy 174.909512 177.065471) (xy 174.819777 177.195475) + (xy 174.819776 177.195476) (xy 174.763758 177.343181) (xy 174.744718 177.499999) (xy 112.3005 177.499999) + (xy 112.3005 175.605057) (xy 118.701302 175.605057) (xy 118.720618 175.801186) (xy 118.777831 175.98979) + (xy 118.870729 176.163589) (xy 118.870733 176.163596) (xy 118.995759 176.31594) (xy 119.148103 176.440966) + (xy 119.14811 176.44097) (xy 119.321909 176.533868) (xy 119.321912 176.533868) (xy 119.321916 176.533871) + (xy 119.510511 176.591081) (xy 119.706643 176.610398) (xy 119.902775 176.591081) (xy 120.09137 176.533871) + (xy 120.265181 176.440967) (xy 120.417526 176.31594) (xy 120.542553 176.163595) (xy 120.635457 175.989784) + (xy 120.692667 175.801189) (xy 120.711984 175.605057) (xy 120.692667 175.408925) (xy 120.635457 175.22033) + (xy 120.635454 175.220326) (xy 120.635454 175.220323) (xy 120.542556 175.046524) (xy 120.542552 175.046517) + (xy 120.417526 174.894173) (xy 120.339792 174.830378) (xy 121.206143 174.830378) (xy 121.206143 176.379735) + (xy 121.220675 176.452792) (xy 121.220676 176.452796) (xy 121.220677 176.452797) (xy 121.276042 176.535658) + (xy 121.358903 176.591023) (xy 121.358907 176.591024) (xy 121.431964 176.605556) (xy 121.431967 176.605557) + (xy 121.431969 176.605557) (xy 122.981319 176.605557) (xy 122.98132 176.605556) (xy 123.054383 176.591023) + (xy 123.137244 176.535658) (xy 123.192609 176.452797) (xy 123.207143 176.379731) (xy 123.207143 174.830383) + (xy 123.207143 174.83038) (xy 123.207142 174.830378) (xy 123.19261 174.757321) (xy 123.192609 174.757317) + (xy 123.137244 174.674456) (xy 123.054383 174.619091) (xy 123.054382 174.61909) (xy 123.054378 174.619089) + (xy 122.98132 174.604557) (xy 122.981317 174.604557) (xy 122.669075 174.604557) (xy 122.602036 174.584872) + (xy 122.556281 174.532068) (xy 122.546337 174.46291) (xy 122.575362 174.399354) (xy 122.586848 174.387741) + (xy 122.590473 174.38453) (xy 122.68021 174.254523) (xy 122.736227 174.106818) (xy 122.755268 173.95) + (xy 122.736227 173.793182) (xy 122.68021 173.645477) (xy 122.590473 173.51547) (xy 122.47223 173.410717) + (xy 122.472228 173.410716) (xy 122.472227 173.410715) (xy 122.332355 173.337303) (xy 122.178976 173.2995) + (xy 122.178975 173.2995) (xy 122.021005 173.2995) (xy 122.021004 173.2995) (xy 121.867624 173.337303) + (xy 121.727752 173.410715) (xy 121.609506 173.515471) (xy 121.519771 173.645475) (xy 121.51977 173.645476) + (xy 121.463752 173.793181) (xy 121.444712 173.949999) (xy 121.444712 173.95) (xy 121.463752 174.106818) + (xy 121.51977 174.254523) (xy 121.519771 174.254524) (xy 121.609506 174.384529) (xy 121.613132 174.387741) + (xy 121.650259 174.446931) (xy 121.649491 174.516796) (xy 121.611074 174.575156) (xy 121.547203 174.603481) + (xy 121.530905 174.604557) (xy 121.431966 174.604557) (xy 121.358907 174.619089) (xy 121.358903 174.61909) + (xy 121.276042 174.674456) (xy 121.220676 174.757317) (xy 121.220675 174.757321) (xy 121.206143 174.830378) + (xy 120.339792 174.830378) (xy 120.265182 174.769147) (xy 120.265175 174.769143) (xy 120.091376 174.676245) + (xy 120.09137 174.676243) (xy 119.902775 174.619033) (xy 119.902772 174.619032) (xy 119.706643 174.599716) + (xy 119.510513 174.619032) (xy 119.321909 174.676245) (xy 119.14811 174.769143) (xy 119.148103 174.769147) + (xy 118.995759 174.894173) (xy 118.870733 175.046517) (xy 118.870729 175.046524) (xy 118.777831 175.220323) + (xy 118.720618 175.408927) (xy 118.701302 175.605057) (xy 112.3005 175.605057) (xy 112.3005 172.399999) + (xy 119.944722 172.399999) (xy 119.944722 172.4) (xy 119.963762 172.556818) (xy 120.01978 172.704523) + (xy 120.109517 172.83453) (xy 120.22776 172.939283) (xy 120.227762 172.939284) (xy 120.367634 173.012696) + (xy 120.521014 173.0505) (xy 120.521015 173.0505) (xy 120.678985 173.0505) (xy 120.832365 173.012696) + (xy 120.97224 172.939283) (xy 121.090483 172.83453) (xy 121.18022 172.704523) (xy 121.236237 172.556818) + (xy 121.255278 172.4) (xy 121.236237 172.243182) (xy 121.18022 172.095477) (xy 121.090483 171.96547) + (xy 120.97224 171.860717) (xy 120.972238 171.860716) (xy 120.972237 171.860715) (xy 120.832365 171.787303) + (xy 120.678986 171.7495) (xy 120.678985 171.7495) (xy 120.521015 171.7495) (xy 120.521014 171.7495) + (xy 120.367634 171.787303) (xy 120.227762 171.860715) (xy 120.109516 171.965471) (xy 120.019781 172.095475) + (xy 120.01978 172.095476) (xy 119.963762 172.243181) (xy 119.944722 172.399999) (xy 112.3005 172.399999) + (xy 112.3005 170.965055) (xy 121.371364 170.965055) (xy 121.371364 170.965056) (xy 121.390404 171.121874) + (xy 121.446422 171.269579) (xy 121.536159 171.399586) (xy 121.654402 171.504339) (xy 121.654404 171.50434) + (xy 121.794276 171.577752) (xy 121.947656 171.615556) (xy 121.947657 171.615556) (xy 122.105627 171.615556) + (xy 122.259007 171.577752) (xy 122.398882 171.504339) (xy 122.517125 171.399586) (xy 122.606862 171.269579) + (xy 122.662879 171.121874) (xy 122.68192 170.965056) (xy 122.662879 170.808238) (xy 122.606862 170.660533) + (xy 122.517125 170.530526) (xy 122.398882 170.425773) (xy 122.39888 170.425772) (xy 122.398879 170.425771) + (xy 122.259007 170.352359) (xy 122.105628 170.314556) (xy 122.105627 170.314556) (xy 121.947657 170.314556) + (xy 121.947656 170.314556) (xy 121.794276 170.352359) (xy 121.654404 170.425771) (xy 121.536158 170.530527) + (xy 121.446423 170.660531) (xy 121.446422 170.660532) (xy 121.390404 170.808237) (xy 121.371364 170.965055) + (xy 112.3005 170.965055) (xy 112.3005 165.499999) (xy 171.844732 165.499999) (xy 171.844732 165.5) + (xy 171.863772 165.656818) (xy 171.893244 165.734528) (xy 171.91979 165.804523) (xy 172.009527 165.93453) + (xy 172.12777 166.039283) (xy 172.127772 166.039284) (xy 172.267644 166.112696) (xy 172.421024 166.1505) + (xy 172.421025 166.1505) (xy 172.578995 166.1505) (xy 172.732375 166.112696) (xy 172.776984 166.089283) + (xy 172.87225 166.039283) (xy 172.916593 165.999999) (xy 175.144722 165.999999) (xy 175.144722 166) + (xy 175.163762 166.156818) (xy 175.21978 166.304523) (xy 175.219781 166.304524) (xy 175.309516 166.434529) + (xy 175.335089 166.457185) (xy 175.372215 166.516375) (xy 175.371447 166.586241) (xy 175.335089 166.642815) + (xy 175.309516 166.66547) (xy 175.219781 166.795475) (xy 175.21978 166.795476) (xy 175.163762 166.943181) + (xy 175.144722 167.099999) (xy 175.144722 167.1) (xy 175.163762 167.256818) (xy 175.21978 167.404523) + (xy 175.219781 167.404524) (xy 175.309516 167.534529) (xy 175.335089 167.557185) (xy 175.372215 167.616375) + (xy 175.371447 167.686241) (xy 175.335089 167.742815) (xy 175.309516 167.76547) (xy 175.219781 167.895475) + (xy 175.21978 167.895476) (xy 175.163762 168.043181) (xy 175.144722 168.199999) (xy 175.144722 168.2) + (xy 175.163762 168.356818) (xy 175.219266 168.503169) (xy 175.21978 168.504523) (xy 175.309517 168.63453) + (xy 175.42776 168.739283) (xy 175.427762 168.739284) (xy 175.567634 168.812696) (xy 175.721014 168.8505) + (xy 175.721015 168.8505) (xy 175.878985 168.8505) (xy 176.032365 168.812696) (xy 176.131401 168.760717) + (xy 176.17224 168.739283) (xy 176.272917 168.650092) (xy 176.8345 168.650092) (xy 176.8345 168.799907) + (xy 176.863723 168.946822) (xy 176.863725 168.94683) (xy 176.921051 169.085229) (xy 176.921056 169.085238) + (xy 177.00428 169.20979) (xy 177.004283 169.209794) (xy 177.110205 169.315716) (xy 177.110209 169.315719) + (xy 177.234761 169.398943) (xy 177.234767 169.398946) (xy 177.234768 169.398947) (xy 177.37317 169.456275) + (xy 177.520092 169.485499) (xy 177.520096 169.4855) (xy 177.520097 169.4855) (xy 177.669904 169.4855) + (xy 177.669905 169.485499) (xy 177.81683 169.456275) (xy 177.955232 169.398947) (xy 178.079791 169.315719) + (xy 178.095511 169.299999) (xy 188.444722 169.299999) (xy 188.444722 169.3) (xy 188.463762 169.456818) + (xy 188.480329 169.5005) (xy 188.51978 169.604523) (xy 188.609517 169.73453) (xy 188.72776 169.839283) + (xy 188.727762 169.839284) (xy 188.867634 169.912696) (xy 189.021014 169.9505) (xy 189.021015 169.9505) + (xy 189.178985 169.9505) (xy 189.332365 169.912696) (xy 189.47224 169.839283) (xy 189.590483 169.73453) + (xy 189.68022 169.604523) (xy 189.736237 169.456818) (xy 189.755278 169.3) (xy 189.755278 169.299999) + (xy 190.244722 169.299999) (xy 190.244722 169.3) (xy 190.263762 169.456818) (xy 190.280329 169.5005) + (xy 190.31978 169.604523) (xy 190.409517 169.73453) (xy 190.52776 169.839283) (xy 190.527762 169.839284) + (xy 190.667634 169.912696) (xy 190.821014 169.9505) (xy 190.821015 169.9505) (xy 190.978985 169.9505) + (xy 191.132365 169.912696) (xy 191.27224 169.839283) (xy 191.390483 169.73453) (xy 191.48022 169.604523) + (xy 191.536237 169.456818) (xy 191.555278 169.3) (xy 191.540589 169.179025) (xy 191.552049 169.110103) + (xy 191.598953 169.058317) (xy 191.666409 169.04011) (xy 191.693359 169.043683) (xy 191.721013 169.050499) + (xy 191.721014 169.0505) (xy 191.721015 169.0505) (xy 191.878985 169.0505) (xy 192.032365 169.012696) + (xy 192.043564 169.006818) (xy 192.17224 168.939283) (xy 192.290483 168.83453) (xy 192.38022 168.704523) + (xy 192.436237 168.556818) (xy 192.455278 168.4) (xy 192.436237 168.243182) (xy 192.436236 168.243179) + (xy 192.436236 168.243178) (xy 192.426866 168.21847) (xy 192.425443 168.199999) (xy 194.944722 168.199999) + (xy 194.944722 168.2) (xy 194.963762 168.356818) (xy 195.019266 168.503169) (xy 195.01978 168.504523) + (xy 195.109517 168.63453) (xy 195.22776 168.739283) (xy 195.227762 168.739284) (xy 195.367634 168.812696) + (xy 195.521014 168.8505) (xy 195.521015 168.8505) (xy 195.678985 168.8505) (xy 195.832365 168.812696) + (xy 195.972238 168.739284) (xy 195.972237 168.739284) (xy 195.97224 168.739283) (xy 196.037129 168.681797) + (xy 196.100362 168.652075) (xy 196.169626 168.661259) (xy 196.201579 168.681793) (xy 196.227236 168.704523) + (xy 196.277762 168.749285) (xy 196.417634 168.822696) (xy 196.571014 168.8605) (xy 196.571015 168.8605) + (xy 196.728985 168.8605) (xy 196.882365 168.822696) (xy 196.925793 168.799903) (xy 197.02224 168.749283) + (xy 197.122774 168.660218) (xy 197.186006 168.630498) (xy 197.25527 168.639682) (xy 197.287224 168.660217) + (xy 197.38776 168.749283) (xy 197.387762 168.749284) (xy 197.527634 168.822696) (xy 197.681014 168.8605) + (xy 197.681015 168.8605) (xy 197.838985 168.8605) (xy 197.992365 168.822696) (xy 198.035793 168.799903) + (xy 198.13224 168.749283) (xy 198.250483 168.64453) (xy 198.34022 168.514523) (xy 198.396237 168.366818) + (xy 198.415278 168.21) (xy 198.415278 168.209999) (xy 198.669722 168.209999) (xy 198.669722 168.21) + (xy 198.688762 168.366818) (xy 198.740988 168.504524) (xy 198.74478 168.514523) (xy 198.834517 168.64453) + (xy 198.95276 168.749283) (xy 198.952762 168.749284) (xy 199.092634 168.822696) (xy 199.246014 168.8605) + (xy 199.246015 168.8605) (xy 199.403985 168.8605) (xy 199.44659 168.849999) (xy 200.844722 168.849999) + (xy 200.844722 168.85) (xy 200.863762 169.006818) (xy 200.915479 169.143182) (xy 200.91978 169.154523) + (xy 201.009517 169.28453) (xy 201.12776 169.389283) (xy 201.127762 169.389284) (xy 201.267634 169.462696) + (xy 201.421014 169.5005) (xy 201.421015 169.5005) (xy 201.578985 169.5005) (xy 201.732365 169.462696) + (xy 201.744601 169.456274) (xy 201.87224 169.389283) (xy 201.990483 169.28453) (xy 202.08022 169.154523) + (xy 202.136237 169.006818) (xy 202.155278 168.85) (xy 202.136237 168.693182) (xy 202.134007 168.687303) + (xy 202.082337 168.55106) (xy 202.08022 168.545477) (xy 201.990483 168.41547) (xy 201.87224 168.310717) + (xy 201.872238 168.310716) (xy 201.872237 168.310715) (xy 201.732365 168.237303) (xy 201.578986 168.1995) + (xy 201.578985 168.1995) (xy 201.421015 168.1995) (xy 201.421014 168.1995) (xy 201.267634 168.237303) + (xy 201.127762 168.310715) (xy 201.009516 168.415471) (xy 200.919781 168.545475) (xy 200.91978 168.545476) + (xy 200.863762 168.693181) (xy 200.844722 168.849999) (xy 199.44659 168.849999) (xy 199.557365 168.822696) + (xy 199.600793 168.799903) (xy 199.69724 168.749283) (xy 199.815483 168.64453) (xy 199.90522 168.514523) + (xy 199.961237 168.366818) (xy 199.980278 168.21) (xy 199.966373 168.095476) (xy 199.961237 168.053181) + (xy 199.938687 167.993723) (xy 199.90522 167.905477) (xy 199.815483 167.77547) (xy 199.69724 167.670717) + (xy 199.697238 167.670716) (xy 199.697237 167.670715) (xy 199.557365 167.597303) (xy 199.403986 167.5595) + (xy 199.403985 167.5595) (xy 199.246015 167.5595) (xy 199.246014 167.5595) (xy 199.092634 167.597303) + (xy 198.952762 167.670715) (xy 198.834516 167.775471) (xy 198.744781 167.905475) (xy 198.74478 167.905476) + (xy 198.688762 168.053181) (xy 198.669722 168.209999) (xy 198.415278 168.209999) (xy 198.401373 168.095476) + (xy 198.396237 168.053181) (xy 198.373687 167.993723) (xy 198.34022 167.905477) (xy 198.250483 167.77547) + (xy 198.13224 167.670717) (xy 198.132238 167.670716) (xy 198.132237 167.670715) (xy 197.992365 167.597303) + (xy 197.838986 167.5595) (xy 197.838985 167.5595) (xy 197.681015 167.5595) (xy 197.681014 167.5595) + (xy 197.527634 167.597303) (xy 197.387761 167.670715) (xy 197.387759 167.670717) (xy 197.287226 167.75978) + (xy 197.223993 167.789501) (xy 197.154729 167.780317) (xy 197.122774 167.75978) (xy 197.02224 167.670717) + (xy 197.022238 167.670715) (xy 196.882365 167.597303) (xy 196.728986 167.5595) (xy 196.728985 167.5595) + (xy 196.571015 167.5595) (xy 196.571014 167.5595) (xy 196.417634 167.597303) (xy 196.277762 167.670714) + (xy 196.212869 167.728204) (xy 196.149635 167.757924) (xy 196.080372 167.74874) (xy 196.048418 167.728204) + (xy 195.983526 167.670715) (xy 195.972237 167.660714) (xy 195.832365 167.587303) (xy 195.678986 167.5495) + (xy 195.678985 167.5495) (xy 195.521015 167.5495) (xy 195.521014 167.5495) (xy 195.367634 167.587303) + (xy 195.227762 167.660715) (xy 195.169084 167.712699) (xy 195.128402 167.74874) (xy 195.109516 167.765471) + (xy 195.019781 167.895475) (xy 195.01978 167.895476) (xy 194.963762 168.043181) (xy 194.944722 168.199999) + (xy 192.425443 168.199999) (xy 192.421499 168.148807) (xy 192.454647 168.087301) (xy 192.515786 168.05348) + (xy 192.542808 168.0505) (xy 192.578985 168.0505) (xy 192.732365 168.012696) (xy 192.87224 167.939283) + (xy 192.990483 167.83453) (xy 193.08022 167.704523) (xy 193.136237 167.556818) (xy 193.155278 167.4) + (xy 193.148694 167.345771) (xy 193.136237 167.243181) (xy 193.101087 167.1505) (xy 193.08022 167.095477) + (xy 192.990483 166.96547) (xy 192.87224 166.860717) (xy 192.872238 166.860716) (xy 192.872237 166.860715) + (xy 192.732365 166.787303) (xy 192.578986 166.7495) (xy 192.578985 166.7495) (xy 192.421015 166.7495) + (xy 192.421014 166.7495) (xy 192.401825 166.754229) (xy 192.332023 166.751157) (xy 192.274962 166.710836) + (xy 192.249058 166.648777) (xy 192.236237 166.543182) (xy 192.18022 166.395477) (xy 192.090483 166.26547) + (xy 191.97224 166.160717) (xy 191.972238 166.160716) (xy 191.972237 166.160715) (xy 191.832365 166.087303) + (xy 191.678986 166.0495) (xy 191.678985 166.0495) (xy 191.521015 166.0495) (xy 191.521014 166.0495) + (xy 191.367634 166.087303) (xy 191.227762 166.160715) (xy 191.22776 166.160717) (xy 191.110898 166.264247) + (xy 191.109516 166.265471) (xy 191.019781 166.395475) (xy 191.01978 166.395476) (xy 190.963762 166.543181) + (xy 190.944722 166.699999) (xy 190.944722 166.7) (xy 190.963762 166.856818) (xy 191.014027 166.989353) + (xy 191.01978 167.004523) (xy 191.109517 167.13453) (xy 191.22776 167.239283) (xy 191.227762 167.239284) + (xy 191.367634 167.312696) (xy 191.521014 167.3505) (xy 191.521015 167.3505) (xy 191.678983 167.3505) + (xy 191.678985 167.3505) (xy 191.698171 167.345771) (xy 191.767971 167.34884) (xy 191.825034 167.389159) + (xy 191.850941 167.451221) (xy 191.863763 167.556819) (xy 191.863763 167.556821) (xy 191.873134 167.58153) + (xy 191.878501 167.651193) (xy 191.845353 167.712699) (xy 191.784214 167.74652) (xy 191.757192 167.7495) + (xy 191.721014 167.7495) (xy 191.567634 167.787303) (xy 191.427762 167.860715) (xy 191.309516 167.965471) + (xy 191.219781 168.095475) (xy 191.21978 168.095476) (xy 191.163762 168.243181) (xy 191.144722 168.399999) (xy 191.144722 168.4) (xy 191.15941 168.520973) (xy 191.147949 168.589896) (xy 191.101045 168.641682) (xy 191.033589 168.659889) (xy 191.006639 168.656316) (xy 190.978985 168.6495) (xy 190.821015 168.6495) (xy 190.821014 168.6495) (xy 190.667634 168.687303) (xy 190.527762 168.760715) (xy 190.409516 168.865471) - (xy 190.319781 168.995475) (xy 190.31978 168.995476) (xy 190.263762 169.143181) (xy 190.243818 169.307445) - (xy 190.240775 169.307075) (xy 190.225037 169.360675) (xy 190.172233 169.40643) (xy 190.103075 169.416374) - (xy 190.063097 169.403433) (xy 190.032364 169.387303) (xy 189.878986 169.3495) (xy 189.878985 169.3495) - (xy 189.721015 169.3495) (xy 189.721014 169.3495) (xy 189.567634 169.387303) (xy 189.427762 169.460715) - (xy 189.309516 169.565471) (xy 189.219781 169.695475) (xy 189.21978 169.695476) (xy 189.163762 169.843181) - (xy 189.144722 169.999999) (xy 112.3005 169.999999) (xy 112.3005 165.499999) (xy 171.844732 165.499999) - (xy 171.844732 165.5) (xy 171.863772 165.656818) (xy 171.893244 165.734528) (xy 171.91979 165.804523) - (xy 172.009527 165.93453) (xy 172.12777 166.039283) (xy 172.127772 166.039284) (xy 172.267644 166.112696) - (xy 172.421024 166.1505) (xy 172.421025 166.1505) (xy 172.578995 166.1505) (xy 172.732375 166.112696) - (xy 172.776984 166.089283) (xy 172.87225 166.039283) (xy 172.916593 165.999999) (xy 175.144722 165.999999) - (xy 175.144722 166) (xy 175.163762 166.156818) (xy 175.21978 166.304523) (xy 175.219781 166.304524) - (xy 175.309516 166.434529) (xy 175.335089 166.457185) (xy 175.372215 166.516375) (xy 175.371447 166.586241) - (xy 175.335089 166.642815) (xy 175.309516 166.66547) (xy 175.219781 166.795475) (xy 175.21978 166.795476) - (xy 175.163762 166.943181) (xy 175.144722 167.099999) (xy 175.144722 167.1) (xy 175.163762 167.256818) - (xy 175.203536 167.361692) (xy 175.21978 167.404523) (xy 175.252013 167.451221) (xy 175.309516 167.534529) - (xy 175.335089 167.557185) (xy 175.372215 167.616375) (xy 175.371447 167.686241) (xy 175.335089 167.742815) - (xy 175.309516 167.76547) (xy 175.219781 167.895475) (xy 175.21978 167.895476) (xy 175.163762 168.043181) - (xy 175.144722 168.199999) (xy 175.144722 168.2) (xy 175.163762 168.356818) (xy 175.219266 168.503169) - (xy 175.21978 168.504523) (xy 175.309517 168.63453) (xy 175.42776 168.739283) (xy 175.427762 168.739284) - (xy 175.567634 168.812696) (xy 175.721014 168.8505) (xy 175.721015 168.8505) (xy 175.878985 168.8505) - (xy 176.032365 168.812696) (xy 176.131401 168.760717) (xy 176.17224 168.739283) (xy 176.272917 168.650092) - (xy 176.8345 168.650092) (xy 176.8345 168.799907) (xy 176.863723 168.946822) (xy 176.863725 168.94683) - (xy 176.921051 169.085229) (xy 176.921056 169.085238) (xy 177.00428 169.20979) (xy 177.004283 169.209794) - (xy 177.110205 169.315716) (xy 177.110209 169.315719) (xy 177.234761 169.398943) (xy 177.23477 169.398948) - (xy 177.266123 169.411934) (xy 177.37317 169.456275) (xy 177.520092 169.485499) (xy 177.520096 169.4855) - (xy 177.520097 169.4855) (xy 177.669904 169.4855) (xy 177.669905 169.485499) (xy 177.81683 169.456275) - (xy 177.955232 169.398947) (xy 178.079791 169.315719) (xy 178.185719 169.209791) (xy 178.268947 169.085232) - (xy 178.326275 168.94683) (xy 178.3555 168.799903) (xy 178.3555 168.650097) (xy 178.326275 168.50317) - (xy 178.268947 168.364768) (xy 178.268946 168.364767) (xy 178.268943 168.364761) (xy 178.185719 168.240209) - (xy 178.185716 168.240205) (xy 178.079794 168.134283) (xy 178.07979 168.13428) (xy 177.955238 168.051056) - (xy 177.955229 168.051051) (xy 177.81683 167.993725) (xy 177.816822 167.993723) (xy 177.669907 167.9645) - (xy 177.669903 167.9645) (xy 177.520097 167.9645) (xy 177.520092 167.9645) (xy 177.373177 167.993723) - (xy 177.373169 167.993725) (xy 177.23477 168.051051) (xy 177.234761 168.051056) (xy 177.110209 168.13428) - (xy 177.110205 168.134283) (xy 177.004283 168.240205) (xy 177.00428 168.240209) (xy 176.921056 168.364761) - (xy 176.921051 168.36477) (xy 176.863725 168.503169) (xy 176.863723 168.503177) (xy 176.8345 168.650092) - (xy 176.272917 168.650092) (xy 176.290483 168.63453) (xy 176.38022 168.504523) (xy 176.436237 168.356818) - (xy 176.455278 168.2) (xy 176.437488 168.05348) (xy 176.436237 168.043181) (xy 176.406397 167.9645) - (xy 176.38022 167.895477) (xy 176.290483 167.76547) (xy 176.26491 167.742814) (xy 176.227785 167.683627) - (xy 176.228552 167.613761) (xy 176.26491 167.557185) (xy 176.290483 167.53453) (xy 176.38022 167.404523) - (xy 176.436237 167.256818) (xy 176.455278 167.1) (xy 176.447666 167.037304) (xy 176.436237 166.943181) - (xy 176.403608 166.857146) (xy 176.38022 166.795477) (xy 176.290483 166.66547) (xy 176.26491 166.642814) - (xy 176.227785 166.583627) (xy 176.228552 166.513761) (xy 176.26491 166.457185) (xy 176.290483 166.43453) - (xy 176.38022 166.304523) (xy 176.436237 166.156818) (xy 176.455278 166) (xy 176.445702 165.921129) - (xy 176.436237 165.843181) (xy 176.411142 165.777011) (xy 176.391417 165.725) (xy 180.529659 165.725) - (xy 180.548975 165.921129) (xy 180.548976 165.921132) (xy 180.5729 166) (xy 180.606188 166.109733) - (xy 180.699086 166.283532) (xy 180.69909 166.283539) (xy 180.824116 166.435883) (xy 180.97646 166.560909) - (xy 180.976467 166.560913) (xy 181.150266 166.653811) (xy 181.150269 166.653811) (xy 181.150273 166.653814) - (xy 181.338868 166.711024) (xy 181.535 166.730341) (xy 181.731132 166.711024) (xy 181.919727 166.653814) - (xy 182.093538 166.56091) (xy 182.245883 166.435883) (xy 182.37091 166.283538) (xy 182.417981 166.195475) - (xy 182.463811 166.109733) (xy 182.463811 166.109732) (xy 182.463814 166.109727) (xy 182.521024 165.921132) - (xy 182.540341 165.725) (xy 182.52803 165.599999) (xy 187.844722 165.599999) (xy 187.844722 165.6) - (xy 187.863762 165.756818) (xy 187.900818 165.854524) (xy 187.91978 165.904523) (xy 188.009517 166.03453) - (xy 188.12776 166.139283) (xy 188.127762 166.139284) (xy 188.267634 166.212696) (xy 188.421014 166.2505) - (xy 188.53505 166.2505) (xy 188.602089 166.270185) (xy 188.647844 166.322989) (xy 188.658145 166.389445) - (xy 188.652507 166.435883) (xy 188.644722 166.5) (xy 188.663762 166.656818) (xy 188.716349 166.795476) - (xy 188.71978 166.804523) (xy 188.809517 166.93453) (xy 188.92776 167.039283) (xy 188.927762 167.039284) - (xy 189.067634 167.112696) (xy 189.221014 167.1505) (xy 189.221015 167.1505) (xy 189.378985 167.1505) - (xy 189.532365 167.112696) (xy 189.556557 167.099999) (xy 189.67224 167.039283) (xy 189.790483 166.93453) - (xy 189.88022 166.804523) (xy 189.936237 166.656818) (xy 189.955278 166.5) (xy 189.947329 166.434529) - (xy 189.936237 166.343181) (xy 189.88675 166.212696) (xy 189.88022 166.195477) (xy 189.790483 166.06547) - (xy 189.67224 165.960717) (xy 189.672238 165.960716) (xy 189.672237 165.960715) (xy 189.532365 165.887303) - (xy 189.378986 165.8495) (xy 189.378985 165.8495) (xy 189.264951 165.8495) (xy 189.197912 165.829815) - (xy 189.152157 165.777011) (xy 189.141855 165.710554) (xy 189.155278 165.6) (xy 189.155278 165.599999) - (xy 189.149207 165.549999) (xy 195.794722 165.549999) (xy 195.794722 165.55) (xy 195.813762 165.706818) - (xy 195.865479 165.843182) (xy 195.86978 165.854523) (xy 195.959517 165.98453) (xy 196.07776 166.089283) - (xy 196.077762 166.089284) (xy 196.217634 166.162696) (xy 196.371014 166.2005) (xy 196.371015 166.2005) - (xy 196.528985 166.2005) (xy 196.531014 166.2) (xy 244.3 166.2) (xy 244.3 188.8) (xy 251.376 188.8) - (xy 251.443039 188.819685) (xy 251.488794 188.872489) (xy 251.5 188.924) (xy 251.5 194.761107) (xy 251.480315 194.828146) - (xy 251.427511 194.873901) (xy 251.358353 194.883845) (xy 251.294797 194.85482) (xy 251.262444 194.810917) - (xy 251.203623 194.676818) (xy 251.195049 194.657272) (xy 251.159285 194.602532) (xy 251.105364 194.52) - (xy 251.063571 194.456031) (xy 250.900764 194.279175) (xy 250.900759 194.279171) (xy 250.900757 194.279169) - (xy 250.711075 194.131533) (xy 250.711069 194.131529) (xy 250.499657 194.017118) (xy 250.499652 194.017116) - (xy 250.2723 193.939066) (xy 250.094468 193.909391) (xy 250.035192 193.8995) (xy 249.794808 193.8995) - (xy 249.748047 193.907303) (xy 249.557699 193.939066) (xy 249.330347 194.017116) (xy 249.330342 194.017118) - (xy 249.11893 194.131529) (xy 249.118924 194.131533) (xy 248.929242 194.279169) (xy 248.929239 194.279172) - (xy 248.929236 194.279174) (xy 248.929236 194.279175) (xy 248.908972 194.301188) (xy 248.76643 194.456029) - (xy 248.766427 194.456033) (xy 248.634951 194.65727) (xy 248.538389 194.87741) (xy 248.479379 195.11044) - (xy 248.459529 195.349994) (xy 248.459529 195.350005) (xy 248.479379 195.589559) (xy 248.538389 195.822589) - (xy 248.634951 196.042729) (xy 248.757629 196.2305) (xy 248.766429 196.243969) (xy 248.929236 196.420825) - (xy 248.929239 196.420827) (xy 248.929242 196.42083) (xy 249.118924 196.568466) (xy 249.11893 196.56847) - (xy 249.118933 196.568472) (xy 249.330344 196.682882) (xy 249.330347 196.682883) (xy 249.557699 196.760933) - (xy 249.557701 196.760933) (xy 249.557703 196.760934) (xy 249.794808 196.8005) (xy 249.794809 196.8005) - (xy 250.035191 196.8005) (xy 250.035192 196.8005) (xy 250.272297 196.760934) (xy 250.499656 196.682882) - (xy 250.711067 196.568472) (xy 250.900764 196.420825) (xy 251.063571 196.243969) (xy 251.195049 196.042728) - (xy 251.262444 195.889081) (xy 251.3074 195.835596) (xy 251.374136 195.814906) (xy 251.441464 195.83358) - (xy 251.488007 195.885691) (xy 251.5 195.938892) (xy 251.5 208.231107) (xy 251.480315 208.298146) - (xy 251.427511 208.343901) (xy 251.358353 208.353845) (xy 251.294797 208.32482) (xy 251.262444 208.280917) - (xy 251.195048 208.12727) (xy 251.063572 207.926033) (xy 251.063571 207.926031) (xy 250.900764 207.749175) - (xy 250.900759 207.749171) (xy 250.900757 207.749169) (xy 250.711075 207.601533) (xy 250.711069 207.601529) - (xy 250.499657 207.487118) (xy 250.499652 207.487116) (xy 250.2723 207.409066) (xy 250.094468 207.379391) - (xy 250.035192 207.3695) (xy 249.794808 207.3695) (xy 249.747387 207.377413) (xy 249.557699 207.409066) - (xy 249.330347 207.487116) (xy 249.330342 207.487118) (xy 249.11893 207.601529) (xy 249.118924 207.601533) - (xy 248.929242 207.749169) (xy 248.929239 207.749172) (xy 248.76643 207.926029) (xy 248.766427 207.926033) - (xy 248.634951 208.12727) (xy 248.538389 208.34741) (xy 248.479379 208.58044) (xy 248.459529 208.819994) - (xy 248.459529 208.820005) (xy 248.479379 209.059559) (xy 248.538389 209.292589) (xy 248.634951 209.512729) - (xy 248.766427 209.713966) (xy 248.766429 209.713969) (xy 248.929236 209.890825) (xy 248.929239 209.890827) - (xy 248.929242 209.89083) (xy 249.118924 210.038466) (xy 249.11893 210.03847) (xy 249.118933 210.038472) - (xy 249.330344 210.152882) (xy 249.347208 210.158671) (xy 249.557699 210.230933) (xy 249.557701 210.230933) - (xy 249.557703 210.230934) (xy 249.794808 210.2705) (xy 249.794809 210.2705) (xy 250.035191 210.2705) - (xy 250.035192 210.2705) (xy 250.272297 210.230934) (xy 250.499656 210.152882) (xy 250.711067 210.038472) - (xy 250.728988 210.024524) (xy 250.775315 209.988466) (xy 250.900764 209.890825) (xy 251.063571 209.713969) - (xy 251.195049 209.512728) (xy 251.262444 209.359081) (xy 251.3074 209.305596) (xy 251.374136 209.284906) - (xy 251.441464 209.30358) (xy 251.488007 209.355691) (xy 251.5 209.408892) (xy 251.5 213.5) (xy 268.5 213.5) - (xy 268.5 213) (xy 252.124 213) (xy 252.056961 212.980315) (xy 252.011206 212.927511) (xy 252 212.876) - (xy 252 209.719999) (xy 256.654722 209.719999) (xy 256.654722 209.72) (xy 256.673762 209.876818) - (xy 256.717 209.990825) (xy 256.72978 210.024523) (xy 256.819517 210.15453) (xy 256.93776 210.259283) - (xy 256.937762 210.259284) (xy 257.077634 210.332696) (xy 257.231014 210.3705) (xy 257.231015 210.3705) - (xy 257.388985 210.3705) (xy 257.542365 210.332696) (xy 257.545724 210.330933) (xy 257.68224 210.259283) - (xy 257.800483 210.15453) (xy 257.89022 210.024523) (xy 257.946237 209.876818) (xy 257.965278 209.72) - (xy 257.946237 209.563182) (xy 257.945302 209.560717) (xy 257.903123 209.4495) (xy 257.89022 209.415477) - (xy 257.800483 209.28547) (xy 257.68224 209.180717) (xy 257.682238 209.180716) (xy 257.682237 209.180715) - (xy 257.542365 209.107303) (xy 257.388986 209.0695) (xy 257.388985 209.0695) (xy 257.231015 209.0695) - (xy 257.231014 209.0695) (xy 257.077634 209.107303) (xy 256.937762 209.180715) (xy 256.819516 209.285471) - (xy 256.729781 209.415475) (xy 256.72978 209.415476) (xy 256.673762 209.563181) (xy 256.654722 209.719999) - (xy 252 209.719999) (xy 252 205.899999) (xy 253.544722 205.899999) (xy 253.544722 205.9) (xy 253.563762 206.056818) + (xy 190.319781 168.995475) (xy 190.31978 168.995476) (xy 190.263762 169.143181) (xy 190.244722 169.299999) + (xy 189.755278 169.299999) (xy 189.736237 169.143182) (xy 189.68022 168.995477) (xy 189.590483 168.86547) + (xy 189.47224 168.760717) (xy 189.472238 168.760716) (xy 189.472237 168.760715) (xy 189.332365 168.687303) + (xy 189.178986 168.6495) (xy 189.178985 168.6495) (xy 189.021015 168.6495) (xy 189.021014 168.6495) + (xy 188.867634 168.687303) (xy 188.727762 168.760715) (xy 188.609516 168.865471) (xy 188.519781 168.995475) + (xy 188.51978 168.995476) (xy 188.463762 169.143181) (xy 188.444722 169.299999) (xy 178.095511 169.299999) + (xy 178.185719 169.209791) (xy 178.268947 169.085232) (xy 178.326275 168.94683) (xy 178.3555 168.799903) + (xy 178.3555 168.650097) (xy 178.326275 168.50317) (xy 178.268947 168.364768) (xy 178.268946 168.364767) + (xy 178.268943 168.364761) (xy 178.185719 168.240209) (xy 178.185716 168.240205) (xy 178.079794 168.134283) + (xy 178.07979 168.13428) (xy 177.955238 168.051056) (xy 177.955229 168.051051) (xy 177.81683 167.993725) + (xy 177.816822 167.993723) (xy 177.669907 167.9645) (xy 177.669903 167.9645) (xy 177.520097 167.9645) + (xy 177.520092 167.9645) (xy 177.373177 167.993723) (xy 177.373169 167.993725) (xy 177.23477 168.051051) + (xy 177.234761 168.051056) (xy 177.110209 168.13428) (xy 177.110205 168.134283) (xy 177.004283 168.240205) + (xy 177.00428 168.240209) (xy 176.921056 168.364761) (xy 176.921051 168.36477) (xy 176.863725 168.503169) + (xy 176.863723 168.503177) (xy 176.8345 168.650092) (xy 176.272917 168.650092) (xy 176.290483 168.63453) + (xy 176.38022 168.504523) (xy 176.436237 168.356818) (xy 176.455278 168.2) (xy 176.442587 168.095475) + (xy 176.436237 168.043181) (xy 176.406397 167.9645) (xy 176.38022 167.895477) (xy 176.290483 167.76547) + (xy 176.26491 167.742814) (xy 176.227785 167.683627) (xy 176.228552 167.613761) (xy 176.26491 167.557185) + (xy 176.290483 167.53453) (xy 176.38022 167.404523) (xy 176.436237 167.256818) (xy 176.455278 167.1) + (xy 176.447666 167.037304) (xy 176.436237 166.943181) (xy 176.404961 166.860715) (xy 176.38022 166.795477) + (xy 176.290483 166.66547) (xy 176.26491 166.642814) (xy 176.227785 166.583627) (xy 176.228552 166.513761) + (xy 176.26491 166.457185) (xy 176.290483 166.43453) (xy 176.38022 166.304523) (xy 176.436237 166.156818) + (xy 176.455278 166) (xy 176.445702 165.921129) (xy 176.436237 165.843181) (xy 176.411142 165.777011) + (xy 176.391417 165.725) (xy 180.529659 165.725) (xy 180.548975 165.921129) (xy 180.548976 165.921132) + (xy 180.5729 166) (xy 180.606188 166.109733) (xy 180.699086 166.283532) (xy 180.69909 166.283539) + (xy 180.824116 166.435883) (xy 180.97646 166.560909) (xy 180.976467 166.560913) (xy 181.150266 166.653811) + (xy 181.150269 166.653811) (xy 181.150273 166.653814) (xy 181.338868 166.711024) (xy 181.535 166.730341) + (xy 181.731132 166.711024) (xy 181.919727 166.653814) (xy 182.093538 166.56091) (xy 182.245883 166.435883) + (xy 182.37091 166.283538) (xy 182.417981 166.195475) (xy 182.463811 166.109733) (xy 182.463811 166.109732) + (xy 182.463814 166.109727) (xy 182.521024 165.921132) (xy 182.540341 165.725) (xy 182.52803 165.599999) + (xy 187.844722 165.599999) (xy 187.844722 165.6) (xy 187.863762 165.756818) (xy 187.900818 165.854524) + (xy 187.91978 165.904523) (xy 188.009517 166.03453) (xy 188.12776 166.139283) (xy 188.127762 166.139284) + (xy 188.267634 166.212696) (xy 188.421014 166.2505) (xy 188.53505 166.2505) (xy 188.602089 166.270185) + (xy 188.647844 166.322989) (xy 188.658145 166.389445) (xy 188.652507 166.435883) (xy 188.644722 166.5) + (xy 188.663762 166.656818) (xy 188.716349 166.795476) (xy 188.71978 166.804523) (xy 188.809517 166.93453) + (xy 188.92776 167.039283) (xy 188.927762 167.039284) (xy 189.067634 167.112696) (xy 189.221014 167.1505) + (xy 189.221015 167.1505) (xy 189.378985 167.1505) (xy 189.513863 167.117256) (xy 189.583664 167.120325) + (xy 189.640726 167.160645) (xy 189.666932 167.225414) (xy 189.65396 167.294069) (xy 189.645588 167.308091) + (xy 189.619786 167.345471) (xy 189.619784 167.345476) (xy 189.563766 167.493181) (xy 189.544726 167.649999) + (xy 189.544726 167.65) (xy 189.563766 167.806818) (xy 189.601183 167.905476) (xy 189.619784 167.954523) + (xy 189.709521 168.08453) (xy 189.827764 168.189283) (xy 189.827766 168.189284) (xy 189.967638 168.262696) + (xy 190.121018 168.3005) (xy 190.121019 168.3005) (xy 190.278989 168.3005) (xy 190.432369 168.262696) + (xy 190.475221 168.240205) (xy 190.572244 168.189283) (xy 190.690487 168.08453) (xy 190.780224 167.954523) + (xy 190.836241 167.806818) (xy 190.855282 167.65) (xy 190.848884 167.597303) (xy 190.836241 167.493181) + (xy 190.814996 167.437164) (xy 190.780224 167.345477) (xy 190.690487 167.21547) (xy 190.572244 167.110717) + (xy 190.572242 167.110716) (xy 190.572241 167.110715) (xy 190.432369 167.037303) (xy 190.27899 166.9995) + (xy 190.278989 166.9995) (xy 190.121019 166.9995) (xy 190.121018 166.9995) (xy 189.98614 167.032743) + (xy 189.916338 167.029673) (xy 189.859276 166.989353) (xy 189.833071 166.924584) (xy 189.846044 166.855929) + (xy 189.854417 166.841905) (xy 189.880218 166.804526) (xy 189.880219 166.804524) (xy 189.88022 166.804523) + (xy 189.936237 166.656818) (xy 189.955278 166.5) (xy 189.947329 166.434529) (xy 189.936237 166.343181) + (xy 189.88675 166.212696) (xy 189.88022 166.195477) (xy 189.790483 166.06547) (xy 189.67224 165.960717) + (xy 189.672238 165.960716) (xy 189.672237 165.960715) (xy 189.532365 165.887303) (xy 189.378986 165.8495) + (xy 189.378985 165.8495) (xy 189.264951 165.8495) (xy 189.197912 165.829815) (xy 189.152157 165.777011) + (xy 189.141855 165.710554) (xy 189.155278 165.6) (xy 189.155278 165.599999) (xy 189.149207 165.549999) + (xy 195.794722 165.549999) (xy 195.794722 165.55) (xy 195.813762 165.706818) (xy 195.865479 165.843182) + (xy 195.86978 165.854523) (xy 195.959517 165.98453) (xy 196.07776 166.089283) (xy 196.077762 166.089284) + (xy 196.217634 166.162696) (xy 196.371014 166.2005) (xy 196.371015 166.2005) (xy 196.528985 166.2005) + (xy 196.531014 166.2) (xy 244.3 166.2) (xy 244.3 188.8) (xy 251.376 188.8) (xy 251.443039 188.819685) + (xy 251.488794 188.872489) (xy 251.5 188.924) (xy 251.5 194.761107) (xy 251.480315 194.828146) (xy 251.427511 194.873901) + (xy 251.358353 194.883845) (xy 251.294797 194.85482) (xy 251.262444 194.810917) (xy 251.203623 194.676818) + (xy 251.195049 194.657272) (xy 251.159285 194.602532) (xy 251.105364 194.52) (xy 251.063571 194.456031) + (xy 250.900764 194.279175) (xy 250.900759 194.279171) (xy 250.900757 194.279169) (xy 250.711075 194.131533) + (xy 250.711069 194.131529) (xy 250.499657 194.017118) (xy 250.499652 194.017116) (xy 250.2723 193.939066) + (xy 250.094468 193.909391) (xy 250.035192 193.8995) (xy 249.794808 193.8995) (xy 249.748047 193.907303) + (xy 249.557699 193.939066) (xy 249.330347 194.017116) (xy 249.330342 194.017118) (xy 249.11893 194.131529) + (xy 249.118924 194.131533) (xy 248.929242 194.279169) (xy 248.929239 194.279172) (xy 248.929236 194.279174) + (xy 248.929236 194.279175) (xy 248.908972 194.301188) (xy 248.76643 194.456029) (xy 248.766427 194.456033) + (xy 248.634951 194.65727) (xy 248.538389 194.87741) (xy 248.479379 195.11044) (xy 248.459529 195.349994) + (xy 248.459529 195.350005) (xy 248.479379 195.589559) (xy 248.538389 195.822589) (xy 248.634951 196.042729) + (xy 248.757629 196.2305) (xy 248.766429 196.243969) (xy 248.929236 196.420825) (xy 248.929239 196.420827) + (xy 248.929242 196.42083) (xy 249.118924 196.568466) (xy 249.11893 196.56847) (xy 249.118933 196.568472) + (xy 249.330344 196.682882) (xy 249.330347 196.682883) (xy 249.557699 196.760933) (xy 249.557701 196.760933) + (xy 249.557703 196.760934) (xy 249.794808 196.8005) (xy 249.794809 196.8005) (xy 250.035191 196.8005) + (xy 250.035192 196.8005) (xy 250.272297 196.760934) (xy 250.499656 196.682882) (xy 250.711067 196.568472) + (xy 250.900764 196.420825) (xy 251.063571 196.243969) (xy 251.195049 196.042728) (xy 251.262444 195.889081) + (xy 251.3074 195.835596) (xy 251.374136 195.814906) (xy 251.441464 195.83358) (xy 251.488007 195.885691) + (xy 251.5 195.938892) (xy 251.5 208.231107) (xy 251.480315 208.298146) (xy 251.427511 208.343901) + (xy 251.358353 208.353845) (xy 251.294797 208.32482) (xy 251.262444 208.280917) (xy 251.195048 208.12727) + (xy 251.063572 207.926033) (xy 251.063571 207.926031) (xy 250.900764 207.749175) (xy 250.900759 207.749171) + (xy 250.900757 207.749169) (xy 250.711075 207.601533) (xy 250.711069 207.601529) (xy 250.499657 207.487118) + (xy 250.499652 207.487116) (xy 250.2723 207.409066) (xy 250.094468 207.379391) (xy 250.035192 207.3695) + (xy 249.794808 207.3695) (xy 249.747387 207.377413) (xy 249.557699 207.409066) (xy 249.330347 207.487116) + (xy 249.330342 207.487118) (xy 249.11893 207.601529) (xy 249.118924 207.601533) (xy 248.929242 207.749169) + (xy 248.929239 207.749172) (xy 248.76643 207.926029) (xy 248.766427 207.926033) (xy 248.634951 208.12727) + (xy 248.538389 208.34741) (xy 248.479379 208.58044) (xy 248.459529 208.819994) (xy 248.459529 208.820005) + (xy 248.479379 209.059559) (xy 248.538389 209.292589) (xy 248.634951 209.512729) (xy 248.766427 209.713966) + (xy 248.766429 209.713969) (xy 248.929236 209.890825) (xy 248.929239 209.890827) (xy 248.929242 209.89083) + (xy 249.118924 210.038466) (xy 249.11893 210.03847) (xy 249.118933 210.038472) (xy 249.330344 210.152882) + (xy 249.347208 210.158671) (xy 249.557699 210.230933) (xy 249.557701 210.230933) (xy 249.557703 210.230934) + (xy 249.794808 210.2705) (xy 249.794809 210.2705) (xy 250.035191 210.2705) (xy 250.035192 210.2705) + (xy 250.272297 210.230934) (xy 250.499656 210.152882) (xy 250.711067 210.038472) (xy 250.728988 210.024524) + (xy 250.775315 209.988466) (xy 250.900764 209.890825) (xy 251.063571 209.713969) (xy 251.195049 209.512728) + (xy 251.262444 209.359081) (xy 251.3074 209.305596) (xy 251.374136 209.284906) (xy 251.441464 209.30358) + (xy 251.488007 209.355691) (xy 251.5 209.408892) (xy 251.5 213.5) (xy 268.5 213.5) (xy 268.5 213) + (xy 252.124 213) (xy 252.056961 212.980315) (xy 252.011206 212.927511) (xy 252 212.876) (xy 252 209.719999) + (xy 256.654722 209.719999) (xy 256.654722 209.72) (xy 256.673762 209.876818) (xy 256.717 209.990825) + (xy 256.72978 210.024523) (xy 256.819517 210.15453) (xy 256.93776 210.259283) (xy 256.937762 210.259284) + (xy 257.077634 210.332696) (xy 257.231014 210.3705) (xy 257.231015 210.3705) (xy 257.388985 210.3705) + (xy 257.542365 210.332696) (xy 257.545724 210.330933) (xy 257.68224 210.259283) (xy 257.800483 210.15453) + (xy 257.89022 210.024523) (xy 257.946237 209.876818) (xy 257.965278 209.72) (xy 257.946237 209.563182) + (xy 257.945302 209.560717) (xy 257.903123 209.4495) (xy 257.89022 209.415477) (xy 257.800483 209.28547) + (xy 257.68224 209.180717) (xy 257.682238 209.180716) (xy 257.682237 209.180715) (xy 257.542365 209.107303) + (xy 257.388986 209.0695) (xy 257.388985 209.0695) (xy 257.231015 209.0695) (xy 257.231014 209.0695) + (xy 257.077634 209.107303) (xy 256.937762 209.180715) (xy 256.819516 209.285471) (xy 256.729781 209.415475) + (xy 256.72978 209.415476) (xy 256.673762 209.563181) (xy 256.654722 209.719999) (xy 252 209.719999) + (xy 252 205.899999) (xy 253.544722 205.899999) (xy 253.544722 205.9) (xy 253.563762 206.056818) (xy 253.608403 206.174524) (xy 253.61978 206.204523) (xy 253.709517 206.33453) (xy 253.82776 206.439283) (xy 253.827762 206.439284) (xy 253.967634 206.512696) (xy 254.121014 206.5505) (xy 254.121015 206.5505) (xy 254.278985 206.5505) (xy 254.432365 206.512696) (xy 254.489524 206.482696) (xy 254.57224 206.439283) (xy 254.690483 206.33453) (xy 254.78022 206.204523) (xy 254.836237 206.056818) (xy 254.855278 205.9) (xy 254.836237 205.743182) (xy 254.78022 205.595477) (xy 254.762634 205.569999) (xy 261.584722 205.569999) - (xy 261.584722 205.57) (xy 261.603762 205.726818) (xy 261.658064 205.869999) (xy 261.65978 205.874523) + (xy 261.584722 205.57) (xy 261.603762 205.726818) (xy 261.647894 205.843182) (xy 261.65978 205.874523) (xy 261.749517 206.00453) (xy 261.86776 206.109283) (xy 261.867762 206.109284) (xy 262.007634 206.182696) (xy 262.161014 206.2205) (xy 262.161015 206.2205) (xy 262.318985 206.2205) (xy 262.472365 206.182696) (xy 262.487937 206.174523) (xy 262.61224 206.109283) (xy 262.730483 206.00453) (xy 262.82022 205.874523) @@ -170694,7 +175185,7 @@ (xy 263.878986 204.8495) (xy 263.878985 204.8495) (xy 263.721015 204.8495) (xy 263.721014 204.8495) (xy 263.567634 204.887303) (xy 263.427762 204.960715) (xy 263.309516 205.065471) (xy 263.219781 205.195475) (xy 263.21978 205.195476) (xy 263.163762 205.343181) (xy 263.144722 205.499999) (xy 262.886779 205.499999) - (xy 262.876237 205.413181) (xy 262.854992 205.357164) (xy 262.82022 205.265477) (xy 262.730483 205.13547) + (xy 262.876237 205.413181) (xy 262.852086 205.3495) (xy 262.82022 205.265477) (xy 262.730483 205.13547) (xy 262.61224 205.030717) (xy 262.612238 205.030716) (xy 262.612237 205.030715) (xy 262.472365 204.957303) (xy 262.318986 204.9195) (xy 262.318985 204.9195) (xy 262.161015 204.9195) (xy 262.161014 204.9195) (xy 262.007634 204.957303) (xy 261.867762 205.030715) (xy 261.749516 205.135471) (xy 261.659781 205.265475) @@ -171281,9 +175772,9 @@ (xy 187.971462 157.187696) (xy 187.972733 157.187029) (xy 188.111337 157.114283) (xy 188.22958 157.00953) (xy 188.319317 156.879523) (xy 188.375334 156.731818) (xy 188.394375 156.575) (xy 188.375334 156.418182) (xy 188.319317 156.270477) (xy 188.232664 156.144938) (xy 188.210782 156.078586) (xy 188.228247 156.010934) - (xy 188.279515 155.963464) (xy 188.334715 155.9505) (xy 188.478985 155.9505) (xy 188.632365 155.912696) - (xy 188.651155 155.902834) (xy 188.77224 155.839283) (xy 188.890483 155.73453) (xy 188.98022 155.604523) - (xy 189.036237 155.456818) (xy 189.046756 155.370189) (xy 192.174532 155.370189) (xy 192.174532 155.37019) + (xy 188.279515 155.963464) (xy 188.334715 155.9505) (xy 188.478983 155.9505) (xy 188.632363 155.912696) + (xy 188.651153 155.902834) (xy 188.772238 155.839283) (xy 188.890481 155.73453) (xy 188.980218 155.604523) + (xy 189.036235 155.456818) (xy 189.046754 155.370189) (xy 192.174532 155.370189) (xy 192.174532 155.37019) (xy 192.193572 155.527008) (xy 192.225921 155.612303) (xy 192.24959 155.674713) (xy 192.339327 155.80472) (xy 192.45757 155.909473) (xy 192.457572 155.909474) (xy 192.597444 155.982886) (xy 192.750824 156.02069) (xy 192.750825 156.02069) (xy 192.908795 156.02069) (xy 193.062175 155.982886) (xy 193.101392 155.962303) @@ -171321,15 +175812,15 @@ (xy 193.202047 154.830905) (xy 193.062175 154.757493) (xy 192.908796 154.71969) (xy 192.908795 154.71969) (xy 192.750825 154.71969) (xy 192.750824 154.71969) (xy 192.597444 154.757493) (xy 192.457572 154.830905) (xy 192.339326 154.935661) (xy 192.249591 155.065665) (xy 192.24959 155.065666) (xy 192.193572 155.213371) - (xy 192.174532 155.370189) (xy 189.046756 155.370189) (xy 189.055278 155.3) (xy 189.04476 155.213371) - (xy 189.036237 155.143181) (xy 189.006839 155.065665) (xy 188.98022 154.995477) (xy 188.890483 154.86547) - (xy 188.77224 154.760717) (xy 188.772238 154.760716) (xy 188.772237 154.760715) (xy 188.632365 154.687303) - (xy 188.478986 154.6495) (xy 188.478985 154.6495) (xy 188.321015 154.6495) (xy 188.321014 154.6495) - (xy 188.167634 154.687303) (xy 188.027762 154.760715) (xy 187.909516 154.865471) (xy 187.819781 154.995475) - (xy 187.81978 154.995476) (xy 187.763762 155.143181) (xy 187.744722 155.299999) (xy 187.744722 155.3) - (xy 187.763762 155.456818) (xy 187.795038 155.539284) (xy 187.81978 155.604523) (xy 187.882559 155.695475) - (xy 187.906432 155.73006) (xy 187.928315 155.796414) (xy 187.91085 155.864066) (xy 187.859582 155.911536) - (xy 187.804382 155.9245) (xy 187.660111 155.9245) (xy 187.506731 155.962303) (xy 187.366859 156.035715) + (xy 192.174532 155.370189) (xy 189.046754 155.370189) (xy 189.055276 155.3) (xy 189.044758 155.213371) + (xy 189.036235 155.143181) (xy 189.006837 155.065665) (xy 188.980218 154.995477) (xy 188.890481 154.86547) + (xy 188.772238 154.760717) (xy 188.772236 154.760716) (xy 188.772235 154.760715) (xy 188.632363 154.687303) + (xy 188.478984 154.6495) (xy 188.478983 154.6495) (xy 188.321013 154.6495) (xy 188.321012 154.6495) + (xy 188.167632 154.687303) (xy 188.02776 154.760715) (xy 187.909514 154.865471) (xy 187.819779 154.995475) + (xy 187.819778 154.995476) (xy 187.76376 155.143181) (xy 187.74472 155.299999) (xy 187.74472 155.3) + (xy 187.76376 155.456818) (xy 187.795036 155.539284) (xy 187.819778 155.604523) (xy 187.882557 155.695475) + (xy 187.90643 155.73006) (xy 187.928313 155.796414) (xy 187.910848 155.864066) (xy 187.85958 155.911536) + (xy 187.80438 155.9245) (xy 187.660111 155.9245) (xy 187.506731 155.962303) (xy 187.366859 156.035715) (xy 187.248613 156.140471) (xy 187.158878 156.270475) (xy 187.158877 156.270476) (xy 187.102859 156.418181) (xy 187.083819 156.574999) (xy 187.083819 156.575) (xy 187.102859 156.731818) (xy 187.15026 156.856801) (xy 187.155627 156.926464) (xy 187.12248 156.98797) (xy 187.061342 157.021792) (xy 186.991624 157.01719) @@ -171505,11 +175996,11 @@ (xy 181.309517 153.73453) (xy 181.42776 153.839283) (xy 181.427762 153.839284) (xy 181.567634 153.912696) (xy 181.721014 153.9505) (xy 181.721015 153.9505) (xy 181.878985 153.9505) (xy 182.032365 153.912696) (xy 182.039859 153.908763) (xy 182.17224 153.839283) (xy 182.290483 153.73453) (xy 182.34883 153.649999) - (xy 187.794722 153.649999) (xy 187.794722 153.65) (xy 187.813762 153.806818) (xy 187.864 153.939283) - (xy 187.86978 153.954523) (xy 187.959517 154.08453) (xy 188.07776 154.189283) (xy 188.077762 154.189284) - (xy 188.217634 154.262696) (xy 188.371014 154.3005) (xy 188.371015 154.3005) (xy 188.528985 154.3005) - (xy 188.682365 154.262696) (xy 188.82224 154.189283) (xy 188.940483 154.08453) (xy 189.03022 153.954523) - (xy 189.086237 153.806818) (xy 189.086938 153.801041) (xy 200.322979 153.801041) (xy 200.342295 153.99717) + (xy 187.744722 153.649999) (xy 187.744722 153.65) (xy 187.763762 153.806818) (xy 187.814 153.939283) + (xy 187.81978 153.954523) (xy 187.909517 154.08453) (xy 188.02776 154.189283) (xy 188.027762 154.189284) + (xy 188.167634 154.262696) (xy 188.321014 154.3005) (xy 188.321015 154.3005) (xy 188.478985 154.3005) + (xy 188.632365 154.262696) (xy 188.77224 154.189283) (xy 188.890483 154.08453) (xy 188.98022 153.954523) + (xy 189.036237 153.806818) (xy 189.036938 153.801041) (xy 200.322979 153.801041) (xy 200.342295 153.99717) (xy 200.342296 153.997173) (xy 200.373808 154.101055) (xy 200.399508 154.185774) (xy 200.492406 154.359573) (xy 200.49241 154.35958) (xy 200.617436 154.511924) (xy 200.76978 154.63695) (xy 200.769787 154.636954) (xy 200.943586 154.729852) (xy 200.943589 154.729852) (xy 200.943593 154.729855) (xy 201.132188 154.787065) @@ -171521,13 +176012,13 @@ (xy 201.713053 152.872229) (xy 201.713047 152.872227) (xy 201.524452 152.815017) (xy 201.524449 152.815016) (xy 201.32832 152.7957) (xy 201.13219 152.815016) (xy 200.943586 152.872229) (xy 200.769787 152.965127) (xy 200.76978 152.965131) (xy 200.617436 153.090157) (xy 200.49241 153.242501) (xy 200.492406 153.242508) - (xy 200.399508 153.416307) (xy 200.342295 153.604911) (xy 200.322979 153.801041) (xy 189.086938 153.801041) - (xy 189.105278 153.65) (xy 189.0915 153.536522) (xy 189.086237 153.493181) (xy 189.053369 153.406517) - (xy 189.03022 153.345477) (xy 188.940483 153.21547) (xy 188.82224 153.110717) (xy 188.822238 153.110716) - (xy 188.822237 153.110715) (xy 188.682365 153.037303) (xy 188.528986 152.9995) (xy 188.528985 152.9995) - (xy 188.371015 152.9995) (xy 188.371014 152.9995) (xy 188.217634 153.037303) (xy 188.077762 153.110715) - (xy 187.959516 153.215471) (xy 187.869781 153.345475) (xy 187.86978 153.345476) (xy 187.813762 153.493181) - (xy 187.794722 153.649999) (xy 182.34883 153.649999) (xy 182.38022 153.604523) (xy 182.436237 153.456818) + (xy 200.399508 153.416307) (xy 200.342295 153.604911) (xy 200.322979 153.801041) (xy 189.036938 153.801041) + (xy 189.055278 153.65) (xy 189.0415 153.536522) (xy 189.036237 153.493181) (xy 189.003369 153.406517) + (xy 188.98022 153.345477) (xy 188.890483 153.21547) (xy 188.77224 153.110717) (xy 188.772238 153.110716) + (xy 188.772237 153.110715) (xy 188.632365 153.037303) (xy 188.478986 152.9995) (xy 188.478985 152.9995) + (xy 188.321015 152.9995) (xy 188.321014 152.9995) (xy 188.167634 153.037303) (xy 188.027762 153.110715) + (xy 187.909516 153.215471) (xy 187.819781 153.345475) (xy 187.81978 153.345476) (xy 187.763762 153.493181) + (xy 187.744722 153.649999) (xy 182.34883 153.649999) (xy 182.38022 153.604523) (xy 182.436237 153.456818) (xy 182.455278 153.3) (xy 182.454525 153.293794) (xy 182.436237 153.143181) (xy 182.406765 153.06547) (xy 182.38022 152.995477) (xy 182.290483 152.86547) (xy 182.17224 152.760717) (xy 182.172238 152.760716) (xy 182.172237 152.760715) (xy 182.032365 152.687303) (xy 181.878986 152.6495) (xy 181.878985 152.6495) @@ -173298,465 +177789,466 @@ (xy 166.575341 117.892118) (xy 166.363929 118.006529) (xy 166.363923 118.006533) (xy 166.174241 118.154169) (xy 166.174238 118.154172) (xy 166.011429 118.331029) (xy 166.011426 118.331033) (xy 165.87995 118.53227) (xy 165.783388 118.75241) (xy 165.724378 118.98544) (xy 165.704528 119.224994) (xy 112.3005 119.224994) - (xy 112.3005 115.299999) (xy 113.744722 115.299999) (xy 113.744722 115.3) (xy 113.763762 115.456818) - (xy 113.812542 115.585437) (xy 113.81978 115.604523) (xy 113.909517 115.73453) (xy 114.02776 115.839283) - (xy 114.027762 115.839284) (xy 114.167634 115.912696) (xy 114.233585 115.92895) (xy 114.286229 115.941926) - (xy 114.34661 115.977082) (xy 114.378399 116.039301) (xy 114.371504 116.108829) (xy 114.328113 116.163592) - (xy 114.286233 116.182719) (xy 114.267635 116.187303) (xy 114.267634 116.187303) (xy 114.127762 116.260715) - (xy 114.088526 116.295475) (xy 114.019181 116.356909) (xy 114.009516 116.365471) (xy 113.919781 116.495475) - (xy 113.91978 116.495476) (xy 113.863762 116.643181) (xy 113.844722 116.799999) (xy 113.844722 116.8) - (xy 113.863762 116.956818) (xy 113.898979 117.049676) (xy 113.91978 117.104523) (xy 114.009517 117.23453) - (xy 114.12776 117.339283) (xy 114.127762 117.339284) (xy 114.267634 117.412696) (xy 114.421014 117.4505) - (xy 114.421015 117.4505) (xy 114.578985 117.4505) (xy 114.732365 117.412696) (xy 114.87224 117.339283) - (xy 114.990483 117.23453) (xy 115.08022 117.104523) (xy 115.136237 116.956818) (xy 115.155278 116.8) - (xy 115.140497 116.678262) (xy 115.136237 116.643181) (xy 115.114992 116.587164) (xy 115.08022 116.495477) - (xy 114.990483 116.36547) (xy 114.87224 116.260717) (xy 114.872238 116.260716) (xy 114.872237 116.260715) - (xy 114.732366 116.187304) (xy 114.613769 116.158073) (xy 114.553389 116.122917) (xy 114.5216 116.060698) - (xy 114.528496 115.991169) (xy 114.571887 115.936406) (xy 114.613771 115.917279) (xy 114.632365 115.912696) - (xy 114.77224 115.839283) (xy 114.890483 115.73453) (xy 114.98022 115.604523) (xy 115.036237 115.456818) - (xy 115.046172 115.374999) (xy 133.044722 115.374999) (xy 133.044722 115.375) (xy 133.063762 115.531818) - (xy 133.11978 115.679523) (xy 133.157747 115.734528) (xy 133.209515 115.809528) (xy 133.209517 115.80953) - (xy 133.226979 115.825) (xy 133.305637 115.894684) (xy 133.342764 115.953874) (xy 133.341996 116.023739) - (xy 133.305637 116.080316) (xy 133.209516 116.16547) (xy 133.119781 116.295475) (xy 133.11978 116.295476) - (xy 133.063762 116.443181) (xy 133.044722 116.599999) (xy 133.044722 116.6) (xy 133.063762 116.756818) - (xy 133.101175 116.855466) (xy 133.11978 116.904523) (xy 133.209517 117.03453) (xy 133.32776 117.139283) - (xy 133.327762 117.139284) (xy 133.467634 117.212696) (xy 133.621014 117.2505) (xy 133.621015 117.2505) - (xy 133.778985 117.2505) (xy 133.932365 117.212696) (xy 133.956568 117.199993) (xy 134.07224 117.139283) - (xy 134.190483 117.03453) (xy 134.28022 116.904523) (xy 134.336237 116.756818) (xy 134.355278 116.6) - (xy 134.345289 116.517728) (xy 134.336237 116.443181) (xy 134.303518 116.356909) (xy 134.28022 116.295477) - (xy 134.190483 116.16547) (xy 134.09436 116.080314) (xy 134.057236 116.021127) (xy 134.058003 115.951261) - (xy 134.09436 115.894685) (xy 134.173027 115.824994) (xy 165.704528 115.824994) (xy 165.704528 115.825005) - (xy 165.724378 116.064559) (xy 165.783388 116.297589) (xy 165.87995 116.517729) (xy 166.009133 116.715456) - (xy 166.011428 116.718969) (xy 166.174235 116.895825) (xy 166.174238 116.895827) (xy 166.174241 116.89583) - (xy 166.363923 117.043466) (xy 166.363929 117.04347) (xy 166.363932 117.043472) (xy 166.575343 117.157882) - (xy 166.575346 117.157883) (xy 166.802698 117.235933) (xy 166.8027 117.235933) (xy 166.802702 117.235934) - (xy 167.039807 117.2755) (xy 167.039808 117.2755) (xy 167.28019 117.2755) (xy 167.280191 117.2755) - (xy 167.517296 117.235934) (xy 167.744655 117.157882) (xy 167.956066 117.043472) (xy 167.963124 117.037979) - (xy 168.019767 116.993891) (xy 168.145763 116.895825) (xy 168.30857 116.718969) (xy 168.440048 116.517728) - (xy 168.536609 116.297591) (xy 168.595619 116.064563) (xy 168.607004 115.927168) (xy 168.61547 115.825005) - (xy 168.61547 115.824994) (xy 168.602236 115.665291) (xy 168.595619 115.585437) (xy 168.536609 115.352409) - (xy 168.440048 115.132272) (xy 168.399674 115.070476) (xy 168.350674 114.995476) (xy 168.30857 114.931031) - (xy 168.145763 114.754175) (xy 168.145758 114.754171) (xy 168.145756 114.754169) (xy 167.956074 114.606533) - (xy 167.956068 114.606529) (xy 167.944597 114.600321) (xy 179.179499 114.600321) (xy 179.179499 117.049678) - (xy 179.194031 117.122735) (xy 179.194032 117.122739) (xy 179.194033 117.12274) (xy 179.249398 117.205601) - (xy 179.332259 117.260966) (xy 179.332263 117.260967) (xy 179.40532 117.275499) (xy 179.405323 117.2755) - (xy 179.405325 117.2755) (xy 181.854675 117.2755) (xy 181.854676 117.275499) (xy 181.927739 117.260966) - (xy 182.0106 117.205601) (xy 182.065965 117.12274) (xy 182.080499 117.049674) (xy 182.080499 115.699993) - (xy 257.269786 115.699993) (xy 257.269786 115.700006) (xy 257.288608 115.927168) (xy 257.28861 115.927179) - (xy 257.344569 116.148155) (xy 257.436137 116.356908) (xy 257.560814 116.547742) (xy 257.560817 116.547745) - (xy 257.680966 116.678262) (xy 257.715208 116.715458) (xy 257.715212 116.715461) (xy 257.89509 116.855466) - (xy 257.895094 116.855469) (xy 257.895096 116.85547) (xy 257.895099 116.855472) (xy 257.969669 116.895827) - (xy 258.095574 116.963963) (xy 258.207529 117.002397) (xy 258.311173 117.037979) (xy 258.311175 117.037979) - (xy 258.311177 117.03798) (xy 258.536023 117.0755) (xy 258.536024 117.0755) (xy 258.763976 117.0755) - (xy 258.763977 117.0755) (xy 258.988823 117.03798) (xy 259.204426 116.963963) (xy 259.404906 116.855469) - (xy 259.584794 116.715456) (xy 259.62422 116.672627) (xy 259.684105 116.636639) (xy 259.753943 116.638739) - (xy 259.811559 116.678262) (xy 259.838661 116.742662) (xy 259.835654 116.787052) (xy 259.78861 116.97282) - (xy 259.788608 116.972831) (xy 259.769786 117.199993) (xy 259.769786 117.200006) (xy 259.788608 117.427168) - (xy 259.78861 117.427176) (xy 259.794516 117.4505) (xy 259.835654 117.612946) (xy 259.833029 117.682767) - (xy 259.793073 117.740084) (xy 259.728472 117.766701) (xy 259.659736 117.754167) (xy 259.624219 117.727371) - (xy 259.584794 117.684544) (xy 259.584789 117.68454) (xy 259.584787 117.684538) (xy 259.404909 117.544533) - (xy 259.4049 117.544527) (xy 259.204432 117.43604) (xy 259.204429 117.436039) (xy 259.204426 117.436037) - (xy 259.20442 117.436035) (xy 259.204418 117.436034) (xy 258.988826 117.36202) (xy 258.820188 117.33388) - (xy 258.763977 117.3245) (xy 258.536023 117.3245) (xy 258.491053 117.332004) (xy 258.311173 117.36202) - (xy 258.095581 117.436034) (xy 258.095567 117.43604) (xy 257.895099 117.544527) (xy 257.89509 117.544533) - (xy 257.715212 117.684538) (xy 257.715208 117.684541) (xy 257.560814 117.852257) (xy 257.436137 118.043091) - (xy 257.344569 118.251844) (xy 257.28861 118.47282) (xy 257.288608 118.472831) (xy 257.269786 118.699993) - (xy 257.269786 118.700006) (xy 257.288608 118.927168) (xy 257.28861 118.927179) (xy 257.344569 119.148155) - (xy 257.436137 119.356908) (xy 257.560814 119.547742) (xy 257.560817 119.547745) (xy 257.680966 119.678262) - (xy 257.715208 119.715458) (xy 257.715212 119.715461) (xy 257.895094 119.855469) (xy 257.895096 119.85547) - (xy 257.895099 119.855472) (xy 258.010139 119.917728) (xy 258.095574 119.963963) (xy 258.163584 119.987311) - (xy 258.311173 120.037979) (xy 258.311175 120.037979) (xy 258.311177 120.03798) (xy 258.536023 120.0755) - (xy 258.536024 120.0755) (xy 258.763976 120.0755) (xy 258.763977 120.0755) (xy 258.988823 120.03798) - (xy 259.204426 119.963963) (xy 259.404906 119.855469) (xy 259.584794 119.715456) (xy 259.62422 119.672627) - (xy 259.684105 119.636639) (xy 259.753943 119.638739) (xy 259.811559 119.678262) (xy 259.838661 119.742662) - (xy 259.835654 119.787052) (xy 259.78861 119.97282) (xy 259.788608 119.972831) (xy 259.769786 120.199993) - (xy 259.769786 120.200006) (xy 259.788608 120.427168) (xy 259.78861 120.427176) (xy 259.832377 120.600008) - (xy 259.835654 120.612946) (xy 259.833029 120.682767) (xy 259.793073 120.740084) (xy 259.728472 120.766701) - (xy 259.659736 120.754167) (xy 259.624219 120.727371) (xy 259.584794 120.684544) (xy 259.584789 120.68454) - (xy 259.584787 120.684538) (xy 259.404909 120.544533) (xy 259.4049 120.544527) (xy 259.204432 120.43604) - (xy 259.204429 120.436039) (xy 259.204426 120.436037) (xy 259.20442 120.436035) (xy 259.204418 120.436034) - (xy 258.988826 120.36202) (xy 258.820188 120.33388) (xy 258.763977 120.3245) (xy 258.536023 120.3245) - (xy 258.491053 120.332004) (xy 258.311173 120.36202) (xy 258.095581 120.436034) (xy 258.095567 120.43604) - (xy 257.895099 120.544527) (xy 257.89509 120.544533) (xy 257.715212 120.684538) (xy 257.715208 120.684541) - (xy 257.560814 120.852257) (xy 257.436137 121.043091) (xy 257.344569 121.251844) (xy 257.28861 121.47282) - (xy 257.288608 121.472831) (xy 257.269786 121.699993) (xy 257.269786 121.700006) (xy 257.288608 121.927168) - (xy 257.28861 121.927179) (xy 257.344569 122.148155) (xy 257.436137 122.356908) (xy 257.560814 122.547742) - (xy 257.560817 122.547745) (xy 257.680966 122.678262) (xy 257.715208 122.715458) (xy 257.715212 122.715461) - (xy 257.839636 122.812304) (xy 257.895094 122.855469) (xy 257.895096 122.85547) (xy 257.895099 122.855472) - (xy 258.011646 122.918543) (xy 258.095574 122.963963) (xy 258.172786 122.99047) (xy 258.311173 123.037979) - (xy 258.311175 123.037979) (xy 258.311177 123.03798) (xy 258.536023 123.0755) (xy 258.536024 123.0755) - (xy 258.763976 123.0755) (xy 258.763977 123.0755) (xy 258.988823 123.03798) (xy 259.204426 122.963963) - (xy 259.404906 122.855469) (xy 259.584794 122.715456) (xy 259.62422 122.672627) (xy 259.684105 122.636639) - (xy 259.753943 122.638739) (xy 259.811559 122.678262) (xy 259.838661 122.742662) (xy 259.835654 122.787052) - (xy 259.78861 122.97282) (xy 259.788608 122.972831) (xy 259.769786 123.199993) (xy 259.769786 123.200006) - (xy 259.788608 123.427168) (xy 259.78861 123.427176) (xy 259.808087 123.50409) (xy 259.835654 123.612946) - (xy 259.833029 123.682767) (xy 259.793073 123.740084) (xy 259.728472 123.766701) (xy 259.659736 123.754167) - (xy 259.624219 123.727371) (xy 259.584794 123.684544) (xy 259.584789 123.68454) (xy 259.584787 123.684538) - (xy 259.404909 123.544533) (xy 259.4049 123.544527) (xy 259.204432 123.43604) (xy 259.204429 123.436039) - (xy 259.204426 123.436037) (xy 259.20442 123.436035) (xy 259.204418 123.436034) (xy 258.988826 123.36202) - (xy 258.820188 123.33388) (xy 258.763977 123.3245) (xy 258.536023 123.3245) (xy 258.491053 123.332004) - (xy 258.311173 123.36202) (xy 258.095581 123.436034) (xy 258.095567 123.43604) (xy 257.895099 123.544527) - (xy 257.89509 123.544533) (xy 257.715212 123.684538) (xy 257.715208 123.684541) (xy 257.560814 123.852257) - (xy 257.436137 124.043091) (xy 257.344569 124.251844) (xy 257.28861 124.47282) (xy 257.288608 124.472831) - (xy 257.269786 124.699993) (xy 257.269786 124.700006) (xy 257.288608 124.927168) (xy 257.28861 124.927179) - (xy 257.344569 125.148155) (xy 257.436137 125.356908) (xy 257.560814 125.547742) (xy 257.560817 125.547745) - (xy 257.680966 125.678262) (xy 257.715208 125.715458) (xy 257.715212 125.715461) (xy 257.89509 125.855466) - (xy 257.895094 125.855469) (xy 257.895096 125.85547) (xy 257.895099 125.855472) (xy 257.904791 125.860717) - (xy 258.095574 125.963963) (xy 258.207529 126.002397) (xy 258.311173 126.037979) (xy 258.311175 126.037979) - (xy 258.311177 126.03798) (xy 258.536023 126.0755) (xy 258.536024 126.0755) (xy 258.763976 126.0755) - (xy 258.763977 126.0755) (xy 258.988823 126.03798) (xy 259.204426 125.963963) (xy 259.404906 125.855469) - (xy 259.584794 125.715456) (xy 259.62422 125.672627) (xy 259.684105 125.636639) (xy 259.753943 125.638739) - (xy 259.811559 125.678262) (xy 259.838661 125.742662) (xy 259.835654 125.787052) (xy 259.78861 125.97282) - (xy 259.788608 125.972831) (xy 259.769786 126.199993) (xy 259.769786 126.200006) (xy 259.788608 126.427168) - (xy 259.78861 126.427176) (xy 259.831229 126.595475) (xy 259.835654 126.612946) (xy 259.833029 126.682767) - (xy 259.793073 126.740084) (xy 259.728472 126.766701) (xy 259.659736 126.754167) (xy 259.624219 126.727371) - (xy 259.617818 126.720418) (xy 259.584794 126.684544) (xy 259.584789 126.68454) (xy 259.584787 126.684538) - (xy 259.404909 126.544533) (xy 259.4049 126.544527) (xy 259.204432 126.43604) (xy 259.204429 126.436039) - (xy 259.204426 126.436037) (xy 259.20442 126.436035) (xy 259.204418 126.436034) (xy 258.988826 126.36202) - (xy 258.820188 126.33388) (xy 258.763977 126.3245) (xy 258.536023 126.3245) (xy 258.491053 126.332004) - (xy 258.311173 126.36202) (xy 258.095581 126.436034) (xy 258.095567 126.43604) (xy 257.895099 126.544527) - (xy 257.89509 126.544533) (xy 257.715212 126.684538) (xy 257.715208 126.684541) (xy 257.560814 126.852257) - (xy 257.436137 127.043091) (xy 257.344569 127.251844) (xy 257.28861 127.47282) (xy 257.288608 127.472831) - (xy 257.269786 127.699993) (xy 257.269786 127.700006) (xy 257.288608 127.927168) (xy 257.28861 127.927179) - (xy 257.344569 128.148155) (xy 257.436137 128.356908) (xy 257.560814 128.547742) (xy 257.604757 128.595477) - (xy 257.680966 128.678262) (xy 257.715208 128.715458) (xy 257.715212 128.715461) (xy 257.773357 128.760717) - (xy 257.895094 128.855469) (xy 257.895096 128.85547) (xy 257.895099 128.855472) (xy 257.977378 128.899999) - (xy 258.095574 128.963963) (xy 258.156075 128.984733) (xy 258.311173 129.037979) (xy 258.311175 129.037979) - (xy 258.311177 129.03798) (xy 258.536023 129.0755) (xy 258.536024 129.0755) (xy 258.763976 129.0755) - (xy 258.763977 129.0755) (xy 258.988823 129.03798) (xy 259.204426 128.963963) (xy 259.404906 128.855469) - (xy 259.584794 128.715456) (xy 259.62422 128.672627) (xy 259.684105 128.636639) (xy 259.753943 128.638739) - (xy 259.811559 128.678262) (xy 259.838661 128.742662) (xy 259.835654 128.787052) (xy 259.78861 128.97282) - (xy 259.788608 128.972831) (xy 259.769786 129.199993) (xy 259.769786 129.200006) (xy 259.788608 129.427168) - (xy 259.78861 129.427176) (xy 259.833831 129.60575) (xy 259.835654 129.612946) (xy 259.833029 129.682767) - (xy 259.793073 129.740084) (xy 259.728472 129.766701) (xy 259.659736 129.754167) (xy 259.624219 129.727371) - (xy 259.614504 129.716818) (xy 259.584794 129.684544) (xy 259.584789 129.68454) (xy 259.584787 129.684538) - (xy 259.404909 129.544533) (xy 259.4049 129.544527) (xy 259.204432 129.43604) (xy 259.204429 129.436039) - (xy 259.204426 129.436037) (xy 259.20442 129.436035) (xy 259.204418 129.436034) (xy 258.988826 129.36202) - (xy 258.820188 129.33388) (xy 258.763977 129.3245) (xy 258.536023 129.3245) (xy 258.491053 129.332004) - (xy 258.311173 129.36202) (xy 258.095581 129.436034) (xy 258.095567 129.43604) (xy 257.895099 129.544527) - (xy 257.89509 129.544533) (xy 257.715212 129.684538) (xy 257.715208 129.684541) (xy 257.560814 129.852257) - (xy 257.436137 130.043091) (xy 257.344569 130.251844) (xy 257.28861 130.47282) (xy 257.288608 130.472831) - (xy 257.269786 130.699993) (xy 257.269786 130.700006) (xy 257.288608 130.927168) (xy 257.28861 130.927179) - (xy 257.344569 131.148155) (xy 257.436137 131.356908) (xy 257.560814 131.547742) (xy 257.604757 131.595477) - (xy 257.705142 131.704524) (xy 257.715208 131.715458) (xy 257.715212 131.715461) (xy 257.870638 131.836434) - (xy 257.895094 131.855469) (xy 257.895096 131.85547) (xy 257.895099 131.855472) (xy 257.930589 131.874678) - (xy 258.095574 131.963963) (xy 258.207529 132.002397) (xy 258.311173 132.037979) (xy 258.311175 132.037979) - (xy 258.311177 132.03798) (xy 258.536023 132.0755) (xy 258.536024 132.0755) (xy 258.763976 132.0755) - (xy 258.763977 132.0755) (xy 258.988823 132.03798) (xy 259.204426 131.963963) (xy 259.404906 131.855469) - (xy 259.584794 131.715456) (xy 259.62422 131.672627) (xy 259.684105 131.636639) (xy 259.753943 131.638739) - (xy 259.811559 131.678262) (xy 259.838661 131.742662) (xy 259.835654 131.787052) (xy 259.78861 131.97282) - (xy 259.788608 131.972831) (xy 259.769786 132.199993) (xy 259.769786 132.200006) (xy 259.788608 132.427168) - (xy 259.78861 132.427176) (xy 259.822427 132.560717) (xy 259.835654 132.612946) (xy 259.833029 132.682767) - (xy 259.793073 132.740084) (xy 259.728472 132.766701) (xy 259.659736 132.754167) (xy 259.624219 132.727371) - (xy 259.61903 132.721734) (xy 259.584794 132.684544) (xy 259.584789 132.68454) (xy 259.584787 132.684538) - (xy 259.404909 132.544533) (xy 259.4049 132.544527) (xy 259.204432 132.43604) (xy 259.204429 132.436039) - (xy 259.204426 132.436037) (xy 259.20442 132.436035) (xy 259.204418 132.436034) (xy 258.988826 132.36202) - (xy 258.820188 132.33388) (xy 258.763977 132.3245) (xy 258.536023 132.3245) (xy 258.491053 132.332004) - (xy 258.311173 132.36202) (xy 258.095581 132.436034) (xy 258.095567 132.43604) (xy 257.895099 132.544527) - (xy 257.89509 132.544533) (xy 257.715212 132.684538) (xy 257.715208 132.684541) (xy 257.560814 132.852257) - (xy 257.436137 133.043091) (xy 257.344569 133.251844) (xy 257.28861 133.47282) (xy 257.288608 133.472831) - (xy 257.269786 133.699993) (xy 257.269786 133.700006) (xy 257.288608 133.927168) (xy 257.28861 133.927179) - (xy 257.344569 134.148155) (xy 257.436137 134.356908) (xy 257.560814 134.547742) (xy 257.715208 134.715458) - (xy 257.715212 134.715461) (xy 257.779465 134.765471) (xy 257.895094 134.855469) (xy 257.895096 134.85547) - (xy 257.895099 134.855472) (xy 258.011646 134.918543) (xy 258.095574 134.963963) (xy 258.207529 135.002397) - (xy 258.311173 135.037979) (xy 258.311175 135.037979) (xy 258.311177 135.03798) (xy 258.536023 135.0755) - (xy 258.536024 135.0755) (xy 258.763976 135.0755) (xy 258.763977 135.0755) (xy 258.988823 135.03798) - (xy 259.204426 134.963963) (xy 259.404906 134.855469) (xy 259.584794 134.715456) (xy 259.739183 134.547745) - (xy 259.863862 134.356909) (xy 259.95543 134.148155) (xy 260.01139 133.927176) (xy 260.011391 133.927168) - (xy 260.030214 133.700006) (xy 260.030214 133.699993) (xy 260.011391 133.472831) (xy 260.011387 133.472811) - (xy 259.964346 133.287053) (xy 259.96697 133.217233) (xy 260.006926 133.159915) (xy 260.071527 133.133298) - (xy 260.140263 133.145832) (xy 260.17578 133.172628) (xy 260.215206 133.215456) (xy 260.215209 133.215458) - (xy 260.215212 133.215461) (xy 260.389689 133.351262) (xy 260.395094 133.355469) (xy 260.395096 133.35547) - (xy 260.395099 133.355472) (xy 260.477378 133.399999) (xy 260.595574 133.463963) (xy 260.661781 133.486692) - (xy 260.811173 133.537979) (xy 260.811175 133.537979) (xy 260.811177 133.53798) (xy 261.036023 133.5755) - (xy 261.036024 133.5755) (xy 261.263976 133.5755) (xy 261.263977 133.5755) (xy 261.488823 133.53798) - (xy 261.704426 133.463963) (xy 261.904906 133.355469) (xy 262.084794 133.215456) (xy 262.239183 133.047745) - (xy 262.363862 132.856909) (xy 262.45543 132.648155) (xy 262.51139 132.427176) (xy 262.519898 132.3245) - (xy 262.526424 132.245745) (xy 262.543679 132.201026) (xy 262.755527 132.201026) (xy 262.771456 132.230994) - (xy 262.773576 132.245745) (xy 262.788608 132.427168) (xy 262.78861 132.427179) (xy 262.844569 132.648155) - (xy 262.936137 132.856908) (xy 263.060814 133.047742) (xy 263.12411 133.1165) (xy 263.1947 133.193181) - (xy 263.215208 133.215458) (xy 263.215212 133.215461) (xy 263.389689 133.351262) (xy 263.395094 133.355469) - (xy 263.395096 133.35547) (xy 263.395099 133.355472) (xy 263.477378 133.399999) (xy 263.595574 133.463963) - (xy 263.661781 133.486692) (xy 263.811173 133.537979) (xy 263.811175 133.537979) (xy 263.811177 133.53798) - (xy 264.036023 133.5755) (xy 264.036024 133.5755) (xy 264.263976 133.5755) (xy 264.263977 133.5755) - (xy 264.488823 133.53798) (xy 264.704426 133.463963) (xy 264.904906 133.355469) (xy 265.084794 133.215456) - (xy 265.12422 133.172627) (xy 265.184105 133.136639) (xy 265.253943 133.138739) (xy 265.311559 133.178262) - (xy 265.338661 133.242662) (xy 265.335654 133.287052) (xy 265.28861 133.47282) (xy 265.288608 133.472831) - (xy 265.269786 133.699993) (xy 265.269786 133.700006) (xy 265.288608 133.927168) (xy 265.28861 133.927179) - (xy 265.344569 134.148155) (xy 265.436137 134.356908) (xy 265.560814 134.547742) (xy 265.715208 134.715458) - (xy 265.715212 134.715461) (xy 265.779465 134.765471) (xy 265.895094 134.855469) (xy 265.895096 134.85547) - (xy 265.895099 134.855472) (xy 266.011646 134.918543) (xy 266.095574 134.963963) (xy 266.207529 135.002397) - (xy 266.311173 135.037979) (xy 266.311175 135.037979) (xy 266.311177 135.03798) (xy 266.536023 135.0755) - (xy 266.536024 135.0755) (xy 266.763976 135.0755) (xy 266.763977 135.0755) (xy 266.988823 135.03798) - (xy 267.204426 134.963963) (xy 267.404906 134.855469) (xy 267.584794 134.715456) (xy 267.739183 134.547745) - (xy 267.863862 134.356909) (xy 267.95543 134.148155) (xy 268.01139 133.927176) (xy 268.011391 133.927168) - (xy 268.030214 133.700006) (xy 268.030214 133.699993) (xy 268.011391 133.472831) (xy 268.011389 133.47282) - (xy 267.95543 133.251844) (xy 267.863862 133.043091) (xy 267.739185 132.852257) (xy 267.651322 132.756813) - (xy 267.584794 132.684544) (xy 267.584793 132.684543) (xy 267.584791 132.684541) (xy 267.584787 132.684538) - (xy 267.404909 132.544533) (xy 267.4049 132.544527) (xy 267.204432 132.43604) (xy 267.204429 132.436039) - (xy 267.204426 132.436037) (xy 267.20442 132.436035) (xy 267.204418 132.436034) (xy 266.988826 132.36202) - (xy 266.820188 132.33388) (xy 266.763977 132.3245) (xy 266.536023 132.3245) (xy 266.491053 132.332004) - (xy 266.311173 132.36202) (xy 266.095581 132.436034) (xy 266.095567 132.43604) (xy 265.895099 132.544527) - (xy 265.89509 132.544533) (xy 265.715212 132.684538) (xy 265.715207 132.684543) (xy 265.675779 132.727372) - (xy 265.615892 132.763361) (xy 265.546053 132.76126) (xy 265.488438 132.721734) (xy 265.461338 132.657334) - (xy 265.464346 132.612946) (xy 265.477573 132.560717) (xy 265.51139 132.427176) (xy 265.519898 132.3245) - (xy 265.530214 132.200006) (xy 265.530214 132.199993) (xy 265.511391 131.972831) (xy 265.511387 131.972811) - (xy 265.464346 131.787053) (xy 265.46697 131.717233) (xy 265.506926 131.659915) (xy 265.571527 131.633298) - (xy 265.640263 131.645832) (xy 265.67578 131.672628) (xy 265.715206 131.715456) (xy 265.715209 131.715458) - (xy 265.715212 131.715461) (xy 265.870638 131.836434) (xy 265.895094 131.855469) (xy 265.895096 131.85547) - (xy 265.895099 131.855472) (xy 265.930589 131.874678) (xy 266.095574 131.963963) (xy 266.207529 132.002397) - (xy 266.311173 132.037979) (xy 266.311175 132.037979) (xy 266.311177 132.03798) (xy 266.536023 132.0755) - (xy 266.536024 132.0755) (xy 266.763976 132.0755) (xy 266.763977 132.0755) (xy 266.988823 132.03798) - (xy 267.204426 131.963963) (xy 267.404906 131.855469) (xy 267.584794 131.715456) (xy 267.739183 131.547745) - (xy 267.863862 131.356909) (xy 267.95543 131.148155) (xy 268.01139 130.927176) (xy 268.026106 130.749579) - (xy 268.030214 130.700006) (xy 268.030214 130.699993) (xy 268.011391 130.472831) (xy 268.011389 130.47282) - (xy 267.95543 130.251844) (xy 267.863862 130.043091) (xy 267.739185 129.852257) (xy 267.660425 129.766701) - (xy 267.584794 129.684544) (xy 267.584793 129.684543) (xy 267.584791 129.684541) (xy 267.584787 129.684538) - (xy 267.404909 129.544533) (xy 267.4049 129.544527) (xy 267.204432 129.43604) (xy 267.204429 129.436039) - (xy 267.204426 129.436037) (xy 267.20442 129.436035) (xy 267.204418 129.436034) (xy 266.988826 129.36202) - (xy 266.820188 129.33388) (xy 266.763977 129.3245) (xy 266.536023 129.3245) (xy 266.491053 129.332004) - (xy 266.311173 129.36202) (xy 266.095581 129.436034) (xy 266.095567 129.43604) (xy 265.895099 129.544527) - (xy 265.89509 129.544533) (xy 265.715212 129.684538) (xy 265.715208 129.684541) (xy 265.560814 129.852257) - (xy 265.436137 130.043091) (xy 265.344569 130.251844) (xy 265.28861 130.47282) (xy 265.288608 130.472831) - (xy 265.269786 130.699993) (xy 265.269786 130.700006) (xy 265.288608 130.927168) (xy 265.28861 130.927176) - (xy 265.33323 131.103376) (xy 265.335654 131.112946) (xy 265.333029 131.182767) (xy 265.293073 131.240084) - (xy 265.228472 131.266701) (xy 265.159736 131.254167) (xy 265.124219 131.227371) (xy 265.108627 131.210434) - (xy 265.084794 131.184544) (xy 265.084789 131.18454) (xy 265.084787 131.184538) (xy 264.904909 131.044533) - (xy 264.9049 131.044527) (xy 264.704432 130.93604) (xy 264.704429 130.936039) (xy 264.704426 130.936037) - (xy 264.70442 130.936035) (xy 264.704418 130.936034) (xy 264.488826 130.86202) (xy 264.320188 130.83388) - (xy 264.263977 130.8245) (xy 264.036023 130.8245) (xy 263.991053 130.832004) (xy 263.811173 130.86202) - (xy 263.595581 130.936034) (xy 263.595567 130.93604) (xy 263.395099 131.044527) (xy 263.39509 131.044533) - (xy 263.215212 131.184538) (xy 263.215208 131.184541) (xy 263.060814 131.352257) (xy 262.936137 131.543091) - (xy 262.844569 131.751844) (xy 262.78861 131.97282) (xy 262.788608 131.972831) (xy 262.773576 132.154254) - (xy 262.755527 132.201026) (xy 262.543679 132.201026) (xy 262.544472 132.198972) (xy 262.528544 132.169005) - (xy 262.526424 132.154254) (xy 262.511391 131.972831) (xy 262.511389 131.97282) (xy 262.45543 131.751844) - (xy 262.363862 131.543091) (xy 262.239185 131.352257) (xy 262.155416 131.26126) (xy 262.084794 131.184544) - (xy 262.084793 131.184543) (xy 262.084791 131.184541) (xy 262.084787 131.184538) (xy 261.904909 131.044533) - (xy 261.9049 131.044527) (xy 261.704432 130.93604) (xy 261.704429 130.936039) (xy 261.704426 130.936037) - (xy 261.70442 130.936035) (xy 261.704418 130.936034) (xy 261.488826 130.86202) (xy 261.320188 130.83388) - (xy 261.263977 130.8245) (xy 261.036023 130.8245) (xy 260.991053 130.832004) (xy 260.811173 130.86202) - (xy 260.595581 130.936034) (xy 260.595567 130.93604) (xy 260.395099 131.044527) (xy 260.39509 131.044533) - (xy 260.215212 131.184538) (xy 260.215207 131.184543) (xy 260.175779 131.227372) (xy 260.115892 131.263361) - (xy 260.046053 131.26126) (xy 259.988438 131.221734) (xy 259.961338 131.157334) (xy 259.964346 131.112946) - (xy 259.96677 131.103376) (xy 260.01139 130.927176) (xy 260.026106 130.749579) (xy 260.030214 130.700006) - (xy 260.030214 130.699993) (xy 260.011391 130.472831) (xy 260.011387 130.472811) (xy 259.964346 130.287053) - (xy 259.96697 130.217233) (xy 260.006926 130.159915) (xy 260.071527 130.133298) (xy 260.140263 130.145832) - (xy 260.17578 130.172628) (xy 260.215206 130.215456) (xy 260.215209 130.215458) (xy 260.215212 130.215461) - (xy 260.38654 130.348811) (xy 260.395094 130.355469) (xy 260.395096 130.35547) (xy 260.395099 130.355472) - (xy 260.485228 130.404247) (xy 260.595574 130.463963) (xy 260.663561 130.487303) (xy 260.811173 130.537979) - (xy 260.811175 130.537979) (xy 260.811177 130.53798) (xy 261.036023 130.5755) (xy 261.036024 130.5755) - (xy 261.263976 130.5755) (xy 261.263977 130.5755) (xy 261.488823 130.53798) (xy 261.704426 130.463963) - (xy 261.904906 130.355469) (xy 262.084794 130.215456) (xy 262.239183 130.047745) (xy 262.363862 129.856909) - (xy 262.45543 129.648155) (xy 262.51139 129.427176) (xy 262.511391 129.427168) (xy 262.530214 129.200006) - (xy 262.530214 129.199993) (xy 262.511391 128.972831) (xy 262.511389 128.97282) (xy 262.45543 128.751844) - (xy 262.363862 128.543091) (xy 262.239185 128.352257) (xy 262.113082 128.215273) (xy 262.084794 128.184544) - (xy 262.084793 128.184543) (xy 262.084791 128.184541) (xy 262.084787 128.184538) (xy 261.904909 128.044533) - (xy 261.9049 128.044527) (xy 261.704432 127.93604) (xy 261.704429 127.936039) (xy 261.704426 127.936037) - (xy 261.70442 127.936035) (xy 261.704418 127.936034) (xy 261.488826 127.86202) (xy 261.320188 127.83388) - (xy 261.263977 127.8245) (xy 261.036023 127.8245) (xy 260.991053 127.832004) (xy 260.811173 127.86202) - (xy 260.595581 127.936034) (xy 260.595567 127.93604) (xy 260.395099 128.044527) (xy 260.39509 128.044533) - (xy 260.215212 128.184538) (xy 260.215207 128.184543) (xy 260.175779 128.227372) (xy 260.115892 128.263361) - (xy 260.046053 128.26126) (xy 259.988438 128.221734) (xy 259.961338 128.157334) (xy 259.964346 128.112946) - (xy 259.982449 128.041462) (xy 260.01139 127.927176) (xy 260.011391 127.927168) (xy 260.030214 127.700006) - (xy 260.030214 127.699993) (xy 260.011391 127.472831) (xy 260.011387 127.472811) (xy 259.964346 127.287053) - (xy 259.96697 127.217233) (xy 260.006926 127.159915) (xy 260.071527 127.133298) (xy 260.140263 127.145832) - (xy 260.17578 127.172628) (xy 260.215206 127.215456) (xy 260.215209 127.215458) (xy 260.215212 127.215461) - (xy 260.39509 127.355466) (xy 260.395094 127.355469) (xy 260.395096 127.35547) (xy 260.395099 127.355472) - (xy 260.511646 127.418543) (xy 260.595574 127.463963) (xy 260.707529 127.502397) (xy 260.811173 127.537979) - (xy 260.811175 127.537979) (xy 260.811177 127.53798) (xy 261.036023 127.5755) (xy 261.036024 127.5755) - (xy 261.263976 127.5755) (xy 261.263977 127.5755) (xy 261.488823 127.53798) (xy 261.704426 127.463963) - (xy 261.904906 127.355469) (xy 262.084794 127.215456) (xy 262.239183 127.047745) (xy 262.363862 126.856909) - (xy 262.45543 126.648155) (xy 262.51139 126.427176) (xy 262.513642 126.399999) (xy 262.526424 126.245745) - (xy 262.543679 126.201026) (xy 262.755527 126.201026) (xy 262.771456 126.230994) (xy 262.773576 126.245745) - (xy 262.788608 126.427168) (xy 262.78861 126.427179) (xy 262.844569 126.648155) (xy 262.936137 126.856908) - (xy 263.060814 127.047742) (xy 263.097233 127.087303) (xy 263.205142 127.204524) (xy 263.215208 127.215458) - (xy 263.215212 127.215461) (xy 263.39509 127.355466) (xy 263.395094 127.355469) (xy 263.395096 127.35547) - (xy 263.395099 127.355472) (xy 263.511646 127.418543) (xy 263.595574 127.463963) (xy 263.707529 127.502397) - (xy 263.811173 127.537979) (xy 263.811175 127.537979) (xy 263.811177 127.53798) (xy 264.036023 127.5755) - (xy 264.036024 127.5755) (xy 264.263976 127.5755) (xy 264.263977 127.5755) (xy 264.488823 127.53798) - (xy 264.704426 127.463963) (xy 264.904906 127.355469) (xy 265.084794 127.215456) (xy 265.12422 127.172627) - (xy 265.184105 127.136639) (xy 265.253943 127.138739) (xy 265.311559 127.178262) (xy 265.338661 127.242662) - (xy 265.335654 127.287052) (xy 265.28861 127.47282) (xy 265.288608 127.472831) (xy 265.269786 127.699993) - (xy 265.269786 127.700006) (xy 265.288608 127.927168) (xy 265.28861 127.927179) (xy 265.344569 128.148155) - (xy 265.436137 128.356908) (xy 265.560814 128.547742) (xy 265.604757 128.595477) (xy 265.680966 128.678262) - (xy 265.715208 128.715458) (xy 265.715212 128.715461) (xy 265.773357 128.760717) (xy 265.895094 128.855469) - (xy 265.895096 128.85547) (xy 265.895099 128.855472) (xy 265.977378 128.899999) (xy 266.095574 128.963963) - (xy 266.156075 128.984733) (xy 266.311173 129.037979) (xy 266.311175 129.037979) (xy 266.311177 129.03798) - (xy 266.536023 129.0755) (xy 266.536024 129.0755) (xy 266.763976 129.0755) (xy 266.763977 129.0755) - (xy 266.988823 129.03798) (xy 267.204426 128.963963) (xy 267.404906 128.855469) (xy 267.584794 128.715456) - (xy 267.739183 128.547745) (xy 267.863862 128.356909) (xy 267.95543 128.148155) (xy 268.01139 127.927176) - (xy 268.011391 127.927168) (xy 268.030214 127.700006) (xy 268.030214 127.699993) (xy 268.011391 127.472831) - (xy 268.011389 127.47282) (xy 267.95543 127.251844) (xy 267.863862 127.043091) (xy 267.739185 126.852257) - (xy 267.655416 126.76126) (xy 267.584794 126.684544) (xy 267.584793 126.684543) (xy 267.584791 126.684541) - (xy 267.584787 126.684538) (xy 267.404909 126.544533) (xy 267.4049 126.544527) (xy 267.204432 126.43604) - (xy 267.204429 126.436039) (xy 267.204426 126.436037) (xy 267.20442 126.436035) (xy 267.204418 126.436034) - (xy 266.988826 126.36202) (xy 266.820188 126.33388) (xy 266.763977 126.3245) (xy 266.536023 126.3245) - (xy 266.491053 126.332004) (xy 266.311173 126.36202) (xy 266.095581 126.436034) (xy 266.095567 126.43604) - (xy 265.895099 126.544527) (xy 265.89509 126.544533) (xy 265.715212 126.684538) (xy 265.715207 126.684543) - (xy 265.675779 126.727372) (xy 265.615892 126.763361) (xy 265.546053 126.76126) (xy 265.488438 126.721734) - (xy 265.461338 126.657334) (xy 265.464346 126.612946) (xy 265.468771 126.595475) (xy 265.51139 126.427176) - (xy 265.513642 126.399999) (xy 265.530214 126.200006) (xy 265.530214 126.199993) (xy 265.511391 125.972831) - (xy 265.511387 125.972811) (xy 265.464346 125.787053) (xy 265.46697 125.717233) (xy 265.506926 125.659915) - (xy 265.571527 125.633298) (xy 265.640263 125.645832) (xy 265.67578 125.672628) (xy 265.715206 125.715456) - (xy 265.715209 125.715458) (xy 265.715212 125.715461) (xy 265.89509 125.855466) (xy 265.895094 125.855469) - (xy 265.895096 125.85547) (xy 265.895099 125.855472) (xy 265.904791 125.860717) (xy 266.095574 125.963963) - (xy 266.207529 126.002397) (xy 266.311173 126.037979) (xy 266.311175 126.037979) (xy 266.311177 126.03798) - (xy 266.536023 126.0755) (xy 266.536024 126.0755) (xy 266.763976 126.0755) (xy 266.763977 126.0755) - (xy 266.988823 126.03798) (xy 267.204426 125.963963) (xy 267.404906 125.855469) (xy 267.476174 125.799999) - (xy 268.044722 125.799999) (xy 268.044722 125.8) (xy 268.063762 125.956818) (xy 268.116349 126.095476) - (xy 268.11978 126.104523) (xy 268.209517 126.23453) (xy 268.32776 126.339283) (xy 268.327762 126.339284) - (xy 268.467634 126.412696) (xy 268.621014 126.4505) (xy 268.621015 126.4505) (xy 268.778985 126.4505) - (xy 268.932365 126.412696) (xy 268.956557 126.399999) (xy 269.07224 126.339283) (xy 269.190483 126.23453) - (xy 269.28022 126.104523) (xy 269.336237 125.956818) (xy 269.355278 125.8) (xy 269.353737 125.787304) - (xy 269.336237 125.643181) (xy 269.301087 125.5505) (xy 269.28022 125.495477) (xy 269.190483 125.36547) - (xy 269.07224 125.260717) (xy 269.072238 125.260716) (xy 269.072237 125.260715) (xy 268.932365 125.187303) - (xy 268.778986 125.1495) (xy 268.778985 125.1495) (xy 268.621015 125.1495) (xy 268.621014 125.1495) - (xy 268.467634 125.187303) (xy 268.327762 125.260715) (xy 268.31862 125.268814) (xy 268.219181 125.356909) - (xy 268.209516 125.365471) (xy 268.119781 125.495475) (xy 268.11978 125.495476) (xy 268.063762 125.643181) - (xy 268.044722 125.799999) (xy 267.476174 125.799999) (xy 267.584794 125.715456) (xy 267.739183 125.547745) - (xy 267.863862 125.356909) (xy 267.95543 125.148155) (xy 268.01139 124.927176) (xy 268.013763 124.898538) - (xy 268.030214 124.700006) (xy 268.030214 124.699993) (xy 268.011391 124.472831) (xy 268.011389 124.47282) - (xy 267.95543 124.251844) (xy 267.863862 124.043091) (xy 267.739185 123.852257) (xy 267.691078 123.799999) - (xy 269.644718 123.799999) (xy 269.644718 123.8) (xy 269.663758 123.956818) (xy 269.698243 124.047745) - (xy 269.719776 124.104523) (xy 269.809513 124.23453) (xy 269.927756 124.339283) (xy 269.927758 124.339284) - (xy 270.06763 124.412696) (xy 270.22101 124.4505) (xy 270.221011 124.4505) (xy 270.378981 124.4505) - (xy 270.532361 124.412696) (xy 270.631397 124.360717) (xy 270.672236 124.339283) (xy 270.790479 124.23453) - (xy 270.880216 124.104523) (xy 270.936233 123.956818) (xy 270.955274 123.8) (xy 270.941255 123.684538) - (xy 270.936233 123.643181) (xy 270.89882 123.544533) (xy 270.880216 123.495477) (xy 270.790479 123.36547) - (xy 270.672236 123.260717) (xy 270.672234 123.260716) (xy 270.672233 123.260715) (xy 270.532361 123.187303) - (xy 270.378982 123.1495) (xy 270.378981 123.1495) (xy 270.221011 123.1495) (xy 270.22101 123.1495) - (xy 270.06763 123.187303) (xy 269.927758 123.260715) (xy 269.855759 123.3245) (xy 269.820316 123.3559) - (xy 269.809512 123.365471) (xy 269.719777 123.495475) (xy 269.719776 123.495476) (xy 269.663758 123.643181) - (xy 269.644718 123.799999) (xy 267.691078 123.799999) (xy 267.660425 123.766701) (xy 267.584794 123.684544) - (xy 267.584793 123.684543) (xy 267.584791 123.684541) (xy 267.584787 123.684538) (xy 267.404909 123.544533) - (xy 267.4049 123.544527) (xy 267.204432 123.43604) (xy 267.204429 123.436039) (xy 267.204426 123.436037) - (xy 267.20442 123.436035) (xy 267.204418 123.436034) (xy 266.988826 123.36202) (xy 266.820188 123.33388) - (xy 266.763977 123.3245) (xy 266.536023 123.3245) (xy 266.491053 123.332004) (xy 266.311173 123.36202) - (xy 266.095581 123.436034) (xy 266.095567 123.43604) (xy 265.895099 123.544527) (xy 265.89509 123.544533) - (xy 265.715212 123.684538) (xy 265.715208 123.684541) (xy 265.560814 123.852257) (xy 265.436137 124.043091) - (xy 265.344569 124.251844) (xy 265.28861 124.47282) (xy 265.288608 124.472831) (xy 265.269786 124.699993) - (xy 265.269786 124.700006) (xy 265.288608 124.927168) (xy 265.28861 124.927176) (xy 265.335654 125.112946) - (xy 265.333029 125.182767) (xy 265.293073 125.240084) (xy 265.228472 125.266701) (xy 265.159736 125.254167) - (xy 265.124219 125.227371) (xy 265.11903 125.221734) (xy 265.084794 125.184544) (xy 265.084789 125.18454) - (xy 265.084787 125.184538) (xy 264.904909 125.044533) (xy 264.9049 125.044527) (xy 264.704432 124.93604) - (xy 264.704429 124.936039) (xy 264.704426 124.936037) (xy 264.70442 124.936035) (xy 264.704418 124.936034) - (xy 264.488826 124.86202) (xy 264.320188 124.83388) (xy 264.263977 124.8245) (xy 264.036023 124.8245) - (xy 263.991053 124.832004) (xy 263.811173 124.86202) (xy 263.595581 124.936034) (xy 263.595567 124.93604) - (xy 263.395099 125.044527) (xy 263.39509 125.044533) (xy 263.215212 125.184538) (xy 263.215208 125.184541) - (xy 263.060814 125.352257) (xy 262.936137 125.543091) (xy 262.844569 125.751844) (xy 262.78861 125.97282) - (xy 262.788608 125.972831) (xy 262.773576 126.154254) (xy 262.755527 126.201026) (xy 262.543679 126.201026) - (xy 262.544472 126.198972) (xy 262.528544 126.169005) (xy 262.526424 126.154254) (xy 262.511391 125.972831) - (xy 262.511389 125.97282) (xy 262.45543 125.751844) (xy 262.363862 125.543091) (xy 262.239185 125.352257) - (xy 262.154914 125.260715) (xy 262.084794 125.184544) (xy 262.084793 125.184543) (xy 262.084791 125.184541) - (xy 262.084787 125.184538) (xy 261.904909 125.044533) (xy 261.9049 125.044527) (xy 261.704432 124.93604) - (xy 261.704429 124.936039) (xy 261.704426 124.936037) (xy 261.70442 124.936035) (xy 261.704418 124.936034) - (xy 261.488826 124.86202) (xy 261.320188 124.83388) (xy 261.263977 124.8245) (xy 261.036023 124.8245) - (xy 260.991053 124.832004) (xy 260.811173 124.86202) (xy 260.595581 124.936034) (xy 260.595567 124.93604) - (xy 260.395099 125.044527) (xy 260.39509 125.044533) (xy 260.215212 125.184538) (xy 260.215207 125.184543) - (xy 260.175779 125.227372) (xy 260.115892 125.263361) (xy 260.046053 125.26126) (xy 259.988438 125.221734) - (xy 259.961338 125.157334) (xy 259.964346 125.112946) (xy 260.011387 124.927188) (xy 260.011389 124.927179) - (xy 260.01139 124.927176) (xy 260.013763 124.898538) (xy 260.030214 124.700006) (xy 260.030214 124.699993) - (xy 260.011391 124.472831) (xy 260.011387 124.472811) (xy 259.964346 124.287053) (xy 259.96697 124.217233) - (xy 260.006926 124.159915) (xy 260.071527 124.133298) (xy 260.140263 124.145832) (xy 260.17578 124.172628) - (xy 260.215206 124.215456) (xy 260.215209 124.215458) (xy 260.215212 124.215461) (xy 260.39509 124.355466) - (xy 260.395094 124.355469) (xy 260.395096 124.35547) (xy 260.395099 124.355472) (xy 260.404791 124.360717) - (xy 260.595574 124.463963) (xy 260.707529 124.502397) (xy 260.811173 124.537979) (xy 260.811175 124.537979) - (xy 260.811177 124.53798) (xy 261.036023 124.5755) (xy 261.036024 124.5755) (xy 261.263976 124.5755) - (xy 261.263977 124.5755) (xy 261.488823 124.53798) (xy 261.704426 124.463963) (xy 261.904906 124.355469) - (xy 262.084794 124.215456) (xy 262.239183 124.047745) (xy 262.363862 123.856909) (xy 262.45543 123.648155) - (xy 262.51139 123.427176) (xy 262.511391 123.427168) (xy 262.530214 123.200006) (xy 262.530214 123.199993) - (xy 262.511391 122.972831) (xy 262.511389 122.97282) (xy 262.45543 122.751844) (xy 262.363862 122.543091) - (xy 262.239185 122.352257) (xy 262.084791 122.184541) (xy 262.084787 122.184538) (xy 261.904909 122.044533) - (xy 261.9049 122.044527) (xy 261.704432 121.93604) (xy 261.704429 121.936039) (xy 261.704426 121.936037) - (xy 261.70442 121.936035) (xy 261.704418 121.936034) (xy 261.488826 121.86202) (xy 261.320188 121.83388) - (xy 261.263977 121.8245) (xy 261.036023 121.8245) (xy 260.991053 121.832004) (xy 260.811173 121.86202) - (xy 260.595581 121.936034) (xy 260.595567 121.93604) (xy 260.395099 122.044527) (xy 260.39509 122.044533) - (xy 260.215212 122.184538) (xy 260.215207 122.184543) (xy 260.175779 122.227372) (xy 260.115892 122.263361) - (xy 260.046053 122.26126) (xy 259.988438 122.221734) (xy 259.961338 122.157334) (xy 259.964346 122.112946) - (xy 260.011387 121.927188) (xy 260.011389 121.927179) (xy 260.01139 121.927176) (xy 260.017223 121.856786) - (xy 260.030214 121.700006) (xy 260.030214 121.699993) (xy 265.269786 121.699993) (xy 265.269786 121.700006) - (xy 265.288608 121.927168) (xy 265.28861 121.927179) (xy 265.344569 122.148155) (xy 265.436137 122.356908) - (xy 265.560814 122.547742) (xy 265.560817 122.547745) (xy 265.680966 122.678262) (xy 265.715208 122.715458) - (xy 265.715212 122.715461) (xy 265.839636 122.812304) (xy 265.895094 122.855469) (xy 265.895096 122.85547) - (xy 265.895099 122.855472) (xy 266.011646 122.918543) (xy 266.095574 122.963963) (xy 266.172786 122.99047) - (xy 266.311173 123.037979) (xy 266.311175 123.037979) (xy 266.311177 123.03798) (xy 266.536023 123.0755) - (xy 266.536024 123.0755) (xy 266.763976 123.0755) (xy 266.763977 123.0755) (xy 266.988823 123.03798) - (xy 267.204426 122.963963) (xy 267.404906 122.855469) (xy 267.584794 122.715456) (xy 267.739183 122.547745) - (xy 267.863862 122.356909) (xy 267.95543 122.148155) (xy 268.01139 121.927176) (xy 268.017223 121.856786) - (xy 268.030214 121.700006) (xy 268.030214 121.699993) (xy 268.030212 121.699967) (xy 270.844722 121.699967) - (xy 270.844722 121.699968) (xy 270.863762 121.856786) (xy 270.89505 121.939284) (xy 270.91978 122.004491) - (xy 271.009517 122.134498) (xy 271.12776 122.239251) (xy 271.127762 122.239252) (xy 271.267634 122.312664) - (xy 271.421014 122.350468) (xy 271.421015 122.350468) (xy 271.578985 122.350468) (xy 271.732365 122.312664) - (xy 271.87224 122.239251) (xy 271.990483 122.134498) (xy 272.08022 122.004491) (xy 272.136237 121.856786) - (xy 272.155278 121.699968) (xy 272.147333 121.63453) (xy 272.136237 121.543149) (xy 272.114992 121.487132) - (xy 272.08022 121.395445) (xy 271.990483 121.265438) (xy 271.87224 121.160685) (xy 271.872238 121.160684) - (xy 271.872237 121.160683) (xy 271.732365 121.087271) (xy 271.578986 121.049468) (xy 271.578985 121.049468) - (xy 271.421015 121.049468) (xy 271.421014 121.049468) (xy 271.267634 121.087271) (xy 271.127762 121.160683) - (xy 271.065933 121.215458) (xy 271.024861 121.251845) (xy 271.009516 121.265439) (xy 270.919781 121.395443) - (xy 270.91978 121.395444) (xy 270.863762 121.543149) (xy 270.844722 121.699967) (xy 268.030212 121.699967) - (xy 268.011391 121.472831) (xy 268.011389 121.47282) (xy 267.95543 121.251844) (xy 267.863862 121.043091) - (xy 267.739185 120.852257) (xy 267.651334 120.756826) (xy 267.584794 120.684544) (xy 267.584793 120.684543) - (xy 267.584791 120.684541) (xy 267.584787 120.684538) (xy 267.404909 120.544533) (xy 267.4049 120.544527) - (xy 267.204432 120.43604) (xy 267.204429 120.436039) (xy 267.204426 120.436037) (xy 267.20442 120.436035) - (xy 267.204418 120.436034) (xy 266.988826 120.36202) (xy 266.820188 120.33388) (xy 266.763977 120.3245) - (xy 266.536023 120.3245) (xy 266.491053 120.332004) (xy 266.311173 120.36202) (xy 266.095581 120.436034) - (xy 266.095567 120.43604) (xy 265.895099 120.544527) (xy 265.89509 120.544533) (xy 265.715212 120.684538) - (xy 265.715208 120.684541) (xy 265.560814 120.852257) (xy 265.436137 121.043091) (xy 265.344569 121.251844) - (xy 265.28861 121.47282) (xy 265.288608 121.472831) (xy 265.269786 121.699993) (xy 260.030214 121.699993) - (xy 260.011391 121.472831) (xy 260.011387 121.472811) (xy 259.964346 121.287053) (xy 259.96697 121.217233) - (xy 260.006926 121.159915) (xy 260.071527 121.133298) (xy 260.140263 121.145832) (xy 260.17578 121.172628) - (xy 260.215206 121.215456) (xy 260.215209 121.215458) (xy 260.215212 121.215461) (xy 260.279424 121.265439) - (xy 260.395094 121.355469) (xy 260.395096 121.35547) (xy 260.395099 121.355472) (xy 260.468963 121.395445) - (xy 260.595574 121.463963) (xy 260.707529 121.502397) (xy 260.811173 121.537979) (xy 260.811175 121.537979) - (xy 260.811177 121.53798) (xy 261.036023 121.5755) (xy 261.036024 121.5755) (xy 261.263976 121.5755) - (xy 261.263977 121.5755) (xy 261.488823 121.53798) (xy 261.704426 121.463963) (xy 261.904906 121.355469) - (xy 262.084794 121.215456) (xy 262.239183 121.047745) (xy 262.363862 120.856909) (xy 262.45543 120.648155) - (xy 262.51139 120.427176) (xy 262.519898 120.3245) (xy 262.530214 120.200006) (xy 262.530214 120.199993) - (xy 262.511391 119.972831) (xy 262.511389 119.97282) (xy 262.45543 119.751844) (xy 262.363862 119.543091) - (xy 262.239185 119.352257) (xy 262.084791 119.184541) (xy 262.084787 119.184538) (xy 261.904909 119.044533) - (xy 261.9049 119.044527) (xy 261.704432 118.93604) (xy 261.704429 118.936039) (xy 261.704426 118.936037) - (xy 261.70442 118.936035) (xy 261.704418 118.936034) (xy 261.488826 118.86202) (xy 261.320188 118.83388) - (xy 261.263977 118.8245) (xy 261.036023 118.8245) (xy 260.991053 118.832004) (xy 260.811173 118.86202) - (xy 260.595581 118.936034) (xy 260.595567 118.93604) (xy 260.395099 119.044527) (xy 260.39509 119.044533) - (xy 260.215212 119.184538) (xy 260.215207 119.184543) (xy 260.175779 119.227372) (xy 260.115892 119.263361) - (xy 260.046053 119.26126) (xy 259.988438 119.221734) (xy 259.961338 119.157334) (xy 259.964346 119.112946) - (xy 260.011387 118.927188) (xy 260.011389 118.927179) (xy 260.01139 118.927176) (xy 260.019898 118.8245) - (xy 260.030214 118.700006) (xy 260.030214 118.699993) (xy 265.269786 118.699993) (xy 265.269786 118.700006) - (xy 265.288608 118.927168) (xy 265.28861 118.927179) (xy 265.344569 119.148155) (xy 265.436137 119.356908) - (xy 265.560814 119.547742) (xy 265.560817 119.547745) (xy 265.680966 119.678262) (xy 265.715208 119.715458) - (xy 265.715212 119.715461) (xy 265.895094 119.855469) (xy 265.895096 119.85547) (xy 265.895099 119.855472) - (xy 266.010139 119.917728) (xy 266.095574 119.963963) (xy 266.163584 119.987311) (xy 266.311173 120.037979) - (xy 266.311175 120.037979) (xy 266.311177 120.03798) (xy 266.536023 120.0755) (xy 266.536024 120.0755) - (xy 266.763976 120.0755) (xy 266.763977 120.0755) (xy 266.988823 120.03798) (xy 267.204426 119.963963) - (xy 267.404906 119.855469) (xy 267.584794 119.715456) (xy 267.739183 119.547745) (xy 267.863862 119.356909) - (xy 267.95543 119.148155) (xy 268.01139 118.927176) (xy 268.019898 118.8245) (xy 268.030214 118.700006) - (xy 268.030214 118.699993) (xy 268.011391 118.472831) (xy 268.011389 118.47282) (xy 267.95543 118.251844) - (xy 267.863862 118.043091) (xy 267.739185 117.852257) (xy 267.660425 117.766701) (xy 267.584794 117.684544) - (xy 267.584793 117.684543) (xy 267.584791 117.684541) (xy 267.584787 117.684538) (xy 267.404909 117.544533) - (xy 267.4049 117.544527) (xy 267.204432 117.43604) (xy 267.204429 117.436039) (xy 267.204426 117.436037) - (xy 267.20442 117.436035) (xy 267.204418 117.436034) (xy 266.988826 117.36202) (xy 266.820188 117.33388) - (xy 266.763977 117.3245) (xy 266.536023 117.3245) (xy 266.491053 117.332004) (xy 266.311173 117.36202) - (xy 266.095581 117.436034) (xy 266.095567 117.43604) (xy 265.895099 117.544527) (xy 265.89509 117.544533) - (xy 265.715212 117.684538) (xy 265.715208 117.684541) (xy 265.560814 117.852257) (xy 265.436137 118.043091) - (xy 265.344569 118.251844) (xy 265.28861 118.47282) (xy 265.288608 118.472831) (xy 265.269786 118.699993) - (xy 260.030214 118.699993) (xy 260.011391 118.472831) (xy 260.011387 118.472811) (xy 259.964346 118.287053) - (xy 259.96697 118.217233) (xy 260.006926 118.159915) (xy 260.071527 118.133298) (xy 260.140263 118.145832) - (xy 260.17578 118.172628) (xy 260.215206 118.215456) (xy 260.215209 118.215458) (xy 260.215212 118.215461) - (xy 260.363696 118.331031) (xy 260.395094 118.355469) (xy 260.395096 118.35547) (xy 260.395099 118.355472) - (xy 260.511646 118.418543) (xy 260.595574 118.463963) (xy 260.707529 118.502397) (xy 260.811173 118.537979) - (xy 260.811175 118.537979) (xy 260.811177 118.53798) (xy 261.036023 118.5755) (xy 261.036024 118.5755) - (xy 261.263976 118.5755) (xy 261.263977 118.5755) (xy 261.488823 118.53798) (xy 261.704426 118.463963) - (xy 261.904906 118.355469) (xy 262.084794 118.215456) (xy 262.239183 118.047745) (xy 262.363862 117.856909) - (xy 262.45543 117.648155) (xy 262.51139 117.427176) (xy 262.523958 117.2755) (xy 262.530214 117.200006) - (xy 262.530214 117.199993) (xy 262.511391 116.972831) (xy 262.511389 116.97282) (xy 262.45543 116.751844) - (xy 262.363862 116.543091) (xy 262.239185 116.352257) (xy 262.084791 116.184541) (xy 262.084787 116.184538) + (xy 112.3005 115.364999) (xy 114.194722 115.364999) (xy 114.194722 115.365) (xy 114.213762 115.521818) + (xy 114.26978 115.669523) (xy 114.359517 115.79953) (xy 114.47776 115.904283) (xy 114.477762 115.904284) + (xy 114.617632 115.977695) (xy 114.617634 115.977695) (xy 114.617635 115.977696) (xy 114.624345 115.979349) + (xy 114.625372 115.979603) (xy 114.685753 116.01476) (xy 114.71754 116.07698) (xy 114.710644 116.146508) + (xy 114.667252 116.201271) (xy 114.625372 116.220397) (xy 114.617632 116.222304) (xy 114.477762 116.295715) + (xy 114.359516 116.400471) (xy 114.269781 116.530475) (xy 114.26978 116.530476) (xy 114.213762 116.678181) + (xy 114.194722 116.834999) (xy 114.194722 116.835) (xy 114.213762 116.991818) (xy 114.235706 117.049678) + (xy 114.26978 117.139523) (xy 114.359517 117.26953) (xy 114.47776 117.374283) (xy 114.477762 117.374284) + (xy 114.617634 117.447696) (xy 114.771014 117.4855) (xy 114.771015 117.4855) (xy 114.928985 117.4855) + (xy 115.082365 117.447696) (xy 115.121477 117.427168) (xy 115.22224 117.374283) (xy 115.340483 117.26953) + (xy 115.43022 117.139523) (xy 115.486237 116.991818) (xy 115.505278 116.835) (xy 115.49119 116.718969) + (xy 115.486237 116.678181) (xy 115.464992 116.622164) (xy 115.43022 116.530477) (xy 115.340483 116.40047) + (xy 115.22224 116.295717) (xy 115.222238 116.295716) (xy 115.222237 116.295715) (xy 115.082365 116.222303) + (xy 115.082366 116.222303) (xy 115.074629 116.220397) (xy 115.014248 116.185241) (xy 114.982459 116.123022) + (xy 114.989355 116.053493) (xy 115.032746 115.99873) (xy 115.074629 115.979603) (xy 115.082365 115.977696) + (xy 115.132732 115.951261) (xy 115.22224 115.904283) (xy 115.340483 115.79953) (xy 115.43022 115.669523) + (xy 115.486237 115.521818) (xy 115.504064 115.374999) (xy 133.044722 115.374999) (xy 133.044722 115.375) + (xy 133.063762 115.531818) (xy 133.115988 115.669524) (xy 133.11978 115.679523) (xy 133.164648 115.744526) + (xy 133.209515 115.809528) (xy 133.209517 115.80953) (xy 133.226979 115.825) (xy 133.305637 115.894684) + (xy 133.342764 115.953874) (xy 133.341996 116.023739) (xy 133.305637 116.080316) (xy 133.209516 116.16547) + (xy 133.119781 116.295475) (xy 133.11978 116.295476) (xy 133.063762 116.443181) (xy 133.044722 116.599999) + (xy 133.044722 116.6) (xy 133.063762 116.756818) (xy 133.093413 116.834999) (xy 133.11978 116.904523) + (xy 133.209517 117.03453) (xy 133.32776 117.139283) (xy 133.327762 117.139284) (xy 133.467634 117.212696) + (xy 133.621014 117.2505) (xy 133.621015 117.2505) (xy 133.778985 117.2505) (xy 133.932365 117.212696) + (xy 133.956568 117.199993) (xy 134.07224 117.139283) (xy 134.190483 117.03453) (xy 134.28022 116.904523) + (xy 134.336237 116.756818) (xy 134.355278 116.6) (xy 134.346837 116.530477) (xy 134.336237 116.443181) + (xy 134.303518 116.356909) (xy 134.28022 116.295477) (xy 134.190483 116.16547) (xy 134.09436 116.080314) + (xy 134.057236 116.021127) (xy 134.058003 115.951261) (xy 134.09436 115.894685) (xy 134.173027 115.824994) + (xy 165.704528 115.824994) (xy 165.704528 115.825005) (xy 165.724378 116.064559) (xy 165.783388 116.297589) + (xy 165.87995 116.517729) (xy 166.009133 116.715456) (xy 166.011428 116.718969) (xy 166.174235 116.895825) + (xy 166.174238 116.895827) (xy 166.174241 116.89583) (xy 166.363923 117.043466) (xy 166.363929 117.04347) + (xy 166.363932 117.043472) (xy 166.575343 117.157882) (xy 166.575346 117.157883) (xy 166.802698 117.235933) + (xy 166.8027 117.235933) (xy 166.802702 117.235934) (xy 167.039807 117.2755) (xy 167.039808 117.2755) + (xy 167.28019 117.2755) (xy 167.280191 117.2755) (xy 167.517296 117.235934) (xy 167.744655 117.157882) + (xy 167.956066 117.043472) (xy 167.963124 117.037979) (xy 168.022431 116.991818) (xy 168.145763 116.895825) + (xy 168.30857 116.718969) (xy 168.440048 116.517728) (xy 168.536609 116.297591) (xy 168.595619 116.064563) + (xy 168.6089 115.904284) (xy 168.61547 115.825005) (xy 168.61547 115.824994) (xy 168.595619 115.58544) + (xy 168.595619 115.585437) (xy 168.536609 115.352409) (xy 168.440048 115.132272) (xy 168.399674 115.070476) + (xy 168.308571 114.931033) (xy 168.30857 114.931031) (xy 168.145763 114.754175) (xy 168.145758 114.754171) + (xy 168.145756 114.754169) (xy 167.956074 114.606533) (xy 167.956068 114.606529) (xy 167.944597 114.600321) + (xy 179.179499 114.600321) (xy 179.179499 117.049678) (xy 179.194031 117.122735) (xy 179.194032 117.122739) + (xy 179.212404 117.150235) (xy 179.249398 117.205601) (xy 179.332259 117.260966) (xy 179.332263 117.260967) + (xy 179.40532 117.275499) (xy 179.405323 117.2755) (xy 179.405325 117.2755) (xy 181.854675 117.2755) + (xy 181.854676 117.275499) (xy 181.927739 117.260966) (xy 182.0106 117.205601) (xy 182.065965 117.12274) + (xy 182.080499 117.049674) (xy 182.080499 115.699993) (xy 257.269786 115.699993) (xy 257.269786 115.700006) + (xy 257.288608 115.927168) (xy 257.28861 115.927179) (xy 257.344569 116.148155) (xy 257.436137 116.356908) + (xy 257.560814 116.547742) (xy 257.560817 116.547745) (xy 257.680966 116.678262) (xy 257.715208 116.715458) + (xy 257.715212 116.715461) (xy 257.89509 116.855466) (xy 257.895094 116.855469) (xy 257.895096 116.85547) + (xy 257.895099 116.855472) (xy 257.969669 116.895827) (xy 258.095574 116.963963) (xy 258.207529 117.002397) + (xy 258.311173 117.037979) (xy 258.311175 117.037979) (xy 258.311177 117.03798) (xy 258.536023 117.0755) + (xy 258.536024 117.0755) (xy 258.763976 117.0755) (xy 258.763977 117.0755) (xy 258.988823 117.03798) + (xy 259.204426 116.963963) (xy 259.404906 116.855469) (xy 259.584794 116.715456) (xy 259.62422 116.672627) + (xy 259.684105 116.636639) (xy 259.753943 116.638739) (xy 259.811559 116.678262) (xy 259.838661 116.742662) + (xy 259.835654 116.787052) (xy 259.78861 116.97282) (xy 259.788608 116.972831) (xy 259.769786 117.199993) + (xy 259.769786 117.200006) (xy 259.788608 117.427168) (xy 259.78861 117.427176) (xy 259.835654 117.612946) + (xy 259.833029 117.682767) (xy 259.793073 117.740084) (xy 259.728472 117.766701) (xy 259.659736 117.754167) + (xy 259.624219 117.727371) (xy 259.584794 117.684544) (xy 259.584789 117.68454) (xy 259.584787 117.684538) + (xy 259.404909 117.544533) (xy 259.4049 117.544527) (xy 259.204432 117.43604) (xy 259.204429 117.436039) + (xy 259.204426 117.436037) (xy 259.20442 117.436035) (xy 259.204418 117.436034) (xy 258.988826 117.36202) + (xy 258.820188 117.33388) (xy 258.763977 117.3245) (xy 258.536023 117.3245) (xy 258.491053 117.332004) + (xy 258.311173 117.36202) (xy 258.095581 117.436034) (xy 258.095567 117.43604) (xy 257.895099 117.544527) + (xy 257.89509 117.544533) (xy 257.715212 117.684538) (xy 257.715208 117.684541) (xy 257.560814 117.852257) + (xy 257.436137 118.043091) (xy 257.344569 118.251844) (xy 257.28861 118.47282) (xy 257.288608 118.472831) + (xy 257.269786 118.699993) (xy 257.269786 118.700006) (xy 257.288608 118.927168) (xy 257.28861 118.927179) + (xy 257.344569 119.148155) (xy 257.436137 119.356908) (xy 257.560814 119.547742) (xy 257.560817 119.547745) + (xy 257.680966 119.678262) (xy 257.715208 119.715458) (xy 257.715212 119.715461) (xy 257.895094 119.855469) + (xy 257.895096 119.85547) (xy 257.895099 119.855472) (xy 258.010139 119.917728) (xy 258.095574 119.963963) + (xy 258.163584 119.987311) (xy 258.311173 120.037979) (xy 258.311175 120.037979) (xy 258.311177 120.03798) + (xy 258.536023 120.0755) (xy 258.536024 120.0755) (xy 258.763976 120.0755) (xy 258.763977 120.0755) + (xy 258.988823 120.03798) (xy 259.204426 119.963963) (xy 259.404906 119.855469) (xy 259.584794 119.715456) + (xy 259.62422 119.672627) (xy 259.684105 119.636639) (xy 259.753943 119.638739) (xy 259.811559 119.678262) + (xy 259.838661 119.742662) (xy 259.835654 119.787052) (xy 259.78861 119.97282) (xy 259.788608 119.972831) + (xy 259.769786 120.199993) (xy 259.769786 120.200006) (xy 259.788608 120.427168) (xy 259.78861 120.427176) + (xy 259.832377 120.600008) (xy 259.835654 120.612946) (xy 259.833029 120.682767) (xy 259.793073 120.740084) + (xy 259.728472 120.766701) (xy 259.659736 120.754167) (xy 259.624219 120.727371) (xy 259.584794 120.684544) + (xy 259.584789 120.68454) (xy 259.584787 120.684538) (xy 259.404909 120.544533) (xy 259.4049 120.544527) + (xy 259.204432 120.43604) (xy 259.204429 120.436039) (xy 259.204426 120.436037) (xy 259.20442 120.436035) + (xy 259.204418 120.436034) (xy 258.988826 120.36202) (xy 258.820188 120.33388) (xy 258.763977 120.3245) + (xy 258.536023 120.3245) (xy 258.491053 120.332004) (xy 258.311173 120.36202) (xy 258.095581 120.436034) + (xy 258.095567 120.43604) (xy 257.895099 120.544527) (xy 257.89509 120.544533) (xy 257.715212 120.684538) + (xy 257.715208 120.684541) (xy 257.560814 120.852257) (xy 257.436137 121.043091) (xy 257.344569 121.251844) + (xy 257.28861 121.47282) (xy 257.288608 121.472831) (xy 257.269786 121.699993) (xy 257.269786 121.700006) + (xy 257.288608 121.927168) (xy 257.28861 121.927179) (xy 257.344569 122.148155) (xy 257.436137 122.356908) + (xy 257.560814 122.547742) (xy 257.560817 122.547745) (xy 257.680966 122.678262) (xy 257.715208 122.715458) + (xy 257.715212 122.715461) (xy 257.839636 122.812304) (xy 257.895094 122.855469) (xy 257.895096 122.85547) + (xy 257.895099 122.855472) (xy 258.011646 122.918543) (xy 258.095574 122.963963) (xy 258.172786 122.99047) + (xy 258.311173 123.037979) (xy 258.311175 123.037979) (xy 258.311177 123.03798) (xy 258.536023 123.0755) + (xy 258.536024 123.0755) (xy 258.763976 123.0755) (xy 258.763977 123.0755) (xy 258.988823 123.03798) + (xy 259.204426 122.963963) (xy 259.404906 122.855469) (xy 259.584794 122.715456) (xy 259.62422 122.672627) + (xy 259.684105 122.636639) (xy 259.753943 122.638739) (xy 259.811559 122.678262) (xy 259.838661 122.742662) + (xy 259.835654 122.787052) (xy 259.78861 122.97282) (xy 259.788608 122.972831) (xy 259.769786 123.199993) + (xy 259.769786 123.200006) (xy 259.788608 123.427168) (xy 259.78861 123.427176) (xy 259.808087 123.50409) + (xy 259.835654 123.612946) (xy 259.833029 123.682767) (xy 259.793073 123.740084) (xy 259.728472 123.766701) + (xy 259.659736 123.754167) (xy 259.624219 123.727371) (xy 259.584794 123.684544) (xy 259.584789 123.68454) + (xy 259.584787 123.684538) (xy 259.404909 123.544533) (xy 259.4049 123.544527) (xy 259.204432 123.43604) + (xy 259.204429 123.436039) (xy 259.204426 123.436037) (xy 259.20442 123.436035) (xy 259.204418 123.436034) + (xy 258.988826 123.36202) (xy 258.820188 123.33388) (xy 258.763977 123.3245) (xy 258.536023 123.3245) + (xy 258.491053 123.332004) (xy 258.311173 123.36202) (xy 258.095581 123.436034) (xy 258.095567 123.43604) + (xy 257.895099 123.544527) (xy 257.89509 123.544533) (xy 257.715212 123.684538) (xy 257.715208 123.684541) + (xy 257.560814 123.852257) (xy 257.436137 124.043091) (xy 257.344569 124.251844) (xy 257.28861 124.47282) + (xy 257.288608 124.472831) (xy 257.269786 124.699993) (xy 257.269786 124.700006) (xy 257.288608 124.927168) + (xy 257.28861 124.927179) (xy 257.344569 125.148155) (xy 257.436137 125.356908) (xy 257.560814 125.547742) + (xy 257.560817 125.547745) (xy 257.680966 125.678262) (xy 257.715208 125.715458) (xy 257.715212 125.715461) + (xy 257.89509 125.855466) (xy 257.895094 125.855469) (xy 257.895096 125.85547) (xy 257.895099 125.855472) + (xy 257.904791 125.860717) (xy 258.095574 125.963963) (xy 258.207529 126.002397) (xy 258.311173 126.037979) + (xy 258.311175 126.037979) (xy 258.311177 126.03798) (xy 258.536023 126.0755) (xy 258.536024 126.0755) + (xy 258.763976 126.0755) (xy 258.763977 126.0755) (xy 258.988823 126.03798) (xy 259.204426 125.963963) + (xy 259.404906 125.855469) (xy 259.584794 125.715456) (xy 259.62422 125.672627) (xy 259.684105 125.636639) + (xy 259.753943 125.638739) (xy 259.811559 125.678262) (xy 259.838661 125.742662) (xy 259.835654 125.787052) + (xy 259.78861 125.97282) (xy 259.788608 125.972831) (xy 259.769786 126.199993) (xy 259.769786 126.200006) + (xy 259.788608 126.427168) (xy 259.78861 126.427176) (xy 259.831229 126.595475) (xy 259.835654 126.612946) + (xy 259.833029 126.682767) (xy 259.793073 126.740084) (xy 259.728472 126.766701) (xy 259.659736 126.754167) + (xy 259.624219 126.727371) (xy 259.617818 126.720418) (xy 259.584794 126.684544) (xy 259.584789 126.68454) + (xy 259.584787 126.684538) (xy 259.404909 126.544533) (xy 259.4049 126.544527) (xy 259.204432 126.43604) + (xy 259.204429 126.436039) (xy 259.204426 126.436037) (xy 259.20442 126.436035) (xy 259.204418 126.436034) + (xy 258.988826 126.36202) (xy 258.820188 126.33388) (xy 258.763977 126.3245) (xy 258.536023 126.3245) + (xy 258.491053 126.332004) (xy 258.311173 126.36202) (xy 258.095581 126.436034) (xy 258.095567 126.43604) + (xy 257.895099 126.544527) (xy 257.89509 126.544533) (xy 257.715212 126.684538) (xy 257.715208 126.684541) + (xy 257.560814 126.852257) (xy 257.436137 127.043091) (xy 257.344569 127.251844) (xy 257.28861 127.47282) + (xy 257.288608 127.472831) (xy 257.269786 127.699993) (xy 257.269786 127.700006) (xy 257.288608 127.927168) + (xy 257.28861 127.927179) (xy 257.344569 128.148155) (xy 257.436137 128.356908) (xy 257.560814 128.547742) + (xy 257.604757 128.595477) (xy 257.680966 128.678262) (xy 257.715208 128.715458) (xy 257.715212 128.715461) + (xy 257.773357 128.760717) (xy 257.895094 128.855469) (xy 257.895096 128.85547) (xy 257.895099 128.855472) + (xy 257.977378 128.899999) (xy 258.095574 128.963963) (xy 258.156075 128.984733) (xy 258.311173 129.037979) + (xy 258.311175 129.037979) (xy 258.311177 129.03798) (xy 258.536023 129.0755) (xy 258.536024 129.0755) + (xy 258.763976 129.0755) (xy 258.763977 129.0755) (xy 258.988823 129.03798) (xy 259.204426 128.963963) + (xy 259.404906 128.855469) (xy 259.584794 128.715456) (xy 259.62422 128.672627) (xy 259.684105 128.636639) + (xy 259.753943 128.638739) (xy 259.811559 128.678262) (xy 259.838661 128.742662) (xy 259.835654 128.787052) + (xy 259.78861 128.97282) (xy 259.788608 128.972831) (xy 259.769786 129.199993) (xy 259.769786 129.200006) + (xy 259.788608 129.427168) (xy 259.78861 129.427176) (xy 259.833831 129.60575) (xy 259.835654 129.612946) + (xy 259.833029 129.682767) (xy 259.793073 129.740084) (xy 259.728472 129.766701) (xy 259.659736 129.754167) + (xy 259.624219 129.727371) (xy 259.614504 129.716818) (xy 259.584794 129.684544) (xy 259.584789 129.68454) + (xy 259.584787 129.684538) (xy 259.404909 129.544533) (xy 259.4049 129.544527) (xy 259.204432 129.43604) + (xy 259.204429 129.436039) (xy 259.204426 129.436037) (xy 259.20442 129.436035) (xy 259.204418 129.436034) + (xy 258.988826 129.36202) (xy 258.820188 129.33388) (xy 258.763977 129.3245) (xy 258.536023 129.3245) + (xy 258.491053 129.332004) (xy 258.311173 129.36202) (xy 258.095581 129.436034) (xy 258.095567 129.43604) + (xy 257.895099 129.544527) (xy 257.89509 129.544533) (xy 257.715212 129.684538) (xy 257.715208 129.684541) + (xy 257.560814 129.852257) (xy 257.436137 130.043091) (xy 257.344569 130.251844) (xy 257.28861 130.47282) + (xy 257.288608 130.472831) (xy 257.269786 130.699993) (xy 257.269786 130.700006) (xy 257.288608 130.927168) + (xy 257.28861 130.927179) (xy 257.344569 131.148155) (xy 257.436137 131.356908) (xy 257.560814 131.547742) + (xy 257.604757 131.595477) (xy 257.705142 131.704524) (xy 257.715208 131.715458) (xy 257.715212 131.715461) + (xy 257.870638 131.836434) (xy 257.895094 131.855469) (xy 257.895096 131.85547) (xy 257.895099 131.855472) + (xy 257.930589 131.874678) (xy 258.095574 131.963963) (xy 258.207529 132.002397) (xy 258.311173 132.037979) + (xy 258.311175 132.037979) (xy 258.311177 132.03798) (xy 258.536023 132.0755) (xy 258.536024 132.0755) + (xy 258.763976 132.0755) (xy 258.763977 132.0755) (xy 258.988823 132.03798) (xy 259.204426 131.963963) + (xy 259.404906 131.855469) (xy 259.584794 131.715456) (xy 259.62422 131.672627) (xy 259.684105 131.636639) + (xy 259.753943 131.638739) (xy 259.811559 131.678262) (xy 259.838661 131.742662) (xy 259.835654 131.787052) + (xy 259.78861 131.97282) (xy 259.788608 131.972831) (xy 259.769786 132.199993) (xy 259.769786 132.200006) + (xy 259.788608 132.427168) (xy 259.78861 132.427176) (xy 259.822427 132.560717) (xy 259.835654 132.612946) + (xy 259.833029 132.682767) (xy 259.793073 132.740084) (xy 259.728472 132.766701) (xy 259.659736 132.754167) + (xy 259.624219 132.727371) (xy 259.61903 132.721734) (xy 259.584794 132.684544) (xy 259.584789 132.68454) + (xy 259.584787 132.684538) (xy 259.404909 132.544533) (xy 259.4049 132.544527) (xy 259.204432 132.43604) + (xy 259.204429 132.436039) (xy 259.204426 132.436037) (xy 259.20442 132.436035) (xy 259.204418 132.436034) + (xy 258.988826 132.36202) (xy 258.820188 132.33388) (xy 258.763977 132.3245) (xy 258.536023 132.3245) + (xy 258.491053 132.332004) (xy 258.311173 132.36202) (xy 258.095581 132.436034) (xy 258.095567 132.43604) + (xy 257.895099 132.544527) (xy 257.89509 132.544533) (xy 257.715212 132.684538) (xy 257.715208 132.684541) + (xy 257.560814 132.852257) (xy 257.436137 133.043091) (xy 257.344569 133.251844) (xy 257.28861 133.47282) + (xy 257.288608 133.472831) (xy 257.269786 133.699993) (xy 257.269786 133.700006) (xy 257.288608 133.927168) + (xy 257.28861 133.927179) (xy 257.344569 134.148155) (xy 257.436137 134.356908) (xy 257.560814 134.547742) + (xy 257.715208 134.715458) (xy 257.715212 134.715461) (xy 257.779465 134.765471) (xy 257.895094 134.855469) + (xy 257.895096 134.85547) (xy 257.895099 134.855472) (xy 258.011646 134.918543) (xy 258.095574 134.963963) + (xy 258.207529 135.002397) (xy 258.311173 135.037979) (xy 258.311175 135.037979) (xy 258.311177 135.03798) + (xy 258.536023 135.0755) (xy 258.536024 135.0755) (xy 258.763976 135.0755) (xy 258.763977 135.0755) + (xy 258.988823 135.03798) (xy 259.204426 134.963963) (xy 259.404906 134.855469) (xy 259.584794 134.715456) + (xy 259.739183 134.547745) (xy 259.863862 134.356909) (xy 259.95543 134.148155) (xy 260.01139 133.927176) + (xy 260.011391 133.927168) (xy 260.030214 133.700006) (xy 260.030214 133.699993) (xy 260.011391 133.472831) + (xy 260.011387 133.472811) (xy 259.964346 133.287053) (xy 259.96697 133.217233) (xy 260.006926 133.159915) + (xy 260.071527 133.133298) (xy 260.140263 133.145832) (xy 260.17578 133.172628) (xy 260.215206 133.215456) + (xy 260.215209 133.215458) (xy 260.215212 133.215461) (xy 260.389689 133.351262) (xy 260.395094 133.355469) + (xy 260.395096 133.35547) (xy 260.395099 133.355472) (xy 260.477378 133.399999) (xy 260.595574 133.463963) + (xy 260.661781 133.486692) (xy 260.811173 133.537979) (xy 260.811175 133.537979) (xy 260.811177 133.53798) + (xy 261.036023 133.5755) (xy 261.036024 133.5755) (xy 261.263976 133.5755) (xy 261.263977 133.5755) + (xy 261.488823 133.53798) (xy 261.704426 133.463963) (xy 261.904906 133.355469) (xy 262.084794 133.215456) + (xy 262.239183 133.047745) (xy 262.363862 132.856909) (xy 262.45543 132.648155) (xy 262.51139 132.427176) + (xy 262.519898 132.3245) (xy 262.526424 132.245745) (xy 262.543679 132.201026) (xy 262.755527 132.201026) + (xy 262.771456 132.230994) (xy 262.773576 132.245745) (xy 262.788608 132.427168) (xy 262.78861 132.427179) + (xy 262.844569 132.648155) (xy 262.936137 132.856908) (xy 263.060814 133.047742) (xy 263.12411 133.1165) + (xy 263.1947 133.193181) (xy 263.215208 133.215458) (xy 263.215212 133.215461) (xy 263.389689 133.351262) + (xy 263.395094 133.355469) (xy 263.395096 133.35547) (xy 263.395099 133.355472) (xy 263.477378 133.399999) + (xy 263.595574 133.463963) (xy 263.661781 133.486692) (xy 263.811173 133.537979) (xy 263.811175 133.537979) + (xy 263.811177 133.53798) (xy 264.036023 133.5755) (xy 264.036024 133.5755) (xy 264.263976 133.5755) + (xy 264.263977 133.5755) (xy 264.488823 133.53798) (xy 264.704426 133.463963) (xy 264.904906 133.355469) + (xy 265.084794 133.215456) (xy 265.12422 133.172627) (xy 265.184105 133.136639) (xy 265.253943 133.138739) + (xy 265.311559 133.178262) (xy 265.338661 133.242662) (xy 265.335654 133.287052) (xy 265.28861 133.47282) + (xy 265.288608 133.472831) (xy 265.269786 133.699993) (xy 265.269786 133.700006) (xy 265.288608 133.927168) + (xy 265.28861 133.927179) (xy 265.344569 134.148155) (xy 265.436137 134.356908) (xy 265.560814 134.547742) + (xy 265.715208 134.715458) (xy 265.715212 134.715461) (xy 265.779465 134.765471) (xy 265.895094 134.855469) + (xy 265.895096 134.85547) (xy 265.895099 134.855472) (xy 266.011646 134.918543) (xy 266.095574 134.963963) + (xy 266.207529 135.002397) (xy 266.311173 135.037979) (xy 266.311175 135.037979) (xy 266.311177 135.03798) + (xy 266.536023 135.0755) (xy 266.536024 135.0755) (xy 266.763976 135.0755) (xy 266.763977 135.0755) + (xy 266.988823 135.03798) (xy 267.204426 134.963963) (xy 267.404906 134.855469) (xy 267.584794 134.715456) + (xy 267.739183 134.547745) (xy 267.863862 134.356909) (xy 267.95543 134.148155) (xy 268.01139 133.927176) + (xy 268.011391 133.927168) (xy 268.030214 133.700006) (xy 268.030214 133.699993) (xy 268.011391 133.472831) + (xy 268.011389 133.47282) (xy 267.95543 133.251844) (xy 267.863862 133.043091) (xy 267.739185 132.852257) + (xy 267.651322 132.756813) (xy 267.584794 132.684544) (xy 267.584793 132.684543) (xy 267.584791 132.684541) + (xy 267.584787 132.684538) (xy 267.404909 132.544533) (xy 267.4049 132.544527) (xy 267.204432 132.43604) + (xy 267.204429 132.436039) (xy 267.204426 132.436037) (xy 267.20442 132.436035) (xy 267.204418 132.436034) + (xy 266.988826 132.36202) (xy 266.820188 132.33388) (xy 266.763977 132.3245) (xy 266.536023 132.3245) + (xy 266.491053 132.332004) (xy 266.311173 132.36202) (xy 266.095581 132.436034) (xy 266.095567 132.43604) + (xy 265.895099 132.544527) (xy 265.89509 132.544533) (xy 265.715212 132.684538) (xy 265.715207 132.684543) + (xy 265.675779 132.727372) (xy 265.615892 132.763361) (xy 265.546053 132.76126) (xy 265.488438 132.721734) + (xy 265.461338 132.657334) (xy 265.464346 132.612946) (xy 265.477573 132.560717) (xy 265.51139 132.427176) + (xy 265.519898 132.3245) (xy 265.530214 132.200006) (xy 265.530214 132.199993) (xy 265.511391 131.972831) + (xy 265.511387 131.972811) (xy 265.464346 131.787053) (xy 265.46697 131.717233) (xy 265.506926 131.659915) + (xy 265.571527 131.633298) (xy 265.640263 131.645832) (xy 265.67578 131.672628) (xy 265.715206 131.715456) + (xy 265.715209 131.715458) (xy 265.715212 131.715461) (xy 265.870638 131.836434) (xy 265.895094 131.855469) + (xy 265.895096 131.85547) (xy 265.895099 131.855472) (xy 265.930589 131.874678) (xy 266.095574 131.963963) + (xy 266.207529 132.002397) (xy 266.311173 132.037979) (xy 266.311175 132.037979) (xy 266.311177 132.03798) + (xy 266.536023 132.0755) (xy 266.536024 132.0755) (xy 266.763976 132.0755) (xy 266.763977 132.0755) + (xy 266.988823 132.03798) (xy 267.204426 131.963963) (xy 267.404906 131.855469) (xy 267.584794 131.715456) + (xy 267.739183 131.547745) (xy 267.863862 131.356909) (xy 267.95543 131.148155) (xy 268.01139 130.927176) + (xy 268.026106 130.749579) (xy 268.030214 130.700006) (xy 268.030214 130.699993) (xy 268.011391 130.472831) + (xy 268.011389 130.47282) (xy 267.95543 130.251844) (xy 267.863862 130.043091) (xy 267.739185 129.852257) + (xy 267.660425 129.766701) (xy 267.584794 129.684544) (xy 267.584793 129.684543) (xy 267.584791 129.684541) + (xy 267.584787 129.684538) (xy 267.404909 129.544533) (xy 267.4049 129.544527) (xy 267.204432 129.43604) + (xy 267.204429 129.436039) (xy 267.204426 129.436037) (xy 267.20442 129.436035) (xy 267.204418 129.436034) + (xy 266.988826 129.36202) (xy 266.820188 129.33388) (xy 266.763977 129.3245) (xy 266.536023 129.3245) + (xy 266.491053 129.332004) (xy 266.311173 129.36202) (xy 266.095581 129.436034) (xy 266.095567 129.43604) + (xy 265.895099 129.544527) (xy 265.89509 129.544533) (xy 265.715212 129.684538) (xy 265.715208 129.684541) + (xy 265.560814 129.852257) (xy 265.436137 130.043091) (xy 265.344569 130.251844) (xy 265.28861 130.47282) + (xy 265.288608 130.472831) (xy 265.269786 130.699993) (xy 265.269786 130.700006) (xy 265.288608 130.927168) + (xy 265.28861 130.927176) (xy 265.33323 131.103376) (xy 265.335654 131.112946) (xy 265.333029 131.182767) + (xy 265.293073 131.240084) (xy 265.228472 131.266701) (xy 265.159736 131.254167) (xy 265.124219 131.227371) + (xy 265.108627 131.210434) (xy 265.084794 131.184544) (xy 265.084789 131.18454) (xy 265.084787 131.184538) + (xy 264.904909 131.044533) (xy 264.9049 131.044527) (xy 264.704432 130.93604) (xy 264.704429 130.936039) + (xy 264.704426 130.936037) (xy 264.70442 130.936035) (xy 264.704418 130.936034) (xy 264.488826 130.86202) + (xy 264.320188 130.83388) (xy 264.263977 130.8245) (xy 264.036023 130.8245) (xy 263.991053 130.832004) + (xy 263.811173 130.86202) (xy 263.595581 130.936034) (xy 263.595567 130.93604) (xy 263.395099 131.044527) + (xy 263.39509 131.044533) (xy 263.215212 131.184538) (xy 263.215208 131.184541) (xy 263.060814 131.352257) + (xy 262.936137 131.543091) (xy 262.844569 131.751844) (xy 262.78861 131.97282) (xy 262.788608 131.972831) + (xy 262.773576 132.154254) (xy 262.755527 132.201026) (xy 262.543679 132.201026) (xy 262.544472 132.198972) + (xy 262.528544 132.169005) (xy 262.526424 132.154254) (xy 262.511391 131.972831) (xy 262.511389 131.97282) + (xy 262.45543 131.751844) (xy 262.363862 131.543091) (xy 262.239185 131.352257) (xy 262.155416 131.26126) + (xy 262.084794 131.184544) (xy 262.084793 131.184543) (xy 262.084791 131.184541) (xy 262.084787 131.184538) + (xy 261.904909 131.044533) (xy 261.9049 131.044527) (xy 261.704432 130.93604) (xy 261.704429 130.936039) + (xy 261.704426 130.936037) (xy 261.70442 130.936035) (xy 261.704418 130.936034) (xy 261.488826 130.86202) + (xy 261.320188 130.83388) (xy 261.263977 130.8245) (xy 261.036023 130.8245) (xy 260.991053 130.832004) + (xy 260.811173 130.86202) (xy 260.595581 130.936034) (xy 260.595567 130.93604) (xy 260.395099 131.044527) + (xy 260.39509 131.044533) (xy 260.215212 131.184538) (xy 260.215207 131.184543) (xy 260.175779 131.227372) + (xy 260.115892 131.263361) (xy 260.046053 131.26126) (xy 259.988438 131.221734) (xy 259.961338 131.157334) + (xy 259.964346 131.112946) (xy 259.96677 131.103376) (xy 260.01139 130.927176) (xy 260.026106 130.749579) + (xy 260.030214 130.700006) (xy 260.030214 130.699993) (xy 260.011391 130.472831) (xy 260.011387 130.472811) + (xy 259.964346 130.287053) (xy 259.96697 130.217233) (xy 260.006926 130.159915) (xy 260.071527 130.133298) + (xy 260.140263 130.145832) (xy 260.17578 130.172628) (xy 260.215206 130.215456) (xy 260.215209 130.215458) + (xy 260.215212 130.215461) (xy 260.38654 130.348811) (xy 260.395094 130.355469) (xy 260.395096 130.35547) + (xy 260.395099 130.355472) (xy 260.485228 130.404247) (xy 260.595574 130.463963) (xy 260.663561 130.487303) + (xy 260.811173 130.537979) (xy 260.811175 130.537979) (xy 260.811177 130.53798) (xy 261.036023 130.5755) + (xy 261.036024 130.5755) (xy 261.263976 130.5755) (xy 261.263977 130.5755) (xy 261.488823 130.53798) + (xy 261.704426 130.463963) (xy 261.904906 130.355469) (xy 262.084794 130.215456) (xy 262.239183 130.047745) + (xy 262.363862 129.856909) (xy 262.45543 129.648155) (xy 262.51139 129.427176) (xy 262.511391 129.427168) + (xy 262.530214 129.200006) (xy 262.530214 129.199993) (xy 262.511391 128.972831) (xy 262.511389 128.97282) + (xy 262.45543 128.751844) (xy 262.363862 128.543091) (xy 262.239185 128.352257) (xy 262.113082 128.215273) + (xy 262.084794 128.184544) (xy 262.084793 128.184543) (xy 262.084791 128.184541) (xy 262.084787 128.184538) + (xy 261.904909 128.044533) (xy 261.9049 128.044527) (xy 261.704432 127.93604) (xy 261.704429 127.936039) + (xy 261.704426 127.936037) (xy 261.70442 127.936035) (xy 261.704418 127.936034) (xy 261.488826 127.86202) + (xy 261.320188 127.83388) (xy 261.263977 127.8245) (xy 261.036023 127.8245) (xy 260.991053 127.832004) + (xy 260.811173 127.86202) (xy 260.595581 127.936034) (xy 260.595567 127.93604) (xy 260.395099 128.044527) + (xy 260.39509 128.044533) (xy 260.215212 128.184538) (xy 260.215207 128.184543) (xy 260.175779 128.227372) + (xy 260.115892 128.263361) (xy 260.046053 128.26126) (xy 259.988438 128.221734) (xy 259.961338 128.157334) + (xy 259.964346 128.112946) (xy 259.982449 128.041462) (xy 260.01139 127.927176) (xy 260.011391 127.927168) + (xy 260.030214 127.700006) (xy 260.030214 127.699993) (xy 260.011391 127.472831) (xy 260.011387 127.472811) + (xy 259.964346 127.287053) (xy 259.96697 127.217233) (xy 260.006926 127.159915) (xy 260.071527 127.133298) + (xy 260.140263 127.145832) (xy 260.17578 127.172628) (xy 260.215206 127.215456) (xy 260.215209 127.215458) + (xy 260.215212 127.215461) (xy 260.39509 127.355466) (xy 260.395094 127.355469) (xy 260.395096 127.35547) + (xy 260.395099 127.355472) (xy 260.511646 127.418543) (xy 260.595574 127.463963) (xy 260.707529 127.502397) + (xy 260.811173 127.537979) (xy 260.811175 127.537979) (xy 260.811177 127.53798) (xy 261.036023 127.5755) + (xy 261.036024 127.5755) (xy 261.263976 127.5755) (xy 261.263977 127.5755) (xy 261.488823 127.53798) + (xy 261.704426 127.463963) (xy 261.904906 127.355469) (xy 262.084794 127.215456) (xy 262.239183 127.047745) + (xy 262.363862 126.856909) (xy 262.45543 126.648155) (xy 262.51139 126.427176) (xy 262.513642 126.399999) + (xy 262.526424 126.245745) (xy 262.543679 126.201026) (xy 262.755527 126.201026) (xy 262.771456 126.230994) + (xy 262.773576 126.245745) (xy 262.788608 126.427168) (xy 262.78861 126.427179) (xy 262.844569 126.648155) + (xy 262.936137 126.856908) (xy 263.060814 127.047742) (xy 263.097233 127.087303) (xy 263.205142 127.204524) + (xy 263.215208 127.215458) (xy 263.215212 127.215461) (xy 263.39509 127.355466) (xy 263.395094 127.355469) + (xy 263.395096 127.35547) (xy 263.395099 127.355472) (xy 263.511646 127.418543) (xy 263.595574 127.463963) + (xy 263.707529 127.502397) (xy 263.811173 127.537979) (xy 263.811175 127.537979) (xy 263.811177 127.53798) + (xy 264.036023 127.5755) (xy 264.036024 127.5755) (xy 264.263976 127.5755) (xy 264.263977 127.5755) + (xy 264.488823 127.53798) (xy 264.704426 127.463963) (xy 264.904906 127.355469) (xy 265.084794 127.215456) + (xy 265.12422 127.172627) (xy 265.184105 127.136639) (xy 265.253943 127.138739) (xy 265.311559 127.178262) + (xy 265.338661 127.242662) (xy 265.335654 127.287052) (xy 265.28861 127.47282) (xy 265.288608 127.472831) + (xy 265.269786 127.699993) (xy 265.269786 127.700006) (xy 265.288608 127.927168) (xy 265.28861 127.927179) + (xy 265.344569 128.148155) (xy 265.436137 128.356908) (xy 265.560814 128.547742) (xy 265.604757 128.595477) + (xy 265.680966 128.678262) (xy 265.715208 128.715458) (xy 265.715212 128.715461) (xy 265.773357 128.760717) + (xy 265.895094 128.855469) (xy 265.895096 128.85547) (xy 265.895099 128.855472) (xy 265.977378 128.899999) + (xy 266.095574 128.963963) (xy 266.156075 128.984733) (xy 266.311173 129.037979) (xy 266.311175 129.037979) + (xy 266.311177 129.03798) (xy 266.536023 129.0755) (xy 266.536024 129.0755) (xy 266.763976 129.0755) + (xy 266.763977 129.0755) (xy 266.988823 129.03798) (xy 267.204426 128.963963) (xy 267.404906 128.855469) + (xy 267.584794 128.715456) (xy 267.739183 128.547745) (xy 267.863862 128.356909) (xy 267.95543 128.148155) + (xy 268.01139 127.927176) (xy 268.011391 127.927168) (xy 268.030214 127.700006) (xy 268.030214 127.699993) + (xy 268.011391 127.472831) (xy 268.011389 127.47282) (xy 267.95543 127.251844) (xy 267.863862 127.043091) + (xy 267.739185 126.852257) (xy 267.655416 126.76126) (xy 267.584794 126.684544) (xy 267.584793 126.684543) + (xy 267.584791 126.684541) (xy 267.584787 126.684538) (xy 267.404909 126.544533) (xy 267.4049 126.544527) + (xy 267.204432 126.43604) (xy 267.204429 126.436039) (xy 267.204426 126.436037) (xy 267.20442 126.436035) + (xy 267.204418 126.436034) (xy 266.988826 126.36202) (xy 266.820188 126.33388) (xy 266.763977 126.3245) + (xy 266.536023 126.3245) (xy 266.491053 126.332004) (xy 266.311173 126.36202) (xy 266.095581 126.436034) + (xy 266.095567 126.43604) (xy 265.895099 126.544527) (xy 265.89509 126.544533) (xy 265.715212 126.684538) + (xy 265.715207 126.684543) (xy 265.675779 126.727372) (xy 265.615892 126.763361) (xy 265.546053 126.76126) + (xy 265.488438 126.721734) (xy 265.461338 126.657334) (xy 265.464346 126.612946) (xy 265.468771 126.595475) + (xy 265.51139 126.427176) (xy 265.513642 126.399999) (xy 265.530214 126.200006) (xy 265.530214 126.199993) + (xy 265.511391 125.972831) (xy 265.511387 125.972811) (xy 265.464346 125.787053) (xy 265.46697 125.717233) + (xy 265.506926 125.659915) (xy 265.571527 125.633298) (xy 265.640263 125.645832) (xy 265.67578 125.672628) + (xy 265.715206 125.715456) (xy 265.715209 125.715458) (xy 265.715212 125.715461) (xy 265.89509 125.855466) + (xy 265.895094 125.855469) (xy 265.895096 125.85547) (xy 265.895099 125.855472) (xy 265.904791 125.860717) + (xy 266.095574 125.963963) (xy 266.207529 126.002397) (xy 266.311173 126.037979) (xy 266.311175 126.037979) + (xy 266.311177 126.03798) (xy 266.536023 126.0755) (xy 266.536024 126.0755) (xy 266.763976 126.0755) + (xy 266.763977 126.0755) (xy 266.988823 126.03798) (xy 267.204426 125.963963) (xy 267.404906 125.855469) + (xy 267.476174 125.799999) (xy 268.044722 125.799999) (xy 268.044722 125.8) (xy 268.063762 125.956818) + (xy 268.116349 126.095476) (xy 268.11978 126.104523) (xy 268.209517 126.23453) (xy 268.32776 126.339283) + (xy 268.327762 126.339284) (xy 268.467634 126.412696) (xy 268.621014 126.4505) (xy 268.621015 126.4505) + (xy 268.778985 126.4505) (xy 268.932365 126.412696) (xy 268.956557 126.399999) (xy 269.07224 126.339283) + (xy 269.190483 126.23453) (xy 269.28022 126.104523) (xy 269.336237 125.956818) (xy 269.355278 125.8) + (xy 269.353737 125.787304) (xy 269.336237 125.643181) (xy 269.301087 125.5505) (xy 269.28022 125.495477) + (xy 269.190483 125.36547) (xy 269.07224 125.260717) (xy 269.072238 125.260716) (xy 269.072237 125.260715) + (xy 268.932365 125.187303) (xy 268.778986 125.1495) (xy 268.778985 125.1495) (xy 268.621015 125.1495) + (xy 268.621014 125.1495) (xy 268.467634 125.187303) (xy 268.327762 125.260715) (xy 268.31862 125.268814) + (xy 268.219181 125.356909) (xy 268.209516 125.365471) (xy 268.119781 125.495475) (xy 268.11978 125.495476) + (xy 268.063762 125.643181) (xy 268.044722 125.799999) (xy 267.476174 125.799999) (xy 267.584794 125.715456) + (xy 267.739183 125.547745) (xy 267.863862 125.356909) (xy 267.95543 125.148155) (xy 268.01139 124.927176) + (xy 268.013763 124.898538) (xy 268.030214 124.700006) (xy 268.030214 124.699993) (xy 268.011391 124.472831) + (xy 268.011389 124.47282) (xy 267.95543 124.251844) (xy 267.863862 124.043091) (xy 267.739185 123.852257) + (xy 267.691078 123.799999) (xy 269.644718 123.799999) (xy 269.644718 123.8) (xy 269.663758 123.956818) + (xy 269.698243 124.047745) (xy 269.719776 124.104523) (xy 269.809513 124.23453) (xy 269.927756 124.339283) + (xy 269.927758 124.339284) (xy 270.06763 124.412696) (xy 270.22101 124.4505) (xy 270.221011 124.4505) + (xy 270.378981 124.4505) (xy 270.532361 124.412696) (xy 270.631397 124.360717) (xy 270.672236 124.339283) + (xy 270.790479 124.23453) (xy 270.880216 124.104523) (xy 270.936233 123.956818) (xy 270.955274 123.8) + (xy 270.941255 123.684538) (xy 270.936233 123.643181) (xy 270.89882 123.544533) (xy 270.880216 123.495477) + (xy 270.790479 123.36547) (xy 270.672236 123.260717) (xy 270.672234 123.260716) (xy 270.672233 123.260715) + (xy 270.532361 123.187303) (xy 270.378982 123.1495) (xy 270.378981 123.1495) (xy 270.221011 123.1495) + (xy 270.22101 123.1495) (xy 270.06763 123.187303) (xy 269.927758 123.260715) (xy 269.855759 123.3245) + (xy 269.820316 123.3559) (xy 269.809512 123.365471) (xy 269.719777 123.495475) (xy 269.719776 123.495476) + (xy 269.663758 123.643181) (xy 269.644718 123.799999) (xy 267.691078 123.799999) (xy 267.660425 123.766701) + (xy 267.584794 123.684544) (xy 267.584793 123.684543) (xy 267.584791 123.684541) (xy 267.584787 123.684538) + (xy 267.404909 123.544533) (xy 267.4049 123.544527) (xy 267.204432 123.43604) (xy 267.204429 123.436039) + (xy 267.204426 123.436037) (xy 267.20442 123.436035) (xy 267.204418 123.436034) (xy 266.988826 123.36202) + (xy 266.820188 123.33388) (xy 266.763977 123.3245) (xy 266.536023 123.3245) (xy 266.491053 123.332004) + (xy 266.311173 123.36202) (xy 266.095581 123.436034) (xy 266.095567 123.43604) (xy 265.895099 123.544527) + (xy 265.89509 123.544533) (xy 265.715212 123.684538) (xy 265.715208 123.684541) (xy 265.560814 123.852257) + (xy 265.436137 124.043091) (xy 265.344569 124.251844) (xy 265.28861 124.47282) (xy 265.288608 124.472831) + (xy 265.269786 124.699993) (xy 265.269786 124.700006) (xy 265.288608 124.927168) (xy 265.28861 124.927176) + (xy 265.335654 125.112946) (xy 265.333029 125.182767) (xy 265.293073 125.240084) (xy 265.228472 125.266701) + (xy 265.159736 125.254167) (xy 265.124219 125.227371) (xy 265.11903 125.221734) (xy 265.084794 125.184544) + (xy 265.084789 125.18454) (xy 265.084787 125.184538) (xy 264.904909 125.044533) (xy 264.9049 125.044527) + (xy 264.704432 124.93604) (xy 264.704429 124.936039) (xy 264.704426 124.936037) (xy 264.70442 124.936035) + (xy 264.704418 124.936034) (xy 264.488826 124.86202) (xy 264.320188 124.83388) (xy 264.263977 124.8245) + (xy 264.036023 124.8245) (xy 263.991053 124.832004) (xy 263.811173 124.86202) (xy 263.595581 124.936034) + (xy 263.595567 124.93604) (xy 263.395099 125.044527) (xy 263.39509 125.044533) (xy 263.215212 125.184538) + (xy 263.215208 125.184541) (xy 263.060814 125.352257) (xy 262.936137 125.543091) (xy 262.844569 125.751844) + (xy 262.78861 125.97282) (xy 262.788608 125.972831) (xy 262.773576 126.154254) (xy 262.755527 126.201026) + (xy 262.543679 126.201026) (xy 262.544472 126.198972) (xy 262.528544 126.169005) (xy 262.526424 126.154254) + (xy 262.511391 125.972831) (xy 262.511389 125.97282) (xy 262.45543 125.751844) (xy 262.363862 125.543091) + (xy 262.239185 125.352257) (xy 262.154914 125.260715) (xy 262.084794 125.184544) (xy 262.084793 125.184543) + (xy 262.084791 125.184541) (xy 262.084787 125.184538) (xy 261.904909 125.044533) (xy 261.9049 125.044527) + (xy 261.704432 124.93604) (xy 261.704429 124.936039) (xy 261.704426 124.936037) (xy 261.70442 124.936035) + (xy 261.704418 124.936034) (xy 261.488826 124.86202) (xy 261.320188 124.83388) (xy 261.263977 124.8245) + (xy 261.036023 124.8245) (xy 260.991053 124.832004) (xy 260.811173 124.86202) (xy 260.595581 124.936034) + (xy 260.595567 124.93604) (xy 260.395099 125.044527) (xy 260.39509 125.044533) (xy 260.215212 125.184538) + (xy 260.215207 125.184543) (xy 260.175779 125.227372) (xy 260.115892 125.263361) (xy 260.046053 125.26126) + (xy 259.988438 125.221734) (xy 259.961338 125.157334) (xy 259.964346 125.112946) (xy 260.011387 124.927188) + (xy 260.011389 124.927179) (xy 260.01139 124.927176) (xy 260.013763 124.898538) (xy 260.030214 124.700006) + (xy 260.030214 124.699993) (xy 260.011391 124.472831) (xy 260.011387 124.472811) (xy 259.964346 124.287053) + (xy 259.96697 124.217233) (xy 260.006926 124.159915) (xy 260.071527 124.133298) (xy 260.140263 124.145832) + (xy 260.17578 124.172628) (xy 260.215206 124.215456) (xy 260.215209 124.215458) (xy 260.215212 124.215461) + (xy 260.39509 124.355466) (xy 260.395094 124.355469) (xy 260.395096 124.35547) (xy 260.395099 124.355472) + (xy 260.404791 124.360717) (xy 260.595574 124.463963) (xy 260.707529 124.502397) (xy 260.811173 124.537979) + (xy 260.811175 124.537979) (xy 260.811177 124.53798) (xy 261.036023 124.5755) (xy 261.036024 124.5755) + (xy 261.263976 124.5755) (xy 261.263977 124.5755) (xy 261.488823 124.53798) (xy 261.704426 124.463963) + (xy 261.904906 124.355469) (xy 262.084794 124.215456) (xy 262.239183 124.047745) (xy 262.363862 123.856909) + (xy 262.45543 123.648155) (xy 262.51139 123.427176) (xy 262.511391 123.427168) (xy 262.530214 123.200006) + (xy 262.530214 123.199993) (xy 262.511391 122.972831) (xy 262.511389 122.97282) (xy 262.45543 122.751844) + (xy 262.363862 122.543091) (xy 262.239185 122.352257) (xy 262.084791 122.184541) (xy 262.084787 122.184538) + (xy 261.904909 122.044533) (xy 261.9049 122.044527) (xy 261.704432 121.93604) (xy 261.704429 121.936039) + (xy 261.704426 121.936037) (xy 261.70442 121.936035) (xy 261.704418 121.936034) (xy 261.488826 121.86202) + (xy 261.320188 121.83388) (xy 261.263977 121.8245) (xy 261.036023 121.8245) (xy 260.991053 121.832004) + (xy 260.811173 121.86202) (xy 260.595581 121.936034) (xy 260.595567 121.93604) (xy 260.395099 122.044527) + (xy 260.39509 122.044533) (xy 260.215212 122.184538) (xy 260.215207 122.184543) (xy 260.175779 122.227372) + (xy 260.115892 122.263361) (xy 260.046053 122.26126) (xy 259.988438 122.221734) (xy 259.961338 122.157334) + (xy 259.964346 122.112946) (xy 260.011387 121.927188) (xy 260.011389 121.927179) (xy 260.01139 121.927176) + (xy 260.017223 121.856786) (xy 260.030214 121.700006) (xy 260.030214 121.699993) (xy 265.269786 121.699993) + (xy 265.269786 121.700006) (xy 265.288608 121.927168) (xy 265.28861 121.927179) (xy 265.344569 122.148155) + (xy 265.436137 122.356908) (xy 265.560814 122.547742) (xy 265.560817 122.547745) (xy 265.680966 122.678262) + (xy 265.715208 122.715458) (xy 265.715212 122.715461) (xy 265.839636 122.812304) (xy 265.895094 122.855469) + (xy 265.895096 122.85547) (xy 265.895099 122.855472) (xy 266.011646 122.918543) (xy 266.095574 122.963963) + (xy 266.172786 122.99047) (xy 266.311173 123.037979) (xy 266.311175 123.037979) (xy 266.311177 123.03798) + (xy 266.536023 123.0755) (xy 266.536024 123.0755) (xy 266.763976 123.0755) (xy 266.763977 123.0755) + (xy 266.988823 123.03798) (xy 267.204426 122.963963) (xy 267.404906 122.855469) (xy 267.584794 122.715456) + (xy 267.739183 122.547745) (xy 267.863862 122.356909) (xy 267.95543 122.148155) (xy 268.01139 121.927176) + (xy 268.017223 121.856786) (xy 268.030214 121.700006) (xy 268.030214 121.699993) (xy 268.030212 121.699967) + (xy 270.844722 121.699967) (xy 270.844722 121.699968) (xy 270.863762 121.856786) (xy 270.89505 121.939284) + (xy 270.91978 122.004491) (xy 271.009517 122.134498) (xy 271.12776 122.239251) (xy 271.127762 122.239252) + (xy 271.267634 122.312664) (xy 271.421014 122.350468) (xy 271.421015 122.350468) (xy 271.578985 122.350468) + (xy 271.732365 122.312664) (xy 271.87224 122.239251) (xy 271.990483 122.134498) (xy 272.08022 122.004491) + (xy 272.136237 121.856786) (xy 272.155278 121.699968) (xy 272.147333 121.63453) (xy 272.136237 121.543149) + (xy 272.114992 121.487132) (xy 272.08022 121.395445) (xy 271.990483 121.265438) (xy 271.87224 121.160685) + (xy 271.872238 121.160684) (xy 271.872237 121.160683) (xy 271.732365 121.087271) (xy 271.578986 121.049468) + (xy 271.578985 121.049468) (xy 271.421015 121.049468) (xy 271.421014 121.049468) (xy 271.267634 121.087271) + (xy 271.127762 121.160683) (xy 271.065933 121.215458) (xy 271.024861 121.251845) (xy 271.009516 121.265439) + (xy 270.919781 121.395443) (xy 270.91978 121.395444) (xy 270.863762 121.543149) (xy 270.844722 121.699967) + (xy 268.030212 121.699967) (xy 268.011391 121.472831) (xy 268.011389 121.47282) (xy 267.95543 121.251844) + (xy 267.863862 121.043091) (xy 267.739185 120.852257) (xy 267.651334 120.756826) (xy 267.584794 120.684544) + (xy 267.584793 120.684543) (xy 267.584791 120.684541) (xy 267.584787 120.684538) (xy 267.404909 120.544533) + (xy 267.4049 120.544527) (xy 267.204432 120.43604) (xy 267.204429 120.436039) (xy 267.204426 120.436037) + (xy 267.20442 120.436035) (xy 267.204418 120.436034) (xy 266.988826 120.36202) (xy 266.820188 120.33388) + (xy 266.763977 120.3245) (xy 266.536023 120.3245) (xy 266.491053 120.332004) (xy 266.311173 120.36202) + (xy 266.095581 120.436034) (xy 266.095567 120.43604) (xy 265.895099 120.544527) (xy 265.89509 120.544533) + (xy 265.715212 120.684538) (xy 265.715208 120.684541) (xy 265.560814 120.852257) (xy 265.436137 121.043091) + (xy 265.344569 121.251844) (xy 265.28861 121.47282) (xy 265.288608 121.472831) (xy 265.269786 121.699993) + (xy 260.030214 121.699993) (xy 260.011391 121.472831) (xy 260.011387 121.472811) (xy 259.964346 121.287053) + (xy 259.96697 121.217233) (xy 260.006926 121.159915) (xy 260.071527 121.133298) (xy 260.140263 121.145832) + (xy 260.17578 121.172628) (xy 260.215206 121.215456) (xy 260.215209 121.215458) (xy 260.215212 121.215461) + (xy 260.279424 121.265439) (xy 260.395094 121.355469) (xy 260.395096 121.35547) (xy 260.395099 121.355472) + (xy 260.468963 121.395445) (xy 260.595574 121.463963) (xy 260.707529 121.502397) (xy 260.811173 121.537979) + (xy 260.811175 121.537979) (xy 260.811177 121.53798) (xy 261.036023 121.5755) (xy 261.036024 121.5755) + (xy 261.263976 121.5755) (xy 261.263977 121.5755) (xy 261.488823 121.53798) (xy 261.704426 121.463963) + (xy 261.904906 121.355469) (xy 262.084794 121.215456) (xy 262.239183 121.047745) (xy 262.363862 120.856909) + (xy 262.45543 120.648155) (xy 262.51139 120.427176) (xy 262.519898 120.3245) (xy 262.530214 120.200006) + (xy 262.530214 120.199993) (xy 262.511391 119.972831) (xy 262.511389 119.97282) (xy 262.45543 119.751844) + (xy 262.363862 119.543091) (xy 262.239185 119.352257) (xy 262.084791 119.184541) (xy 262.084787 119.184538) + (xy 261.904909 119.044533) (xy 261.9049 119.044527) (xy 261.704432 118.93604) (xy 261.704429 118.936039) + (xy 261.704426 118.936037) (xy 261.70442 118.936035) (xy 261.704418 118.936034) (xy 261.488826 118.86202) + (xy 261.320188 118.83388) (xy 261.263977 118.8245) (xy 261.036023 118.8245) (xy 260.991053 118.832004) + (xy 260.811173 118.86202) (xy 260.595581 118.936034) (xy 260.595567 118.93604) (xy 260.395099 119.044527) + (xy 260.39509 119.044533) (xy 260.215212 119.184538) (xy 260.215207 119.184543) (xy 260.175779 119.227372) + (xy 260.115892 119.263361) (xy 260.046053 119.26126) (xy 259.988438 119.221734) (xy 259.961338 119.157334) + (xy 259.964346 119.112946) (xy 260.011387 118.927188) (xy 260.011389 118.927179) (xy 260.01139 118.927176) + (xy 260.019898 118.8245) (xy 260.030214 118.700006) (xy 260.030214 118.699993) (xy 265.269786 118.699993) + (xy 265.269786 118.700006) (xy 265.288608 118.927168) (xy 265.28861 118.927179) (xy 265.344569 119.148155) + (xy 265.436137 119.356908) (xy 265.560814 119.547742) (xy 265.560817 119.547745) (xy 265.680966 119.678262) + (xy 265.715208 119.715458) (xy 265.715212 119.715461) (xy 265.895094 119.855469) (xy 265.895096 119.85547) + (xy 265.895099 119.855472) (xy 266.010139 119.917728) (xy 266.095574 119.963963) (xy 266.163584 119.987311) + (xy 266.311173 120.037979) (xy 266.311175 120.037979) (xy 266.311177 120.03798) (xy 266.536023 120.0755) + (xy 266.536024 120.0755) (xy 266.763976 120.0755) (xy 266.763977 120.0755) (xy 266.988823 120.03798) + (xy 267.204426 119.963963) (xy 267.404906 119.855469) (xy 267.584794 119.715456) (xy 267.739183 119.547745) + (xy 267.863862 119.356909) (xy 267.95543 119.148155) (xy 268.01139 118.927176) (xy 268.019898 118.8245) + (xy 268.030214 118.700006) (xy 268.030214 118.699993) (xy 268.011391 118.472831) (xy 268.011389 118.47282) + (xy 267.95543 118.251844) (xy 267.863862 118.043091) (xy 267.739185 117.852257) (xy 267.660425 117.766701) + (xy 267.584794 117.684544) (xy 267.584793 117.684543) (xy 267.584791 117.684541) (xy 267.584787 117.684538) + (xy 267.404909 117.544533) (xy 267.4049 117.544527) (xy 267.204432 117.43604) (xy 267.204429 117.436039) + (xy 267.204426 117.436037) (xy 267.20442 117.436035) (xy 267.204418 117.436034) (xy 266.988826 117.36202) + (xy 266.820188 117.33388) (xy 266.763977 117.3245) (xy 266.536023 117.3245) (xy 266.491053 117.332004) + (xy 266.311173 117.36202) (xy 266.095581 117.436034) (xy 266.095567 117.43604) (xy 265.895099 117.544527) + (xy 265.89509 117.544533) (xy 265.715212 117.684538) (xy 265.715208 117.684541) (xy 265.560814 117.852257) + (xy 265.436137 118.043091) (xy 265.344569 118.251844) (xy 265.28861 118.47282) (xy 265.288608 118.472831) + (xy 265.269786 118.699993) (xy 260.030214 118.699993) (xy 260.011391 118.472831) (xy 260.011387 118.472811) + (xy 259.964346 118.287053) (xy 259.96697 118.217233) (xy 260.006926 118.159915) (xy 260.071527 118.133298) + (xy 260.140263 118.145832) (xy 260.17578 118.172628) (xy 260.215206 118.215456) (xy 260.215209 118.215458) + (xy 260.215212 118.215461) (xy 260.363696 118.331031) (xy 260.395094 118.355469) (xy 260.395096 118.35547) + (xy 260.395099 118.355472) (xy 260.511646 118.418543) (xy 260.595574 118.463963) (xy 260.707529 118.502397) + (xy 260.811173 118.537979) (xy 260.811175 118.537979) (xy 260.811177 118.53798) (xy 261.036023 118.5755) + (xy 261.036024 118.5755) (xy 261.263976 118.5755) (xy 261.263977 118.5755) (xy 261.488823 118.53798) + (xy 261.704426 118.463963) (xy 261.904906 118.355469) (xy 262.084794 118.215456) (xy 262.239183 118.047745) + (xy 262.363862 117.856909) (xy 262.45543 117.648155) (xy 262.51139 117.427176) (xy 262.523958 117.2755) + (xy 262.530214 117.200006) (xy 262.530214 117.199993) (xy 262.511391 116.972831) (xy 262.511389 116.97282) + (xy 262.45543 116.751844) (xy 262.363862 116.543091) (xy 262.239185 116.352257) (xy 262.12422 116.227372) + (xy 262.084794 116.184544) (xy 262.084793 116.184543) (xy 262.084791 116.184541) (xy 262.084787 116.184538) (xy 261.904909 116.044533) (xy 261.9049 116.044527) (xy 261.704432 115.93604) (xy 261.704429 115.936039) (xy 261.704426 115.936037) (xy 261.70442 115.936035) (xy 261.704418 115.936034) (xy 261.488826 115.86202) (xy 261.320188 115.83388) (xy 261.263977 115.8245) (xy 261.036023 115.8245) (xy 260.991053 115.832004) (xy 260.811173 115.86202) (xy 260.595581 115.936034) (xy 260.595567 115.93604) (xy 260.395099 116.044527) (xy 260.39509 116.044533) (xy 260.215212 116.184538) (xy 260.215207 116.184543) (xy 260.175779 116.227372) (xy 260.115892 116.263361) (xy 260.046053 116.26126) (xy 259.988438 116.221734) (xy 259.961338 116.157334) - (xy 259.964346 116.112946) (xy 259.976599 116.064563) (xy 260.01139 115.927176) (xy 260.01221 115.917279) + (xy 259.964346 116.112946) (xy 259.976599 116.064563) (xy 260.01139 115.927176) (xy 260.011391 115.927168) (xy 260.030214 115.700006) (xy 260.030214 115.699993) (xy 265.269786 115.699993) (xy 265.269786 115.700006) (xy 265.288608 115.927168) (xy 265.28861 115.927179) (xy 265.344569 116.148155) (xy 265.436137 116.356908) (xy 265.560814 116.547742) (xy 265.560817 116.547745) (xy 265.680966 116.678262) (xy 265.715208 116.715458) @@ -173765,28 +178257,30 @@ (xy 266.311173 117.037979) (xy 266.311175 117.037979) (xy 266.311177 117.03798) (xy 266.536023 117.0755) (xy 266.536024 117.0755) (xy 266.763976 117.0755) (xy 266.763977 117.0755) (xy 266.988823 117.03798) (xy 267.204426 116.963963) (xy 267.404906 116.855469) (xy 267.584794 116.715456) (xy 267.739183 116.547745) - (xy 267.863862 116.356909) (xy 267.95543 116.148155) (xy 268.01139 115.927176) (xy 268.01221 115.917279) + (xy 267.863862 116.356909) (xy 267.95543 116.148155) (xy 268.01139 115.927176) (xy 268.011391 115.927168) (xy 268.030214 115.700006) (xy 268.030214 115.699993) (xy 268.011391 115.472831) (xy 268.011389 115.47282) - (xy 267.95543 115.251844) (xy 267.863862 115.043091) (xy 267.739185 114.852257) (xy 267.584791 114.684541) - (xy 267.584787 114.684538) (xy 267.404909 114.544533) (xy 267.4049 114.544527) (xy 267.204432 114.43604) - (xy 267.204429 114.436039) (xy 267.204426 114.436037) (xy 267.20442 114.436035) (xy 267.204418 114.436034) - (xy 266.988826 114.36202) (xy 266.820188 114.33388) (xy 266.763977 114.3245) (xy 266.536023 114.3245) - (xy 266.491053 114.332004) (xy 266.311173 114.36202) (xy 266.095581 114.436034) (xy 266.095567 114.43604) - (xy 265.895099 114.544527) (xy 265.89509 114.544533) (xy 265.715212 114.684538) (xy 265.715208 114.684541) - (xy 265.560814 114.852257) (xy 265.436137 115.043091) (xy 265.344569 115.251844) (xy 265.28861 115.47282) - (xy 265.288608 115.472831) (xy 265.269786 115.699993) (xy 260.030214 115.699993) (xy 260.011391 115.472831) - (xy 260.011389 115.47282) (xy 259.95543 115.251844) (xy 259.863862 115.043091) (xy 259.739185 114.852257) - (xy 259.584791 114.684541) (xy 259.584787 114.684538) (xy 259.404909 114.544533) (xy 259.4049 114.544527) - (xy 259.204432 114.43604) (xy 259.204429 114.436039) (xy 259.204426 114.436037) (xy 259.20442 114.436035) - (xy 259.204418 114.436034) (xy 258.988826 114.36202) (xy 258.820188 114.33388) (xy 258.763977 114.3245) - (xy 258.536023 114.3245) (xy 258.491053 114.332004) (xy 258.311173 114.36202) (xy 258.095581 114.436034) - (xy 258.095567 114.43604) (xy 257.895099 114.544527) (xy 257.89509 114.544533) (xy 257.715212 114.684538) - (xy 257.715208 114.684541) (xy 257.560814 114.852257) (xy 257.436137 115.043091) (xy 257.344569 115.251844) - (xy 257.28861 115.47282) (xy 257.288608 115.472831) (xy 257.269786 115.699993) (xy 182.080499 115.699993) - (xy 182.080499 114.600326) (xy 182.080499 114.600323) (xy 182.080498 114.600321) (xy 182.080434 114.599999) - (xy 187.544722 114.599999) (xy 187.544722 114.6) (xy 187.563762 114.756818) (xy 187.61978 114.904523) - (xy 187.709517 115.03453) (xy 187.82776 115.139283) (xy 187.827762 115.139284) (xy 187.967634 115.212696) - (xy 188.121014 115.2505) (xy 188.121015 115.2505) (xy 188.278985 115.2505) (xy 188.432365 115.212696) + (xy 267.95543 115.251844) (xy 267.863862 115.043091) (xy 267.739185 114.852257) (xy 267.648888 114.754169) + (xy 267.584794 114.684544) (xy 267.584793 114.684543) (xy 267.584791 114.684541) (xy 267.584787 114.684538) + (xy 267.404909 114.544533) (xy 267.4049 114.544527) (xy 267.204432 114.43604) (xy 267.204429 114.436039) + (xy 267.204426 114.436037) (xy 267.20442 114.436035) (xy 267.204418 114.436034) (xy 266.988826 114.36202) + (xy 266.820188 114.33388) (xy 266.763977 114.3245) (xy 266.536023 114.3245) (xy 266.491053 114.332004) + (xy 266.311173 114.36202) (xy 266.095581 114.436034) (xy 266.095567 114.43604) (xy 265.895099 114.544527) + (xy 265.89509 114.544533) (xy 265.715212 114.684538) (xy 265.715208 114.684541) (xy 265.560814 114.852257) + (xy 265.436137 115.043091) (xy 265.344569 115.251844) (xy 265.28861 115.47282) (xy 265.288608 115.472831) + (xy 265.269786 115.699993) (xy 260.030214 115.699993) (xy 260.011391 115.472831) (xy 260.011389 115.47282) + (xy 259.95543 115.251844) (xy 259.863862 115.043091) (xy 259.739185 114.852257) (xy 259.648888 114.754169) + (xy 259.584794 114.684544) (xy 259.584793 114.684543) (xy 259.584791 114.684541) (xy 259.584787 114.684538) + (xy 259.404909 114.544533) (xy 259.4049 114.544527) (xy 259.204432 114.43604) (xy 259.204429 114.436039) + (xy 259.204426 114.436037) (xy 259.20442 114.436035) (xy 259.204418 114.436034) (xy 258.988826 114.36202) + (xy 258.820188 114.33388) (xy 258.763977 114.3245) (xy 258.536023 114.3245) (xy 258.491053 114.332004) + (xy 258.311173 114.36202) (xy 258.095581 114.436034) (xy 258.095567 114.43604) (xy 257.895099 114.544527) + (xy 257.89509 114.544533) (xy 257.715212 114.684538) (xy 257.715208 114.684541) (xy 257.560814 114.852257) + (xy 257.436137 115.043091) (xy 257.344569 115.251844) (xy 257.28861 115.47282) (xy 257.288608 115.472831) + (xy 257.269786 115.699993) (xy 182.080499 115.699993) (xy 182.080499 114.600326) (xy 182.080499 114.600323) + (xy 182.080498 114.600321) (xy 182.080434 114.599999) (xy 187.544722 114.599999) (xy 187.544722 114.6) + (xy 187.563762 114.756818) (xy 187.593685 114.835717) (xy 187.61978 114.904523) (xy 187.709517 115.03453) + (xy 187.82776 115.139283) (xy 187.827762 115.139284) (xy 187.967634 115.212696) (xy 188.121014 115.2505) + (xy 188.121015 115.2505) (xy 188.278985 115.2505) (xy 188.432365 115.212696) (xy 188.440966 115.208182) (xy 188.57224 115.139283) (xy 188.690483 115.03453) (xy 188.78022 114.904523) (xy 188.836237 114.756818) (xy 188.855278 114.6) (xy 188.848543 114.544527) (xy 188.836237 114.443181) (xy 188.791227 114.3245) (xy 188.78022 114.295477) (xy 188.690483 114.16547) (xy 188.57224 114.060717) (xy 188.572238 114.060716) @@ -173804,17 +178298,17 @@ (xy 166.174241 114.754169) (xy 166.174238 114.754172) (xy 166.011429 114.931029) (xy 166.011426 114.931033) (xy 165.87995 115.13227) (xy 165.783388 115.35241) (xy 165.724378 115.58544) (xy 165.704528 115.824994) (xy 134.173027 115.824994) (xy 134.190483 115.80953) (xy 134.28022 115.679523) (xy 134.336237 115.531818) - (xy 134.355278 115.375) (xy 134.346172 115.3) (xy 134.336237 115.218181) (xy 134.306315 115.139284) + (xy 134.355278 115.375) (xy 134.340325 115.251845) (xy 134.336237 115.218181) (xy 134.306315 115.139284) (xy 134.28022 115.070477) (xy 134.190483 114.94047) (xy 134.07224 114.835717) (xy 134.072238 114.835716) (xy 134.072237 114.835715) (xy 133.932365 114.762303) (xy 133.778986 114.7245) (xy 133.778985 114.7245) (xy 133.621015 114.7245) (xy 133.621014 114.7245) (xy 133.467634 114.762303) (xy 133.327762 114.835715) (xy 133.209516 114.940471) (xy 133.119781 115.070475) (xy 133.11978 115.070476) (xy 133.063762 115.218181) - (xy 133.044722 115.374999) (xy 115.046172 115.374999) (xy 115.055278 115.3) (xy 115.045344 115.218181) - (xy 115.036237 115.143181) (xy 115.008663 115.070475) (xy 114.98022 114.995477) (xy 114.890483 114.86547) - (xy 114.77224 114.760717) (xy 114.772238 114.760716) (xy 114.772237 114.760715) (xy 114.632365 114.687303) - (xy 114.478986 114.6495) (xy 114.478985 114.6495) (xy 114.321015 114.6495) (xy 114.321014 114.6495) - (xy 114.167634 114.687303) (xy 114.027762 114.760715) (xy 113.909516 114.865471) (xy 113.819781 114.995475) - (xy 113.81978 114.995476) (xy 113.763762 115.143181) (xy 113.744722 115.299999) (xy 112.3005 115.299999) + (xy 133.044722 115.374999) (xy 115.504064 115.374999) (xy 115.505278 115.365) (xy 115.491539 115.251844) + (xy 115.486237 115.208181) (xy 115.434012 115.070476) (xy 115.43022 115.060477) (xy 115.340483 114.93047) + (xy 115.22224 114.825717) (xy 115.222238 114.825716) (xy 115.222237 114.825715) (xy 115.082365 114.752303) + (xy 114.928986 114.7145) (xy 114.928985 114.7145) (xy 114.771015 114.7145) (xy 114.771014 114.7145) + (xy 114.617634 114.752303) (xy 114.477762 114.825715) (xy 114.359516 114.930471) (xy 114.269781 115.060475) + (xy 114.26978 115.060476) (xy 114.213762 115.208181) (xy 114.194722 115.364999) (xy 112.3005 115.364999) (xy 112.3005 111.085321) (xy 114.6395 111.085321) (xy 114.6395 112.634678) (xy 114.654032 112.707735) (xy 114.654033 112.707739) (xy 114.654034 112.70774) (xy 114.709399 112.790601) (xy 114.79226 112.845966) (xy 114.792264 112.845967) (xy 114.865321 112.860499) (xy 114.865324 112.8605) (xy 114.865326 112.8605) @@ -173855,12 +178349,11 @@ (xy 116.570601 110.929399) (xy 116.48774 110.874034) (xy 116.487739 110.874033) (xy 116.487735 110.874032) (xy 116.414677 110.8595) (xy 116.414674 110.8595) (xy 114.865326 110.8595) (xy 114.865323 110.8595) (xy 114.792264 110.874032) (xy 114.79226 110.874033) (xy 114.709399 110.929399) (xy 114.654033 111.01226) - (xy 114.654032 111.012264) (xy 114.6395 111.085321) (xy 112.3005 111.085321) (xy 112.3005 109.309999) - (xy 112.804722 109.309999) (xy 112.804722 109.31) (xy 112.823762 109.466818) (xy 112.874272 109.599999) - (xy 112.87978 109.614523) (xy 112.969517 109.74453) (xy 113.08776 109.849283) (xy 113.087762 109.849284) - (xy 113.227634 109.922696) (xy 113.381014 109.9605) (xy 113.381015 109.9605) (xy 113.538985 109.9605) - (xy 113.692365 109.922696) (xy 113.72699 109.904523) (xy 113.83224 109.849283) (xy 113.950483 109.74453) - (xy 114.04022 109.614523) (xy 114.045728 109.599999) (xy 131.044722 109.599999) (xy 131.044722 109.6) + (xy 114.654032 111.012264) (xy 114.6395 111.085321) (xy 112.3005 111.085321) (xy 112.3005 108.999999) + (xy 112.804722 108.999999) (xy 112.804722 109) (xy 112.823762 109.156818) (xy 112.876349 109.295476) + (xy 112.87978 109.304523) (xy 112.969517 109.43453) (xy 113.08776 109.539283) (xy 113.087762 109.539284) + (xy 113.227634 109.612696) (xy 113.381014 109.6505) (xy 113.381015 109.6505) (xy 113.538985 109.6505) + (xy 113.692365 109.612696) (xy 113.716557 109.599999) (xy 131.044722 109.599999) (xy 131.044722 109.6) (xy 131.063762 109.756818) (xy 131.11978 109.904523) (xy 131.209517 110.03453) (xy 131.32776 110.139283) (xy 131.327762 110.139284) (xy 131.467634 110.212696) (xy 131.621014 110.2505) (xy 131.621015 110.2505) (xy 131.778985 110.2505) (xy 131.932365 110.212696) (xy 131.950648 110.2031) (xy 132.07224 110.139283) @@ -173868,320 +178361,320 @@ (xy 132.336237 109.443182) (xy 132.28022 109.295477) (xy 132.190483 109.16547) (xy 132.07224 109.060717) (xy 132.072238 109.060716) (xy 132.072237 109.060715) (xy 131.932365 108.987303) (xy 131.778986 108.9495) (xy 131.778985 108.9495) (xy 131.621015 108.9495) (xy 131.621014 108.9495) (xy 131.467634 108.987303) - (xy 131.327762 109.060715) (xy 131.32776 109.060717) (xy 131.223388 109.153182) (xy 131.209516 109.165471) - (xy 131.119781 109.295475) (xy 131.11978 109.295476) (xy 131.063762 109.443181) (xy 131.044722 109.599999) - (xy 114.045728 109.599999) (xy 114.096237 109.466818) (xy 114.115278 109.31) (xy 114.113515 109.295476) - (xy 114.096237 109.153181) (xy 114.067843 109.078313) (xy 114.04022 109.005477) (xy 113.950483 108.87547) - (xy 113.83224 108.770717) (xy 113.832238 108.770716) (xy 113.832237 108.770715) (xy 113.692365 108.697303) - (xy 113.538986 108.6595) (xy 113.538985 108.6595) (xy 113.381015 108.6595) (xy 113.381014 108.6595) - (xy 113.227634 108.697303) (xy 113.087762 108.770715) (xy 112.969516 108.875471) (xy 112.879781 109.005475) - (xy 112.87978 109.005476) (xy 112.823762 109.153181) (xy 112.804722 109.309999) (xy 112.3005 109.309999) - (xy 112.3005 108.179999) (xy 127.984722 108.179999) (xy 127.984722 108.18) (xy 128.003762 108.336818) - (xy 128.034395 108.417589) (xy 128.05978 108.484523) (xy 128.149517 108.61453) (xy 128.26776 108.719283) + (xy 131.327762 109.060715) (xy 131.209516 109.165471) (xy 131.119781 109.295475) (xy 131.11978 109.295476) + (xy 131.063762 109.443181) (xy 131.044722 109.599999) (xy 113.716557 109.599999) (xy 113.83224 109.539283) + (xy 113.950483 109.43453) (xy 114.04022 109.304523) (xy 114.096237 109.156818) (xy 114.115278 109) + (xy 114.113737 108.987304) (xy 114.096237 108.843181) (xy 114.074992 108.787164) (xy 114.04022 108.695477) + (xy 113.950483 108.56547) (xy 113.83224 108.460717) (xy 113.832238 108.460716) (xy 113.832237 108.460715) + (xy 113.692365 108.387303) (xy 113.538986 108.3495) (xy 113.538985 108.3495) (xy 113.381015 108.3495) + (xy 113.381014 108.3495) (xy 113.227634 108.387303) (xy 113.087762 108.460715) (xy 112.969516 108.565471) + (xy 112.879781 108.695475) (xy 112.87978 108.695476) (xy 112.823762 108.843181) (xy 112.804722 108.999999) + (xy 112.3005 108.999999) (xy 112.3005 108.179999) (xy 127.984722 108.179999) (xy 127.984722 108.18) + (xy 128.003762 108.336818) (xy 128.05978 108.484523) (xy 128.149517 108.61453) (xy 128.26776 108.719283) (xy 128.267762 108.719284) (xy 128.407634 108.792696) (xy 128.561014 108.8305) (xy 128.561015 108.8305) - (xy 128.718985 108.8305) (xy 128.872365 108.792696) (xy 128.914242 108.770717) (xy 129.01224 108.719283) - (xy 129.130483 108.61453) (xy 129.22022 108.484523) (xy 129.276237 108.336818) (xy 129.295278 108.18) - (xy 129.276237 108.023182) (xy 129.246584 107.944994) (xy 165.704529 107.944994) (xy 165.704529 107.945005) - (xy 165.724379 108.184559) (xy 165.783389 108.417589) (xy 165.879951 108.637729) (xy 165.981197 108.792696) - (xy 166.011429 108.838969) (xy 166.174236 109.015825) (xy 166.174239 109.015827) (xy 166.174242 109.01583) - (xy 166.363924 109.163466) (xy 166.36393 109.16347) (xy 166.363933 109.163472) (xy 166.575344 109.277882) - (xy 166.575347 109.277883) (xy 166.802699 109.355933) (xy 166.802701 109.355933) (xy 166.802703 109.355934) - (xy 167.039808 109.3955) (xy 167.039809 109.3955) (xy 167.280191 109.3955) (xy 167.280192 109.3955) - (xy 167.517297 109.355934) (xy 167.744656 109.277882) (xy 167.956067 109.163472) (xy 168.145764 109.015825) - (xy 168.308571 108.838969) (xy 168.440049 108.637728) (xy 168.53661 108.417591) (xy 168.59562 108.184563) - (xy 168.615471 107.945) (xy 168.615471 107.944994) (xy 179.174529 107.944994) (xy 179.174529 107.945005) - (xy 179.194379 108.184559) (xy 179.253389 108.417589) (xy 179.349951 108.637729) (xy 179.451197 108.792696) - (xy 179.481429 108.838969) (xy 179.644236 109.015825) (xy 179.644239 109.015827) (xy 179.644242 109.01583) - (xy 179.833924 109.163466) (xy 179.83393 109.16347) (xy 179.833933 109.163472) (xy 180.045344 109.277882) - (xy 180.045347 109.277883) (xy 180.272699 109.355933) (xy 180.272701 109.355933) (xy 180.272703 109.355934) - (xy 180.509808 109.3955) (xy 180.509809 109.3955) (xy 180.750191 109.3955) (xy 180.750192 109.3955) - (xy 180.987297 109.355934) (xy 181.214656 109.277882) (xy 181.426067 109.163472) (xy 181.615764 109.015825) - (xy 181.778571 108.838969) (xy 181.910049 108.637728) (xy 182.00661 108.417591) (xy 182.030779 108.322149) - (xy 271.1995 108.322149) (xy 271.1995 108.57785) (xy 271.218121 108.719283) (xy 271.232874 108.83134) - (xy 271.282307 109.015827) (xy 271.29905 109.078312) (xy 271.299053 109.078322) (xy 271.396894 109.314531) - (xy 271.396899 109.314542) (xy 271.524734 109.535957) (xy 271.524745 109.535973) (xy 271.680388 109.738811) - (xy 271.680394 109.738818) (xy 271.861181 109.919605) (xy 271.861188 109.919611) (xy 271.914476 109.9605) - (xy 272.064035 110.075261) (xy 272.064042 110.075265) (xy 272.285457 110.2031) (xy 272.285462 110.203102) - (xy 272.285465 110.203104) (xy 272.521687 110.30095) (xy 272.76866 110.367126) (xy 273.022157 110.4005) - (xy 273.022164 110.4005) (xy 273.277836 110.4005) (xy 273.277843 110.4005) (xy 273.53134 110.367126) - (xy 273.778313 110.30095) (xy 274.014535 110.203104) (xy 274.235965 110.075261) (xy 274.438813 109.91961) - (xy 274.61961 109.738813) (xy 274.775261 109.535965) (xy 274.903104 109.314535) (xy 275.00095 109.078313) - (xy 275.067126 108.83134) (xy 275.1005 108.577843) (xy 275.1005 108.322157) (xy 275.067126 108.06866) - (xy 275.00095 107.821687) (xy 274.903104 107.585465) (xy 274.903102 107.585462) (xy 274.9031 107.585457) - (xy 274.775265 107.364042) (xy 274.775261 107.364035) (xy 274.61961 107.161187) (xy 274.619605 107.161181) - (xy 274.438818 106.980394) (xy 274.438811 106.980388) (xy 274.235973 106.824745) (xy 274.235971 106.824743) - (xy 274.235965 106.824739) (xy 274.23596 106.824736) (xy 274.235957 106.824734) (xy 274.014542 106.696899) - (xy 274.014531 106.696894) (xy 273.778322 106.599053) (xy 273.778315 106.599051) (xy 273.778313 106.59905) - (xy 273.53134 106.532874) (xy 273.475007 106.525457) (xy 273.27785 106.4995) (xy 273.277843 106.4995) - (xy 273.022157 106.4995) (xy 273.022149 106.4995) (xy 272.796826 106.529165) (xy 272.76866 106.532874) - (xy 272.521687 106.59905) (xy 272.521677 106.599053) (xy 272.285468 106.696894) (xy 272.285457 106.696899) - (xy 272.064042 106.824734) (xy 272.064026 106.824745) (xy 271.861188 106.980388) (xy 271.861181 106.980394) - (xy 271.680394 107.161181) (xy 271.680388 107.161188) (xy 271.524745 107.364026) (xy 271.524734 107.364042) - (xy 271.396899 107.585457) (xy 271.396894 107.585468) (xy 271.299053 107.821677) (xy 271.29905 107.821687) - (xy 271.266009 107.945) (xy 271.232874 108.068661) (xy 271.1995 108.322149) (xy 182.030779 108.322149) - (xy 182.06562 108.184563) (xy 182.085471 107.945) (xy 182.06562 107.705437) (xy 182.00661 107.472409) - (xy 181.910049 107.252272) (xy 181.778571 107.051031) (xy 181.615764 106.874175) (xy 181.615759 106.874171) - (xy 181.615757 106.874169) (xy 181.426075 106.726533) (xy 181.426069 106.726529) (xy 181.214657 106.612118) - (xy 181.214652 106.612116) (xy 180.9873 106.534066) (xy 180.780155 106.4995) (xy 180.750192 106.4945) - (xy 180.509808 106.4945) (xy 180.479845 106.4995) (xy 180.272699 106.534066) (xy 180.045347 106.612116) - (xy 180.045342 106.612118) (xy 179.83393 106.726529) (xy 179.833924 106.726533) (xy 179.644242 106.874169) - (xy 179.644239 106.874172) (xy 179.48143 107.051029) (xy 179.481427 107.051033) (xy 179.349951 107.25227) - (xy 179.253389 107.47241) (xy 179.194379 107.70544) (xy 179.174529 107.944994) (xy 168.615471 107.944994) - (xy 168.59562 107.705437) (xy 168.53661 107.472409) (xy 168.440049 107.252272) (xy 168.308571 107.051031) - (xy 168.145764 106.874175) (xy 168.145759 106.874171) (xy 168.145757 106.874169) (xy 167.956075 106.726533) - (xy 167.956069 106.726529) (xy 167.744657 106.612118) (xy 167.744652 106.612116) (xy 167.5173 106.534066) - (xy 167.310155 106.4995) (xy 167.280192 106.4945) (xy 167.039808 106.4945) (xy 167.009845 106.4995) - (xy 166.802699 106.534066) (xy 166.575347 106.612116) (xy 166.575342 106.612118) (xy 166.36393 106.726529) - (xy 166.363924 106.726533) (xy 166.174242 106.874169) (xy 166.174239 106.874172) (xy 166.01143 107.051029) - (xy 166.011427 107.051033) (xy 165.879951 107.25227) (xy 165.783389 107.47241) (xy 165.724379 107.70544) - (xy 165.704529 107.944994) (xy 129.246584 107.944994) (xy 129.22022 107.875477) (xy 129.130483 107.74547) - (xy 129.01224 107.640717) (xy 129.012238 107.640716) (xy 129.012237 107.640715) (xy 128.872365 107.567303) - (xy 128.718986 107.5295) (xy 128.718985 107.5295) (xy 128.561015 107.5295) (xy 128.561014 107.5295) - (xy 128.407634 107.567303) (xy 128.267762 107.640715) (xy 128.149516 107.745471) (xy 128.059781 107.875475) - (xy 128.05978 107.875476) (xy 128.003762 108.023181) (xy 127.984722 108.179999) (xy 112.3005 108.179999) - (xy 112.3005 104.544994) (xy 165.704529 104.544994) (xy 165.704529 104.545005) (xy 165.724379 104.784559) - (xy 165.783389 105.017589) (xy 165.879951 105.237729) (xy 166.011427 105.438966) (xy 166.011429 105.438969) - (xy 166.174236 105.615825) (xy 166.174239 105.615827) (xy 166.174242 105.61583) (xy 166.363924 105.763466) - (xy 166.36393 105.76347) (xy 166.363933 105.763472) (xy 166.575344 105.877882) (xy 166.575347 105.877883) - (xy 166.802699 105.955933) (xy 166.802701 105.955933) (xy 166.802703 105.955934) (xy 167.039808 105.9955) - (xy 167.039809 105.9955) (xy 167.280191 105.9955) (xy 167.280192 105.9955) (xy 167.517297 105.955934) - (xy 167.744656 105.877882) (xy 167.956067 105.763472) (xy 168.145764 105.615825) (xy 168.308571 105.438969) - (xy 168.440049 105.237728) (xy 168.53661 105.017591) (xy 168.59562 104.784563) (xy 168.615471 104.545) - (xy 168.59562 104.305437) (xy 168.53661 104.072409) (xy 168.440049 103.852272) (xy 168.308571 103.651031) - (xy 168.145764 103.474175) (xy 168.145759 103.474171) (xy 168.145757 103.474169) (xy 167.956075 103.326533) - (xy 167.956069 103.326529) (xy 167.944598 103.320321) (xy 179.1795 103.320321) (xy 179.1795 105.769678) - (xy 179.194032 105.842735) (xy 179.194033 105.842739) (xy 179.194034 105.84274) (xy 179.249399 105.925601) - (xy 179.33226 105.980966) (xy 179.332264 105.980967) (xy 179.405321 105.995499) (xy 179.405324 105.9955) - (xy 179.405326 105.9955) (xy 181.854676 105.9955) (xy 181.854677 105.995499) (xy 181.92774 105.980966) - (xy 182.010601 105.925601) (xy 182.065966 105.84274) (xy 182.0805 105.769674) (xy 182.0805 103.320326) - (xy 182.0805 103.320323) (xy 182.080499 103.320321) (xy 182.065967 103.247264) (xy 182.065966 103.24726) - (xy 182.042484 103.212116) (xy 182.010601 103.164399) (xy 181.92774 103.109034) (xy 181.927739 103.109033) - (xy 181.927735 103.109032) (xy 181.854677 103.0945) (xy 181.854674 103.0945) (xy 179.405326 103.0945) - (xy 179.405323 103.0945) (xy 179.332264 103.109032) (xy 179.33226 103.109033) (xy 179.249399 103.164399) - (xy 179.194033 103.24726) (xy 179.194032 103.247264) (xy 179.1795 103.320321) (xy 167.944598 103.320321) - (xy 167.744657 103.212118) (xy 167.744652 103.212116) (xy 167.5173 103.134066) (xy 167.339468 103.104391) - (xy 167.280192 103.0945) (xy 167.039808 103.0945) (xy 166.992387 103.102413) (xy 166.802699 103.134066) - (xy 166.575347 103.212116) (xy 166.575342 103.212118) (xy 166.36393 103.326529) (xy 166.363924 103.326533) - (xy 166.174242 103.474169) (xy 166.174239 103.474172) (xy 166.01143 103.651029) (xy 166.011427 103.651033) - (xy 165.879951 103.85227) (xy 165.783389 104.07241) (xy 165.724379 104.30544) (xy 165.704529 104.544994) - (xy 112.3005 104.544994) (xy 112.3005 102.299999) (xy 122.034722 102.299999) (xy 122.034722 102.3) - (xy 122.053762 102.456818) (xy 122.10978 102.604523) (xy 122.199517 102.73453) (xy 122.31776 102.839283) - (xy 122.317762 102.839284) (xy 122.457634 102.912696) (xy 122.611014 102.9505) (xy 122.611015 102.9505) - (xy 122.768985 102.9505) (xy 122.922365 102.912696) (xy 123.06224 102.839283) (xy 123.180483 102.73453) - (xy 123.27022 102.604523) (xy 123.326237 102.456818) (xy 123.345278 102.3) (xy 123.326237 102.143182) - (xy 123.27022 101.995477) (xy 123.180483 101.86547) (xy 123.06224 101.760717) (xy 123.062238 101.760716) - (xy 123.062237 101.760715) (xy 122.922365 101.687303) (xy 122.768986 101.6495) (xy 122.768985 101.6495) - (xy 122.611015 101.6495) (xy 122.611014 101.6495) (xy 122.457634 101.687303) (xy 122.317762 101.760715) - (xy 122.199516 101.865471) (xy 122.109781 101.995475) (xy 122.10978 101.995476) (xy 122.053762 102.143181) - (xy 122.034722 102.299999) (xy 112.3005 102.299999) (xy 112.3005 101.199996) (xy 200.544719 101.199996) - (xy 200.544719 101.199997) (xy 200.563759 101.356815) (xy 200.619777 101.50452) (xy 200.709514 101.634527) - (xy 200.827757 101.73928) (xy 200.827759 101.739281) (xy 200.967631 101.812693) (xy 201.121011 101.850497) - (xy 201.121012 101.850497) (xy 201.278982 101.850497) (xy 201.432362 101.812693) (xy 201.572237 101.73928) - (xy 201.69048 101.634527) (xy 201.780217 101.50452) (xy 201.836234 101.356815) (xy 201.855275 101.199997) - (xy 201.836234 101.043179) (xy 201.780217 100.895474) (xy 201.69048 100.765467) (xy 201.572237 100.660714) - (xy 201.572235 100.660713) (xy 201.572234 100.660712) (xy 201.432362 100.5873) (xy 201.278983 100.549497) - (xy 201.278982 100.549497) (xy 201.121012 100.549497) (xy 201.121011 100.549497) (xy 200.967631 100.5873) - (xy 200.827759 100.660712) (xy 200.709513 100.765468) (xy 200.619778 100.895472) (xy 200.619777 100.895473) - (xy 200.563759 101.043178) (xy 200.544719 101.199996) (xy 112.3005 101.199996) (xy 112.3005 99.439999) - (xy 162.174722 99.439999) (xy 162.174722 99.44) (xy 162.193762 99.596818) (xy 162.247793 99.739283) - (xy 162.24978 99.744523) (xy 162.339517 99.87453) (xy 162.45776 99.979283) (xy 162.457762 99.979284) - (xy 162.597634 100.052696) (xy 162.751014 100.0905) (xy 162.751015 100.0905) (xy 162.908985 100.0905) - (xy 163.062365 100.052696) (xy 163.20224 99.979283) (xy 163.320483 99.87453) (xy 163.40644 99.749999) - (xy 199.094722 99.749999) (xy 199.094722 99.75) (xy 199.113762 99.906818) (xy 199.148548 99.998539) - (xy 199.16978 100.054523) (xy 199.259517 100.18453) (xy 199.37776 100.289283) (xy 199.377762 100.289284) - (xy 199.517634 100.362696) (xy 199.671014 100.4005) (xy 199.671015 100.4005) (xy 199.828985 100.4005) - (xy 199.982365 100.362696) (xy 200.12224 100.289283) (xy 200.240483 100.18453) (xy 200.33022 100.054523) - (xy 200.386237 99.906818) (xy 200.405278 99.75) (xy 200.386679 99.596818) (xy 200.386237 99.593181) - (xy 200.364992 99.537164) (xy 200.33022 99.445477) (xy 200.32644 99.44) (xy 257.874659 99.44) (xy 257.893975 99.636129) - (xy 257.893976 99.636132) (xy 257.947536 99.812696) (xy 257.951188 99.824733) (xy 258.044086 99.998532) - (xy 258.04409 99.998539) (xy 258.169116 100.150883) (xy 258.32146 100.275909) (xy 258.321467 100.275913) - (xy 258.495266 100.368811) (xy 258.495269 100.368811) (xy 258.495273 100.368814) (xy 258.683868 100.426024) - (xy 258.88 100.445341) (xy 259.076132 100.426024) (xy 259.264727 100.368814) (xy 259.438538 100.27591) - (xy 259.590883 100.150883) (xy 259.71591 99.998538) (xy 259.808814 99.824727) (xy 259.866024 99.636132) - (xy 259.885341 99.44) (xy 259.866024 99.243868) (xy 259.808814 99.055273) (xy 259.808811 99.055269) - (xy 259.808811 99.055266) (xy 259.715913 98.881467) (xy 259.715909 98.88146) (xy 259.590883 98.729116) - (xy 259.513149 98.665321) (xy 260.3795 98.665321) (xy 260.3795 100.214678) (xy 260.394032 100.287735) - (xy 260.394033 100.287739) (xy 260.412405 100.315235) (xy 260.449399 100.370601) (xy 260.494147 100.4005) - (xy 260.53226 100.425966) (xy 260.532264 100.425967) (xy 260.605321 100.440499) (xy 260.605324 100.4405) - (xy 260.605326 100.4405) (xy 262.154676 100.4405) (xy 262.154677 100.440499) (xy 262.22774 100.425966) - (xy 262.310601 100.370601) (xy 262.365966 100.28774) (xy 262.3805 100.214674) (xy 262.3805 99.199999) - (xy 264.544722 99.199999) (xy 264.544722 99.2) (xy 264.563762 99.356818) (xy 264.603084 99.460499) - (xy 264.61978 99.504523) (xy 264.709517 99.63453) (xy 264.82776 99.739283) (xy 264.827762 99.739284) - (xy 264.967634 99.812696) (xy 265.121014 99.8505) (xy 265.121015 99.8505) (xy 265.278985 99.8505) - (xy 265.432365 99.812696) (xy 265.57224 99.739283) (xy 265.690483 99.63453) (xy 265.78022 99.504523) - (xy 265.836237 99.356818) (xy 265.855278 99.2) (xy 265.847666 99.137304) (xy 265.836237 99.043181) - (xy 265.782207 98.900717) (xy 265.78022 98.895477) (xy 265.690483 98.76547) (xy 265.57224 98.660717) - (xy 265.572238 98.660716) (xy 265.572237 98.660715) (xy 265.432365 98.587303) (xy 265.278986 98.5495) - (xy 265.278985 98.5495) (xy 265.121015 98.5495) (xy 265.121014 98.5495) (xy 264.967634 98.587303) - (xy 264.827762 98.660715) (xy 264.709516 98.765471) (xy 264.619781 98.895475) (xy 264.61978 98.895476) - (xy 264.563762 99.043181) (xy 264.544722 99.199999) (xy 262.3805 99.199999) (xy 262.3805 98.665326) - (xy 262.3805 98.665323) (xy 262.380499 98.665321) (xy 262.365967 98.592264) (xy 262.365966 98.59226) - (xy 262.337395 98.5495) (xy 262.310601 98.509399) (xy 262.22774 98.454034) (xy 262.227739 98.454033) - (xy 262.227735 98.454032) (xy 262.154677 98.4395) (xy 262.154674 98.4395) (xy 260.605326 98.4395) - (xy 260.605323 98.4395) (xy 260.532264 98.454032) (xy 260.53226 98.454033) (xy 260.449399 98.509399) - (xy 260.394033 98.59226) (xy 260.394032 98.592264) (xy 260.3795 98.665321) (xy 259.513149 98.665321) - (xy 259.438539 98.60409) (xy 259.438532 98.604086) (xy 259.264733 98.511188) (xy 259.264727 98.511186) - (xy 259.076132 98.453976) (xy 259.076129 98.453975) (xy 258.88 98.434659) (xy 258.68387 98.453975) - (xy 258.495266 98.511188) (xy 258.321467 98.604086) (xy 258.32146 98.60409) (xy 258.169116 98.729116) - (xy 258.04409 98.88146) (xy 258.044086 98.881467) (xy 257.951188 99.055266) (xy 257.893975 99.24387) - (xy 257.874659 99.44) (xy 200.32644 99.44) (xy 200.240483 99.31547) (xy 200.12224 99.210717) (xy 200.122238 99.210716) - (xy 200.122237 99.210715) (xy 199.982365 99.137303) (xy 199.828986 99.0995) (xy 199.828985 99.0995) - (xy 199.671015 99.0995) (xy 199.671014 99.0995) (xy 199.517634 99.137303) (xy 199.377762 99.210715) - (xy 199.298931 99.280552) (xy 199.268243 99.30774) (xy 199.259516 99.315471) (xy 199.169781 99.445475) - (xy 199.16978 99.445476) (xy 199.113762 99.593181) (xy 199.094722 99.749999) (xy 163.40644 99.749999) - (xy 163.41022 99.744523) (xy 163.466237 99.596818) (xy 163.485278 99.44) (xy 163.470158 99.31547) - (xy 163.466237 99.283181) (xy 163.43469 99.199999) (xy 163.41022 99.135477) (xy 163.320483 99.00547) - (xy 163.20224 98.900717) (xy 163.202238 98.900716) (xy 163.202237 98.900715) (xy 163.062365 98.827303) - (xy 162.908986 98.7895) (xy 162.908985 98.7895) (xy 162.751015 98.7895) (xy 162.751014 98.7895) - (xy 162.597634 98.827303) (xy 162.457762 98.900715) (xy 162.339516 99.005471) (xy 162.249781 99.135475) - (xy 162.24978 99.135476) (xy 162.193762 99.283181) (xy 162.174722 99.439999) (xy 112.3005 99.439999) - (xy 112.3005 97.685321) (xy 164.3195 97.685321) (xy 164.3195 99.234678) (xy 164.334032 99.307735) - (xy 164.334033 99.307739) (xy 164.352405 99.335235) (xy 164.389399 99.390601) (xy 164.46333 99.439999) - (xy 164.47226 99.445966) (xy 164.472264 99.445967) (xy 164.545321 99.460499) (xy 164.545324 99.4605) - (xy 164.545326 99.4605) (xy 166.094676 99.4605) (xy 166.094677 99.460499) (xy 166.16774 99.445966) - (xy 166.250601 99.390601) (xy 166.305966 99.30774) (xy 166.3205 99.234674) (xy 166.3205 97.685326) - (xy 166.3205 97.685323) (xy 166.320499 97.685321) (xy 166.305967 97.612264) (xy 166.305966 97.61226) - (xy 166.250601 97.529399) (xy 166.16774 97.474034) (xy 166.167739 97.474033) (xy 166.167735 97.474032) - (xy 166.094677 97.4595) (xy 166.094674 97.4595) (xy 164.545326 97.4595) (xy 164.545323 97.4595) - (xy 164.472264 97.474032) (xy 164.47226 97.474033) (xy 164.389399 97.529399) (xy 164.334033 97.61226) - (xy 164.334032 97.612264) (xy 164.3195 97.685321) (xy 112.3005 97.685321) (xy 112.3005 95.96) (xy 164.314659 95.96) - (xy 164.333975 96.156129) (xy 164.391188 96.344733) (xy 164.484086 96.518532) (xy 164.48409 96.518539) - (xy 164.609116 96.670883) (xy 164.76146 96.795909) (xy 164.761467 96.795913) (xy 164.935266 96.888811) - (xy 164.935269 96.888811) (xy 164.935273 96.888814) (xy 165.123868 96.946024) (xy 165.32 96.965341) - (xy 165.516132 96.946024) (xy 165.704727 96.888814) (xy 165.870888 96.799999) (xy 222.144722 96.799999) - (xy 222.144722 96.8) (xy 222.163762 96.956818) (xy 222.21978 97.104523) (xy 222.309517 97.23453) - (xy 222.42776 97.339283) (xy 222.427762 97.339284) (xy 222.567634 97.412696) (xy 222.721014 97.4505) - (xy 222.721015 97.4505) (xy 222.878985 97.4505) (xy 223.032365 97.412696) (xy 223.17224 97.339283) - (xy 223.290483 97.23453) (xy 223.38022 97.104523) (xy 223.436237 96.956818) (xy 223.455278 96.8) - (xy 223.454781 96.79591) (xy 223.436237 96.643182) (xy 223.436237 96.643181) (xy 223.409765 96.573383) - (xy 223.404399 96.503721) (xy 223.437546 96.442215) (xy 223.498684 96.408394) (xy 223.559972 96.412438) - (xy 223.560351 96.410901) (xy 223.721014 96.4505) (xy 223.721015 96.4505) (xy 223.878985 96.4505) - (xy 224.032365 96.412696) (xy 224.040562 96.408394) (xy 224.17224 96.339283) (xy 224.290483 96.23453) - (xy 224.38022 96.104523) (xy 224.436237 95.956818) (xy 224.455278 95.8) (xy 224.436237 95.643182) - (xy 224.38022 95.495477) (xy 224.290483 95.36547) (xy 224.17224 95.260717) (xy 224.172238 95.260716) - (xy 224.172237 95.260715) (xy 224.032365 95.187303) (xy 223.878986 95.1495) (xy 223.878985 95.1495) - (xy 223.721015 95.1495) (xy 223.721014 95.1495) (xy 223.567634 95.187303) (xy 223.427762 95.260715) - (xy 223.309516 95.365471) (xy 223.219781 95.495475) (xy 223.21978 95.495476) (xy 223.163762 95.643181) - (xy 223.144722 95.799999) (xy 223.144722 95.8) (xy 223.163763 95.956818) (xy 223.190233 96.026615) - (xy 223.1956 96.096278) (xy 223.162452 96.157785) (xy 223.101314 96.191606) (xy 223.040028 96.18756) - (xy 223.039649 96.189099) (xy 222.878986 96.1495) (xy 222.878985 96.1495) (xy 222.721015 96.1495) - (xy 222.721014 96.1495) (xy 222.567634 96.187303) (xy 222.427762 96.260715) (xy 222.42776 96.260717) - (xy 222.332925 96.344733) (xy 222.309516 96.365471) (xy 222.219781 96.495475) (xy 222.21978 96.495476) - (xy 222.163762 96.643181) (xy 222.144722 96.799999) (xy 165.870888 96.799999) (xy 165.878538 96.79591) - (xy 166.030883 96.670883) (xy 166.15591 96.518538) (xy 166.248814 96.344727) (xy 166.306024 96.156132) - (xy 166.325341 95.96) (xy 166.306024 95.763868) (xy 166.256315 95.599999) (xy 220.944722 95.599999) - (xy 220.944722 95.6) (xy 220.963762 95.756818) (xy 221.01978 95.904523) (xy 221.109517 96.03453) - (xy 221.22776 96.139283) (xy 221.227762 96.139284) (xy 221.367634 96.212696) (xy 221.521014 96.2505) - (xy 221.521015 96.2505) (xy 221.678985 96.2505) (xy 221.832365 96.212696) (xy 221.872548 96.191606) - (xy 221.97224 96.139283) (xy 222.090483 96.03453) (xy 222.18022 95.904523) (xy 222.236237 95.756818) - (xy 222.255278 95.6) (xy 222.242587 95.495475) (xy 222.236237 95.443181) (xy 222.206765 95.36547) - (xy 222.18022 95.295477) (xy 222.161707 95.268656) (xy 222.139825 95.202301) (xy 222.157291 95.13465) - (xy 222.208559 95.087181) (xy 222.277353 95.074964) (xy 222.321379 95.088419) (xy 222.367635 95.112696) - (xy 222.367637 95.112696) (xy 222.367638 95.112697) (xy 222.521014 95.1505) (xy 222.521015 95.1505) - (xy 222.678985 95.1505) (xy 222.832365 95.112696) (xy 222.97224 95.039283) (xy 223.090483 94.93453) - (xy 223.18022 94.804523) (xy 223.236237 94.656818) (xy 223.255278 94.5) (xy 223.255278 94.499999) - (xy 224.244722 94.499999) (xy 224.244722 94.5) (xy 224.263762 94.656818) (xy 224.31978 94.804523) - (xy 224.409517 94.93453) (xy 224.52776 95.039283) (xy 224.527762 95.039284) (xy 224.667634 95.112696) - (xy 224.821014 95.1505) (xy 224.821015 95.1505) (xy 224.978985 95.1505) (xy 225.132365 95.112696) - (xy 225.27224 95.039283) (xy 225.390483 94.93453) (xy 225.48022 94.804523) (xy 225.536237 94.656818) - (xy 225.555278 94.5) (xy 225.536237 94.343182) (xy 225.48022 94.195477) (xy 225.390483 94.06547) - (xy 225.27224 93.960717) (xy 225.272238 93.960716) (xy 225.272237 93.960715) (xy 225.132365 93.887303) - (xy 224.978986 93.8495) (xy 224.978985 93.8495) (xy 224.821015 93.8495) (xy 224.821014 93.8495) - (xy 224.667634 93.887303) (xy 224.527762 93.960715) (xy 224.409516 94.065471) (xy 224.319781 94.195475) - (xy 224.31978 94.195476) (xy 224.263762 94.343181) (xy 224.244722 94.499999) (xy 223.255278 94.499999) - (xy 223.236237 94.343182) (xy 223.18022 94.195477) (xy 223.090483 94.06547) (xy 222.97224 93.960717) - (xy 222.972238 93.960716) (xy 222.972237 93.960715) (xy 222.832365 93.887303) (xy 222.678986 93.8495) - (xy 222.678985 93.8495) (xy 222.521015 93.8495) (xy 222.521014 93.8495) (xy 222.367634 93.887303) - (xy 222.227762 93.960715) (xy 222.109516 94.065471) (xy 222.019781 94.195475) (xy 222.01978 94.195476) - (xy 221.963762 94.343181) (xy 221.944722 94.499999) (xy 221.944722 94.5) (xy 221.963762 94.656818) - (xy 222.01978 94.804523) (xy 222.019782 94.804527) (xy 222.038292 94.831344) (xy 222.060174 94.897698) - (xy 222.042708 94.96535) (xy 221.991439 95.012819) (xy 221.922646 95.025034) (xy 221.878615 95.011578) - (xy 221.832365 94.987304) (xy 221.832364 94.987303) (xy 221.832363 94.987303) (xy 221.678986 94.9495) - (xy 221.678985 94.9495) (xy 221.521015 94.9495) (xy 221.521014 94.9495) (xy 221.367634 94.987303) - (xy 221.227762 95.060715) (xy 221.109516 95.165471) (xy 221.019781 95.295475) (xy 221.01978 95.295476) - (xy 220.963762 95.443181) (xy 220.944722 95.599999) (xy 166.256315 95.599999) (xy 166.248814 95.575273) - (xy 166.248811 95.575269) (xy 166.248811 95.575266) (xy 166.155913 95.401467) (xy 166.155909 95.40146) - (xy 166.030883 95.249116) (xy 165.878539 95.12409) (xy 165.878532 95.124086) (xy 165.704733 95.031188) - (xy 165.704727 95.031186) (xy 165.516132 94.973976) (xy 165.516129 94.973975) (xy 165.32 94.954659) - (xy 165.12387 94.973975) (xy 164.935266 95.031188) (xy 164.761467 95.124086) (xy 164.76146 95.12409) - (xy 164.609116 95.249116) (xy 164.48409 95.40146) (xy 164.484086 95.401467) (xy 164.391188 95.575266) - (xy 164.333975 95.76387) (xy 164.314659 95.96) (xy 112.3005 95.96) (xy 112.3005 93.869999) (xy 163.594722 93.869999) - (xy 163.594722 93.87) (xy 163.613762 94.026818) (xy 163.66978 94.174523) (xy 163.759517 94.30453) - (xy 163.87776 94.409283) (xy 163.877762 94.409284) (xy 164.017634 94.482696) (xy 164.171014 94.5205) - (xy 164.171015 94.5205) (xy 164.328985 94.5205) (xy 164.482365 94.482696) (xy 164.62224 94.409283) - (xy 164.740483 94.30453) (xy 164.83022 94.174523) (xy 164.886237 94.026818) (xy 164.905278 93.87) - (xy 164.886237 93.713182) (xy 164.881551 93.700827) (xy 164.856408 93.63453) (xy 164.83022 93.565477) - (xy 164.740483 93.43547) (xy 164.62224 93.330717) (xy 164.622238 93.330716) (xy 164.622237 93.330715) - (xy 164.482365 93.257303) (xy 164.328986 93.2195) (xy 164.328985 93.2195) (xy 164.171015 93.2195) - (xy 164.171014 93.2195) (xy 164.017634 93.257303) (xy 163.877762 93.330715) (xy 163.759516 93.435471) - (xy 163.669781 93.565475) (xy 163.66978 93.565476) (xy 163.613762 93.713181) (xy 163.594722 93.869999) - (xy 112.3005 93.869999) (xy 112.3005 92.699999) (xy 167.044722 92.699999) (xy 167.044722 92.7) (xy 167.063762 92.856818) - (xy 167.078424 92.895477) (xy 167.11978 93.004523) (xy 167.209517 93.13453) (xy 167.32776 93.239283) - (xy 167.327762 93.239284) (xy 167.467634 93.312696) (xy 167.621014 93.3505) (xy 167.621015 93.3505) - (xy 167.778985 93.3505) (xy 167.932365 93.312696) (xy 168.07224 93.239283) (xy 168.190483 93.13453) - (xy 168.28022 93.004523) (xy 168.336237 92.856818) (xy 168.355278 92.7) (xy 168.345564 92.619994) - (xy 176.729529 92.619994) (xy 176.729529 92.620005) (xy 176.749379 92.859559) (xy 176.808389 93.092589) - (xy 176.904951 93.312729) (xy 176.985143 93.435471) (xy 177.036429 93.513969) (xy 177.199236 93.690825) - (xy 177.199239 93.690827) (xy 177.199242 93.69083) (xy 177.388924 93.838466) (xy 177.38893 93.83847) - (xy 177.388933 93.838472) (xy 177.600344 93.952882) (xy 177.600347 93.952883) (xy 177.827699 94.030933) - (xy 177.827701 94.030933) (xy 177.827703 94.030934) (xy 178.064808 94.0705) (xy 178.064809 94.0705) - (xy 178.305191 94.0705) (xy 178.305192 94.0705) (xy 178.542297 94.030934) (xy 178.769656 93.952882) - (xy 178.981067 93.838472) (xy 179.170764 93.690825) (xy 179.333571 93.513969) (xy 179.465049 93.312728) - (xy 179.56161 93.092591) (xy 179.62062 92.859563) (xy 179.637097 92.660717) (xy 179.640471 92.620005) - (xy 179.640471 92.619994) (xy 179.621449 92.39044) (xy 179.62062 92.380437) (xy 179.56161 92.147409) - (xy 179.465049 91.927272) (xy 179.333571 91.726031) (xy 179.170764 91.549175) (xy 179.170759 91.549171) - (xy 179.170757 91.549169) (xy 178.981075 91.401533) (xy 178.981069 91.401529) (xy 178.969598 91.395321) - (xy 180.1345 91.395321) (xy 180.1345 93.844678) (xy 180.149032 93.917735) (xy 180.149033 93.917739) - (xy 180.167405 93.945235) (xy 180.204399 94.000601) (xy 180.264763 94.040934) (xy 180.28726 94.055966) - (xy 180.287264 94.055967) (xy 180.360321 94.070499) (xy 180.360324 94.0705) (xy 180.360326 94.0705) - (xy 182.809676 94.0705) (xy 182.809677 94.070499) (xy 182.88274 94.055966) (xy 182.965601 94.000601) - (xy 183.020966 93.91774) (xy 183.0355 93.844674) (xy 183.0355 92.619994) (xy 185.91953 92.619994) - (xy 185.91953 92.620005) (xy 185.93938 92.859559) (xy 185.99839 93.092589) (xy 186.094952 93.312729) - (xy 186.175144 93.435471) (xy 186.22643 93.513969) (xy 186.389237 93.690825) (xy 186.38924 93.690827) - (xy 186.389243 93.69083) (xy 186.578925 93.838466) (xy 186.578931 93.83847) (xy 186.578934 93.838472) - (xy 186.790345 93.952882) (xy 186.790348 93.952883) (xy 187.0177 94.030933) (xy 187.017702 94.030933) - (xy 187.017704 94.030934) (xy 187.254809 94.0705) (xy 187.25481 94.0705) (xy 187.495192 94.0705) - (xy 187.495193 94.0705) (xy 187.732298 94.030934) (xy 187.959657 93.952882) (xy 188.171068 93.838472) - (xy 188.360765 93.690825) (xy 188.523572 93.513969) (xy 188.65505 93.312728) (xy 188.751611 93.092591) - (xy 188.810621 92.859563) (xy 188.827098 92.660717) (xy 188.830472 92.620005) (xy 188.830472 92.619994) - (xy 188.81145 92.39044) (xy 188.810621 92.380437) (xy 188.751611 92.147409) (xy 188.65505 91.927272) - (xy 188.523572 91.726031) (xy 188.360765 91.549175) (xy 188.36076 91.549171) (xy 188.360758 91.549169) - (xy 188.171076 91.401533) (xy 188.17107 91.401529) (xy 188.159599 91.395321) (xy 189.324501 91.395321) - (xy 189.324501 93.844678) (xy 189.339033 93.917735) (xy 189.339034 93.917739) (xy 189.357406 93.945235) - (xy 189.3944 94.000601) (xy 189.454764 94.040934) (xy 189.477261 94.055966) (xy 189.477265 94.055967) - (xy 189.550322 94.070499) (xy 189.550325 94.0705) (xy 189.550327 94.0705) (xy 191.999677 94.0705) - (xy 191.999678 94.070499) (xy 192.072741 94.055966) (xy 192.155602 94.000601) (xy 192.210967 93.91774) - (xy 192.225501 93.844674) (xy 192.225501 93.199999) (xy 223.245722 93.199999) (xy 223.245722 93.2) - (xy 223.264762 93.356818) (xy 223.294592 93.435471) (xy 223.32078 93.504523) (xy 223.410517 93.63453) - (xy 223.52876 93.739283) (xy 223.528762 93.739284) (xy 223.668634 93.812696) (xy 223.822014 93.8505) - (xy 223.822015 93.8505) (xy 223.979985 93.8505) (xy 224.133365 93.812696) (xy 224.27324 93.739283) - (xy 224.391483 93.63453) (xy 224.48122 93.504523) (xy 224.537237 93.356818) (xy 224.556278 93.2) - (xy 224.537237 93.043182) (xy 224.48122 92.895477) (xy 224.391483 92.76547) (xy 224.27324 92.660717) - (xy 224.273238 92.660716) (xy 224.273237 92.660715) (xy 224.214704 92.629994) (xy 233.979529 92.629994) - (xy 233.979529 92.630005) (xy 233.999379 92.869559) (xy 234.058389 93.102589) (xy 234.154951 93.322729) - (xy 234.173095 93.3505) (xy 234.286429 93.523969) (xy 234.449236 93.700825) (xy 234.449239 93.700827) - (xy 234.449242 93.70083) (xy 234.638924 93.848466) (xy 234.63893 93.84847) (xy 234.638933 93.848472) - (xy 234.850344 93.962882) (xy 234.850347 93.962883) (xy 235.077699 94.040933) (xy 235.077701 94.040933) - (xy 235.077703 94.040934) (xy 235.314808 94.0805) (xy 235.314809 94.0805) (xy 235.555191 94.0805) - (xy 235.555192 94.0805) (xy 235.792297 94.040934) (xy 236.019656 93.962882) (xy 236.231067 93.848472) - (xy 236.420764 93.700825) (xy 236.583571 93.523969) (xy 236.715049 93.322728) (xy 236.81161 93.102591) - (xy 236.87062 92.869563) (xy 236.890471 92.63) (xy 236.889642 92.62) (xy 236.877237 92.470291) (xy 236.87062 92.390437) - (xy 236.81161 92.157409) (xy 236.715049 91.937272) (xy 236.708514 91.92727) (xy 236.583572 91.736033) - (xy 236.583571 91.736031) (xy 236.420764 91.559175) (xy 236.420759 91.559171) (xy 236.420757 91.559169) - (xy 236.231075 91.411533) (xy 236.231069 91.411529) (xy 236.219598 91.405321) (xy 237.3845 91.405321) - (xy 237.3845 93.854678) (xy 237.399032 93.927735) (xy 237.399033 93.927739) (xy 237.399034 93.92774) - (xy 237.454399 94.010601) (xy 237.522294 94.055966) (xy 237.53726 94.065966) (xy 237.537264 94.065967) - (xy 237.610321 94.080499) (xy 237.610324 94.0805) (xy 237.610326 94.0805) (xy 240.059676 94.0805) - (xy 240.059677 94.080499) (xy 240.13274 94.065966) (xy 240.215601 94.010601) (xy 240.270966 93.92774) - (xy 240.2855 93.854674) (xy 240.2855 92.629994) (xy 244.269529 92.629994) (xy 244.269529 92.630005) - (xy 244.289379 92.869559) (xy 244.348389 93.102589) (xy 244.444951 93.322729) (xy 244.463095 93.3505) - (xy 244.576429 93.523969) (xy 244.739236 93.700825) (xy 244.739239 93.700827) (xy 244.739242 93.70083) - (xy 244.928924 93.848466) (xy 244.92893 93.84847) (xy 244.928933 93.848472) (xy 245.140344 93.962882) - (xy 245.140347 93.962883) (xy 245.367699 94.040933) (xy 245.367701 94.040933) (xy 245.367703 94.040934) - (xy 245.604808 94.0805) (xy 245.604809 94.0805) (xy 245.845191 94.0805) (xy 245.845192 94.0805) - (xy 246.082297 94.040934) (xy 246.309656 93.962882) (xy 246.521067 93.848472) (xy 246.710764 93.700825) - (xy 246.873571 93.523969) (xy 247.005049 93.322728) (xy 247.10161 93.102591) (xy 247.16062 92.869563) - (xy 247.180471 92.63) (xy 247.179642 92.62) (xy 247.167237 92.470291) (xy 247.16062 92.390437) (xy 247.10161 92.157409) + (xy 128.718985 108.8305) (xy 128.872365 108.792696) (xy 129.01224 108.719283) (xy 129.130483 108.61453) + (xy 129.22022 108.484523) (xy 129.276237 108.336818) (xy 129.295278 108.18) (xy 129.276237 108.023182) + (xy 129.246584 107.944994) (xy 165.704529 107.944994) (xy 165.704529 107.945005) (xy 165.724379 108.184559) + (xy 165.783389 108.417589) (xy 165.879951 108.637729) (xy 165.933234 108.719284) (xy 166.011429 108.838969) + (xy 166.174236 109.015825) (xy 166.174239 109.015827) (xy 166.174242 109.01583) (xy 166.363924 109.163466) + (xy 166.36393 109.16347) (xy 166.363933 109.163472) (xy 166.575344 109.277882) (xy 166.575347 109.277883) + (xy 166.802699 109.355933) (xy 166.802701 109.355933) (xy 166.802703 109.355934) (xy 167.039808 109.3955) + (xy 167.039809 109.3955) (xy 167.280191 109.3955) (xy 167.280192 109.3955) (xy 167.517297 109.355934) + (xy 167.744656 109.277882) (xy 167.956067 109.163472) (xy 168.145764 109.015825) (xy 168.308571 108.838969) + (xy 168.440049 108.637728) (xy 168.53661 108.417591) (xy 168.59562 108.184563) (xy 168.615471 107.945) + (xy 168.615471 107.944994) (xy 179.174529 107.944994) (xy 179.174529 107.945005) (xy 179.194379 108.184559) + (xy 179.253389 108.417589) (xy 179.349951 108.637729) (xy 179.403234 108.719284) (xy 179.481429 108.838969) + (xy 179.644236 109.015825) (xy 179.644239 109.015827) (xy 179.644242 109.01583) (xy 179.833924 109.163466) + (xy 179.83393 109.16347) (xy 179.833933 109.163472) (xy 180.045344 109.277882) (xy 180.045347 109.277883) + (xy 180.272699 109.355933) (xy 180.272701 109.355933) (xy 180.272703 109.355934) (xy 180.509808 109.3955) + (xy 180.509809 109.3955) (xy 180.750191 109.3955) (xy 180.750192 109.3955) (xy 180.987297 109.355934) + (xy 181.214656 109.277882) (xy 181.426067 109.163472) (xy 181.615764 109.015825) (xy 181.778571 108.838969) + (xy 181.910049 108.637728) (xy 182.00661 108.417591) (xy 182.030779 108.322149) (xy 271.1995 108.322149) + (xy 271.1995 108.57785) (xy 271.214987 108.695476) (xy 271.232874 108.83134) (xy 271.282307 109.015827) + (xy 271.29905 109.078312) (xy 271.299053 109.078322) (xy 271.396894 109.314531) (xy 271.396899 109.314542) + (xy 271.524734 109.535957) (xy 271.524745 109.535973) (xy 271.680388 109.738811) (xy 271.680394 109.738818) + (xy 271.861181 109.919605) (xy 271.861187 109.91961) (xy 272.064035 110.075261) (xy 272.064042 110.075265) + (xy 272.285457 110.2031) (xy 272.285462 110.203102) (xy 272.285465 110.203104) (xy 272.521687 110.30095) + (xy 272.76866 110.367126) (xy 273.022157 110.4005) (xy 273.022164 110.4005) (xy 273.277836 110.4005) + (xy 273.277843 110.4005) (xy 273.53134 110.367126) (xy 273.778313 110.30095) (xy 274.014535 110.203104) + (xy 274.235965 110.075261) (xy 274.438813 109.91961) (xy 274.61961 109.738813) (xy 274.775261 109.535965) + (xy 274.903104 109.314535) (xy 275.00095 109.078313) (xy 275.067126 108.83134) (xy 275.1005 108.577843) + (xy 275.1005 108.322157) (xy 275.067126 108.06866) (xy 275.00095 107.821687) (xy 274.903104 107.585465) + (xy 274.903102 107.585462) (xy 274.9031 107.585457) (xy 274.775265 107.364042) (xy 274.775261 107.364035) + (xy 274.61961 107.161187) (xy 274.619605 107.161181) (xy 274.438818 106.980394) (xy 274.438811 106.980388) + (xy 274.235973 106.824745) (xy 274.235971 106.824743) (xy 274.235965 106.824739) (xy 274.23596 106.824736) + (xy 274.235957 106.824734) (xy 274.014542 106.696899) (xy 274.014531 106.696894) (xy 273.778322 106.599053) + (xy 273.778315 106.599051) (xy 273.778313 106.59905) (xy 273.53134 106.532874) (xy 273.475007 106.525457) + (xy 273.27785 106.4995) (xy 273.277843 106.4995) (xy 273.022157 106.4995) (xy 273.022149 106.4995) + (xy 272.796826 106.529165) (xy 272.76866 106.532874) (xy 272.521687 106.59905) (xy 272.521677 106.599053) + (xy 272.285468 106.696894) (xy 272.285457 106.696899) (xy 272.064042 106.824734) (xy 272.064026 106.824745) + (xy 271.861188 106.980388) (xy 271.861181 106.980394) (xy 271.680394 107.161181) (xy 271.680388 107.161188) + (xy 271.524745 107.364026) (xy 271.524734 107.364042) (xy 271.396899 107.585457) (xy 271.396894 107.585468) + (xy 271.299053 107.821677) (xy 271.29905 107.821687) (xy 271.266009 107.945) (xy 271.232874 108.068661) + (xy 271.1995 108.322149) (xy 182.030779 108.322149) (xy 182.06562 108.184563) (xy 182.085471 107.945) + (xy 182.06562 107.705437) (xy 182.00661 107.472409) (xy 181.910049 107.252272) (xy 181.778571 107.051031) + (xy 181.615764 106.874175) (xy 181.615759 106.874171) (xy 181.615757 106.874169) (xy 181.426075 106.726533) + (xy 181.426069 106.726529) (xy 181.214657 106.612118) (xy 181.214652 106.612116) (xy 180.9873 106.534066) + (xy 180.780155 106.4995) (xy 180.750192 106.4945) (xy 180.509808 106.4945) (xy 180.479845 106.4995) + (xy 180.272699 106.534066) (xy 180.045347 106.612116) (xy 180.045342 106.612118) (xy 179.83393 106.726529) + (xy 179.833924 106.726533) (xy 179.644242 106.874169) (xy 179.644239 106.874172) (xy 179.48143 107.051029) + (xy 179.481427 107.051033) (xy 179.349951 107.25227) (xy 179.253389 107.47241) (xy 179.194379 107.70544) + (xy 179.174529 107.944994) (xy 168.615471 107.944994) (xy 168.59562 107.705437) (xy 168.53661 107.472409) + (xy 168.440049 107.252272) (xy 168.308571 107.051031) (xy 168.145764 106.874175) (xy 168.145759 106.874171) + (xy 168.145757 106.874169) (xy 167.956075 106.726533) (xy 167.956069 106.726529) (xy 167.744657 106.612118) + (xy 167.744652 106.612116) (xy 167.5173 106.534066) (xy 167.310155 106.4995) (xy 167.280192 106.4945) + (xy 167.039808 106.4945) (xy 167.009845 106.4995) (xy 166.802699 106.534066) (xy 166.575347 106.612116) + (xy 166.575342 106.612118) (xy 166.36393 106.726529) (xy 166.363924 106.726533) (xy 166.174242 106.874169) + (xy 166.174239 106.874172) (xy 166.01143 107.051029) (xy 166.011427 107.051033) (xy 165.879951 107.25227) + (xy 165.783389 107.47241) (xy 165.724379 107.70544) (xy 165.704529 107.944994) (xy 129.246584 107.944994) + (xy 129.22022 107.875477) (xy 129.130483 107.74547) (xy 129.01224 107.640717) (xy 129.012238 107.640716) + (xy 129.012237 107.640715) (xy 128.872365 107.567303) (xy 128.718986 107.5295) (xy 128.718985 107.5295) + (xy 128.561015 107.5295) (xy 128.561014 107.5295) (xy 128.407634 107.567303) (xy 128.267762 107.640715) + (xy 128.149516 107.745471) (xy 128.059781 107.875475) (xy 128.05978 107.875476) (xy 128.003762 108.023181) + (xy 127.984722 108.179999) (xy 112.3005 108.179999) (xy 112.3005 104.544994) (xy 165.704529 104.544994) + (xy 165.704529 104.545005) (xy 165.724379 104.784559) (xy 165.783389 105.017589) (xy 165.879951 105.237729) + (xy 166.011427 105.438966) (xy 166.011429 105.438969) (xy 166.174236 105.615825) (xy 166.174239 105.615827) + (xy 166.174242 105.61583) (xy 166.363924 105.763466) (xy 166.36393 105.76347) (xy 166.363933 105.763472) + (xy 166.575344 105.877882) (xy 166.575347 105.877883) (xy 166.802699 105.955933) (xy 166.802701 105.955933) + (xy 166.802703 105.955934) (xy 167.039808 105.9955) (xy 167.039809 105.9955) (xy 167.280191 105.9955) + (xy 167.280192 105.9955) (xy 167.517297 105.955934) (xy 167.744656 105.877882) (xy 167.956067 105.763472) + (xy 168.145764 105.615825) (xy 168.308571 105.438969) (xy 168.440049 105.237728) (xy 168.53661 105.017591) + (xy 168.59562 104.784563) (xy 168.615471 104.545) (xy 168.59562 104.305437) (xy 168.53661 104.072409) + (xy 168.440049 103.852272) (xy 168.308571 103.651031) (xy 168.145764 103.474175) (xy 168.145759 103.474171) + (xy 168.145757 103.474169) (xy 167.956075 103.326533) (xy 167.956069 103.326529) (xy 167.944598 103.320321) + (xy 179.1795 103.320321) (xy 179.1795 105.769678) (xy 179.194032 105.842735) (xy 179.194033 105.842739) + (xy 179.194034 105.84274) (xy 179.249399 105.925601) (xy 179.33226 105.980966) (xy 179.332264 105.980967) + (xy 179.405321 105.995499) (xy 179.405324 105.9955) (xy 179.405326 105.9955) (xy 181.854676 105.9955) + (xy 181.854677 105.995499) (xy 181.92774 105.980966) (xy 182.010601 105.925601) (xy 182.065966 105.84274) + (xy 182.0805 105.769674) (xy 182.0805 103.320326) (xy 182.0805 103.320323) (xy 182.080499 103.320321) + (xy 182.065967 103.247264) (xy 182.065966 103.24726) (xy 182.042484 103.212116) (xy 182.010601 103.164399) + (xy 181.92774 103.109034) (xy 181.927739 103.109033) (xy 181.927735 103.109032) (xy 181.854677 103.0945) + (xy 181.854674 103.0945) (xy 179.405326 103.0945) (xy 179.405323 103.0945) (xy 179.332264 103.109032) + (xy 179.33226 103.109033) (xy 179.249399 103.164399) (xy 179.194033 103.24726) (xy 179.194032 103.247264) + (xy 179.1795 103.320321) (xy 167.944598 103.320321) (xy 167.744657 103.212118) (xy 167.744652 103.212116) + (xy 167.5173 103.134066) (xy 167.339468 103.104391) (xy 167.280192 103.0945) (xy 167.039808 103.0945) + (xy 166.992387 103.102413) (xy 166.802699 103.134066) (xy 166.575347 103.212116) (xy 166.575342 103.212118) + (xy 166.36393 103.326529) (xy 166.363924 103.326533) (xy 166.174242 103.474169) (xy 166.174239 103.474172) + (xy 166.01143 103.651029) (xy 166.011427 103.651033) (xy 165.879951 103.85227) (xy 165.783389 104.07241) + (xy 165.724379 104.30544) (xy 165.704529 104.544994) (xy 112.3005 104.544994) (xy 112.3005 102.299999) + (xy 122.034722 102.299999) (xy 122.034722 102.3) (xy 122.053762 102.456818) (xy 122.10978 102.604523) + (xy 122.199517 102.73453) (xy 122.31776 102.839283) (xy 122.317762 102.839284) (xy 122.457634 102.912696) + (xy 122.611014 102.9505) (xy 122.611015 102.9505) (xy 122.768985 102.9505) (xy 122.922365 102.912696) + (xy 123.06224 102.839283) (xy 123.180483 102.73453) (xy 123.27022 102.604523) (xy 123.326237 102.456818) + (xy 123.345278 102.3) (xy 123.326237 102.143182) (xy 123.27022 101.995477) (xy 123.180483 101.86547) + (xy 123.06224 101.760717) (xy 123.062238 101.760716) (xy 123.062237 101.760715) (xy 122.922365 101.687303) + (xy 122.768986 101.6495) (xy 122.768985 101.6495) (xy 122.611015 101.6495) (xy 122.611014 101.6495) + (xy 122.457634 101.687303) (xy 122.317762 101.760715) (xy 122.199516 101.865471) (xy 122.109781 101.995475) + (xy 122.10978 101.995476) (xy 122.053762 102.143181) (xy 122.034722 102.299999) (xy 112.3005 102.299999) + (xy 112.3005 101.199996) (xy 200.544719 101.199996) (xy 200.544719 101.199997) (xy 200.563759 101.356815) + (xy 200.619777 101.50452) (xy 200.709514 101.634527) (xy 200.827757 101.73928) (xy 200.827759 101.739281) + (xy 200.967631 101.812693) (xy 201.121011 101.850497) (xy 201.121012 101.850497) (xy 201.278982 101.850497) + (xy 201.432362 101.812693) (xy 201.572237 101.73928) (xy 201.69048 101.634527) (xy 201.780217 101.50452) + (xy 201.836234 101.356815) (xy 201.855275 101.199997) (xy 201.836234 101.043179) (xy 201.780217 100.895474) + (xy 201.69048 100.765467) (xy 201.572237 100.660714) (xy 201.572235 100.660713) (xy 201.572234 100.660712) + (xy 201.432362 100.5873) (xy 201.278983 100.549497) (xy 201.278982 100.549497) (xy 201.121012 100.549497) + (xy 201.121011 100.549497) (xy 200.967631 100.5873) (xy 200.827759 100.660712) (xy 200.709513 100.765468) + (xy 200.619778 100.895472) (xy 200.619777 100.895473) (xy 200.563759 101.043178) (xy 200.544719 101.199996) + (xy 112.3005 101.199996) (xy 112.3005 99.439999) (xy 162.174722 99.439999) (xy 162.174722 99.44) + (xy 162.193762 99.596818) (xy 162.247793 99.739283) (xy 162.24978 99.744523) (xy 162.339517 99.87453) + (xy 162.45776 99.979283) (xy 162.457762 99.979284) (xy 162.597634 100.052696) (xy 162.751014 100.0905) + (xy 162.751015 100.0905) (xy 162.908985 100.0905) (xy 163.062365 100.052696) (xy 163.20224 99.979283) + (xy 163.320483 99.87453) (xy 163.40644 99.749999) (xy 199.094722 99.749999) (xy 199.094722 99.75) + (xy 199.113762 99.906818) (xy 199.148548 99.998539) (xy 199.16978 100.054523) (xy 199.259517 100.18453) + (xy 199.37776 100.289283) (xy 199.377762 100.289284) (xy 199.517634 100.362696) (xy 199.671014 100.4005) + (xy 199.671015 100.4005) (xy 199.828985 100.4005) (xy 199.982365 100.362696) (xy 200.12224 100.289283) + (xy 200.240483 100.18453) (xy 200.33022 100.054523) (xy 200.386237 99.906818) (xy 200.405278 99.75) + (xy 200.386679 99.596818) (xy 200.386237 99.593181) (xy 200.364992 99.537164) (xy 200.33022 99.445477) + (xy 200.32644 99.44) (xy 257.874659 99.44) (xy 257.893975 99.636129) (xy 257.893976 99.636132) (xy 257.947536 99.812696) + (xy 257.951188 99.824733) (xy 258.044086 99.998532) (xy 258.04409 99.998539) (xy 258.169116 100.150883) + (xy 258.32146 100.275909) (xy 258.321467 100.275913) (xy 258.495266 100.368811) (xy 258.495269 100.368811) + (xy 258.495273 100.368814) (xy 258.683868 100.426024) (xy 258.88 100.445341) (xy 259.076132 100.426024) + (xy 259.264727 100.368814) (xy 259.438538 100.27591) (xy 259.590883 100.150883) (xy 259.71591 99.998538) + (xy 259.808814 99.824727) (xy 259.866024 99.636132) (xy 259.885341 99.44) (xy 259.866024 99.243868) + (xy 259.808814 99.055273) (xy 259.808811 99.055269) (xy 259.808811 99.055266) (xy 259.715913 98.881467) + (xy 259.715909 98.88146) (xy 259.590883 98.729116) (xy 259.513149 98.665321) (xy 260.3795 98.665321) + (xy 260.3795 100.214678) (xy 260.394032 100.287735) (xy 260.394033 100.287739) (xy 260.412405 100.315235) + (xy 260.449399 100.370601) (xy 260.494147 100.4005) (xy 260.53226 100.425966) (xy 260.532264 100.425967) + (xy 260.605321 100.440499) (xy 260.605324 100.4405) (xy 260.605326 100.4405) (xy 262.154676 100.4405) + (xy 262.154677 100.440499) (xy 262.22774 100.425966) (xy 262.310601 100.370601) (xy 262.365966 100.28774) + (xy 262.3805 100.214674) (xy 262.3805 99.199999) (xy 264.544722 99.199999) (xy 264.544722 99.2) + (xy 264.563762 99.356818) (xy 264.603084 99.460499) (xy 264.61978 99.504523) (xy 264.709517 99.63453) + (xy 264.82776 99.739283) (xy 264.827762 99.739284) (xy 264.967634 99.812696) (xy 265.121014 99.8505) + (xy 265.121015 99.8505) (xy 265.278985 99.8505) (xy 265.432365 99.812696) (xy 265.57224 99.739283) + (xy 265.690483 99.63453) (xy 265.78022 99.504523) (xy 265.836237 99.356818) (xy 265.855278 99.2) + (xy 265.847666 99.137304) (xy 265.836237 99.043181) (xy 265.782207 98.900717) (xy 265.78022 98.895477) + (xy 265.690483 98.76547) (xy 265.57224 98.660717) (xy 265.572238 98.660716) (xy 265.572237 98.660715) + (xy 265.432365 98.587303) (xy 265.278986 98.5495) (xy 265.278985 98.5495) (xy 265.121015 98.5495) + (xy 265.121014 98.5495) (xy 264.967634 98.587303) (xy 264.827762 98.660715) (xy 264.709516 98.765471) + (xy 264.619781 98.895475) (xy 264.61978 98.895476) (xy 264.563762 99.043181) (xy 264.544722 99.199999) + (xy 262.3805 99.199999) (xy 262.3805 98.665326) (xy 262.3805 98.665323) (xy 262.380499 98.665321) + (xy 262.365967 98.592264) (xy 262.365966 98.59226) (xy 262.337395 98.5495) (xy 262.310601 98.509399) + (xy 262.22774 98.454034) (xy 262.227739 98.454033) (xy 262.227735 98.454032) (xy 262.154677 98.4395) + (xy 262.154674 98.4395) (xy 260.605326 98.4395) (xy 260.605323 98.4395) (xy 260.532264 98.454032) + (xy 260.53226 98.454033) (xy 260.449399 98.509399) (xy 260.394033 98.59226) (xy 260.394032 98.592264) + (xy 260.3795 98.665321) (xy 259.513149 98.665321) (xy 259.438539 98.60409) (xy 259.438532 98.604086) + (xy 259.264733 98.511188) (xy 259.264727 98.511186) (xy 259.076132 98.453976) (xy 259.076129 98.453975) + (xy 258.88 98.434659) (xy 258.68387 98.453975) (xy 258.495266 98.511188) (xy 258.321467 98.604086) + (xy 258.32146 98.60409) (xy 258.169116 98.729116) (xy 258.04409 98.88146) (xy 258.044086 98.881467) + (xy 257.951188 99.055266) (xy 257.893975 99.24387) (xy 257.874659 99.44) (xy 200.32644 99.44) (xy 200.240483 99.31547) + (xy 200.12224 99.210717) (xy 200.122238 99.210716) (xy 200.122237 99.210715) (xy 199.982365 99.137303) + (xy 199.828986 99.0995) (xy 199.828985 99.0995) (xy 199.671015 99.0995) (xy 199.671014 99.0995) + (xy 199.517634 99.137303) (xy 199.377762 99.210715) (xy 199.298931 99.280552) (xy 199.268243 99.30774) + (xy 199.259516 99.315471) (xy 199.169781 99.445475) (xy 199.16978 99.445476) (xy 199.113762 99.593181) + (xy 199.094722 99.749999) (xy 163.40644 99.749999) (xy 163.41022 99.744523) (xy 163.466237 99.596818) + (xy 163.485278 99.44) (xy 163.470158 99.31547) (xy 163.466237 99.283181) (xy 163.43469 99.199999) + (xy 163.41022 99.135477) (xy 163.320483 99.00547) (xy 163.20224 98.900717) (xy 163.202238 98.900716) + (xy 163.202237 98.900715) (xy 163.062365 98.827303) (xy 162.908986 98.7895) (xy 162.908985 98.7895) + (xy 162.751015 98.7895) (xy 162.751014 98.7895) (xy 162.597634 98.827303) (xy 162.457762 98.900715) + (xy 162.339516 99.005471) (xy 162.249781 99.135475) (xy 162.24978 99.135476) (xy 162.193762 99.283181) + (xy 162.174722 99.439999) (xy 112.3005 99.439999) (xy 112.3005 97.685321) (xy 164.3195 97.685321) + (xy 164.3195 99.234678) (xy 164.334032 99.307735) (xy 164.334033 99.307739) (xy 164.352405 99.335235) + (xy 164.389399 99.390601) (xy 164.46333 99.439999) (xy 164.47226 99.445966) (xy 164.472264 99.445967) + (xy 164.545321 99.460499) (xy 164.545324 99.4605) (xy 164.545326 99.4605) (xy 166.094676 99.4605) + (xy 166.094677 99.460499) (xy 166.16774 99.445966) (xy 166.250601 99.390601) (xy 166.305966 99.30774) + (xy 166.3205 99.234674) (xy 166.3205 97.685326) (xy 166.3205 97.685323) (xy 166.320499 97.685321) + (xy 166.305967 97.612264) (xy 166.305966 97.61226) (xy 166.250601 97.529399) (xy 166.16774 97.474034) + (xy 166.167739 97.474033) (xy 166.167735 97.474032) (xy 166.094677 97.4595) (xy 166.094674 97.4595) + (xy 164.545326 97.4595) (xy 164.545323 97.4595) (xy 164.472264 97.474032) (xy 164.47226 97.474033) + (xy 164.389399 97.529399) (xy 164.334033 97.61226) (xy 164.334032 97.612264) (xy 164.3195 97.685321) + (xy 112.3005 97.685321) (xy 112.3005 95.96) (xy 164.314659 95.96) (xy 164.333975 96.156129) (xy 164.391188 96.344733) + (xy 164.484086 96.518532) (xy 164.48409 96.518539) (xy 164.609116 96.670883) (xy 164.76146 96.795909) + (xy 164.761467 96.795913) (xy 164.935266 96.888811) (xy 164.935269 96.888811) (xy 164.935273 96.888814) + (xy 165.123868 96.946024) (xy 165.32 96.965341) (xy 165.516132 96.946024) (xy 165.704727 96.888814) + (xy 165.870888 96.799999) (xy 222.144722 96.799999) (xy 222.144722 96.8) (xy 222.163762 96.956818) + (xy 222.21978 97.104523) (xy 222.309517 97.23453) (xy 222.42776 97.339283) (xy 222.427762 97.339284) + (xy 222.567634 97.412696) (xy 222.721014 97.4505) (xy 222.721015 97.4505) (xy 222.878985 97.4505) + (xy 223.032365 97.412696) (xy 223.17224 97.339283) (xy 223.290483 97.23453) (xy 223.38022 97.104523) + (xy 223.436237 96.956818) (xy 223.455278 96.8) (xy 223.454781 96.79591) (xy 223.436237 96.643182) + (xy 223.436237 96.643181) (xy 223.409765 96.573383) (xy 223.404399 96.503721) (xy 223.437546 96.442215) + (xy 223.498684 96.408394) (xy 223.559972 96.412438) (xy 223.560351 96.410901) (xy 223.721014 96.4505) + (xy 223.721015 96.4505) (xy 223.878985 96.4505) (xy 224.032365 96.412696) (xy 224.040562 96.408394) + (xy 224.17224 96.339283) (xy 224.290483 96.23453) (xy 224.38022 96.104523) (xy 224.436237 95.956818) + (xy 224.455278 95.8) (xy 224.436237 95.643182) (xy 224.38022 95.495477) (xy 224.290483 95.36547) + (xy 224.17224 95.260717) (xy 224.172238 95.260716) (xy 224.172237 95.260715) (xy 224.032365 95.187303) + (xy 223.878986 95.1495) (xy 223.878985 95.1495) (xy 223.721015 95.1495) (xy 223.721014 95.1495) + (xy 223.567634 95.187303) (xy 223.427762 95.260715) (xy 223.309516 95.365471) (xy 223.219781 95.495475) + (xy 223.21978 95.495476) (xy 223.163762 95.643181) (xy 223.144722 95.799999) (xy 223.144722 95.8) + (xy 223.163763 95.956818) (xy 223.190233 96.026615) (xy 223.1956 96.096278) (xy 223.162452 96.157785) + (xy 223.101314 96.191606) (xy 223.040028 96.18756) (xy 223.039649 96.189099) (xy 222.878986 96.1495) + (xy 222.878985 96.1495) (xy 222.721015 96.1495) (xy 222.721014 96.1495) (xy 222.567634 96.187303) + (xy 222.427762 96.260715) (xy 222.42776 96.260717) (xy 222.332925 96.344733) (xy 222.309516 96.365471) + (xy 222.219781 96.495475) (xy 222.21978 96.495476) (xy 222.163762 96.643181) (xy 222.144722 96.799999) + (xy 165.870888 96.799999) (xy 165.878538 96.79591) (xy 166.030883 96.670883) (xy 166.15591 96.518538) + (xy 166.248814 96.344727) (xy 166.306024 96.156132) (xy 166.325341 95.96) (xy 166.306024 95.763868) + (xy 166.256315 95.599999) (xy 220.944722 95.599999) (xy 220.944722 95.6) (xy 220.963762 95.756818) + (xy 221.01978 95.904523) (xy 221.109517 96.03453) (xy 221.22776 96.139283) (xy 221.227762 96.139284) + (xy 221.367634 96.212696) (xy 221.521014 96.2505) (xy 221.521015 96.2505) (xy 221.678985 96.2505) + (xy 221.832365 96.212696) (xy 221.872548 96.191606) (xy 221.97224 96.139283) (xy 222.090483 96.03453) + (xy 222.18022 95.904523) (xy 222.236237 95.756818) (xy 222.255278 95.6) (xy 222.242587 95.495475) + (xy 222.236237 95.443181) (xy 222.206765 95.36547) (xy 222.18022 95.295477) (xy 222.161707 95.268656) + (xy 222.139825 95.202301) (xy 222.157291 95.13465) (xy 222.208559 95.087181) (xy 222.277353 95.074964) + (xy 222.321379 95.088419) (xy 222.367635 95.112696) (xy 222.367637 95.112696) (xy 222.367638 95.112697) + (xy 222.521014 95.1505) (xy 222.521015 95.1505) (xy 222.678985 95.1505) (xy 222.832365 95.112696) + (xy 222.97224 95.039283) (xy 223.090483 94.93453) (xy 223.18022 94.804523) (xy 223.236237 94.656818) + (xy 223.255278 94.5) (xy 223.255278 94.499999) (xy 224.244722 94.499999) (xy 224.244722 94.5) (xy 224.263762 94.656818) + (xy 224.31978 94.804523) (xy 224.409517 94.93453) (xy 224.52776 95.039283) (xy 224.527762 95.039284) + (xy 224.667634 95.112696) (xy 224.821014 95.1505) (xy 224.821015 95.1505) (xy 224.978985 95.1505) + (xy 225.132365 95.112696) (xy 225.27224 95.039283) (xy 225.390483 94.93453) (xy 225.48022 94.804523) + (xy 225.536237 94.656818) (xy 225.555278 94.5) (xy 225.536237 94.343182) (xy 225.48022 94.195477) + (xy 225.390483 94.06547) (xy 225.27224 93.960717) (xy 225.272238 93.960716) (xy 225.272237 93.960715) + (xy 225.132365 93.887303) (xy 224.978986 93.8495) (xy 224.978985 93.8495) (xy 224.821015 93.8495) + (xy 224.821014 93.8495) (xy 224.667634 93.887303) (xy 224.527762 93.960715) (xy 224.409516 94.065471) + (xy 224.319781 94.195475) (xy 224.31978 94.195476) (xy 224.263762 94.343181) (xy 224.244722 94.499999) + (xy 223.255278 94.499999) (xy 223.236237 94.343182) (xy 223.18022 94.195477) (xy 223.090483 94.06547) + (xy 222.97224 93.960717) (xy 222.972238 93.960716) (xy 222.972237 93.960715) (xy 222.832365 93.887303) + (xy 222.678986 93.8495) (xy 222.678985 93.8495) (xy 222.521015 93.8495) (xy 222.521014 93.8495) + (xy 222.367634 93.887303) (xy 222.227762 93.960715) (xy 222.109516 94.065471) (xy 222.019781 94.195475) + (xy 222.01978 94.195476) (xy 221.963762 94.343181) (xy 221.944722 94.499999) (xy 221.944722 94.5) + (xy 221.963762 94.656818) (xy 222.01978 94.804523) (xy 222.019782 94.804527) (xy 222.038292 94.831344) + (xy 222.060174 94.897698) (xy 222.042708 94.96535) (xy 221.991439 95.012819) (xy 221.922646 95.025034) + (xy 221.878615 95.011578) (xy 221.832365 94.987304) (xy 221.832364 94.987303) (xy 221.832363 94.987303) + (xy 221.678986 94.9495) (xy 221.678985 94.9495) (xy 221.521015 94.9495) (xy 221.521014 94.9495) + (xy 221.367634 94.987303) (xy 221.227762 95.060715) (xy 221.109516 95.165471) (xy 221.019781 95.295475) + (xy 221.01978 95.295476) (xy 220.963762 95.443181) (xy 220.944722 95.599999) (xy 166.256315 95.599999) + (xy 166.248814 95.575273) (xy 166.248811 95.575269) (xy 166.248811 95.575266) (xy 166.155913 95.401467) + (xy 166.155909 95.40146) (xy 166.030883 95.249116) (xy 165.878539 95.12409) (xy 165.878532 95.124086) + (xy 165.704733 95.031188) (xy 165.704727 95.031186) (xy 165.516132 94.973976) (xy 165.516129 94.973975) + (xy 165.32 94.954659) (xy 165.12387 94.973975) (xy 164.935266 95.031188) (xy 164.761467 95.124086) + (xy 164.76146 95.12409) (xy 164.609116 95.249116) (xy 164.48409 95.40146) (xy 164.484086 95.401467) + (xy 164.391188 95.575266) (xy 164.333975 95.76387) (xy 164.314659 95.96) (xy 112.3005 95.96) (xy 112.3005 93.869999) + (xy 163.594722 93.869999) (xy 163.594722 93.87) (xy 163.613762 94.026818) (xy 163.66978 94.174523) + (xy 163.759517 94.30453) (xy 163.87776 94.409283) (xy 163.877762 94.409284) (xy 164.017634 94.482696) + (xy 164.171014 94.5205) (xy 164.171015 94.5205) (xy 164.328985 94.5205) (xy 164.482365 94.482696) + (xy 164.62224 94.409283) (xy 164.740483 94.30453) (xy 164.83022 94.174523) (xy 164.886237 94.026818) + (xy 164.905278 93.87) (xy 164.886237 93.713182) (xy 164.881551 93.700827) (xy 164.856408 93.63453) + (xy 164.83022 93.565477) (xy 164.740483 93.43547) (xy 164.62224 93.330717) (xy 164.622238 93.330716) + (xy 164.622237 93.330715) (xy 164.482365 93.257303) (xy 164.328986 93.2195) (xy 164.328985 93.2195) + (xy 164.171015 93.2195) (xy 164.171014 93.2195) (xy 164.017634 93.257303) (xy 163.877762 93.330715) + (xy 163.759516 93.435471) (xy 163.669781 93.565475) (xy 163.66978 93.565476) (xy 163.613762 93.713181) + (xy 163.594722 93.869999) (xy 112.3005 93.869999) (xy 112.3005 92.699999) (xy 167.044722 92.699999) + (xy 167.044722 92.7) (xy 167.063762 92.856818) (xy 167.078424 92.895477) (xy 167.11978 93.004523) + (xy 167.209517 93.13453) (xy 167.32776 93.239283) (xy 167.327762 93.239284) (xy 167.467634 93.312696) + (xy 167.621014 93.3505) (xy 167.621015 93.3505) (xy 167.778985 93.3505) (xy 167.932365 93.312696) + (xy 168.07224 93.239283) (xy 168.190483 93.13453) (xy 168.28022 93.004523) (xy 168.336237 92.856818) + (xy 168.355278 92.7) (xy 168.345564 92.619994) (xy 176.729529 92.619994) (xy 176.729529 92.620005) + (xy 176.749379 92.859559) (xy 176.808389 93.092589) (xy 176.904951 93.312729) (xy 176.985143 93.435471) + (xy 177.036429 93.513969) (xy 177.199236 93.690825) (xy 177.199239 93.690827) (xy 177.199242 93.69083) + (xy 177.388924 93.838466) (xy 177.38893 93.83847) (xy 177.388933 93.838472) (xy 177.600344 93.952882) + (xy 177.600347 93.952883) (xy 177.827699 94.030933) (xy 177.827701 94.030933) (xy 177.827703 94.030934) + (xy 178.064808 94.0705) (xy 178.064809 94.0705) (xy 178.305191 94.0705) (xy 178.305192 94.0705) + (xy 178.542297 94.030934) (xy 178.769656 93.952882) (xy 178.981067 93.838472) (xy 179.170764 93.690825) + (xy 179.333571 93.513969) (xy 179.465049 93.312728) (xy 179.56161 93.092591) (xy 179.62062 92.859563) + (xy 179.637097 92.660717) (xy 179.640471 92.620005) (xy 179.640471 92.619994) (xy 179.621449 92.39044) + (xy 179.62062 92.380437) (xy 179.56161 92.147409) (xy 179.465049 91.927272) (xy 179.333571 91.726031) + (xy 179.170764 91.549175) (xy 179.170759 91.549171) (xy 179.170757 91.549169) (xy 178.981075 91.401533) + (xy 178.981069 91.401529) (xy 178.969598 91.395321) (xy 180.1345 91.395321) (xy 180.1345 93.844678) + (xy 180.149032 93.917735) (xy 180.149033 93.917739) (xy 180.167405 93.945235) (xy 180.204399 94.000601) + (xy 180.264763 94.040934) (xy 180.28726 94.055966) (xy 180.287264 94.055967) (xy 180.360321 94.070499) + (xy 180.360324 94.0705) (xy 180.360326 94.0705) (xy 182.809676 94.0705) (xy 182.809677 94.070499) + (xy 182.88274 94.055966) (xy 182.965601 94.000601) (xy 183.020966 93.91774) (xy 183.0355 93.844674) + (xy 183.0355 92.619994) (xy 185.91953 92.619994) (xy 185.91953 92.620005) (xy 185.93938 92.859559) + (xy 185.99839 93.092589) (xy 186.094952 93.312729) (xy 186.175144 93.435471) (xy 186.22643 93.513969) + (xy 186.389237 93.690825) (xy 186.38924 93.690827) (xy 186.389243 93.69083) (xy 186.578925 93.838466) + (xy 186.578931 93.83847) (xy 186.578934 93.838472) (xy 186.790345 93.952882) (xy 186.790348 93.952883) + (xy 187.0177 94.030933) (xy 187.017702 94.030933) (xy 187.017704 94.030934) (xy 187.254809 94.0705) + (xy 187.25481 94.0705) (xy 187.495192 94.0705) (xy 187.495193 94.0705) (xy 187.732298 94.030934) + (xy 187.959657 93.952882) (xy 188.171068 93.838472) (xy 188.360765 93.690825) (xy 188.523572 93.513969) + (xy 188.65505 93.312728) (xy 188.751611 93.092591) (xy 188.810621 92.859563) (xy 188.827098 92.660717) + (xy 188.830472 92.620005) (xy 188.830472 92.619994) (xy 188.81145 92.39044) (xy 188.810621 92.380437) + (xy 188.751611 92.147409) (xy 188.65505 91.927272) (xy 188.523572 91.726031) (xy 188.360765 91.549175) + (xy 188.36076 91.549171) (xy 188.360758 91.549169) (xy 188.171076 91.401533) (xy 188.17107 91.401529) + (xy 188.159599 91.395321) (xy 189.324501 91.395321) (xy 189.324501 93.844678) (xy 189.339033 93.917735) + (xy 189.339034 93.917739) (xy 189.357406 93.945235) (xy 189.3944 94.000601) (xy 189.454764 94.040934) + (xy 189.477261 94.055966) (xy 189.477265 94.055967) (xy 189.550322 94.070499) (xy 189.550325 94.0705) + (xy 189.550327 94.0705) (xy 191.999677 94.0705) (xy 191.999678 94.070499) (xy 192.072741 94.055966) + (xy 192.155602 94.000601) (xy 192.210967 93.91774) (xy 192.225501 93.844674) (xy 192.225501 93.199999) + (xy 223.245722 93.199999) (xy 223.245722 93.2) (xy 223.264762 93.356818) (xy 223.294592 93.435471) + (xy 223.32078 93.504523) (xy 223.410517 93.63453) (xy 223.52876 93.739283) (xy 223.528762 93.739284) + (xy 223.668634 93.812696) (xy 223.822014 93.8505) (xy 223.822015 93.8505) (xy 223.979985 93.8505) + (xy 224.133365 93.812696) (xy 224.27324 93.739283) (xy 224.391483 93.63453) (xy 224.48122 93.504523) + (xy 224.537237 93.356818) (xy 224.556278 93.2) (xy 224.537237 93.043182) (xy 224.48122 92.895477) + (xy 224.391483 92.76547) (xy 224.27324 92.660717) (xy 224.273238 92.660716) (xy 224.273237 92.660715) + (xy 224.214704 92.629994) (xy 233.979529 92.629994) (xy 233.979529 92.630005) (xy 233.999379 92.869559) + (xy 234.058389 93.102589) (xy 234.154951 93.322729) (xy 234.173095 93.3505) (xy 234.286429 93.523969) + (xy 234.449236 93.700825) (xy 234.449239 93.700827) (xy 234.449242 93.70083) (xy 234.638924 93.848466) + (xy 234.63893 93.84847) (xy 234.638933 93.848472) (xy 234.850344 93.962882) (xy 234.850347 93.962883) + (xy 235.077699 94.040933) (xy 235.077701 94.040933) (xy 235.077703 94.040934) (xy 235.314808 94.0805) + (xy 235.314809 94.0805) (xy 235.555191 94.0805) (xy 235.555192 94.0805) (xy 235.792297 94.040934) + (xy 236.019656 93.962882) (xy 236.231067 93.848472) (xy 236.420764 93.700825) (xy 236.583571 93.523969) + (xy 236.715049 93.322728) (xy 236.81161 93.102591) (xy 236.87062 92.869563) (xy 236.890471 92.63) + (xy 236.889642 92.62) (xy 236.877237 92.470291) (xy 236.87062 92.390437) (xy 236.81161 92.157409) + (xy 236.715049 91.937272) (xy 236.708514 91.92727) (xy 236.583572 91.736033) (xy 236.583571 91.736031) + (xy 236.420764 91.559175) (xy 236.420759 91.559171) (xy 236.420757 91.559169) (xy 236.231075 91.411533) + (xy 236.231069 91.411529) (xy 236.219598 91.405321) (xy 237.3845 91.405321) (xy 237.3845 93.854678) + (xy 237.399032 93.927735) (xy 237.399033 93.927739) (xy 237.399034 93.92774) (xy 237.454399 94.010601) + (xy 237.522294 94.055966) (xy 237.53726 94.065966) (xy 237.537264 94.065967) (xy 237.610321 94.080499) + (xy 237.610324 94.0805) (xy 237.610326 94.0805) (xy 240.059676 94.0805) (xy 240.059677 94.080499) + (xy 240.13274 94.065966) (xy 240.215601 94.010601) (xy 240.270966 93.92774) (xy 240.2855 93.854674) + (xy 240.2855 92.629994) (xy 244.269529 92.629994) (xy 244.269529 92.630005) (xy 244.289379 92.869559) + (xy 244.348389 93.102589) (xy 244.444951 93.322729) (xy 244.463095 93.3505) (xy 244.576429 93.523969) + (xy 244.739236 93.700825) (xy 244.739239 93.700827) (xy 244.739242 93.70083) (xy 244.928924 93.848466) + (xy 244.92893 93.84847) (xy 244.928933 93.848472) (xy 245.140344 93.962882) (xy 245.140347 93.962883) + (xy 245.367699 94.040933) (xy 245.367701 94.040933) (xy 245.367703 94.040934) (xy 245.604808 94.0805) + (xy 245.604809 94.0805) (xy 245.845191 94.0805) (xy 245.845192 94.0805) (xy 246.082297 94.040934) + (xy 246.309656 93.962882) (xy 246.521067 93.848472) (xy 246.710764 93.700825) (xy 246.873571 93.523969) + (xy 247.005049 93.322728) (xy 247.10161 93.102591) (xy 247.16062 92.869563) (xy 247.180471 92.63) + (xy 247.179642 92.62) (xy 247.167237 92.470291) (xy 247.16062 92.390437) (xy 247.10161 92.157409) (xy 247.005049 91.937272) (xy 246.998514 91.92727) (xy 246.873572 91.736033) (xy 246.873571 91.736031) (xy 246.710764 91.559175) (xy 246.710759 91.559171) (xy 246.710757 91.559169) (xy 246.521075 91.411533) (xy 246.521069 91.411529) (xy 246.509598 91.405321) (xy 247.6745 91.405321) (xy 247.6745 93.854678) @@ -175027,79 +179520,61 @@ (filled_polygon (layer "B.Cu") (pts - (xy 231.976435 220.766462) (xy 232.01738 220.823078) (xy 232.0245 220.864492) (xy 232.0245 221.407796) - (xy 232.004815 221.474835) (xy 231.982727 221.500611) (xy 231.909518 221.565468) (xy 231.819781 221.695475) - (xy 231.81978 221.695476) (xy 231.763763 221.843181) (xy 231.744722 222) (xy 231.744722 222.000001) - (xy 231.750896 222.050855) (xy 231.739435 222.119779) (xy 231.719414 222.147949) (xy 231.719471 222.147993) - (xy 231.718292 222.149529) (xy 231.715488 222.153475) (xy 231.714526 222.154436) (xy 231.714522 222.154442) - (xy 231.665091 222.240059) (xy 231.665091 222.24006) (xy 231.66509 222.240062) (xy 231.6395 222.335565) - (xy 231.6395 222.335567) (xy 231.6395 223.378108) (xy 231.619815 223.445147) (xy 231.603181 223.465789) - (xy 225.255789 229.813181) (xy 225.194466 229.846666) (xy 225.168108 229.8495) (xy 225.021022 229.8495) - (xy 224.867642 229.887303) (xy 224.72777 229.960715) (xy 224.609524 230.065471) (xy 224.519789 230.195475) - (xy 224.519788 230.195476) (xy 224.46377 230.343181) (xy 224.44473 230.499999) (xy 224.44473 230.5) - (xy 224.46377 230.656818) (xy 224.518072 230.799998) (xy 224.519788 230.804523) (xy 224.609525 230.93453) - (xy 224.727768 231.039283) (xy 224.72777 231.039284) (xy 224.867642 231.112696) (xy 225.021022 231.1505) - (xy 225.021023 231.1505) (xy 225.178993 231.1505) (xy 225.332373 231.112696) (xy 225.35566 231.100474) - (xy 225.472248 231.039283) (xy 225.590491 230.93453) (xy 225.680228 230.804523) (xy 225.736245 230.656818) - (xy 225.755286 230.5) (xy 225.74911 230.449144) (xy 225.760569 230.380224) (xy 225.784522 230.346521) - (xy 231.877821 224.253223) (xy 231.939142 224.21974) (xy 232.008834 224.224724) (xy 232.064767 224.266596) - (xy 232.089184 224.33206) (xy 232.0895 224.340906) (xy 232.0895 224.634678) (xy 232.104032 224.707735) - (xy 232.104033 224.707739) (xy 232.104034 224.70774) (xy 232.159399 224.790601) (xy 232.24226 224.845966) - (xy 232.242264 224.845967) (xy 232.315321 224.860499) (xy 232.315324 224.8605) (xy 232.315326 224.8605) - (xy 233.864676 224.8605) (xy 233.864677 224.860499) (xy 233.93774 224.845966) (xy 234.020601 224.790601) - (xy 234.075966 224.70774) (xy 234.0905 224.634674) (xy 234.0905 223.86) (xy 234.584659 223.86) (xy 234.603975 224.056129) - (xy 234.603976 224.056132) (xy 234.65814 224.234687) (xy 234.661188 224.244733) (xy 234.754086 224.418532) - (xy 234.75409 224.418539) (xy 234.879116 224.570883) (xy 235.03146 224.695909) (xy 235.031467 224.695913) - (xy 235.205266 224.788811) (xy 235.205269 224.788811) (xy 235.205273 224.788814) (xy 235.393868 224.846024) - (xy 235.59 224.865341) (xy 235.786132 224.846024) (xy 235.974727 224.788814) (xy 236.027297 224.760715) - (xy 236.061632 224.742362) (xy 236.148538 224.69591) (xy 236.300883 224.570883) (xy 236.42591 224.418538) - (xy 236.518814 224.244727) (xy 236.576024 224.056132) (xy 236.595341 223.86) (xy 236.576024 223.663868) - (xy 236.518814 223.475273) (xy 236.518811 223.475269) (xy 236.518811 223.475266) (xy 236.425913 223.301467) - (xy 236.425909 223.30146) (xy 236.300883 223.149116) (xy 236.148539 223.02409) (xy 236.148532 223.024086) - (xy 235.974733 222.931188) (xy 235.974727 222.931186) (xy 235.786132 222.873976) (xy 235.786129 222.873975) - (xy 235.59 222.854659) (xy 235.39387 222.873975) (xy 235.205266 222.931188) (xy 235.031467 223.024086) - (xy 235.03146 223.02409) (xy 234.879116 223.149116) (xy 234.75409 223.30146) (xy 234.754086 223.301467) - (xy 234.661188 223.475266) (xy 234.603975 223.66387) (xy 234.584659 223.86) (xy 234.0905 223.86) - (xy 234.0905 223.085326) (xy 234.0905 223.085323) (xy 234.090499 223.085321) (xy 234.075967 223.012264) - (xy 234.075966 223.01226) (xy 234.020601 222.929399) (xy 233.93774 222.874034) (xy 233.937739 222.874033) - (xy 233.937735 222.874032) (xy 233.864677 222.8595) (xy 233.864674 222.8595) (xy 232.652274 222.8595) - (xy 232.585235 222.839815) (xy 232.53948 222.787011) (xy 232.529536 222.717853) (xy 232.558561 222.654297) - (xy 232.617339 222.616523) (xy 232.6226 222.615103) (xy 232.632365 222.612696) (xy 232.737279 222.557632) + (xy 236.83014 222.395185) (xy 236.850782 222.411819) (xy 239.569662 225.130699) (xy 239.603147 225.192022) + (xy 239.598163 225.261714) (xy 239.556291 225.317647) (xy 239.524004 225.332939) (xy 239.52465 225.334643) + (xy 239.517634 225.337303) (xy 239.377762 225.410715) (xy 239.259516 225.515471) (xy 239.169781 225.645475) + (xy 239.16978 225.645476) (xy 239.113763 225.793181) (xy 239.094722 225.95) (xy 239.100896 226.000854) + (xy 239.089435 226.069777) (xy 239.065481 226.10348) (xy 238.580782 226.588181) (xy 238.519459 226.621666) + (xy 238.493101 226.6245) (xy 232.146308 226.6245) (xy 232.079269 226.604815) (xy 232.044257 226.570938) + (xy 232.040483 226.56547) (xy 231.92224 226.460717) (xy 231.922238 226.460716) (xy 231.922237 226.460715) + (xy 231.782365 226.387303) (xy 231.628986 226.3495) (xy 231.628985 226.3495) (xy 231.471015 226.3495) + (xy 231.471014 226.3495) (xy 231.317634 226.387303) (xy 231.177762 226.460715) (xy 231.059516 226.565471) + (xy 230.969781 226.695475) (xy 230.96978 226.695476) (xy 230.913762 226.843181) (xy 230.894722 226.999999) + (xy 230.894722 227) (xy 230.913762 227.156818) (xy 230.958461 227.274678) (xy 230.96978 227.304523) + (xy 231.059517 227.43453) (xy 231.17776 227.539283) (xy 231.177762 227.539284) (xy 231.317634 227.612696) + (xy 231.471014 227.6505) (xy 231.471015 227.6505) (xy 231.628985 227.6505) (xy 231.782365 227.612696) + (xy 231.799505 227.6037) (xy 231.92224 227.539283) (xy 232.040483 227.43453) (xy 232.044257 227.429061) + (xy 232.098537 227.385071) (xy 232.146308 227.3755) (xy 238.749435 227.3755) (xy 238.749436 227.3755) + (xy 238.797186 227.362705) (xy 238.844938 227.34991) (xy 238.930562 227.300475) (xy 239.000475 227.230562) + (xy 239.594217 226.636818) (xy 239.65554 226.603334) (xy 239.681898 226.6005) (xy 239.828985 226.6005) + (xy 239.982365 226.562696) (xy 240.12224 226.489283) (xy 240.240483 226.38453) (xy 240.33022 226.254523) + (xy 240.362098 226.170465) (xy 240.404274 226.114765) (xy 240.469871 226.090707) (xy 240.538062 226.105933) + (xy 240.56572 226.126757) (xy 243.169525 228.730562) (xy 243.239438 228.800475) (xy 243.325062 228.84991) + (xy 243.337952 228.853364) (xy 243.350841 228.856818) (xy 243.350842 228.856818) (xy 243.365387 228.860715) + (xy 243.420564 228.8755) (xy 243.420565 228.8755) (xy 244.903692 228.8755) (xy 244.970731 228.895185) + (xy 245.005742 228.929061) (xy 245.009517 228.93453) (xy 245.12776 229.039283) (xy 245.127762 229.039284) + (xy 245.267634 229.112696) (xy 245.421014 229.1505) (xy 245.421015 229.1505) (xy 245.578985 229.1505) + (xy 245.730331 229.113197) (xy 245.800132 229.116266) (xy 245.857194 229.156586) (xy 245.8834 229.221355) + (xy 245.870428 229.29001) (xy 245.847686 229.321275) (xy 243.880782 231.288181) (xy 243.819459 231.321666) + (xy 243.793101 231.3245) (xy 225.431902 231.3245) (xy 225.364863 231.304815) (xy 225.319108 231.252011) + (xy 225.309164 231.182853) (xy 225.338189 231.119297) (xy 225.374276 231.090704) (xy 225.472245 231.039285) + (xy 225.472246 231.039283) (xy 225.472248 231.039283) (xy 225.590491 230.93453) (xy 225.680228 230.804523) + (xy 225.736245 230.656818) (xy 225.755286 230.5) (xy 225.74911 230.449144) (xy 225.760569 230.380224) + (xy 225.784522 230.346521) (xy 231.877821 224.253223) (xy 231.939142 224.21974) (xy 232.008834 224.224724) + (xy 232.064767 224.266596) (xy 232.089184 224.33206) (xy 232.0895 224.340906) (xy 232.0895 224.634678) + (xy 232.104032 224.707735) (xy 232.104033 224.707739) (xy 232.104034 224.70774) (xy 232.159399 224.790601) + (xy 232.24226 224.845966) (xy 232.242264 224.845967) (xy 232.315321 224.860499) (xy 232.315324 224.8605) + (xy 232.315326 224.8605) (xy 233.864676 224.8605) (xy 233.864677 224.860499) (xy 233.93774 224.845966) + (xy 234.020601 224.790601) (xy 234.075966 224.70774) (xy 234.0905 224.634674) (xy 234.0905 223.86) + (xy 234.584659 223.86) (xy 234.603975 224.056129) (xy 234.603976 224.056132) (xy 234.65814 224.234687) + (xy 234.661188 224.244733) (xy 234.754086 224.418532) (xy 234.75409 224.418539) (xy 234.879116 224.570883) + (xy 235.03146 224.695909) (xy 235.031467 224.695913) (xy 235.205266 224.788811) (xy 235.205269 224.788811) + (xy 235.205273 224.788814) (xy 235.393868 224.846024) (xy 235.59 224.865341) (xy 235.786132 224.846024) + (xy 235.974727 224.788814) (xy 236.027297 224.760715) (xy 236.061632 224.742362) (xy 236.148538 224.69591) + (xy 236.300883 224.570883) (xy 236.42591 224.418538) (xy 236.518814 224.244727) (xy 236.576024 224.056132) + (xy 236.595341 223.86) (xy 236.576024 223.663868) (xy 236.518814 223.475273) (xy 236.518811 223.475269) + (xy 236.518811 223.475266) (xy 236.425913 223.301467) (xy 236.425909 223.30146) (xy 236.300883 223.149116) + (xy 236.148539 223.02409) (xy 236.148532 223.024086) (xy 235.974733 222.931188) (xy 235.974727 222.931186) + (xy 235.786132 222.873976) (xy 235.786129 222.873975) (xy 235.59 222.854659) (xy 235.39387 222.873975) + (xy 235.205266 222.931188) (xy 235.031467 223.024086) (xy 235.03146 223.02409) (xy 234.879116 223.149116) + (xy 234.75409 223.30146) (xy 234.754086 223.301467) (xy 234.661188 223.475266) (xy 234.603975 223.66387) + (xy 234.584659 223.86) (xy 234.0905 223.86) (xy 234.0905 223.085326) (xy 234.0905 223.085323) (xy 234.090499 223.085321) + (xy 234.075967 223.012264) (xy 234.075966 223.01226) (xy 234.020601 222.929399) (xy 233.93774 222.874034) + (xy 233.937739 222.874033) (xy 233.937735 222.874032) (xy 233.864677 222.8595) (xy 233.864674 222.8595) + (xy 232.652274 222.8595) (xy 232.585235 222.839815) (xy 232.53948 222.787011) (xy 232.529536 222.717853) + (xy 232.558561 222.654297) (xy 232.617339 222.616523) (xy 232.6226 222.615103) (xy 232.632365 222.612696) (xy 232.77224 222.539283) (xy 232.890483 222.43453) (xy 232.894257 222.429061) (xy 232.948537 222.385071) - (xy 232.996308 222.3755) (xy 236.763101 222.3755) (xy 236.83014 222.395185) (xy 236.850782 222.411819) - (xy 239.569662 225.130699) (xy 239.603147 225.192022) (xy 239.598163 225.261714) (xy 239.556291 225.317647) - (xy 239.524004 225.332939) (xy 239.52465 225.334643) (xy 239.517634 225.337303) (xy 239.377762 225.410715) - (xy 239.259516 225.515471) (xy 239.169781 225.645475) (xy 239.16978 225.645476) (xy 239.113763 225.793181) - (xy 239.094722 225.95) (xy 239.100896 226.000854) (xy 239.089435 226.069777) (xy 239.065481 226.10348) - (xy 238.580782 226.588181) (xy 238.519459 226.621666) (xy 238.493101 226.6245) (xy 232.146308 226.6245) - (xy 232.079269 226.604815) (xy 232.044257 226.570938) (xy 232.040483 226.56547) (xy 231.92224 226.460717) - (xy 231.922238 226.460716) (xy 231.922237 226.460715) (xy 231.782365 226.387303) (xy 231.628986 226.3495) - (xy 231.628985 226.3495) (xy 231.471015 226.3495) (xy 231.471014 226.3495) (xy 231.317634 226.387303) - (xy 231.177762 226.460715) (xy 231.059516 226.565471) (xy 230.969781 226.695475) (xy 230.96978 226.695476) - (xy 230.913762 226.843181) (xy 230.894722 226.999999) (xy 230.894722 227) (xy 230.913762 227.156818) - (xy 230.958461 227.274678) (xy 230.96978 227.304523) (xy 231.059517 227.43453) (xy 231.17776 227.539283) - (xy 231.177762 227.539284) (xy 231.317634 227.612696) (xy 231.471014 227.6505) (xy 231.471015 227.6505) - (xy 231.628985 227.6505) (xy 231.782365 227.612696) (xy 231.799505 227.6037) (xy 231.92224 227.539283) - (xy 232.040483 227.43453) (xy 232.044257 227.429061) (xy 232.098537 227.385071) (xy 232.146308 227.3755) - (xy 238.749435 227.3755) (xy 238.749436 227.3755) (xy 238.797186 227.362705) (xy 238.844938 227.34991) - (xy 238.930562 227.300475) (xy 239.000475 227.230562) (xy 239.594217 226.636818) (xy 239.65554 226.603334) - (xy 239.681898 226.6005) (xy 239.828985 226.6005) (xy 239.982365 226.562696) (xy 240.12224 226.489283) - (xy 240.240483 226.38453) (xy 240.33022 226.254523) (xy 240.362098 226.170465) (xy 240.404274 226.114765) - (xy 240.469871 226.090707) (xy 240.538062 226.105933) (xy 240.56572 226.126757) (xy 243.169525 228.730562) - (xy 243.239438 228.800475) (xy 243.325062 228.84991) (xy 243.337952 228.853364) (xy 243.350841 228.856818) - (xy 243.350842 228.856818) (xy 243.365387 228.860715) (xy 243.420564 228.8755) (xy 243.420565 228.8755) - (xy 244.903692 228.8755) (xy 244.970731 228.895185) (xy 245.005742 228.929061) (xy 245.009517 228.93453) - (xy 245.12776 229.039283) (xy 245.127762 229.039284) (xy 245.267634 229.112696) (xy 245.421014 229.1505) - (xy 245.421015 229.1505) (xy 245.578985 229.1505) (xy 245.730331 229.113197) (xy 245.800132 229.116266) - (xy 245.857194 229.156586) (xy 245.8834 229.221355) (xy 245.870428 229.29001) (xy 245.847686 229.321275) - (xy 243.680782 231.488181) (xy 243.619459 231.521666) (xy 243.593101 231.5245) (xy 215.490135 231.5245) - (xy 215.423096 231.504815) (xy 215.377341 231.452011) (xy 215.367397 231.382853) (xy 215.396422 231.319297) - (xy 215.407908 231.307684) (xy 215.490483 231.23453) (xy 215.494257 231.229061) (xy 215.548537 231.185071) - (xy 215.596308 231.1755) (xy 220.949435 231.1755) (xy 220.949436 231.1755) (xy 220.997186 231.162705) - (xy 221.044938 231.14991) (xy 221.130562 231.100475) (xy 221.200475 231.030562) (xy 221.200474 231.030562) - (xy 221.259043 230.971993) (xy 221.259042 230.971993) (xy 231.344218 220.886819) (xy 231.405541 220.853334) - (xy 231.431899 220.8505) (xy 231.578985 220.8505) (xy 231.732365 220.812696) (xy 231.842874 220.754696) - (xy 231.911382 220.74097) + (xy 232.996308 222.3755) (xy 236.763101 222.3755) ) ) (filled_polygon @@ -175134,7 +179609,7 @@ (xy 207.004808 210.3705) (xy 207.004809 210.3705) (xy 207.245191 210.3705) (xy 207.245192 210.3705) (xy 207.482297 210.330934) (xy 207.709656 210.252882) (xy 207.921067 210.138472) (xy 207.976278 210.0955) (xy 208.003343 210.074434) (xy 208.110764 209.990825) (xy 208.273571 209.813969) (xy 208.405049 209.612728) - (xy 208.50161 209.392591) (xy 208.56062 209.159563) (xy 208.580471 208.92) (xy 208.575508 208.860112) + (xy 208.50161 209.392591) (xy 208.56062 209.159563) (xy 208.580471 208.92) (xy 208.568041 208.77) (xy 208.56062 208.68044) (xy 208.56062 208.680437) (xy 208.50161 208.447409) (xy 208.405049 208.227272) (xy 208.402417 208.223244) (xy 208.33931 208.126651) (xy 208.273571 208.026031) (xy 208.110764 207.849175) (xy 208.110759 207.849171) (xy 208.110757 207.849169) (xy 207.921075 207.701533) (xy 207.921069 207.701529) @@ -175143,7 +179618,7 @@ (xy 206.540347 207.587116) (xy 206.540342 207.587118) (xy 206.32893 207.701529) (xy 206.328924 207.701533) (xy 206.139242 207.849169) (xy 206.139239 207.849172) (xy 205.97643 208.026029) (xy 205.976427 208.026033) (xy 205.844951 208.22727) (xy 205.748389 208.44741) (xy 205.689379 208.68044) (xy 205.669529 208.919994) - (xy 205.180471 208.919994) (xy 205.175508 208.860112) (xy 205.16062 208.68044) (xy 205.16062 208.680437) + (xy 205.180471 208.919994) (xy 205.168041 208.77) (xy 205.16062 208.68044) (xy 205.16062 208.680437) (xy 205.10161 208.447409) (xy 205.005049 208.227272) (xy 205.002417 208.223244) (xy 204.93931 208.126651) (xy 204.873571 208.026031) (xy 204.710764 207.849175) (xy 204.710759 207.849171) (xy 204.710757 207.849169) (xy 204.521075 207.701533) (xy 204.521069 207.701529) (xy 204.309657 207.587118) (xy 204.309652 207.587116) @@ -175184,7 +179659,7 @@ (pts (xy 202.221805 170.115017) (xy 202.259995 170.141032) (xy 234.788181 202.669218) (xy 234.821666 202.730541) (xy 234.8245 202.756899) (xy 234.8245 219.249437) (xy 234.834571 219.287024) (xy 234.850089 219.344936) - (xy 234.850089 219.344937) (xy 234.85009 219.344938) (xy 234.890816 219.415477) (xy 234.899523 219.430559) + (xy 234.850089 219.344937) (xy 234.85997 219.36205) (xy 234.890816 219.415477) (xy 234.899523 219.430559) (xy 234.899528 219.430565) (xy 236.881782 221.412819) (xy 236.915267 221.474142) (xy 236.910283 221.543834) (xy 236.868411 221.599767) (xy 236.802947 221.624184) (xy 236.794101 221.6245) (xy 232.996308 221.6245) (xy 232.929269 221.604815) (xy 232.894257 221.570938) (xy 232.890483 221.56547) (xy 232.890481 221.565467) @@ -175201,8 +179676,8 @@ (xy 233.067147 219.11899) (xy 233.107123 219.13193) (xy 233.127635 219.142696) (xy 233.127637 219.142696) (xy 233.127638 219.142697) (xy 233.281014 219.1805) (xy 233.281015 219.1805) (xy 233.438985 219.1805) (xy 233.592365 219.142696) (xy 233.618586 219.128934) (xy 233.73224 219.069283) (xy 233.850483 218.96453) - (xy 233.94022 218.834523) (xy 233.996237 218.686818) (xy 234.015278 218.53) (xy 234.01392 218.518811) - (xy 233.996237 218.373181) (xy 233.968818 218.300883) (xy 233.94022 218.225477) (xy 233.850483 218.09547) + (xy 233.94022 218.834523) (xy 233.996237 218.686818) (xy 234.015278 218.53) (xy 234.001589 218.417255) + (xy 233.996237 218.373181) (xy 233.974992 218.317164) (xy 233.94022 218.225477) (xy 233.850483 218.09547) (xy 233.850481 218.095468) (xy 233.777273 218.030611) (xy 233.740146 217.971422) (xy 233.7355 217.937796) (xy 233.7355 212.550567) (xy 233.7355 212.550565) (xy 233.70991 212.455062) (xy 233.660475 212.369438) (xy 233.590562 212.299525) (xy 227.540563 206.249526) (xy 227.540562 206.249525) (xy 227.454938 206.20009) @@ -175235,26 +179710,6 @@ (xy 231.447989 214.443105) (xy 231.517147 214.433161) ) ) - (filled_polygon - (layer "B.Cu") - (pts - (xy 165.733713 187.345185) (xy 165.779468 187.397989) (xy 165.789412 187.467147) (xy 165.782617 187.493467) - (xy 165.776139 187.510549) (xy 165.763762 187.543182) (xy 165.744722 187.699999) (xy 165.744722 187.7) - (xy 165.763762 187.856817) (xy 165.778424 187.895476) (xy 165.816442 187.995723) (xy 165.8245 188.039691) - (xy 165.8245 209.715228) (xy 165.804815 209.782267) (xy 165.752011 209.828022) (xy 165.682853 209.837966) - (xy 165.619297 209.808941) (xy 165.59845 209.785668) (xy 165.515484 209.665472) (xy 165.515483 209.66547) - (xy 165.515479 209.665466) (xy 165.510509 209.659856) (xy 165.511953 209.658576) (xy 165.480145 209.60786) - (xy 165.4755 209.57424) (xy 165.4755 198.350567) (xy 165.4755 198.350565) (xy 165.44991 198.255062) - (xy 165.400475 198.169438) (xy 165.330562 198.099525) (xy 161.630563 194.399526) (xy 161.630562 194.399525) - (xy 161.544938 194.35009) (xy 161.497186 194.337295) (xy 161.497184 194.337294) (xy 161.497182 194.337293) - (xy 161.449436 194.3245) (xy 161.449435 194.3245) (xy 159.617482 194.3245) (xy 159.550443 194.304815) - (xy 159.529801 194.288181) (xy 156.241819 191.000199) (xy 156.208334 190.938876) (xy 156.2055 190.912518) - (xy 156.2055 189.102202) (xy 156.225185 189.035163) (xy 156.247274 189.009386) (xy 156.320482 188.944531) - (xy 156.320483 188.94453) (xy 156.41022 188.814523) (xy 156.466237 188.666818) (xy 156.485278 188.51) - (xy 156.479102 188.459144) (xy 156.490561 188.390224) (xy 156.514514 188.356521) (xy 157.509218 187.361819) - (xy 157.570541 187.328334) (xy 157.596899 187.3255) (xy 165.666674 187.3255) - ) - ) (filled_polygon (layer "B.Cu") (pts @@ -175277,7 +179732,7 @@ (xy 130.233692 191.2055) (xy 130.300731 191.225185) (xy 130.335742 191.259061) (xy 130.338163 191.262569) (xy 130.339515 191.264528) (xy 130.339517 191.26453) (xy 130.45776 191.369283) (xy 130.457762 191.369284) (xy 130.597634 191.442696) (xy 130.751014 191.4805) (xy 130.751015 191.4805) (xy 130.908985 191.4805) - (xy 131.062365 191.442696) (xy 131.078911 191.434012) (xy 131.20224 191.369283) (xy 131.320483 191.26453) + (xy 131.062365 191.442696) (xy 131.081971 191.432406) (xy 131.20224 191.369283) (xy 131.320483 191.26453) (xy 131.41022 191.134523) (xy 131.466237 190.986818) (xy 131.485278 190.83) (xy 131.473197 190.730499) (xy 131.466237 190.673181) (xy 131.444992 190.617164) (xy 131.41022 190.525477) (xy 131.320483 190.39547) (xy 131.20224 190.290717) (xy 131.202238 190.290716) (xy 131.202237 190.290715) (xy 131.062365 190.217303) @@ -175287,6 +179742,52 @@ (xy 133.399718 186.936319) (xy 133.461041 186.902834) (xy 133.487399 186.9) (xy 138.576 186.9) ) ) + (filled_polygon + (layer "B.Cu") + (pts + (xy 165.628997 186.677328) (xy 165.674752 186.730132) (xy 165.684696 186.79929) (xy 165.655671 186.862846) + (xy 165.649639 186.869324) (xy 164.799526 187.719436) (xy 164.750091 187.805059) (xy 164.750091 187.80506) + (xy 164.75009 187.805062) (xy 164.7245 187.900565) (xy 164.7245 187.900567) (xy 164.7245 197.9005) + (xy 164.704815 197.967539) (xy 164.652011 198.013294) (xy 164.6005 198.0245) (xy 162.7119 198.0245) + (xy 162.644861 198.004815) (xy 162.624219 197.988181) (xy 159.558173 194.922135) (xy 156.489516 191.853479) + (xy 156.456032 191.792157) (xy 156.454102 191.750857) (xy 156.460278 191.7) (xy 156.441237 191.543182) + (xy 156.38522 191.395477) (xy 156.295483 191.26547) (xy 156.17724 191.160717) (xy 156.177238 191.160716) + (xy 156.177237 191.160715) (xy 156.037365 191.087303) (xy 155.883986 191.0495) (xy 155.883985 191.0495) + (xy 155.726015 191.0495) (xy 155.726014 191.0495) (xy 155.572634 191.087303) (xy 155.432762 191.160715) + (xy 155.314516 191.265471) (xy 155.224781 191.395474) (xy 155.210775 191.432406) (xy 155.168596 191.488108) + (xy 155.102999 191.512165) (xy 155.034808 191.496938) (xy 155.007152 191.476115) (xy 154.741819 191.210782) + (xy 154.708334 191.149459) (xy 154.7055 191.123101) (xy 154.7055 190.738068) (xy 154.725185 190.671029) + (xy 154.771046 190.62871) (xy 154.888538 190.56591) (xy 155.040883 190.440883) (xy 155.16591 190.288538) + (xy 155.258814 190.114727) (xy 155.316024 189.926132) (xy 155.335341 189.73) (xy 155.316024 189.533868) + (xy 155.258814 189.345273) (xy 155.258811 189.345269) (xy 155.258811 189.345266) (xy 155.165913 189.171467) + (xy 155.165909 189.17146) (xy 155.040883 189.019116) (xy 154.888539 188.89409) (xy 154.888532 188.894086) + (xy 154.714733 188.801188) (xy 154.714727 188.801186) (xy 154.526132 188.743976) (xy 154.526129 188.743975) + (xy 154.33 188.724659) (xy 154.13387 188.743975) (xy 153.945266 188.801188) (xy 153.771467 188.894086) + (xy 153.77146 188.89409) (xy 153.619116 189.019116) (xy 153.49409 189.17146) (xy 153.494086 189.171467) + (xy 153.401188 189.345266) (xy 153.343975 189.53387) (xy 153.324659 189.73) (xy 153.343975 189.926129) + (xy 153.343976 189.926132) (xy 153.400126 190.111234) (xy 153.401188 190.114733) (xy 153.494086 190.288532) + (xy 153.49409 190.288539) (xy 153.619116 190.440883) (xy 153.77146 190.565909) (xy 153.771463 190.565911) + (xy 153.793585 190.577735) (xy 153.888953 190.62871) (xy 153.938797 190.677671) (xy 153.9545 190.738068) + (xy 153.9545 191.379435) (xy 153.98009 191.474938) (xy 153.980091 191.474939) (xy 153.980091 191.47494) + (xy 153.983301 191.4805) (xy 154.001825 191.512585) (xy 154.002354 191.5135) (xy 154.018827 191.5814) + (xy 153.995975 191.647427) (xy 153.941054 191.690617) (xy 153.894967 191.6995) (xy 152.317255 191.6995) + (xy 152.250216 191.679815) (xy 152.229574 191.663181) (xy 151.508574 190.942181) (xy 151.475089 190.880858) + (xy 151.480073 190.811166) (xy 151.521945 190.755233) (xy 151.587409 190.730816) (xy 151.596255 190.7305) + (xy 152.604676 190.7305) (xy 152.604677 190.730499) (xy 152.67774 190.715966) (xy 152.760601 190.660601) + (xy 152.815966 190.57774) (xy 152.8305 190.504674) (xy 152.8305 188.955326) (xy 152.8305 188.955323) + (xy 152.830499 188.955321) (xy 152.815967 188.882264) (xy 152.815966 188.88226) (xy 152.774155 188.819685) + (xy 152.760601 188.799399) (xy 152.67774 188.744034) (xy 152.677739 188.744033) (xy 152.677735 188.744032) + (xy 152.604677 188.7295) (xy 152.604674 188.7295) (xy 151.055326 188.7295) (xy 151.055323 188.7295) + (xy 150.982264 188.744032) (xy 150.98226 188.744033) (xy 150.899399 188.799399) (xy 150.844033 188.88226) + (xy 150.844032 188.882264) (xy 150.8295 188.955321) (xy 150.8295 189.963745) (xy 150.809815 190.030784) + (xy 150.757011 190.076539) (xy 150.687853 190.086483) (xy 150.624297 190.057458) (xy 150.617819 190.051426) + (xy 149.736819 189.170426) (xy 149.703334 189.109103) (xy 149.7005 189.082745) (xy 149.7005 187.036565) + (xy 149.720185 186.969526) (xy 149.772989 186.923771) (xy 149.842147 186.913827) (xy 149.854156 186.916164) + (xy 149.921015 186.932643) (xy 149.921017 186.932643) (xy 150.078985 186.932643) (xy 150.232365 186.894839) + (xy 150.280979 186.869324) (xy 150.37224 186.821426) (xy 150.490483 186.716673) (xy 150.494257 186.711204) + (xy 150.548537 186.667214) (xy 150.596308 186.657643) (xy 165.561958 186.657643) + ) + ) (filled_polygon (layer "B.Cu") (pts @@ -175811,7 +180312,7 @@ (xy 265.214513 115.570185) (xy 265.260268 115.622989) (xy 265.27105 115.68474) (xy 265.269786 115.699994) (xy 265.269786 115.700006) (xy 265.288608 115.927168) (xy 265.28861 115.927179) (xy 265.344569 116.148155) (xy 265.436137 116.356908) (xy 265.560814 116.547742) (xy 265.583308 116.572177) (xy 265.70054 116.699525) - (xy 265.715208 116.715458) (xy 265.715212 116.715461) (xy 265.82383 116.800002) (xy 265.895094 116.855469) + (xy 265.715208 116.715458) (xy 265.715212 116.715461) (xy 265.870301 116.836172) (xy 265.895094 116.855469) (xy 265.895096 116.85547) (xy 265.895099 116.855472) (xy 265.969669 116.895827) (xy 266.095574 116.963963) (xy 266.18652 116.995185) (xy 266.311173 117.037979) (xy 266.311175 117.037979) (xy 266.311177 117.03798) (xy 266.536023 117.0755) (xy 266.536024 117.0755) (xy 266.763975 117.0755) (xy 266.763977 117.0755) @@ -175838,7 +180339,7 @@ (xy 267.584797 123.684547) (xy 267.584787 123.684538) (xy 267.404909 123.544533) (xy 267.4049 123.544527) (xy 267.204432 123.43604) (xy 267.204429 123.436039) (xy 267.204426 123.436037) (xy 267.20442 123.436035) (xy 267.204418 123.436034) (xy 266.988826 123.36202) (xy 266.820188 123.33388) (xy 266.763977 123.3245) - (xy 266.536023 123.3245) (xy 266.499695 123.330562) (xy 266.311173 123.36202) (xy 266.095581 123.436034) + (xy 266.536023 123.3245) (xy 266.491053 123.332004) (xy 266.311173 123.36202) (xy 266.095581 123.436034) (xy 266.095567 123.43604) (xy 265.895099 123.544527) (xy 265.89509 123.544533) (xy 265.715212 123.684538) (xy 265.715208 123.684541) (xy 265.560816 123.852255) (xy 265.514016 123.923888) (xy 265.460869 123.969244) (xy 265.434406 123.977681) (xy 265.431093 123.97834) (xy 265.431084 123.978342) (xy 265.294511 124.034912) @@ -175969,61 +180470,62 @@ (xy 260.811173 121.86202) (xy 260.595581 121.936034) (xy 260.595567 121.93604) (xy 260.395099 122.044527) (xy 260.39509 122.044533) (xy 260.215212 122.184538) (xy 260.215207 122.184543) (xy 260.175779 122.227372) (xy 260.115892 122.263361) (xy 260.046053 122.26126) (xy 259.988438 122.221734) (xy 259.961338 122.157334) - (xy 259.964346 122.112946) (xy 259.988021 122.019459) (xy 260.01139 121.927176) (xy 260.012077 121.918885) - (xy 260.030214 121.700006) (xy 260.030214 121.699993) (xy 265.269786 121.699993) (xy 265.269786 121.700006) - (xy 265.288608 121.927168) (xy 265.28861 121.927179) (xy 265.344569 122.148155) (xy 265.436137 122.356908) - (xy 265.560814 122.547742) (xy 265.715208 122.715458) (xy 265.715212 122.715461) (xy 265.893697 122.854382) - (xy 265.895094 122.855469) (xy 265.895096 122.85547) (xy 265.895099 122.855472) (xy 265.976504 122.899526) - (xy 266.095574 122.963963) (xy 266.207529 123.002397) (xy 266.311173 123.037979) (xy 266.311175 123.037979) - (xy 266.311177 123.03798) (xy 266.536023 123.0755) (xy 266.536024 123.0755) (xy 266.763976 123.0755) - (xy 266.763977 123.0755) (xy 266.988823 123.03798) (xy 267.204426 122.963963) (xy 267.404906 122.855469) - (xy 267.584794 122.715456) (xy 267.739183 122.547745) (xy 267.863862 122.356909) (xy 267.95543 122.148155) - (xy 268.01139 121.927176) (xy 268.012077 121.918885) (xy 268.030214 121.700006) (xy 268.030214 121.699993) - (xy 268.011391 121.472831) (xy 268.011389 121.47282) (xy 267.95543 121.251844) (xy 267.863862 121.043091) - (xy 267.739185 120.852257) (xy 267.651334 120.756826) (xy 267.584794 120.684544) (xy 267.584793 120.684543) - (xy 267.584791 120.684541) (xy 267.584787 120.684538) (xy 267.404909 120.544533) (xy 267.4049 120.544527) - (xy 267.204432 120.43604) (xy 267.204429 120.436039) (xy 267.204426 120.436037) (xy 267.20442 120.436035) - (xy 267.204418 120.436034) (xy 266.988826 120.36202) (xy 266.820188 120.33388) (xy 266.763977 120.3245) - (xy 266.536023 120.3245) (xy 266.491053 120.332004) (xy 266.311173 120.36202) (xy 266.095581 120.436034) - (xy 266.095567 120.43604) (xy 265.895099 120.544527) (xy 265.89509 120.544533) (xy 265.715212 120.684538) - (xy 265.715208 120.684541) (xy 265.560814 120.852257) (xy 265.436137 121.043091) (xy 265.344569 121.251844) - (xy 265.28861 121.47282) (xy 265.288608 121.472831) (xy 265.269786 121.699993) (xy 260.030214 121.699993) - (xy 260.011391 121.472831) (xy 260.011387 121.472811) (xy 259.964346 121.287053) (xy 259.96697 121.217233) - (xy 260.006926 121.159915) (xy 260.071527 121.133298) (xy 260.140263 121.145832) (xy 260.17578 121.172628) - (xy 260.215206 121.215456) (xy 260.395094 121.355469) (xy 260.395096 121.35547) (xy 260.395099 121.355472) - (xy 260.414367 121.365899) (xy 260.595574 121.463963) (xy 260.707529 121.502397) (xy 260.811173 121.537979) - (xy 260.811175 121.537979) (xy 260.811177 121.53798) (xy 261.036023 121.5755) (xy 261.036024 121.5755) - (xy 261.263976 121.5755) (xy 261.263977 121.5755) (xy 261.488823 121.53798) (xy 261.704426 121.463963) - (xy 261.904906 121.355469) (xy 262.084794 121.215456) (xy 262.239183 121.047745) (xy 262.363862 120.856909) - (xy 262.45543 120.648155) (xy 262.51139 120.427176) (xy 262.519898 120.3245) (xy 262.530214 120.200006) - (xy 262.530214 120.199993) (xy 262.511391 119.972831) (xy 262.511389 119.97282) (xy 262.45543 119.751844) - (xy 262.363862 119.543091) (xy 262.239185 119.352257) (xy 262.084791 119.184541) (xy 262.084787 119.184538) - (xy 261.904909 119.044533) (xy 261.9049 119.044527) (xy 261.704432 118.93604) (xy 261.704429 118.936039) - (xy 261.704426 118.936037) (xy 261.70442 118.936035) (xy 261.704418 118.936034) (xy 261.488826 118.86202) - (xy 261.320188 118.83388) (xy 261.263977 118.8245) (xy 261.036023 118.8245) (xy 260.991053 118.832004) - (xy 260.811173 118.86202) (xy 260.595581 118.936034) (xy 260.595567 118.93604) (xy 260.395099 119.044527) - (xy 260.39509 119.044533) (xy 260.215212 119.184538) (xy 260.215207 119.184543) (xy 260.175779 119.227372) - (xy 260.115892 119.263361) (xy 260.046053 119.26126) (xy 259.988438 119.221734) (xy 259.961338 119.157334) - (xy 259.964346 119.112946) (xy 260.011387 118.927188) (xy 260.011389 118.927179) (xy 260.01139 118.927176) - (xy 260.01543 118.878421) (xy 260.030214 118.700006) (xy 260.030214 118.699993) (xy 260.011391 118.472831) - (xy 260.011387 118.472811) (xy 259.964346 118.287053) (xy 259.96697 118.217233) (xy 260.006926 118.159915) - (xy 260.071527 118.133298) (xy 260.140263 118.145832) (xy 260.17578 118.172628) (xy 260.215206 118.215456) - (xy 260.215209 118.215458) (xy 260.215212 118.215461) (xy 260.363696 118.331031) (xy 260.395094 118.355469) - (xy 260.395096 118.35547) (xy 260.395099 118.355472) (xy 260.423401 118.370788) (xy 260.595574 118.463963) - (xy 260.707529 118.502397) (xy 260.811173 118.537979) (xy 260.811175 118.537979) (xy 260.811177 118.53798) - (xy 261.036023 118.5755) (xy 261.036024 118.5755) (xy 261.263976 118.5755) (xy 261.263977 118.5755) - (xy 261.488823 118.53798) (xy 261.704426 118.463963) (xy 261.904906 118.355469) (xy 262.084794 118.215456) - (xy 262.239183 118.047745) (xy 262.363862 117.856909) (xy 262.45543 117.648155) (xy 262.51139 117.427176) - (xy 262.516789 117.36202) (xy 262.530214 117.200006) (xy 262.530214 117.199993) (xy 262.511391 116.972831) - (xy 262.511389 116.97282) (xy 262.45543 116.751844) (xy 262.363862 116.543091) (xy 262.239185 116.352257) + (xy 259.964346 122.112946) (xy 260.011387 121.927188) (xy 260.011389 121.927179) (xy 260.01139 121.927176) + (xy 260.012077 121.918885) (xy 260.030214 121.700006) (xy 260.030214 121.699993) (xy 265.269786 121.699993) + (xy 265.269786 121.700006) (xy 265.288608 121.927168) (xy 265.28861 121.927179) (xy 265.344569 122.148155) + (xy 265.436137 122.356908) (xy 265.560814 122.547742) (xy 265.715208 122.715458) (xy 265.715212 122.715461) + (xy 265.893697 122.854382) (xy 265.895094 122.855469) (xy 265.895096 122.85547) (xy 265.895099 122.855472) + (xy 265.976504 122.899526) (xy 266.095574 122.963963) (xy 266.207529 123.002397) (xy 266.311173 123.037979) + (xy 266.311175 123.037979) (xy 266.311177 123.03798) (xy 266.536023 123.0755) (xy 266.536024 123.0755) + (xy 266.763976 123.0755) (xy 266.763977 123.0755) (xy 266.988823 123.03798) (xy 267.204426 122.963963) + (xy 267.404906 122.855469) (xy 267.584794 122.715456) (xy 267.739183 122.547745) (xy 267.863862 122.356909) + (xy 267.95543 122.148155) (xy 268.01139 121.927176) (xy 268.012077 121.918885) (xy 268.030214 121.700006) + (xy 268.030214 121.699993) (xy 268.011391 121.472831) (xy 268.011389 121.47282) (xy 267.95543 121.251844) + (xy 267.863862 121.043091) (xy 267.739185 120.852257) (xy 267.651334 120.756826) (xy 267.584794 120.684544) + (xy 267.584793 120.684543) (xy 267.584791 120.684541) (xy 267.584787 120.684538) (xy 267.404909 120.544533) + (xy 267.4049 120.544527) (xy 267.204432 120.43604) (xy 267.204429 120.436039) (xy 267.204426 120.436037) + (xy 267.20442 120.436035) (xy 267.204418 120.436034) (xy 266.988826 120.36202) (xy 266.820188 120.33388) + (xy 266.763977 120.3245) (xy 266.536023 120.3245) (xy 266.491053 120.332004) (xy 266.311173 120.36202) + (xy 266.095581 120.436034) (xy 266.095567 120.43604) (xy 265.895099 120.544527) (xy 265.89509 120.544533) + (xy 265.715212 120.684538) (xy 265.715208 120.684541) (xy 265.560814 120.852257) (xy 265.436137 121.043091) + (xy 265.344569 121.251844) (xy 265.28861 121.47282) (xy 265.288608 121.472831) (xy 265.269786 121.699993) + (xy 260.030214 121.699993) (xy 260.011391 121.472831) (xy 260.011387 121.472811) (xy 259.964346 121.287053) + (xy 259.96697 121.217233) (xy 260.006926 121.159915) (xy 260.071527 121.133298) (xy 260.140263 121.145832) + (xy 260.17578 121.172628) (xy 260.215206 121.215456) (xy 260.395094 121.355469) (xy 260.395096 121.35547) + (xy 260.395099 121.355472) (xy 260.414367 121.365899) (xy 260.595574 121.463963) (xy 260.707529 121.502397) + (xy 260.811173 121.537979) (xy 260.811175 121.537979) (xy 260.811177 121.53798) (xy 261.036023 121.5755) + (xy 261.036024 121.5755) (xy 261.263976 121.5755) (xy 261.263977 121.5755) (xy 261.488823 121.53798) + (xy 261.704426 121.463963) (xy 261.904906 121.355469) (xy 262.084794 121.215456) (xy 262.239183 121.047745) + (xy 262.363862 120.856909) (xy 262.45543 120.648155) (xy 262.51139 120.427176) (xy 262.519898 120.3245) + (xy 262.530214 120.200006) (xy 262.530214 120.199993) (xy 262.511391 119.972831) (xy 262.511389 119.97282) + (xy 262.45543 119.751844) (xy 262.363862 119.543091) (xy 262.239185 119.352257) (xy 262.084791 119.184541) + (xy 262.084787 119.184538) (xy 261.904909 119.044533) (xy 261.9049 119.044527) (xy 261.704432 118.93604) + (xy 261.704429 118.936039) (xy 261.704426 118.936037) (xy 261.70442 118.936035) (xy 261.704418 118.936034) + (xy 261.488826 118.86202) (xy 261.320188 118.83388) (xy 261.263977 118.8245) (xy 261.036023 118.8245) + (xy 260.991053 118.832004) (xy 260.811173 118.86202) (xy 260.595581 118.936034) (xy 260.595567 118.93604) + (xy 260.395099 119.044527) (xy 260.39509 119.044533) (xy 260.215212 119.184538) (xy 260.215207 119.184543) + (xy 260.175779 119.227372) (xy 260.115892 119.263361) (xy 260.046053 119.26126) (xy 259.988438 119.221734) + (xy 259.961338 119.157334) (xy 259.964346 119.112946) (xy 260.011387 118.927188) (xy 260.011389 118.927179) + (xy 260.01139 118.927176) (xy 260.01543 118.878421) (xy 260.030214 118.700006) (xy 260.030214 118.699993) + (xy 260.011391 118.472831) (xy 260.011387 118.472811) (xy 259.964346 118.287053) (xy 259.96697 118.217233) + (xy 260.006926 118.159915) (xy 260.071527 118.133298) (xy 260.140263 118.145832) (xy 260.17578 118.172628) + (xy 260.215206 118.215456) (xy 260.215209 118.215458) (xy 260.215212 118.215461) (xy 260.363696 118.331031) + (xy 260.395094 118.355469) (xy 260.395096 118.35547) (xy 260.395099 118.355472) (xy 260.423401 118.370788) + (xy 260.595574 118.463963) (xy 260.707529 118.502397) (xy 260.811173 118.537979) (xy 260.811175 118.537979) + (xy 260.811177 118.53798) (xy 261.036023 118.5755) (xy 261.036024 118.5755) (xy 261.263976 118.5755) + (xy 261.263977 118.5755) (xy 261.488823 118.53798) (xy 261.704426 118.463963) (xy 261.904906 118.355469) + (xy 262.084794 118.215456) (xy 262.239183 118.047745) (xy 262.363862 117.856909) (xy 262.45543 117.648155) + (xy 262.51139 117.427176) (xy 262.511566 117.425056) (xy 262.530214 117.200006) (xy 262.530214 117.199993) + (xy 262.511391 116.972831) (xy 262.511389 116.97282) (xy 262.45543 116.751844) (xy 262.363862 116.543091) + (xy 262.239185 116.352257) (xy 262.121285 116.224184) (xy 262.084794 116.184544) (xy 262.084793 116.184543) (xy 262.084791 116.184541) (xy 262.084787 116.184538) (xy 261.904909 116.044533) (xy 261.9049 116.044527) (xy 261.704432 115.93604) (xy 261.704429 115.936039) (xy 261.704426 115.936037) (xy 261.70442 115.936035) (xy 261.704418 115.936034) (xy 261.488826 115.86202) (xy 261.320188 115.83388) (xy 261.263977 115.8245) (xy 261.036023 115.8245) (xy 260.991053 115.832004) (xy 260.811173 115.86202) (xy 260.595581 115.936034) (xy 260.595567 115.93604) (xy 260.395099 116.044527) (xy 260.39509 116.044533) (xy 260.215212 116.184538) (xy 260.215207 116.184543) (xy 260.175779 116.227372) (xy 260.115892 116.263361) (xy 260.046053 116.26126) - (xy 259.988438 116.221734) (xy 259.961338 116.157334) (xy 259.964346 116.112946) (xy 259.976599 116.064563) - (xy 260.01139 115.927176) (xy 260.011759 115.922722) (xy 260.030214 115.700006) (xy 260.030214 115.699994) + (xy 259.988438 116.221734) (xy 259.961338 116.157334) (xy 259.964346 116.112946) (xy 259.974195 116.074056) + (xy 260.01139 115.927176) (xy 260.011391 115.927168) (xy 260.030214 115.700006) (xy 260.030214 115.699994) (xy 260.02895 115.68474) (xy 260.043031 115.616304) (xy 260.091876 115.566345) (xy 260.152526 115.5505) (xy 265.147474 115.5505) ) @@ -176365,17 +180867,17 @@ (xy 253.744781 199.902801) (xy 253.74478 199.902802) (xy 253.688762 200.050507) (xy 253.669722 200.207325) (xy 253.669722 200.207326) (xy 253.688762 200.364144) (xy 253.74478 200.511849) (xy 253.744781 200.51185) (xy 253.834517 200.641857) (xy 253.907726 200.706712) (xy 253.944853 200.7659) (xy 253.9495 200.799528) - (xy 253.9495 203.007599) (xy 253.962277 203.055286) (xy 253.962291 203.055336) (xy 253.962295 203.055349) - (xy 253.97509 203.103101) (xy 254.015053 203.172319) (xy 254.015054 203.172321) (xy 254.015053 203.172321) - (xy 254.024527 203.188727) (xy 254.0779 203.2421) (xy 254.111386 203.303423) (xy 254.11422 203.329782) - (xy 254.11422 203.783821) (xy 254.094535 203.85086) (xy 254.041731 203.896615) (xy 253.972573 203.906559) - (xy 253.909017 203.877534) (xy 253.902539 203.871502) (xy 253.411819 203.380782) (xy 253.378334 203.319459) - (xy 253.3755 203.293101) (xy 253.3755 197.86904) (xy 253.395185 197.802001) (xy 253.447989 197.756246) - (xy 253.517147 197.746302) (xy 253.580703 197.775327) (xy 253.581602 197.776115) (xy 253.603456 197.795475) - (xy 253.607756 197.799285) (xy 253.747628 197.872696) (xy 253.901008 197.9105) (xy 253.901009 197.9105) - (xy 254.058979 197.9105) (xy 254.212359 197.872696) (xy 254.352232 197.799284) (xy 254.352231 197.799284) - (xy 254.352234 197.799283) (xy 254.377054 197.777295) (xy 254.394676 197.761684) (xy 254.457909 197.731963) - (xy 254.476902 197.7305) (xy 257.723694 197.7305) + (xy 253.9495 202.908727) (xy 253.9495 203.007599) (xy 253.955474 203.029895) (xy 253.962012 203.054297) + (xy 253.97509 203.103103) (xy 253.975091 203.103104) (xy 254.01505 203.172315) (xy 254.024527 203.188727) + (xy 254.0779 203.2421) (xy 254.111386 203.303423) (xy 254.11422 203.329782) (xy 254.11422 203.783821) + (xy 254.094535 203.85086) (xy 254.041731 203.896615) (xy 253.972573 203.906559) (xy 253.909017 203.877534) + (xy 253.902539 203.871502) (xy 253.411819 203.380782) (xy 253.378334 203.319459) (xy 253.3755 203.293101) + (xy 253.3755 197.86904) (xy 253.395185 197.802001) (xy 253.447989 197.756246) (xy 253.517147 197.746302) + (xy 253.580703 197.775327) (xy 253.581602 197.776115) (xy 253.603456 197.795475) (xy 253.607756 197.799285) + (xy 253.747628 197.872696) (xy 253.901008 197.9105) (xy 253.901009 197.9105) (xy 254.058979 197.9105) + (xy 254.212359 197.872696) (xy 254.352232 197.799284) (xy 254.352231 197.799284) (xy 254.352234 197.799283) + (xy 254.377054 197.777295) (xy 254.394676 197.761684) (xy 254.457909 197.731963) (xy 254.476902 197.7305) + (xy 257.723694 197.7305) ) ) (filled_polygon @@ -176398,7 +180900,7 @@ (xy 113.07408 233.424394) (xy 112.894163 233.28971) (xy 112.880792 233.278124) (xy 112.721875 233.119207) (xy 112.710289 233.105836) (xy 112.575605 232.925919) (xy 112.56604 232.911036) (xy 112.45833 232.713782) (xy 112.450983 232.697694) (xy 112.372437 232.487103) (xy 112.367458 232.470144) (xy 112.319683 232.250529) - (xy 112.317165 232.233017) (xy 112.314837 232.200472) (xy 112.300816 232.004418) (xy 112.3005 231.995572) + (xy 112.317165 232.233017) (xy 112.303309 232.039283) (xy 112.300816 232.004418) (xy 112.3005 231.995572) (xy 112.3005 226.210186) (xy 117.1745 226.210186) (xy 117.1745 226.479813) (xy 117.204686 226.747719) (xy 117.204688 226.747731) (xy 117.264684 227.010594) (xy 117.264687 227.010602) (xy 117.353734 227.265082) (xy 117.470714 227.507994) (xy 117.470716 227.507997) (xy 117.614162 227.736289) (xy 117.782266 227.947085) @@ -176410,7 +180912,7 @@ (xy 120.737997 228.449284) (xy 120.966289 228.305838) (xy 121.177085 228.137734) (xy 121.367734 227.947085) (xy 121.535838 227.736289) (xy 121.679284 227.507997) (xy 121.796267 227.265079) (xy 121.885316 227.010591) (xy 121.945312 226.747732) (xy 121.9755 226.479809) (xy 121.9755 226.210191) (xy 121.945312 225.942268) - (xy 121.885316 225.679409) (xy 121.873254 225.644939) (xy 121.839835 225.549432) (xy 121.796267 225.424921) + (xy 121.885316 225.679409) (xy 121.873254 225.644939) (xy 121.832019 225.527094) (xy 121.796267 225.424921) (xy 121.679284 225.182003) (xy 121.535838 224.953711) (xy 121.367734 224.742915) (xy 121.177085 224.552266) (xy 121.168569 224.545475) (xy 121.055566 224.455358) (xy 120.966289 224.384162) (xy 120.74439 224.244733) (xy 120.737994 224.240714) (xy 120.495082 224.123734) (xy 120.240602 224.034687) (xy 120.240594 224.034684) @@ -176424,7 +180926,7 @@ (xy 137.0735 222.908941) (xy 137.095019 223.072383) (xy 137.103452 223.136438) (xy 137.145405 223.293011) (xy 137.162842 223.358087) (xy 137.25065 223.570076) (xy 137.250657 223.57009) (xy 137.365392 223.768817) (xy 137.505081 223.950861) (xy 137.505089 223.95087) (xy 137.66733 224.113111) (xy 137.667338 224.113118) - (xy 137.667339 224.113119) (xy 137.708235 224.1445) (xy 137.849382 224.252807) (xy 137.849385 224.252808) + (xy 137.667339 224.113119) (xy 137.681173 224.123734) (xy 137.849382 224.252807) (xy 137.849385 224.252808) (xy 137.849388 224.252811) (xy 138.048112 224.367544) (xy 138.048117 224.367546) (xy 138.048123 224.367549) (xy 138.13948 224.40539) (xy 138.260113 224.455358) (xy 138.481762 224.514748) (xy 138.709266 224.5447) (xy 138.709273 224.5447) (xy 138.938727 224.5447) (xy 138.938734 224.5447) (xy 139.166238 224.514748) @@ -176441,282 +180943,684 @@ (xy 138.048109 221.220857) (xy 137.849382 221.335592) (xy 137.667338 221.475281) (xy 137.505081 221.637538) (xy 137.365392 221.819582) (xy 137.250657 222.018309) (xy 137.25065 222.018323) (xy 137.162842 222.230312) (xy 137.16023 222.24006) (xy 137.126968 222.3642) (xy 137.103453 222.451959) (xy 137.103451 222.45197) - (xy 137.0735 222.679458) (xy 112.3005 222.679458) (xy 112.3005 216.815321) (xy 113.9595 216.815321) - (xy 113.9595 218.364678) (xy 113.974032 218.437735) (xy 113.974033 218.437739) (xy 113.974034 218.43774) - (xy 114.029399 218.520601) (xy 114.11226 218.575966) (xy 114.112264 218.575967) (xy 114.185321 218.590499) - (xy 114.185324 218.5905) (xy 114.185326 218.5905) (xy 115.734676 218.5905) (xy 115.734677 218.590499) - (xy 115.80774 218.575966) (xy 115.890601 218.520601) (xy 115.945966 218.43774) (xy 115.9605 218.364674) - (xy 115.9605 217.59) (xy 116.454659 217.59) (xy 116.473975 217.786129) (xy 116.473976 217.786132) - (xy 116.530183 217.971422) (xy 116.531188 217.974733) (xy 116.624086 218.148532) (xy 116.62409 218.148539) - (xy 116.749116 218.300883) (xy 116.90146 218.425909) (xy 116.901467 218.425913) (xy 117.075266 218.518811) - (xy 117.075269 218.518811) (xy 117.075273 218.518814) (xy 117.263868 218.576024) (xy 117.46 218.595341) - (xy 117.656132 218.576024) (xy 117.844727 218.518814) (xy 118.018538 218.42591) (xy 118.170883 218.300883) - (xy 118.29591 218.148538) (xy 118.358943 218.030611) (xy 118.388811 217.974733) (xy 118.388811 217.974732) - (xy 118.388814 217.974727) (xy 118.446024 217.786132) (xy 118.455539 217.689521) (xy 139.3135 217.689521) + (xy 137.0735 222.679458) (xy 112.3005 222.679458) (xy 112.3005 217.689521) (xy 139.3135 217.689521) (xy 139.3135 219.258878) (xy 139.328032 219.331935) (xy 139.328033 219.331939) (xy 139.336718 219.344937) (xy 139.383399 219.414801) (xy 139.45989 219.46591) (xy 139.46626 219.470166) (xy 139.466264 219.470167) (xy 139.539321 219.484699) (xy 139.539324 219.4847) (xy 139.539326 219.4847) (xy 140.575324 219.4847) (xy 140.642363 219.504385) (xy 140.663005 219.521019) (xy 142.463181 221.321195) (xy 142.496666 221.382518) (xy 142.4995 221.408876) (xy 142.4995 229.465891) (xy 142.533608 229.593187) (xy 142.560222 229.639283) - (xy 142.5995 229.707314) (xy 144.892686 232.0005) (xy 145.006814 232.066392) (xy 145.134108 232.1005) - (xy 145.13411 232.1005) (xy 185.26589 232.1005) (xy 185.265892 232.1005) (xy 185.393186 232.066392) - (xy 185.507314 232.0005) (xy 189.0005 228.507314) (xy 189.066392 228.393186) (xy 189.1005 228.265893) + (xy 142.5995 229.707314) (xy 144.292686 231.4005) (xy 144.406814 231.466392) (xy 144.534108 231.5005) + (xy 144.53411 231.5005) (xy 185.86589 231.5005) (xy 185.865892 231.5005) (xy 185.993186 231.466392) + (xy 186.107314 231.4005) (xy 189.0005 228.507314) (xy 189.066392 228.393186) (xy 189.1005 228.265892) (xy 189.1005 228.134108) (xy 189.1005 219.158657) (xy 189.120185 219.091618) (xy 189.12245 219.088217) (xy 189.135369 219.0695) (xy 189.18022 219.004523) (xy 189.236237 218.856818) (xy 189.255278 218.7) - (xy 189.253767 218.687551) (xy 189.236237 218.543181) (xy 189.196248 218.43774) (xy 189.18022 218.395477) + (xy 189.253767 218.687551) (xy 189.236237 218.543181) (xy 189.188479 218.417255) (xy 189.18022 218.395477) (xy 189.090483 218.26547) (xy 188.97224 218.160717) (xy 188.972238 218.160716) (xy 188.972237 218.160715) (xy 188.832365 218.087303) (xy 188.678986 218.0495) (xy 188.678985 218.0495) (xy 188.521015 218.0495) (xy 188.521014 218.0495) (xy 188.367634 218.087303) (xy 188.227762 218.160715) (xy 188.109516 218.265471) (xy 188.019781 218.395475) (xy 188.01978 218.395476) (xy 187.963762 218.543181) (xy 187.944722 218.699999) (xy 187.944722 218.7) (xy 187.963762 218.856818) (xy 188.01978 219.004523) (xy 188.01978 219.004524) (xy 188.07755 219.088217) (xy 188.099433 219.154571) (xy 188.0995 219.158657) (xy 188.0995 227.941324) - (xy 188.079815 228.008363) (xy 188.063181 228.029005) (xy 185.029005 231.063181) (xy 184.967682 231.096666) - (xy 184.941324 231.0995) (xy 145.458676 231.0995) (xy 145.391637 231.079815) (xy 145.370995 231.063181) - (xy 144.407813 230.099999) (xy 158.944722 230.099999) (xy 158.944722 230.1) (xy 158.963762 230.256818) - (xy 159.013582 230.388181) (xy 159.01978 230.404523) (xy 159.109517 230.53453) (xy 159.22776 230.639283) - (xy 159.227762 230.639284) (xy 159.367634 230.712696) (xy 159.521014 230.7505) (xy 159.521015 230.7505) - (xy 159.678985 230.7505) (xy 159.832365 230.712696) (xy 159.97224 230.639283) (xy 160.090483 230.53453) - (xy 160.094257 230.529061) (xy 160.148537 230.485071) (xy 160.196308 230.4755) (xy 176.449435 230.4755) - (xy 176.449436 230.4755) (xy 176.497186 230.462705) (xy 176.544938 230.44991) (xy 176.630562 230.400475) - (xy 176.700475 230.330562) (xy 177.400474 229.630563) (xy 178.300474 228.730563) (xy 178.300475 228.730562) - (xy 178.34991 228.644938) (xy 178.3755 228.549435) (xy 178.3755 228.286592) (xy 185.413701 228.286592) - (xy 185.413701 228.436407) (xy 185.442924 228.583322) (xy 185.442926 228.58333) (xy 185.500252 228.721729) - (xy 185.500257 228.721738) (xy 185.583481 228.84629) (xy 185.583484 228.846294) (xy 185.689406 228.952216) - (xy 185.68941 228.952219) (xy 185.813962 229.035443) (xy 185.813971 229.035448) (xy 185.82323 229.039283) - (xy 185.952371 229.092775) (xy 186.070471 229.116266) (xy 186.099293 229.121999) (xy 186.099297 229.122) - (xy 186.099298 229.122) (xy 186.249105 229.122) (xy 186.249106 229.121999) (xy 186.396031 229.092775) - (xy 186.534433 229.035447) (xy 186.658992 228.952219) (xy 186.76492 228.846291) (xy 186.848148 228.721732) - (xy 186.905476 228.58333) (xy 186.934701 228.436403) (xy 186.934701 228.286597) (xy 186.905476 228.13967) - (xy 186.849267 228.00397) (xy 186.848149 228.00127) (xy 186.848144 228.001261) (xy 186.76492 227.876709) - (xy 186.764917 227.876705) (xy 186.658995 227.770783) (xy 186.658991 227.77078) (xy 186.534439 227.687556) - (xy 186.53443 227.687551) (xy 186.396031 227.630225) (xy 186.396023 227.630223) (xy 186.249108 227.601) - (xy 186.249104 227.601) (xy 186.099298 227.601) (xy 186.099293 227.601) (xy 185.952378 227.630223) - (xy 185.95237 227.630225) (xy 185.813971 227.687551) (xy 185.813962 227.687556) (xy 185.68941 227.77078) - (xy 185.689406 227.770783) (xy 185.583484 227.876705) (xy 185.583481 227.876709) (xy 185.500257 228.001261) - (xy 185.500252 228.00127) (xy 185.442926 228.139669) (xy 185.442924 228.139677) (xy 185.413701 228.286592) - (xy 178.3755 228.286592) (xy 178.3755 224.813636) (xy 181.233701 224.813636) (xy 181.233701 225.909363) - (xy 181.233702 225.909382) (xy 181.240109 225.968981) (xy 181.290403 226.103827) (xy 181.290404 226.103828) - (xy 181.290405 226.10383) (xy 181.376655 226.219046) (xy 181.491871 226.305296) (xy 181.491872 226.305296) - (xy 181.491873 226.305297) (xy 181.626719 226.355591) (xy 181.626718 226.355591) (xy 181.633646 226.356335) - (xy 181.686329 226.362) (xy 181.686338 226.362) (xy 182.782064 226.362) (xy 182.782073 226.362) - (xy 182.841683 226.355591) (xy 182.976531 226.305296) (xy 183.091747 226.219046) (xy 183.177997 226.10383) - (xy 183.228292 225.968982) (xy 183.234701 225.909372) (xy 183.234701 224.813628) (xy 183.228292 224.754018) - (xy 183.212204 224.710883) (xy 183.177998 224.619172) (xy 183.177997 224.619171) (xy 183.177997 224.61917) - (xy 183.091747 224.503954) (xy 182.976531 224.417704) (xy 182.976529 224.417703) (xy 182.976528 224.417702) - (xy 182.841682 224.367408) (xy 182.841683 224.367408) (xy 182.782083 224.361001) (xy 182.782081 224.361) - (xy 182.782073 224.361) (xy 181.686329 224.361) (xy 181.686321 224.361) (xy 181.686318 224.361001) - (xy 181.626719 224.367408) (xy 181.491873 224.417702) (xy 181.491871 224.417704) (xy 181.376655 224.503954) - (xy 181.290405 224.61917) (xy 181.290403 224.619172) (xy 181.240109 224.754018) (xy 181.233702 224.813617) - (xy 181.233701 224.813636) (xy 178.3755 224.813636) (xy 178.3755 222.3615) (xy 181.22886 222.3615) - (xy 181.248176 222.557629) (xy 181.305389 222.746233) (xy 181.398287 222.920032) (xy 181.398291 222.920039) - (xy 181.523317 223.072383) (xy 181.675661 223.197409) (xy 181.675668 223.197413) (xy 181.849467 223.290311) - (xy 181.84947 223.290311) (xy 181.849474 223.290314) (xy 182.038069 223.347524) (xy 182.234201 223.366841) - (xy 182.430333 223.347524) (xy 182.618928 223.290314) (xy 182.621168 223.289117) (xy 182.787682 223.200113) - (xy 182.792739 223.19741) (xy 182.945084 223.072383) (xy 183.070111 222.920038) (xy 183.116563 222.833132) - (xy 183.163012 222.746233) (xy 183.163012 222.746232) (xy 183.163015 222.746227) (xy 183.220225 222.557632) - (xy 183.239542 222.3615) (xy 183.220225 222.165368) (xy 183.163015 221.976773) (xy 183.163012 221.976769) - (xy 183.163012 221.976766) (xy 183.070114 221.802967) (xy 183.07011 221.80296) (xy 182.945084 221.650616) - (xy 182.79274 221.52559) (xy 182.792733 221.525586) (xy 182.618934 221.432688) (xy 182.618928 221.432686) - (xy 182.430333 221.375476) (xy 182.43033 221.375475) (xy 182.234201 221.356159) (xy 182.038071 221.375475) - (xy 181.849467 221.432688) (xy 181.675668 221.525586) (xy 181.675661 221.52559) (xy 181.523317 221.650616) - (xy 181.398291 221.80296) (xy 181.398287 221.802967) (xy 181.305389 221.976766) (xy 181.248176 222.16537) - (xy 181.22886 222.3615) (xy 178.3755 222.3615) (xy 178.3755 219.286592) (xy 185.413701 219.286592) - (xy 185.413701 219.436407) (xy 185.442924 219.583322) (xy 185.442926 219.58333) (xy 185.500252 219.721729) - (xy 185.500257 219.721738) (xy 185.583481 219.84629) (xy 185.583484 219.846294) (xy 185.689406 219.952216) - (xy 185.68941 219.952219) (xy 185.813962 220.035443) (xy 185.813971 220.035448) (xy 185.832643 220.043182) - (xy 185.952371 220.092775) (xy 186.099293 220.121999) (xy 186.099297 220.122) (xy 186.099298 220.122) - (xy 186.249105 220.122) (xy 186.249106 220.121999) (xy 186.396031 220.092775) (xy 186.534433 220.035447) - (xy 186.658992 219.952219) (xy 186.76492 219.846291) (xy 186.848148 219.721732) (xy 186.905476 219.58333) - (xy 186.934701 219.436403) (xy 186.934701 219.286597) (xy 186.905476 219.13967) (xy 186.849267 219.00397) - (xy 186.848149 219.00127) (xy 186.848144 219.001261) (xy 186.76492 218.876709) (xy 186.764917 218.876705) - (xy 186.658995 218.770783) (xy 186.658991 218.77078) (xy 186.534439 218.687556) (xy 186.53443 218.687551) - (xy 186.396031 218.630225) (xy 186.396023 218.630223) (xy 186.249108 218.601) (xy 186.249104 218.601) - (xy 186.099298 218.601) (xy 186.099293 218.601) (xy 185.952378 218.630223) (xy 185.95237 218.630225) - (xy 185.813971 218.687551) (xy 185.813962 218.687556) (xy 185.68941 218.77078) (xy 185.689406 218.770783) - (xy 185.583484 218.876705) (xy 185.583481 218.876709) (xy 185.500257 219.001261) (xy 185.500252 219.00127) - (xy 185.442926 219.139669) (xy 185.442924 219.139677) (xy 185.413701 219.286592) (xy 178.3755 219.286592) - (xy 178.3755 210.450565) (xy 178.3755 210.406899) (xy 178.395185 210.33986) (xy 178.411819 210.319218) - (xy 186.444218 202.286819) (xy 186.505541 202.253334) (xy 186.531899 202.2505) (xy 186.678985 202.2505) - (xy 186.832365 202.212696) (xy 186.97224 202.139283) (xy 187.090483 202.03453) (xy 187.18022 201.904523) - (xy 187.236237 201.756818) (xy 187.255278 201.6) (xy 187.246752 201.529777) (xy 187.236237 201.443181) - (xy 187.181935 201.3) (xy 187.18022 201.295477) (xy 187.090483 201.16547) (xy 186.97224 201.060717) - (xy 186.972238 201.060716) (xy 186.972237 201.060715) (xy 186.832365 200.987303) (xy 186.678986 200.9495) - (xy 186.678985 200.9495) (xy 186.521015 200.9495) (xy 186.521014 200.9495) (xy 186.367634 200.987303) - (xy 186.227762 201.060715) (xy 186.109516 201.165471) (xy 186.019781 201.295475) (xy 186.01978 201.295476) - (xy 185.963762 201.443181) (xy 185.944722 201.599999) (xy 185.944722 201.6) (xy 185.950896 201.650853) - (xy 185.939435 201.719776) (xy 185.915481 201.753479) (xy 177.769438 209.899525) (xy 177.699526 209.969436) - (xy 177.650091 210.055059) (xy 177.650088 210.055066) (xy 177.644898 210.074434) (xy 177.644899 210.074435) - (xy 177.624816 210.149387) (xy 177.624803 210.149436) (xy 177.6245 210.150564) (xy 177.6245 228.293101) - (xy 177.604815 228.36014) (xy 177.588181 228.380782) (xy 176.280782 229.688181) (xy 176.219459 229.721666) - (xy 176.193101 229.7245) (xy 160.196308 229.7245) (xy 160.129269 229.704815) (xy 160.094257 229.670938) - (xy 160.090483 229.66547) (xy 159.97224 229.560717) (xy 159.972238 229.560716) (xy 159.972237 229.560715) - (xy 159.832365 229.487303) (xy 159.678986 229.4495) (xy 159.678985 229.4495) (xy 159.521015 229.4495) - (xy 159.521014 229.4495) (xy 159.367634 229.487303) (xy 159.227762 229.560715) (xy 159.109516 229.665471) - (xy 159.019781 229.795475) (xy 159.01978 229.795476) (xy 158.963762 229.943181) (xy 158.944722 230.099999) - (xy 144.407813 230.099999) (xy 143.536819 229.229005) (xy 143.503334 229.167682) (xy 143.5005 229.141324) - (xy 143.5005 221.08431) (xy 143.5005 221.084308) (xy 143.466392 220.957014) (xy 143.4005 220.842886) - (xy 143.307314 220.7497) (xy 141.370819 218.813205) (xy 141.337334 218.751882) (xy 141.3345 218.725524) - (xy 141.3345 217.689523) (xy 141.334499 217.689521) (xy 141.319967 217.616464) (xy 141.319966 217.61646) - (xy 141.302286 217.59) (xy 141.264601 217.533599) (xy 141.18174 217.478234) (xy 141.181739 217.478233) - (xy 141.181735 217.478232) (xy 141.108677 217.4637) (xy 141.108674 217.4637) (xy 139.539326 217.4637) - (xy 139.539323 217.4637) (xy 139.466264 217.478232) (xy 139.46626 217.478233) (xy 139.383399 217.533599) - (xy 139.328033 217.61646) (xy 139.328032 217.616464) (xy 139.3135 217.689521) (xy 118.455539 217.689521) - (xy 118.465341 217.59) (xy 118.446024 217.393868) (xy 118.388814 217.205273) (xy 118.388811 217.205269) - (xy 118.388811 217.205266) (xy 118.295913 217.031467) (xy 118.295909 217.03146) (xy 118.170883 216.879116) - (xy 118.018539 216.75409) (xy 118.018532 216.754086) (xy 117.844733 216.661188) (xy 117.844727 216.661186) - (xy 117.656132 216.603976) (xy 117.656129 216.603975) (xy 117.46 216.584659) (xy 117.26387 216.603975) - (xy 117.075266 216.661188) (xy 116.901467 216.754086) (xy 116.90146 216.75409) (xy 116.749116 216.879116) - (xy 116.62409 217.03146) (xy 116.624086 217.031467) (xy 116.531188 217.205266) (xy 116.473975 217.39387) - (xy 116.454659 217.59) (xy 115.9605 217.59) (xy 115.9605 216.815326) (xy 115.9605 216.815323) (xy 115.960499 216.815321) - (xy 115.945967 216.742264) (xy 115.945966 216.74226) (xy 115.890601 216.659399) (xy 115.80774 216.604034) - (xy 115.807739 216.604033) (xy 115.807735 216.604032) (xy 115.734677 216.5895) (xy 115.734674 216.5895) - (xy 114.185326 216.5895) (xy 114.185323 216.5895) (xy 114.112264 216.604032) (xy 114.11226 216.604033) - (xy 114.029399 216.659399) (xy 113.974033 216.74226) (xy 113.974032 216.742264) (xy 113.9595 216.815321) - (xy 112.3005 216.815321) (xy 112.3005 215.4742) (xy 136.308611 215.4742) (xy 136.328121 215.672295) - (xy 136.385903 215.862774) (xy 136.479731 216.038314) (xy 136.479735 216.038321) (xy 136.606011 216.192188) - (xy 136.759878 216.318464) (xy 136.759885 216.318468) (xy 136.848611 216.365893) (xy 136.935427 216.412297) - (xy 137.125907 216.470079) (xy 137.324 216.489589) (xy 137.522093 216.470079) (xy 137.712573 216.412297) - (xy 137.88812 216.318465) (xy 138.041988 216.192188) (xy 138.168265 216.03832) (xy 138.262097 215.862773) + (xy 188.079815 228.008363) (xy 188.063181 228.029005) (xy 185.629005 230.463181) (xy 185.567682 230.496666) + (xy 185.541324 230.4995) (xy 176.830899 230.4995) (xy 176.76386 230.479815) (xy 176.718105 230.427011) + (xy 176.708161 230.357853) (xy 176.737186 230.294297) (xy 176.743218 230.287819) (xy 177.496509 229.534528) + (xy 178.300474 228.730563) (xy 178.300475 228.730562) (xy 178.34991 228.644938) (xy 178.3755 228.549435) + (xy 178.3755 228.286592) (xy 185.413701 228.286592) (xy 185.413701 228.436407) (xy 185.442924 228.583322) + (xy 185.442926 228.58333) (xy 185.500252 228.721729) (xy 185.500257 228.721738) (xy 185.583481 228.84629) + (xy 185.583484 228.846294) (xy 185.689406 228.952216) (xy 185.68941 228.952219) (xy 185.813962 229.035443) + (xy 185.813971 229.035448) (xy 185.82323 229.039283) (xy 185.952371 229.092775) (xy 186.070471 229.116266) + (xy 186.099293 229.121999) (xy 186.099297 229.122) (xy 186.099298 229.122) (xy 186.249105 229.122) + (xy 186.249106 229.121999) (xy 186.396031 229.092775) (xy 186.534433 229.035447) (xy 186.658992 228.952219) + (xy 186.76492 228.846291) (xy 186.848148 228.721732) (xy 186.905476 228.58333) (xy 186.934701 228.436403) + (xy 186.934701 228.286597) (xy 186.905476 228.13967) (xy 186.849267 228.00397) (xy 186.848149 228.00127) + (xy 186.848144 228.001261) (xy 186.76492 227.876709) (xy 186.764917 227.876705) (xy 186.658995 227.770783) + (xy 186.658991 227.77078) (xy 186.534439 227.687556) (xy 186.53443 227.687551) (xy 186.396031 227.630225) + (xy 186.396023 227.630223) (xy 186.249108 227.601) (xy 186.249104 227.601) (xy 186.099298 227.601) + (xy 186.099293 227.601) (xy 185.952378 227.630223) (xy 185.95237 227.630225) (xy 185.813971 227.687551) + (xy 185.813962 227.687556) (xy 185.68941 227.77078) (xy 185.689406 227.770783) (xy 185.583484 227.876705) + (xy 185.583481 227.876709) (xy 185.500257 228.001261) (xy 185.500252 228.00127) (xy 185.442926 228.139669) + (xy 185.442924 228.139677) (xy 185.413701 228.286592) (xy 178.3755 228.286592) (xy 178.3755 224.813636) + (xy 181.233701 224.813636) (xy 181.233701 225.909363) (xy 181.233702 225.909382) (xy 181.240109 225.968981) + (xy 181.290403 226.103827) (xy 181.290404 226.103828) (xy 181.290405 226.10383) (xy 181.376655 226.219046) + (xy 181.491871 226.305296) (xy 181.491872 226.305296) (xy 181.491873 226.305297) (xy 181.626719 226.355591) + (xy 181.626718 226.355591) (xy 181.633646 226.356335) (xy 181.686329 226.362) (xy 181.686338 226.362) + (xy 182.782064 226.362) (xy 182.782073 226.362) (xy 182.841683 226.355591) (xy 182.976531 226.305296) + (xy 183.091747 226.219046) (xy 183.177997 226.10383) (xy 183.228292 225.968982) (xy 183.234701 225.909372) + (xy 183.234701 224.813628) (xy 183.228292 224.754018) (xy 183.212204 224.710883) (xy 183.177998 224.619172) + (xy 183.177997 224.619171) (xy 183.177997 224.61917) (xy 183.091747 224.503954) (xy 182.976531 224.417704) + (xy 182.976529 224.417703) (xy 182.976528 224.417702) (xy 182.841682 224.367408) (xy 182.841683 224.367408) + (xy 182.782083 224.361001) (xy 182.782081 224.361) (xy 182.782073 224.361) (xy 181.686329 224.361) + (xy 181.686321 224.361) (xy 181.686318 224.361001) (xy 181.626719 224.367408) (xy 181.491873 224.417702) + (xy 181.491871 224.417704) (xy 181.376655 224.503954) (xy 181.290405 224.61917) (xy 181.290403 224.619172) + (xy 181.240109 224.754018) (xy 181.233702 224.813617) (xy 181.233701 224.813636) (xy 178.3755 224.813636) + (xy 178.3755 222.3615) (xy 181.22886 222.3615) (xy 181.248176 222.557629) (xy 181.305389 222.746233) + (xy 181.398287 222.920032) (xy 181.398291 222.920039) (xy 181.523317 223.072383) (xy 181.675661 223.197409) + (xy 181.675668 223.197413) (xy 181.849467 223.290311) (xy 181.84947 223.290311) (xy 181.849474 223.290314) + (xy 182.038069 223.347524) (xy 182.234201 223.366841) (xy 182.430333 223.347524) (xy 182.618928 223.290314) + (xy 182.621168 223.289117) (xy 182.787682 223.200113) (xy 182.792739 223.19741) (xy 182.945084 223.072383) + (xy 183.070111 222.920038) (xy 183.116563 222.833132) (xy 183.163012 222.746233) (xy 183.163012 222.746232) + (xy 183.163015 222.746227) (xy 183.220225 222.557632) (xy 183.239542 222.3615) (xy 183.220225 222.165368) + (xy 183.163015 221.976773) (xy 183.163012 221.976769) (xy 183.163012 221.976766) (xy 183.070114 221.802967) + (xy 183.07011 221.80296) (xy 182.945084 221.650616) (xy 182.79274 221.52559) (xy 182.792733 221.525586) + (xy 182.618934 221.432688) (xy 182.618928 221.432686) (xy 182.430333 221.375476) (xy 182.43033 221.375475) + (xy 182.234201 221.356159) (xy 182.038071 221.375475) (xy 181.849467 221.432688) (xy 181.675668 221.525586) + (xy 181.675661 221.52559) (xy 181.523317 221.650616) (xy 181.398291 221.80296) (xy 181.398287 221.802967) + (xy 181.305389 221.976766) (xy 181.248176 222.16537) (xy 181.22886 222.3615) (xy 178.3755 222.3615) + (xy 178.3755 219.286592) (xy 185.413701 219.286592) (xy 185.413701 219.436407) (xy 185.442924 219.583322) + (xy 185.442926 219.58333) (xy 185.500252 219.721729) (xy 185.500257 219.721738) (xy 185.583481 219.84629) + (xy 185.583484 219.846294) (xy 185.689406 219.952216) (xy 185.68941 219.952219) (xy 185.813962 220.035443) + (xy 185.813971 220.035448) (xy 185.832643 220.043182) (xy 185.952371 220.092775) (xy 186.099293 220.121999) + (xy 186.099297 220.122) (xy 186.099298 220.122) (xy 186.249105 220.122) (xy 186.249106 220.121999) + (xy 186.396031 220.092775) (xy 186.534433 220.035447) (xy 186.658992 219.952219) (xy 186.76492 219.846291) + (xy 186.848148 219.721732) (xy 186.905476 219.58333) (xy 186.934701 219.436403) (xy 186.934701 219.286597) + (xy 186.905476 219.13967) (xy 186.848148 219.001268) (xy 186.848147 219.001267) (xy 186.848144 219.001261) + (xy 186.76492 218.876709) (xy 186.764917 218.876705) (xy 186.658995 218.770783) (xy 186.658991 218.77078) + (xy 186.534439 218.687556) (xy 186.53443 218.687551) (xy 186.396031 218.630225) (xy 186.396023 218.630223) + (xy 186.249108 218.601) (xy 186.249104 218.601) (xy 186.099298 218.601) (xy 186.099293 218.601) + (xy 185.952378 218.630223) (xy 185.95237 218.630225) (xy 185.813971 218.687551) (xy 185.813962 218.687556) + (xy 185.68941 218.77078) (xy 185.689406 218.770783) (xy 185.583484 218.876705) (xy 185.583481 218.876709) + (xy 185.500257 219.001261) (xy 185.500252 219.00127) (xy 185.442926 219.139669) (xy 185.442924 219.139677) + (xy 185.413701 219.286592) (xy 178.3755 219.286592) (xy 178.3755 210.450565) (xy 178.3755 210.406899) + (xy 178.395185 210.33986) (xy 178.411819 210.319218) (xy 186.444218 202.286819) (xy 186.505541 202.253334) + (xy 186.531899 202.2505) (xy 186.678985 202.2505) (xy 186.832365 202.212696) (xy 186.97224 202.139283) + (xy 187.090483 202.03453) (xy 187.18022 201.904523) (xy 187.236237 201.756818) (xy 187.255278 201.6) + (xy 187.246752 201.529777) (xy 187.236237 201.443181) (xy 187.181935 201.3) (xy 187.18022 201.295477) + (xy 187.090483 201.16547) (xy 186.97224 201.060717) (xy 186.972238 201.060716) (xy 186.972237 201.060715) + (xy 186.832365 200.987303) (xy 186.678986 200.9495) (xy 186.678985 200.9495) (xy 186.521015 200.9495) + (xy 186.521014 200.9495) (xy 186.367634 200.987303) (xy 186.227762 201.060715) (xy 186.109516 201.165471) + (xy 186.019781 201.295475) (xy 186.01978 201.295476) (xy 185.963762 201.443181) (xy 185.944722 201.599999) + (xy 185.944722 201.6) (xy 185.950896 201.650853) (xy 185.939435 201.719776) (xy 185.915481 201.753479) + (xy 177.769438 209.899525) (xy 177.699526 209.969436) (xy 177.650091 210.055059) (xy 177.650088 210.055066) + (xy 177.644898 210.074434) (xy 177.644899 210.074435) (xy 177.624816 210.149387) (xy 177.624803 210.149436) + (xy 177.6245 210.150564) (xy 177.6245 228.293101) (xy 177.604815 228.36014) (xy 177.588181 228.380782) + (xy 176.280782 229.688181) (xy 176.219459 229.721666) (xy 176.193101 229.7245) (xy 160.196308 229.7245) + (xy 160.129269 229.704815) (xy 160.094257 229.670938) (xy 160.090483 229.66547) (xy 159.97224 229.560717) + (xy 159.972238 229.560716) (xy 159.972237 229.560715) (xy 159.832365 229.487303) (xy 159.678986 229.4495) + (xy 159.678985 229.4495) (xy 159.521015 229.4495) (xy 159.521014 229.4495) (xy 159.367634 229.487303) + (xy 159.227762 229.560715) (xy 159.109516 229.665471) (xy 159.019781 229.795475) (xy 159.01978 229.795476) + (xy 158.963762 229.943181) (xy 158.944722 230.099999) (xy 158.944722 230.1) (xy 158.963763 230.256818) + (xy 158.992097 230.331529) (xy 158.997464 230.401192) (xy 158.964317 230.462698) (xy 158.903178 230.49652) + (xy 158.876155 230.4995) (xy 144.858676 230.4995) (xy 144.791637 230.479815) (xy 144.770995 230.463181) + (xy 143.536819 229.229005) (xy 143.503334 229.167682) (xy 143.5005 229.141324) (xy 143.5005 221.08431) + (xy 143.5005 221.084308) (xy 143.466392 220.957014) (xy 143.4005 220.842886) (xy 143.307314 220.7497) + (xy 141.370819 218.813205) (xy 141.337334 218.751882) (xy 141.3345 218.725524) (xy 141.3345 217.689523) + (xy 141.334499 217.689521) (xy 141.319967 217.616464) (xy 141.319966 217.61646) (xy 141.264601 217.533599) + (xy 141.18174 217.478234) (xy 141.181739 217.478233) (xy 141.181735 217.478232) (xy 141.108677 217.4637) + (xy 141.108674 217.4637) (xy 139.539326 217.4637) (xy 139.539323 217.4637) (xy 139.466264 217.478232) + (xy 139.46626 217.478233) (xy 139.383399 217.533599) (xy 139.328033 217.61646) (xy 139.328032 217.616464) + (xy 139.3135 217.689521) (xy 112.3005 217.689521) (xy 112.3005 215.4742) (xy 136.308611 215.4742) + (xy 136.328121 215.672295) (xy 136.385903 215.862774) (xy 136.479731 216.038314) (xy 136.479735 216.038321) + (xy 136.606011 216.192188) (xy 136.759878 216.318464) (xy 136.759885 216.318468) (xy 136.935425 216.412296) + (xy 136.935427 216.412297) (xy 137.125907 216.470079) (xy 137.324 216.489589) (xy 137.522093 216.470079) + (xy 137.712573 216.412297) (xy 137.88812 216.318465) (xy 138.013801 216.215321) (xy 146.189501 216.215321) + (xy 146.189501 217.764678) (xy 146.204033 217.837735) (xy 146.204034 217.837739) (xy 146.204035 217.83774) + (xy 146.2594 217.920601) (xy 146.33546 217.971422) (xy 146.342261 217.975966) (xy 146.342265 217.975967) + (xy 146.415322 217.990499) (xy 146.415325 217.9905) (xy 146.415327 217.9905) (xy 147.964677 217.9905) + (xy 147.964678 217.990499) (xy 148.037741 217.975966) (xy 148.120602 217.920601) (xy 148.175967 217.83774) + (xy 148.190501 217.764674) (xy 148.190501 216.215326) (xy 148.190501 216.215323) (xy 148.1905 216.215321) + (xy 148.175968 216.142264) (xy 148.175967 216.14226) (xy 148.120602 216.059399) (xy 148.037741 216.004034) + (xy 148.03774 216.004033) (xy 148.037736 216.004032) (xy 147.964678 215.9895) (xy 147.964675 215.9895) + (xy 146.415327 215.9895) (xy 146.415324 215.9895) (xy 146.342265 216.004032) (xy 146.342261 216.004033) + (xy 146.2594 216.059399) (xy 146.204034 216.14226) (xy 146.204033 216.142264) (xy 146.189501 216.215321) + (xy 138.013801 216.215321) (xy 138.041988 216.192188) (xy 138.168265 216.03832) (xy 138.262097 215.862773) (xy 138.319879 215.672293) (xy 138.339389 215.4742) (xy 138.319879 215.276107) (xy 138.262097 215.085627) (xy 138.262096 215.085625) (xy 138.168268 214.910085) (xy 138.168264 214.910078) (xy 138.041988 214.756211) - (xy 137.888121 214.629935) (xy 137.888114 214.629931) (xy 137.712574 214.536103) (xy 137.522095 214.478321) + (xy 137.888121 214.629935) (xy 137.888114 214.629931) (xy 137.712574 214.536103) (xy 137.560595 214.49) + (xy 146.18466 214.49) (xy 146.203976 214.686129) (xy 146.203977 214.686132) (xy 146.253857 214.850565) + (xy 146.261189 214.874733) (xy 146.354087 215.048532) (xy 146.354091 215.048539) (xy 146.479117 215.200883) + (xy 146.631461 215.325909) (xy 146.631468 215.325913) (xy 146.805267 215.418811) (xy 146.80527 215.418811) + (xy 146.805274 215.418814) (xy 146.993869 215.476024) (xy 147.190001 215.495341) (xy 147.386133 215.476024) + (xy 147.574728 215.418814) (xy 147.748539 215.32591) (xy 147.900884 215.200883) (xy 148.025911 215.048538) + (xy 148.099916 214.910085) (xy 148.118812 214.874733) (xy 148.118812 214.874732) (xy 148.118815 214.874727) + (xy 148.176025 214.686132) (xy 148.195342 214.49) (xy 148.176025 214.293868) (xy 148.118815 214.105273) + (xy 148.118812 214.105269) (xy 148.118812 214.105266) (xy 148.025914 213.931467) (xy 148.02591 213.93146) + (xy 147.900884 213.779116) (xy 147.74854 213.65409) (xy 147.748533 213.654086) (xy 147.574734 213.561188) + (xy 147.574728 213.561186) (xy 147.386133 213.503976) (xy 147.38613 213.503975) (xy 147.190001 213.484659) + (xy 146.993871 213.503975) (xy 146.805267 213.561188) (xy 146.631468 213.654086) (xy 146.631461 213.65409) + (xy 146.479117 213.779116) (xy 146.354091 213.93146) (xy 146.354087 213.931467) (xy 146.261189 214.105266) + (xy 146.203976 214.29387) (xy 146.18466 214.49) (xy 137.560595 214.49) (xy 137.522095 214.478321) (xy 137.324 214.458811) (xy 137.125904 214.478321) (xy 136.935425 214.536103) (xy 136.759885 214.629931) (xy 136.759878 214.629935) (xy 136.606011 214.756211) (xy 136.479735 214.910078) (xy 136.479731 214.910085) (xy 136.385903 215.085625) (xy 136.328121 215.276104) (xy 136.308611 215.4742) (xy 112.3005 215.4742) - (xy 112.3005 204.889999) (xy 113.274722 204.889999) (xy 113.274722 204.89) (xy 113.293762 205.046818) - (xy 113.348244 205.190474) (xy 113.34978 205.194523) (xy 113.439517 205.32453) (xy 113.55776 205.429283) - (xy 113.557762 205.429284) (xy 113.697634 205.502696) (xy 113.851014 205.5405) (xy 113.851015 205.5405) - (xy 114.008985 205.5405) (xy 114.162365 205.502696) (xy 114.233296 205.465468) (xy 114.30224 205.429283) - (xy 114.420483 205.32453) (xy 114.424257 205.319061) (xy 114.478537 205.275071) (xy 114.526308 205.2655) - (xy 115.599435 205.2655) (xy 115.599436 205.2655) (xy 115.647186 205.252705) (xy 115.694938 205.23991) - (xy 115.780562 205.190475) (xy 115.850475 205.120562) (xy 115.850474 205.120562) (xy 115.909043 205.061993) - (xy 115.909042 205.061993) (xy 126.288321 194.682715) (xy 126.349642 194.649232) (xy 126.419334 194.654216) - (xy 126.475267 194.696088) (xy 126.499684 194.761552) (xy 126.5 194.770398) (xy 126.5 201.3) (xy 126.5 201.6) - (xy 137.4 201.6) (xy 137.4 199.424) (xy 137.419685 199.356961) (xy 137.472489 199.311206) (xy 137.524 199.3) - (xy 137.6355 199.3) (xy 137.702539 199.319685) (xy 137.748294 199.372489) (xy 137.7595 199.424) - (xy 137.7595 204.9881) (xy 137.739815 205.055139) (xy 137.723181 205.075781) (xy 137.615781 205.183181) - (xy 137.554458 205.216666) (xy 137.5281 205.2195) (xy 137.381014 205.2195) (xy 137.227634 205.257303) - (xy 137.087762 205.330715) (xy 136.969516 205.435471) (xy 136.879781 205.565475) (xy 136.87978 205.565476) - (xy 136.823762 205.713181) (xy 136.804722 205.869999) (xy 136.804722 205.87) (xy 136.823762 206.026818) - (xy 136.862354 206.128574) (xy 136.87978 206.174523) (xy 136.969517 206.30453) (xy 137.08776 206.409283) - (xy 137.087762 206.409284) (xy 137.227634 206.482696) (xy 137.381014 206.5205) (xy 137.381015 206.5205) - (xy 137.538985 206.5205) (xy 137.692365 206.482696) (xy 137.83224 206.409283) (xy 137.950483 206.30453) - (xy 138.04022 206.174523) (xy 138.096237 206.026818) (xy 138.115278 205.87) (xy 138.109102 205.819144) - (xy 138.120561 205.750224) (xy 138.144511 205.716524) (xy 138.435474 205.425563) (xy 138.435763 205.425063) - (xy 138.48491 205.339938) (xy 138.503777 205.269525) (xy 138.5105 205.244436) (xy 138.5105 205.145564) - (xy 138.5105 199.424) (xy 138.530185 199.356961) (xy 138.582989 199.311206) (xy 138.6345 199.3) - (xy 139 199.3) (xy 139 186.7695) (xy 139.019685 186.702461) (xy 139.072489 186.656706) (xy 139.124 186.6455) - (xy 145.403692 186.6455) (xy 145.470731 186.665185) (xy 145.505742 186.699061) (xy 145.508089 186.702461) - (xy 145.509515 186.704528) (xy 145.509517 186.70453) (xy 145.62776 186.809283) (xy 145.627762 186.809284) - (xy 145.767634 186.882696) (xy 145.921014 186.9205) (xy 145.921015 186.9205) (xy 146.078985 186.9205) - (xy 146.232365 186.882696) (xy 146.257843 186.869324) (xy 146.37224 186.809283) (xy 146.490483 186.70453) - (xy 146.58022 186.574523) (xy 146.636237 186.426818) (xy 146.651468 186.30137) (xy 146.679089 186.237195) - (xy 146.737023 186.198138) (xy 146.806876 186.196603) (xy 146.862245 186.228638) (xy 147.863181 187.229574) - (xy 147.896666 187.290897) (xy 147.8995 187.317255) (xy 147.8995 189.852726) (xy 147.926793 189.954589) - (xy 147.953156 190.00025) (xy 147.97952 190.045913) (xy 147.979521 190.045914) (xy 147.979522 190.045915) - (xy 151.275179 193.341571) (xy 151.275189 193.341582) (xy 151.354088 193.420481) (xy 151.39975 193.446843) - (xy 151.399752 193.446845) (xy 151.434421 193.466861) (xy 151.445412 193.473207) (xy 151.547273 193.500501) - (xy 151.547276 193.500501) (xy 151.660323 193.500501) (xy 151.660339 193.5005) (xy 152.91867 193.5005) - (xy 152.985709 193.520185) (xy 153.031464 193.572989) (xy 153.041408 193.642147) (xy 153.012383 193.705703) - (xy 152.976296 193.734296) (xy 152.929754 193.758723) (xy 152.811508 193.863479) (xy 152.721773 193.993483) - (xy 152.721772 193.993484) (xy 152.665754 194.141189) (xy 152.646714 194.298007) (xy 152.646714 194.298008) - (xy 152.665754 194.454826) (xy 152.708591 194.567775) (xy 152.721772 194.602531) (xy 152.811509 194.732538) - (xy 152.929752 194.837291) (xy 152.958125 194.852182) (xy 153.008338 194.900766) (xy 153.0245 194.961979) - (xy 153.0245 215.2931) (xy 153.004815 215.360139) (xy 152.988181 215.380781) (xy 151.269437 217.099526) - (xy 148.299526 220.069436) (xy 148.250091 220.155059) (xy 148.25009 220.15506) (xy 148.242748 220.18246) - (xy 148.239078 220.19616) (xy 148.238049 220.2) (xy 148.224816 220.249387) (xy 148.224803 220.249436) - (xy 148.2245 220.250564) (xy 148.2245 228.107796) (xy 148.204815 228.174835) (xy 148.182727 228.200611) - (xy 148.109518 228.265468) (xy 148.019781 228.395475) (xy 148.01978 228.395476) (xy 147.963762 228.543181) - (xy 147.944722 228.699999) (xy 147.944722 228.7) (xy 147.963763 228.856818) (xy 147.963762 228.856818) - (xy 148.01978 229.004523) (xy 148.109517 229.13453) (xy 148.22776 229.239283) (xy 148.227762 229.239284) - (xy 148.367634 229.312696) (xy 148.521014 229.3505) (xy 148.521015 229.3505) (xy 148.678985 229.3505) - (xy 148.832365 229.312696) (xy 148.877111 229.289211) (xy 148.97224 229.239283) (xy 149.090483 229.13453) - (xy 149.18022 229.004523) (xy 149.236237 228.856818) (xy 149.255278 228.7) (xy 149.251086 228.665471) - (xy 149.236237 228.543181) (xy 149.200708 228.4495) (xy 149.18022 228.395477) (xy 149.106926 228.289292) - (xy 169.0495 228.289292) (xy 169.0495 228.439107) (xy 169.078723 228.586022) (xy 169.078725 228.58603) - (xy 169.136051 228.724429) (xy 169.136056 228.724438) (xy 169.21928 228.84899) (xy 169.219283 228.848994) - (xy 169.325205 228.954916) (xy 169.325209 228.954919) (xy 169.449761 229.038143) (xy 169.44977 229.038148) - (xy 169.452513 229.039284) (xy 169.58817 229.095475) (xy 169.692696 229.116266) (xy 169.735092 229.124699) - (xy 169.735096 229.1247) (xy 169.735097 229.1247) (xy 169.884904 229.1247) (xy 169.884905 229.124699) - (xy 170.03183 229.095475) (xy 170.170232 229.038147) (xy 170.294791 228.954919) (xy 170.400719 228.848991) - (xy 170.483947 228.724432) (xy 170.541275 228.58603) (xy 170.5705 228.439103) (xy 170.5705 228.289297) - (xy 170.541275 228.14237) (xy 170.494318 228.029005) (xy 170.483948 228.00397) (xy 170.483943 228.003961) - (xy 170.400719 227.879409) (xy 170.400716 227.879405) (xy 170.294794 227.773483) (xy 170.29479 227.77348) - (xy 170.170238 227.690256) (xy 170.170229 227.690251) (xy 170.03183 227.632925) (xy 170.031822 227.632923) - (xy 169.884907 227.6037) (xy 169.884903 227.6037) (xy 169.735097 227.6037) (xy 169.735092 227.6037) - (xy 169.588177 227.632923) (xy 169.588169 227.632925) (xy 169.44977 227.690251) (xy 169.449761 227.690256) - (xy 169.325209 227.77348) (xy 169.325205 227.773483) (xy 169.219283 227.879405) (xy 169.21928 227.879409) - (xy 169.136056 228.003961) (xy 169.136051 228.00397) (xy 169.078725 228.142369) (xy 169.078723 228.142377) - (xy 169.0495 228.289292) (xy 149.106926 228.289292) (xy 149.090483 228.26547) (xy 149.090481 228.265468) - (xy 149.017273 228.200611) (xy 148.980146 228.141422) (xy 148.9755 228.107796) (xy 148.9755 225.299999) - (xy 157.844722 225.299999) (xy 157.844722 225.3) (xy 157.863762 225.456818) (xy 157.903413 225.561367) - (xy 157.91978 225.604523) (xy 158.009517 225.73453) (xy 158.12776 225.839283) (xy 158.127762 225.839284) - (xy 158.267634 225.912696) (xy 158.421014 225.9505) (xy 158.421015 225.9505) (xy 158.578985 225.9505) - (xy 158.732365 225.912696) (xy 158.795787 225.879409) (xy 158.87224 225.839283) (xy 158.990483 225.73453) - (xy 159.08022 225.604523) (xy 159.136237 225.456818) (xy 159.155278 225.3) (xy 159.149102 225.249144) - (xy 159.160561 225.180224) (xy 159.184514 225.146521) (xy 163.924217 220.406819) (xy 163.98554 220.373334) - (xy 164.011898 220.3705) (xy 164.138985 220.3705) (xy 164.292365 220.332696) (xy 164.43224 220.259283) - (xy 164.550483 220.15453) (xy 164.64022 220.024523) (xy 164.696237 219.876818) (xy 164.715278 219.72) - (xy 164.70808 219.660714) (xy 164.696237 219.563181) (xy 164.660961 219.470166) (xy 164.64022 219.415477) - (xy 164.550483 219.28547) (xy 164.43224 219.180717) (xy 164.432238 219.180716) (xy 164.432237 219.180715) - (xy 164.292365 219.107303) (xy 164.138986 219.0695) (xy 164.138985 219.0695) (xy 163.981015 219.0695) - (xy 163.981014 219.0695) (xy 163.827634 219.107303) (xy 163.687762 219.180715) (xy 163.68776 219.180717) - (xy 163.599534 219.258878) (xy 163.569516 219.285471) (xy 163.479781 219.415475) (xy 163.47978 219.415476) - (xy 163.423762 219.563181) (xy 163.404722 219.719999) (xy 163.404722 219.720002) (xy 163.413061 219.78869) - (xy 163.4016 219.857613) (xy 163.377646 219.891315) (xy 158.655781 224.613181) (xy 158.594458 224.646666) - (xy 158.5681 224.6495) (xy 158.421014 224.6495) (xy 158.267634 224.687303) (xy 158.127762 224.760715) - (xy 158.009516 224.865471) (xy 157.919781 224.995475) (xy 157.91978 224.995476) (xy 157.863762 225.143181) - (xy 157.844722 225.299999) (xy 148.9755 225.299999) (xy 148.9755 220.506899) (xy 148.995185 220.43986) - (xy 149.011819 220.419218) (xy 151.859033 217.572004) (xy 151.859045 217.57199) (xy 153.700475 215.730563) - (xy 153.749911 215.644937) (xy 153.7755 215.549436) (xy 153.7755 215.450564) (xy 153.7755 194.79577) - (xy 153.795185 194.728731) (xy 153.79745 194.72533) (xy 153.806663 194.711983) (xy 153.882212 194.602531) - (xy 153.938229 194.454826) (xy 153.938229 194.454822) (xy 153.939018 194.452743) (xy 153.981195 194.397041) - (xy 154.046793 194.372983) (xy 154.114983 194.38821) (xy 154.142641 194.409033) (xy 154.863181 195.129573) - (xy 154.896666 195.190896) (xy 154.8995 195.217254) (xy 154.8995 208.666926) (xy 154.926793 208.768789) - (xy 154.953156 208.81445) (xy 154.97952 208.860113) (xy 162.662924 216.543517) (xy 170.313181 224.193773) - (xy 170.346666 224.255096) (xy 170.3495 224.281454) (xy 170.3495 224.369493) (xy 170.329815 224.436532) - (xy 170.283955 224.47885) (xy 170.19146 224.52829) (xy 170.039116 224.653316) (xy 169.91409 224.80566) - (xy 169.914086 224.805667) (xy 169.821188 224.979466) (xy 169.763975 225.16807) (xy 169.744659 225.3642) - (xy 169.763975 225.560329) (xy 169.821188 225.748933) (xy 169.914086 225.922732) (xy 169.91409 225.922739) - (xy 170.039116 226.075083) (xy 170.19146 226.200109) (xy 170.191467 226.200113) (xy 170.365266 226.293011) - (xy 170.365269 226.293011) (xy 170.365273 226.293014) (xy 170.553868 226.350224) (xy 170.75 226.369541) - (xy 170.946132 226.350224) (xy 171.134727 226.293014) (xy 171.308538 226.20011) (xy 171.460883 226.075083) - (xy 171.58591 225.922738) (xy 171.678814 225.748927) (xy 171.736024 225.560332) (xy 171.755341 225.3642) - (xy 171.736024 225.168068) (xy 171.678814 224.979473) (xy 171.678811 224.979469) (xy 171.678811 224.979466) - (xy 171.585913 224.805667) (xy 171.585909 224.80566) (xy 171.460883 224.653316) (xy 171.308539 224.52829) - (xy 171.216045 224.47885) (xy 171.166202 224.429887) (xy 171.1505 224.369493) (xy 171.1505 224.126929) - (xy 171.150501 224.126916) (xy 171.150501 224.011474) (xy 171.150501 224.011473) (xy 171.123207 223.909613) - (xy 171.07048 223.818287) (xy 170.995913 223.74372) (xy 170.995912 223.743719) (xy 170.991582 223.739389) - (xy 170.991571 223.739379) (xy 170.818619 223.566427) (xy 170.785134 223.505104) (xy 170.790118 223.435412) - (xy 170.83199 223.379479) (xy 170.894144 223.355344) (xy 170.946132 223.350224) (xy 171.134727 223.293014) - (xy 171.139779 223.290314) (xy 171.308532 223.200113) (xy 171.308538 223.20011) (xy 171.396835 223.127645) - (xy 171.461144 223.100333) (xy 171.530012 223.112124) (xy 171.581572 223.159276) (xy 171.5995 223.223499) - (xy 171.5995 223.666926) (xy 171.626793 223.768789) (xy 171.647047 223.803868) (xy 171.67952 223.860113) - (xy 172.237946 224.418539) (xy 172.763439 224.944031) (xy 172.796924 225.005354) (xy 172.794419 225.067706) - (xy 172.763976 225.168067) (xy 172.744659 225.3642) (xy 172.763975 225.560329) (xy 172.821188 225.748933) - (xy 172.914086 225.922732) (xy 172.91409 225.922739) (xy 173.039116 226.075083) (xy 173.19146 226.200109) - (xy 173.191467 226.200113) (xy 173.365266 226.293011) (xy 173.365269 226.293011) (xy 173.365273 226.293014) - (xy 173.553868 226.350224) (xy 173.75 226.369541) (xy 173.946132 226.350224) (xy 174.134727 226.293014) - (xy 174.308538 226.20011) (xy 174.460883 226.075083) (xy 174.58591 225.922738) (xy 174.678814 225.748927) - (xy 174.736024 225.560332) (xy 174.755341 225.3642) (xy 174.736024 225.168068) (xy 174.678814 224.979473) - (xy 174.678811 224.979469) (xy 174.678811 224.979466) (xy 174.585913 224.805667) (xy 174.585909 224.80566) - (xy 174.460883 224.653316) (xy 174.308539 224.52829) (xy 174.308532 224.528286) (xy 174.134733 224.435388) - (xy 174.134727 224.435386) (xy 174.008997 224.397246) (xy 173.946129 224.378175) (xy 173.75 224.358859) - (xy 173.553867 224.378176) (xy 173.453506 224.408619) (xy 173.383639 224.409242) (xy 173.329831 224.377639) - (xy 172.436819 223.484626) (xy 172.403334 223.423303) (xy 172.4005 223.396945) (xy 172.4005 216.547275) - (xy 172.4005 216.547273) (xy 172.373207 216.445413) (xy 172.373207 216.445412) (xy 172.32048 216.354087) - (xy 170.545913 214.57952) (xy 170.50025 214.553156) (xy 170.454589 214.526793) (xy 170.403657 214.513146) - (xy 170.352727 214.4995) (xy 170.352726 214.4995) (xy 168.53945 214.4995) (xy 168.472411 214.479815) - (xy 168.451769 214.463181) (xy 167.250769 213.262181) (xy 167.217284 213.200858) (xy 167.222268 213.131166) - (xy 167.26414 213.075233) (xy 167.329604 213.050816) (xy 167.33845 213.0505) (xy 167.378985 213.0505) - (xy 167.532365 213.012696) (xy 167.594061 212.980315) (xy 167.67224 212.939283) (xy 167.790483 212.83453) - (xy 167.88022 212.704523) (xy 167.936237 212.556818) (xy 167.955278 212.4) (xy 167.936237 212.243182) - (xy 167.936236 212.24318) (xy 167.914992 212.187164) (xy 167.88022 212.095477) (xy 167.790483 211.96547) + (xy 112.3005 115.364999) (xy 114.194722 115.364999) (xy 114.194722 115.365) (xy 114.213762 115.521818) + (xy 114.252132 115.622989) (xy 114.26978 115.669523) (xy 114.359517 115.79953) (xy 114.47776 115.904283) + (xy 114.617635 115.977696) (xy 114.622584 115.978915) (xy 114.680595 116.011632) (xy 114.681696 116.012733) + (xy 114.715181 116.074056) (xy 114.710197 116.143748) (xy 114.668325 116.199681) (xy 114.623694 116.22081) + (xy 114.617634 116.222303) (xy 114.477762 116.295715) (xy 114.359516 116.400471) (xy 114.269781 116.530475) + (xy 114.26978 116.530476) (xy 114.213762 116.678181) (xy 114.194722 116.834999) (xy 114.194722 116.835) + (xy 114.213762 116.991818) (xy 114.26978 117.139523) (xy 114.269781 117.139524) (xy 114.35255 117.259437) + (xy 114.374433 117.325792) (xy 114.3745 117.329877) (xy 114.3745 122.499435) (xy 114.40009 122.594938) + (xy 114.438838 122.662051) (xy 114.449526 122.680563) (xy 115.169437 123.400475) (xy 115.255063 123.449911) + (xy 115.350564 123.4755) (xy 115.350565 123.4755) (xy 139.413101 123.4755) (xy 139.48014 123.495185) + (xy 139.500782 123.511819) (xy 144.141669 128.152706) (xy 144.175154 128.214029) (xy 144.172649 128.27638) + (xy 144.155031 128.33446) (xy 144.133975 128.40387) (xy 144.114659 128.6) (xy 144.133975 128.796129) + (xy 144.133976 128.796132) (xy 144.189223 128.978257) (xy 144.191188 128.984733) (xy 144.284086 129.158532) + (xy 144.28409 129.158539) (xy 144.409116 129.310883) (xy 144.56146 129.435909) (xy 144.561463 129.435911) + (xy 144.589315 129.450798) (xy 144.678953 129.49871) (xy 144.728797 129.547671) (xy 144.7445 129.608068) + (xy 144.7445 129.9755) (xy 144.724815 130.042539) (xy 144.672011 130.088294) (xy 144.6205 130.0995) + (xy 144.345323 130.0995) (xy 144.272264 130.114032) (xy 144.27226 130.114033) (xy 144.189399 130.169399) + (xy 144.134033 130.25226) (xy 144.134032 130.252264) (xy 144.1195 130.325321) (xy 144.1195 131.874678) + (xy 144.134032 131.947735) (xy 144.134033 131.947739) (xy 144.150786 131.972811) (xy 144.189399 132.030601) + (xy 144.264141 132.080541) (xy 144.27226 132.085966) (xy 144.272264 132.085967) (xy 144.345321 132.100499) + (xy 144.345324 132.1005) (xy 144.345326 132.1005) (xy 144.636239 132.1005) (xy 144.703278 132.120185) + (xy 144.749033 132.172989) (xy 144.756013 132.192405) (xy 144.770089 132.244936) (xy 144.770089 132.244937) + (xy 144.783002 132.267302) (xy 144.817879 132.327711) (xy 144.818572 132.32891) (xy 144.818572 132.328913) + (xy 144.819523 132.33056) (xy 144.819527 132.330565) (xy 149.266444 136.777481) (xy 153.674525 141.185562) + (xy 153.744438 141.255475) (xy 153.830062 141.30491) (xy 153.830066 141.304911) (xy 153.863014 141.31374) + (xy 153.863015 141.31374) (xy 153.879775 141.31823) (xy 153.925564 141.3305) (xy 153.925565 141.3305) + (xy 160.297519 141.3305) (xy 160.364558 141.350185) (xy 160.3852 141.366819) (xy 163.463181 144.4448) + (xy 163.496666 144.506123) (xy 163.4995 144.532481) (xy 163.4995 147.622386) (xy 163.479815 147.689425) + (xy 163.427011 147.73518) (xy 163.357853 147.745124) (xy 163.317874 147.732182) (xy 163.232364 147.687302) + (xy 163.078985 147.649499) (xy 163.078984 147.649499) (xy 162.921014 147.649499) (xy 162.921013 147.649499) + (xy 162.767633 147.687302) (xy 162.627761 147.760714) (xy 162.509515 147.86547) (xy 162.41978 147.995474) + (xy 162.419779 147.995475) (xy 162.363761 148.14318) (xy 162.363761 148.143183) (xy 162.363107 148.148568) + (xy 162.335481 148.212744) (xy 162.277544 148.251797) (xy 162.207691 148.253327) (xy 162.152332 148.221295) + (xy 161.957806 148.026768) (xy 161.764239 147.833201) (xy 161.730754 147.771878) (xy 161.735738 147.702186) + (xy 161.77761 147.646253) (xy 161.843074 147.621836) (xy 161.881589 147.625122) (xy 161.960395 147.644546) + (xy 161.960397 147.644546) (xy 162.118365 147.644546) (xy 162.271745 147.606742) (xy 162.300982 147.591397) + (xy 162.41162 147.533329) (xy 162.529863 147.428576) (xy 162.6196 147.298569) (xy 162.675617 147.150864) + (xy 162.694658 146.994046) (xy 162.694201 146.990278) (xy 162.675617 146.837227) (xy 162.633088 146.725088) + (xy 162.6196 146.689523) (xy 162.529863 146.559516) (xy 162.41162 146.454763) (xy 162.411618 146.454762) + (xy 162.411617 146.454761) (xy 162.271745 146.381349) (xy 162.118366 146.343546) (xy 162.118365 146.343546) + (xy 161.960395 146.343546) (xy 161.960394 146.343546) (xy 161.807014 146.381349) (xy 161.667142 146.454761) + (xy 161.548896 146.559517) (xy 161.459161 146.689521) (xy 161.45916 146.689522) (xy 161.420628 146.791123) + (xy 161.37845 146.846826) (xy 161.312852 146.870883) (xy 161.304686 146.871152) (xy 158.164134 146.871152) + (xy 158.097095 146.851467) (xy 158.076453 146.834833) (xy 156.741145 145.499526) (xy 156.741144 145.499525) + (xy 156.669896 145.45839) (xy 156.655522 145.450091) (xy 156.655521 145.45009) (xy 156.65552 145.45009) + (xy 156.591624 145.432969) (xy 156.591623 145.432968) (xy 156.560018 145.4245) (xy 156.560017 145.4245) + (xy 147.196308 145.4245) (xy 147.129269 145.404815) (xy 147.094257 145.370938) (xy 147.090483 145.36547) + (xy 146.97224 145.260717) (xy 146.972238 145.260716) (xy 146.972237 145.260715) (xy 146.832365 145.187303) + (xy 146.678986 145.1495) (xy 146.678985 145.1495) (xy 146.521015 145.1495) (xy 146.521014 145.1495) + (xy 146.367634 145.187303) (xy 146.227762 145.260715) (xy 146.22776 145.260717) (xy 146.138631 145.339678) + (xy 146.109516 145.365471) (xy 146.019781 145.495475) (xy 146.01978 145.495476) (xy 145.963762 145.643181) + (xy 145.944722 145.799999) (xy 145.944722 145.8) (xy 145.963762 145.956818) (xy 146.01978 146.104523) + (xy 146.109517 146.23453) (xy 146.22776 146.339283) (xy 146.227762 146.339284) (xy 146.367634 146.412696) + (xy 146.521014 146.4505) (xy 146.521015 146.4505) (xy 146.678985 146.4505) (xy 146.832365 146.412696) + (xy 146.892089 146.38135) (xy 146.97224 146.339283) (xy 147.090483 146.23453) (xy 147.094257 146.229061) + (xy 147.148537 146.185071) (xy 147.196308 146.1755) (xy 156.303683 146.1755) (xy 156.370722 146.195185) + (xy 156.391364 146.211819) (xy 157.232446 147.052901) (xy 157.265931 147.114224) (xy 157.260947 147.183916) + (xy 157.219075 147.239849) (xy 157.17444 147.260979) (xy 157.067633 147.287304) (xy 156.927762 147.360715) + (xy 156.91634 147.370834) (xy 156.842593 147.436168) (xy 156.809516 147.465471) (xy 156.719781 147.595475) + (xy 156.71978 147.595476) (xy 156.663762 147.743181) (xy 156.644722 147.899999) (xy 156.644722 147.9) + (xy 156.663762 148.056818) (xy 156.698559 148.148568) (xy 156.71978 148.204523) (xy 156.805743 148.329063) + (xy 156.806432 148.33006) (xy 156.828315 148.396414) (xy 156.81085 148.464066) (xy 156.759582 148.511536) + (xy 156.704382 148.5245) (xy 146.4069 148.5245) (xy 146.339861 148.504815) (xy 146.319219 148.488181) + (xy 144.060101 146.229063) (xy 141.794217 143.96318) (xy 141.760733 143.901858) (xy 141.765717 143.832166) + (xy 141.779852 143.805056) (xy 141.78022 143.804523) (xy 141.836237 143.656818) (xy 141.855278 143.5) + (xy 141.837488 143.35348) (xy 141.836237 143.343181) (xy 141.810568 143.275499) (xy 141.78022 143.195477) + (xy 141.690483 143.06547) (xy 141.57224 142.960717) (xy 141.572238 142.960716) (xy 141.572237 142.960715) + (xy 141.432365 142.887303) (xy 141.278986 142.8495) (xy 141.278985 142.8495) (xy 141.121015 142.8495) + (xy 141.121014 142.8495) (xy 140.967634 142.887303) (xy 140.827762 142.960715) (xy 140.709516 143.065471) + (xy 140.619781 143.195475) (xy 140.61978 143.195476) (xy 140.563762 143.343181) (xy 140.544722 143.499999) + (xy 140.544722 143.5) (xy 140.563762 143.656818) (xy 140.595038 143.739284) (xy 140.61978 143.804523) + (xy 140.709517 143.93453) (xy 140.82776 144.039283) (xy 140.827761 144.039283) (xy 140.827764 144.039286) + (xy 140.833934 144.043545) (xy 140.832437 144.045713) (xy 140.87307 144.084742) (xy 140.889673 144.113499) + (xy 140.899525 144.130562) (xy 140.899526 144.130563) (xy 145.969437 149.200475) (xy 145.969438 149.200476) + (xy 145.96944 149.200477) (xy 146.01225 149.225193) (xy 146.055063 149.249911) (xy 146.150564 149.2755) + (xy 146.150565 149.2755) (xy 157.342796 149.2755) (xy 157.409835 149.295185) (xy 157.430476 149.311818) + (xy 158.269129 150.150472) (xy 158.26913 150.150473) (xy 158.269132 150.150474) (xy 158.284972 150.159619) + (xy 158.354755 150.199908) (xy 158.450256 150.225497) (xy 158.450257 150.225497) (xy 161.503692 150.225497) + (xy 161.570731 150.245182) (xy 161.605742 150.279058) (xy 161.609517 150.284527) (xy 161.609519 150.284529) + (xy 161.60952 150.28453) (xy 161.614491 150.290142) (xy 161.6128 150.291639) (xy 161.643995 150.341363) + (xy 161.643233 150.411228) (xy 161.612896 150.458443) (xy 161.614491 150.459856) (xy 161.609516 150.46547) + (xy 161.607089 150.468987) (xy 161.605742 150.470938) (xy 161.551463 150.514929) (xy 161.503692 150.5245) + (xy 146.106899 150.5245) (xy 146.03986 150.504815) (xy 146.019218 150.488181) (xy 138.884517 143.35348) + (xy 138.851032 143.292157) (xy 138.849102 143.250857) (xy 138.855278 143.2) (xy 138.836237 143.043182) + (xy 138.78022 142.895477) (xy 138.690483 142.76547) (xy 138.57224 142.660717) (xy 138.572238 142.660716) + (xy 138.572237 142.660715) (xy 138.432365 142.587303) (xy 138.278986 142.5495) (xy 138.278985 142.5495) + (xy 138.121015 142.5495) (xy 138.121014 142.5495) (xy 137.967634 142.587303) (xy 137.827762 142.660715) + (xy 137.709516 142.765471) (xy 137.619781 142.895475) (xy 137.61978 142.895476) (xy 137.563762 143.043181) + (xy 137.544722 143.199999) (xy 137.544722 143.2) (xy 137.563762 143.356818) (xy 137.618064 143.499999) + (xy 137.61978 143.504523) (xy 137.709517 143.63453) (xy 137.82776 143.739283) (xy 137.827762 143.739284) + (xy 137.967634 143.812696) (xy 138.121014 143.8505) (xy 138.268101 143.8505) (xy 138.33514 143.870185) + (xy 138.355782 143.886819) (xy 145.599525 151.130562) (xy 145.669438 151.200475) (xy 145.755062 151.24991) + (xy 145.767952 151.253364) (xy 145.780841 151.256818) (xy 145.780842 151.256818) (xy 145.795576 151.260765) + (xy 145.850564 151.2755) (xy 145.850565 151.2755) (xy 161.503692 151.2755) (xy 161.570731 151.295185) + (xy 161.605742 151.329061) (xy 161.609517 151.33453) (xy 161.72776 151.439283) (xy 161.727762 151.439284) + (xy 161.867634 151.512696) (xy 162.021014 151.5505) (xy 162.021015 151.5505) (xy 162.178985 151.5505) + (xy 162.332365 151.512696) (xy 162.342872 151.507181) (xy 162.411377 151.493454) (xy 162.476431 151.518943) + (xy 162.517378 151.575557) (xy 162.5245 151.616976) (xy 162.5245 152.8931) (xy 162.504815 152.960139) + (xy 162.488181 152.980781) (xy 161.030782 154.438181) (xy 160.969459 154.471666) (xy 160.943101 154.4745) + (xy 154.186308 154.4745) (xy 154.119269 154.454815) (xy 154.084257 154.420938) (xy 154.080483 154.41547) + (xy 153.96224 154.310717) (xy 153.962238 154.310716) (xy 153.962237 154.310715) (xy 153.822365 154.237303) + (xy 153.668986 154.1995) (xy 153.668985 154.1995) (xy 153.511015 154.1995) (xy 153.511014 154.1995) + (xy 153.357634 154.237303) (xy 153.217762 154.310715) (xy 153.099516 154.415471) (xy 153.009781 154.545475) + (xy 153.00978 154.545476) (xy 152.953762 154.693181) (xy 152.934722 154.849999) (xy 152.934722 154.85) + (xy 152.953762 155.006818) (xy 152.990933 155.104828) (xy 153.00978 155.154523) (xy 153.099517 155.28453) + (xy 153.21776 155.389283) (xy 153.217762 155.389284) (xy 153.357634 155.462696) (xy 153.511014 155.5005) + (xy 153.511015 155.5005) (xy 153.668985 155.5005) (xy 153.822365 155.462696) (xy 153.827406 155.46005) + (xy 153.96224 155.389283) (xy 154.080483 155.28453) (xy 154.084257 155.279061) (xy 154.138537 155.235071) + (xy 154.186308 155.2255) (xy 160.580497 155.2255) (xy 160.647536 155.245185) (xy 160.693291 155.297989) + (xy 160.703235 155.367147) (xy 160.67421 155.430703) (xy 160.668178 155.437181) (xy 159.692178 156.413181) + (xy 159.630855 156.446666) (xy 159.604497 156.4495) (xy 157.596308 156.4495) (xy 157.529269 156.429815) + (xy 157.494257 156.395938) (xy 157.490483 156.39047) (xy 157.37224 156.285717) (xy 157.372238 156.285716) + (xy 157.372237 156.285715) (xy 157.232365 156.212303) (xy 157.078986 156.1745) (xy 157.078985 156.1745) + (xy 156.921015 156.1745) (xy 156.921014 156.1745) (xy 156.767634 156.212303) (xy 156.627762 156.285715) + (xy 156.509516 156.390471) (xy 156.419781 156.520475) (xy 156.41978 156.520476) (xy 156.363762 156.668181) + (xy 156.344722 156.824999) (xy 156.344722 156.825) (xy 156.363762 156.981818) (xy 156.39173 157.055562) + (xy 156.41978 157.129523) (xy 156.509517 157.25953) (xy 156.62776 157.364283) (xy 156.627762 157.364284) + (xy 156.767634 157.437696) (xy 156.921014 157.4755) (xy 156.921015 157.4755) (xy 157.078985 157.4755) + (xy 157.232365 157.437696) (xy 157.37224 157.364283) (xy 157.490483 157.25953) (xy 157.494257 157.254061) + (xy 157.548537 157.210071) (xy 157.596308 157.2005) (xy 159.860831 157.2005) (xy 159.860832 157.2005) + (xy 159.898518 157.190401) (xy 159.908617 157.187696) (xy 159.929654 157.182058) (xy 159.956334 157.17491) + (xy 160.041958 157.125475) (xy 160.111871 157.055562) (xy 160.11187 157.055562) (xy 160.170439 156.996993) + (xy 160.170438 156.996993) (xy 163.532821 153.634612) (xy 163.594142 153.601129) (xy 163.663834 153.606113) + (xy 163.719767 153.647985) (xy 163.744184 153.713449) (xy 163.7445 153.722295) (xy 163.7445 164.2005) + (xy 163.724815 164.267539) (xy 163.672011 164.313294) (xy 163.6205 164.3245) (xy 128.242262 164.3245) + (xy 128.19451 164.337295) (xy 128.194509 164.337294) (xy 128.146761 164.350089) (xy 128.14676 164.350089) + (xy 128.061133 164.399527) (xy 122.182423 170.278237) (xy 122.1211 170.311722) (xy 122.094742 170.314556) + (xy 121.947656 170.314556) (xy 121.794276 170.352359) (xy 121.654404 170.425771) (xy 121.536158 170.530527) + (xy 121.446423 170.660531) (xy 121.446422 170.660532) (xy 121.390404 170.808237) (xy 121.371364 170.965055) + (xy 121.371364 170.965056) (xy 121.390404 171.121874) (xy 121.435257 171.240139) (xy 121.446422 171.269579) + (xy 121.536159 171.399586) (xy 121.654402 171.504339) (xy 121.654404 171.50434) (xy 121.794276 171.577752) + (xy 121.947656 171.615556) (xy 121.947657 171.615556) (xy 122.105627 171.615556) (xy 122.259007 171.577752) + (xy 122.293905 171.559436) (xy 122.398882 171.504339) (xy 122.517125 171.399586) (xy 122.606862 171.269579) + (xy 122.662879 171.121874) (xy 122.68192 170.965056) (xy 122.675744 170.9142) (xy 122.687203 170.84528) + (xy 122.711156 170.811577) (xy 128.410916 165.111819) (xy 128.472239 165.078334) (xy 128.498597 165.0755) + (xy 163.6205 165.0755) (xy 163.687539 165.095185) (xy 163.733294 165.147989) (xy 163.7445 165.1995) + (xy 163.7445 168.993907) (xy 163.744527 168.995) (xy 163.744808 169.00645) (xy 163.745406 169.018618) + (xy 163.746325 169.031086) (xy 163.763745 169.207958) (xy 163.763751 169.208009) (xy 163.767421 169.232756) + (xy 163.767427 169.232785) (xy 163.772169 169.256627) (xy 163.778249 169.280899) (xy 163.778257 169.280928) + (xy 163.828079 169.445171) (xy 163.836523 169.468772) (xy 163.836524 169.468775) (xy 163.845826 169.491231) + (xy 163.85655 169.513905) (xy 163.856557 169.513919) (xy 163.937435 169.665229) (xy 163.937441 169.66524) + (xy 163.942185 169.673155) (xy 163.950316 169.686722) (xy 163.950327 169.686739) (xy 163.963827 169.706944) + (xy 163.963845 169.70697) (xy 163.971115 169.716772) (xy 163.97877 169.727093) (xy 164.00925 169.764234) + (xy 164.009274 169.764265) (xy 164.087644 169.859758) (xy 164.104473 169.878326) (xy 164.121672 169.895525) + (xy 164.14024 169.912354) (xy 164.140245 169.912358) (xy 164.272901 170.021226) (xy 164.272916 170.021237) + (xy 164.293015 170.036145) (xy 164.293081 170.036191) (xy 164.313251 170.049667) (xy 164.334731 170.062542) + (xy 164.334747 170.062551) (xy 164.334759 170.062558) (xy 164.334778 170.062568) (xy 164.486079 170.143441) + (xy 164.486093 170.143448) (xy 164.486097 170.14345) (xy 164.486101 170.143452) (xy 164.508762 170.15417) + (xy 164.53122 170.163473) (xy 164.554834 170.171922) (xy 164.719057 170.221738) (xy 164.743381 170.227831) + (xy 164.767222 170.232573) (xy 164.785462 170.235278) (xy 164.79202 170.236252) (xy 164.809984 170.238021) + (xy 164.968895 170.253673) (xy 164.981404 170.254595) (xy 164.993558 170.255192) (xy 165.006093 170.2555) + (xy 165.768085 170.2555) (xy 165.835124 170.275185) (xy 165.880879 170.327989) (xy 165.890823 170.397147) + (xy 165.861798 170.460703) (xy 165.855766 170.467181) (xy 162.784766 173.538181) (xy 162.723443 173.571666) + (xy 162.697085 173.5745) (xy 122.696298 173.5745) (xy 122.629259 173.554815) (xy 122.594247 173.520938) + (xy 122.590473 173.51547) (xy 122.47223 173.410717) (xy 122.472228 173.410716) (xy 122.472227 173.410715) + (xy 122.332355 173.337303) (xy 122.178976 173.2995) (xy 122.178975 173.2995) (xy 122.021005 173.2995) + (xy 122.021004 173.2995) (xy 121.867624 173.337303) (xy 121.727752 173.410715) (xy 121.609506 173.515471) + (xy 121.519771 173.645475) (xy 121.51977 173.645476) (xy 121.463752 173.793181) (xy 121.444712 173.949999) + (xy 121.444712 173.95) (xy 121.463752 174.106818) (xy 121.51977 174.254523) (xy 121.519771 174.254524) + (xy 121.609506 174.384529) (xy 121.613132 174.387741) (xy 121.650259 174.446931) (xy 121.649491 174.516796) + (xy 121.611074 174.575156) (xy 121.547203 174.603481) (xy 121.530905 174.604557) (xy 121.431966 174.604557) + (xy 121.358907 174.619089) (xy 121.358903 174.61909) (xy 121.276042 174.674456) (xy 121.220676 174.757317) + (xy 121.220675 174.757321) (xy 121.206143 174.830378) (xy 121.206143 176.379735) (xy 121.220675 176.452792) + (xy 121.220676 176.452796) (xy 121.220677 176.452797) (xy 121.276042 176.535658) (xy 121.358903 176.591023) + (xy 121.358907 176.591024) (xy 121.431964 176.605556) (xy 121.431967 176.605557) (xy 121.431969 176.605557) + (xy 122.981319 176.605557) (xy 122.98132 176.605556) (xy 123.054383 176.591023) (xy 123.137244 176.535658) + (xy 123.192609 176.452797) (xy 123.207143 176.379731) (xy 123.207143 174.830383) (xy 123.207143 174.83038) + (xy 123.207142 174.830378) (xy 123.19261 174.757321) (xy 123.192609 174.757317) (xy 123.184334 174.744932) + (xy 123.137244 174.674456) (xy 123.054383 174.619091) (xy 123.054382 174.61909) (xy 123.054378 174.619089) + (xy 122.98132 174.604557) (xy 122.981317 174.604557) (xy 122.669075 174.604557) (xy 122.602036 174.584872) + (xy 122.556281 174.532068) (xy 122.546337 174.46291) (xy 122.575362 174.399354) (xy 122.586848 174.387741) + (xy 122.590473 174.38453) (xy 122.594247 174.379061) (xy 122.648527 174.335071) (xy 122.696298 174.3255) + (xy 162.953419 174.3255) (xy 162.95342 174.3255) (xy 163.00117 174.312705) (xy 163.048922 174.29991) + (xy 163.134546 174.250475) (xy 163.204459 174.180562) (xy 167.243326 170.141693) (xy 167.304647 170.10821) + (xy 167.374339 170.113194) (xy 167.421797 170.146133) (xy 167.422341 170.145618) (xy 167.424243 170.147625) + (xy 167.424248 170.14763) (xy 167.42425 170.147632) (xy 167.457024 170.179257) (xy 167.545359 170.225465) + (xy 167.54536 170.225465) (xy 167.54536 170.225466) (xy 167.595488 170.240184) (xy 167.612398 170.24515) + (xy 167.612402 170.24515) (xy 167.612404 170.245151) (xy 167.624035 170.246823) (xy 167.684383 170.2555) + (xy 167.684384 170.2555) (xy 172.00049 170.2555) (xy 172.067529 170.275185) (xy 172.113284 170.327989) + (xy 172.12449 170.3795) (xy 172.12449 174.649429) (xy 172.15008 174.744932) (xy 172.199415 174.830383) + (xy 172.199516 174.830557) (xy 174.715477 177.346518) (xy 174.748962 177.407841) (xy 174.750892 177.449143) + (xy 174.747051 177.480782) (xy 174.744718 177.5) (xy 174.762862 177.649434) (xy 174.763759 177.656817) + (xy 174.763758 177.656818) (xy 174.799994 177.752362) (xy 174.819776 177.804523) (xy 174.909513 177.93453) + (xy 174.94444 177.965472) (xy 175.027758 178.039285) (xy 175.125728 178.090704) (xy 175.175941 178.139289) + (xy 175.191915 178.207308) (xy 175.16858 178.273165) (xy 175.113343 178.315952) (xy 175.068102 178.3245) + (xy 163.500564 178.3245) (xy 163.405061 178.350089) (xy 163.319438 178.399525) (xy 163.319435 178.399527) + (xy 156.955781 184.763181) (xy 156.894458 184.796666) (xy 156.8681 184.7995) (xy 156.721014 184.7995) + (xy 156.567634 184.837303) (xy 156.427762 184.910715) (xy 156.309516 185.015471) (xy 156.219781 185.145475) + (xy 156.21978 185.145476) (xy 156.163762 185.293181) (xy 156.144722 185.449999) (xy 156.144722 185.45) + (xy 156.163762 185.606817) (xy 156.173178 185.631643) (xy 156.213769 185.738673) (xy 156.219136 185.808335) + (xy 156.185989 185.869841) (xy 156.124851 185.903663) (xy 156.097827 185.906643) (xy 150.596308 185.906643) + (xy 150.529269 185.886958) (xy 150.494257 185.853081) (xy 150.490483 185.847613) (xy 150.37224 185.74286) + (xy 150.372238 185.742859) (xy 150.372237 185.742858) (xy 150.232365 185.669446) (xy 150.078986 185.631643) + (xy 150.078985 185.631643) (xy 149.921015 185.631643) (xy 149.921014 185.631643) (xy 149.767634 185.669446) + (xy 149.627762 185.742858) (xy 149.509516 185.847614) (xy 149.449013 185.935268) (xy 149.39473 185.979258) + (xy 149.325281 185.986918) (xy 149.262717 185.955814) (xy 149.259282 185.952509) (xy 142.286295 178.979522) + (xy 142.286293 178.97952) (xy 142.24063 178.953156) (xy 142.194969 178.926793) (xy 142.130533 178.909528) + (xy 142.093107 178.8995) (xy 142.093106 178.8995) (xy 120.017255 178.8995) (xy 119.950216 178.879815) + (xy 119.929574 178.863181) (xy 118.736819 177.670426) (xy 118.703334 177.609103) (xy 118.7005 177.582745) + (xy 118.7005 176.302722) (xy 118.720185 176.235683) (xy 118.772989 176.189928) (xy 118.842147 176.179984) + (xy 118.905703 176.209009) (xy 118.920353 176.224057) (xy 118.995759 176.31594) (xy 119.148103 176.440966) + (xy 119.14811 176.44097) (xy 119.321909 176.533868) (xy 119.321912 176.533868) (xy 119.321916 176.533871) + (xy 119.510511 176.591081) (xy 119.706643 176.610398) (xy 119.902775 176.591081) (xy 120.09137 176.533871) + (xy 120.265181 176.440967) (xy 120.417526 176.31594) (xy 120.542553 176.163595) (xy 120.635457 175.989784) + (xy 120.692667 175.801189) (xy 120.711984 175.605057) (xy 120.692667 175.408925) (xy 120.635457 175.22033) + (xy 120.635454 175.220326) (xy 120.635454 175.220323) (xy 120.542556 175.046524) (xy 120.542552 175.046517) + (xy 120.417526 174.894173) (xy 120.265182 174.769147) (xy 120.265175 174.769143) (xy 120.091376 174.676245) + (xy 120.09137 174.676243) (xy 119.902775 174.619033) (xy 119.902772 174.619032) (xy 119.706643 174.599716) + (xy 119.510513 174.619032) (xy 119.321909 174.676245) (xy 119.14811 174.769143) (xy 119.148103 174.769147) + (xy 118.995759 174.894173) (xy 118.920353 174.986056) (xy 118.862607 175.02539) (xy 118.792762 175.027261) + (xy 118.732994 174.991073) (xy 118.702278 174.928317) (xy 118.7005 174.907391) (xy 118.7005 152.850563) + (xy 119.0245 152.850563) (xy 119.0245 171.249437) (xy 119.032538 171.279437) (xy 119.050089 171.344936) + (xy 119.050089 171.344937) (xy 119.06464 171.37014) (xy 119.098875 171.429436) (xy 119.098881 171.429447) + (xy 119.099521 171.430556) (xy 119.099524 171.43056) (xy 119.099526 171.430563) (xy 119.099529 171.430566) + (xy 119.915481 172.246518) (xy 119.948966 172.307841) (xy 119.950896 172.349143) (xy 119.944722 172.399997) + (xy 119.944722 172.4) (xy 119.963762 172.556818) (xy 120.01978 172.704523) (xy 120.109517 172.83453) + (xy 120.22776 172.939283) (xy 120.227762 172.939284) (xy 120.367634 173.012696) (xy 120.521014 173.0505) + (xy 120.521015 173.0505) (xy 120.678985 173.0505) (xy 120.832365 173.012696) (xy 120.97224 172.939283) + (xy 121.090483 172.83453) (xy 121.18022 172.704523) (xy 121.236237 172.556818) (xy 121.255278 172.4) + (xy 121.236237 172.243182) (xy 121.18022 172.095477) (xy 121.090483 171.96547) (xy 120.97224 171.860717) + (xy 120.972238 171.860716) (xy 120.972237 171.860715) (xy 120.832365 171.787303) (xy 120.678986 171.7495) + (xy 120.678985 171.7495) (xy 120.531899 171.7495) (xy 120.46486 171.729815) (xy 120.444218 171.713181) + (xy 119.811819 171.080782) (xy 119.778334 171.019459) (xy 119.7755 170.993101) (xy 119.7755 156.224999) + (xy 144.274722 156.224999) (xy 144.274722 156.225) (xy 144.293762 156.381818) (xy 144.346349 156.520476) + (xy 144.34978 156.529523) (xy 144.439517 156.65953) (xy 144.55776 156.764283) (xy 144.557762 156.764284) + (xy 144.697634 156.837696) (xy 144.851014 156.8755) (xy 144.851015 156.8755) (xy 145.008985 156.8755) + (xy 145.162365 156.837696) (xy 145.186557 156.824999) (xy 145.30224 156.764283) (xy 145.420483 156.65953) + (xy 145.424257 156.654061) (xy 145.478537 156.610071) (xy 145.526308 156.6005) (xy 145.704435 156.6005) + (xy 145.704436 156.6005) (xy 145.752186 156.587705) (xy 145.799938 156.57491) (xy 145.885562 156.525475) + (xy 145.955475 156.455562) (xy 148.599218 153.811819) (xy 148.660541 153.778334) (xy 148.686899 153.7755) + (xy 149.103692 153.7755) (xy 149.170731 153.795185) (xy 149.205742 153.829061) (xy 149.208163 153.832569) + (xy 149.209515 153.834528) (xy 149.209517 153.83453) (xy 149.32776 153.939283) (xy 149.327762 153.939284) + (xy 149.467634 154.012696) (xy 149.621014 154.0505) (xy 149.621015 154.0505) (xy 149.778985 154.0505) + (xy 149.932365 154.012696) (xy 149.940604 154.008372) (xy 150.07224 153.939283) (xy 150.190483 153.83453) + (xy 150.28022 153.704523) (xy 150.336237 153.556818) (xy 150.355278 153.4) (xy 150.355221 153.399526) + (xy 150.336237 153.243181) (xy 150.314992 153.187164) (xy 150.28022 153.095477) (xy 150.190483 152.96547) + (xy 150.07224 152.860717) (xy 150.072238 152.860716) (xy 150.072237 152.860715) (xy 149.932365 152.787303) + (xy 149.778986 152.7495) (xy 149.778985 152.7495) (xy 149.621015 152.7495) (xy 149.621014 152.7495) + (xy 149.467634 152.787303) (xy 149.327762 152.860715) (xy 149.209516 152.96547) (xy 149.207089 152.968987) + (xy 149.205742 152.970938) (xy 149.151463 153.014929) (xy 149.103692 153.0245) (xy 148.430564 153.0245) + (xy 148.382812 153.037295) (xy 148.382811 153.037294) (xy 148.335063 153.050089) (xy 148.335062 153.050089) + (xy 148.26753 153.089079) (xy 148.25645 153.095477) (xy 148.249435 153.099527) (xy 145.576199 155.772763) + (xy 145.514876 155.806248) (xy 145.445184 155.801264) (xy 145.406294 155.777899) (xy 145.30224 155.685717) + (xy 145.302237 155.685714) (xy 145.162365 155.612303) (xy 145.008986 155.5745) (xy 145.008985 155.5745) + (xy 144.851015 155.5745) (xy 144.851014 155.5745) (xy 144.697634 155.612303) (xy 144.557762 155.685715) + (xy 144.439516 155.790471) (xy 144.349781 155.920475) (xy 144.34978 155.920476) (xy 144.293762 156.068181) + (xy 144.274722 156.224999) (xy 119.7755 156.224999) (xy 119.7755 153.106899) (xy 119.795185 153.03986) + (xy 119.811819 153.019218) (xy 129.519219 143.311819) (xy 129.580542 143.278334) (xy 129.6069 143.2755) + (xy 136.649434 143.2755) (xy 136.649436 143.2755) (xy 136.698155 143.262445) (xy 136.708451 143.259687) + (xy 136.724536 143.255376) (xy 136.744938 143.24991) (xy 136.830562 143.200475) (xy 136.900475 143.130562) + (xy 136.900474 143.130562) (xy 136.959043 143.071993) (xy 136.959042 143.071993) (xy 139.444218 140.586819) + (xy 139.505541 140.553334) (xy 139.531899 140.5505) (xy 139.678985 140.5505) (xy 139.832365 140.512696) + (xy 139.97224 140.439283) (xy 140.090483 140.33453) (xy 140.18022 140.204523) (xy 140.236237 140.056818) + (xy 140.255278 139.9) (xy 140.236237 139.743182) (xy 140.18022 139.595477) (xy 140.090483 139.46547) + (xy 139.97224 139.360717) (xy 139.972238 139.360716) (xy 139.972237 139.360715) (xy 139.832365 139.287303) + (xy 139.678986 139.2495) (xy 139.678985 139.2495) (xy 139.521015 139.2495) (xy 139.521014 139.2495) + (xy 139.367634 139.287303) (xy 139.227762 139.360715) (xy 139.109516 139.465471) (xy 139.019781 139.595475) + (xy 139.01978 139.595476) (xy 138.963763 139.743181) (xy 138.944722 139.9) (xy 138.944722 139.900001) + (xy 138.950896 139.950854) (xy 138.939435 140.019777) (xy 138.915481 140.05348) (xy 136.480782 142.488181) + (xy 136.419459 142.521666) (xy 136.393101 142.5245) (xy 129.350564 142.5245) (xy 129.255063 142.550089) + (xy 129.25506 142.55009) (xy 129.16944 142.599522) (xy 129.169435 142.599526) (xy 119.169438 152.599525) + (xy 119.099526 152.669436) (xy 119.050089 152.755063) (xy 119.050088 152.755065) (xy 119.042397 152.783772) + (xy 119.042397 152.783774) (xy 119.024699 152.849825) (xy 119.024675 152.849914) (xy 119.0245 152.850563) + (xy 118.7005 152.850563) (xy 118.7005 150.017253) (xy 118.720185 149.950214) (xy 118.736814 149.929577) + (xy 122.935703 145.730687) (xy 122.935708 145.730684) (xy 122.945911 145.72048) (xy 122.945913 145.72048) + (xy 123.02048 145.645913) (xy 123.073207 145.554587) (xy 123.078559 145.534614) (xy 123.100501 145.452727) + (xy 123.100501 145.347273) (xy 123.100501 145.339678) (xy 123.1005 145.33966) (xy 123.1005 133.860307) + (xy 123.120185 133.793268) (xy 123.166874 133.750511) (xy 123.222232 133.721456) (xy 123.22223 133.721456) + (xy 123.22224 133.721452) (xy 123.340483 133.616699) (xy 123.43022 133.486692) (xy 123.486237 133.338987) + (xy 123.505278 133.182169) (xy 123.502048 133.155563) (xy 123.486237 133.02535) (xy 123.455074 132.943181) + (xy 123.43022 132.877646) (xy 123.340483 132.747639) (xy 123.228 132.647989) (xy 123.222237 132.642883) + (xy 123.109965 132.583958) (xy 123.059752 132.535373) (xy 123.043778 132.467354) (xy 123.067114 132.401496) + (xy 123.079903 132.386488) (xy 126.319574 129.146819) (xy 126.380897 129.113334) (xy 126.407255 129.1105) + (xy 126.488985 129.1105) (xy 126.642365 129.072696) (xy 126.673157 129.056535) (xy 126.78224 128.999283) + (xy 126.900483 128.89453) (xy 126.99022 128.764523) (xy 127.046237 128.616818) (xy 127.065278 128.46) + (xy 127.058463 128.403868) (xy 127.046237 128.303181) (xy 127.015348 128.221734) (xy 126.99022 128.155477) + (xy 126.931177 128.069939) (xy 126.909295 128.003586) (xy 126.92676 127.935934) (xy 126.978028 127.888464) + (xy 127.033228 127.8755) (xy 129.889064 127.8755) (xy 129.956103 127.895185) (xy 129.976745 127.911819) + (xy 141.225491 139.160565) (xy 141.258976 139.221888) (xy 141.260905 139.233295) (xy 141.263761 139.256809) + (xy 141.263763 139.256821) (xy 141.314802 139.391397) (xy 141.31978 139.404523) (xy 141.409517 139.53453) + (xy 141.52776 139.639283) (xy 141.527762 139.639284) (xy 141.667634 139.712696) (xy 141.821014 139.7505) + (xy 141.821015 139.7505) (xy 141.978985 139.7505) (xy 142.132365 139.712696) (xy 142.27224 139.639283) + (xy 142.390483 139.53453) (xy 142.48022 139.404523) (xy 142.536237 139.256818) (xy 142.555278 139.1) + (xy 142.551021 139.064944) (xy 142.536237 138.943182) (xy 142.521672 138.904777) (xy 142.483899 138.805179) + (xy 142.478533 138.735521) (xy 142.51168 138.674014) (xy 142.572818 138.640193) (xy 142.642536 138.644794) + (xy 142.647435 138.647084) (xy 142.647553 138.6468) (xy 142.655056 138.649907) (xy 142.655063 138.649911) + (xy 142.750564 138.6755) (xy 142.750565 138.6755) (xy 143.203692 138.6755) (xy 143.270731 138.695185) + (xy 143.305742 138.729061) (xy 143.308163 138.732569) (xy 143.309515 138.734528) (xy 143.309517 138.73453) + (xy 143.42776 138.839283) (xy 143.427762 138.839284) (xy 143.567634 138.912696) (xy 143.721014 138.9505) + (xy 143.721015 138.9505) (xy 143.878985 138.9505) (xy 144.032365 138.912696) (xy 144.09605 138.879271) + (xy 144.17224 138.839283) (xy 144.290483 138.73453) (xy 144.38022 138.604523) (xy 144.436237 138.456818) + (xy 144.455278 138.3) (xy 144.443964 138.206815) (xy 144.436237 138.143181) (xy 144.409258 138.072044) + (xy 144.38022 137.995477) (xy 144.290483 137.86547) (xy 144.17224 137.760717) (xy 144.172238 137.760716) + (xy 144.172237 137.760715) (xy 144.032365 137.687303) (xy 143.878986 137.6495) (xy 143.878985 137.6495) + (xy 143.721015 137.6495) (xy 143.721014 137.6495) (xy 143.567634 137.687303) (xy 143.427762 137.760715) + (xy 143.309516 137.86547) (xy 143.307089 137.868987) (xy 143.305742 137.870938) (xy 143.251463 137.914929) + (xy 143.203692 137.9245) (xy 143.0069 137.9245) (xy 142.939861 137.904815) (xy 142.919219 137.888181) + (xy 129.630563 124.599526) (xy 129.630562 124.599525) (xy 129.544938 124.55009) (xy 129.492846 124.536132) + (xy 129.492845 124.536131) (xy 129.449436 124.5245) (xy 129.449435 124.5245) (xy 118.296308 124.5245) + (xy 118.229269 124.504815) (xy 118.194257 124.470938) (xy 118.190483 124.46547) (xy 118.07224 124.360717) + (xy 118.072238 124.360716) (xy 118.072237 124.360715) (xy 117.932365 124.287303) (xy 117.778986 124.2495) + (xy 117.778985 124.2495) (xy 117.621015 124.2495) (xy 117.621014 124.2495) (xy 117.467634 124.287303) + (xy 117.327762 124.360715) (xy 117.209516 124.465471) (xy 117.119781 124.595475) (xy 117.11978 124.595476) + (xy 117.063762 124.743181) (xy 117.044722 124.899999) (xy 117.044722 124.9) (xy 117.063762 125.056818) + (xy 117.114083 125.189501) (xy 117.11978 125.204523) (xy 117.209517 125.33453) (xy 117.32776 125.439283) + (xy 117.327762 125.439284) (xy 117.467634 125.512696) (xy 117.621014 125.5505) (xy 117.621015 125.5505) + (xy 117.778985 125.5505) (xy 117.932365 125.512696) (xy 117.960642 125.497855) (xy 118.07224 125.439283) + (xy 118.190483 125.33453) (xy 118.194257 125.329061) (xy 118.248537 125.285071) (xy 118.296308 125.2755) + (xy 129.193101 125.2755) (xy 129.26014 125.295185) (xy 129.280782 125.311819) (xy 142.247686 138.278724) + (xy 142.281171 138.340047) (xy 142.276187 138.409739) (xy 142.234315 138.465672) (xy 142.168851 138.490089) + (xy 142.130331 138.486802) (xy 141.978986 138.4495) (xy 141.978985 138.4495) (xy 141.821015 138.4495) + (xy 141.821014 138.4495) (xy 141.692752 138.481113) (xy 141.62295 138.478044) (xy 141.575397 138.448397) + (xy 130.326526 127.199526) (xy 130.326525 127.199525) (xy 130.240901 127.15009) (xy 130.193149 127.137295) + (xy 130.193147 127.137294) (xy 130.193145 127.137293) (xy 130.145399 127.1245) (xy 130.145398 127.1245) + (xy 119.006899 127.1245) (xy 118.93986 127.104815) (xy 118.919218 127.088181) (xy 118.884517 127.05348) + (xy 118.851032 126.992157) (xy 118.849102 126.950857) (xy 118.855278 126.9) (xy 118.836237 126.743182) + (xy 118.78022 126.595477) (xy 118.690483 126.46547) (xy 118.57224 126.360717) (xy 118.572238 126.360716) + (xy 118.572237 126.360715) (xy 118.432365 126.287303) (xy 118.278986 126.2495) (xy 118.278985 126.2495) + (xy 118.121015 126.2495) (xy 118.121014 126.2495) (xy 117.967634 126.287303) (xy 117.827762 126.360715) + (xy 117.709516 126.465471) (xy 117.619781 126.595475) (xy 117.61978 126.595476) (xy 117.563762 126.743181) + (xy 117.544722 126.899999) (xy 117.544722 126.9) (xy 117.563762 127.056818) (xy 117.617885 127.199526) + (xy 117.61978 127.204523) (xy 117.709517 127.33453) (xy 117.82776 127.439283) (xy 117.827762 127.439284) + (xy 117.967634 127.512696) (xy 118.121014 127.5505) (xy 118.268101 127.5505) (xy 118.33514 127.570185) + (xy 118.355782 127.586819) (xy 118.499525 127.730562) (xy 118.569438 127.800475) (xy 118.655062 127.84991) + (xy 118.667952 127.853364) (xy 118.680841 127.856818) (xy 118.680842 127.856818) (xy 118.695576 127.860765) + (xy 118.750564 127.8755) (xy 118.750565 127.8755) (xy 125.786772 127.8755) (xy 125.853811 127.895185) + (xy 125.899566 127.947989) (xy 125.90951 128.017147) (xy 125.888822 128.06994) (xy 125.829781 128.155475) + (xy 125.82978 128.155476) (xy 125.773762 128.303181) (xy 125.754722 128.459999) (xy 125.754722 128.460001) + (xy 125.760316 128.506078) (xy 125.748855 128.575002) (xy 125.724901 128.608704) (xy 124.631228 129.702377) + (xy 124.569905 129.735862) (xy 124.500213 129.730878) (xy 124.44428 129.689006) (xy 124.419863 129.623542) + (xy 124.42045 129.599755) (xy 124.425278 129.56) (xy 124.406237 129.403182) (xy 124.401501 129.390695) + (xy 124.382366 129.34024) (xy 124.35022 129.255477) (xy 124.260483 129.12547) (xy 124.14224 129.020717) + (xy 124.142238 129.020716) (xy 124.142237 129.020715) (xy 124.002365 128.947303) (xy 123.848986 128.9095) + (xy 123.848985 128.9095) (xy 123.691015 128.9095) (xy 123.691014 128.9095) (xy 123.537634 128.947303) + (xy 123.397762 129.020715) (xy 123.279516 129.125471) (xy 123.189781 129.255475) (xy 123.18978 129.255476) + (xy 123.133762 129.403181) (xy 123.114722 129.559999) (xy 123.114722 129.560002) (xy 123.117068 129.579328) + (xy 123.105606 129.648251) (xy 123.081653 129.681952) (xy 121.644066 131.119539) (xy 121.582743 131.153024) + (xy 121.513051 131.14804) (xy 121.498771 131.141659) (xy 121.452365 131.117304) (xy 121.452364 131.117303) + (xy 121.452363 131.117303) (xy 121.298985 131.0795) (xy 121.141015 131.0795) (xy 121.141014 131.0795) + (xy 120.987634 131.117303) (xy 120.847762 131.190715) (xy 120.776139 131.254167) (xy 120.735596 131.290085) + (xy 120.729516 131.295471) (xy 120.639781 131.425475) (xy 120.63978 131.425476) (xy 120.583762 131.573181) + (xy 120.564722 131.729999) (xy 120.564722 131.73) (xy 120.583762 131.886818) (xy 120.638292 132.0306) + (xy 120.63978 132.034523) (xy 120.729517 132.16453) (xy 120.84776 132.269283) (xy 120.847762 132.269284) + (xy 120.987634 132.342696) (xy 121.141014 132.3805) (xy 121.141015 132.3805) (xy 121.298985 132.3805) + (xy 121.452365 132.342696) (xy 121.478626 132.328913) (xy 121.59224 132.269283) (xy 121.710483 132.16453) + (xy 121.73577 132.127893) (xy 121.775815 132.090951) (xy 121.845913 132.05048) (xy 123.649573 130.246818) + (xy 123.710896 130.213334) (xy 123.737254 130.2105) (xy 123.823744 130.2105) (xy 123.890783 130.230185) + (xy 123.936538 130.282989) (xy 123.946482 130.352147) (xy 123.917457 130.415703) (xy 123.911425 130.422181) + (xy 121.350168 132.983437) (xy 121.288845 133.016922) (xy 121.232813 133.016153) (xy 121.188718 133.005285) + (xy 121.030748 133.005285) (xy 121.030747 133.005285) (xy 120.877367 133.043088) (xy 120.737495 133.1165) + (xy 120.619249 133.221256) (xy 120.529514 133.35126) (xy 120.529513 133.351261) (xy 120.473495 133.498966) + (xy 120.454455 133.655784) (xy 120.454455 133.655785) (xy 120.473495 133.812603) (xy 120.529513 133.960308) + (xy 120.529514 133.960309) (xy 120.61925 134.090316) (xy 120.682726 134.146549) (xy 120.719853 134.205738) + (xy 120.7245 134.239365) (xy 120.7245 145.157745) (xy 120.704815 145.224784) (xy 120.688181 145.245426) + (xy 116.979522 148.954084) (xy 116.97952 148.954087) (xy 116.926793 149.045412) (xy 116.904699 149.127868) + (xy 116.902619 149.13563) (xy 116.8995 149.14727) (xy 116.8995 178.452726) (xy 116.926793 178.554589) + (xy 116.93024 178.560559) (xy 116.97952 178.645913) (xy 116.979521 178.645914) (xy 116.979522 178.645915) + (xy 118.875179 180.541571) (xy 118.875189 180.541582) (xy 118.879519 180.545912) (xy 118.87952 180.545913) + (xy 118.954087 180.62048) (xy 118.983205 180.637291) (xy 119.045412 180.673207) (xy 119.147273 180.7005) + (xy 141.282745 180.7005) (xy 141.349784 180.720185) (xy 141.370426 180.736819) (xy 146.041426 185.407819) + (xy 146.074911 185.469142) (xy 146.069927 185.538834) (xy 146.028055 185.594767) (xy 145.962591 185.619184) + (xy 145.953745 185.6195) (xy 145.921014 185.6195) (xy 145.767634 185.657303) (xy 145.627762 185.730715) + (xy 145.509516 185.83547) (xy 145.507089 185.838987) (xy 145.505742 185.840938) (xy 145.451463 185.884929) + (xy 145.403692 185.8945) (xy 133.485563 185.8945) (xy 133.440247 185.906642) (xy 133.440247 185.906643) + (xy 133.390062 185.92009) (xy 133.390061 185.92009) (xy 133.390059 185.920091) (xy 133.304436 185.969526) + (xy 132.710282 186.563681) (xy 132.648959 186.597166) (xy 132.622601 186.6) (xy 126.5 186.6) (xy 126.5 193.3576) + (xy 126.480315 193.424639) (xy 126.463681 193.445281) (xy 116.869438 203.039525) (xy 116.799527 203.109435) + (xy 116.750089 203.195062) (xy 116.750089 203.195063) (xy 116.745192 203.213339) (xy 116.725438 203.287065) + (xy 116.725434 203.287079) (xy 116.7245 203.290559) (xy 116.7245 205.407796) (xy 116.704815 205.474835) + (xy 116.682727 205.500611) (xy 116.609518 205.565468) (xy 116.519781 205.695475) (xy 116.51978 205.695476) + (xy 116.463762 205.843181) (xy 116.444722 205.999999) (xy 116.444722 206) (xy 116.463762 206.156818) + (xy 116.498922 206.249525) (xy 116.51978 206.304523) (xy 116.609517 206.43453) (xy 116.72776 206.539283) + (xy 116.727762 206.539284) (xy 116.867634 206.612696) (xy 117.021014 206.6505) (xy 117.021015 206.6505) + (xy 117.178985 206.6505) (xy 117.332365 206.612696) (xy 117.47224 206.539283) (xy 117.590483 206.43453) + (xy 117.68022 206.304523) (xy 117.736237 206.156818) (xy 117.755278 206) (xy 117.747666 205.937304) + (xy 117.736237 205.843181) (xy 117.698312 205.743182) (xy 117.68022 205.695477) (xy 117.590483 205.56547) + (xy 117.56884 205.546296) (xy 117.517273 205.500611) (xy 117.480146 205.441422) (xy 117.4755 205.407796) + (xy 117.4755 203.546899) (xy 117.495185 203.47986) (xy 117.511819 203.459218) (xy 126.288319 194.682718) + (xy 126.349642 194.649233) (xy 126.419334 194.654217) (xy 126.475267 194.696089) (xy 126.499684 194.761553) + (xy 126.5 194.770399) (xy 126.5 201.3) (xy 126.5 201.6) (xy 137.4 201.6) (xy 137.4 199.424) (xy 137.419685 199.356961) + (xy 137.472489 199.311206) (xy 137.524 199.3) (xy 137.6355 199.3) (xy 137.702539 199.319685) (xy 137.748294 199.372489) + (xy 137.7595 199.424) (xy 137.7595 204.9881) (xy 137.739815 205.055139) (xy 137.723181 205.075781) + (xy 137.615781 205.183181) (xy 137.554458 205.216666) (xy 137.5281 205.2195) (xy 137.381014 205.2195) + (xy 137.227634 205.257303) (xy 137.087762 205.330715) (xy 136.969516 205.435471) (xy 136.879781 205.565475) + (xy 136.87978 205.565476) (xy 136.823762 205.713181) (xy 136.804722 205.869999) (xy 136.804722 205.87) + (xy 136.823762 206.026818) (xy 136.862354 206.128574) (xy 136.87978 206.174523) (xy 136.969517 206.30453) + (xy 137.08776 206.409283) (xy 137.087762 206.409284) (xy 137.227634 206.482696) (xy 137.381014 206.5205) + (xy 137.381015 206.5205) (xy 137.538985 206.5205) (xy 137.692365 206.482696) (xy 137.83224 206.409283) + (xy 137.950483 206.30453) (xy 138.04022 206.174523) (xy 138.096237 206.026818) (xy 138.115278 205.87) + (xy 138.109102 205.819144) (xy 138.120561 205.750224) (xy 138.144511 205.716524) (xy 138.435474 205.425563) + (xy 138.435763 205.425063) (xy 138.48491 205.339938) (xy 138.503777 205.269525) (xy 138.5105 205.244436) + (xy 138.5105 205.145564) (xy 138.5105 199.424) (xy 138.530185 199.356961) (xy 138.582989 199.311206) + (xy 138.6345 199.3) (xy 139 199.3) (xy 139 186.7695) (xy 139.019685 186.702461) (xy 139.072489 186.656706) + (xy 139.124 186.6455) (xy 145.403692 186.6455) (xy 145.470731 186.665185) (xy 145.505742 186.699061) + (xy 145.508089 186.702461) (xy 145.509515 186.704528) (xy 145.509517 186.70453) (xy 145.62776 186.809283) + (xy 145.627762 186.809284) (xy 145.767634 186.882696) (xy 145.921014 186.9205) (xy 145.921015 186.9205) + (xy 146.078985 186.9205) (xy 146.232365 186.882696) (xy 146.257843 186.869324) (xy 146.37224 186.809283) + (xy 146.490483 186.70453) (xy 146.58022 186.574523) (xy 146.636237 186.426818) (xy 146.651468 186.30137) + (xy 146.679089 186.237195) (xy 146.737023 186.198138) (xy 146.806876 186.196603) (xy 146.862245 186.228638) + (xy 147.863181 187.229574) (xy 147.896666 187.290897) (xy 147.8995 187.317255) (xy 147.8995 189.852726) + (xy 147.926793 189.954589) (xy 147.953156 190.00025) (xy 147.97952 190.045913) (xy 147.979521 190.045914) + (xy 147.979522 190.045915) (xy 151.275179 193.341571) (xy 151.275189 193.341582) (xy 151.354088 193.420481) + (xy 151.39975 193.446843) (xy 151.399752 193.446845) (xy 151.434421 193.466861) (xy 151.445412 193.473207) + (xy 151.547273 193.500501) (xy 151.547276 193.500501) (xy 151.660323 193.500501) (xy 151.660339 193.5005) + (xy 152.91867 193.5005) (xy 152.985709 193.520185) (xy 153.031464 193.572989) (xy 153.041408 193.642147) + (xy 153.012383 193.705703) (xy 152.976296 193.734296) (xy 152.929754 193.758723) (xy 152.811508 193.863479) + (xy 152.721773 193.993483) (xy 152.721772 193.993484) (xy 152.665754 194.141189) (xy 152.646714 194.298007) + (xy 152.646714 194.298008) (xy 152.665754 194.454826) (xy 152.708591 194.567775) (xy 152.721772 194.602531) + (xy 152.811509 194.732538) (xy 152.929752 194.837291) (xy 152.958125 194.852182) (xy 153.008338 194.900766) + (xy 153.0245 194.961979) (xy 153.0245 215.2931) (xy 153.004815 215.360139) (xy 152.988181 215.380781) + (xy 151.269437 217.099526) (xy 148.299526 220.069436) (xy 148.250091 220.155059) (xy 148.25009 220.15506) + (xy 148.242748 220.18246) (xy 148.239078 220.19616) (xy 148.238049 220.2) (xy 148.224816 220.249387) + (xy 148.224803 220.249436) (xy 148.2245 220.250564) (xy 148.2245 228.107796) (xy 148.204815 228.174835) + (xy 148.182727 228.200611) (xy 148.109518 228.265468) (xy 148.019781 228.395475) (xy 148.01978 228.395476) + (xy 147.963762 228.543181) (xy 147.944722 228.699999) (xy 147.944722 228.7) (xy 147.963763 228.856818) + (xy 147.963762 228.856818) (xy 148.01978 229.004523) (xy 148.109517 229.13453) (xy 148.22776 229.239283) + (xy 148.227762 229.239284) (xy 148.367634 229.312696) (xy 148.521014 229.3505) (xy 148.521015 229.3505) + (xy 148.678985 229.3505) (xy 148.832365 229.312696) (xy 148.877111 229.289211) (xy 148.97224 229.239283) + (xy 149.090483 229.13453) (xy 149.18022 229.004523) (xy 149.236237 228.856818) (xy 149.255278 228.7) + (xy 149.251086 228.665471) (xy 149.236237 228.543181) (xy 149.200708 228.4495) (xy 149.18022 228.395477) + (xy 149.106926 228.289292) (xy 169.0495 228.289292) (xy 169.0495 228.439107) (xy 169.078723 228.586022) + (xy 169.078725 228.58603) (xy 169.136051 228.724429) (xy 169.136056 228.724438) (xy 169.21928 228.84899) + (xy 169.219283 228.848994) (xy 169.325205 228.954916) (xy 169.325209 228.954919) (xy 169.449761 229.038143) + (xy 169.44977 229.038148) (xy 169.452513 229.039284) (xy 169.58817 229.095475) (xy 169.692696 229.116266) + (xy 169.735092 229.124699) (xy 169.735096 229.1247) (xy 169.735097 229.1247) (xy 169.884904 229.1247) + (xy 169.884905 229.124699) (xy 170.03183 229.095475) (xy 170.170232 229.038147) (xy 170.294791 228.954919) + (xy 170.400719 228.848991) (xy 170.483947 228.724432) (xy 170.541275 228.58603) (xy 170.5705 228.439103) + (xy 170.5705 228.289297) (xy 170.541275 228.14237) (xy 170.494318 228.029005) (xy 170.483948 228.00397) + (xy 170.483943 228.003961) (xy 170.400719 227.879409) (xy 170.400716 227.879405) (xy 170.294794 227.773483) + (xy 170.29479 227.77348) (xy 170.170238 227.690256) (xy 170.170229 227.690251) (xy 170.03183 227.632925) + (xy 170.031822 227.632923) (xy 169.884907 227.6037) (xy 169.884903 227.6037) (xy 169.735097 227.6037) + (xy 169.735092 227.6037) (xy 169.588177 227.632923) (xy 169.588169 227.632925) (xy 169.44977 227.690251) + (xy 169.449761 227.690256) (xy 169.325209 227.77348) (xy 169.325205 227.773483) (xy 169.219283 227.879405) + (xy 169.21928 227.879409) (xy 169.136056 228.003961) (xy 169.136051 228.00397) (xy 169.078725 228.142369) + (xy 169.078723 228.142377) (xy 169.0495 228.289292) (xy 149.106926 228.289292) (xy 149.090483 228.26547) + (xy 149.090481 228.265468) (xy 149.017273 228.200611) (xy 148.980146 228.141422) (xy 148.9755 228.107796) + (xy 148.9755 225.299999) (xy 157.844722 225.299999) (xy 157.844722 225.3) (xy 157.863762 225.456818) + (xy 157.903413 225.561367) (xy 157.91978 225.604523) (xy 158.009517 225.73453) (xy 158.12776 225.839283) + (xy 158.127762 225.839284) (xy 158.267634 225.912696) (xy 158.421014 225.9505) (xy 158.421015 225.9505) + (xy 158.578985 225.9505) (xy 158.732365 225.912696) (xy 158.795787 225.879409) (xy 158.87224 225.839283) + (xy 158.990483 225.73453) (xy 159.08022 225.604523) (xy 159.136237 225.456818) (xy 159.155278 225.3) + (xy 159.149102 225.249144) (xy 159.160561 225.180224) (xy 159.184514 225.146521) (xy 163.924217 220.406819) + (xy 163.98554 220.373334) (xy 164.011898 220.3705) (xy 164.138985 220.3705) (xy 164.292365 220.332696) + (xy 164.43224 220.259283) (xy 164.550483 220.15453) (xy 164.64022 220.024523) (xy 164.696237 219.876818) + (xy 164.715278 219.72) (xy 164.70808 219.660714) (xy 164.696237 219.563181) (xy 164.673938 219.504385) + (xy 164.64022 219.415477) (xy 164.550483 219.28547) (xy 164.43224 219.180717) (xy 164.432238 219.180716) + (xy 164.432237 219.180715) (xy 164.292365 219.107303) (xy 164.138986 219.0695) (xy 164.138985 219.0695) + (xy 163.981015 219.0695) (xy 163.981014 219.0695) (xy 163.827634 219.107303) (xy 163.687762 219.180715) + (xy 163.68776 219.180717) (xy 163.599534 219.258878) (xy 163.569516 219.285471) (xy 163.479781 219.415475) + (xy 163.47978 219.415476) (xy 163.423762 219.563181) (xy 163.404722 219.719999) (xy 163.404722 219.720002) + (xy 163.413061 219.78869) (xy 163.4016 219.857613) (xy 163.377646 219.891315) (xy 158.655781 224.613181) + (xy 158.594458 224.646666) (xy 158.5681 224.6495) (xy 158.421014 224.6495) (xy 158.267634 224.687303) + (xy 158.127762 224.760715) (xy 158.009516 224.865471) (xy 157.919781 224.995475) (xy 157.91978 224.995476) + (xy 157.863762 225.143181) (xy 157.844722 225.299999) (xy 148.9755 225.299999) (xy 148.9755 220.506899) + (xy 148.995185 220.43986) (xy 149.011819 220.419218) (xy 151.859033 217.572004) (xy 151.859045 217.57199) + (xy 153.700475 215.730563) (xy 153.749911 215.644937) (xy 153.7755 215.549436) (xy 153.7755 215.450564) + (xy 153.7755 194.79577) (xy 153.795185 194.728731) (xy 153.79745 194.72533) (xy 153.806663 194.711983) + (xy 153.882212 194.602531) (xy 153.938229 194.454826) (xy 153.938229 194.454822) (xy 153.939018 194.452743) + (xy 153.981195 194.397041) (xy 154.046793 194.372983) (xy 154.114983 194.38821) (xy 154.142641 194.409033) + (xy 154.863181 195.129573) (xy 154.896666 195.190896) (xy 154.8995 195.217254) (xy 154.8995 204.547273) + (xy 154.8995 204.652727) (xy 154.907961 204.684303) (xy 154.926793 204.754589) (xy 154.953156 204.80025) + (xy 154.97952 204.845913) (xy 154.979522 204.845915) (xy 168.463181 218.329574) (xy 168.496666 218.390897) + (xy 168.4995 218.417255) (xy 168.4995 224.152726) (xy 168.526793 224.254589) (xy 168.553156 224.30025) + (xy 168.57952 224.345913) (xy 169.162421 224.928814) (xy 169.729937 225.496329) (xy 169.761773 225.554633) + (xy 169.762208 225.554502) (xy 169.76284 225.556587) (xy 169.763422 225.557652) (xy 169.763872 225.559811) + (xy 169.763974 225.560323) (xy 169.763975 225.560328) (xy 169.763976 225.560332) (xy 169.815616 225.730566) + (xy 169.821188 225.748933) (xy 169.914086 225.922732) (xy 169.91409 225.922739) (xy 170.039116 226.075083) + (xy 170.19146 226.200109) (xy 170.191467 226.200113) (xy 170.365266 226.293011) (xy 170.365269 226.293011) + (xy 170.365273 226.293014) (xy 170.553868 226.350224) (xy 170.75 226.369541) (xy 170.946132 226.350224) + (xy 171.134727 226.293014) (xy 171.308538 226.20011) (xy 171.460883 226.075083) (xy 171.58591 225.922738) + (xy 171.678814 225.748927) (xy 171.736024 225.560332) (xy 171.755341 225.3642) (xy 171.736024 225.168068) + (xy 171.678814 224.979473) (xy 171.678811 224.979469) (xy 171.678811 224.979466) (xy 171.585913 224.805667) + (xy 171.585909 224.80566) (xy 171.460883 224.653316) (xy 171.308539 224.52829) (xy 171.308532 224.528286) + (xy 171.134733 224.435388) (xy 171.134727 224.435386) (xy 171.008997 224.397246) (xy 170.946129 224.378175) + (xy 170.75 224.358859) (xy 170.55387 224.378175) (xy 170.365266 224.435388) (xy 170.191467 224.528286) + (xy 170.19146 224.52829) (xy 170.115333 224.590767) (xy 170.051023 224.61808) (xy 169.982155 224.606289) + (xy 169.948987 224.582595) (xy 169.336819 223.970426) (xy 169.303334 223.909103) (xy 169.3005 223.882745) + (xy 169.3005 220.161897) (xy 169.320185 220.094858) (xy 169.372989 220.049103) (xy 169.442147 220.039159) + (xy 169.47195 220.047335) (xy 169.58817 220.095475) (xy 169.721518 220.121999) (xy 169.735092 220.124699) + (xy 169.735096 220.1247) (xy 169.735097 220.1247) (xy 169.884904 220.1247) (xy 169.884905 220.124699) + (xy 170.03183 220.095475) (xy 170.170232 220.038147) (xy 170.192193 220.023472) (xy 170.206609 220.013841) + (xy 170.273286 219.992963) (xy 170.340666 220.011447) (xy 170.387357 220.063426) (xy 170.3995 220.116943) + (xy 170.3995 221.342768) (xy 170.379815 221.409807) (xy 170.333953 221.452126) (xy 170.191467 221.528286) + (xy 170.19146 221.52829) (xy 170.039116 221.653316) (xy 169.91409 221.80566) (xy 169.914086 221.805667) + (xy 169.821188 221.979466) (xy 169.763975 222.16807) (xy 169.744659 222.3642) (xy 169.763975 222.560329) + (xy 169.821188 222.748933) (xy 169.914086 222.922732) (xy 169.91409 222.922739) (xy 170.039116 223.075083) + (xy 170.19146 223.200109) (xy 170.191467 223.200113) (xy 170.365266 223.293011) (xy 170.365269 223.293011) + (xy 170.365273 223.293014) (xy 170.553868 223.350224) (xy 170.75 223.369541) (xy 170.946132 223.350224) + (xy 171.134727 223.293014) (xy 171.139779 223.290314) (xy 171.308532 223.200113) (xy 171.308538 223.20011) + (xy 171.396835 223.127645) (xy 171.461144 223.100333) (xy 171.530012 223.112124) (xy 171.581572 223.159276) + (xy 171.5995 223.223499) (xy 171.5995 223.666926) (xy 171.626793 223.768789) (xy 171.647047 223.803868) + (xy 171.67952 223.860113) (xy 172.237946 224.418539) (xy 172.763439 224.944031) (xy 172.796924 225.005354) + (xy 172.794419 225.067706) (xy 172.763976 225.168067) (xy 172.744659 225.3642) (xy 172.763975 225.560329) + (xy 172.821188 225.748933) (xy 172.914086 225.922732) (xy 172.91409 225.922739) (xy 173.039116 226.075083) + (xy 173.19146 226.200109) (xy 173.191467 226.200113) (xy 173.365266 226.293011) (xy 173.365269 226.293011) + (xy 173.365273 226.293014) (xy 173.553868 226.350224) (xy 173.75 226.369541) (xy 173.946132 226.350224) + (xy 174.134727 226.293014) (xy 174.308538 226.20011) (xy 174.460883 226.075083) (xy 174.58591 225.922738) + (xy 174.678814 225.748927) (xy 174.736024 225.560332) (xy 174.755341 225.3642) (xy 174.736024 225.168068) + (xy 174.678814 224.979473) (xy 174.678811 224.979469) (xy 174.678811 224.979466) (xy 174.585913 224.805667) + (xy 174.585909 224.80566) (xy 174.460883 224.653316) (xy 174.308539 224.52829) (xy 174.308532 224.528286) + (xy 174.134733 224.435388) (xy 174.134727 224.435386) (xy 174.008997 224.397246) (xy 173.946129 224.378175) + (xy 173.75 224.358859) (xy 173.553867 224.378176) (xy 173.453506 224.408619) (xy 173.383639 224.409242) + (xy 173.329831 224.377639) (xy 172.886299 223.934107) (xy 172.436819 223.484626) (xy 172.403334 223.423303) + (xy 172.4005 223.396945) (xy 172.4005 219.362729) (xy 172.400501 219.362716) (xy 172.400501 219.247274) + (xy 172.382666 219.180715) (xy 172.373207 219.145413) (xy 172.351205 219.107304) (xy 172.32048 219.054087) + (xy 172.245913 218.97952) (xy 172.245912 218.979519) (xy 172.241582 218.975189) (xy 172.241571 218.975179) + (xy 167.845915 214.579522) (xy 167.845914 214.579521) (xy 167.845913 214.57952) (xy 167.80025 214.553156) + (xy 167.754589 214.526793) (xy 167.703657 214.513146) (xy 167.652727 214.4995) (xy 167.652726 214.4995) + (xy 167.517255 214.4995) (xy 167.450216 214.479815) (xy 167.429574 214.463181) (xy 156.736819 203.770426) + (xy 156.703334 203.709103) (xy 156.7005 203.682745) (xy 156.7005 195.013465) (xy 156.720185 194.946426) + (xy 156.772989 194.900671) (xy 156.842147 194.890727) (xy 156.905703 194.919752) (xy 156.906667 194.920596) + (xy 156.908404 194.922135) (xy 156.927762 194.939285) (xy 157.067634 195.012696) (xy 157.221014 195.0505) + (xy 157.221015 195.0505) (xy 157.378985 195.0505) (xy 157.532365 195.012696) (xy 157.67224 194.939283) + (xy 157.790483 194.83453) (xy 157.88022 194.704523) (xy 157.921722 194.59509) (xy 157.963899 194.539389) + (xy 158.029496 194.515332) (xy 158.097686 194.530559) (xy 158.125344 194.551382) (xy 162.274437 198.700475) + (xy 162.295605 198.712696) (xy 162.360062 198.74991) (xy 162.360066 198.749911) (xy 162.407811 198.762705) + (xy 162.407812 198.762705) (xy 162.417903 198.765408) (xy 162.455564 198.7755) (xy 162.455565 198.7755) + (xy 164.6005 198.7755) (xy 164.667539 198.795185) (xy 164.713294 198.847989) (xy 164.7245 198.8995) + (xy 164.7245 209.448104) (xy 164.704815 209.515143) (xy 164.658131 209.557898) (xy 164.652761 209.560716) + (xy 164.65276 209.560717) (xy 164.534516 209.665471) (xy 164.444781 209.795475) (xy 164.44478 209.795476) + (xy 164.388762 209.943181) (xy 164.369722 210.099999) (xy 164.369722 210.1) (xy 164.388762 210.256818) + (xy 164.432038 210.370926) (xy 164.44478 210.404523) (xy 164.534517 210.53453) (xy 164.65276 210.639283) + (xy 164.652762 210.639284) (xy 164.792634 210.712696) (xy 164.946014 210.7505) (xy 164.946015 210.7505) + (xy 165.103985 210.7505) (xy 165.257365 210.712696) (xy 165.318171 210.680782) (xy 165.39724 210.639283) + (xy 165.515483 210.53453) (xy 165.59845 210.41433) (xy 165.652733 210.370341) (xy 165.722181 210.362681) + (xy 165.784746 210.393784) (xy 165.820564 210.453775) (xy 165.8245 210.484771) (xy 165.8245 210.849435) + (xy 165.85009 210.944938) (xy 165.850091 210.944939) (xy 165.850091 210.94494) (xy 165.899526 211.030563) + (xy 166.746618 211.877655) (xy 166.780103 211.938978) (xy 166.775119 212.00867) (xy 166.760988 212.035774) + (xy 166.719782 212.095472) (xy 166.71978 212.095476) (xy 166.663762 212.243181) (xy 166.644722 212.399999) + (xy 166.644722 212.4) (xy 166.663762 212.556818) (xy 166.71978 212.704523) (xy 166.809517 212.83453) + (xy 166.92776 212.939283) (xy 166.927762 212.939284) (xy 167.067634 213.012696) (xy 167.221014 213.0505) + (xy 167.221015 213.0505) (xy 167.378985 213.0505) (xy 167.532365 213.012696) (xy 167.594061 212.980315) + (xy 167.67224 212.939283) (xy 167.790483 212.83453) (xy 167.88022 212.704523) (xy 167.936237 212.556818) + (xy 167.955278 212.4) (xy 167.936237 212.243182) (xy 167.88022 212.095477) (xy 167.790483 211.96547) (xy 167.777271 211.953765) (xy 167.707981 211.892379) (xy 167.670854 211.83319) (xy 167.670457 211.831747) (xy 167.64991 211.755062) (xy 167.600475 211.669438) (xy 167.530562 211.599525) (xy 166.611819 210.680782) (xy 166.578334 210.619459) (xy 166.5755 210.593101) (xy 166.5755 188.537054) (xy 166.595185 188.470015) (xy 166.647989 188.42426) (xy 166.717147 188.414316) (xy 166.780703 188.443341) (xy 166.815441 188.493082) - (xy 166.81978 188.504523) (xy 166.819781 188.504525) (xy 166.858462 188.560564) (xy 166.909517 188.63453) + (xy 166.81978 188.504523) (xy 166.819781 188.504525) (xy 166.820604 188.505717) (xy 166.909517 188.63453) (xy 167.02776 188.739283) (xy 167.027762 188.739284) (xy 167.167634 188.812696) (xy 167.321014 188.8505) (xy 167.468101 188.8505) (xy 167.53514 188.870185) (xy 167.555782 188.886819) (xy 168.334198 189.665235) (xy 168.367683 189.726558) (xy 168.370517 189.752916) (xy 168.370517 212.50053) (xy 168.350832 212.567569) @@ -176737,7 +181641,7 @@ (xy 170.845191 210.2205) (xy 170.845192 210.2205) (xy 171.082297 210.180934) (xy 171.309656 210.102882) (xy 171.521067 209.988472) (xy 171.545525 209.969436) (xy 171.635346 209.899525) (xy 171.710764 209.840825) (xy 171.873571 209.663969) (xy 172.005049 209.462728) (xy 172.10161 209.242591) (xy 172.16062 209.009563) - (xy 172.173004 208.860112) (xy 172.180471 208.770005) (xy 172.180471 208.769994) (xy 172.669529 208.769994) + (xy 172.169442 208.90309) (xy 172.180471 208.770005) (xy 172.180471 208.769994) (xy 172.669529 208.769994) (xy 172.669529 208.770005) (xy 172.689379 209.009559) (xy 172.748389 209.242589) (xy 172.844951 209.462729) (xy 172.932424 209.596615) (xy 172.976429 209.663969) (xy 173.139236 209.840825) (xy 173.139239 209.840827) (xy 173.139242 209.84083) (xy 173.328924 209.988466) (xy 173.32893 209.98847) (xy 173.328933 209.988472) @@ -176746,7 +181650,7 @@ (xy 174.004809 210.2205) (xy 174.245191 210.2205) (xy 174.245192 210.2205) (xy 174.482297 210.180934) (xy 174.709656 210.102882) (xy 174.921067 209.988472) (xy 174.945525 209.969436) (xy 175.035346 209.899525) (xy 175.110764 209.840825) (xy 175.273571 209.663969) (xy 175.405049 209.462728) (xy 175.50161 209.242591) - (xy 175.56062 209.009563) (xy 175.573004 208.860112) (xy 175.580471 208.770005) (xy 175.580471 208.769994) + (xy 175.56062 209.009563) (xy 175.569442 208.90309) (xy 175.580471 208.770005) (xy 175.580471 208.769994) (xy 175.56062 208.53044) (xy 175.56062 208.530437) (xy 175.50161 208.297409) (xy 175.405049 208.077272) (xy 175.371571 208.026031) (xy 175.306236 207.926029) (xy 175.273571 207.876031) (xy 175.110764 207.699175) (xy 175.110759 207.699171) (xy 175.110757 207.699169) (xy 174.921075 207.551533) (xy 174.921069 207.551529) @@ -176781,7 +181685,7 @@ (xy 175.110764 196.370825) (xy 175.273571 196.193969) (xy 175.405049 195.992728) (xy 175.50161 195.772591) (xy 175.56062 195.539563) (xy 175.575425 195.3609) (xy 175.580471 195.300005) (xy 175.580471 195.299994) (xy 175.56062 195.06044) (xy 175.56062 195.060437) (xy 175.50161 194.827409) (xy 175.405049 194.607272) - (xy 175.372747 194.557831) (xy 175.305774 194.455321) (xy 175.273571 194.406031) (xy 175.110764 194.229175) + (xy 175.397091 194.595092) (xy 175.305774 194.455321) (xy 175.273571 194.406031) (xy 175.110764 194.229175) (xy 175.110759 194.229171) (xy 175.110757 194.229169) (xy 174.921075 194.081533) (xy 174.921069 194.081529) (xy 174.709657 193.967118) (xy 174.709652 193.967116) (xy 174.4823 193.889066) (xy 174.304468 193.859391) (xy 174.245192 193.8495) (xy 174.004808 193.8495) (xy 173.957387 193.857413) (xy 173.767699 193.889066) @@ -176790,7 +181694,7 @@ (xy 173.103294 194.268217) (xy 172.97643 194.406029) (xy 172.976427 194.406033) (xy 172.844951 194.60727) (xy 172.748389 194.82741) (xy 172.689379 195.06044) (xy 172.669529 195.299994) (xy 172.1755 195.299994) (xy 172.1755 194.075326) (xy 172.1755 194.075323) (xy 172.175499 194.075321) (xy 172.160967 194.002264) - (xy 172.160966 194.00226) (xy 172.137134 193.966593) (xy 172.105601 193.919399) (xy 172.050235 193.882405) + (xy 172.160966 194.00226) (xy 172.131321 193.957893) (xy 172.105601 193.919399) (xy 172.050235 193.882405) (xy 172.022739 193.864033) (xy 172.022735 193.864032) (xy 171.949677 193.8495) (xy 171.949674 193.8495) (xy 169.500326 193.8495) (xy 169.500323 193.8495) (xy 169.427264 193.864032) (xy 169.42726 193.864033) (xy 169.344396 193.919401) (xy 169.335763 193.928035) (xy 169.333472 193.925744) (xy 169.294996 193.957893) @@ -176819,632 +181723,649 @@ (xy 188.592235 195.895092) (xy 188.652004 195.931278) (xy 188.682721 195.994034) (xy 188.6845 196.014962) (xy 188.6845 197.507796) (xy 188.664815 197.574835) (xy 188.642727 197.600611) (xy 188.569518 197.665468) (xy 188.479781 197.795475) (xy 188.47978 197.795476) (xy 188.423762 197.943181) (xy 188.404722 198.099999) - (xy 188.404722 198.1) (xy 188.423762 198.256818) (xy 188.459316 198.350565) (xy 188.47978 198.404523) + (xy 188.404722 198.1) (xy 188.423762 198.256818) (xy 188.459316 198.350564) (xy 188.47978 198.404523) (xy 188.569517 198.53453) (xy 188.68776 198.639283) (xy 188.687762 198.639284) (xy 188.827634 198.712696) (xy 188.981014 198.7505) (xy 188.981015 198.7505) (xy 189.138985 198.7505) (xy 189.292365 198.712696) - (xy 189.43224 198.639283) (xy 189.550483 198.53453) (xy 189.64022 198.404523) (xy 189.696237 198.256818) - (xy 189.715278 198.1) (xy 189.705776 198.021739) (xy 189.696237 197.943181) (xy 189.660772 197.849669) - (xy 189.64022 197.795477) (xy 189.550483 197.66547) (xy 189.550481 197.665468) (xy 189.477273 197.600611) - (xy 189.440146 197.541422) (xy 189.4355 197.507796) (xy 189.4355 196.3545) (xy 189.455185 196.287461) - (xy 189.507989 196.241706) (xy 189.5595 196.2305) (xy 191.024676 196.2305) (xy 191.024677 196.230499) - (xy 191.09774 196.215966) (xy 191.180601 196.160601) (xy 191.235966 196.07774) (xy 191.2505 196.004674) - (xy 191.2505 194.455326) (xy 191.2505 194.455323) (xy 191.250499 194.455321) (xy 191.235967 194.382264) - (xy 191.235966 194.38226) (xy 191.229767 194.372983) (xy 191.180601 194.299399) (xy 191.09774 194.244034) - (xy 191.097739 194.244033) (xy 191.097735 194.244032) (xy 191.024677 194.2295) (xy 191.024674 194.2295) - (xy 189.5595 194.2295) (xy 189.492461 194.209815) (xy 189.446706 194.157011) (xy 189.4355 194.1055) - (xy 189.4355 192.111227) (xy 189.455185 192.044188) (xy 189.507989 191.998433) (xy 189.577147 191.988489) - (xy 189.640703 192.017514) (xy 189.66527 192.048521) (xy 189.665519 192.04835) (xy 189.668118 192.052116) - (xy 189.669299 192.053606) (xy 189.669778 192.054519) (xy 189.66978 192.054523) (xy 189.759517 192.18453) - (xy 189.87776 192.289283) (xy 189.877762 192.289284) (xy 190.017634 192.362696) (xy 190.171014 192.4005) - (xy 190.171015 192.4005) (xy 190.328985 192.4005) (xy 190.482365 192.362696) (xy 190.62224 192.289283) - (xy 190.740483 192.18453) (xy 190.83022 192.054523) (xy 190.886237 191.906818) (xy 190.905278 191.75) - (xy 190.886237 191.593182) (xy 190.881769 191.581402) (xy 190.856018 191.513502) (xy 190.83022 191.445477) - (xy 190.740483 191.31547) (xy 190.740481 191.315468) (xy 190.667273 191.250611) (xy 190.630146 191.191422) - (xy 190.6255 191.157796) (xy 190.6255 180.060882) (xy 190.645185 179.993843) (xy 190.661814 179.973206) - (xy 191.984001 178.651018) (xy 192.045322 178.617535) (xy 192.115014 178.622519) (xy 192.170947 178.664391) - (xy 192.187622 178.694729) (xy 192.219781 178.779525) (xy 192.24033 178.809295) (xy 192.309517 178.90953) - (xy 192.42776 179.014283) (xy 192.427762 179.014284) (xy 192.567634 179.087696) (xy 192.721014 179.1255) - (xy 192.721015 179.1255) (xy 192.878984 179.1255) (xy 192.878985 179.1255) (xy 192.903724 179.119402) - (xy 192.973526 179.122471) (xy 193.021081 179.152118) (xy 200.188181 186.319218) (xy 200.221666 186.380541) - (xy 200.2245 186.406899) (xy 200.2245 213.950565) (xy 200.2245 225.549435) (xy 200.25009 225.644938) - (xy 200.250091 225.644939) (xy 200.250091 225.64494) (xy 200.250401 225.645477) (xy 200.293102 225.719437) - (xy 200.299526 225.730563) (xy 200.299528 225.730566) (xy 202.415481 227.846518) (xy 202.448966 227.907841) - (xy 202.450896 227.949143) (xy 202.444722 227.999997) (xy 202.444722 228) (xy 202.463762 228.156818) - (xy 202.515448 228.293101) (xy 202.51978 228.304523) (xy 202.609517 228.43453) (xy 202.72776 228.539283) - (xy 202.727762 228.539284) (xy 202.867634 228.612696) (xy 203.021014 228.6505) (xy 203.021015 228.6505) - (xy 203.178985 228.6505) (xy 203.332365 228.612696) (xy 203.383187 228.586022) (xy 203.47224 228.539283) - (xy 203.590483 228.43453) (xy 203.68022 228.304523) (xy 203.736237 228.156818) (xy 203.755278 228) - (xy 203.740308 227.876705) (xy 203.736237 227.843181) (xy 203.709803 227.773481) (xy 203.68022 227.695477) - (xy 203.590483 227.56547) (xy 203.47224 227.460717) (xy 203.472238 227.460716) (xy 203.472237 227.460715) - (xy 203.332365 227.387303) (xy 203.178986 227.3495) (xy 203.178985 227.3495) (xy 203.031899 227.3495) - (xy 202.96486 227.329815) (xy 202.944218 227.313181) (xy 201.011819 225.380782) (xy 200.978334 225.319459) - (xy 200.9755 225.293101) (xy 200.9755 186.150566) (xy 200.9755 186.150565) (xy 200.9755 186.150564) - (xy 200.949911 186.055063) (xy 200.906145 185.979258) (xy 200.900477 185.96944) (xy 200.900473 185.969435) - (xy 193.491597 178.560559) (xy 193.458112 178.499236) (xy 193.456305 178.482432) (xy 193.456182 178.482447) - (xy 193.455278 178.475) (xy 193.448253 178.417146) (xy 193.459713 178.348226) (xy 193.506617 178.296439) - (xy 193.574072 178.278232) (xy 193.628975 178.292406) (xy 193.667634 178.312696) (xy 193.821014 178.3505) - (xy 193.968101 178.3505) (xy 194.03514 178.370185) (xy 194.055782 178.386819) (xy 201.688181 186.019218) - (xy 201.721666 186.080541) (xy 201.7245 186.106899) (xy 201.7245 209.501111) (xy 201.75009 209.596614) - (xy 201.799525 209.682238) (xy 201.799526 209.682239) (xy 217.847849 225.730562) (xy 217.917762 225.800475) - (xy 217.962501 225.826305) (xy 218.010716 225.876871) (xy 218.0245 225.933691) (xy 218.0245 227.249435) - (xy 218.05009 227.344938) (xy 218.050091 227.344939) (xy 218.050091 227.34494) (xy 218.057344 227.357503) - (xy 218.074549 227.387303) (xy 218.099526 227.430563) (xy 219.915481 229.246518) (xy 219.948966 229.307841) - (xy 219.950896 229.349143) (xy 219.944722 229.399997) (xy 219.944722 229.4) (xy 219.963762 229.556818) - (xy 220.008618 229.675092) (xy 220.01978 229.704523) (xy 220.109517 229.83453) (xy 220.22776 229.939283) - (xy 220.227762 229.939284) (xy 220.367634 230.012696) (xy 220.521014 230.0505) (xy 220.521015 230.0505) - (xy 220.678985 230.0505) (xy 220.830332 230.013197) (xy 220.900133 230.016266) (xy 220.957196 230.056586) - (xy 220.983401 230.121356) (xy 220.970429 230.190011) (xy 220.947688 230.221274) (xy 220.78078 230.388182) - (xy 220.719459 230.421666) (xy 220.693101 230.4245) (xy 215.596308 230.4245) (xy 215.529269 230.404815) - (xy 215.494257 230.370938) (xy 215.490483 230.36547) (xy 215.37224 230.260717) (xy 215.372238 230.260716) - (xy 215.372237 230.260715) (xy 215.232365 230.187303) (xy 215.078986 230.1495) (xy 215.078985 230.1495) - (xy 214.921015 230.1495) (xy 214.921014 230.1495) (xy 214.767634 230.187303) (xy 214.627762 230.260715) - (xy 214.509516 230.365471) (xy 214.419781 230.495475) (xy 214.41978 230.495476) (xy 214.363762 230.643181) - (xy 214.344722 230.799999) (xy 214.344722 230.8) (xy 214.363762 230.956818) (xy 214.4168 231.096666) - (xy 214.41978 231.104523) (xy 214.451107 231.149908) (xy 214.509516 231.234529) (xy 214.592092 231.307684) - (xy 214.629219 231.366874) (xy 214.628451 231.436739) (xy 214.590034 231.495099) (xy 214.526163 231.523424) - (xy 214.509865 231.5245) (xy 206.106899 231.5245) (xy 206.03986 231.504815) (xy 206.019218 231.488181) - (xy 205.484517 230.95348) (xy 205.451032 230.892157) (xy 205.449102 230.850857) (xy 205.455278 230.8) - (xy 205.436237 230.643182) (xy 205.38022 230.495477) (xy 205.290483 230.36547) (xy 205.17224 230.260717) - (xy 205.172238 230.260716) (xy 205.172237 230.260715) (xy 205.032365 230.187303) (xy 204.878986 230.1495) - (xy 204.878985 230.1495) (xy 204.721015 230.1495) (xy 204.721014 230.1495) (xy 204.567634 230.187303) - (xy 204.427762 230.260715) (xy 204.309516 230.365471) (xy 204.219781 230.495475) (xy 204.21978 230.495476) - (xy 204.163762 230.643181) (xy 204.144722 230.799999) (xy 204.144722 230.8) (xy 204.163762 230.956818) - (xy 204.2168 231.096666) (xy 204.21978 231.104523) (xy 204.309517 231.23453) (xy 204.42776 231.339283) - (xy 204.427762 231.339284) (xy 204.567634 231.412696) (xy 204.721014 231.4505) (xy 204.868101 231.4505) - (xy 204.93514 231.470185) (xy 204.955782 231.486819) (xy 205.599525 232.130562) (xy 205.669438 232.200475) - (xy 205.741126 232.241864) (xy 205.755062 232.24991) (xy 205.802811 232.262705) (xy 205.802812 232.262705) - (xy 205.812903 232.265408) (xy 205.850564 232.2755) (xy 205.850565 232.2755) (xy 205.850566 232.2755) - (xy 243.849435 232.2755) (xy 243.849436 232.2755) (xy 243.897186 232.262705) (xy 243.944938 232.24991) - (xy 244.030562 232.200475) (xy 244.100475 232.130562) (xy 246.444217 229.786818) (xy 246.50554 229.753334) - (xy 246.531898 229.7505) (xy 246.678985 229.7505) (xy 246.832365 229.712696) (xy 246.847937 229.704523) - (xy 246.97224 229.639283) (xy 247.090483 229.53453) (xy 247.18022 229.404523) (xy 247.236237 229.256818) - (xy 247.255278 229.1) (xy 247.255221 229.099526) (xy 247.236237 228.943181) (xy 247.204961 228.860715) - (xy 247.18022 228.795477) (xy 247.090483 228.66547) (xy 246.97224 228.560717) (xy 246.972238 228.560716) - (xy 246.972237 228.560715) (xy 246.832365 228.487303) (xy 246.678986 228.4495) (xy 246.678985 228.4495) - (xy 246.521015 228.4495) (xy 246.521014 228.4495) (xy 246.367635 228.487303) (xy 246.325618 228.509356) - (xy 246.25711 228.52308) (xy 246.192057 228.497588) (xy 246.151113 228.440972) (xy 246.144897 228.414505) - (xy 246.136237 228.343182) (xy 246.08022 228.195477) (xy 245.990483 228.06547) (xy 245.87224 227.960717) - (xy 245.872238 227.960716) (xy 245.872237 227.960715) (xy 245.732365 227.887303) (xy 245.578986 227.8495) - (xy 245.578985 227.8495) (xy 245.421015 227.8495) (xy 245.421014 227.8495) (xy 245.267634 227.887303) - (xy 245.127762 227.960715) (xy 245.009516 228.06547) (xy 245.007089 228.068987) (xy 245.005742 228.070938) - (xy 244.951463 228.114929) (xy 244.903692 228.1245) (xy 243.676899 228.1245) (xy 243.60986 228.104815) - (xy 243.589218 228.088181) (xy 243.213218 227.712181) (xy 243.179733 227.650858) (xy 243.184717 227.581166) - (xy 243.226589 227.525233) (xy 243.292053 227.500816) (xy 243.300899 227.5005) (xy 244.394676 227.5005) - (xy 244.394677 227.500499) (xy 244.46774 227.485966) (xy 244.550601 227.430601) (xy 244.605966 227.34774) - (xy 244.6205 227.274674) (xy 244.6205 226.410186) (xy 267.1745 226.410186) (xy 267.1745 226.679813) - (xy 267.204686 226.947719) (xy 267.204688 226.947731) (xy 267.264684 227.210594) (xy 267.264687 227.210602) - (xy 267.353734 227.465082) (xy 267.470714 227.707994) (xy 267.511864 227.773483) (xy 267.614162 227.936289) - (xy 267.782266 228.147085) (xy 267.972915 228.337734) (xy 268.183711 228.505838) (xy 268.405088 228.644939) - (xy 268.412005 228.649285) (xy 268.424529 228.655316) (xy 268.654921 228.766267) (xy 268.846049 228.833145) - (xy 268.909397 228.855312) (xy 268.909405 228.855315) (xy 268.909408 228.855315) (xy 268.909409 228.855316) - (xy 269.172268 228.915312) (xy 269.440187 228.945499) (xy 269.440188 228.9455) (xy 269.440191 228.9455) - (xy 269.709812 228.9455) (xy 269.709812 228.945499) (xy 269.977732 228.915312) (xy 270.240591 228.855316) - (xy 270.495079 228.766267) (xy 270.737997 228.649284) (xy 270.966289 228.505838) (xy 271.177085 228.337734) - (xy 271.367734 228.147085) (xy 271.535838 227.936289) (xy 271.679284 227.707997) (xy 271.796267 227.465079) - (xy 271.885316 227.210591) (xy 271.945312 226.947732) (xy 271.9755 226.679809) (xy 271.9755 226.410191) - (xy 271.945312 226.142268) (xy 271.885316 225.879409) (xy 271.796267 225.624921) (xy 271.679284 225.382003) - (xy 271.535838 225.153711) (xy 271.367734 224.942915) (xy 271.177085 224.752266) (xy 270.966289 224.584162) - (xy 270.737997 224.440716) (xy 270.737994 224.440714) (xy 270.495082 224.323734) (xy 270.240602 224.234687) - (xy 270.240594 224.234684) (xy 270.043446 224.189687) (xy 269.977732 224.174688) (xy 269.977728 224.174687) - (xy 269.977719 224.174686) (xy 269.709813 224.1445) (xy 269.709809 224.1445) (xy 269.440191 224.1445) - (xy 269.440186 224.1445) (xy 269.17228 224.174686) (xy 269.172268 224.174688) (xy 268.909405 224.234684) - (xy 268.909397 224.234687) (xy 268.654917 224.323734) (xy 268.412005 224.440714) (xy 268.183712 224.584161) - (xy 267.972915 224.752265) (xy 267.782265 224.942915) (xy 267.614161 225.153712) (xy 267.470714 225.382005) - (xy 267.353734 225.624917) (xy 267.264687 225.879397) (xy 267.264684 225.879405) (xy 267.204688 226.142268) - (xy 267.204686 226.14228) (xy 267.1745 226.410186) (xy 244.6205 226.410186) (xy 244.6205 225.725326) - (xy 244.6205 225.725323) (xy 244.620499 225.725321) (xy 244.605967 225.652264) (xy 244.605966 225.65226) - (xy 244.57407 225.604524) (xy 244.550601 225.569399) (xy 244.469891 225.515471) (xy 244.467739 225.514033) - (xy 244.467735 225.514032) (xy 244.394677 225.4995) (xy 244.394674 225.4995) (xy 242.845326 225.4995) - (xy 242.845323 225.4995) (xy 242.772264 225.514032) (xy 242.77226 225.514033) (xy 242.689399 225.569399) - (xy 242.634033 225.65226) (xy 242.634032 225.652264) (xy 242.6195 225.725321) (xy 242.6195 226.819101) - (xy 242.599815 226.88614) (xy 242.547011 226.931895) (xy 242.477853 226.941839) (xy 242.414297 226.912814) - (xy 242.407819 226.906782) (xy 241.123727 225.62269) (xy 241.090242 225.561367) (xy 241.095226 225.491675) - (xy 241.137098 225.435742) (xy 241.153772 225.425217) (xy 241.22224 225.389283) (xy 241.340483 225.28453) - (xy 241.43022 225.154523) (xy 241.486237 225.006818) (xy 241.505278 224.85) (xy 241.499895 224.805662) - (xy 241.486237 224.693181) (xy 241.439855 224.570883) (xy 241.43022 224.545477) (xy 241.340483 224.41547) - (xy 241.22224 224.310717) (xy 241.222238 224.310716) (xy 241.222237 224.310715) (xy 241.082365 224.237303) - (xy 240.928986 224.1995) (xy 240.928985 224.1995) (xy 240.7819 224.1995) (xy 240.714861 224.179815) - (xy 240.694219 224.163181) (xy 240.531038 224) (xy 242.614659 224) (xy 242.633975 224.196129) (xy 242.633976 224.196132) - (xy 242.689198 224.378175) (xy 242.691188 224.384733) (xy 242.784086 224.558532) (xy 242.78409 224.558539) - (xy 242.909116 224.710883) (xy 243.06146 224.835909) (xy 243.061467 224.835913) (xy 243.235266 224.928811) - (xy 243.235269 224.928811) (xy 243.235273 224.928814) (xy 243.423868 224.986024) (xy 243.62 225.005341) - (xy 243.816132 224.986024) (xy 244.004727 224.928814) (xy 244.178538 224.83591) (xy 244.330883 224.710883) - (xy 244.45591 224.558538) (xy 244.524511 224.430194) (xy 244.548811 224.384733) (xy 244.548811 224.384732) - (xy 244.548814 224.384727) (xy 244.606024 224.196132) (xy 244.625341 224) (xy 244.606024 223.803868) - (xy 244.548814 223.615273) (xy 244.548811 223.615269) (xy 244.548811 223.615266) (xy 244.455913 223.441467) - (xy 244.455909 223.44146) (xy 244.330883 223.289116) (xy 244.178539 223.16409) (xy 244.178532 223.164086) - (xy 244.004733 223.071188) (xy 244.004727 223.071186) (xy 243.816132 223.013976) (xy 243.816129 223.013975) - (xy 243.62 222.994659) (xy 243.42387 223.013975) (xy 243.235266 223.071188) (xy 243.061467 223.164086) - (xy 243.06146 223.16409) (xy 242.909116 223.289116) (xy 242.78409 223.44146) (xy 242.784086 223.441467) - (xy 242.691188 223.615266) (xy 242.633975 223.80387) (xy 242.614659 224) (xy 240.531038 224) (xy 235.611819 219.080781) - (xy 235.578334 219.019458) (xy 235.5755 218.9931) (xy 235.5755 208.819994) (xy 235.869529 208.819994) - (xy 235.869529 208.820005) (xy 235.889379 209.059559) (xy 235.948389 209.292589) (xy 236.044951 209.512729) - (xy 236.144744 209.665472) (xy 236.176429 209.713969) (xy 236.339236 209.890825) (xy 236.339239 209.890827) - (xy 236.339242 209.89083) (xy 236.528924 210.038466) (xy 236.52893 210.03847) (xy 236.528933 210.038472) - (xy 236.647952 210.102882) (xy 236.736062 210.150565) (xy 236.740344 210.152882) (xy 236.757208 210.158671) - (xy 236.967699 210.230933) (xy 236.967701 210.230933) (xy 236.967703 210.230934) (xy 237.204808 210.2705) - (xy 237.204809 210.2705) (xy 237.445191 210.2705) (xy 237.445192 210.2705) (xy 237.682297 210.230934) - (xy 237.909656 210.152882) (xy 238.121067 210.038472) (xy 238.138988 210.024524) (xy 238.209762 209.969438) - (xy 238.310764 209.890825) (xy 238.473571 209.713969) (xy 238.605049 209.512728) (xy 238.70161 209.292591) - (xy 238.76062 209.059563) (xy 238.780471 208.82) (xy 238.780471 208.819994) (xy 239.269529 208.819994) - (xy 239.269529 208.820005) (xy 239.289379 209.059559) (xy 239.348389 209.292589) (xy 239.444951 209.512729) - (xy 239.544744 209.665472) (xy 239.576429 209.713969) (xy 239.739236 209.890825) (xy 239.739239 209.890827) - (xy 239.739242 209.89083) (xy 239.928924 210.038466) (xy 239.92893 210.03847) (xy 239.928933 210.038472) - (xy 240.047952 210.102882) (xy 240.136062 210.150565) (xy 240.140344 210.152882) (xy 240.157208 210.158671) - (xy 240.367699 210.230933) (xy 240.367701 210.230933) (xy 240.367703 210.230934) (xy 240.604808 210.2705) - (xy 240.604809 210.2705) (xy 240.845191 210.2705) (xy 240.845192 210.2705) (xy 241.082297 210.230934) - (xy 241.309656 210.152882) (xy 241.521067 210.038472) (xy 241.538988 210.024524) (xy 241.609762 209.969438) - (xy 241.710764 209.890825) (xy 241.873571 209.713969) (xy 242.005049 209.512728) (xy 242.10161 209.292591) - (xy 242.16062 209.059563) (xy 242.180471 208.82) (xy 242.180471 208.819994) (xy 245.059529 208.819994) - (xy 245.059529 208.820005) (xy 245.079379 209.059559) (xy 245.138389 209.292589) (xy 245.234951 209.512729) - (xy 245.334744 209.665472) (xy 245.366429 209.713969) (xy 245.529236 209.890825) (xy 245.529239 209.890827) - (xy 245.529242 209.89083) (xy 245.718924 210.038466) (xy 245.71893 210.03847) (xy 245.718933 210.038472) - (xy 245.837952 210.102882) (xy 245.926062 210.150565) (xy 245.930344 210.152882) (xy 245.947208 210.158671) - (xy 246.157699 210.230933) (xy 246.157701 210.230933) (xy 246.157703 210.230934) (xy 246.394808 210.2705) - (xy 246.394809 210.2705) (xy 246.635191 210.2705) (xy 246.635192 210.2705) (xy 246.872297 210.230934) - (xy 247.099656 210.152882) (xy 247.311067 210.038472) (xy 247.328988 210.024524) (xy 247.399762 209.969438) - (xy 247.500764 209.890825) (xy 247.663571 209.713969) (xy 247.795049 209.512728) (xy 247.89161 209.292591) - (xy 247.95062 209.059563) (xy 247.970471 208.82) (xy 247.966328 208.770005) (xy 247.95062 208.58044) - (xy 247.95062 208.580437) (xy 247.89161 208.347409) (xy 247.795049 208.127272) (xy 247.663571 207.926031) - (xy 247.500764 207.749175) (xy 247.500759 207.749171) (xy 247.500757 207.749169) (xy 247.311075 207.601533) - (xy 247.311069 207.601529) (xy 247.099657 207.487118) (xy 247.099652 207.487116) (xy 246.8723 207.409066) - (xy 246.694468 207.379391) (xy 246.635192 207.3695) (xy 246.394808 207.3695) (xy 246.347387 207.377413) - (xy 246.157699 207.409066) (xy 245.930347 207.487116) (xy 245.930342 207.487118) (xy 245.71893 207.601529) - (xy 245.718924 207.601533) (xy 245.529242 207.749169) (xy 245.529239 207.749172) (xy 245.36643 207.926029) - (xy 245.366427 207.926033) (xy 245.234951 208.12727) (xy 245.138389 208.34741) (xy 245.079379 208.58044) - (xy 245.059529 208.819994) (xy 242.180471 208.819994) (xy 242.176328 208.770005) (xy 242.16062 208.58044) - (xy 242.16062 208.580437) (xy 242.10161 208.347409) (xy 242.005049 208.127272) (xy 241.873571 207.926031) - (xy 241.710764 207.749175) (xy 241.710759 207.749171) (xy 241.710757 207.749169) (xy 241.521075 207.601533) - (xy 241.521069 207.601529) (xy 241.309657 207.487118) (xy 241.309652 207.487116) (xy 241.0823 207.409066) - (xy 240.904468 207.379391) (xy 240.845192 207.3695) (xy 240.604808 207.3695) (xy 240.557387 207.377413) - (xy 240.367699 207.409066) (xy 240.140347 207.487116) (xy 240.140342 207.487118) (xy 239.92893 207.601529) - (xy 239.928924 207.601533) (xy 239.739242 207.749169) (xy 239.739239 207.749172) (xy 239.57643 207.926029) - (xy 239.576427 207.926033) (xy 239.444951 208.12727) (xy 239.348389 208.34741) (xy 239.289379 208.58044) - (xy 239.269529 208.819994) (xy 238.780471 208.819994) (xy 238.776328 208.770005) (xy 238.76062 208.58044) - (xy 238.76062 208.580437) (xy 238.70161 208.347409) (xy 238.605049 208.127272) (xy 238.473571 207.926031) - (xy 238.310764 207.749175) (xy 238.310759 207.749171) (xy 238.310757 207.749169) (xy 238.121075 207.601533) - (xy 238.121069 207.601529) (xy 237.909657 207.487118) (xy 237.909652 207.487116) (xy 237.6823 207.409066) - (xy 237.504468 207.379391) (xy 237.445192 207.3695) (xy 237.204808 207.3695) (xy 237.157387 207.377413) - (xy 236.967699 207.409066) (xy 236.740347 207.487116) (xy 236.740342 207.487118) (xy 236.52893 207.601529) - (xy 236.528924 207.601533) (xy 236.339242 207.749169) (xy 236.339239 207.749172) (xy 236.17643 207.926029) - (xy 236.176427 207.926033) (xy 236.044951 208.12727) (xy 235.948389 208.34741) (xy 235.889379 208.58044) - (xy 235.869529 208.819994) (xy 235.5755 208.819994) (xy 235.5755 202.500564) (xy 235.575197 202.499436) - (xy 235.575184 202.499388) (xy 235.54991 202.405064) (xy 235.549909 202.40506) (xy 235.544533 202.395749) - (xy 235.500475 202.319438) (xy 235.430562 202.249525) (xy 234.72782 201.546783) (xy 234.694335 201.48546) - (xy 234.699319 201.415768) (xy 234.741191 201.359835) (xy 234.75786 201.349314) (xy 234.87224 201.289283) - (xy 234.990483 201.18453) (xy 235.08022 201.054523) (xy 235.080223 201.054513) (xy 235.081635 201.051825) - (xy 235.083196 201.050211) (xy 235.084481 201.04835) (xy 235.08479 201.048563) (xy 235.130217 201.00161) - (xy 235.198235 200.985632) (xy 235.264094 201.008963) (xy 235.279116 201.021764) (xy 235.887914 201.630562) - (xy 235.957827 201.700475) (xy 236.043451 201.74991) (xy 236.056341 201.753364) (xy 236.06923 201.756818) - (xy 236.069231 201.756818) (xy 236.083965 201.760765) (xy 236.138953 201.7755) (xy 236.138954 201.7755) - (xy 243.023692 201.7755) (xy 243.090731 201.795185) (xy 243.125742 201.829061) (xy 243.128163 201.832569) - (xy 243.129515 201.834528) (xy 243.129517 201.83453) (xy 243.24776 201.939283) (xy 243.247762 201.939284) - (xy 243.387634 202.012696) (xy 243.541014 202.0505) (xy 243.541015 202.0505) (xy 243.698985 202.0505) - (xy 243.852365 202.012696) (xy 243.99224 201.939283) (xy 244.110483 201.83453) (xy 244.20022 201.704523) - (xy 244.256237 201.556818) (xy 244.275278 201.4) (xy 244.275278 201.399995) (xy 244.256237 201.243181) - (xy 244.204012 201.105476) (xy 244.20022 201.095477) (xy 244.110483 200.96547) (xy 243.99224 200.860717) - (xy 243.992238 200.860716) (xy 243.992237 200.860715) (xy 243.852365 200.787303) (xy 243.698986 200.7495) - (xy 243.698985 200.7495) (xy 243.541015 200.7495) (xy 243.541014 200.7495) (xy 243.387634 200.787303) - (xy 243.247762 200.860715) (xy 243.129516 200.96547) (xy 243.127089 200.968987) (xy 243.125742 200.970938) - (xy 243.071463 201.014929) (xy 243.023692 201.0245) (xy 236.395288 201.0245) (xy 236.328249 201.004815) - (xy 236.307607 200.988181) (xy 233.586607 198.267181) (xy 233.553122 198.205858) (xy 233.558106 198.136166) - (xy 233.599978 198.080233) (xy 233.665442 198.055816) (xy 233.674288 198.0555) (xy 241.793887 198.0555) - (xy 241.793907 198.0555) (xy 241.806442 198.055192) (xy 241.818596 198.054595) (xy 241.831105 198.053673) - (xy 242.007978 198.036252) (xy 242.032777 198.032573) (xy 242.056618 198.027831) (xy 242.080942 198.021738) - (xy 242.245165 197.971922) (xy 242.268779 197.963473) (xy 242.291237 197.95417) (xy 242.313898 197.943452) - (xy 242.314404 197.943182) (xy 242.375547 197.9105) (xy 242.46524 197.862558) (xy 242.486745 197.849669) - (xy 242.506957 197.836164) (xy 242.527098 197.821226) (xy 242.659754 197.712358) (xy 242.678332 197.69552) - (xy 242.69552 197.678332) (xy 242.712358 197.659754) (xy 242.821226 197.527098) (xy 242.836164 197.506957) - (xy 242.849669 197.486745) (xy 242.862558 197.46524) (xy 242.943452 197.313898) (xy 242.95417 197.291237) - (xy 242.963473 197.268779) (xy 242.971922 197.245165) (xy 243.021738 197.080942) (xy 243.027831 197.056618) - (xy 243.032573 197.032777) (xy 243.036252 197.007978) (xy 243.053673 196.831105) (xy 243.053711 196.830601) - (xy 243.054593 196.818622) (xy 243.054595 196.818596) (xy 243.055192 196.806442) (xy 243.0555 196.793907) - (xy 243.0555 194.125321) (xy 245.0645 194.125321) (xy 245.0645 196.574678) (xy 245.079032 196.647735) - (xy 245.079033 196.647739) (xy 245.079034 196.64774) (xy 245.134399 196.730601) (xy 245.192524 196.769438) - (xy 245.21726 196.785966) (xy 245.217264 196.785967) (xy 245.290321 196.800499) (xy 245.290324 196.8005) - (xy 245.290326 196.8005) (xy 247.739676 196.8005) (xy 247.739677 196.800499) (xy 247.81274 196.785966) - (xy 247.895601 196.730601) (xy 247.950966 196.64774) (xy 247.9655 196.574674) (xy 247.9655 194.125326) - (xy 247.9655 194.125323) (xy 247.965499 194.125321) (xy 247.950967 194.052264) (xy 247.950966 194.05226) - (xy 247.94215 194.039066) (xy 247.895601 193.969399) (xy 247.830266 193.925744) (xy 247.812739 193.914033) - (xy 247.812735 193.914032) (xy 247.739677 193.8995) (xy 247.739674 193.8995) (xy 245.290326 193.8995) - (xy 245.290323 193.8995) (xy 245.217264 193.914032) (xy 245.21726 193.914033) (xy 245.134399 193.969399) - (xy 245.079033 194.05226) (xy 245.079032 194.052264) (xy 245.0645 194.125321) (xy 243.0555 194.125321) - (xy 243.0555 166.2) (xy 244.3 166.2) (xy 244.3 188.8) (xy 251.376 188.8) (xy 251.443039 188.819685) - (xy 251.488794 188.872489) (xy 251.5 188.924) (xy 251.5 194.761107) (xy 251.480315 194.828146) (xy 251.427511 194.873901) - (xy 251.358353 194.883845) (xy 251.294797 194.85482) (xy 251.262444 194.810917) (xy 251.203623 194.676818) - (xy 251.195049 194.657272) (xy 251.193052 194.654216) (xy 251.1116 194.529544) (xy 251.063571 194.456031) - (xy 250.900764 194.279175) (xy 250.900759 194.279171) (xy 250.900757 194.279169) (xy 250.711075 194.131533) - (xy 250.711069 194.131529) (xy 250.499657 194.017118) (xy 250.499652 194.017116) (xy 250.2723 193.939066) - (xy 250.094468 193.909391) (xy 250.035192 193.8995) (xy 249.794808 193.8995) (xy 249.747387 193.907413) - (xy 249.557699 193.939066) (xy 249.330347 194.017116) (xy 249.330342 194.017118) (xy 249.11893 194.131529) - (xy 249.118924 194.131533) (xy 248.929242 194.279169) (xy 248.929239 194.279172) (xy 248.929236 194.279174) - (xy 248.929236 194.279175) (xy 248.908972 194.301188) (xy 248.76643 194.456029) (xy 248.766427 194.456033) - (xy 248.634951 194.65727) (xy 248.538389 194.87741) (xy 248.479379 195.11044) (xy 248.459529 195.349994) - (xy 248.459529 195.350005) (xy 248.479379 195.589559) (xy 248.538389 195.822589) (xy 248.634951 196.042729) - (xy 248.766427 196.243966) (xy 248.766429 196.243969) (xy 248.929236 196.420825) (xy 248.929239 196.420827) - (xy 248.929242 196.42083) (xy 249.118924 196.568466) (xy 249.11893 196.56847) (xy 249.118933 196.568472) - (xy 249.265407 196.64774) (xy 249.326123 196.680598) (xy 249.330344 196.682882) (xy 249.330347 196.682883) - (xy 249.557699 196.760933) (xy 249.557701 196.760933) (xy 249.557703 196.760934) (xy 249.794808 196.8005) - (xy 249.794809 196.8005) (xy 250.035191 196.8005) (xy 250.035192 196.8005) (xy 250.272297 196.760934) - (xy 250.499656 196.682882) (xy 250.711067 196.568472) (xy 250.900764 196.420825) (xy 251.063571 196.243969) - (xy 251.195049 196.042728) (xy 251.262444 195.889081) (xy 251.3074 195.835596) (xy 251.374136 195.814906) - (xy 251.441464 195.83358) (xy 251.488007 195.885691) (xy 251.5 195.938892) (xy 251.5 208.231107) - (xy 251.480315 208.298146) (xy 251.427511 208.343901) (xy 251.358353 208.353845) (xy 251.294797 208.32482) - (xy 251.262444 208.280917) (xy 251.195048 208.12727) (xy 251.063572 207.926033) (xy 251.063571 207.926031) - (xy 250.900764 207.749175) (xy 250.900759 207.749171) (xy 250.900757 207.749169) (xy 250.711075 207.601533) - (xy 250.711069 207.601529) (xy 250.499657 207.487118) (xy 250.499652 207.487116) (xy 250.2723 207.409066) - (xy 250.094468 207.379391) (xy 250.035192 207.3695) (xy 249.794808 207.3695) (xy 249.747387 207.377413) - (xy 249.557699 207.409066) (xy 249.330347 207.487116) (xy 249.330342 207.487118) (xy 249.11893 207.601529) - (xy 249.118924 207.601533) (xy 248.929242 207.749169) (xy 248.929239 207.749172) (xy 248.76643 207.926029) - (xy 248.766427 207.926033) (xy 248.634951 208.12727) (xy 248.538389 208.34741) (xy 248.479379 208.58044) - (xy 248.459529 208.819994) (xy 248.459529 208.820005) (xy 248.479379 209.059559) (xy 248.538389 209.292589) - (xy 248.634951 209.512729) (xy 248.734744 209.665472) (xy 248.766429 209.713969) (xy 248.929236 209.890825) - (xy 248.929239 209.890827) (xy 248.929242 209.89083) (xy 249.118924 210.038466) (xy 249.11893 210.03847) - (xy 249.118933 210.038472) (xy 249.237952 210.102882) (xy 249.326062 210.150565) (xy 249.330344 210.152882) - (xy 249.347208 210.158671) (xy 249.557699 210.230933) (xy 249.557701 210.230933) (xy 249.557703 210.230934) - (xy 249.794808 210.2705) (xy 249.794809 210.2705) (xy 250.035191 210.2705) (xy 250.035192 210.2705) - (xy 250.272297 210.230934) (xy 250.499656 210.152882) (xy 250.711067 210.038472) (xy 250.728988 210.024524) - (xy 250.799762 209.969438) (xy 250.900764 209.890825) (xy 251.063571 209.713969) (xy 251.195049 209.512728) - (xy 251.262444 209.359081) (xy 251.3074 209.305596) (xy 251.374136 209.284906) (xy 251.441464 209.30358) - (xy 251.488007 209.355691) (xy 251.5 209.408892) (xy 251.5 213.5) (xy 268.5 213.5) (xy 268.5 213) - (xy 252.124 213) (xy 252.056961 212.980315) (xy 252.011206 212.927511) (xy 252 212.876) (xy 252 209.719999) - (xy 256.654722 209.719999) (xy 256.654722 209.72) (xy 256.673762 209.876818) (xy 256.717 209.990825) - (xy 256.72978 210.024523) (xy 256.819517 210.15453) (xy 256.93776 210.259283) (xy 256.937762 210.259284) - (xy 257.077634 210.332696) (xy 257.231014 210.3705) (xy 257.231015 210.3705) (xy 257.388985 210.3705) - (xy 257.542365 210.332696) (xy 257.568045 210.319218) (xy 257.68224 210.259283) (xy 257.800483 210.15453) - (xy 257.804257 210.149061) (xy 257.858537 210.105071) (xy 257.906308 210.0955) (xy 258.95474 210.0955) - (xy 258.954741 210.0955) (xy 259.002491 210.082705) (xy 259.050243 210.06991) (xy 259.135867 210.020475) - (xy 259.20578 209.950562) (xy 262.540474 206.615868) (xy 262.546862 206.604802) (xy 262.549965 206.599431) - (xy 262.572454 206.560476) (xy 262.58991 206.530243) (xy 262.6155 206.43474) (xy 262.6155 206.162202) - (xy 262.635185 206.095163) (xy 262.657274 206.069386) (xy 262.730482 206.004531) (xy 262.730483 206.00453) - (xy 262.82022 205.874523) (xy 262.876237 205.726818) (xy 262.889324 205.619029) (xy 262.916945 205.554853) - (xy 262.924728 205.546307) (xy 262.945838 205.525197) (xy 263.007159 205.491714) (xy 263.076851 205.496698) - (xy 263.132784 205.53857) (xy 263.156613 205.597933) (xy 263.163763 205.656819) (xy 263.185139 205.713182) - (xy 263.21978 205.804523) (xy 263.309517 205.93453) (xy 263.42776 206.039283) (xy 263.427762 206.039284) - (xy 263.567634 206.112696) (xy 263.721014 206.1505) (xy 263.721015 206.1505) (xy 263.878985 206.1505) - (xy 264.032365 206.112696) (xy 264.114884 206.069386) (xy 264.17224 206.039283) (xy 264.290483 205.93453) - (xy 264.294257 205.929061) (xy 264.348537 205.885071) (xy 264.396308 205.8755) (xy 266.303692 205.8755) - (xy 266.370731 205.895185) (xy 266.405742 205.929061) (xy 266.408163 205.932569) (xy 266.409515 205.934528) - (xy 266.409517 205.93453) (xy 266.52776 206.039283) (xy 266.527762 206.039284) (xy 266.667634 206.112696) - (xy 266.821014 206.1505) (xy 266.821015 206.1505) (xy 266.978985 206.1505) (xy 267.132365 206.112696) - (xy 267.214884 206.069386) (xy 267.27224 206.039283) (xy 267.390483 205.93453) (xy 267.48022 205.804523) - (xy 267.536237 205.656818) (xy 267.555278 205.5) (xy 267.546692 205.429283) (xy 267.536237 205.343181) - (xy 267.508302 205.269524) (xy 267.48022 205.195477) (xy 267.390483 205.06547) (xy 267.27224 204.960717) - (xy 267.272238 204.960716) (xy 267.272237 204.960715) (xy 267.132365 204.887303) (xy 266.978986 204.8495) - (xy 266.978985 204.8495) (xy 266.821015 204.8495) (xy 266.821014 204.8495) (xy 266.667634 204.887303) - (xy 266.527762 204.960715) (xy 266.409516 205.06547) (xy 266.407089 205.068987) (xy 266.405742 205.070938) - (xy 266.351463 205.114929) (xy 266.303692 205.1245) (xy 264.396308 205.1245) (xy 264.329269 205.104815) - (xy 264.294257 205.070938) (xy 264.290483 205.06547) (xy 264.17224 204.960717) (xy 264.172238 204.960716) - (xy 264.172237 204.960715) (xy 264.032366 204.887304) (xy 263.885912 204.851207) (xy 263.825532 204.816051) - (xy 263.793743 204.753832) (xy 263.800639 204.684303) (xy 263.827904 204.643131) (xy 265.334217 203.136819) - (xy 265.39554 203.103334) (xy 265.421898 203.1005) (xy 265.568985 203.1005) (xy 265.722365 203.062696) - (xy 265.736483 203.055286) (xy 265.86224 202.989283) (xy 265.980483 202.88453) (xy 266.07022 202.754523) - (xy 266.126237 202.606818) (xy 266.145278 202.45) (xy 266.126237 202.293182) (xy 266.07022 202.145477) - (xy 265.980483 202.01547) (xy 265.86224 201.910717) (xy 265.862238 201.910716) (xy 265.862237 201.910715) - (xy 265.722365 201.837303) (xy 265.568986 201.7995) (xy 265.568985 201.7995) (xy 265.411015 201.7995) - (xy 265.411014 201.7995) (xy 265.257634 201.837303) (xy 265.117762 201.910715) (xy 264.999516 202.015471) - (xy 264.909781 202.145475) (xy 264.90978 202.145476) (xy 264.853763 202.293181) (xy 264.834722 202.45) - (xy 264.840896 202.500854) (xy 264.829435 202.569777) (xy 264.805481 202.60348) (xy 262.505205 204.903756) - (xy 262.443882 204.937241) (xy 262.387851 204.936472) (xy 262.318988 204.9195) (xy 262.318985 204.9195) - (xy 262.161015 204.9195) (xy 262.161014 204.9195) (xy 262.007634 204.957303) (xy 261.867762 205.030715) - (xy 261.749516 205.135471) (xy 261.659781 205.265475) (xy 261.65978 205.265476) (xy 261.603762 205.413181) - (xy 261.584722 205.569999) (xy 261.584722 205.57) (xy 261.603762 205.726818) (xy 261.638779 205.819148) - (xy 261.65978 205.874523) (xy 261.687576 205.914794) (xy 261.749517 206.004531) (xy 261.822726 206.069386) - (xy 261.859853 206.128574) (xy 261.8645 206.162202) (xy 261.8645 206.178406) (xy 261.844815 206.245445) - (xy 261.828181 206.266087) (xy 258.786087 209.308181) (xy 258.724764 209.341666) (xy 258.698406 209.3445) - (xy 257.906308 209.3445) (xy 257.839269 209.324815) (xy 257.804257 209.290938) (xy 257.800483 209.28547) - (xy 257.68224 209.180717) (xy 257.682238 209.180716) (xy 257.682237 209.180715) (xy 257.542365 209.107303) - (xy 257.388986 209.0695) (xy 257.388985 209.0695) (xy 257.231015 209.0695) (xy 257.231014 209.0695) - (xy 257.077634 209.107303) (xy 256.937762 209.180715) (xy 256.819516 209.285471) (xy 256.729781 209.415475) - (xy 256.72978 209.415476) (xy 256.673762 209.563181) (xy 256.654722 209.719999) (xy 252 209.719999) - (xy 252 196.950565) (xy 252.6245 196.950565) (xy 252.6245 203.549435) (xy 252.65009 203.644938) - (xy 252.667136 203.674462) (xy 252.699526 203.730563) (xy 252.699528 203.730565) (xy 253.788181 204.819218) - (xy 253.821666 204.880541) (xy 253.8245 204.906899) (xy 253.8245 205.307796) (xy 253.804815 205.374835) - (xy 253.782727 205.400611) (xy 253.709518 205.465468) (xy 253.619781 205.595475) (xy 253.61978 205.595476) - (xy 253.563762 205.743181) (xy 253.544722 205.899999) (xy 253.544722 205.9) (xy 253.563762 206.056818) - (xy 253.608403 206.174524) (xy 253.61978 206.204523) (xy 253.709517 206.33453) (xy 253.82776 206.439283) - (xy 253.827762 206.439284) (xy 253.967634 206.512696) (xy 254.121014 206.5505) (xy 254.121015 206.5505) - (xy 254.278985 206.5505) (xy 254.432365 206.512696) (xy 254.489524 206.482696) (xy 254.57224 206.439283) - (xy 254.690483 206.33453) (xy 254.78022 206.204523) (xy 254.836237 206.056818) (xy 254.855278 205.9) - (xy 254.851636 205.870001) (xy 254.836237 205.743181) (xy 254.803484 205.656819) (xy 254.78022 205.595477) - (xy 254.690483 205.46547) (xy 254.690481 205.465468) (xy 254.617273 205.400611) (xy 254.580146 205.341422) - (xy 254.5755 205.307796) (xy 254.5755 204.65468) (xy 254.595185 204.587641) (xy 254.647989 204.541886) - (xy 254.717147 204.531942) (xy 254.761499 204.547293) (xy 254.79148 204.564602) (xy 254.798762 204.568807) - (xy 254.798766 204.568809) (xy 254.814683 204.573074) (xy 254.846515 204.581604) (xy 254.846516 204.581604) - (xy 254.856607 204.584307) (xy 254.894268 204.594399) (xy 254.894269 204.594399) (xy 254.89427 204.594399) - (xy 260.060536 204.594399) (xy 260.060537 204.594399) (xy 260.108287 204.581604) (xy 260.156039 204.568809) - (xy 260.241663 204.519374) (xy 260.311576 204.449461) (xy 262.664217 202.096818) (xy 262.72554 202.063334) - (xy 262.751898 202.0605) (xy 262.898985 202.0605) (xy 263.052365 202.022696) (xy 263.071418 202.012696) - (xy 263.19224 201.949283) (xy 263.310483 201.84453) (xy 263.40022 201.714523) (xy 263.456237 201.566818) - (xy 263.475278 201.41) (xy 263.461373 201.295476) (xy 263.456237 201.253181) (xy 263.426966 201.176) - (xy 263.40022 201.105477) (xy 263.310483 200.97547) (xy 263.19224 200.870717) (xy 263.192238 200.870716) - (xy 263.192237 200.870715) (xy 263.052365 200.797303) (xy 262.898986 200.7595) (xy 262.898985 200.7595) - (xy 262.741015 200.7595) (xy 262.741014 200.7595) (xy 262.587634 200.797303) (xy 262.447762 200.870715) - (xy 262.329516 200.975471) (xy 262.239781 201.105475) (xy 262.23978 201.105476) (xy 262.183763 201.253181) - (xy 262.164722 201.41) (xy 262.170896 201.460854) (xy 262.159435 201.529777) (xy 262.135481 201.56348) - (xy 259.891883 203.80708) (xy 259.83056 203.840565) (xy 259.804202 203.843399) (xy 255.988565 203.843399) - (xy 255.921526 203.823714) (xy 255.875771 203.77091) (xy 255.865827 203.701752) (xy 255.872623 203.675428) - (xy 255.874852 203.669548) (xy 255.900957 203.600717) (xy 255.919998 203.443899) (xy 255.919386 203.438861) - (xy 255.930845 203.369941) (xy 255.954798 203.336237) (xy 260.739218 198.551819) (xy 260.800541 198.518334) - (xy 260.826899 198.5155) (xy 264.103101 198.5155) (xy 264.17014 198.535185) (xy 264.190782 198.551819) - (xy 265.495481 199.856518) (xy 265.528966 199.917841) (xy 265.530896 199.959143) (xy 265.524722 200.009997) - (xy 265.524722 200.01) (xy 265.543762 200.166818) (xy 265.59978 200.314523) (xy 265.689517 200.44453) - (xy 265.80776 200.549283) (xy 265.807762 200.549284) (xy 265.947634 200.622696) (xy 266.101014 200.6605) - (xy 266.101015 200.6605) (xy 266.258985 200.6605) (xy 266.412365 200.622696) (xy 266.55224 200.549283) - (xy 266.670483 200.44453) (xy 266.76022 200.314523) (xy 266.816237 200.166818) (xy 266.835278 200.01) - (xy 266.816237 199.853182) (xy 266.76022 199.705477) (xy 266.670483 199.57547) (xy 266.55224 199.470717) - (xy 266.552238 199.470716) (xy 266.552237 199.470715) (xy 266.412365 199.397303) (xy 266.258986 199.3595) - (xy 266.258985 199.3595) (xy 266.111899 199.3595) (xy 266.04486 199.339815) (xy 266.024218 199.323181) - (xy 264.643218 197.942181) (xy 264.609733 197.880858) (xy 264.614717 197.811166) (xy 264.656589 197.755233) - (xy 264.722053 197.730816) (xy 264.730899 197.7305) (xy 267.394435 197.7305) (xy 267.394436 197.7305) - (xy 267.442186 197.717705) (xy 267.489938 197.70491) (xy 267.575562 197.655475) (xy 267.645475 197.585562) - (xy 268.744217 196.486818) (xy 268.80554 196.453334) (xy 268.831898 196.4505) (xy 268.978985 196.4505) - (xy 269.132365 196.412696) (xy 269.157921 196.399283) (xy 269.27224 196.339283) (xy 269.390483 196.23453) - (xy 269.48022 196.104523) (xy 269.536237 195.956818) (xy 269.555278 195.8) (xy 269.553887 195.788539) - (xy 269.536237 195.643181) (xy 269.502975 195.555477) (xy 269.48022 195.495477) (xy 269.390483 195.36547) - (xy 269.27224 195.260717) (xy 269.272238 195.260716) (xy 269.272237 195.260715) (xy 269.132365 195.187303) - (xy 268.978986 195.1495) (xy 268.978985 195.1495) (xy 268.821015 195.1495) (xy 268.821014 195.1495) - (xy 268.667634 195.187303) (xy 268.527762 195.260715) (xy 268.409516 195.365471) (xy 268.319781 195.495475) - (xy 268.31978 195.495476) (xy 268.263763 195.643181) (xy 268.244722 195.8) (xy 268.250896 195.850854) - (xy 268.239435 195.919777) (xy 268.215481 195.95348) (xy 267.225782 196.943181) (xy 267.164459 196.976666) - (xy 267.138101 196.9795) (xy 258.91631 196.9795) (xy 258.849271 196.959815) (xy 258.814259 196.925938) - (xy 258.810485 196.92047) (xy 258.692242 196.815717) (xy 258.69224 196.815716) (xy 258.692239 196.815715) - (xy 258.552367 196.742303) (xy 258.398988 196.7045) (xy 258.398987 196.7045) (xy 258.241017 196.7045) - (xy 258.241016 196.7045) (xy 258.087636 196.742303) (xy 257.947764 196.815715) (xy 257.829518 196.92047) - (xy 257.827091 196.923987) (xy 257.825744 196.925938) (xy 257.771465 196.969929) (xy 257.723694 196.9795) - (xy 256.861129 196.9795) (xy 256.79409 196.959815) (xy 256.748335 196.907011) (xy 256.738391 196.837853) - (xy 256.767416 196.774297) (xy 256.826194 196.736523) (xy 256.831455 196.735103) (xy 256.922365 196.712696) - (xy 256.983518 196.6806) (xy 257.06224 196.639283) (xy 257.180483 196.53453) (xy 257.27022 196.404523) - (xy 257.326237 196.256818) (xy 257.345278 196.1) (xy 257.344 196.08947) (xy 257.326237 195.943181) - (xy 257.298227 195.869326) (xy 257.29469 195.859999) (xy 258.464724 195.859999) (xy 258.464724 195.86) - (xy 258.483764 196.016818) (xy 258.532555 196.145468) (xy 258.539782 196.164523) (xy 258.629519 196.29453) - (xy 258.747762 196.399283) (xy 258.747764 196.399284) (xy 258.887636 196.472696) (xy 259.041016 196.5105) - (xy 259.041017 196.5105) (xy 259.198987 196.5105) (xy 259.352367 196.472696) (xy 259.361251 196.468033) - (xy 259.492242 196.399283) (xy 259.610485 196.29453) (xy 259.700222 196.164523) (xy 259.756239 196.016818) - (xy 259.77528 195.86) (xy 259.769104 195.809144) (xy 259.780563 195.740224) (xy 259.804516 195.706521) - (xy 265.836094 189.674945) (xy 265.836095 189.674944) (xy 265.88553 189.58932) (xy 265.910375 189.496597) - (xy 265.910378 189.496588) (xy 265.911119 189.493823) (xy 265.91112 189.493816) (xy 265.91112 175.143271) - (xy 265.930805 175.076232) (xy 265.933054 175.072854) (xy 265.98022 175.004523) (xy 266.036237 174.856818) - (xy 266.055278 174.7) (xy 266.052394 174.676243) (xy 266.036237 174.543181) (xy 265.98169 174.399354) - (xy 265.98022 174.395477) (xy 265.890483 174.26547) (xy 265.77224 174.160717) (xy 265.772238 174.160716) - (xy 265.772237 174.160715) (xy 265.632365 174.087303) (xy 265.478986 174.0495) (xy 265.478985 174.0495) - (xy 265.321015 174.0495) (xy 265.321014 174.0495) (xy 265.167634 174.087303) (xy 265.027762 174.160715) - (xy 264.909516 174.265471) (xy 264.819781 174.395475) (xy 264.81978 174.395476) (xy 264.763762 174.543181) - (xy 264.744722 174.699999) (xy 264.744722 174.7) (xy 264.763762 174.856818) (xy 264.797002 174.944463) - (xy 264.81978 175.004523) (xy 264.909517 175.13453) (xy 265.02776 175.239283) (xy 265.093746 175.273915) - (xy 265.143958 175.322498) (xy 265.16012 175.383711) (xy 265.16012 189.237482) (xy 265.140435 189.304521) - (xy 265.123801 189.325163) (xy 259.275783 195.173181) (xy 259.21446 195.206666) (xy 259.188102 195.2095) - (xy 259.041016 195.2095) (xy 258.887636 195.247303) (xy 258.747764 195.320715) (xy 258.629518 195.425471) - (xy 258.539783 195.555475) (xy 258.539782 195.555476) (xy 258.483764 195.703181) (xy 258.464724 195.859999) - (xy 257.29469 195.859999) (xy 257.27022 195.795477) (xy 257.180483 195.66547) (xy 257.155324 195.643181) - (xy 257.107273 195.600611) (xy 257.070146 195.541422) (xy 257.0655 195.507796) (xy 257.0655 188.816898) - (xy 257.085185 188.749859) (xy 257.101814 188.729222) (xy 260.514217 185.316818) (xy 260.57554 185.283334) - (xy 260.601898 185.2805) (xy 260.748985 185.2805) (xy 260.902365 185.242696) (xy 260.909954 185.238713) - (xy 261.04224 185.169283) (xy 261.160483 185.06453) (xy 261.25022 184.934523) (xy 261.306237 184.786818) - (xy 261.325278 184.63) (xy 261.316503 184.557726) (xy 261.306237 184.473181) (xy 261.262368 184.35751) - (xy 261.25022 184.325477) (xy 261.160483 184.19547) (xy 261.04224 184.090717) (xy 261.042238 184.090716) - (xy 261.042237 184.090715) (xy 260.902365 184.017303) (xy 260.748986 183.9795) (xy 260.748985 183.9795) - (xy 260.591015 183.9795) (xy 260.591014 183.9795) (xy 260.437634 184.017303) (xy 260.297762 184.090715) - (xy 260.179516 184.195471) (xy 260.089781 184.325475) (xy 260.08978 184.325476) (xy 260.033763 184.473181) - (xy 260.014722 184.63) (xy 260.020896 184.680854) (xy 260.009435 184.749777) (xy 259.985481 184.78348) - (xy 256.459438 188.309525) (xy 256.389527 188.379435) (xy 256.389525 188.379437) (xy 256.389525 188.379438) - (xy 256.34009 188.465062) (xy 256.340089 188.465064) (xy 256.335865 188.480829) (xy 256.335865 188.48083) - (xy 256.314816 188.559387) (xy 256.314803 188.559436) (xy 256.3145 188.560564) (xy 256.3145 189.6264) - (xy 256.294815 189.693439) (xy 256.242011 189.739194) (xy 256.172853 189.749138) (xy 256.109297 189.720113) - (xy 256.108274 189.719216) (xy 256.04224 189.660717) (xy 256.042238 189.660715) (xy 255.902365 189.587303) - (xy 255.748986 189.5495) (xy 255.748985 189.5495) (xy 255.591015 189.5495) (xy 255.591014 189.5495) - (xy 255.430351 189.589099) (xy 255.429627 189.586162) (xy 255.373774 189.59045) (xy 255.312277 189.557285) - (xy 255.278473 189.496137) (xy 255.2755 189.469148) (xy 255.2755 185.806899) (xy 255.295185 185.73986) - (xy 255.311819 185.719218) (xy 259.238439 181.792598) (xy 263.200474 177.830563) (xy 263.200475 177.830562) - (xy 263.24991 177.744938) (xy 263.273522 177.656818) (xy 263.2755 177.649436) (xy 263.2755 177.550564) - (xy 263.2755 165.592202) (xy 263.295185 165.525163) (xy 263.317274 165.499386) (xy 263.390482 165.434531) - (xy 263.390483 165.43453) (xy 263.48022 165.304523) (xy 263.536237 165.156818) (xy 263.555278 165) - (xy 263.55247 164.976869) (xy 263.536237 164.843181) (xy 263.514992 164.787164) (xy 263.48022 164.695477) - (xy 263.390483 164.56547) (xy 263.27224 164.460717) (xy 263.272238 164.460716) (xy 263.272237 164.460715) - (xy 263.132365 164.387303) (xy 262.978986 164.3495) (xy 262.978985 164.3495) (xy 262.821015 164.3495) - (xy 262.821014 164.3495) (xy 262.667634 164.387303) (xy 262.527762 164.460715) (xy 262.409516 164.565471) - (xy 262.319781 164.695475) (xy 262.31978 164.695476) (xy 262.263762 164.843181) (xy 262.244722 164.999999) - (xy 262.244722 165) (xy 262.263762 165.156818) (xy 262.31978 165.304523) (xy 262.319781 165.304524) - (xy 262.409517 165.434531) (xy 262.482726 165.499386) (xy 262.519853 165.558574) (xy 262.5245 165.592202) - (xy 262.5245 177.393101) (xy 262.504815 177.46014) (xy 262.488181 177.480782) (xy 254.599526 185.369436) - (xy 254.550091 185.455059) (xy 254.550091 185.45506) (xy 254.55009 185.455062) (xy 254.5245 185.550565) - (xy 254.5245 185.550567) (xy 254.5245 193.981837) (xy 254.504815 194.048876) (xy 254.452011 194.094631) - (xy 254.382853 194.104575) (xy 254.319297 194.07555) (xy 254.318273 194.074653) (xy 254.257273 194.020612) - (xy 254.220146 193.961422) (xy 254.2155 193.927796) (xy 254.2155 183.896898) (xy 254.235185 183.829859) - (xy 254.251815 183.809221) (xy 254.894217 183.166818) (xy 254.95554 183.133334) (xy 254.981898 183.1305) - (xy 255.128985 183.1305) (xy 255.282365 183.092696) (xy 255.42224 183.019283) (xy 255.540483 182.91453) - (xy 255.63022 182.784523) (xy 255.686237 182.636818) (xy 255.705278 182.48) (xy 255.702494 182.457067) - (xy 255.686237 182.323181) (xy 255.646522 182.218463) (xy 255.63022 182.175477) (xy 255.540483 182.04547) - (xy 255.42224 181.940717) (xy 255.422238 181.940716) (xy 255.422237 181.940715) (xy 255.282365 181.867303) - (xy 255.128986 181.8295) (xy 255.128985 181.8295) (xy 254.971015 181.8295) (xy 254.971014 181.8295) - (xy 254.817634 181.867303) (xy 254.677762 181.940715) (xy 254.559516 182.045471) (xy 254.469781 182.175475) - (xy 254.46978 182.175476) (xy 254.413763 182.323181) (xy 254.394722 182.48) (xy 254.400896 182.530854) - (xy 254.389435 182.599777) (xy 254.365481 182.63348) (xy 253.609438 183.389525) (xy 253.539526 183.459436) - (xy 253.490091 183.545059) (xy 253.490091 183.54506) (xy 253.49009 183.545062) (xy 253.4645 183.640565) - (xy 253.4645 183.640567) (xy 253.4645 193.927796) (xy 253.444815 193.994835) (xy 253.422727 194.020611) - (xy 253.349518 194.085468) (xy 253.259781 194.215475) (xy 253.25978 194.215476) (xy 253.203762 194.363181) - (xy 253.184722 194.519999) (xy 253.184722 194.52) (xy 253.203762 194.676818) (xy 253.235898 194.761552) - (xy 253.25978 194.824523) (xy 253.349517 194.95453) (xy 253.46776 195.059283) (xy 253.47986 195.065633) - (xy 253.607634 195.132696) (xy 253.761014 195.1705) (xy 253.761015 195.1705) (xy 253.918983 195.1705) - (xy 253.918985 195.1705) (xy 253.990708 195.152822) (xy 254.060506 195.155891) (xy 254.117569 195.19621) - (xy 254.143774 195.260979) (xy 254.130803 195.329634) (xy 254.108061 195.3609) (xy 252.769438 196.699525) - (xy 252.699527 196.769435) (xy 252.650089 196.855063) (xy 252.647502 196.86472) (xy 252.630035 196.92991) - (xy 252.6245 196.950565) (xy 252 196.950565) (xy 252 188.3) (xy 244.924 188.3) (xy 244.856961 188.280315) - (xy 244.811206 188.227511) (xy 244.8 188.176) (xy 244.8 166.348958) (xy 244.819685 166.281919) (xy 244.833446 166.264247) - (xy 244.940001 166.150344) (xy 250.69355 159.999999) (xy 255.144736 159.999999) (xy 255.144736 160) - (xy 255.163776 160.156818) (xy 255.219794 160.304523) (xy 255.219795 160.304524) (xy 255.309531 160.434531) - (xy 255.38274 160.499386) (xy 255.419867 160.558574) (xy 255.424514 160.592202) (xy 255.424514 161.949452) - (xy 255.431893 161.976988) (xy 255.431893 161.97699) (xy 255.431894 161.97699) (xy 255.450105 162.044955) - (xy 255.498022 162.127949) (xy 255.49954 162.130578) (xy 255.971674 162.602711) (xy 256.399525 163.030562) - (xy 256.469438 163.100475) (xy 256.555062 163.14991) (xy 256.555066 163.149911) (xy 256.595392 163.160717) - (xy 256.595393 163.160717) (xy 256.607052 163.16384) (xy 256.650564 163.1755) (xy 256.650565 163.1755) - (xy 273.603692 163.1755) (xy 273.670731 163.195185) (xy 273.705742 163.229061) (xy 273.708163 163.232569) - (xy 273.709515 163.234528) (xy 273.709517 163.23453) (xy 273.82776 163.339283) (xy 273.827762 163.339284) - (xy 273.967634 163.412696) (xy 274.121014 163.4505) (xy 274.121015 163.4505) (xy 274.278985 163.4505) - (xy 274.432365 163.412696) (xy 274.57224 163.339283) (xy 274.690483 163.23453) (xy 274.78022 163.104523) - (xy 274.836237 162.956818) (xy 274.855278 162.8) (xy 274.846172 162.725) (xy 274.836237 162.643181) - (xy 274.79466 162.533553) (xy 274.78022 162.495477) (xy 274.690483 162.36547) (xy 274.57224 162.260717) - (xy 274.572238 162.260716) (xy 274.572237 162.260715) (xy 274.432365 162.187303) (xy 274.278986 162.1495) - (xy 274.278985 162.1495) (xy 274.121015 162.1495) (xy 274.121014 162.1495) (xy 273.967634 162.187303) - (xy 273.827762 162.260715) (xy 273.709516 162.36547) (xy 273.707089 162.368987) (xy 273.705742 162.370938) - (xy 273.651463 162.414929) (xy 273.603692 162.4245) (xy 256.906899 162.4245) (xy 256.83986 162.404815) - (xy 256.819218 162.388181) (xy 256.211833 161.780796) (xy 256.178348 161.719473) (xy 256.175514 161.693115) - (xy 256.175514 160.592202) (xy 256.195199 160.525163) (xy 256.217288 160.499386) (xy 256.290496 160.434531) - (xy 256.317453 160.395477) (xy 256.380234 160.304523) (xy 256.436251 160.156818) (xy 256.455292 160) - (xy 256.436251 159.843182) (xy 256.380234 159.695477) (xy 256.290497 159.56547) (xy 256.172254 159.460717) - (xy 256.172252 159.460716) (xy 256.172251 159.460715) (xy 256.032379 159.387303) (xy 255.879 159.3495) - (xy 255.878999 159.3495) (xy 255.721029 159.3495) (xy 255.721028 159.3495) (xy 255.567648 159.387303) - (xy 255.427776 159.460715) (xy 255.30953 159.565471) (xy 255.219795 159.695475) (xy 255.219794 159.695476) - (xy 255.163776 159.843181) (xy 255.144736 159.999999) (xy 250.69355 159.999999) (xy 255.980114 154.348844) - (xy 258.26599 151.905321) (xy 273.5695 151.905321) (xy 273.5695 153.454678) (xy 273.584032 153.527735) - (xy 273.584033 153.527739) (xy 273.589647 153.536141) (xy 273.639399 153.610601) (xy 273.706652 153.655537) - (xy 273.72226 153.665966) (xy 273.722264 153.665967) (xy 273.795321 153.680499) (xy 273.795324 153.6805) - (xy 273.795326 153.6805) (xy 275.344676 153.6805) (xy 275.344677 153.680499) (xy 275.41774 153.665966) - (xy 275.500601 153.610601) (xy 275.555966 153.52774) (xy 275.5705 153.454674) (xy 275.5705 151.905326) - (xy 275.5705 151.905323) (xy 275.570499 151.905321) (xy 275.555967 151.832264) (xy 275.555966 151.83226) - (xy 275.536442 151.80304) (xy 275.500601 151.749399) (xy 275.445235 151.712405) (xy 275.417739 151.694033) - (xy 275.417735 151.694032) (xy 275.344677 151.6795) (xy 275.344674 151.6795) (xy 273.795326 151.6795) - (xy 273.795323 151.6795) (xy 273.722264 151.694032) (xy 273.72226 151.694033) (xy 273.639399 151.749399) - (xy 273.584033 151.83226) (xy 273.584032 151.832264) (xy 273.5695 151.905321) (xy 258.26599 151.905321) - (xy 259.88 150.18) (xy 273.564659 150.18) (xy 273.583975 150.376129) (xy 273.641188 150.564733) - (xy 273.734086 150.738532) (xy 273.73409 150.738539) (xy 273.859116 150.890883) (xy 274.01146 151.015909) - (xy 274.011467 151.015913) (xy 274.185266 151.108811) (xy 274.185269 151.108811) (xy 274.185273 151.108814) - (xy 274.373868 151.166024) (xy 274.57 151.185341) (xy 274.766132 151.166024) (xy 274.954727 151.108814) - (xy 274.975788 151.097557) (xy 275.041632 151.062362) (xy 275.128538 151.01591) (xy 275.280883 150.890883) - (xy 275.40591 150.738538) (xy 275.490502 150.580278) (xy 275.498811 150.564733) (xy 275.498811 150.564732) - (xy 275.498814 150.564727) (xy 275.556024 150.376132) (xy 275.575341 150.18) (xy 275.556024 149.983868) - (xy 275.498814 149.795273) (xy 275.498811 149.795269) (xy 275.498811 149.795266) (xy 275.405913 149.621467) - (xy 275.405909 149.62146) (xy 275.280883 149.469116) (xy 275.128539 149.34409) (xy 275.128532 149.344086) - (xy 274.954733 149.251188) (xy 274.954727 149.251186) (xy 274.828997 149.213046) (xy 274.766129 149.193975) - (xy 274.57 149.174659) (xy 274.37387 149.193975) (xy 274.185266 149.251188) (xy 274.011467 149.344086) - (xy 274.01146 149.34409) (xy 273.859116 149.469116) (xy 273.73409 149.62146) (xy 273.734086 149.621467) - (xy 273.641188 149.795266) (xy 273.583975 149.98387) (xy 273.564659 150.18) (xy 259.88 150.18) (xy 262.163246 147.739289) - (xy 262.22342 147.703779) (xy 262.2538 147.7) (xy 271.6 147.7) (xy 271.6 147.2) (xy 262.1 147.2) - (xy 262.099998 147.2) (xy 244.772658 165.695477) (xy 244.3 166.2) (xy 243.0555 166.2) (xy 243.0555 141.973686) - (xy 243.075185 141.906647) (xy 243.127989 141.860892) (xy 243.197147 141.850948) (xy 243.260703 141.879973) - (xy 243.267181 141.886005) (xy 247.964122 146.582947) (xy 247.964125 146.58295) (xy 247.964128 146.582952) - (xy 248.034805 146.630176) (xy 248.087049 146.665084) (xy 248.223631 146.721658) (xy 248.223635 146.721658) - (xy 248.223636 146.721659) (xy 248.368623 146.7505) (xy 248.368626 146.7505) (xy 261.17392 146.7505) - (xy 261.271462 146.731096) (xy 261.318913 146.721658) (xy 261.455495 146.665084) (xy 261.507739 146.630176) - (xy 261.578416 146.582952) (xy 267.339218 140.822149) (xy 271.1995 140.822149) (xy 271.1995 141.07785) - (xy 271.214953 141.195222) (xy 271.232874 141.33134) (xy 271.29905 141.578312) (xy 271.299053 141.578322) - (xy 271.396894 141.814531) (xy 271.396899 141.814542) (xy 271.524734 142.035957) (xy 271.524745 142.035973) - (xy 271.680388 142.238811) (xy 271.680394 142.238818) (xy 271.861181 142.419605) (xy 271.861187 142.41961) - (xy 272.064035 142.575261) (xy 272.064042 142.575265) (xy 272.285457 142.7031) (xy 272.285462 142.703102) - (xy 272.285465 142.703104) (xy 272.521687 142.80095) (xy 272.76866 142.867126) (xy 273.022157 142.9005) - (xy 273.022164 142.9005) (xy 273.277836 142.9005) (xy 273.277843 142.9005) (xy 273.53134 142.867126) - (xy 273.778313 142.80095) (xy 274.014535 142.703104) (xy 274.235965 142.575261) (xy 274.438813 142.41961) - (xy 274.61961 142.238813) (xy 274.775261 142.035965) (xy 274.903104 141.814535) (xy 275.00095 141.578313) - (xy 275.067126 141.33134) (xy 275.1005 141.077843) (xy 275.1005 140.822157) (xy 275.067126 140.56866) - (xy 275.00095 140.321687) (xy 274.98414 140.281105) (xy 274.903105 140.085468) (xy 274.9031 140.085457) - (xy 274.775265 139.864042) (xy 274.775261 139.864035) (xy 274.61961 139.661187) (xy 274.619605 139.661181) - (xy 274.438818 139.480394) (xy 274.438811 139.480388) (xy 274.235973 139.324745) (xy 274.235971 139.324743) - (xy 274.235965 139.324739) (xy 274.23596 139.324736) (xy 274.235957 139.324734) (xy 274.014542 139.196899) - (xy 274.014531 139.196894) (xy 273.778322 139.099053) (xy 273.778315 139.099051) (xy 273.778313 139.09905) - (xy 273.53134 139.032874) (xy 273.475007 139.025457) (xy 273.27785 138.9995) (xy 273.277843 138.9995) - (xy 273.022157 138.9995) (xy 273.022149 138.9995) (xy 272.796826 139.029165) (xy 272.76866 139.032874) - (xy 272.535973 139.095222) (xy 272.521687 139.09905) (xy 272.521677 139.099053) (xy 272.285468 139.196894) - (xy 272.285457 139.196899) (xy 272.064042 139.324734) (xy 272.064026 139.324745) (xy 271.861188 139.480388) - (xy 271.861181 139.480394) (xy 271.680394 139.661181) (xy 271.680388 139.661188) (xy 271.524745 139.864026) - (xy 271.524734 139.864042) (xy 271.396899 140.085457) (xy 271.396894 140.085468) (xy 271.299053 140.321677) - (xy 271.29905 140.321687) (xy 271.24787 140.512696) (xy 271.232874 140.568661) (xy 271.1995 140.822149) - (xy 267.339218 140.822149) (xy 270.782951 137.378416) (xy 270.865084 137.255495) (xy 270.921658 137.118913) - (xy 270.9505 136.973918) (xy 270.9505 136.826083) (xy 270.9505 125.529026) (xy 270.9505 125.529023) - (xy 270.921659 125.384036) (xy 270.921658 125.384035) (xy 270.921658 125.384031) (xy 270.865084 125.247449) - (xy 270.826364 125.1895) (xy 270.826363 125.189498) (xy 270.826362 125.189496) (xy 270.782953 125.124529) - (xy 270.782947 125.124522) (xy 270.400337 124.741913) (xy 270.366852 124.68059) (xy 270.371836 124.610899) - (xy 270.413707 124.554965) (xy 270.463827 124.532615) (xy 270.479846 124.529428) (xy 270.518909 124.521658) - (xy 270.655491 124.465084) (xy 270.778412 124.382951) (xy 270.882947 124.278416) (xy 270.96508 124.155495) - (xy 271.021654 124.018913) (xy 271.036971 123.941911) (xy 271.050496 123.87392) (xy 271.050496 122.511691) - (xy 271.070181 122.444652) (xy 271.122985 122.398897) (xy 271.192143 122.388953) (xy 271.221946 122.397129) - (xy 271.281087 122.421626) (xy 271.281091 122.421626) (xy 271.281092 122.421627) (xy 271.426079 122.450468) - (xy 271.426082 122.450468) (xy 271.57392 122.450468) (xy 271.712709 122.42286) (xy 271.718913 122.421626) - (xy 271.855495 122.365052) (xy 271.978416 122.282919) (xy 272.082951 122.178384) (xy 272.165084 122.055463) - (xy 272.221658 121.918881) (xy 272.238437 121.83453) (xy 272.2505 121.773888) (xy 272.2505 117.895139) - (xy 272.221659 117.750152) (xy 272.221658 117.750151) (xy 272.221658 117.750147) (xy 272.198029 117.693101) - (xy 272.165086 117.613569) (xy 272.165085 117.613567) (xy 272.132186 117.56433) (xy 272.132185 117.564328) - (xy 272.082956 117.490649) (xy 272.082952 117.490644) (xy 267.009361 112.417052) (xy 267.009354 112.417046) - (xy 266.935669 112.367812) (xy 266.935669 112.367813) (xy 266.886431 112.334913) (xy 266.749857 112.278343) - (xy 266.749847 112.27834) (xy 266.60486 112.2495) (xy 266.604858 112.2495) (xy 224.2745 112.2495) - (xy 224.207461 112.229815) (xy 224.161706 112.177011) (xy 224.1505 112.1255) (xy 224.1505 108.322149) - (xy 271.1995 108.322149) (xy 271.1995 108.57785) (xy 271.218121 108.719283) (xy 271.232874 108.83134) - (xy 271.282307 109.015827) (xy 271.29905 109.078312) (xy 271.299053 109.078322) (xy 271.396894 109.314531) - (xy 271.396899 109.314542) (xy 271.524734 109.535957) (xy 271.524745 109.535973) (xy 271.680388 109.738811) - (xy 271.680394 109.738818) (xy 271.861181 109.919605) (xy 271.861188 109.919611) (xy 271.914476 109.9605) - (xy 272.064035 110.075261) (xy 272.064042 110.075265) (xy 272.285457 110.2031) (xy 272.285462 110.203102) - (xy 272.285465 110.203104) (xy 272.521687 110.30095) (xy 272.76866 110.367126) (xy 273.022157 110.4005) - (xy 273.022164 110.4005) (xy 273.277836 110.4005) (xy 273.277843 110.4005) (xy 273.53134 110.367126) - (xy 273.778313 110.30095) (xy 274.014535 110.203104) (xy 274.235965 110.075261) (xy 274.438813 109.91961) - (xy 274.61961 109.738813) (xy 274.775261 109.535965) (xy 274.903104 109.314535) (xy 275.00095 109.078313) - (xy 275.067126 108.83134) (xy 275.1005 108.577843) (xy 275.1005 108.322157) (xy 275.067126 108.06866) - (xy 275.00095 107.821687) (xy 274.971644 107.750937) (xy 274.903105 107.585468) (xy 274.9031 107.585457) - (xy 274.775265 107.364042) (xy 274.775261 107.364035) (xy 274.61961 107.161187) (xy 274.619605 107.161181) - (xy 274.438818 106.980394) (xy 274.438811 106.980388) (xy 274.235973 106.824745) (xy 274.235971 106.824743) - (xy 274.235965 106.824739) (xy 274.23596 106.824736) (xy 274.235957 106.824734) (xy 274.014542 106.696899) - (xy 274.014531 106.696894) (xy 273.778322 106.599053) (xy 273.778315 106.599051) (xy 273.778313 106.59905) - (xy 273.53134 106.532874) (xy 273.475007 106.525457) (xy 273.27785 106.4995) (xy 273.277843 106.4995) - (xy 273.022157 106.4995) (xy 273.022149 106.4995) (xy 272.796826 106.529165) (xy 272.76866 106.532874) - (xy 272.521687 106.59905) (xy 272.521677 106.599053) (xy 272.285468 106.696894) (xy 272.285457 106.696899) - (xy 272.064042 106.824734) (xy 272.064026 106.824745) (xy 271.861188 106.980388) (xy 271.861181 106.980394) - (xy 271.680394 107.161181) (xy 271.680388 107.161188) (xy 271.524745 107.364026) (xy 271.524734 107.364042) - (xy 271.396899 107.585457) (xy 271.396894 107.585468) (xy 271.299053 107.821677) (xy 271.29905 107.821687) - (xy 271.266009 107.945) (xy 271.232874 108.068661) (xy 271.1995 108.322149) (xy 224.1505 108.322149) - (xy 224.1505 99.44) (xy 257.874659 99.44) (xy 257.893975 99.636129) (xy 257.913046 99.698997) (xy 257.947536 99.812696) - (xy 257.951188 99.824733) (xy 258.044086 99.998532) (xy 258.04409 99.998539) (xy 258.169116 100.150883) - (xy 258.32146 100.275909) (xy 258.321467 100.275913) (xy 258.495266 100.368811) (xy 258.495269 100.368811) - (xy 258.495273 100.368814) (xy 258.683868 100.426024) (xy 258.88 100.445341) (xy 259.076132 100.426024) - (xy 259.264727 100.368814) (xy 259.438538 100.27591) (xy 259.590883 100.150883) (xy 259.71591 99.998538) - (xy 259.808814 99.824727) (xy 259.866024 99.636132) (xy 259.885341 99.44) (xy 259.866024 99.243868) - (xy 259.808814 99.055273) (xy 259.808811 99.055269) (xy 259.808811 99.055266) (xy 259.715913 98.881467) - (xy 259.715909 98.88146) (xy 259.590883 98.729116) (xy 259.513149 98.665321) (xy 260.3795 98.665321) - (xy 260.3795 100.214678) (xy 260.394032 100.287735) (xy 260.394033 100.287739) (xy 260.39542 100.289815) - (xy 260.449399 100.370601) (xy 260.518431 100.416726) (xy 260.53226 100.425966) (xy 260.532264 100.425967) - (xy 260.605321 100.440499) (xy 260.605324 100.4405) (xy 260.605326 100.4405) (xy 262.154676 100.4405) - (xy 262.154677 100.440499) (xy 262.22774 100.425966) (xy 262.310601 100.370601) (xy 262.365966 100.28774) - (xy 262.3805 100.214674) (xy 262.3805 98.665326) (xy 262.3805 98.665323) (xy 262.380499 98.665321) - (xy 262.365967 98.592264) (xy 262.365966 98.59226) (xy 262.337395 98.5495) (xy 262.310601 98.509399) - (xy 262.255235 98.472405) (xy 262.227739 98.454033) (xy 262.227735 98.454032) (xy 262.154677 98.4395) - (xy 262.154674 98.4395) (xy 260.605326 98.4395) (xy 260.605323 98.4395) (xy 260.532264 98.454032) - (xy 260.53226 98.454033) (xy 260.449399 98.509399) (xy 260.394033 98.59226) (xy 260.394032 98.592264) - (xy 260.3795 98.665321) (xy 259.513149 98.665321) (xy 259.438539 98.60409) (xy 259.438532 98.604086) - (xy 259.264733 98.511188) (xy 259.264727 98.511186) (xy 259.076132 98.453976) (xy 259.076129 98.453975) - (xy 258.88 98.434659) (xy 258.68387 98.453975) (xy 258.495266 98.511188) (xy 258.321467 98.604086) - (xy 258.32146 98.60409) (xy 258.169116 98.729116) (xy 258.04409 98.88146) (xy 258.044086 98.881467) - (xy 257.951188 99.055266) (xy 257.893975 99.24387) (xy 257.874659 99.44) (xy 224.1505 99.44) (xy 224.1505 96.526079) - (xy 224.136053 96.453452) (xy 224.14228 96.38386) (xy 224.175443 96.336445) (xy 224.290483 96.23453) - (xy 224.38022 96.104523) (xy 224.436237 95.956818) (xy 224.455278 95.8) (xy 224.436237 95.643182) - (xy 224.38022 95.495477) (xy 224.290483 95.36547) (xy 224.17224 95.260717) (xy 224.172238 95.260716) - (xy 224.172237 95.260715) (xy 224.032365 95.187303) (xy 223.878986 95.1495) (xy 223.878985 95.1495) - (xy 223.721015 95.1495) (xy 223.721014 95.1495) (xy 223.567634 95.187303) (xy 223.427762 95.260715) - (xy 223.309516 95.365471) (xy 223.219781 95.495475) (xy 223.21978 95.495476) (xy 223.163762 95.643181) - (xy 223.144722 95.799999) (xy 223.144722 95.8075) (xy 223.142172 95.8075) (xy 223.132698 95.864404) - (xy 223.085784 95.91618) (xy 223.068529 95.924964) (xy 223.04451 95.934913) (xy 223.044498 95.934919) - (xy 222.921584 96.017048) (xy 222.92158 96.017051) (xy 222.825451 96.113181) (xy 222.764128 96.146666) - (xy 222.73777 96.1495) (xy 222.721014 96.1495) (xy 222.567634 96.187303) (xy 222.427762 96.260715) - (xy 222.42776 96.260717) (xy 222.332925 96.344733) (xy 222.309516 96.365471) (xy 222.219781 96.495475) - (xy 222.21978 96.495476) (xy 222.163762 96.643181) (xy 222.144722 96.799999) (xy 222.144722 96.8) - (xy 222.163762 96.956818) (xy 222.21978 97.104523) (xy 222.309517 97.23453) (xy 222.42776 97.339283) - (xy 222.567635 97.412696) (xy 222.567641 97.412697) (xy 222.569471 97.413392) (xy 222.570622 97.414264) - (xy 222.574277 97.416182) (xy 222.573958 97.416789) (xy 222.625174 97.45557) (xy 222.649231 97.521168) - (xy 222.6495 97.529334) (xy 222.6495 118.473918) (xy 222.6495 118.47392) (xy 222.649499 118.47392) - (xy 222.67834 118.618907) (xy 222.678343 118.618917) (xy 222.733638 118.75241) (xy 222.734916 118.755495) - (xy 222.754175 118.784319) (xy 222.763677 118.79854) (xy 222.817049 118.878418) (xy 222.817052 118.878421) - (xy 226.471451 122.532819) (xy 226.504936 122.594142) (xy 226.499952 122.663834) (xy 226.45808 122.719767) - (xy 226.392616 122.744184) (xy 226.38377 122.7445) (xy 208.1995 122.7445) (xy 208.132461 122.724815) - (xy 208.086706 122.672011) (xy 208.0755 122.6205) (xy 208.0755 117.206899) (xy 208.095185 117.13986) - (xy 208.111819 117.119218) (xy 213.956514 111.274523) (xy 219.825474 105.405563) (xy 219.851216 105.360977) - (xy 219.87491 105.319938) (xy 219.9005 105.224435) (xy 219.9005 95.599999) (xy 220.944722 95.599999) - (xy 220.944722 95.6) (xy 220.963762 95.756818) (xy 221.004565 95.864404) (xy 221.01978 95.904523) - (xy 221.109517 96.03453) (xy 221.22776 96.139283) (xy 221.227762 96.139284) (xy 221.367634 96.212696) - (xy 221.521014 96.2505) (xy 221.521015 96.2505) (xy 221.678985 96.2505) (xy 221.832365 96.212696) - (xy 221.97224 96.139283) (xy 222.090483 96.03453) (xy 222.18022 95.904523) (xy 222.236237 95.756818) - (xy 222.255278 95.6) (xy 222.242587 95.495475) (xy 222.236237 95.443181) (xy 222.200684 95.349436) - (xy 222.18022 95.295477) (xy 222.161707 95.268656) (xy 222.139825 95.202301) (xy 222.157291 95.13465) - (xy 222.208559 95.087181) (xy 222.277353 95.074964) (xy 222.321379 95.088419) (xy 222.367635 95.112696) - (xy 222.367637 95.112696) (xy 222.367638 95.112697) (xy 222.521014 95.1505) (xy 222.521015 95.1505) - (xy 222.678985 95.1505) (xy 222.832365 95.112696) (xy 222.852912 95.101912) (xy 222.97224 95.039283) - (xy 223.090483 94.93453) (xy 223.18022 94.804523) (xy 223.236237 94.656818) (xy 223.255278 94.5) - (xy 223.255278 94.499999) (xy 224.244722 94.499999) (xy 224.244722 94.5) (xy 224.263762 94.656818) + (xy 189.315654 198.700473) (xy 189.43224 198.639283) (xy 189.550483 198.53453) (xy 189.64022 198.404523) + (xy 189.696237 198.256818) (xy 189.715278 198.1) (xy 189.705776 198.021739) (xy 189.696237 197.943181) + (xy 189.660772 197.849669) (xy 189.64022 197.795477) (xy 189.550483 197.66547) (xy 189.550481 197.665468) + (xy 189.477273 197.600611) (xy 189.440146 197.541422) (xy 189.4355 197.507796) (xy 189.4355 196.3545) + (xy 189.455185 196.287461) (xy 189.507989 196.241706) (xy 189.5595 196.2305) (xy 191.024676 196.2305) + (xy 191.024677 196.230499) (xy 191.09774 196.215966) (xy 191.180601 196.160601) (xy 191.235966 196.07774) + (xy 191.2505 196.004674) (xy 191.2505 194.455326) (xy 191.2505 194.455323) (xy 191.250499 194.455321) + (xy 191.235967 194.382264) (xy 191.235966 194.38226) (xy 191.229767 194.372983) (xy 191.180601 194.299399) + (xy 191.09774 194.244034) (xy 191.097739 194.244033) (xy 191.097735 194.244032) (xy 191.024677 194.2295) + (xy 191.024674 194.2295) (xy 189.5595 194.2295) (xy 189.492461 194.209815) (xy 189.446706 194.157011) + (xy 189.4355 194.1055) (xy 189.4355 192.111227) (xy 189.455185 192.044188) (xy 189.507989 191.998433) + (xy 189.577147 191.988489) (xy 189.640703 192.017514) (xy 189.66527 192.048521) (xy 189.665519 192.04835) + (xy 189.668118 192.052116) (xy 189.669299 192.053606) (xy 189.669778 192.054519) (xy 189.66978 192.054523) + (xy 189.759517 192.18453) (xy 189.87776 192.289283) (xy 189.877762 192.289284) (xy 190.017634 192.362696) + (xy 190.171014 192.4005) (xy 190.171015 192.4005) (xy 190.328985 192.4005) (xy 190.482365 192.362696) + (xy 190.520852 192.342496) (xy 190.62224 192.289283) (xy 190.740483 192.18453) (xy 190.83022 192.054523) + (xy 190.886237 191.906818) (xy 190.905278 191.75) (xy 190.892824 191.647427) (xy 190.886237 191.593181) + (xy 190.856018 191.5135) (xy 190.83022 191.445477) (xy 190.740483 191.31547) (xy 190.740481 191.315468) + (xy 190.667273 191.250611) (xy 190.630146 191.191422) (xy 190.6255 191.157796) (xy 190.6255 180.060882) + (xy 190.645185 179.993843) (xy 190.661814 179.973206) (xy 191.984001 178.651018) (xy 192.045322 178.617535) + (xy 192.115014 178.622519) (xy 192.170947 178.664391) (xy 192.187621 178.694728) (xy 192.21978 178.779523) + (xy 192.309517 178.90953) (xy 192.42776 179.014283) (xy 192.427762 179.014284) (xy 192.567634 179.087696) + (xy 192.721014 179.1255) (xy 192.721015 179.1255) (xy 192.878984 179.1255) (xy 192.878985 179.1255) + (xy 192.903724 179.119402) (xy 192.973526 179.122471) (xy 193.021081 179.152118) (xy 200.188181 186.319218) + (xy 200.221666 186.380541) (xy 200.2245 186.406899) (xy 200.2245 213.950565) (xy 200.2245 225.549435) + (xy 200.25009 225.644938) (xy 200.250091 225.644939) (xy 200.250091 225.64494) (xy 200.250401 225.645477) + (xy 200.293102 225.719437) (xy 200.299526 225.730563) (xy 200.299528 225.730566) (xy 202.415481 227.846518) + (xy 202.448966 227.907841) (xy 202.450896 227.949143) (xy 202.444722 227.999997) (xy 202.444722 228) + (xy 202.463762 228.156818) (xy 202.515448 228.293101) (xy 202.51978 228.304523) (xy 202.609517 228.43453) + (xy 202.72776 228.539283) (xy 202.727762 228.539284) (xy 202.867634 228.612696) (xy 203.021014 228.6505) + (xy 203.021015 228.6505) (xy 203.178985 228.6505) (xy 203.332365 228.612696) (xy 203.383187 228.586022) + (xy 203.47224 228.539283) (xy 203.590483 228.43453) (xy 203.68022 228.304523) (xy 203.736237 228.156818) + (xy 203.755278 228) (xy 203.740308 227.876705) (xy 203.736237 227.843181) (xy 203.709803 227.773481) + (xy 203.68022 227.695477) (xy 203.590483 227.56547) (xy 203.47224 227.460717) (xy 203.472238 227.460716) + (xy 203.472237 227.460715) (xy 203.332365 227.387303) (xy 203.178986 227.3495) (xy 203.178985 227.3495) + (xy 203.031899 227.3495) (xy 202.96486 227.329815) (xy 202.944218 227.313181) (xy 201.011819 225.380782) + (xy 200.978334 225.319459) (xy 200.9755 225.293101) (xy 200.9755 186.150566) (xy 200.9755 186.150565) + (xy 200.9755 186.150564) (xy 200.949911 186.055063) (xy 200.906145 185.979258) (xy 200.900477 185.96944) + (xy 200.900473 185.969435) (xy 193.491597 178.560559) (xy 193.458112 178.499236) (xy 193.456305 178.482432) + (xy 193.456182 178.482447) (xy 193.455278 178.475) (xy 193.448253 178.417146) (xy 193.459713 178.348226) + (xy 193.506617 178.296439) (xy 193.574072 178.278232) (xy 193.628975 178.292406) (xy 193.667634 178.312696) + (xy 193.821014 178.3505) (xy 193.968101 178.3505) (xy 194.03514 178.370185) (xy 194.055782 178.386819) + (xy 201.688181 186.019218) (xy 201.721666 186.080541) (xy 201.7245 186.106899) (xy 201.7245 209.501111) + (xy 201.75009 209.596614) (xy 201.799525 209.682238) (xy 201.799526 209.682239) (xy 217.847849 225.730562) + (xy 217.917762 225.800475) (xy 217.962501 225.826305) (xy 218.010716 225.876871) (xy 218.0245 225.933691) + (xy 218.0245 227.249435) (xy 218.05009 227.344938) (xy 218.050091 227.344939) (xy 218.050091 227.34494) + (xy 218.057344 227.357503) (xy 218.074549 227.387303) (xy 218.099526 227.430563) (xy 219.915481 229.246518) + (xy 219.948966 229.307841) (xy 219.950896 229.349143) (xy 219.944722 229.399997) (xy 219.944722 229.4) + (xy 219.963762 229.556818) (xy 220.008618 229.675092) (xy 220.01978 229.704523) (xy 220.109517 229.83453) + (xy 220.22776 229.939283) (xy 220.227762 229.939284) (xy 220.367634 230.012696) (xy 220.521014 230.0505) + (xy 220.521015 230.0505) (xy 220.678985 230.0505) (xy 220.830332 230.013197) (xy 220.900133 230.016266) + (xy 220.957196 230.056586) (xy 220.983401 230.121356) (xy 220.970429 230.190011) (xy 220.947688 230.221274) + (xy 220.78078 230.388182) (xy 220.719459 230.421666) (xy 220.693101 230.4245) (xy 215.596308 230.4245) + (xy 215.529269 230.404815) (xy 215.494257 230.370938) (xy 215.490483 230.36547) (xy 215.37224 230.260717) + (xy 215.372238 230.260716) (xy 215.372237 230.260715) (xy 215.232365 230.187303) (xy 215.078986 230.1495) + (xy 215.078985 230.1495) (xy 214.921015 230.1495) (xy 214.921014 230.1495) (xy 214.767634 230.187303) + (xy 214.627762 230.260715) (xy 214.509516 230.365471) (xy 214.419781 230.495475) (xy 214.41978 230.495476) + (xy 214.363762 230.643181) (xy 214.344722 230.799999) (xy 214.344722 230.8) (xy 214.363762 230.956818) + (xy 214.41978 231.104523) (xy 214.41978 231.104524) (xy 214.437407 231.13006) (xy 214.45929 231.196414) + (xy 214.441825 231.264066) (xy 214.390557 231.311536) (xy 214.335357 231.3245) (xy 205.906899 231.3245) + (xy 205.83986 231.304815) (xy 205.819218 231.288181) (xy 205.484517 230.95348) (xy 205.451032 230.892157) + (xy 205.449102 230.850857) (xy 205.455278 230.8) (xy 205.436237 230.643182) (xy 205.38022 230.495477) + (xy 205.290483 230.36547) (xy 205.17224 230.260717) (xy 205.172238 230.260716) (xy 205.172237 230.260715) + (xy 205.032365 230.187303) (xy 204.878986 230.1495) (xy 204.878985 230.1495) (xy 204.721015 230.1495) + (xy 204.721014 230.1495) (xy 204.567634 230.187303) (xy 204.427762 230.260715) (xy 204.309516 230.365471) + (xy 204.219781 230.495475) (xy 204.21978 230.495476) (xy 204.163762 230.643181) (xy 204.144722 230.799999) + (xy 204.144722 230.8) (xy 204.163762 230.956818) (xy 204.214539 231.090704) (xy 204.21978 231.104523) + (xy 204.309517 231.23453) (xy 204.42776 231.339283) (xy 204.427762 231.339284) (xy 204.567634 231.412696) + (xy 204.721014 231.4505) (xy 204.868101 231.4505) (xy 204.93514 231.470185) (xy 204.955782 231.486819) + (xy 205.399525 231.930562) (xy 205.469438 232.000475) (xy 205.555059 232.049908) (xy 205.555062 232.04991) + (xy 205.602811 232.062705) (xy 205.602812 232.062705) (xy 205.612903 232.065408) (xy 205.650564 232.0755) + (xy 205.650565 232.0755) (xy 205.650566 232.0755) (xy 244.049435 232.0755) (xy 244.049436 232.0755) + (xy 244.097186 232.062705) (xy 244.144938 232.04991) (xy 244.230562 232.000475) (xy 244.300475 231.930562) + (xy 244.731038 231.499999) (xy 245.544722 231.499999) (xy 245.544722 231.5) (xy 245.563762 231.656818) + (xy 245.595038 231.739284) (xy 245.61978 231.804523) (xy 245.709517 231.93453) (xy 245.82776 232.039283) + (xy 245.827762 232.039284) (xy 245.967634 232.112696) (xy 246.121014 232.1505) (xy 246.121015 232.1505) + (xy 246.278985 232.1505) (xy 246.432365 232.112696) (xy 246.503237 232.075499) (xy 246.57224 232.039283) + (xy 246.690483 231.93453) (xy 246.694257 231.929061) (xy 246.748537 231.885071) (xy 246.796308 231.8755) + (xy 264.749435 231.8755) (xy 264.749436 231.8755) (xy 264.789539 231.864754) (xy 264.800285 231.861875) + (xy 264.849435 231.848705) (xy 264.911206 231.848083) (xy 264.92101 231.850499) (xy 264.921013 231.8505) + (xy 264.921015 231.8505) (xy 265.078985 231.8505) (xy 265.232365 231.812696) (xy 265.247937 231.804523) + (xy 265.37224 231.739283) (xy 265.490483 231.63453) (xy 265.58022 231.504523) (xy 265.636237 231.356818) + (xy 265.655278 231.2) (xy 265.647907 231.139289) (xy 265.636237 231.043181) (xy 265.604961 230.960715) + (xy 265.58022 230.895477) (xy 265.490483 230.76547) (xy 265.37224 230.660717) (xy 265.372238 230.660716) + (xy 265.372237 230.660715) (xy 265.232365 230.587303) (xy 265.078986 230.5495) (xy 265.078985 230.5495) + (xy 264.921015 230.5495) (xy 264.921014 230.5495) (xy 264.767634 230.587303) (xy 264.627762 230.660715) + (xy 264.509516 230.765471) (xy 264.419781 230.895475) (xy 264.41978 230.895476) (xy 264.363274 231.044471) + (xy 264.321096 231.100174) (xy 264.255498 231.124231) (xy 264.247332 231.1245) (xy 246.796308 231.1245) + (xy 246.729269 231.104815) (xy 246.694257 231.070938) (xy 246.690483 231.06547) (xy 246.57224 230.960717) + (xy 246.572238 230.960716) (xy 246.572237 230.960715) (xy 246.432365 230.887303) (xy 246.278986 230.8495) + (xy 246.278985 230.8495) (xy 246.121015 230.8495) (xy 246.121014 230.8495) (xy 245.967634 230.887303) + (xy 245.827762 230.960715) (xy 245.709516 231.065471) (xy 245.619781 231.195475) (xy 245.61978 231.195476) + (xy 245.563762 231.343181) (xy 245.544722 231.499999) (xy 244.731038 231.499999) (xy 246.444217 229.786818) + (xy 246.50554 229.753334) (xy 246.531898 229.7505) (xy 246.678985 229.7505) (xy 246.832365 229.712696) + (xy 246.847937 229.704523) (xy 246.97224 229.639283) (xy 247.090483 229.53453) (xy 247.18022 229.404523) + (xy 247.236237 229.256818) (xy 247.255278 229.1) (xy 247.255221 229.099526) (xy 247.236237 228.943181) + (xy 247.204961 228.860715) (xy 247.18022 228.795477) (xy 247.090483 228.66547) (xy 246.97224 228.560717) + (xy 246.972238 228.560716) (xy 246.972237 228.560715) (xy 246.832365 228.487303) (xy 246.678986 228.4495) + (xy 246.678985 228.4495) (xy 246.521015 228.4495) (xy 246.521014 228.4495) (xy 246.367635 228.487303) + (xy 246.325618 228.509356) (xy 246.25711 228.52308) (xy 246.192057 228.497588) (xy 246.151113 228.440972) + (xy 246.144897 228.414505) (xy 246.136237 228.343182) (xy 246.08022 228.195477) (xy 245.990483 228.06547) + (xy 245.87224 227.960717) (xy 245.872238 227.960716) (xy 245.872237 227.960715) (xy 245.732365 227.887303) + (xy 245.578986 227.8495) (xy 245.578985 227.8495) (xy 245.421015 227.8495) (xy 245.421014 227.8495) + (xy 245.267634 227.887303) (xy 245.127762 227.960715) (xy 245.009516 228.06547) (xy 245.007089 228.068987) + (xy 245.005742 228.070938) (xy 244.951463 228.114929) (xy 244.903692 228.1245) (xy 243.676899 228.1245) + (xy 243.60986 228.104815) (xy 243.589218 228.088181) (xy 243.213218 227.712181) (xy 243.179733 227.650858) + (xy 243.184717 227.581166) (xy 243.226589 227.525233) (xy 243.292053 227.500816) (xy 243.300899 227.5005) + (xy 244.394676 227.5005) (xy 244.394677 227.500499) (xy 244.46774 227.485966) (xy 244.550601 227.430601) + (xy 244.605966 227.34774) (xy 244.6205 227.274674) (xy 244.6205 226.410186) (xy 267.1745 226.410186) + (xy 267.1745 226.679813) (xy 267.204686 226.947719) (xy 267.204688 226.947731) (xy 267.264684 227.210594) + (xy 267.264687 227.210602) (xy 267.353734 227.465082) (xy 267.470714 227.707994) (xy 267.511864 227.773483) + (xy 267.614162 227.936289) (xy 267.782266 228.147085) (xy 267.972915 228.337734) (xy 268.183711 228.505838) + (xy 268.405088 228.644939) (xy 268.412005 228.649285) (xy 268.424529 228.655316) (xy 268.654921 228.766267) + (xy 268.846049 228.833145) (xy 268.909397 228.855312) (xy 268.909405 228.855315) (xy 268.909408 228.855315) + (xy 268.909409 228.855316) (xy 269.172268 228.915312) (xy 269.440187 228.945499) (xy 269.440188 228.9455) + (xy 269.440191 228.9455) (xy 269.709812 228.9455) (xy 269.709812 228.945499) (xy 269.977732 228.915312) + (xy 270.240591 228.855316) (xy 270.495079 228.766267) (xy 270.737997 228.649284) (xy 270.966289 228.505838) + (xy 271.177085 228.337734) (xy 271.367734 228.147085) (xy 271.535838 227.936289) (xy 271.679284 227.707997) + (xy 271.796267 227.465079) (xy 271.885316 227.210591) (xy 271.945312 226.947732) (xy 271.9755 226.679809) + (xy 271.9755 226.410191) (xy 271.945312 226.142268) (xy 271.885316 225.879409) (xy 271.796267 225.624921) + (xy 271.679284 225.382003) (xy 271.535838 225.153711) (xy 271.367734 224.942915) (xy 271.177085 224.752266) + (xy 270.966289 224.584162) (xy 270.737997 224.440716) (xy 270.737994 224.440714) (xy 270.495082 224.323734) + (xy 270.240602 224.234687) (xy 270.240594 224.234684) (xy 270.043446 224.189687) (xy 269.977732 224.174688) + (xy 269.977728 224.174687) (xy 269.977719 224.174686) (xy 269.709813 224.1445) (xy 269.709809 224.1445) + (xy 269.440191 224.1445) (xy 269.440186 224.1445) (xy 269.17228 224.174686) (xy 269.172268 224.174688) + (xy 268.909405 224.234684) (xy 268.909397 224.234687) (xy 268.654917 224.323734) (xy 268.412005 224.440714) + (xy 268.183712 224.584161) (xy 267.972915 224.752265) (xy 267.782265 224.942915) (xy 267.614161 225.153712) + (xy 267.470714 225.382005) (xy 267.353734 225.624917) (xy 267.264687 225.879397) (xy 267.264684 225.879405) + (xy 267.204688 226.142268) (xy 267.204686 226.14228) (xy 267.1745 226.410186) (xy 244.6205 226.410186) + (xy 244.6205 225.725326) (xy 244.6205 225.725323) (xy 244.620499 225.725321) (xy 244.605967 225.652264) + (xy 244.605966 225.65226) (xy 244.57407 225.604524) (xy 244.550601 225.569399) (xy 244.469891 225.515471) + (xy 244.467739 225.514033) (xy 244.467735 225.514032) (xy 244.394677 225.4995) (xy 244.394674 225.4995) + (xy 242.845326 225.4995) (xy 242.845323 225.4995) (xy 242.772264 225.514032) (xy 242.77226 225.514033) + (xy 242.689399 225.569399) (xy 242.634033 225.65226) (xy 242.634032 225.652264) (xy 242.6195 225.725321) + (xy 242.6195 226.819101) (xy 242.599815 226.88614) (xy 242.547011 226.931895) (xy 242.477853 226.941839) + (xy 242.414297 226.912814) (xy 242.407819 226.906782) (xy 241.123727 225.62269) (xy 241.090242 225.561367) + (xy 241.095226 225.491675) (xy 241.137098 225.435742) (xy 241.153772 225.425217) (xy 241.22224 225.389283) + (xy 241.340483 225.28453) (xy 241.43022 225.154523) (xy 241.486237 225.006818) (xy 241.505278 224.85) + (xy 241.499895 224.805662) (xy 241.486237 224.693181) (xy 241.458168 224.61917) (xy 241.43022 224.545477) + (xy 241.340483 224.41547) (xy 241.22224 224.310717) (xy 241.222238 224.310716) (xy 241.222237 224.310715) + (xy 241.082365 224.237303) (xy 240.928986 224.1995) (xy 240.928985 224.1995) (xy 240.7819 224.1995) + (xy 240.714861 224.179815) (xy 240.694219 224.163181) (xy 240.531038 224) (xy 242.614659 224) (xy 242.633975 224.196129) + (xy 242.633976 224.196132) (xy 242.689198 224.378175) (xy 242.691188 224.384733) (xy 242.784086 224.558532) + (xy 242.78409 224.558539) (xy 242.909116 224.710883) (xy 243.06146 224.835909) (xy 243.061467 224.835913) + (xy 243.235266 224.928811) (xy 243.235269 224.928811) (xy 243.235273 224.928814) (xy 243.423868 224.986024) + (xy 243.62 225.005341) (xy 243.816132 224.986024) (xy 244.004727 224.928814) (xy 244.178538 224.83591) + (xy 244.330883 224.710883) (xy 244.45591 224.558538) (xy 244.530745 224.418532) (xy 244.548811 224.384733) + (xy 244.548811 224.384732) (xy 244.548814 224.384727) (xy 244.606024 224.196132) (xy 244.625341 224) + (xy 244.606024 223.803868) (xy 244.548814 223.615273) (xy 244.548811 223.615269) (xy 244.548811 223.615266) + (xy 244.455913 223.441467) (xy 244.455909 223.44146) (xy 244.330883 223.289116) (xy 244.178539 223.16409) + (xy 244.178532 223.164086) (xy 244.004733 223.071188) (xy 244.004727 223.071186) (xy 243.816132 223.013976) + (xy 243.816129 223.013975) (xy 243.62 222.994659) (xy 243.42387 223.013975) (xy 243.235266 223.071188) + (xy 243.061467 223.164086) (xy 243.06146 223.16409) (xy 242.909116 223.289116) (xy 242.78409 223.44146) + (xy 242.784086 223.441467) (xy 242.691188 223.615266) (xy 242.633975 223.80387) (xy 242.614659 224) + (xy 240.531038 224) (xy 235.611819 219.080781) (xy 235.578334 219.019458) (xy 235.5755 218.9931) + (xy 235.5755 208.819994) (xy 235.869529 208.819994) (xy 235.869529 208.820005) (xy 235.889379 209.059559) + (xy 235.948389 209.292589) (xy 236.044951 209.512729) (xy 236.144744 209.665472) (xy 236.176429 209.713969) + (xy 236.339236 209.890825) (xy 236.339239 209.890827) (xy 236.339242 209.89083) (xy 236.528924 210.038466) + (xy 236.52893 210.03847) (xy 236.528933 210.038472) (xy 236.647952 210.102882) (xy 236.736062 210.150565) + (xy 236.740344 210.152882) (xy 236.757208 210.158671) (xy 236.967699 210.230933) (xy 236.967701 210.230933) + (xy 236.967703 210.230934) (xy 237.204808 210.2705) (xy 237.204809 210.2705) (xy 237.445191 210.2705) + (xy 237.445192 210.2705) (xy 237.682297 210.230934) (xy 237.909656 210.152882) (xy 238.121067 210.038472) + (xy 238.138988 210.024524) (xy 238.209762 209.969438) (xy 238.310764 209.890825) (xy 238.473571 209.713969) + (xy 238.605049 209.512728) (xy 238.70161 209.292591) (xy 238.76062 209.059563) (xy 238.780471 208.82) + (xy 238.780471 208.819994) (xy 239.269529 208.819994) (xy 239.269529 208.820005) (xy 239.289379 209.059559) + (xy 239.348389 209.292589) (xy 239.444951 209.512729) (xy 239.544744 209.665472) (xy 239.576429 209.713969) + (xy 239.739236 209.890825) (xy 239.739239 209.890827) (xy 239.739242 209.89083) (xy 239.928924 210.038466) + (xy 239.92893 210.03847) (xy 239.928933 210.038472) (xy 240.047952 210.102882) (xy 240.136062 210.150565) + (xy 240.140344 210.152882) (xy 240.157208 210.158671) (xy 240.367699 210.230933) (xy 240.367701 210.230933) + (xy 240.367703 210.230934) (xy 240.604808 210.2705) (xy 240.604809 210.2705) (xy 240.845191 210.2705) + (xy 240.845192 210.2705) (xy 241.082297 210.230934) (xy 241.309656 210.152882) (xy 241.521067 210.038472) + (xy 241.538988 210.024524) (xy 241.609762 209.969438) (xy 241.710764 209.890825) (xy 241.873571 209.713969) + (xy 242.005049 209.512728) (xy 242.10161 209.292591) (xy 242.16062 209.059563) (xy 242.180471 208.82) + (xy 242.180471 208.819994) (xy 245.059529 208.819994) (xy 245.059529 208.820005) (xy 245.079379 209.059559) + (xy 245.138389 209.292589) (xy 245.234951 209.512729) (xy 245.334744 209.665472) (xy 245.366429 209.713969) + (xy 245.529236 209.890825) (xy 245.529239 209.890827) (xy 245.529242 209.89083) (xy 245.718924 210.038466) + (xy 245.71893 210.03847) (xy 245.718933 210.038472) (xy 245.837952 210.102882) (xy 245.926062 210.150565) + (xy 245.930344 210.152882) (xy 245.947208 210.158671) (xy 246.157699 210.230933) (xy 246.157701 210.230933) + (xy 246.157703 210.230934) (xy 246.394808 210.2705) (xy 246.394809 210.2705) (xy 246.635191 210.2705) + (xy 246.635192 210.2705) (xy 246.872297 210.230934) (xy 247.099656 210.152882) (xy 247.311067 210.038472) + (xy 247.328988 210.024524) (xy 247.399762 209.969438) (xy 247.500764 209.890825) (xy 247.663571 209.713969) + (xy 247.795049 209.512728) (xy 247.89161 209.292591) (xy 247.95062 209.059563) (xy 247.970471 208.82) + (xy 247.966328 208.770005) (xy 247.95062 208.58044) (xy 247.95062 208.580437) (xy 247.89161 208.347409) + (xy 247.795049 208.127272) (xy 247.663571 207.926031) (xy 247.500764 207.749175) (xy 247.500759 207.749171) + (xy 247.500757 207.749169) (xy 247.311075 207.601533) (xy 247.311069 207.601529) (xy 247.099657 207.487118) + (xy 247.099652 207.487116) (xy 246.8723 207.409066) (xy 246.694468 207.379391) (xy 246.635192 207.3695) + (xy 246.394808 207.3695) (xy 246.347387 207.377413) (xy 246.157699 207.409066) (xy 245.930347 207.487116) + (xy 245.930342 207.487118) (xy 245.71893 207.601529) (xy 245.718924 207.601533) (xy 245.529242 207.749169) + (xy 245.529239 207.749172) (xy 245.36643 207.926029) (xy 245.366427 207.926033) (xy 245.234951 208.12727) + (xy 245.138389 208.34741) (xy 245.079379 208.58044) (xy 245.059529 208.819994) (xy 242.180471 208.819994) + (xy 242.176328 208.770005) (xy 242.16062 208.58044) (xy 242.16062 208.580437) (xy 242.10161 208.347409) + (xy 242.005049 208.127272) (xy 241.873571 207.926031) (xy 241.710764 207.749175) (xy 241.710759 207.749171) + (xy 241.710757 207.749169) (xy 241.521075 207.601533) (xy 241.521069 207.601529) (xy 241.309657 207.487118) + (xy 241.309652 207.487116) (xy 241.0823 207.409066) (xy 240.904468 207.379391) (xy 240.845192 207.3695) + (xy 240.604808 207.3695) (xy 240.557387 207.377413) (xy 240.367699 207.409066) (xy 240.140347 207.487116) + (xy 240.140342 207.487118) (xy 239.92893 207.601529) (xy 239.928924 207.601533) (xy 239.739242 207.749169) + (xy 239.739239 207.749172) (xy 239.57643 207.926029) (xy 239.576427 207.926033) (xy 239.444951 208.12727) + (xy 239.348389 208.34741) (xy 239.289379 208.58044) (xy 239.269529 208.819994) (xy 238.780471 208.819994) + (xy 238.776328 208.770005) (xy 238.76062 208.58044) (xy 238.76062 208.580437) (xy 238.70161 208.347409) + (xy 238.605049 208.127272) (xy 238.473571 207.926031) (xy 238.310764 207.749175) (xy 238.310759 207.749171) + (xy 238.310757 207.749169) (xy 238.121075 207.601533) (xy 238.121069 207.601529) (xy 237.909657 207.487118) + (xy 237.909652 207.487116) (xy 237.6823 207.409066) (xy 237.504468 207.379391) (xy 237.445192 207.3695) + (xy 237.204808 207.3695) (xy 237.157387 207.377413) (xy 236.967699 207.409066) (xy 236.740347 207.487116) + (xy 236.740342 207.487118) (xy 236.52893 207.601529) (xy 236.528924 207.601533) (xy 236.339242 207.749169) + (xy 236.339239 207.749172) (xy 236.17643 207.926029) (xy 236.176427 207.926033) (xy 236.044951 208.12727) + (xy 235.948389 208.34741) (xy 235.889379 208.58044) (xy 235.869529 208.819994) (xy 235.5755 208.819994) + (xy 235.5755 202.500564) (xy 235.575197 202.499436) (xy 235.575184 202.499388) (xy 235.54991 202.405064) + (xy 235.549909 202.40506) (xy 235.544533 202.395749) (xy 235.500475 202.319438) (xy 235.430562 202.249525) + (xy 234.72782 201.546783) (xy 234.694335 201.48546) (xy 234.699319 201.415768) (xy 234.741191 201.359835) + (xy 234.75786 201.349314) (xy 234.87224 201.289283) (xy 234.990483 201.18453) (xy 235.08022 201.054523) + (xy 235.080223 201.054513) (xy 235.081635 201.051825) (xy 235.083196 201.050211) (xy 235.084481 201.04835) + (xy 235.08479 201.048563) (xy 235.130217 201.00161) (xy 235.198235 200.985632) (xy 235.264094 201.008963) + (xy 235.279116 201.021764) (xy 235.887914 201.630562) (xy 235.957827 201.700475) (xy 236.043451 201.74991) + (xy 236.056341 201.753364) (xy 236.06923 201.756818) (xy 236.069231 201.756818) (xy 236.083965 201.760765) + (xy 236.138953 201.7755) (xy 236.138954 201.7755) (xy 243.023692 201.7755) (xy 243.090731 201.795185) + (xy 243.125742 201.829061) (xy 243.128163 201.832569) (xy 243.129515 201.834528) (xy 243.129517 201.83453) + (xy 243.24776 201.939283) (xy 243.247762 201.939284) (xy 243.387634 202.012696) (xy 243.541014 202.0505) + (xy 243.541015 202.0505) (xy 243.698985 202.0505) (xy 243.852365 202.012696) (xy 243.99224 201.939283) + (xy 244.110483 201.83453) (xy 244.20022 201.704523) (xy 244.256237 201.556818) (xy 244.275278 201.4) + (xy 244.275278 201.399995) (xy 244.256237 201.243181) (xy 244.204012 201.105476) (xy 244.20022 201.095477) + (xy 244.110483 200.96547) (xy 243.99224 200.860717) (xy 243.992238 200.860716) (xy 243.992237 200.860715) + (xy 243.852365 200.787303) (xy 243.698986 200.7495) (xy 243.698985 200.7495) (xy 243.541015 200.7495) + (xy 243.541014 200.7495) (xy 243.387634 200.787303) (xy 243.247762 200.860715) (xy 243.129516 200.96547) + (xy 243.127089 200.968987) (xy 243.125742 200.970938) (xy 243.071463 201.014929) (xy 243.023692 201.0245) + (xy 236.395288 201.0245) (xy 236.328249 201.004815) (xy 236.307607 200.988181) (xy 233.586607 198.267181) + (xy 233.553122 198.205858) (xy 233.558106 198.136166) (xy 233.599978 198.080233) (xy 233.665442 198.055816) + (xy 233.674288 198.0555) (xy 241.793887 198.0555) (xy 241.793907 198.0555) (xy 241.806442 198.055192) + (xy 241.818596 198.054595) (xy 241.831105 198.053673) (xy 242.007978 198.036252) (xy 242.032777 198.032573) + (xy 242.056618 198.027831) (xy 242.080942 198.021738) (xy 242.245165 197.971922) (xy 242.268779 197.963473) + (xy 242.291237 197.95417) (xy 242.313898 197.943452) (xy 242.314404 197.943182) (xy 242.375547 197.9105) + (xy 242.46524 197.862558) (xy 242.486745 197.849669) (xy 242.506957 197.836164) (xy 242.527098 197.821226) + (xy 242.659754 197.712358) (xy 242.678332 197.69552) (xy 242.69552 197.678332) (xy 242.712358 197.659754) + (xy 242.821226 197.527098) (xy 242.836164 197.506957) (xy 242.849669 197.486745) (xy 242.862558 197.46524) + (xy 242.943452 197.313898) (xy 242.95417 197.291237) (xy 242.963473 197.268779) (xy 242.971922 197.245165) + (xy 243.021738 197.080942) (xy 243.027831 197.056618) (xy 243.032573 197.032777) (xy 243.036252 197.007978) + (xy 243.053673 196.831105) (xy 243.053711 196.830601) (xy 243.054593 196.818622) (xy 243.054595 196.818596) + (xy 243.055192 196.806442) (xy 243.0555 196.793907) (xy 243.0555 194.125321) (xy 245.0645 194.125321) + (xy 245.0645 196.574678) (xy 245.079032 196.647735) (xy 245.079033 196.647739) (xy 245.079034 196.64774) + (xy 245.134399 196.730601) (xy 245.192524 196.769438) (xy 245.21726 196.785966) (xy 245.217264 196.785967) + (xy 245.290321 196.800499) (xy 245.290324 196.8005) (xy 245.290326 196.8005) (xy 247.739676 196.8005) + (xy 247.739677 196.800499) (xy 247.81274 196.785966) (xy 247.895601 196.730601) (xy 247.950966 196.64774) + (xy 247.9655 196.574674) (xy 247.9655 194.125326) (xy 247.9655 194.125323) (xy 247.965499 194.125321) + (xy 247.950967 194.052264) (xy 247.950966 194.05226) (xy 247.94215 194.039066) (xy 247.895601 193.969399) + (xy 247.830266 193.925744) (xy 247.812739 193.914033) (xy 247.812735 193.914032) (xy 247.739677 193.8995) + (xy 247.739674 193.8995) (xy 245.290326 193.8995) (xy 245.290323 193.8995) (xy 245.217264 193.914032) + (xy 245.21726 193.914033) (xy 245.134399 193.969399) (xy 245.079033 194.05226) (xy 245.079032 194.052264) + (xy 245.0645 194.125321) (xy 243.0555 194.125321) (xy 243.0555 166.2) (xy 244.3 166.2) (xy 244.3 188.8) + (xy 251.376 188.8) (xy 251.443039 188.819685) (xy 251.488794 188.872489) (xy 251.5 188.924) (xy 251.5 194.761107) + (xy 251.480315 194.828146) (xy 251.427511 194.873901) (xy 251.358353 194.883845) (xy 251.294797 194.85482) + (xy 251.262444 194.810917) (xy 251.203623 194.676818) (xy 251.195049 194.657272) (xy 251.192705 194.653685) + (xy 251.1116 194.529544) (xy 251.063571 194.456031) (xy 250.900764 194.279175) (xy 250.900759 194.279171) + (xy 250.900757 194.279169) (xy 250.711075 194.131533) (xy 250.711069 194.131529) (xy 250.499657 194.017118) + (xy 250.499652 194.017116) (xy 250.2723 193.939066) (xy 250.094468 193.909391) (xy 250.035192 193.8995) + (xy 249.794808 193.8995) (xy 249.747387 193.907413) (xy 249.557699 193.939066) (xy 249.330347 194.017116) + (xy 249.330342 194.017118) (xy 249.11893 194.131529) (xy 249.118924 194.131533) (xy 248.929242 194.279169) + (xy 248.929239 194.279172) (xy 248.929236 194.279174) (xy 248.929236 194.279175) (xy 248.908972 194.301188) + (xy 248.76643 194.456029) (xy 248.766427 194.456033) (xy 248.634951 194.65727) (xy 248.538389 194.87741) + (xy 248.479379 195.11044) (xy 248.459529 195.349994) (xy 248.459529 195.350005) (xy 248.479379 195.589559) + (xy 248.538389 195.822589) (xy 248.634951 196.042729) (xy 248.766427 196.243966) (xy 248.766429 196.243969) + (xy 248.929236 196.420825) (xy 248.929239 196.420827) (xy 248.929242 196.42083) (xy 249.118924 196.568466) + (xy 249.11893 196.56847) (xy 249.118933 196.568472) (xy 249.265407 196.64774) (xy 249.326123 196.680598) + (xy 249.330344 196.682882) (xy 249.330347 196.682883) (xy 249.557699 196.760933) (xy 249.557701 196.760933) + (xy 249.557703 196.760934) (xy 249.794808 196.8005) (xy 249.794809 196.8005) (xy 250.035191 196.8005) + (xy 250.035192 196.8005) (xy 250.272297 196.760934) (xy 250.499656 196.682882) (xy 250.711067 196.568472) + (xy 250.900764 196.420825) (xy 251.063571 196.243969) (xy 251.195049 196.042728) (xy 251.262444 195.889081) + (xy 251.3074 195.835596) (xy 251.374136 195.814906) (xy 251.441464 195.83358) (xy 251.488007 195.885691) + (xy 251.5 195.938892) (xy 251.5 208.231107) (xy 251.480315 208.298146) (xy 251.427511 208.343901) + (xy 251.358353 208.353845) (xy 251.294797 208.32482) (xy 251.262444 208.280917) (xy 251.195048 208.12727) + (xy 251.063572 207.926033) (xy 251.063571 207.926031) (xy 250.900764 207.749175) (xy 250.900759 207.749171) + (xy 250.900757 207.749169) (xy 250.711075 207.601533) (xy 250.711069 207.601529) (xy 250.499657 207.487118) + (xy 250.499652 207.487116) (xy 250.2723 207.409066) (xy 250.094468 207.379391) (xy 250.035192 207.3695) + (xy 249.794808 207.3695) (xy 249.747387 207.377413) (xy 249.557699 207.409066) (xy 249.330347 207.487116) + (xy 249.330342 207.487118) (xy 249.11893 207.601529) (xy 249.118924 207.601533) (xy 248.929242 207.749169) + (xy 248.929239 207.749172) (xy 248.76643 207.926029) (xy 248.766427 207.926033) (xy 248.634951 208.12727) + (xy 248.538389 208.34741) (xy 248.479379 208.58044) (xy 248.459529 208.819994) (xy 248.459529 208.820005) + (xy 248.479379 209.059559) (xy 248.538389 209.292589) (xy 248.634951 209.512729) (xy 248.734744 209.665472) + (xy 248.766429 209.713969) (xy 248.929236 209.890825) (xy 248.929239 209.890827) (xy 248.929242 209.89083) + (xy 249.118924 210.038466) (xy 249.11893 210.03847) (xy 249.118933 210.038472) (xy 249.237952 210.102882) + (xy 249.326062 210.150565) (xy 249.330344 210.152882) (xy 249.347208 210.158671) (xy 249.557699 210.230933) + (xy 249.557701 210.230933) (xy 249.557703 210.230934) (xy 249.794808 210.2705) (xy 249.794809 210.2705) + (xy 250.035191 210.2705) (xy 250.035192 210.2705) (xy 250.272297 210.230934) (xy 250.499656 210.152882) + (xy 250.711067 210.038472) (xy 250.728988 210.024524) (xy 250.799762 209.969438) (xy 250.900764 209.890825) + (xy 251.063571 209.713969) (xy 251.195049 209.512728) (xy 251.262444 209.359081) (xy 251.3074 209.305596) + (xy 251.374136 209.284906) (xy 251.441464 209.30358) (xy 251.488007 209.355691) (xy 251.5 209.408892) + (xy 251.5 213.5) (xy 268.5 213.5) (xy 268.5 213) (xy 252.124 213) (xy 252.056961 212.980315) (xy 252.011206 212.927511) + (xy 252 212.876) (xy 252 209.719999) (xy 256.654722 209.719999) (xy 256.654722 209.72) (xy 256.673762 209.876818) + (xy 256.717 209.990825) (xy 256.72978 210.024523) (xy 256.819517 210.15453) (xy 256.93776 210.259283) + (xy 256.937762 210.259284) (xy 257.077634 210.332696) (xy 257.231014 210.3705) (xy 257.231015 210.3705) + (xy 257.388985 210.3705) (xy 257.542365 210.332696) (xy 257.568045 210.319218) (xy 257.68224 210.259283) + (xy 257.800483 210.15453) (xy 257.804257 210.149061) (xy 257.858537 210.105071) (xy 257.906308 210.0955) + (xy 258.95474 210.0955) (xy 258.954741 210.0955) (xy 259.002491 210.082705) (xy 259.050243 210.06991) + (xy 259.135867 210.020475) (xy 259.20578 209.950562) (xy 262.540474 206.615868) (xy 262.540475 206.615867) + (xy 262.58991 206.530243) (xy 262.6155 206.43474) (xy 262.6155 206.162202) (xy 262.635185 206.095163) + (xy 262.657274 206.069386) (xy 262.730482 206.004531) (xy 262.730483 206.00453) (xy 262.82022 205.874523) + (xy 262.876237 205.726818) (xy 262.889324 205.619029) (xy 262.916945 205.554853) (xy 262.924728 205.546307) + (xy 262.945838 205.525197) (xy 263.007159 205.491714) (xy 263.076851 205.496698) (xy 263.132784 205.53857) + (xy 263.156613 205.597933) (xy 263.163763 205.656819) (xy 263.185139 205.713182) (xy 263.21978 205.804523) + (xy 263.309517 205.93453) (xy 263.42776 206.039283) (xy 263.427762 206.039284) (xy 263.567634 206.112696) + (xy 263.721014 206.1505) (xy 263.721015 206.1505) (xy 263.878985 206.1505) (xy 264.032365 206.112696) + (xy 264.114884 206.069386) (xy 264.17224 206.039283) (xy 264.290483 205.93453) (xy 264.294257 205.929061) + (xy 264.348537 205.885071) (xy 264.396308 205.8755) (xy 266.303692 205.8755) (xy 266.370731 205.895185) + (xy 266.405742 205.929061) (xy 266.408163 205.932569) (xy 266.409515 205.934528) (xy 266.409517 205.93453) + (xy 266.52776 206.039283) (xy 266.527762 206.039284) (xy 266.667634 206.112696) (xy 266.821014 206.1505) + (xy 266.821015 206.1505) (xy 266.978985 206.1505) (xy 267.132365 206.112696) (xy 267.214884 206.069386) + (xy 267.27224 206.039283) (xy 267.390483 205.93453) (xy 267.48022 205.804523) (xy 267.536237 205.656818) + (xy 267.555278 205.5) (xy 267.552223 205.474835) (xy 267.536237 205.343181) (xy 267.508302 205.269524) + (xy 267.48022 205.195477) (xy 267.390483 205.06547) (xy 267.27224 204.960717) (xy 267.272238 204.960716) + (xy 267.272237 204.960715) (xy 267.132365 204.887303) (xy 266.978986 204.8495) (xy 266.978985 204.8495) + (xy 266.821015 204.8495) (xy 266.821014 204.8495) (xy 266.667634 204.887303) (xy 266.527762 204.960715) + (xy 266.409516 205.06547) (xy 266.407089 205.068987) (xy 266.405742 205.070938) (xy 266.351463 205.114929) + (xy 266.303692 205.1245) (xy 264.396308 205.1245) (xy 264.329269 205.104815) (xy 264.294257 205.070938) + (xy 264.290483 205.06547) (xy 264.17224 204.960717) (xy 264.172238 204.960716) (xy 264.172237 204.960715) + (xy 264.032366 204.887304) (xy 263.885912 204.851207) (xy 263.825532 204.816051) (xy 263.793743 204.753832) + (xy 263.800639 204.684303) (xy 263.827904 204.643131) (xy 265.334217 203.136819) (xy 265.39554 203.103334) + (xy 265.421898 203.1005) (xy 265.568985 203.1005) (xy 265.722365 203.062696) (xy 265.784863 203.029894) + (xy 265.86224 202.989283) (xy 265.980483 202.88453) (xy 266.07022 202.754523) (xy 266.126237 202.606818) + (xy 266.145278 202.45) (xy 266.126237 202.293182) (xy 266.07022 202.145477) (xy 265.980483 202.01547) + (xy 265.86224 201.910717) (xy 265.862238 201.910716) (xy 265.862237 201.910715) (xy 265.722365 201.837303) + (xy 265.568986 201.7995) (xy 265.568985 201.7995) (xy 265.411015 201.7995) (xy 265.411014 201.7995) + (xy 265.257634 201.837303) (xy 265.117762 201.910715) (xy 264.999516 202.015471) (xy 264.909781 202.145475) + (xy 264.90978 202.145476) (xy 264.853763 202.293181) (xy 264.834722 202.45) (xy 264.840896 202.500854) + (xy 264.829435 202.569777) (xy 264.805481 202.60348) (xy 262.505205 204.903756) (xy 262.443882 204.937241) + (xy 262.387851 204.936472) (xy 262.318988 204.9195) (xy 262.318985 204.9195) (xy 262.161015 204.9195) + (xy 262.161014 204.9195) (xy 262.007634 204.957303) (xy 261.867762 205.030715) (xy 261.749516 205.135471) + (xy 261.659781 205.265475) (xy 261.65978 205.265476) (xy 261.603762 205.413181) (xy 261.584722 205.569999) + (xy 261.584722 205.57) (xy 261.603762 205.726818) (xy 261.647894 205.843182) (xy 261.65978 205.874523) + (xy 261.687576 205.914794) (xy 261.749517 206.004531) (xy 261.822726 206.069386) (xy 261.859853 206.128574) + (xy 261.8645 206.162202) (xy 261.8645 206.178406) (xy 261.844815 206.245445) (xy 261.828181 206.266087) + (xy 258.786087 209.308181) (xy 258.724764 209.341666) (xy 258.698406 209.3445) (xy 257.906308 209.3445) + (xy 257.839269 209.324815) (xy 257.804257 209.290938) (xy 257.800483 209.28547) (xy 257.68224 209.180717) + (xy 257.682238 209.180716) (xy 257.682237 209.180715) (xy 257.542365 209.107303) (xy 257.388986 209.0695) + (xy 257.388985 209.0695) (xy 257.231015 209.0695) (xy 257.231014 209.0695) (xy 257.077634 209.107303) + (xy 256.937762 209.180715) (xy 256.819516 209.285471) (xy 256.729781 209.415475) (xy 256.72978 209.415476) + (xy 256.673762 209.563181) (xy 256.654722 209.719999) (xy 252 209.719999) (xy 252 196.950565) (xy 252.6245 196.950565) + (xy 252.6245 203.549435) (xy 252.65009 203.644938) (xy 252.667136 203.674462) (xy 252.699526 203.730563) + (xy 252.699528 203.730565) (xy 253.788181 204.819218) (xy 253.821666 204.880541) (xy 253.8245 204.906899) + (xy 253.8245 205.307796) (xy 253.804815 205.374835) (xy 253.782727 205.400611) (xy 253.709518 205.465468) + (xy 253.619781 205.595475) (xy 253.61978 205.595476) (xy 253.563762 205.743181) (xy 253.544722 205.899999) + (xy 253.544722 205.9) (xy 253.563762 206.056818) (xy 253.608403 206.174524) (xy 253.61978 206.204523) + (xy 253.709517 206.33453) (xy 253.82776 206.439283) (xy 253.827762 206.439284) (xy 253.967634 206.512696) + (xy 254.121014 206.5505) (xy 254.121015 206.5505) (xy 254.278985 206.5505) (xy 254.432365 206.512696) + (xy 254.489524 206.482696) (xy 254.57224 206.439283) (xy 254.690483 206.33453) (xy 254.78022 206.204523) + (xy 254.836237 206.056818) (xy 254.855278 205.9) (xy 254.851636 205.870001) (xy 254.836237 205.743181) + (xy 254.803484 205.656819) (xy 254.78022 205.595477) (xy 254.690483 205.46547) (xy 254.688378 205.463605) + (xy 254.617273 205.400611) (xy 254.580146 205.341422) (xy 254.5755 205.307796) (xy 254.5755 204.65468) + (xy 254.595185 204.587641) (xy 254.647989 204.541886) (xy 254.717147 204.531942) (xy 254.761499 204.547293) + (xy 254.79148 204.564602) (xy 254.798762 204.568807) (xy 254.798766 204.568809) (xy 254.814683 204.573074) + (xy 254.846515 204.581604) (xy 254.846516 204.581604) (xy 254.856607 204.584307) (xy 254.894268 204.594399) + (xy 254.894269 204.594399) (xy 254.89427 204.594399) (xy 260.060536 204.594399) (xy 260.060537 204.594399) + (xy 260.108287 204.581604) (xy 260.156039 204.568809) (xy 260.241663 204.519374) (xy 260.311576 204.449461) + (xy 262.664217 202.096818) (xy 262.72554 202.063334) (xy 262.751898 202.0605) (xy 262.898985 202.0605) + (xy 263.052365 202.022696) (xy 263.071418 202.012696) (xy 263.19224 201.949283) (xy 263.310483 201.84453) + (xy 263.40022 201.714523) (xy 263.456237 201.566818) (xy 263.475278 201.41) (xy 263.461373 201.295476) + (xy 263.456237 201.253181) (xy 263.426966 201.176) (xy 263.40022 201.105477) (xy 263.310483 200.97547) + (xy 263.19224 200.870717) (xy 263.192238 200.870716) (xy 263.192237 200.870715) (xy 263.052365 200.797303) + (xy 262.898986 200.7595) (xy 262.898985 200.7595) (xy 262.741015 200.7595) (xy 262.741014 200.7595) + (xy 262.587634 200.797303) (xy 262.447762 200.870715) (xy 262.329516 200.975471) (xy 262.239781 201.105475) + (xy 262.23978 201.105476) (xy 262.183763 201.253181) (xy 262.164722 201.41) (xy 262.170896 201.460854) + (xy 262.159435 201.529777) (xy 262.135481 201.56348) (xy 259.891883 203.80708) (xy 259.83056 203.840565) + (xy 259.804202 203.843399) (xy 255.988565 203.843399) (xy 255.921526 203.823714) (xy 255.875771 203.77091) + (xy 255.865827 203.701752) (xy 255.872623 203.675428) (xy 255.874852 203.669548) (xy 255.900957 203.600717) + (xy 255.919998 203.443899) (xy 255.919386 203.438861) (xy 255.930845 203.369941) (xy 255.954798 203.336237) + (xy 260.739218 198.551819) (xy 260.800541 198.518334) (xy 260.826899 198.5155) (xy 264.103101 198.5155) + (xy 264.17014 198.535185) (xy 264.190782 198.551819) (xy 265.495481 199.856518) (xy 265.528966 199.917841) + (xy 265.530896 199.959143) (xy 265.524722 200.009997) (xy 265.524722 200.01) (xy 265.543762 200.166818) + (xy 265.59978 200.314523) (xy 265.689517 200.44453) (xy 265.80776 200.549283) (xy 265.807762 200.549284) + (xy 265.947634 200.622696) (xy 266.101014 200.6605) (xy 266.101015 200.6605) (xy 266.258985 200.6605) + (xy 266.412365 200.622696) (xy 266.55224 200.549283) (xy 266.670483 200.44453) (xy 266.76022 200.314523) + (xy 266.816237 200.166818) (xy 266.835278 200.01) (xy 266.816237 199.853182) (xy 266.76022 199.705477) + (xy 266.670483 199.57547) (xy 266.55224 199.470717) (xy 266.552238 199.470716) (xy 266.552237 199.470715) + (xy 266.412365 199.397303) (xy 266.258986 199.3595) (xy 266.258985 199.3595) (xy 266.111899 199.3595) + (xy 266.04486 199.339815) (xy 266.024218 199.323181) (xy 264.643218 197.942181) (xy 264.609733 197.880858) + (xy 264.614717 197.811166) (xy 264.656589 197.755233) (xy 264.722053 197.730816) (xy 264.730899 197.7305) + (xy 267.394435 197.7305) (xy 267.394436 197.7305) (xy 267.442186 197.717705) (xy 267.489938 197.70491) + (xy 267.575562 197.655475) (xy 267.645475 197.585562) (xy 268.744217 196.486818) (xy 268.80554 196.453334) + (xy 268.831898 196.4505) (xy 268.978985 196.4505) (xy 269.132365 196.412696) (xy 269.157921 196.399283) + (xy 269.27224 196.339283) (xy 269.390483 196.23453) (xy 269.48022 196.104523) (xy 269.536237 195.956818) + (xy 269.555278 195.8) (xy 269.553887 195.788539) (xy 269.536237 195.643181) (xy 269.502975 195.555477) + (xy 269.48022 195.495477) (xy 269.390483 195.36547) (xy 269.27224 195.260717) (xy 269.272238 195.260716) + (xy 269.272237 195.260715) (xy 269.132365 195.187303) (xy 268.978986 195.1495) (xy 268.978985 195.1495) + (xy 268.821015 195.1495) (xy 268.821014 195.1495) (xy 268.667634 195.187303) (xy 268.527762 195.260715) + (xy 268.409516 195.365471) (xy 268.319781 195.495475) (xy 268.31978 195.495476) (xy 268.263763 195.643181) + (xy 268.244722 195.8) (xy 268.250896 195.850854) (xy 268.239435 195.919777) (xy 268.215481 195.95348) + (xy 267.225782 196.943181) (xy 267.164459 196.976666) (xy 267.138101 196.9795) (xy 258.91631 196.9795) + (xy 258.849271 196.959815) (xy 258.814259 196.925938) (xy 258.810485 196.92047) (xy 258.692242 196.815717) + (xy 258.69224 196.815716) (xy 258.692239 196.815715) (xy 258.552367 196.742303) (xy 258.398988 196.7045) + (xy 258.398987 196.7045) (xy 258.241017 196.7045) (xy 258.241016 196.7045) (xy 258.087636 196.742303) + (xy 257.947764 196.815715) (xy 257.829518 196.92047) (xy 257.827091 196.923987) (xy 257.825744 196.925938) + (xy 257.771465 196.969929) (xy 257.723694 196.9795) (xy 256.861129 196.9795) (xy 256.79409 196.959815) + (xy 256.748335 196.907011) (xy 256.738391 196.837853) (xy 256.767416 196.774297) (xy 256.826194 196.736523) + (xy 256.831455 196.735103) (xy 256.922365 196.712696) (xy 256.983518 196.6806) (xy 257.06224 196.639283) + (xy 257.180483 196.53453) (xy 257.27022 196.404523) (xy 257.326237 196.256818) (xy 257.345278 196.1) + (xy 257.344 196.08947) (xy 257.326237 195.943181) (xy 257.298227 195.869326) (xy 257.29469 195.859999) + (xy 258.464724 195.859999) (xy 258.464724 195.86) (xy 258.483764 196.016818) (xy 258.532555 196.145468) + (xy 258.539782 196.164523) (xy 258.629519 196.29453) (xy 258.747762 196.399283) (xy 258.747764 196.399284) + (xy 258.887636 196.472696) (xy 259.041016 196.5105) (xy 259.041017 196.5105) (xy 259.198987 196.5105) + (xy 259.352367 196.472696) (xy 259.361251 196.468033) (xy 259.492242 196.399283) (xy 259.610485 196.29453) + (xy 259.700222 196.164523) (xy 259.756239 196.016818) (xy 259.77528 195.86) (xy 259.769104 195.809144) + (xy 259.780563 195.740224) (xy 259.804516 195.706521) (xy 265.836094 189.674945) (xy 265.836095 189.674944) + (xy 265.88553 189.58932) (xy 265.910375 189.496597) (xy 265.910378 189.496588) (xy 265.911119 189.493823) + (xy 265.91112 189.493816) (xy 265.91112 175.143271) (xy 265.930805 175.076232) (xy 265.933054 175.072854) + (xy 265.98022 175.004523) (xy 266.036237 174.856818) (xy 266.055278 174.7) (xy 266.052394 174.676243) + (xy 266.036237 174.543181) (xy 265.98169 174.399354) (xy 265.98022 174.395477) (xy 265.890483 174.26547) + (xy 265.77224 174.160717) (xy 265.772238 174.160716) (xy 265.772237 174.160715) (xy 265.632365 174.087303) + (xy 265.478986 174.0495) (xy 265.478985 174.0495) (xy 265.321015 174.0495) (xy 265.321014 174.0495) + (xy 265.167634 174.087303) (xy 265.027762 174.160715) (xy 264.909516 174.265471) (xy 264.819781 174.395475) + (xy 264.81978 174.395476) (xy 264.763762 174.543181) (xy 264.744722 174.699999) (xy 264.744722 174.7) + (xy 264.763762 174.856818) (xy 264.797002 174.944463) (xy 264.81978 175.004523) (xy 264.909517 175.13453) + (xy 265.02776 175.239283) (xy 265.093746 175.273915) (xy 265.143958 175.322498) (xy 265.16012 175.383711) + (xy 265.16012 189.237482) (xy 265.140435 189.304521) (xy 265.123801 189.325163) (xy 259.275783 195.173181) + (xy 259.21446 195.206666) (xy 259.188102 195.2095) (xy 259.041016 195.2095) (xy 258.887636 195.247303) + (xy 258.747764 195.320715) (xy 258.629518 195.425471) (xy 258.539783 195.555475) (xy 258.539782 195.555476) + (xy 258.483764 195.703181) (xy 258.464724 195.859999) (xy 257.29469 195.859999) (xy 257.27022 195.795477) + (xy 257.180483 195.66547) (xy 257.155324 195.643181) (xy 257.107273 195.600611) (xy 257.070146 195.541422) + (xy 257.0655 195.507796) (xy 257.0655 188.816898) (xy 257.085185 188.749859) (xy 257.101814 188.729222) + (xy 260.514217 185.316818) (xy 260.57554 185.283334) (xy 260.601898 185.2805) (xy 260.748985 185.2805) + (xy 260.902365 185.242696) (xy 260.909954 185.238713) (xy 261.04224 185.169283) (xy 261.160483 185.06453) + (xy 261.25022 184.934523) (xy 261.306237 184.786818) (xy 261.325278 184.63) (xy 261.316503 184.557726) + (xy 261.306237 184.473181) (xy 261.262368 184.35751) (xy 261.25022 184.325477) (xy 261.160483 184.19547) + (xy 261.04224 184.090717) (xy 261.042238 184.090716) (xy 261.042237 184.090715) (xy 260.902365 184.017303) + (xy 260.748986 183.9795) (xy 260.748985 183.9795) (xy 260.591015 183.9795) (xy 260.591014 183.9795) + (xy 260.437634 184.017303) (xy 260.297762 184.090715) (xy 260.179516 184.195471) (xy 260.089781 184.325475) + (xy 260.08978 184.325476) (xy 260.033763 184.473181) (xy 260.014722 184.63) (xy 260.020896 184.680854) + (xy 260.009435 184.749777) (xy 259.985481 184.78348) (xy 256.459438 188.309525) (xy 256.389526 188.379436) + (xy 256.340091 188.465059) (xy 256.340091 188.46506) (xy 256.34009 188.465062) (xy 256.3145 188.560565) + (xy 256.3145 188.560567) (xy 256.3145 189.6264) (xy 256.294815 189.693439) (xy 256.242011 189.739194) + (xy 256.172853 189.749138) (xy 256.109297 189.720113) (xy 256.108274 189.719216) (xy 256.04224 189.660717) + (xy 256.042238 189.660715) (xy 255.902365 189.587303) (xy 255.748986 189.5495) (xy 255.748985 189.5495) + (xy 255.591015 189.5495) (xy 255.591014 189.5495) (xy 255.430351 189.589099) (xy 255.429627 189.586162) + (xy 255.373774 189.59045) (xy 255.312277 189.557285) (xy 255.278473 189.496137) (xy 255.2755 189.469148) + (xy 255.2755 185.806899) (xy 255.295185 185.73986) (xy 255.311819 185.719218) (xy 259.238439 181.792598) + (xy 263.200474 177.830563) (xy 263.200475 177.830562) (xy 263.24991 177.744938) (xy 263.273522 177.656818) + (xy 263.2755 177.649436) (xy 263.2755 177.550564) (xy 263.2755 165.592202) (xy 263.295185 165.525163) + (xy 263.317274 165.499386) (xy 263.390482 165.434531) (xy 263.390483 165.43453) (xy 263.48022 165.304523) + (xy 263.536237 165.156818) (xy 263.555278 165) (xy 263.55247 164.976869) (xy 263.536237 164.843181) + (xy 263.514992 164.787164) (xy 263.48022 164.695477) (xy 263.390483 164.56547) (xy 263.27224 164.460717) + (xy 263.272238 164.460716) (xy 263.272237 164.460715) (xy 263.132365 164.387303) (xy 262.978986 164.3495) + (xy 262.978985 164.3495) (xy 262.821015 164.3495) (xy 262.821014 164.3495) (xy 262.667634 164.387303) + (xy 262.527762 164.460715) (xy 262.409516 164.565471) (xy 262.319781 164.695475) (xy 262.31978 164.695476) + (xy 262.263762 164.843181) (xy 262.244722 164.999999) (xy 262.244722 165) (xy 262.263762 165.156818) + (xy 262.31978 165.304523) (xy 262.319781 165.304524) (xy 262.409517 165.434531) (xy 262.482726 165.499386) + (xy 262.519853 165.558574) (xy 262.5245 165.592202) (xy 262.5245 177.393101) (xy 262.504815 177.46014) + (xy 262.488181 177.480782) (xy 254.599526 185.369436) (xy 254.550091 185.455059) (xy 254.550091 185.45506) + (xy 254.55009 185.455062) (xy 254.5245 185.550565) (xy 254.5245 185.550567) (xy 254.5245 193.981837) + (xy 254.504815 194.048876) (xy 254.452011 194.094631) (xy 254.382853 194.104575) (xy 254.319297 194.07555) + (xy 254.318273 194.074653) (xy 254.257273 194.020612) (xy 254.220146 193.961422) (xy 254.2155 193.927796) + (xy 254.2155 183.896898) (xy 254.235185 183.829859) (xy 254.251815 183.809221) (xy 254.894217 183.166818) + (xy 254.95554 183.133334) (xy 254.981898 183.1305) (xy 255.128985 183.1305) (xy 255.282365 183.092696) + (xy 255.42224 183.019283) (xy 255.540483 182.91453) (xy 255.63022 182.784523) (xy 255.686237 182.636818) + (xy 255.705278 182.48) (xy 255.702494 182.457067) (xy 255.686237 182.323181) (xy 255.646522 182.218463) + (xy 255.63022 182.175477) (xy 255.540483 182.04547) (xy 255.42224 181.940717) (xy 255.422238 181.940716) + (xy 255.422237 181.940715) (xy 255.282365 181.867303) (xy 255.128986 181.8295) (xy 255.128985 181.8295) + (xy 254.971015 181.8295) (xy 254.971014 181.8295) (xy 254.817634 181.867303) (xy 254.677762 181.940715) + (xy 254.559516 182.045471) (xy 254.469781 182.175475) (xy 254.46978 182.175476) (xy 254.413763 182.323181) + (xy 254.394722 182.48) (xy 254.400896 182.530854) (xy 254.389435 182.599777) (xy 254.365481 182.63348) + (xy 253.609438 183.389525) (xy 253.539526 183.459436) (xy 253.490091 183.545059) (xy 253.490091 183.54506) + (xy 253.49009 183.545062) (xy 253.4645 183.640565) (xy 253.4645 183.640567) (xy 253.4645 193.927796) + (xy 253.444815 193.994835) (xy 253.422727 194.020611) (xy 253.349518 194.085468) (xy 253.259781 194.215475) + (xy 253.25978 194.215476) (xy 253.203762 194.363181) (xy 253.184722 194.519999) (xy 253.184722 194.52) + (xy 253.203762 194.676818) (xy 253.242985 194.780239) (xy 253.25978 194.824523) (xy 253.349517 194.95453) + (xy 253.46776 195.059283) (xy 253.47986 195.065633) (xy 253.607634 195.132696) (xy 253.761014 195.1705) + (xy 253.761015 195.1705) (xy 253.918983 195.1705) (xy 253.918985 195.1705) (xy 253.990708 195.152822) + (xy 254.060506 195.155891) (xy 254.117569 195.19621) (xy 254.143774 195.260979) (xy 254.130803 195.329634) + (xy 254.108061 195.3609) (xy 252.769438 196.699525) (xy 252.699527 196.769435) (xy 252.650089 196.855063) + (xy 252.647502 196.86472) (xy 252.630035 196.92991) (xy 252.6245 196.950565) (xy 252 196.950565) + (xy 252 188.3) (xy 244.924 188.3) (xy 244.856961 188.280315) (xy 244.811206 188.227511) (xy 244.8 188.176) + (xy 244.8 166.348958) (xy 244.819685 166.281919) (xy 244.833446 166.264247) (xy 244.940001 166.150344) + (xy 250.69355 159.999999) (xy 255.144736 159.999999) (xy 255.144736 160) (xy 255.163776 160.156818) + (xy 255.219794 160.304523) (xy 255.219795 160.304524) (xy 255.309531 160.434531) (xy 255.38274 160.499386) + (xy 255.419867 160.558574) (xy 255.424514 160.592202) (xy 255.424514 161.949452) (xy 255.431893 161.976988) + (xy 255.431893 161.97699) (xy 255.431894 161.97699) (xy 255.450105 162.044955) (xy 255.498022 162.127949) + (xy 255.49954 162.130578) (xy 255.971674 162.602711) (xy 256.399525 163.030562) (xy 256.469438 163.100475) + (xy 256.555062 163.14991) (xy 256.555066 163.149911) (xy 256.595392 163.160717) (xy 256.595393 163.160717) + (xy 256.607052 163.16384) (xy 256.650564 163.1755) (xy 256.650565 163.1755) (xy 273.603692 163.1755) + (xy 273.670731 163.195185) (xy 273.705742 163.229061) (xy 273.708163 163.232569) (xy 273.709515 163.234528) + (xy 273.709517 163.23453) (xy 273.82776 163.339283) (xy 273.827762 163.339284) (xy 273.967634 163.412696) + (xy 274.121014 163.4505) (xy 274.121015 163.4505) (xy 274.278985 163.4505) (xy 274.432365 163.412696) + (xy 274.57224 163.339283) (xy 274.690483 163.23453) (xy 274.78022 163.104523) (xy 274.836237 162.956818) + (xy 274.855278 162.8) (xy 274.846172 162.725) (xy 274.836237 162.643181) (xy 274.79466 162.533553) + (xy 274.78022 162.495477) (xy 274.690483 162.36547) (xy 274.57224 162.260717) (xy 274.572238 162.260716) + (xy 274.572237 162.260715) (xy 274.432365 162.187303) (xy 274.278986 162.1495) (xy 274.278985 162.1495) + (xy 274.121015 162.1495) (xy 274.121014 162.1495) (xy 273.967634 162.187303) (xy 273.827762 162.260715) + (xy 273.709516 162.36547) (xy 273.707089 162.368987) (xy 273.705742 162.370938) (xy 273.651463 162.414929) + (xy 273.603692 162.4245) (xy 256.906899 162.4245) (xy 256.83986 162.404815) (xy 256.819218 162.388181) + (xy 256.211833 161.780796) (xy 256.178348 161.719473) (xy 256.175514 161.693115) (xy 256.175514 160.592202) + (xy 256.195199 160.525163) (xy 256.217288 160.499386) (xy 256.290496 160.434531) (xy 256.317453 160.395477) + (xy 256.380234 160.304523) (xy 256.436251 160.156818) (xy 256.455292 160) (xy 256.436251 159.843182) + (xy 256.380234 159.695477) (xy 256.290497 159.56547) (xy 256.172254 159.460717) (xy 256.172252 159.460716) + (xy 256.172251 159.460715) (xy 256.032379 159.387303) (xy 255.879 159.3495) (xy 255.878999 159.3495) + (xy 255.721029 159.3495) (xy 255.721028 159.3495) (xy 255.567648 159.387303) (xy 255.427776 159.460715) + (xy 255.30953 159.565471) (xy 255.219795 159.695475) (xy 255.219794 159.695476) (xy 255.163776 159.843181) + (xy 255.144736 159.999999) (xy 250.69355 159.999999) (xy 255.980114 154.348844) (xy 258.26599 151.905321) + (xy 273.5695 151.905321) (xy 273.5695 153.454678) (xy 273.584032 153.527735) (xy 273.584033 153.527739) + (xy 273.589647 153.536141) (xy 273.639399 153.610601) (xy 273.716169 153.661896) (xy 273.72226 153.665966) + (xy 273.722264 153.665967) (xy 273.795321 153.680499) (xy 273.795324 153.6805) (xy 273.795326 153.6805) + (xy 275.344676 153.6805) (xy 275.344677 153.680499) (xy 275.41774 153.665966) (xy 275.500601 153.610601) + (xy 275.555966 153.52774) (xy 275.5705 153.454674) (xy 275.5705 151.905326) (xy 275.5705 151.905323) + (xy 275.570499 151.905321) (xy 275.555967 151.832264) (xy 275.555966 151.83226) (xy 275.536442 151.80304) + (xy 275.500601 151.749399) (xy 275.445235 151.712405) (xy 275.417739 151.694033) (xy 275.417735 151.694032) + (xy 275.344677 151.6795) (xy 275.344674 151.6795) (xy 273.795326 151.6795) (xy 273.795323 151.6795) + (xy 273.722264 151.694032) (xy 273.72226 151.694033) (xy 273.639399 151.749399) (xy 273.584033 151.83226) + (xy 273.584032 151.832264) (xy 273.5695 151.905321) (xy 258.26599 151.905321) (xy 259.88 150.18) + (xy 273.564659 150.18) (xy 273.583975 150.376129) (xy 273.641188 150.564733) (xy 273.734086 150.738532) + (xy 273.73409 150.738539) (xy 273.859116 150.890883) (xy 274.01146 151.015909) (xy 274.011467 151.015913) + (xy 274.185266 151.108811) (xy 274.185269 151.108811) (xy 274.185273 151.108814) (xy 274.373868 151.166024) + (xy 274.57 151.185341) (xy 274.766132 151.166024) (xy 274.954727 151.108814) (xy 274.975788 151.097557) + (xy 275.041632 151.062362) (xy 275.128538 151.01591) (xy 275.280883 150.890883) (xy 275.40591 150.738538) + (xy 275.490502 150.580278) (xy 275.498811 150.564733) (xy 275.498811 150.564732) (xy 275.498814 150.564727) + (xy 275.556024 150.376132) (xy 275.575341 150.18) (xy 275.556024 149.983868) (xy 275.498814 149.795273) + (xy 275.498811 149.795269) (xy 275.498811 149.795266) (xy 275.405913 149.621467) (xy 275.405909 149.62146) + (xy 275.280883 149.469116) (xy 275.128539 149.34409) (xy 275.128532 149.344086) (xy 274.954733 149.251188) + (xy 274.954727 149.251186) (xy 274.828997 149.213046) (xy 274.766129 149.193975) (xy 274.57 149.174659) + (xy 274.37387 149.193975) (xy 274.185266 149.251188) (xy 274.011467 149.344086) (xy 274.01146 149.34409) + (xy 273.859116 149.469116) (xy 273.73409 149.62146) (xy 273.734086 149.621467) (xy 273.641188 149.795266) + (xy 273.583975 149.98387) (xy 273.564659 150.18) (xy 259.88 150.18) (xy 262.163246 147.739289) (xy 262.22342 147.703779) + (xy 262.2538 147.7) (xy 271.6 147.7) (xy 271.6 147.2) (xy 262.1 147.2) (xy 262.099998 147.2) (xy 244.772658 165.695477) + (xy 244.3 166.2) (xy 243.0555 166.2) (xy 243.0555 141.973686) (xy 243.075185 141.906647) (xy 243.127989 141.860892) + (xy 243.197147 141.850948) (xy 243.260703 141.879973) (xy 243.267181 141.886005) (xy 247.964122 146.582947) + (xy 247.964125 146.58295) (xy 247.964128 146.582952) (xy 248.034805 146.630176) (xy 248.087049 146.665084) + (xy 248.223631 146.721658) (xy 248.223635 146.721658) (xy 248.223636 146.721659) (xy 248.368623 146.7505) + (xy 248.368626 146.7505) (xy 261.17392 146.7505) (xy 261.271462 146.731096) (xy 261.318913 146.721658) + (xy 261.455495 146.665084) (xy 261.507739 146.630176) (xy 261.578416 146.582952) (xy 267.339218 140.822149) + (xy 271.1995 140.822149) (xy 271.1995 141.07785) (xy 271.214953 141.195222) (xy 271.232874 141.33134) + (xy 271.29905 141.578312) (xy 271.299053 141.578322) (xy 271.396894 141.814531) (xy 271.396899 141.814542) + (xy 271.524734 142.035957) (xy 271.524745 142.035973) (xy 271.680388 142.238811) (xy 271.680394 142.238818) + (xy 271.861181 142.419605) (xy 271.861187 142.41961) (xy 272.064035 142.575261) (xy 272.064042 142.575265) + (xy 272.285457 142.7031) (xy 272.285462 142.703102) (xy 272.285465 142.703104) (xy 272.521687 142.80095) + (xy 272.76866 142.867126) (xy 273.022157 142.9005) (xy 273.022164 142.9005) (xy 273.277836 142.9005) + (xy 273.277843 142.9005) (xy 273.53134 142.867126) (xy 273.778313 142.80095) (xy 274.014535 142.703104) + (xy 274.235965 142.575261) (xy 274.438813 142.41961) (xy 274.61961 142.238813) (xy 274.775261 142.035965) + (xy 274.903104 141.814535) (xy 275.00095 141.578313) (xy 275.067126 141.33134) (xy 275.1005 141.077843) + (xy 275.1005 140.822157) (xy 275.067126 140.56866) (xy 275.00095 140.321687) (xy 274.98414 140.281105) + (xy 274.903105 140.085468) (xy 274.9031 140.085457) (xy 274.775265 139.864042) (xy 274.775261 139.864035) + (xy 274.61961 139.661187) (xy 274.619605 139.661181) (xy 274.438818 139.480394) (xy 274.438811 139.480388) + (xy 274.235973 139.324745) (xy 274.235971 139.324743) (xy 274.235965 139.324739) (xy 274.23596 139.324736) + (xy 274.235957 139.324734) (xy 274.014542 139.196899) (xy 274.014531 139.196894) (xy 273.778322 139.099053) + (xy 273.778315 139.099051) (xy 273.778313 139.09905) (xy 273.53134 139.032874) (xy 273.475007 139.025457) + (xy 273.27785 138.9995) (xy 273.277843 138.9995) (xy 273.022157 138.9995) (xy 273.022149 138.9995) + (xy 272.796826 139.029165) (xy 272.76866 139.032874) (xy 272.535973 139.095222) (xy 272.521687 139.09905) + (xy 272.521677 139.099053) (xy 272.285468 139.196894) (xy 272.285457 139.196899) (xy 272.064042 139.324734) + (xy 272.064026 139.324745) (xy 271.861188 139.480388) (xy 271.861181 139.480394) (xy 271.680394 139.661181) + (xy 271.680388 139.661188) (xy 271.524745 139.864026) (xy 271.524734 139.864042) (xy 271.396899 140.085457) + (xy 271.396894 140.085468) (xy 271.299053 140.321677) (xy 271.29905 140.321687) (xy 271.24787 140.512696) + (xy 271.232874 140.568661) (xy 271.1995 140.822149) (xy 267.339218 140.822149) (xy 270.782951 137.378416) + (xy 270.865084 137.255495) (xy 270.921658 137.118913) (xy 270.9505 136.973918) (xy 270.9505 136.826083) + (xy 270.9505 125.529026) (xy 270.9505 125.529023) (xy 270.921659 125.384036) (xy 270.921658 125.384035) + (xy 270.921658 125.384031) (xy 270.865084 125.247449) (xy 270.826364 125.1895) (xy 270.826363 125.189498) + (xy 270.826362 125.189496) (xy 270.782953 125.124529) (xy 270.782947 125.124522) (xy 270.400337 124.741913) + (xy 270.366852 124.68059) (xy 270.371836 124.610899) (xy 270.413707 124.554965) (xy 270.463827 124.532615) + (xy 270.479846 124.529428) (xy 270.518909 124.521658) (xy 270.655491 124.465084) (xy 270.778412 124.382951) + (xy 270.882947 124.278416) (xy 270.96508 124.155495) (xy 271.021654 124.018913) (xy 271.036971 123.941911) + (xy 271.050496 123.87392) (xy 271.050496 122.511691) (xy 271.070181 122.444652) (xy 271.122985 122.398897) + (xy 271.192143 122.388953) (xy 271.221946 122.397129) (xy 271.281087 122.421626) (xy 271.281091 122.421626) + (xy 271.281092 122.421627) (xy 271.426079 122.450468) (xy 271.426082 122.450468) (xy 271.57392 122.450468) + (xy 271.671462 122.431064) (xy 271.718913 122.421626) (xy 271.855495 122.365052) (xy 271.978416 122.282919) + (xy 272.082951 122.178384) (xy 272.165084 122.055463) (xy 272.221658 121.918881) (xy 272.237806 121.837704) + (xy 272.2505 121.773888) (xy 272.2505 117.895139) (xy 272.221659 117.750152) (xy 272.221658 117.750151) + (xy 272.221658 117.750147) (xy 272.198029 117.693101) (xy 272.165086 117.613569) (xy 272.165085 117.613567) + (xy 272.132186 117.56433) (xy 272.132185 117.564328) (xy 272.082956 117.490649) (xy 272.082952 117.490644) + (xy 267.009361 112.417052) (xy 267.009354 112.417046) (xy 266.935669 112.367812) (xy 266.935669 112.367813) + (xy 266.886431 112.334913) (xy 266.749857 112.278343) (xy 266.749847 112.27834) (xy 266.60486 112.2495) + (xy 266.604858 112.2495) (xy 224.2745 112.2495) (xy 224.207461 112.229815) (xy 224.161706 112.177011) + (xy 224.1505 112.1255) (xy 224.1505 108.322149) (xy 271.1995 108.322149) (xy 271.1995 108.57785) + (xy 271.214987 108.695476) (xy 271.232874 108.83134) (xy 271.282307 109.015827) (xy 271.29905 109.078312) + (xy 271.299053 109.078322) (xy 271.396894 109.314531) (xy 271.396899 109.314542) (xy 271.524734 109.535957) + (xy 271.524745 109.535973) (xy 271.680388 109.738811) (xy 271.680394 109.738818) (xy 271.861181 109.919605) + (xy 271.861187 109.91961) (xy 272.064035 110.075261) (xy 272.064042 110.075265) (xy 272.285457 110.2031) + (xy 272.285462 110.203102) (xy 272.285465 110.203104) (xy 272.521687 110.30095) (xy 272.76866 110.367126) + (xy 273.022157 110.4005) (xy 273.022164 110.4005) (xy 273.277836 110.4005) (xy 273.277843 110.4005) + (xy 273.53134 110.367126) (xy 273.778313 110.30095) (xy 274.014535 110.203104) (xy 274.235965 110.075261) + (xy 274.438813 109.91961) (xy 274.61961 109.738813) (xy 274.775261 109.535965) (xy 274.903104 109.314535) + (xy 275.00095 109.078313) (xy 275.067126 108.83134) (xy 275.1005 108.577843) (xy 275.1005 108.322157) + (xy 275.067126 108.06866) (xy 275.00095 107.821687) (xy 274.971644 107.750937) (xy 274.903105 107.585468) + (xy 274.9031 107.585457) (xy 274.775265 107.364042) (xy 274.775261 107.364035) (xy 274.61961 107.161187) + (xy 274.619605 107.161181) (xy 274.438818 106.980394) (xy 274.438811 106.980388) (xy 274.235973 106.824745) + (xy 274.235971 106.824743) (xy 274.235965 106.824739) (xy 274.23596 106.824736) (xy 274.235957 106.824734) + (xy 274.014542 106.696899) (xy 274.014531 106.696894) (xy 273.778322 106.599053) (xy 273.778315 106.599051) + (xy 273.778313 106.59905) (xy 273.53134 106.532874) (xy 273.475007 106.525457) (xy 273.27785 106.4995) + (xy 273.277843 106.4995) (xy 273.022157 106.4995) (xy 273.022149 106.4995) (xy 272.796826 106.529165) + (xy 272.76866 106.532874) (xy 272.521687 106.59905) (xy 272.521677 106.599053) (xy 272.285468 106.696894) + (xy 272.285457 106.696899) (xy 272.064042 106.824734) (xy 272.064026 106.824745) (xy 271.861188 106.980388) + (xy 271.861181 106.980394) (xy 271.680394 107.161181) (xy 271.680388 107.161188) (xy 271.524745 107.364026) + (xy 271.524734 107.364042) (xy 271.396899 107.585457) (xy 271.396894 107.585468) (xy 271.299053 107.821677) + (xy 271.29905 107.821687) (xy 271.266009 107.945) (xy 271.232874 108.068661) (xy 271.1995 108.322149) + (xy 224.1505 108.322149) (xy 224.1505 99.44) (xy 257.874659 99.44) (xy 257.893975 99.636129) (xy 257.913046 99.698997) + (xy 257.947536 99.812696) (xy 257.951188 99.824733) (xy 258.044086 99.998532) (xy 258.04409 99.998539) + (xy 258.169116 100.150883) (xy 258.32146 100.275909) (xy 258.321467 100.275913) (xy 258.495266 100.368811) + (xy 258.495269 100.368811) (xy 258.495273 100.368814) (xy 258.683868 100.426024) (xy 258.88 100.445341) + (xy 259.076132 100.426024) (xy 259.264727 100.368814) (xy 259.438538 100.27591) (xy 259.590883 100.150883) + (xy 259.71591 99.998538) (xy 259.808814 99.824727) (xy 259.866024 99.636132) (xy 259.885341 99.44) + (xy 259.866024 99.243868) (xy 259.808814 99.055273) (xy 259.808811 99.055269) (xy 259.808811 99.055266) + (xy 259.715913 98.881467) (xy 259.715909 98.88146) (xy 259.590883 98.729116) (xy 259.513149 98.665321) + (xy 260.3795 98.665321) (xy 260.3795 100.214678) (xy 260.394032 100.287735) (xy 260.394033 100.287739) + (xy 260.39542 100.289815) (xy 260.449399 100.370601) (xy 260.518431 100.416726) (xy 260.53226 100.425966) + (xy 260.532264 100.425967) (xy 260.605321 100.440499) (xy 260.605324 100.4405) (xy 260.605326 100.4405) + (xy 262.154676 100.4405) (xy 262.154677 100.440499) (xy 262.22774 100.425966) (xy 262.310601 100.370601) + (xy 262.365966 100.28774) (xy 262.3805 100.214674) (xy 262.3805 98.665326) (xy 262.3805 98.665323) + (xy 262.380499 98.665321) (xy 262.365967 98.592264) (xy 262.365966 98.59226) (xy 262.337395 98.5495) + (xy 262.310601 98.509399) (xy 262.255235 98.472405) (xy 262.227739 98.454033) (xy 262.227735 98.454032) + (xy 262.154677 98.4395) (xy 262.154674 98.4395) (xy 260.605326 98.4395) (xy 260.605323 98.4395) + (xy 260.532264 98.454032) (xy 260.53226 98.454033) (xy 260.449399 98.509399) (xy 260.394033 98.59226) + (xy 260.394032 98.592264) (xy 260.3795 98.665321) (xy 259.513149 98.665321) (xy 259.438539 98.60409) + (xy 259.438532 98.604086) (xy 259.264733 98.511188) (xy 259.264727 98.511186) (xy 259.076132 98.453976) + (xy 259.076129 98.453975) (xy 258.88 98.434659) (xy 258.68387 98.453975) (xy 258.495266 98.511188) + (xy 258.321467 98.604086) (xy 258.32146 98.60409) (xy 258.169116 98.729116) (xy 258.04409 98.88146) + (xy 258.044086 98.881467) (xy 257.951188 99.055266) (xy 257.893975 99.24387) (xy 257.874659 99.44) + (xy 224.1505 99.44) (xy 224.1505 96.526079) (xy 224.136053 96.453452) (xy 224.14228 96.38386) (xy 224.175443 96.336445) + (xy 224.290483 96.23453) (xy 224.38022 96.104523) (xy 224.436237 95.956818) (xy 224.455278 95.8) + (xy 224.436237 95.643182) (xy 224.38022 95.495477) (xy 224.290483 95.36547) (xy 224.17224 95.260717) + (xy 224.172238 95.260716) (xy 224.172237 95.260715) (xy 224.032365 95.187303) (xy 223.878986 95.1495) + (xy 223.878985 95.1495) (xy 223.721015 95.1495) (xy 223.721014 95.1495) (xy 223.567634 95.187303) + (xy 223.427762 95.260715) (xy 223.309516 95.365471) (xy 223.219781 95.495475) (xy 223.21978 95.495476) + (xy 223.163762 95.643181) (xy 223.144722 95.799999) (xy 223.144722 95.8075) (xy 223.142172 95.8075) + (xy 223.132698 95.864404) (xy 223.085784 95.91618) (xy 223.068529 95.924964) (xy 223.04451 95.934913) + (xy 223.044498 95.934919) (xy 222.921584 96.017048) (xy 222.92158 96.017051) (xy 222.825451 96.113181) + (xy 222.764128 96.146666) (xy 222.73777 96.1495) (xy 222.721014 96.1495) (xy 222.567634 96.187303) + (xy 222.427762 96.260715) (xy 222.42776 96.260717) (xy 222.332925 96.344733) (xy 222.309516 96.365471) + (xy 222.219781 96.495475) (xy 222.21978 96.495476) (xy 222.163762 96.643181) (xy 222.144722 96.799999) + (xy 222.144722 96.8) (xy 222.163762 96.956818) (xy 222.21978 97.104523) (xy 222.309517 97.23453) + (xy 222.42776 97.339283) (xy 222.567635 97.412696) (xy 222.567641 97.412697) (xy 222.569471 97.413392) + (xy 222.570622 97.414264) (xy 222.574277 97.416182) (xy 222.573958 97.416789) (xy 222.625174 97.45557) + (xy 222.649231 97.521168) (xy 222.6495 97.529334) (xy 222.6495 118.473918) (xy 222.6495 118.47392) + (xy 222.649499 118.47392) (xy 222.67834 118.618907) (xy 222.678343 118.618917) (xy 222.733638 118.75241) + (xy 222.734916 118.755495) (xy 222.754175 118.784319) (xy 222.763677 118.79854) (xy 222.817049 118.878418) + (xy 222.817052 118.878421) (xy 226.471451 122.532819) (xy 226.504936 122.594142) (xy 226.499952 122.663834) + (xy 226.45808 122.719767) (xy 226.392616 122.744184) (xy 226.38377 122.7445) (xy 208.1995 122.7445) + (xy 208.132461 122.724815) (xy 208.086706 122.672011) (xy 208.0755 122.6205) (xy 208.0755 117.206899) + (xy 208.095185 117.13986) (xy 208.111819 117.119218) (xy 213.956514 111.274523) (xy 219.825474 105.405563) + (xy 219.851216 105.360977) (xy 219.87491 105.319938) (xy 219.9005 105.224435) (xy 219.9005 95.599999) + (xy 220.944722 95.599999) (xy 220.944722 95.6) (xy 220.963762 95.756818) (xy 221.004565 95.864404) + (xy 221.01978 95.904523) (xy 221.109517 96.03453) (xy 221.22776 96.139283) (xy 221.227762 96.139284) + (xy 221.367634 96.212696) (xy 221.521014 96.2505) (xy 221.521015 96.2505) (xy 221.678985 96.2505) + (xy 221.832365 96.212696) (xy 221.97224 96.139283) (xy 222.090483 96.03453) (xy 222.18022 95.904523) + (xy 222.236237 95.756818) (xy 222.255278 95.6) (xy 222.242587 95.495475) (xy 222.236237 95.443181) + (xy 222.200684 95.349436) (xy 222.18022 95.295477) (xy 222.161707 95.268656) (xy 222.139825 95.202301) + (xy 222.157291 95.13465) (xy 222.208559 95.087181) (xy 222.277353 95.074964) (xy 222.321379 95.088419) + (xy 222.367635 95.112696) (xy 222.367637 95.112696) (xy 222.367638 95.112697) (xy 222.521014 95.1505) + (xy 222.521015 95.1505) (xy 222.678985 95.1505) (xy 222.832365 95.112696) (xy 222.852912 95.101912) + (xy 222.97224 95.039283) (xy 223.090483 94.93453) (xy 223.18022 94.804523) (xy 223.236237 94.656818) + (xy 223.255278 94.5) (xy 223.255278 94.499999) (xy 224.244722 94.499999) (xy 224.244722 94.5) (xy 224.263762 94.656818) (xy 224.317565 94.798683) (xy 224.31978 94.804523) (xy 224.409517 94.93453) (xy 224.52776 95.039283) (xy 224.527762 95.039284) (xy 224.667634 95.112696) (xy 224.821014 95.1505) (xy 224.821015 95.1505) (xy 224.978985 95.1505) (xy 225.132365 95.112696) (xy 225.152912 95.101912) (xy 225.27224 95.039283) @@ -178173,136 +183094,136 @@ (xy 167.039807 117.2755) (xy 167.039808 117.2755) (xy 167.28019 117.2755) (xy 167.280191 117.2755) (xy 167.517296 117.235934) (xy 167.744655 117.157882) (xy 167.956066 117.043472) (xy 167.963124 117.037979) (xy 168.043396 116.9755) (xy 168.145763 116.895825) (xy 168.30857 116.718969) (xy 168.440048 116.517728) - (xy 168.536609 116.297591) (xy 168.595619 116.064563) (xy 168.607004 115.927168) (xy 168.61547 115.825005) - (xy 168.61547 115.824994) (xy 168.598177 115.616304) (xy 168.595619 115.585437) (xy 168.536609 115.352409) + (xy 168.536609 116.297591) (xy 168.595619 116.064563) (xy 168.6089 115.904284) (xy 168.61547 115.825005) + (xy 168.61547 115.824994) (xy 168.595619 115.58544) (xy 168.595619 115.585437) (xy 168.536609 115.352409) (xy 168.440048 115.132272) (xy 168.42885 115.115133) (xy 168.374309 115.031651) (xy 168.30857 114.931031) (xy 168.145763 114.754175) (xy 168.145758 114.754171) (xy 168.145756 114.754169) (xy 167.956074 114.606533) (xy 167.956068 114.606529) (xy 167.944597 114.600321) (xy 179.179499 114.600321) (xy 179.179499 117.049678) - (xy 179.194031 117.122735) (xy 179.194032 117.122739) (xy 179.194033 117.12274) (xy 179.249398 117.205601) - (xy 179.332259 117.260966) (xy 179.332263 117.260967) (xy 179.40532 117.275499) (xy 179.405323 117.2755) - (xy 179.405325 117.2755) (xy 181.854675 117.2755) (xy 181.854676 117.275499) (xy 181.927739 117.260966) - (xy 182.0106 117.205601) (xy 182.065965 117.12274) (xy 182.080499 117.049674) (xy 182.080499 114.600326) - (xy 182.080499 114.600323) (xy 182.080498 114.600321) (xy 182.065966 114.527264) (xy 182.065965 114.52726) - (xy 182.042483 114.492116) (xy 182.0106 114.444399) (xy 181.927739 114.389034) (xy 181.927738 114.389033) - (xy 181.927734 114.389032) (xy 181.854676 114.3745) (xy 181.854673 114.3745) (xy 179.405325 114.3745) - (xy 179.405322 114.3745) (xy 179.332263 114.389032) (xy 179.332259 114.389033) (xy 179.249398 114.444399) - (xy 179.194032 114.52726) (xy 179.194031 114.527264) (xy 179.179499 114.600321) (xy 167.944597 114.600321) - (xy 167.744656 114.492118) (xy 167.744651 114.492116) (xy 167.517299 114.414066) (xy 167.339467 114.384391) - (xy 167.280191 114.3745) (xy 167.039807 114.3745) (xy 166.992386 114.382413) (xy 166.802698 114.414066) - (xy 166.575346 114.492116) (xy 166.575341 114.492118) (xy 166.363929 114.606529) (xy 166.363923 114.606533) - (xy 166.174241 114.754169) (xy 166.174238 114.754172) (xy 166.011429 114.931029) (xy 166.011426 114.931033) - (xy 165.87995 115.13227) (xy 165.783388 115.35241) (xy 165.724378 115.58544) (xy 165.704528 115.824994) - (xy 158.1555 115.824994) (xy 158.1555 107.944994) (xy 165.704529 107.944994) (xy 165.704529 107.945005) - (xy 165.724379 108.184559) (xy 165.783389 108.417589) (xy 165.879951 108.637729) (xy 165.981197 108.792696) - (xy 166.011429 108.838969) (xy 166.174236 109.015825) (xy 166.174239 109.015827) (xy 166.174242 109.01583) - (xy 166.363924 109.163466) (xy 166.36393 109.16347) (xy 166.363933 109.163472) (xy 166.575344 109.277882) - (xy 166.575347 109.277883) (xy 166.802699 109.355933) (xy 166.802701 109.355933) (xy 166.802703 109.355934) - (xy 167.039808 109.3955) (xy 167.039809 109.3955) (xy 167.280191 109.3955) (xy 167.280192 109.3955) - (xy 167.517297 109.355934) (xy 167.744656 109.277882) (xy 167.956067 109.163472) (xy 168.145764 109.015825) - (xy 168.308571 108.838969) (xy 168.440049 108.637728) (xy 168.53661 108.417591) (xy 168.59562 108.184563) - (xy 168.615471 107.945) (xy 168.615471 107.944994) (xy 179.174529 107.944994) (xy 179.174529 107.945005) - (xy 179.194379 108.184559) (xy 179.253389 108.417589) (xy 179.349951 108.637729) (xy 179.451197 108.792696) - (xy 179.481429 108.838969) (xy 179.644236 109.015825) (xy 179.644239 109.015827) (xy 179.644242 109.01583) - (xy 179.833924 109.163466) (xy 179.83393 109.16347) (xy 179.833933 109.163472) (xy 180.045344 109.277882) - (xy 180.045347 109.277883) (xy 180.272699 109.355933) (xy 180.272701 109.355933) (xy 180.272703 109.355934) - (xy 180.509808 109.3955) (xy 180.509809 109.3955) (xy 180.750191 109.3955) (xy 180.750192 109.3955) - (xy 180.987297 109.355934) (xy 181.214656 109.277882) (xy 181.426067 109.163472) (xy 181.615764 109.015825) - (xy 181.778571 108.838969) (xy 181.910049 108.637728) (xy 182.00661 108.417591) (xy 182.06562 108.184563) - (xy 182.085471 107.945) (xy 182.075988 107.830563) (xy 182.06562 107.70544) (xy 182.06562 107.705437) - (xy 182.00661 107.472409) (xy 181.910049 107.252272) (xy 181.896535 107.231588) (xy 181.778572 107.051033) - (xy 181.778571 107.051031) (xy 181.615764 106.874175) (xy 181.615759 106.874171) (xy 181.615757 106.874169) - (xy 181.426075 106.726533) (xy 181.426069 106.726529) (xy 181.214657 106.612118) (xy 181.214652 106.612116) - (xy 180.9873 106.534066) (xy 180.780155 106.4995) (xy 180.750192 106.4945) (xy 180.509808 106.4945) - (xy 180.479845 106.4995) (xy 180.272699 106.534066) (xy 180.045347 106.612116) (xy 180.045342 106.612118) - (xy 179.83393 106.726529) (xy 179.833924 106.726533) (xy 179.644242 106.874169) (xy 179.644239 106.874172) - (xy 179.48143 107.051029) (xy 179.481427 107.051033) (xy 179.349951 107.25227) (xy 179.253389 107.47241) - (xy 179.194379 107.70544) (xy 179.174529 107.944994) (xy 168.615471 107.944994) (xy 168.605988 107.830563) - (xy 168.59562 107.70544) (xy 168.59562 107.705437) (xy 168.53661 107.472409) (xy 168.440049 107.252272) - (xy 168.426535 107.231588) (xy 168.308572 107.051033) (xy 168.308571 107.051031) (xy 168.145764 106.874175) - (xy 168.145759 106.874171) (xy 168.145757 106.874169) (xy 167.956075 106.726533) (xy 167.956069 106.726529) - (xy 167.744657 106.612118) (xy 167.744652 106.612116) (xy 167.5173 106.534066) (xy 167.310155 106.4995) - (xy 167.280192 106.4945) (xy 167.039808 106.4945) (xy 167.009845 106.4995) (xy 166.802699 106.534066) - (xy 166.575347 106.612116) (xy 166.575342 106.612118) (xy 166.36393 106.726529) (xy 166.363924 106.726533) - (xy 166.174242 106.874169) (xy 166.174239 106.874172) (xy 166.01143 107.051029) (xy 166.011427 107.051033) - (xy 165.879951 107.25227) (xy 165.783389 107.47241) (xy 165.724379 107.70544) (xy 165.704529 107.944994) - (xy 158.1555 107.944994) (xy 158.1555 104.544994) (xy 165.704529 104.544994) (xy 165.704529 104.545005) - (xy 165.724379 104.784559) (xy 165.783389 105.017589) (xy 165.879951 105.237729) (xy 165.933664 105.319942) - (xy 166.011429 105.438969) (xy 166.174236 105.615825) (xy 166.174239 105.615827) (xy 166.174242 105.61583) - (xy 166.363924 105.763466) (xy 166.36393 105.76347) (xy 166.363933 105.763472) (xy 166.575344 105.877882) - (xy 166.575347 105.877883) (xy 166.802699 105.955933) (xy 166.802701 105.955933) (xy 166.802703 105.955934) - (xy 167.039808 105.9955) (xy 167.039809 105.9955) (xy 167.280191 105.9955) (xy 167.280192 105.9955) - (xy 167.517297 105.955934) (xy 167.744656 105.877882) (xy 167.956067 105.763472) (xy 168.145764 105.615825) - (xy 168.308571 105.438969) (xy 168.440049 105.237728) (xy 168.53661 105.017591) (xy 168.59562 104.784563) - (xy 168.615471 104.545) (xy 168.59562 104.305437) (xy 168.53661 104.072409) (xy 168.440049 103.852272) - (xy 168.308571 103.651031) (xy 168.145764 103.474175) (xy 168.145759 103.474171) (xy 168.145757 103.474169) - (xy 167.956075 103.326533) (xy 167.956069 103.326529) (xy 167.944598 103.320321) (xy 179.1795 103.320321) - (xy 179.1795 105.769678) (xy 179.194032 105.842735) (xy 179.194033 105.842739) (xy 179.194034 105.84274) - (xy 179.249399 105.925601) (xy 179.30109 105.960139) (xy 179.33226 105.980966) (xy 179.332264 105.980967) - (xy 179.405321 105.995499) (xy 179.405324 105.9955) (xy 179.405326 105.9955) (xy 181.854676 105.9955) - (xy 181.854677 105.995499) (xy 181.92774 105.980966) (xy 182.010601 105.925601) (xy 182.065966 105.84274) - (xy 182.0805 105.769674) (xy 182.0805 103.320326) (xy 182.0805 103.320323) (xy 182.080499 103.320321) - (xy 182.065967 103.247264) (xy 182.065966 103.24726) (xy 182.042484 103.212116) (xy 182.010601 103.164399) - (xy 181.92774 103.109034) (xy 181.927739 103.109033) (xy 181.927735 103.109032) (xy 181.854677 103.0945) - (xy 181.854674 103.0945) (xy 179.405326 103.0945) (xy 179.405323 103.0945) (xy 179.332264 103.109032) - (xy 179.33226 103.109033) (xy 179.249399 103.164399) (xy 179.194033 103.24726) (xy 179.194032 103.247264) - (xy 179.1795 103.320321) (xy 167.944598 103.320321) (xy 167.744657 103.212118) (xy 167.744652 103.212116) - (xy 167.5173 103.134066) (xy 167.339468 103.104391) (xy 167.280192 103.0945) (xy 167.039808 103.0945) - (xy 166.992387 103.102413) (xy 166.802699 103.134066) (xy 166.575347 103.212116) (xy 166.575342 103.212118) - (xy 166.36393 103.326529) (xy 166.363924 103.326533) (xy 166.174242 103.474169) (xy 166.174239 103.474172) - (xy 166.01143 103.651029) (xy 166.011427 103.651033) (xy 165.879951 103.85227) (xy 165.783389 104.07241) - (xy 165.724379 104.30544) (xy 165.704529 104.544994) (xy 158.1555 104.544994) (xy 158.1555 102.8595) - (xy 158.175185 102.792461) (xy 158.227989 102.746706) (xy 158.2795 102.7355) (xy 161.219435 102.7355) - (xy 161.219436 102.7355) (xy 161.267186 102.722705) (xy 161.314938 102.70991) (xy 161.400562 102.660475) - (xy 161.470475 102.590562) (xy 161.470474 102.590562) (xy 161.529043 102.531993) (xy 161.529042 102.531993) - (xy 164.545475 99.515563) (xy 164.545479 99.515555) (xy 164.550423 99.509114) (xy 164.553228 99.511266) - (xy 164.592126 99.474238) (xy 164.648857 99.4605) (xy 166.094676 99.4605) (xy 166.094677 99.460499) - (xy 166.16774 99.445966) (xy 166.250601 99.390601) (xy 166.305966 99.30774) (xy 166.3205 99.234674) - (xy 166.3205 97.685326) (xy 166.3205 97.685323) (xy 166.320499 97.685321) (xy 166.305967 97.612264) - (xy 166.305966 97.61226) (xy 166.250601 97.529399) (xy 166.16774 97.474034) (xy 166.167739 97.474033) - (xy 166.167735 97.474032) (xy 166.094677 97.4595) (xy 166.094674 97.4595) (xy 164.7445 97.4595) - (xy 164.677461 97.439815) (xy 164.631706 97.387011) (xy 164.6205 97.3355) (xy 164.6205 96.927446) - (xy 164.640185 96.860407) (xy 164.692989 96.814652) (xy 164.762147 96.804708) (xy 164.802953 96.818088) - (xy 164.882127 96.860407) (xy 164.935273 96.888814) (xy 165.123868 96.946024) (xy 165.32 96.965341) - (xy 165.516132 96.946024) (xy 165.704727 96.888814) (xy 165.878538 96.79591) (xy 166.030883 96.670883) - (xy 166.15591 96.518538) (xy 166.248814 96.344727) (xy 166.306024 96.156132) (xy 166.325341 95.96) - (xy 166.306024 95.763868) (xy 166.248814 95.575273) (xy 166.248811 95.575269) (xy 166.248811 95.575266) - (xy 166.155913 95.401467) (xy 166.155909 95.40146) (xy 166.030883 95.249116) (xy 165.878539 95.12409) - (xy 165.878532 95.124086) (xy 165.704733 95.031188) (xy 165.704727 95.031186) (xy 165.516132 94.973976) - (xy 165.516129 94.973975) (xy 165.32 94.954659) (xy 165.12387 94.973975) (xy 165.062628 94.992553) - (xy 164.935273 95.031186) (xy 164.935271 95.031186) (xy 164.935271 95.031187) (xy 164.802953 95.101912) - (xy 164.73455 95.116153) (xy 164.669306 95.091153) (xy 164.627936 95.034847) (xy 164.6205 94.992553) - (xy 164.6205 94.466632) (xy 164.640185 94.399593) (xy 164.662274 94.373816) (xy 164.696855 94.343181) - (xy 164.740483 94.30453) (xy 164.83022 94.174523) (xy 164.886237 94.026818) (xy 164.905278 93.87) - (xy 164.890707 93.749991) (xy 164.886237 93.713181) (xy 164.856408 93.63453) (xy 164.83022 93.565477) - (xy 164.740483 93.43547) (xy 164.62224 93.330717) (xy 164.622238 93.330716) (xy 164.622237 93.330715) - (xy 164.482365 93.257303) (xy 164.328986 93.2195) (xy 164.328985 93.2195) (xy 164.171015 93.2195) - (xy 164.171014 93.2195) (xy 164.017637 93.257303) (xy 163.887126 93.325801) (xy 163.818617 93.339526) - (xy 163.753564 93.314033) (xy 163.71262 93.257418) (xy 163.7055 93.216004) (xy 163.7055 73.820092) - (xy 172.9845 73.820092) (xy 172.9845 73.969907) (xy 173.013723 74.116822) (xy 173.013725 74.11683) - (xy 173.071051 74.255229) (xy 173.071056 74.255238) (xy 173.15428 74.37979) (xy 173.154283 74.379794) - (xy 173.260205 74.485716) (xy 173.260209 74.485719) (xy 173.384761 74.568943) (xy 173.384767 74.568946) - (xy 173.384768 74.568947) (xy 173.52317 74.626275) (xy 173.670092 74.655499) (xy 173.670096 74.6555) - (xy 173.670097 74.6555) (xy 173.819904 74.6555) (xy 173.819905 74.655499) (xy 173.96683 74.626275) - (xy 174.105232 74.568947) (xy 174.229791 74.485719) (xy 174.335719 74.379791) (xy 174.418947 74.255232) - (xy 174.476275 74.11683) (xy 174.5055 73.969903) (xy 174.5055 73.820097) (xy 174.476275 73.67317) - (xy 174.418947 73.534768) (xy 174.418946 73.534767) (xy 174.418943 73.534761) (xy 174.335719 73.410209) - (xy 174.335716 73.410205) (xy 174.229794 73.304283) (xy 174.22979 73.30428) (xy 174.105238 73.221056) - (xy 174.105229 73.221051) (xy 173.96683 73.163725) (xy 173.966822 73.163723) (xy 173.819907 73.1345) - (xy 173.819903 73.1345) (xy 173.670097 73.1345) (xy 173.670092 73.1345) (xy 173.523177 73.163723) - (xy 173.523169 73.163725) (xy 173.38477 73.221051) (xy 173.384761 73.221056) (xy 173.260209 73.30428) - (xy 173.260205 73.304283) (xy 173.154283 73.410205) (xy 173.15428 73.410209) (xy 173.071056 73.534761) - (xy 173.071051 73.53477) (xy 173.013725 73.673169) (xy 173.013723 73.673177) (xy 172.9845 73.820092) - (xy 163.7055 73.820092) (xy 163.7055 70.347136) (xy 168.8045 70.347136) (xy 168.8045 71.442863) - (xy 168.804501 71.442882) (xy 168.810908 71.502481) (xy 168.861202 71.637327) (xy 168.861203 71.637328) - (xy 168.861204 71.63733) (xy 168.947454 71.752546) (xy 169.06267 71.838796) (xy 169.062671 71.838796) - (xy 169.062672 71.838797) (xy 169.197518 71.889091) (xy 169.197517 71.889091) (xy 169.204445 71.889835) - (xy 169.257128 71.8955) (xy 169.257137 71.8955) (xy 170.352863 71.8955) (xy 170.352872 71.8955) - (xy 170.412482 71.889091) (xy 170.54733 71.838796) (xy 170.662546 71.752546) (xy 170.748796 71.63733) - (xy 170.799091 71.502482) (xy 170.8055 71.442872) (xy 170.8055 70.347128) (xy 170.799091 70.287518) - (xy 170.766007 70.198814) (xy 170.748797 70.152672) (xy 170.748796 70.152671) (xy 170.748796 70.15267) - (xy 170.662546 70.037454) (xy 170.54733 69.951204) (xy 170.547328 69.951203) (xy 170.547327 69.951202) - (xy 170.412481 69.900908) (xy 170.412482 69.900908) (xy 170.352882 69.894501) (xy 170.35288 69.8945) - (xy 170.352872 69.8945) (xy 169.257128 69.8945) (xy 169.25712 69.8945) (xy 169.257117 69.894501) + (xy 179.194031 117.122735) (xy 179.194032 117.122739) (xy 179.205472 117.13986) (xy 179.249398 117.205601) + (xy 179.329971 117.259437) (xy 179.332259 117.260966) (xy 179.332263 117.260967) (xy 179.40532 117.275499) + (xy 179.405323 117.2755) (xy 179.405325 117.2755) (xy 181.854675 117.2755) (xy 181.854676 117.275499) + (xy 181.927739 117.260966) (xy 182.0106 117.205601) (xy 182.065965 117.12274) (xy 182.080499 117.049674) + (xy 182.080499 114.600326) (xy 182.080499 114.600323) (xy 182.080498 114.600321) (xy 182.065966 114.527264) + (xy 182.065965 114.52726) (xy 182.042483 114.492116) (xy 182.0106 114.444399) (xy 181.927739 114.389034) + (xy 181.927738 114.389033) (xy 181.927734 114.389032) (xy 181.854676 114.3745) (xy 181.854673 114.3745) + (xy 179.405325 114.3745) (xy 179.405322 114.3745) (xy 179.332263 114.389032) (xy 179.332259 114.389033) + (xy 179.249398 114.444399) (xy 179.194032 114.52726) (xy 179.194031 114.527264) (xy 179.179499 114.600321) + (xy 167.944597 114.600321) (xy 167.744656 114.492118) (xy 167.744651 114.492116) (xy 167.517299 114.414066) + (xy 167.339467 114.384391) (xy 167.280191 114.3745) (xy 167.039807 114.3745) (xy 166.992386 114.382413) + (xy 166.802698 114.414066) (xy 166.575346 114.492116) (xy 166.575341 114.492118) (xy 166.363929 114.606529) + (xy 166.363923 114.606533) (xy 166.174241 114.754169) (xy 166.174238 114.754172) (xy 166.011429 114.931029) + (xy 166.011426 114.931033) (xy 165.87995 115.13227) (xy 165.783388 115.35241) (xy 165.724378 115.58544) + (xy 165.704528 115.824994) (xy 158.1555 115.824994) (xy 158.1555 107.944994) (xy 165.704529 107.944994) + (xy 165.704529 107.945005) (xy 165.724379 108.184559) (xy 165.783389 108.417589) (xy 165.879951 108.637729) + (xy 165.933234 108.719284) (xy 166.011429 108.838969) (xy 166.174236 109.015825) (xy 166.174239 109.015827) + (xy 166.174242 109.01583) (xy 166.363924 109.163466) (xy 166.36393 109.16347) (xy 166.363933 109.163472) + (xy 166.575344 109.277882) (xy 166.575347 109.277883) (xy 166.802699 109.355933) (xy 166.802701 109.355933) + (xy 166.802703 109.355934) (xy 167.039808 109.3955) (xy 167.039809 109.3955) (xy 167.280191 109.3955) + (xy 167.280192 109.3955) (xy 167.517297 109.355934) (xy 167.744656 109.277882) (xy 167.956067 109.163472) + (xy 168.145764 109.015825) (xy 168.308571 108.838969) (xy 168.440049 108.637728) (xy 168.53661 108.417591) + (xy 168.59562 108.184563) (xy 168.615471 107.945) (xy 168.615471 107.944994) (xy 179.174529 107.944994) + (xy 179.174529 107.945005) (xy 179.194379 108.184559) (xy 179.253389 108.417589) (xy 179.349951 108.637729) + (xy 179.403234 108.719284) (xy 179.481429 108.838969) (xy 179.644236 109.015825) (xy 179.644239 109.015827) + (xy 179.644242 109.01583) (xy 179.833924 109.163466) (xy 179.83393 109.16347) (xy 179.833933 109.163472) + (xy 180.045344 109.277882) (xy 180.045347 109.277883) (xy 180.272699 109.355933) (xy 180.272701 109.355933) + (xy 180.272703 109.355934) (xy 180.509808 109.3955) (xy 180.509809 109.3955) (xy 180.750191 109.3955) + (xy 180.750192 109.3955) (xy 180.987297 109.355934) (xy 181.214656 109.277882) (xy 181.426067 109.163472) + (xy 181.615764 109.015825) (xy 181.778571 108.838969) (xy 181.910049 108.637728) (xy 182.00661 108.417591) + (xy 182.06562 108.184563) (xy 182.085471 107.945) (xy 182.075988 107.830563) (xy 182.06562 107.70544) + (xy 182.06562 107.705437) (xy 182.00661 107.472409) (xy 181.910049 107.252272) (xy 181.896535 107.231588) + (xy 181.778572 107.051033) (xy 181.778571 107.051031) (xy 181.615764 106.874175) (xy 181.615759 106.874171) + (xy 181.615757 106.874169) (xy 181.426075 106.726533) (xy 181.426069 106.726529) (xy 181.214657 106.612118) + (xy 181.214652 106.612116) (xy 180.9873 106.534066) (xy 180.780155 106.4995) (xy 180.750192 106.4945) + (xy 180.509808 106.4945) (xy 180.479845 106.4995) (xy 180.272699 106.534066) (xy 180.045347 106.612116) + (xy 180.045342 106.612118) (xy 179.83393 106.726529) (xy 179.833924 106.726533) (xy 179.644242 106.874169) + (xy 179.644239 106.874172) (xy 179.48143 107.051029) (xy 179.481427 107.051033) (xy 179.349951 107.25227) + (xy 179.253389 107.47241) (xy 179.194379 107.70544) (xy 179.174529 107.944994) (xy 168.615471 107.944994) + (xy 168.605988 107.830563) (xy 168.59562 107.70544) (xy 168.59562 107.705437) (xy 168.53661 107.472409) + (xy 168.440049 107.252272) (xy 168.426535 107.231588) (xy 168.308572 107.051033) (xy 168.308571 107.051031) + (xy 168.145764 106.874175) (xy 168.145759 106.874171) (xy 168.145757 106.874169) (xy 167.956075 106.726533) + (xy 167.956069 106.726529) (xy 167.744657 106.612118) (xy 167.744652 106.612116) (xy 167.5173 106.534066) + (xy 167.310155 106.4995) (xy 167.280192 106.4945) (xy 167.039808 106.4945) (xy 167.009845 106.4995) + (xy 166.802699 106.534066) (xy 166.575347 106.612116) (xy 166.575342 106.612118) (xy 166.36393 106.726529) + (xy 166.363924 106.726533) (xy 166.174242 106.874169) (xy 166.174239 106.874172) (xy 166.01143 107.051029) + (xy 166.011427 107.051033) (xy 165.879951 107.25227) (xy 165.783389 107.47241) (xy 165.724379 107.70544) + (xy 165.704529 107.944994) (xy 158.1555 107.944994) (xy 158.1555 104.544994) (xy 165.704529 104.544994) + (xy 165.704529 104.545005) (xy 165.724379 104.784559) (xy 165.783389 105.017589) (xy 165.879951 105.237729) + (xy 165.933664 105.319942) (xy 166.011429 105.438969) (xy 166.174236 105.615825) (xy 166.174239 105.615827) + (xy 166.174242 105.61583) (xy 166.363924 105.763466) (xy 166.36393 105.76347) (xy 166.363933 105.763472) + (xy 166.575344 105.877882) (xy 166.575347 105.877883) (xy 166.802699 105.955933) (xy 166.802701 105.955933) + (xy 166.802703 105.955934) (xy 167.039808 105.9955) (xy 167.039809 105.9955) (xy 167.280191 105.9955) + (xy 167.280192 105.9955) (xy 167.517297 105.955934) (xy 167.744656 105.877882) (xy 167.956067 105.763472) + (xy 168.145764 105.615825) (xy 168.308571 105.438969) (xy 168.440049 105.237728) (xy 168.53661 105.017591) + (xy 168.59562 104.784563) (xy 168.615471 104.545) (xy 168.59562 104.305437) (xy 168.53661 104.072409) + (xy 168.440049 103.852272) (xy 168.308571 103.651031) (xy 168.145764 103.474175) (xy 168.145759 103.474171) + (xy 168.145757 103.474169) (xy 167.956075 103.326533) (xy 167.956069 103.326529) (xy 167.944598 103.320321) + (xy 179.1795 103.320321) (xy 179.1795 105.769678) (xy 179.194032 105.842735) (xy 179.194033 105.842739) + (xy 179.194034 105.84274) (xy 179.249399 105.925601) (xy 179.30109 105.960139) (xy 179.33226 105.980966) + (xy 179.332264 105.980967) (xy 179.405321 105.995499) (xy 179.405324 105.9955) (xy 179.405326 105.9955) + (xy 181.854676 105.9955) (xy 181.854677 105.995499) (xy 181.92774 105.980966) (xy 182.010601 105.925601) + (xy 182.065966 105.84274) (xy 182.0805 105.769674) (xy 182.0805 103.320326) (xy 182.0805 103.320323) + (xy 182.080499 103.320321) (xy 182.065967 103.247264) (xy 182.065966 103.24726) (xy 182.042484 103.212116) + (xy 182.010601 103.164399) (xy 181.92774 103.109034) (xy 181.927739 103.109033) (xy 181.927735 103.109032) + (xy 181.854677 103.0945) (xy 181.854674 103.0945) (xy 179.405326 103.0945) (xy 179.405323 103.0945) + (xy 179.332264 103.109032) (xy 179.33226 103.109033) (xy 179.249399 103.164399) (xy 179.194033 103.24726) + (xy 179.194032 103.247264) (xy 179.1795 103.320321) (xy 167.944598 103.320321) (xy 167.744657 103.212118) + (xy 167.744652 103.212116) (xy 167.5173 103.134066) (xy 167.339468 103.104391) (xy 167.280192 103.0945) + (xy 167.039808 103.0945) (xy 166.992387 103.102413) (xy 166.802699 103.134066) (xy 166.575347 103.212116) + (xy 166.575342 103.212118) (xy 166.36393 103.326529) (xy 166.363924 103.326533) (xy 166.174242 103.474169) + (xy 166.174239 103.474172) (xy 166.01143 103.651029) (xy 166.011427 103.651033) (xy 165.879951 103.85227) + (xy 165.783389 104.07241) (xy 165.724379 104.30544) (xy 165.704529 104.544994) (xy 158.1555 104.544994) + (xy 158.1555 102.8595) (xy 158.175185 102.792461) (xy 158.227989 102.746706) (xy 158.2795 102.7355) + (xy 161.219435 102.7355) (xy 161.219436 102.7355) (xy 161.267186 102.722705) (xy 161.314938 102.70991) + (xy 161.400562 102.660475) (xy 161.470475 102.590562) (xy 161.470474 102.590562) (xy 161.529043 102.531993) + (xy 161.529042 102.531993) (xy 164.545475 99.515563) (xy 164.545479 99.515555) (xy 164.550423 99.509114) + (xy 164.553228 99.511266) (xy 164.592126 99.474238) (xy 164.648857 99.4605) (xy 166.094676 99.4605) + (xy 166.094677 99.460499) (xy 166.16774 99.445966) (xy 166.250601 99.390601) (xy 166.305966 99.30774) + (xy 166.3205 99.234674) (xy 166.3205 97.685326) (xy 166.3205 97.685323) (xy 166.320499 97.685321) + (xy 166.305967 97.612264) (xy 166.305966 97.61226) (xy 166.250601 97.529399) (xy 166.16774 97.474034) + (xy 166.167739 97.474033) (xy 166.167735 97.474032) (xy 166.094677 97.4595) (xy 166.094674 97.4595) + (xy 164.7445 97.4595) (xy 164.677461 97.439815) (xy 164.631706 97.387011) (xy 164.6205 97.3355) + (xy 164.6205 96.927446) (xy 164.640185 96.860407) (xy 164.692989 96.814652) (xy 164.762147 96.804708) + (xy 164.802953 96.818088) (xy 164.882127 96.860407) (xy 164.935273 96.888814) (xy 165.123868 96.946024) + (xy 165.32 96.965341) (xy 165.516132 96.946024) (xy 165.704727 96.888814) (xy 165.878538 96.79591) + (xy 166.030883 96.670883) (xy 166.15591 96.518538) (xy 166.248814 96.344727) (xy 166.306024 96.156132) + (xy 166.325341 95.96) (xy 166.306024 95.763868) (xy 166.248814 95.575273) (xy 166.248811 95.575269) + (xy 166.248811 95.575266) (xy 166.155913 95.401467) (xy 166.155909 95.40146) (xy 166.030883 95.249116) + (xy 165.878539 95.12409) (xy 165.878532 95.124086) (xy 165.704733 95.031188) (xy 165.704727 95.031186) + (xy 165.516132 94.973976) (xy 165.516129 94.973975) (xy 165.32 94.954659) (xy 165.12387 94.973975) + (xy 165.062628 94.992553) (xy 164.935273 95.031186) (xy 164.935271 95.031186) (xy 164.935271 95.031187) + (xy 164.802953 95.101912) (xy 164.73455 95.116153) (xy 164.669306 95.091153) (xy 164.627936 95.034847) + (xy 164.6205 94.992553) (xy 164.6205 94.466632) (xy 164.640185 94.399593) (xy 164.662274 94.373816) + (xy 164.696855 94.343181) (xy 164.740483 94.30453) (xy 164.83022 94.174523) (xy 164.886237 94.026818) + (xy 164.905278 93.87) (xy 164.890707 93.749991) (xy 164.886237 93.713181) (xy 164.856408 93.63453) + (xy 164.83022 93.565477) (xy 164.740483 93.43547) (xy 164.62224 93.330717) (xy 164.622238 93.330716) + (xy 164.622237 93.330715) (xy 164.482365 93.257303) (xy 164.328986 93.2195) (xy 164.328985 93.2195) + (xy 164.171015 93.2195) (xy 164.171014 93.2195) (xy 164.017637 93.257303) (xy 163.887126 93.325801) + (xy 163.818617 93.339526) (xy 163.753564 93.314033) (xy 163.71262 93.257418) (xy 163.7055 93.216004) + (xy 163.7055 73.820092) (xy 172.9845 73.820092) (xy 172.9845 73.969907) (xy 173.013723 74.116822) + (xy 173.013725 74.11683) (xy 173.071051 74.255229) (xy 173.071056 74.255238) (xy 173.15428 74.37979) + (xy 173.154283 74.379794) (xy 173.260205 74.485716) (xy 173.260209 74.485719) (xy 173.384761 74.568943) + (xy 173.384767 74.568946) (xy 173.384768 74.568947) (xy 173.52317 74.626275) (xy 173.670092 74.655499) + (xy 173.670096 74.6555) (xy 173.670097 74.6555) (xy 173.819904 74.6555) (xy 173.819905 74.655499) + (xy 173.96683 74.626275) (xy 174.105232 74.568947) (xy 174.229791 74.485719) (xy 174.335719 74.379791) + (xy 174.418947 74.255232) (xy 174.476275 74.11683) (xy 174.5055 73.969903) (xy 174.5055 73.820097) + (xy 174.476275 73.67317) (xy 174.418947 73.534768) (xy 174.418946 73.534767) (xy 174.418943 73.534761) + (xy 174.335719 73.410209) (xy 174.335716 73.410205) (xy 174.229794 73.304283) (xy 174.22979 73.30428) + (xy 174.105238 73.221056) (xy 174.105229 73.221051) (xy 173.96683 73.163725) (xy 173.966822 73.163723) + (xy 173.819907 73.1345) (xy 173.819903 73.1345) (xy 173.670097 73.1345) (xy 173.670092 73.1345) + (xy 173.523177 73.163723) (xy 173.523169 73.163725) (xy 173.38477 73.221051) (xy 173.384761 73.221056) + (xy 173.260209 73.30428) (xy 173.260205 73.304283) (xy 173.154283 73.410205) (xy 173.15428 73.410209) + (xy 173.071056 73.534761) (xy 173.071051 73.53477) (xy 173.013725 73.673169) (xy 173.013723 73.673177) + (xy 172.9845 73.820092) (xy 163.7055 73.820092) (xy 163.7055 70.347136) (xy 168.8045 70.347136) + (xy 168.8045 71.442863) (xy 168.804501 71.442882) (xy 168.810908 71.502481) (xy 168.861202 71.637327) + (xy 168.861203 71.637328) (xy 168.861204 71.63733) (xy 168.947454 71.752546) (xy 169.06267 71.838796) + (xy 169.062671 71.838796) (xy 169.062672 71.838797) (xy 169.197518 71.889091) (xy 169.197517 71.889091) + (xy 169.204445 71.889835) (xy 169.257128 71.8955) (xy 169.257137 71.8955) (xy 170.352863 71.8955) + (xy 170.352872 71.8955) (xy 170.412482 71.889091) (xy 170.54733 71.838796) (xy 170.662546 71.752546) + (xy 170.748796 71.63733) (xy 170.799091 71.502482) (xy 170.8055 71.442872) (xy 170.8055 70.347128) + (xy 170.799091 70.287518) (xy 170.766007 70.198814) (xy 170.748797 70.152672) (xy 170.748796 70.152671) + (xy 170.748796 70.15267) (xy 170.662546 70.037454) (xy 170.54733 69.951204) (xy 170.547328 69.951203) + (xy 170.547327 69.951202) (xy 170.412481 69.900908) (xy 170.412482 69.900908) (xy 170.352882 69.894501) + (xy 170.35288 69.8945) (xy 170.352872 69.8945) (xy 169.257128 69.8945) (xy 169.25712 69.8945) (xy 169.257117 69.894501) (xy 169.197518 69.900908) (xy 169.062672 69.951202) (xy 169.06267 69.951204) (xy 168.947454 70.037454) (xy 168.861204 70.15267) (xy 168.861202 70.152672) (xy 168.810908 70.287518) (xy 168.804501 70.347117) (xy 168.8045 70.347136) (xy 163.7055 70.347136) (xy 163.7055 69.492202) (xy 163.725185 69.425163) @@ -178518,28 +183439,27 @@ (xy 129.012237 107.640715) (xy 128.872365 107.567303) (xy 128.718986 107.5295) (xy 128.718985 107.5295) (xy 128.561015 107.5295) (xy 128.561014 107.5295) (xy 128.407634 107.567303) (xy 128.267762 107.640715) (xy 128.149516 107.745471) (xy 128.059781 107.875475) (xy 128.05978 107.875476) (xy 128.003762 108.023181) - (xy 127.984722 108.179999) (xy 127.984722 108.18) (xy 128.003762 108.336818) (xy 128.034395 108.417589) - (xy 128.05978 108.484523) (xy 128.149517 108.61453) (xy 128.26776 108.719283) (xy 128.267762 108.719284) - (xy 128.407634 108.792696) (xy 128.561014 108.8305) (xy 128.561015 108.8305) (xy 128.718985 108.8305) - (xy 128.872365 108.792696) (xy 128.914242 108.770717) (xy 129.01224 108.719283) (xy 129.130483 108.61453) - (xy 129.134257 108.609061) (xy 129.188537 108.565071) (xy 129.236308 108.5555) (xy 138.403101 108.5555) - (xy 138.47014 108.575185) (xy 138.490782 108.591819) (xy 163.479525 133.580562) (xy 163.549438 133.650475) - (xy 163.605971 133.683114) (xy 163.654185 133.73368) (xy 163.667407 133.802288) (xy 163.641439 133.867152) - (xy 163.584525 133.90768) (xy 163.543969 133.9145) (xy 160.8969 133.9145) (xy 160.829861 133.894815) - (xy 160.809219 133.878181) (xy 155.685022 128.753984) (xy 155.651537 128.692661) (xy 155.656521 128.622969) - (xy 155.698393 128.567036) (xy 155.763857 128.542619) (xy 155.802379 128.545907) (xy 155.821011 128.550499) - (xy 155.821014 128.5505) (xy 155.821015 128.5505) (xy 155.978985 128.5505) (xy 156.132365 128.512696) - (xy 156.147455 128.504776) (xy 156.27224 128.439283) (xy 156.390483 128.33453) (xy 156.48022 128.204523) - (xy 156.536237 128.056818) (xy 156.555278 127.9) (xy 156.553957 127.889116) (xy 156.536237 127.743181) - (xy 156.508933 127.671188) (xy 156.48022 127.595477) (xy 156.390483 127.46547) (xy 156.27224 127.360717) - (xy 156.272238 127.360716) (xy 156.272237 127.360715) (xy 156.132365 127.287303) (xy 155.978986 127.2495) - (xy 155.978985 127.2495) (xy 155.831899 127.2495) (xy 155.76486 127.229815) (xy 155.744218 127.213181) - (xy 137.830563 109.299526) (xy 137.830562 109.299525) (xy 137.744938 109.25009) (xy 137.697186 109.237295) - (xy 137.697184 109.237294) (xy 137.697182 109.237293) (xy 137.649436 109.2245) (xy 137.649435 109.2245) - (xy 132.296308 109.2245) (xy 132.229269 109.204815) (xy 132.194257 109.170938) (xy 132.190483 109.16547) - (xy 132.07224 109.060717) (xy 132.072238 109.060716) (xy 132.072237 109.060715) (xy 131.932365 108.987303) - (xy 131.778986 108.9495) (xy 131.778985 108.9495) (xy 131.621015 108.9495) (xy 131.621014 108.9495) - (xy 131.467634 108.987303) (xy 131.327762 109.060715) (xy 131.32776 109.060717) (xy 131.223388 109.153182) + (xy 127.984722 108.179999) (xy 127.984722 108.18) (xy 128.003762 108.336818) (xy 128.05978 108.484523) + (xy 128.149517 108.61453) (xy 128.26776 108.719283) (xy 128.267762 108.719284) (xy 128.407634 108.792696) + (xy 128.561014 108.8305) (xy 128.561015 108.8305) (xy 128.718985 108.8305) (xy 128.872365 108.792696) + (xy 129.01224 108.719283) (xy 129.130483 108.61453) (xy 129.134257 108.609061) (xy 129.188537 108.565071) + (xy 129.236308 108.5555) (xy 138.403101 108.5555) (xy 138.47014 108.575185) (xy 138.490782 108.591819) + (xy 163.479525 133.580562) (xy 163.549438 133.650475) (xy 163.605971 133.683114) (xy 163.654185 133.73368) + (xy 163.667407 133.802288) (xy 163.641439 133.867152) (xy 163.584525 133.90768) (xy 163.543969 133.9145) + (xy 160.8969 133.9145) (xy 160.829861 133.894815) (xy 160.809219 133.878181) (xy 155.685022 128.753984) + (xy 155.651537 128.692661) (xy 155.656521 128.622969) (xy 155.698393 128.567036) (xy 155.763857 128.542619) + (xy 155.802379 128.545907) (xy 155.821011 128.550499) (xy 155.821014 128.5505) (xy 155.821015 128.5505) + (xy 155.978985 128.5505) (xy 156.132365 128.512696) (xy 156.147455 128.504776) (xy 156.27224 128.439283) + (xy 156.390483 128.33453) (xy 156.48022 128.204523) (xy 156.536237 128.056818) (xy 156.555278 127.9) + (xy 156.553957 127.889116) (xy 156.536237 127.743181) (xy 156.508933 127.671188) (xy 156.48022 127.595477) + (xy 156.390483 127.46547) (xy 156.27224 127.360717) (xy 156.272238 127.360716) (xy 156.272237 127.360715) + (xy 156.132365 127.287303) (xy 155.978986 127.2495) (xy 155.978985 127.2495) (xy 155.831899 127.2495) + (xy 155.76486 127.229815) (xy 155.744218 127.213181) (xy 137.830563 109.299526) (xy 137.830562 109.299525) + (xy 137.744938 109.25009) (xy 137.697186 109.237295) (xy 137.697184 109.237294) (xy 137.697182 109.237293) + (xy 137.649436 109.2245) (xy 137.649435 109.2245) (xy 132.296308 109.2245) (xy 132.229269 109.204815) + (xy 132.194257 109.170938) (xy 132.190483 109.16547) (xy 132.07224 109.060717) (xy 132.072238 109.060716) + (xy 132.072237 109.060715) (xy 131.932365 108.987303) (xy 131.778986 108.9495) (xy 131.778985 108.9495) + (xy 131.621015 108.9495) (xy 131.621014 108.9495) (xy 131.467634 108.987303) (xy 131.327762 109.060715) (xy 131.209516 109.165471) (xy 131.119781 109.295475) (xy 131.11978 109.295476) (xy 131.063762 109.443181) (xy 131.044722 109.599999) (xy 131.044722 109.6) (xy 131.063762 109.756818) (xy 131.11978 109.904523) (xy 131.209517 110.03453) (xy 131.32776 110.139283) (xy 131.327762 110.139284) (xy 131.467634 110.212696) @@ -178567,122 +183487,121 @@ (xy 133.932365 114.762303) (xy 133.778986 114.7245) (xy 133.778985 114.7245) (xy 133.621015 114.7245) (xy 133.621014 114.7245) (xy 133.467634 114.762303) (xy 133.327762 114.835715) (xy 133.209516 114.940471) (xy 133.119781 115.070475) (xy 133.11978 115.070476) (xy 133.063762 115.218181) (xy 133.044722 115.374999) - (xy 133.044722 115.375) (xy 133.063762 115.531818) (xy 133.11978 115.679523) (xy 133.152751 115.72729) - (xy 133.184114 115.772728) (xy 133.209517 115.80953) (xy 133.226979 115.825) (xy 133.305637 115.894684) - (xy 133.342764 115.953874) (xy 133.341996 116.023739) (xy 133.305637 116.080316) (xy 133.209516 116.16547) - (xy 133.119781 116.295475) (xy 133.11978 116.295476) (xy 133.063762 116.443181) (xy 133.044722 116.599999) - (xy 133.044722 116.6) (xy 133.063762 116.756818) (xy 133.08014 116.800002) (xy 133.11978 116.904523) - (xy 133.209517 117.03453) (xy 133.32776 117.139283) (xy 133.327762 117.139284) (xy 133.467634 117.212696) - (xy 133.621014 117.2505) (xy 133.621015 117.2505) (xy 133.778985 117.2505) (xy 133.932365 117.212696) - (xy 133.956568 117.199993) (xy 134.07224 117.139283) (xy 134.190483 117.03453) (xy 134.194257 117.029061) - (xy 134.248537 116.985071) (xy 134.296308 116.9755) (xy 141.393101 116.9755) (xy 141.46014 116.995185) - (xy 141.480782 117.011819) (xy 151.708181 127.239218) (xy 151.741666 127.300541) (xy 151.7445 127.326899) - (xy 151.7445 127.59193) (xy 151.724815 127.658969) (xy 151.678954 127.701288) (xy 151.561463 127.764088) - (xy 151.56146 127.76409) (xy 151.409116 127.889116) (xy 151.28409 128.04146) (xy 151.284086 128.041467) - (xy 151.191188 128.215266) (xy 151.133975 128.40387) (xy 151.114659 128.6) (xy 151.133975 128.796129) - (xy 151.133976 128.796132) (xy 151.189223 128.978257) (xy 151.191188 128.984733) (xy 151.284086 129.158532) - (xy 151.28409 129.158539) (xy 151.409116 129.310883) (xy 151.56146 129.435909) (xy 151.561463 129.435911) - (xy 151.589315 129.450798) (xy 151.678953 129.49871) (xy 151.728797 129.547671) (xy 151.7445 129.608068) - (xy 151.7445 129.9755) (xy 151.724815 130.042539) (xy 151.672011 130.088294) (xy 151.6205 130.0995) - (xy 151.345323 130.0995) (xy 151.272264 130.114032) (xy 151.27226 130.114033) (xy 151.189399 130.169399) - (xy 151.134033 130.25226) (xy 151.134032 130.252264) (xy 151.1195 130.325321) (xy 151.1195 131.874678) - (xy 151.134032 131.947735) (xy 151.134033 131.947739) (xy 151.150786 131.972811) (xy 151.189399 132.030601) - (xy 151.264141 132.080541) (xy 151.27226 132.085966) (xy 151.272264 132.085967) (xy 151.345321 132.100499) - (xy 151.345324 132.1005) (xy 151.345326 132.1005) (xy 152.538101 132.1005) (xy 152.60514 132.120185) - (xy 152.625782 132.136819) (xy 157.755002 137.26604) (xy 157.788487 137.327363) (xy 157.783503 137.397055) - (xy 157.741631 137.452988) (xy 157.676167 137.477405) (xy 157.614534 137.464528) (xy 157.614374 137.464952) - (xy 157.611688 137.463933) (xy 157.609695 137.463517) (xy 157.607362 137.462292) (xy 157.453983 137.424489) - (xy 157.453982 137.424489) (xy 157.296012 137.424489) (xy 157.296011 137.424489) (xy 157.142631 137.462292) - (xy 157.002759 137.535704) (xy 157.002757 137.535706) (xy 156.884514 137.640459) (xy 156.884513 137.64046) - (xy 156.881293 137.643313) (xy 156.818059 137.673034) (xy 156.799066 137.674497) (xy 155.296308 137.674497) - (xy 155.229269 137.654812) (xy 155.194257 137.620935) (xy 155.190483 137.615467) (xy 155.07224 137.510714) - (xy 155.072238 137.510713) (xy 155.072237 137.510712) (xy 154.932365 137.4373) (xy 154.778986 137.399497) - (xy 154.778985 137.399497) (xy 154.621015 137.399497) (xy 154.621014 137.399497) (xy 154.467634 137.4373) - (xy 154.327762 137.510712) (xy 154.209516 137.615468) (xy 154.119781 137.745472) (xy 154.11978 137.745473) - (xy 154.063762 137.893178) (xy 154.044722 138.049996) (xy 154.044722 138.049997) (xy 154.063762 138.206815) - (xy 154.091034 138.278724) (xy 154.11978 138.35452) (xy 154.157895 138.409739) (xy 154.209518 138.484529) - (xy 154.214491 138.490142) (xy 154.2128 138.491639) (xy 154.243995 138.541363) (xy 154.243233 138.611228) - (xy 154.212896 138.658442) (xy 154.214491 138.659855) (xy 154.209518 138.665467) (xy 154.119781 138.795475) - (xy 154.11978 138.795476) (xy 154.063762 138.943181) (xy 154.044722 139.099999) (xy 154.044722 139.1) - (xy 154.063762 139.256818) (xy 154.107462 139.372044) (xy 154.11978 139.404523) (xy 154.209517 139.53453) - (xy 154.32776 139.639283) (xy 154.327762 139.639284) (xy 154.467634 139.712696) (xy 154.621014 139.7505) - (xy 154.621015 139.7505) (xy 154.778985 139.7505) (xy 154.932365 139.712696) (xy 155.07224 139.639283) - (xy 155.190483 139.53453) (xy 155.194257 139.529061) (xy 155.248537 139.485071) (xy 155.296308 139.4755) - (xy 156.803692 139.4755) (xy 156.870731 139.495185) (xy 156.905742 139.529061) (xy 156.908163 139.532569) - (xy 156.909515 139.534528) (xy 156.909517 139.53453) (xy 157.02776 139.639283) (xy 157.027762 139.639284) - (xy 157.167634 139.712696) (xy 157.321014 139.7505) (xy 157.321015 139.7505) (xy 157.478985 139.7505) - (xy 157.632365 139.712696) (xy 157.77224 139.639283) (xy 157.890483 139.53453) (xy 157.98022 139.404523) - (xy 158.036237 139.256818) (xy 158.055278 139.1) (xy 158.051022 139.064944) (xy 158.036237 138.943181) - (xy 158.01055 138.875452) (xy 157.98022 138.795477) (xy 157.890483 138.66547) (xy 157.89048 138.665467) - (xy 157.890395 138.665391) (xy 157.89035 138.665319) (xy 157.885509 138.659855) (xy 157.886417 138.659049) - (xy 157.85327 138.606201) (xy 157.854039 138.536336) (xy 157.870572 138.502141) (xy 157.955217 138.379512) - (xy 158.011234 138.231807) (xy 158.030275 138.074989) (xy 158.029918 138.072044) (xy 158.011234 137.91817) - (xy 157.974195 137.820507) (xy 157.968828 137.750844) (xy 158.001975 137.689338) (xy 158.063114 137.655516) - (xy 158.132832 137.660118) (xy 158.177816 137.688853) (xy 159.293971 138.805009) (xy 160.406781 139.917819) - (xy 160.440266 139.979142) (xy 160.435282 140.048834) (xy 160.39341 140.104767) (xy 160.327946 140.129184) - (xy 160.3191 140.1295) (xy 154.4119 140.1295) (xy 154.344861 140.109815) (xy 154.324219 140.093181) - (xy 149.031819 134.800781) (xy 148.998334 134.739458) (xy 148.9955 134.7131) (xy 148.9955 132.2245) - (xy 149.015185 132.157461) (xy 149.067989 132.111706) (xy 149.1195 132.1005) (xy 149.394676 132.1005) - (xy 149.394677 132.100499) (xy 149.46774 132.085966) (xy 149.550601 132.030601) (xy 149.605966 131.94774) - (xy 149.6205 131.874674) (xy 149.6205 130.325326) (xy 149.6205 130.325323) (xy 149.620499 130.325321) - (xy 149.605967 130.252264) (xy 149.605966 130.25226) (xy 149.605688 130.251844) (xy 149.550601 130.169399) - (xy 149.495235 130.132405) (xy 149.467739 130.114033) (xy 149.467735 130.114032) (xy 149.394677 130.0995) - (xy 149.394674 130.0995) (xy 149.1195 130.0995) (xy 149.052461 130.079815) (xy 149.006706 130.027011) - (xy 148.9955 129.9755) (xy 148.9955 129.608068) (xy 149.015185 129.541029) (xy 149.061046 129.49871) - (xy 149.178538 129.43591) (xy 149.330883 129.310883) (xy 149.45591 129.158538) (xy 149.543507 128.994656) - (xy 149.548811 128.984733) (xy 149.548811 128.984732) (xy 149.548814 128.984727) (xy 149.606024 128.796132) - (xy 149.625341 128.6) (xy 149.606024 128.403868) (xy 149.548814 128.215273) (xy 149.548811 128.215269) - (xy 149.548811 128.215266) (xy 149.455913 128.041467) (xy 149.455909 128.04146) (xy 149.330883 127.889116) - (xy 149.178539 127.76409) (xy 149.178532 127.764086) (xy 149.004733 127.671188) (xy 149.004727 127.671186) - (xy 148.816132 127.613976) (xy 148.816129 127.613975) (xy 148.62 127.594659) (xy 148.42387 127.613975) - (xy 148.377792 127.627953) (xy 148.29638 127.652649) (xy 148.226516 127.653272) (xy 148.172706 127.621669) - (xy 141.450564 120.899527) (xy 141.450563 120.899526) (xy 141.450562 120.899525) (xy 141.376747 120.856908) - (xy 141.36494 120.850091) (xy 141.364939 120.85009) (xy 141.364938 120.85009) (xy 141.292089 120.83057) - (xy 141.292088 120.830569) (xy 141.269436 120.8245) (xy 141.269435 120.8245) (xy 129.996308 120.8245) - (xy 129.929269 120.804815) (xy 129.894257 120.770938) (xy 129.890483 120.76547) (xy 129.77224 120.660717) - (xy 129.772238 120.660716) (xy 129.772237 120.660715) (xy 129.632365 120.587303) (xy 129.478986 120.5495) - (xy 129.478985 120.5495) (xy 129.321015 120.5495) (xy 129.321014 120.5495) (xy 129.167634 120.587303) - (xy 129.027762 120.660715) (xy 128.909516 120.765471) (xy 128.819781 120.895475) (xy 128.81978 120.895476) - (xy 128.763762 121.043181) (xy 128.744722 121.199999) (xy 128.744722 121.2) (xy 128.763762 121.356818) - (xy 128.807758 121.472824) (xy 128.81978 121.504523) (xy 128.909517 121.63453) (xy 129.02776 121.739283) - (xy 129.027762 121.739284) (xy 129.167634 121.812696) (xy 129.321014 121.8505) (xy 129.321015 121.8505) - (xy 129.478985 121.8505) (xy 129.632365 121.812696) (xy 129.77224 121.739283) (xy 129.890483 121.63453) - (xy 129.894257 121.629061) (xy 129.948537 121.585071) (xy 129.996308 121.5755) (xy 141.013101 121.5755) - (xy 141.08014 121.595185) (xy 141.100782 121.611819) (xy 147.641669 128.152706) (xy 147.675154 128.214029) - (xy 147.672649 128.27638) (xy 147.655031 128.33446) (xy 147.633975 128.40387) (xy 147.614659 128.6) - (xy 147.633975 128.796129) (xy 147.633976 128.796132) (xy 147.689223 128.978257) (xy 147.691188 128.984733) - (xy 147.784086 129.158532) (xy 147.78409 129.158539) (xy 147.909116 129.310883) (xy 148.06146 129.435909) - (xy 148.061463 129.435911) (xy 148.089315 129.450798) (xy 148.178953 129.49871) (xy 148.228797 129.547671) - (xy 148.2445 129.608068) (xy 148.2445 129.9755) (xy 148.224815 130.042539) (xy 148.172011 130.088294) - (xy 148.1205 130.0995) (xy 147.845323 130.0995) (xy 147.772264 130.114032) (xy 147.77226 130.114033) - (xy 147.689399 130.169399) (xy 147.634033 130.25226) (xy 147.634032 130.252264) (xy 147.6195 130.325321) - (xy 147.6195 131.874678) (xy 147.634032 131.947735) (xy 147.634033 131.947739) (xy 147.650786 131.972811) - (xy 147.689399 132.030601) (xy 147.764141 132.080541) (xy 147.77226 132.085966) (xy 147.772264 132.085967) - (xy 147.845321 132.100499) (xy 147.845324 132.1005) (xy 147.845326 132.1005) (xy 148.1205 132.1005) - (xy 148.187539 132.120185) (xy 148.233294 132.172989) (xy 148.2445 132.2245) (xy 148.2445 134.394101) - (xy 148.224815 134.46114) (xy 148.172011 134.506895) (xy 148.102853 134.516839) (xy 148.039297 134.487814) - (xy 148.032819 134.481782) (xy 145.855916 132.304879) (xy 145.822431 132.243556) (xy 145.827415 132.173864) - (xy 145.869287 132.117931) (xy 145.919406 132.095581) (xy 145.967735 132.085967) (xy 145.967735 132.085966) - (xy 145.96774 132.085966) (xy 146.050601 132.030601) (xy 146.105966 131.94774) (xy 146.1205 131.874674) - (xy 146.1205 130.325326) (xy 146.1205 130.325323) (xy 146.120499 130.325321) (xy 146.105967 130.252264) - (xy 146.105966 130.25226) (xy 146.105688 130.251844) (xy 146.050601 130.169399) (xy 145.995235 130.132405) - (xy 145.967739 130.114033) (xy 145.967735 130.114032) (xy 145.894677 130.0995) (xy 145.894674 130.0995) - (xy 145.6195 130.0995) (xy 145.552461 130.079815) (xy 145.506706 130.027011) (xy 145.4955 129.9755) - (xy 145.4955 129.608068) (xy 145.515185 129.541029) (xy 145.561046 129.49871) (xy 145.678538 129.43591) - (xy 145.830883 129.310883) (xy 145.95591 129.158538) (xy 146.043507 128.994656) (xy 146.048811 128.984733) - (xy 146.048811 128.984732) (xy 146.048814 128.984727) (xy 146.106024 128.796132) (xy 146.125341 128.6) - (xy 146.106024 128.403868) (xy 146.048814 128.215273) (xy 146.048811 128.215269) (xy 146.048811 128.215266) - (xy 145.955913 128.041467) (xy 145.955909 128.04146) (xy 145.830883 127.889116) (xy 145.678539 127.76409) - (xy 145.678532 127.764086) (xy 145.504733 127.671188) (xy 145.504727 127.671186) (xy 145.316132 127.613976) - (xy 145.316129 127.613975) (xy 145.12 127.594659) (xy 144.92387 127.613975) (xy 144.877792 127.627953) - (xy 144.79638 127.652649) (xy 144.726516 127.653272) (xy 144.672706 127.621669) (xy 139.850563 122.799526) - (xy 139.850562 122.799525) (xy 139.767976 122.751844) (xy 139.76494 122.750091) (xy 139.764939 122.75009) - (xy 139.764938 122.75009) (xy 139.717186 122.737295) (xy 139.717184 122.737294) (xy 139.717182 122.737293) - (xy 139.669436 122.7245) (xy 139.669435 122.7245) (xy 115.606899 122.7245) (xy 115.53986 122.704815) - (xy 115.519218 122.688181) (xy 114.911819 122.080782) (xy 114.878334 122.019459) (xy 114.8755 121.993101) - (xy 114.8755 121.991317) (xy 114.895185 121.924278) (xy 114.947989 121.878523) (xy 115.017147 121.868579) - (xy 115.080703 121.897604) (xy 115.081649 121.898433) (xy 115.104724 121.918875) (xy 115.127762 121.939285) - (xy 115.267634 122.012696) (xy 115.421014 122.0505) (xy 115.421015 122.0505) (xy 115.578985 122.0505) + (xy 133.044722 115.375) (xy 133.063762 115.531818) (xy 133.115988 115.669524) (xy 133.11978 115.679523) + (xy 133.152751 115.72729) (xy 133.202614 115.79953) (xy 133.209517 115.80953) (xy 133.226979 115.825) + (xy 133.305637 115.894684) (xy 133.342764 115.953874) (xy 133.341996 116.023739) (xy 133.305637 116.080316) + (xy 133.209516 116.16547) (xy 133.119781 116.295475) (xy 133.11978 116.295476) (xy 133.063762 116.443181) + (xy 133.044722 116.599999) (xy 133.044722 116.6) (xy 133.063762 116.756818) (xy 133.101022 116.855062) + (xy 133.11978 116.904523) (xy 133.209517 117.03453) (xy 133.32776 117.139283) (xy 133.327762 117.139284) + (xy 133.467634 117.212696) (xy 133.621014 117.2505) (xy 133.621015 117.2505) (xy 133.778985 117.2505) + (xy 133.932365 117.212696) (xy 133.95746 117.199525) (xy 134.07224 117.139283) (xy 134.190483 117.03453) + (xy 134.194257 117.029061) (xy 134.248537 116.985071) (xy 134.296308 116.9755) (xy 141.393101 116.9755) + (xy 141.46014 116.995185) (xy 141.480782 117.011819) (xy 151.708181 127.239218) (xy 151.741666 127.300541) + (xy 151.7445 127.326899) (xy 151.7445 127.59193) (xy 151.724815 127.658969) (xy 151.678954 127.701288) + (xy 151.561463 127.764088) (xy 151.56146 127.76409) (xy 151.409116 127.889116) (xy 151.28409 128.04146) + (xy 151.284086 128.041467) (xy 151.191188 128.215266) (xy 151.133975 128.40387) (xy 151.114659 128.6) + (xy 151.133975 128.796129) (xy 151.133976 128.796132) (xy 151.189223 128.978257) (xy 151.191188 128.984733) + (xy 151.284086 129.158532) (xy 151.28409 129.158539) (xy 151.409116 129.310883) (xy 151.56146 129.435909) + (xy 151.561463 129.435911) (xy 151.589315 129.450798) (xy 151.678953 129.49871) (xy 151.728797 129.547671) + (xy 151.7445 129.608068) (xy 151.7445 129.9755) (xy 151.724815 130.042539) (xy 151.672011 130.088294) + (xy 151.6205 130.0995) (xy 151.345323 130.0995) (xy 151.272264 130.114032) (xy 151.27226 130.114033) + (xy 151.189399 130.169399) (xy 151.134033 130.25226) (xy 151.134032 130.252264) (xy 151.1195 130.325321) + (xy 151.1195 131.874678) (xy 151.134032 131.947735) (xy 151.134033 131.947739) (xy 151.150786 131.972811) + (xy 151.189399 132.030601) (xy 151.264141 132.080541) (xy 151.27226 132.085966) (xy 151.272264 132.085967) + (xy 151.345321 132.100499) (xy 151.345324 132.1005) (xy 151.345326 132.1005) (xy 152.538101 132.1005) + (xy 152.60514 132.120185) (xy 152.625782 132.136819) (xy 157.755002 137.26604) (xy 157.788487 137.327363) + (xy 157.783503 137.397055) (xy 157.741631 137.452988) (xy 157.676167 137.477405) (xy 157.614534 137.464528) + (xy 157.614374 137.464952) (xy 157.611688 137.463933) (xy 157.609695 137.463517) (xy 157.607362 137.462292) + (xy 157.453983 137.424489) (xy 157.453982 137.424489) (xy 157.296012 137.424489) (xy 157.296011 137.424489) + (xy 157.142631 137.462292) (xy 157.002759 137.535704) (xy 157.002757 137.535706) (xy 156.884514 137.640459) + (xy 156.884513 137.64046) (xy 156.881293 137.643313) (xy 156.818059 137.673034) (xy 156.799066 137.674497) + (xy 155.296308 137.674497) (xy 155.229269 137.654812) (xy 155.194257 137.620935) (xy 155.190483 137.615467) + (xy 155.07224 137.510714) (xy 155.072238 137.510713) (xy 155.072237 137.510712) (xy 154.932365 137.4373) + (xy 154.778986 137.399497) (xy 154.778985 137.399497) (xy 154.621015 137.399497) (xy 154.621014 137.399497) + (xy 154.467634 137.4373) (xy 154.327762 137.510712) (xy 154.209516 137.615468) (xy 154.119781 137.745472) + (xy 154.11978 137.745473) (xy 154.063762 137.893178) (xy 154.044722 138.049996) (xy 154.044722 138.049997) + (xy 154.063762 138.206815) (xy 154.091034 138.278724) (xy 154.11978 138.35452) (xy 154.157895 138.409739) + (xy 154.209518 138.484529) (xy 154.214491 138.490142) (xy 154.2128 138.491639) (xy 154.243995 138.541363) + (xy 154.243233 138.611228) (xy 154.212896 138.658442) (xy 154.214491 138.659855) (xy 154.209518 138.665467) + (xy 154.119781 138.795475) (xy 154.11978 138.795476) (xy 154.063762 138.943181) (xy 154.044722 139.099999) + (xy 154.044722 139.1) (xy 154.063762 139.256818) (xy 154.107462 139.372044) (xy 154.11978 139.404523) + (xy 154.209517 139.53453) (xy 154.32776 139.639283) (xy 154.327762 139.639284) (xy 154.467634 139.712696) + (xy 154.621014 139.7505) (xy 154.621015 139.7505) (xy 154.778985 139.7505) (xy 154.932365 139.712696) + (xy 155.07224 139.639283) (xy 155.190483 139.53453) (xy 155.194257 139.529061) (xy 155.248537 139.485071) + (xy 155.296308 139.4755) (xy 156.803692 139.4755) (xy 156.870731 139.495185) (xy 156.905742 139.529061) + (xy 156.908163 139.532569) (xy 156.909515 139.534528) (xy 156.909517 139.53453) (xy 157.02776 139.639283) + (xy 157.027762 139.639284) (xy 157.167634 139.712696) (xy 157.321014 139.7505) (xy 157.321015 139.7505) + (xy 157.478985 139.7505) (xy 157.632365 139.712696) (xy 157.77224 139.639283) (xy 157.890483 139.53453) + (xy 157.98022 139.404523) (xy 158.036237 139.256818) (xy 158.055278 139.1) (xy 158.051022 139.064944) + (xy 158.036237 138.943181) (xy 158.01055 138.875452) (xy 157.98022 138.795477) (xy 157.890483 138.66547) + (xy 157.89048 138.665467) (xy 157.890395 138.665391) (xy 157.89035 138.665319) (xy 157.885509 138.659855) + (xy 157.886417 138.659049) (xy 157.85327 138.606201) (xy 157.854039 138.536336) (xy 157.870572 138.502141) + (xy 157.955217 138.379512) (xy 158.011234 138.231807) (xy 158.030275 138.074989) (xy 158.029918 138.072044) + (xy 158.011234 137.91817) (xy 157.974195 137.820507) (xy 157.968828 137.750844) (xy 158.001975 137.689338) + (xy 158.063114 137.655516) (xy 158.132832 137.660118) (xy 158.177816 137.688853) (xy 159.293971 138.805009) + (xy 160.406781 139.917819) (xy 160.440266 139.979142) (xy 160.435282 140.048834) (xy 160.39341 140.104767) + (xy 160.327946 140.129184) (xy 160.3191 140.1295) (xy 154.4119 140.1295) (xy 154.344861 140.109815) + (xy 154.324219 140.093181) (xy 149.031819 134.800781) (xy 148.998334 134.739458) (xy 148.9955 134.7131) + (xy 148.9955 132.2245) (xy 149.015185 132.157461) (xy 149.067989 132.111706) (xy 149.1195 132.1005) + (xy 149.394676 132.1005) (xy 149.394677 132.100499) (xy 149.46774 132.085966) (xy 149.550601 132.030601) + (xy 149.605966 131.94774) (xy 149.6205 131.874674) (xy 149.6205 130.325326) (xy 149.6205 130.325323) + (xy 149.620499 130.325321) (xy 149.605967 130.252264) (xy 149.605966 130.25226) (xy 149.605688 130.251844) + (xy 149.550601 130.169399) (xy 149.495235 130.132405) (xy 149.467739 130.114033) (xy 149.467735 130.114032) + (xy 149.394677 130.0995) (xy 149.394674 130.0995) (xy 149.1195 130.0995) (xy 149.052461 130.079815) + (xy 149.006706 130.027011) (xy 148.9955 129.9755) (xy 148.9955 129.608068) (xy 149.015185 129.541029) + (xy 149.061046 129.49871) (xy 149.178538 129.43591) (xy 149.330883 129.310883) (xy 149.45591 129.158538) + (xy 149.543507 128.994656) (xy 149.548811 128.984733) (xy 149.548811 128.984732) (xy 149.548814 128.984727) + (xy 149.606024 128.796132) (xy 149.625341 128.6) (xy 149.606024 128.403868) (xy 149.548814 128.215273) + (xy 149.548811 128.215269) (xy 149.548811 128.215266) (xy 149.455913 128.041467) (xy 149.455909 128.04146) + (xy 149.330883 127.889116) (xy 149.178539 127.76409) (xy 149.178532 127.764086) (xy 149.004733 127.671188) + (xy 149.004727 127.671186) (xy 148.816132 127.613976) (xy 148.816129 127.613975) (xy 148.62 127.594659) + (xy 148.42387 127.613975) (xy 148.377792 127.627953) (xy 148.29638 127.652649) (xy 148.226516 127.653272) + (xy 148.172706 127.621669) (xy 141.450564 120.899527) (xy 141.450563 120.899526) (xy 141.450562 120.899525) + (xy 141.376747 120.856908) (xy 141.36494 120.850091) (xy 141.364939 120.85009) (xy 141.364938 120.85009) + (xy 141.292089 120.83057) (xy 141.292088 120.830569) (xy 141.269436 120.8245) (xy 141.269435 120.8245) + (xy 129.996308 120.8245) (xy 129.929269 120.804815) (xy 129.894257 120.770938) (xy 129.890483 120.76547) + (xy 129.77224 120.660717) (xy 129.772238 120.660716) (xy 129.772237 120.660715) (xy 129.632365 120.587303) + (xy 129.478986 120.5495) (xy 129.478985 120.5495) (xy 129.321015 120.5495) (xy 129.321014 120.5495) + (xy 129.167634 120.587303) (xy 129.027762 120.660715) (xy 128.909516 120.765471) (xy 128.819781 120.895475) + (xy 128.81978 120.895476) (xy 128.763762 121.043181) (xy 128.744722 121.199999) (xy 128.744722 121.2) + (xy 128.763762 121.356818) (xy 128.807758 121.472824) (xy 128.81978 121.504523) (xy 128.909517 121.63453) + (xy 129.02776 121.739283) (xy 129.027762 121.739284) (xy 129.167634 121.812696) (xy 129.321014 121.8505) + (xy 129.321015 121.8505) (xy 129.478985 121.8505) (xy 129.632365 121.812696) (xy 129.77224 121.739283) + (xy 129.890483 121.63453) (xy 129.894257 121.629061) (xy 129.948537 121.585071) (xy 129.996308 121.5755) + (xy 141.013101 121.5755) (xy 141.08014 121.595185) (xy 141.100782 121.611819) (xy 147.641669 128.152706) + (xy 147.675154 128.214029) (xy 147.672649 128.27638) (xy 147.655031 128.33446) (xy 147.633975 128.40387) + (xy 147.614659 128.6) (xy 147.633975 128.796129) (xy 147.633976 128.796132) (xy 147.689223 128.978257) + (xy 147.691188 128.984733) (xy 147.784086 129.158532) (xy 147.78409 129.158539) (xy 147.909116 129.310883) + (xy 148.06146 129.435909) (xy 148.061463 129.435911) (xy 148.089315 129.450798) (xy 148.178953 129.49871) + (xy 148.228797 129.547671) (xy 148.2445 129.608068) (xy 148.2445 129.9755) (xy 148.224815 130.042539) + (xy 148.172011 130.088294) (xy 148.1205 130.0995) (xy 147.845323 130.0995) (xy 147.772264 130.114032) + (xy 147.77226 130.114033) (xy 147.689399 130.169399) (xy 147.634033 130.25226) (xy 147.634032 130.252264) + (xy 147.6195 130.325321) (xy 147.6195 131.874678) (xy 147.634032 131.947735) (xy 147.634033 131.947739) + (xy 147.650786 131.972811) (xy 147.689399 132.030601) (xy 147.764141 132.080541) (xy 147.77226 132.085966) + (xy 147.772264 132.085967) (xy 147.845321 132.100499) (xy 147.845324 132.1005) (xy 147.845326 132.1005) + (xy 148.1205 132.1005) (xy 148.187539 132.120185) (xy 148.233294 132.172989) (xy 148.2445 132.2245) + (xy 148.2445 134.394101) (xy 148.224815 134.46114) (xy 148.172011 134.506895) (xy 148.102853 134.516839) + (xy 148.039297 134.487814) (xy 148.032819 134.481782) (xy 145.855916 132.304879) (xy 145.822431 132.243556) + (xy 145.827415 132.173864) (xy 145.869287 132.117931) (xy 145.919406 132.095581) (xy 145.967735 132.085967) + (xy 145.967735 132.085966) (xy 145.96774 132.085966) (xy 146.050601 132.030601) (xy 146.105966 131.94774) + (xy 146.1205 131.874674) (xy 146.1205 130.325326) (xy 146.1205 130.325323) (xy 146.120499 130.325321) + (xy 146.105967 130.252264) (xy 146.105966 130.25226) (xy 146.105688 130.251844) (xy 146.050601 130.169399) + (xy 145.995235 130.132405) (xy 145.967739 130.114033) (xy 145.967735 130.114032) (xy 145.894677 130.0995) + (xy 145.894674 130.0995) (xy 145.6195 130.0995) (xy 145.552461 130.079815) (xy 145.506706 130.027011) + (xy 145.4955 129.9755) (xy 145.4955 129.608068) (xy 145.515185 129.541029) (xy 145.561046 129.49871) + (xy 145.678538 129.43591) (xy 145.830883 129.310883) (xy 145.95591 129.158538) (xy 146.043507 128.994656) + (xy 146.048811 128.984733) (xy 146.048811 128.984732) (xy 146.048814 128.984727) (xy 146.106024 128.796132) + (xy 146.125341 128.6) (xy 146.106024 128.403868) (xy 146.048814 128.215273) (xy 146.048811 128.215269) + (xy 146.048811 128.215266) (xy 145.955913 128.041467) (xy 145.955909 128.04146) (xy 145.830883 127.889116) + (xy 145.678539 127.76409) (xy 145.678532 127.764086) (xy 145.504733 127.671188) (xy 145.504727 127.671186) + (xy 145.316132 127.613976) (xy 145.316129 127.613975) (xy 145.12 127.594659) (xy 144.92387 127.613975) + (xy 144.877792 127.627953) (xy 144.79638 127.652649) (xy 144.726516 127.653272) (xy 144.672706 127.621669) + (xy 139.850563 122.799526) (xy 139.850562 122.799525) (xy 139.767976 122.751844) (xy 139.76494 122.750091) + (xy 139.764939 122.75009) (xy 139.764938 122.75009) (xy 139.717186 122.737295) (xy 139.717184 122.737294) + (xy 139.717182 122.737293) (xy 139.669436 122.7245) (xy 139.669435 122.7245) (xy 115.6069 122.7245) + (xy 115.539861 122.704815) (xy 115.519219 122.688181) (xy 115.161819 122.330781) (xy 115.128334 122.269458) + (xy 115.1255 122.2431) (xy 115.1255 122.135937) (xy 115.145185 122.068898) (xy 115.197989 122.023143) + (xy 115.267147 122.013199) (xy 115.279169 122.015538) (xy 115.421015 122.0505) (xy 115.578985 122.0505) (xy 115.732365 122.012696) (xy 115.87224 121.939283) (xy 115.937256 121.881683) (xy 116.00049 121.851963) (xy 116.019483 121.8505) (xy 119.074435 121.8505) (xy 119.074436 121.8505) (xy 119.122186 121.837705) (xy 119.169938 121.82491) (xy 119.255562 121.775475) (xy 119.325475 121.705562) (xy 121.610474 119.420563) @@ -178703,455 +183622,83 @@ (xy 117.28022 120.904531) (xy 117.336237 120.756826) (xy 117.355278 120.600008) (xy 117.353736 120.587304) (xy 117.336237 120.443189) (xy 117.305453 120.36202) (xy 117.28022 120.295485) (xy 117.190483 120.165478) (xy 117.190481 120.165476) (xy 117.117273 120.100619) (xy 117.080146 120.04143) (xy 117.0755 120.007804) - (xy 117.0755 117.450567) (xy 117.0755 117.450565) (xy 117.04991 117.355062) (xy 117.003977 117.275504) - (xy 117.003976 117.275499) (xy 117.003975 117.2755) (xy 117.000475 117.269437) (xy 115.088884 115.357847) - (xy 115.0554 115.296525) (xy 115.05347 115.285113) (xy 115.036237 115.143182) (xy 114.98022 114.995477) - (xy 114.890483 114.86547) (xy 114.77224 114.760717) (xy 114.772238 114.760716) (xy 114.772237 114.760715) - (xy 114.632365 114.687303) (xy 114.478986 114.6495) (xy 114.478985 114.6495) (xy 114.321015 114.6495) - (xy 114.321014 114.6495) (xy 114.167634 114.687303) (xy 114.027762 114.760715) (xy 113.909516 114.865471) - (xy 113.819781 114.995475) (xy 113.81978 114.995476) (xy 113.763762 115.143181) (xy 113.744722 115.299999) - (xy 113.744722 115.3) (xy 113.763762 115.456818) (xy 113.805301 115.566345) (xy 113.81978 115.604523) - (xy 113.909517 115.73453) (xy 114.02776 115.839283) (xy 114.027762 115.839284) (xy 114.167634 115.912696) - (xy 114.233585 115.92895) (xy 114.286229 115.941926) (xy 114.34661 115.977082) (xy 114.378399 116.039301) - (xy 114.371504 116.108829) (xy 114.328113 116.163592) (xy 114.286233 116.182719) (xy 114.267635 116.187303) - (xy 114.267634 116.187303) (xy 114.127762 116.260715) (xy 114.088526 116.295475) (xy 114.019181 116.356909) - (xy 114.009516 116.365471) (xy 113.919781 116.495475) (xy 113.91978 116.495476) (xy 113.863762 116.643181) - (xy 113.844722 116.799999) (xy 113.844722 116.8) (xy 113.863762 116.956818) (xy 113.91978 117.104523) - (xy 113.919781 117.104524) (xy 114.009517 117.234531) (xy 114.082726 117.299386) (xy 114.119853 117.358574) - (xy 114.1245 117.392202) (xy 114.1245 122.249435) (xy 114.15009 122.344938) (xy 114.195079 122.422861) - (xy 114.199526 122.430563) (xy 114.199528 122.430566) (xy 114.653944 122.884981) (xy 115.099525 123.330562) - (xy 115.169438 123.400475) (xy 115.255062 123.44991) (xy 115.302811 123.462705) (xy 115.302812 123.462705) - (xy 115.312903 123.465408) (xy 115.350564 123.4755) (xy 115.350565 123.4755) (xy 139.413101 123.4755) - (xy 139.48014 123.495185) (xy 139.500782 123.511819) (xy 144.141669 128.152706) (xy 144.175154 128.214029) - (xy 144.172649 128.27638) (xy 144.155031 128.33446) (xy 144.133975 128.40387) (xy 144.114659 128.6) - (xy 144.133975 128.796129) (xy 144.133976 128.796132) (xy 144.189223 128.978257) (xy 144.191188 128.984733) - (xy 144.284086 129.158532) (xy 144.28409 129.158539) (xy 144.409116 129.310883) (xy 144.56146 129.435909) - (xy 144.561463 129.435911) (xy 144.589315 129.450798) (xy 144.678953 129.49871) (xy 144.728797 129.547671) - (xy 144.7445 129.608068) (xy 144.7445 129.9755) (xy 144.724815 130.042539) (xy 144.672011 130.088294) - (xy 144.6205 130.0995) (xy 144.345323 130.0995) (xy 144.272264 130.114032) (xy 144.27226 130.114033) - (xy 144.189399 130.169399) (xy 144.134033 130.25226) (xy 144.134032 130.252264) (xy 144.1195 130.325321) - (xy 144.1195 131.874678) (xy 144.134032 131.947735) (xy 144.134033 131.947739) (xy 144.150786 131.972811) - (xy 144.189399 132.030601) (xy 144.264141 132.080541) (xy 144.27226 132.085966) (xy 144.272264 132.085967) - (xy 144.345321 132.100499) (xy 144.345324 132.1005) (xy 144.345326 132.1005) (xy 144.636239 132.1005) - (xy 144.703278 132.120185) (xy 144.749033 132.172989) (xy 144.756013 132.192405) (xy 144.770089 132.244936) - (xy 144.770089 132.244937) (xy 144.783002 132.267302) (xy 144.817879 132.327711) (xy 144.818572 132.32891) - (xy 144.818572 132.328913) (xy 144.819523 132.33056) (xy 144.819527 132.330565) (xy 149.266444 136.777481) - (xy 153.674525 141.185562) (xy 153.744438 141.255475) (xy 153.830062 141.30491) (xy 153.830066 141.304911) - (xy 153.863014 141.31374) (xy 153.863015 141.31374) (xy 153.879775 141.31823) (xy 153.925564 141.3305) - (xy 153.925565 141.3305) (xy 160.297519 141.3305) (xy 160.364558 141.350185) (xy 160.3852 141.366819) - (xy 163.463181 144.4448) (xy 163.496666 144.506123) (xy 163.4995 144.532481) (xy 163.4995 147.622386) - (xy 163.479815 147.689425) (xy 163.427011 147.73518) (xy 163.357853 147.745124) (xy 163.317874 147.732182) - (xy 163.232364 147.687302) (xy 163.078985 147.649499) (xy 163.078984 147.649499) (xy 162.921014 147.649499) - (xy 162.921013 147.649499) (xy 162.767633 147.687302) (xy 162.627761 147.760714) (xy 162.509515 147.86547) - (xy 162.41978 147.995474) (xy 162.419779 147.995475) (xy 162.363761 148.14318) (xy 162.363761 148.143183) - (xy 162.363107 148.148568) (xy 162.335481 148.212744) (xy 162.277544 148.251797) (xy 162.207691 148.253327) - (xy 162.152332 148.221295) (xy 161.957806 148.026768) (xy 161.764239 147.833201) (xy 161.730754 147.771878) - (xy 161.735738 147.702186) (xy 161.77761 147.646253) (xy 161.843074 147.621836) (xy 161.881589 147.625122) - (xy 161.960395 147.644546) (xy 161.960397 147.644546) (xy 162.118365 147.644546) (xy 162.271745 147.606742) - (xy 162.300982 147.591397) (xy 162.41162 147.533329) (xy 162.529863 147.428576) (xy 162.6196 147.298569) - (xy 162.675617 147.150864) (xy 162.694658 146.994046) (xy 162.694201 146.990278) (xy 162.675617 146.837227) - (xy 162.633088 146.725088) (xy 162.6196 146.689523) (xy 162.529863 146.559516) (xy 162.41162 146.454763) - (xy 162.411618 146.454762) (xy 162.411617 146.454761) (xy 162.271745 146.381349) (xy 162.118366 146.343546) - (xy 162.118365 146.343546) (xy 161.960395 146.343546) (xy 161.960394 146.343546) (xy 161.807014 146.381349) - (xy 161.667142 146.454761) (xy 161.548896 146.559517) (xy 161.459161 146.689521) (xy 161.45916 146.689522) - (xy 161.420628 146.791123) (xy 161.37845 146.846826) (xy 161.312852 146.870883) (xy 161.304686 146.871152) - (xy 158.164134 146.871152) (xy 158.097095 146.851467) (xy 158.076453 146.834833) (xy 156.741145 145.499526) - (xy 156.741144 145.499525) (xy 156.669896 145.45839) (xy 156.655522 145.450091) (xy 156.655521 145.45009) - (xy 156.65552 145.45009) (xy 156.591624 145.432969) (xy 156.591623 145.432968) (xy 156.560018 145.4245) - (xy 156.560017 145.4245) (xy 147.196308 145.4245) (xy 147.129269 145.404815) (xy 147.094257 145.370938) - (xy 147.090483 145.36547) (xy 146.97224 145.260717) (xy 146.972238 145.260716) (xy 146.972237 145.260715) - (xy 146.832365 145.187303) (xy 146.678986 145.1495) (xy 146.678985 145.1495) (xy 146.521015 145.1495) - (xy 146.521014 145.1495) (xy 146.367634 145.187303) (xy 146.227762 145.260715) (xy 146.22776 145.260717) - (xy 146.138631 145.339678) (xy 146.109516 145.365471) (xy 146.019781 145.495475) (xy 146.01978 145.495476) - (xy 145.963762 145.643181) (xy 145.944722 145.799999) (xy 145.944722 145.8) (xy 145.963762 145.956818) - (xy 146.01978 146.104523) (xy 146.109517 146.23453) (xy 146.22776 146.339283) (xy 146.227762 146.339284) - (xy 146.367634 146.412696) (xy 146.521014 146.4505) (xy 146.521015 146.4505) (xy 146.678985 146.4505) - (xy 146.832365 146.412696) (xy 146.892089 146.38135) (xy 146.97224 146.339283) (xy 147.090483 146.23453) - (xy 147.094257 146.229061) (xy 147.148537 146.185071) (xy 147.196308 146.1755) (xy 156.303683 146.1755) - (xy 156.370722 146.195185) (xy 156.391364 146.211819) (xy 157.232446 147.052901) (xy 157.265931 147.114224) - (xy 157.260947 147.183916) (xy 157.219075 147.239849) (xy 157.17444 147.260979) (xy 157.067633 147.287304) - (xy 156.927762 147.360715) (xy 156.91634 147.370834) (xy 156.842593 147.436168) (xy 156.809516 147.465471) - (xy 156.719781 147.595475) (xy 156.71978 147.595476) (xy 156.663762 147.743181) (xy 156.644722 147.899999) - (xy 156.644722 147.9) (xy 156.663762 148.056818) (xy 156.698559 148.148568) (xy 156.71978 148.204523) - (xy 156.805743 148.329063) (xy 156.806432 148.33006) (xy 156.828315 148.396414) (xy 156.81085 148.464066) - (xy 156.759582 148.511536) (xy 156.704382 148.5245) (xy 146.4069 148.5245) (xy 146.339861 148.504815) - (xy 146.319219 148.488181) (xy 144.060101 146.229063) (xy 141.794217 143.96318) (xy 141.760733 143.901858) - (xy 141.765717 143.832166) (xy 141.779852 143.805056) (xy 141.78022 143.804523) (xy 141.836237 143.656818) - (xy 141.855278 143.5) (xy 141.837488 143.35348) (xy 141.836237 143.343181) (xy 141.810568 143.275499) - (xy 141.78022 143.195477) (xy 141.690483 143.06547) (xy 141.57224 142.960717) (xy 141.572238 142.960716) - (xy 141.572237 142.960715) (xy 141.432365 142.887303) (xy 141.278986 142.8495) (xy 141.278985 142.8495) - (xy 141.121015 142.8495) (xy 141.121014 142.8495) (xy 140.967634 142.887303) (xy 140.827762 142.960715) - (xy 140.709516 143.065471) (xy 140.619781 143.195475) (xy 140.61978 143.195476) (xy 140.563762 143.343181) - (xy 140.544722 143.499999) (xy 140.544722 143.5) (xy 140.563762 143.656818) (xy 140.595038 143.739284) - (xy 140.61978 143.804523) (xy 140.709517 143.93453) (xy 140.82776 144.039283) (xy 140.827761 144.039283) - (xy 140.827764 144.039286) (xy 140.833934 144.043545) (xy 140.832437 144.045713) (xy 140.87307 144.084742) - (xy 140.889673 144.113499) (xy 140.899525 144.130562) (xy 140.899526 144.130563) (xy 145.969437 149.200475) - (xy 145.969438 149.200476) (xy 145.96944 149.200477) (xy 146.01225 149.225193) (xy 146.055063 149.249911) - (xy 146.150564 149.2755) (xy 146.150565 149.2755) (xy 157.342796 149.2755) (xy 157.409835 149.295185) - (xy 157.430476 149.311818) (xy 158.269129 150.150472) (xy 158.26913 150.150473) (xy 158.269132 150.150474) - (xy 158.284972 150.159619) (xy 158.354755 150.199908) (xy 158.450256 150.225497) (xy 158.450257 150.225497) - (xy 161.503692 150.225497) (xy 161.570731 150.245182) (xy 161.605742 150.279058) (xy 161.609517 150.284527) - (xy 161.609519 150.284529) (xy 161.60952 150.28453) (xy 161.614491 150.290142) (xy 161.6128 150.291639) - (xy 161.643995 150.341363) (xy 161.643233 150.411228) (xy 161.612896 150.458443) (xy 161.614491 150.459856) - (xy 161.609516 150.46547) (xy 161.607089 150.468987) (xy 161.605742 150.470938) (xy 161.551463 150.514929) - (xy 161.503692 150.5245) (xy 146.106899 150.5245) (xy 146.03986 150.504815) (xy 146.019218 150.488181) - (xy 138.884517 143.35348) (xy 138.851032 143.292157) (xy 138.849102 143.250857) (xy 138.855278 143.2) - (xy 138.836237 143.043182) (xy 138.78022 142.895477) (xy 138.690483 142.76547) (xy 138.57224 142.660717) - (xy 138.572238 142.660716) (xy 138.572237 142.660715) (xy 138.432365 142.587303) (xy 138.278986 142.5495) - (xy 138.278985 142.5495) (xy 138.121015 142.5495) (xy 138.121014 142.5495) (xy 137.967634 142.587303) - (xy 137.827762 142.660715) (xy 137.709516 142.765471) (xy 137.619781 142.895475) (xy 137.61978 142.895476) - (xy 137.563762 143.043181) (xy 137.544722 143.199999) (xy 137.544722 143.2) (xy 137.563762 143.356818) - (xy 137.618064 143.499999) (xy 137.61978 143.504523) (xy 137.709517 143.63453) (xy 137.82776 143.739283) - (xy 137.827762 143.739284) (xy 137.967634 143.812696) (xy 138.121014 143.8505) (xy 138.268101 143.8505) - (xy 138.33514 143.870185) (xy 138.355782 143.886819) (xy 145.599525 151.130562) (xy 145.669438 151.200475) - (xy 145.755062 151.24991) (xy 145.767952 151.253364) (xy 145.780841 151.256818) (xy 145.780842 151.256818) - (xy 145.795576 151.260765) (xy 145.850564 151.2755) (xy 145.850565 151.2755) (xy 161.503692 151.2755) - (xy 161.570731 151.295185) (xy 161.605742 151.329061) (xy 161.609517 151.33453) (xy 161.72776 151.439283) - (xy 161.727762 151.439284) (xy 161.867634 151.512696) (xy 162.021014 151.5505) (xy 162.021015 151.5505) - (xy 162.178985 151.5505) (xy 162.332365 151.512696) (xy 162.342872 151.507181) (xy 162.411377 151.493454) - (xy 162.476431 151.518943) (xy 162.517378 151.575557) (xy 162.5245 151.616976) (xy 162.5245 152.8931) - (xy 162.504815 152.960139) (xy 162.488181 152.980781) (xy 161.030782 154.438181) (xy 160.969459 154.471666) - (xy 160.943101 154.4745) (xy 154.186308 154.4745) (xy 154.119269 154.454815) (xy 154.084257 154.420938) - (xy 154.080483 154.41547) (xy 153.96224 154.310717) (xy 153.962238 154.310716) (xy 153.962237 154.310715) - (xy 153.822365 154.237303) (xy 153.668986 154.1995) (xy 153.668985 154.1995) (xy 153.511015 154.1995) - (xy 153.511014 154.1995) (xy 153.357634 154.237303) (xy 153.217762 154.310715) (xy 153.099516 154.415471) - (xy 153.009781 154.545475) (xy 153.00978 154.545476) (xy 152.953762 154.693181) (xy 152.934722 154.849999) - (xy 152.934722 154.85) (xy 152.953762 155.006818) (xy 152.990933 155.104828) (xy 153.00978 155.154523) - (xy 153.099517 155.28453) (xy 153.21776 155.389283) (xy 153.217762 155.389284) (xy 153.357634 155.462696) - (xy 153.511014 155.5005) (xy 153.511015 155.5005) (xy 153.668985 155.5005) (xy 153.822365 155.462696) - (xy 153.827406 155.46005) (xy 153.96224 155.389283) (xy 154.080483 155.28453) (xy 154.084257 155.279061) - (xy 154.138537 155.235071) (xy 154.186308 155.2255) (xy 160.580497 155.2255) (xy 160.647536 155.245185) - (xy 160.693291 155.297989) (xy 160.703235 155.367147) (xy 160.67421 155.430703) (xy 160.668178 155.437181) - (xy 159.692178 156.413181) (xy 159.630855 156.446666) (xy 159.604497 156.4495) (xy 157.596308 156.4495) - (xy 157.529269 156.429815) (xy 157.494257 156.395938) (xy 157.490483 156.39047) (xy 157.37224 156.285717) - (xy 157.372238 156.285716) (xy 157.372237 156.285715) (xy 157.232365 156.212303) (xy 157.078986 156.1745) - (xy 157.078985 156.1745) (xy 156.921015 156.1745) (xy 156.921014 156.1745) (xy 156.767634 156.212303) - (xy 156.627762 156.285715) (xy 156.509516 156.390471) (xy 156.419781 156.520475) (xy 156.41978 156.520476) - (xy 156.363762 156.668181) (xy 156.344722 156.824999) (xy 156.344722 156.825) (xy 156.363762 156.981818) - (xy 156.39173 157.055562) (xy 156.41978 157.129523) (xy 156.509517 157.25953) (xy 156.62776 157.364283) - (xy 156.627762 157.364284) (xy 156.767634 157.437696) (xy 156.921014 157.4755) (xy 156.921015 157.4755) - (xy 157.078985 157.4755) (xy 157.232365 157.437696) (xy 157.37224 157.364283) (xy 157.490483 157.25953) - (xy 157.494257 157.254061) (xy 157.548537 157.210071) (xy 157.596308 157.2005) (xy 159.860831 157.2005) - (xy 159.860832 157.2005) (xy 159.898518 157.190401) (xy 159.908617 157.187696) (xy 159.929654 157.182058) - (xy 159.956334 157.17491) (xy 160.041958 157.125475) (xy 160.111871 157.055562) (xy 160.11187 157.055562) - (xy 160.170439 156.996993) (xy 160.170438 156.996993) (xy 163.532821 153.634612) (xy 163.594142 153.601129) - (xy 163.663834 153.606113) (xy 163.719767 153.647985) (xy 163.744184 153.713449) (xy 163.7445 153.722295) - (xy 163.7445 164.2005) (xy 163.724815 164.267539) (xy 163.672011 164.313294) (xy 163.6205 164.3245) - (xy 128.242262 164.3245) (xy 128.19451 164.337295) (xy 128.194509 164.337294) (xy 128.146761 164.350089) - (xy 128.14676 164.350089) (xy 128.061133 164.399527) (xy 122.182423 170.278237) (xy 122.1211 170.311722) - (xy 122.094742 170.314556) (xy 121.947656 170.314556) (xy 121.794276 170.352359) (xy 121.654404 170.425771) - (xy 121.536158 170.530527) (xy 121.446423 170.660531) (xy 121.446422 170.660532) (xy 121.390404 170.808237) - (xy 121.371364 170.965055) (xy 121.371364 170.965056) (xy 121.390404 171.121874) (xy 121.435257 171.240139) - (xy 121.446422 171.269579) (xy 121.536159 171.399586) (xy 121.654402 171.504339) (xy 121.654404 171.50434) - (xy 121.794276 171.577752) (xy 121.947656 171.615556) (xy 121.947657 171.615556) (xy 122.105627 171.615556) - (xy 122.259007 171.577752) (xy 122.293905 171.559436) (xy 122.398882 171.504339) (xy 122.517125 171.399586) - (xy 122.606862 171.269579) (xy 122.662879 171.121874) (xy 122.68192 170.965056) (xy 122.675744 170.9142) - (xy 122.687203 170.84528) (xy 122.711156 170.811577) (xy 128.410916 165.111819) (xy 128.472239 165.078334) - (xy 128.498597 165.0755) (xy 163.6205 165.0755) (xy 163.687539 165.095185) (xy 163.733294 165.147989) - (xy 163.7445 165.1995) (xy 163.7445 168.993907) (xy 163.744527 168.995) (xy 163.744808 169.00645) - (xy 163.745406 169.018618) (xy 163.746325 169.031086) (xy 163.763745 169.207958) (xy 163.763751 169.208009) - (xy 163.767421 169.232756) (xy 163.767427 169.232785) (xy 163.772165 169.256608) (xy 163.778258 169.280934) - (xy 163.821556 169.423668) (xy 163.821555 169.423668) (xy 163.828073 169.445153) (xy 163.828076 169.445162) - (xy 163.836525 169.468776) (xy 163.836539 169.468812) (xy 163.845818 169.491214) (xy 163.845821 169.49122) - (xy 163.85655 169.513905) (xy 163.856557 169.513919) (xy 163.937435 169.665229) (xy 163.937441 169.66524) - (xy 163.942185 169.673155) (xy 163.950316 169.686722) (xy 163.950327 169.686739) (xy 163.963827 169.706944) - (xy 163.963845 169.70697) (xy 163.971115 169.716772) (xy 163.97877 169.727093) (xy 164.00925 169.764234) - (xy 164.009274 169.764265) (xy 164.087644 169.859758) (xy 164.104473 169.878326) (xy 164.121672 169.895525) - (xy 164.14024 169.912354) (xy 164.140245 169.912358) (xy 164.272901 170.021226) (xy 164.272916 170.021237) - (xy 164.293015 170.036145) (xy 164.293081 170.036191) (xy 164.313251 170.049667) (xy 164.334731 170.062542) - (xy 164.334747 170.062551) (xy 164.334759 170.062558) (xy 164.334778 170.062568) (xy 164.486079 170.143441) - (xy 164.486093 170.143448) (xy 164.486097 170.14345) (xy 164.486101 170.143452) (xy 164.508762 170.15417) - (xy 164.53122 170.163473) (xy 164.554834 170.171922) (xy 164.719057 170.221738) (xy 164.743381 170.227831) - (xy 164.767222 170.232573) (xy 164.785462 170.235278) (xy 164.79202 170.236252) (xy 164.809984 170.238021) - (xy 164.968895 170.253673) (xy 164.981404 170.254595) (xy 164.993558 170.255192) (xy 165.006093 170.2555) - (xy 165.768085 170.2555) (xy 165.835124 170.275185) (xy 165.880879 170.327989) (xy 165.890823 170.397147) - (xy 165.861798 170.460703) (xy 165.855766 170.467181) (xy 162.784766 173.538181) (xy 162.723443 173.571666) - (xy 162.697085 173.5745) (xy 122.696298 173.5745) (xy 122.629259 173.554815) (xy 122.594247 173.520938) - (xy 122.590473 173.51547) (xy 122.47223 173.410717) (xy 122.472228 173.410716) (xy 122.472227 173.410715) - (xy 122.332355 173.337303) (xy 122.178976 173.2995) (xy 122.178975 173.2995) (xy 122.021005 173.2995) - (xy 122.021004 173.2995) (xy 121.867624 173.337303) (xy 121.727752 173.410715) (xy 121.609506 173.515471) - (xy 121.519771 173.645475) (xy 121.51977 173.645476) (xy 121.463752 173.793181) (xy 121.444712 173.949999) - (xy 121.444712 173.95) (xy 121.463752 174.106818) (xy 121.51977 174.254523) (xy 121.519771 174.254524) - (xy 121.609506 174.384529) (xy 121.613132 174.387741) (xy 121.650259 174.446931) (xy 121.649491 174.516796) - (xy 121.611074 174.575156) (xy 121.547203 174.603481) (xy 121.530905 174.604557) (xy 121.431966 174.604557) - (xy 121.358907 174.619089) (xy 121.358903 174.61909) (xy 121.276042 174.674456) (xy 121.220676 174.757317) - (xy 121.220675 174.757321) (xy 121.206143 174.830378) (xy 121.206143 176.379735) (xy 121.220675 176.452792) - (xy 121.220676 176.452796) (xy 121.220677 176.452797) (xy 121.276042 176.535658) (xy 121.358903 176.591023) - (xy 121.358907 176.591024) (xy 121.431964 176.605556) (xy 121.431967 176.605557) (xy 121.431969 176.605557) - (xy 122.981319 176.605557) (xy 122.98132 176.605556) (xy 123.054383 176.591023) (xy 123.137244 176.535658) - (xy 123.192609 176.452797) (xy 123.207143 176.379731) (xy 123.207143 174.830383) (xy 123.207143 174.83038) - (xy 123.207142 174.830378) (xy 123.19261 174.757321) (xy 123.192609 174.757317) (xy 123.184334 174.744932) - (xy 123.137244 174.674456) (xy 123.054383 174.619091) (xy 123.054382 174.61909) (xy 123.054378 174.619089) - (xy 122.98132 174.604557) (xy 122.981317 174.604557) (xy 122.669075 174.604557) (xy 122.602036 174.584872) - (xy 122.556281 174.532068) (xy 122.546337 174.46291) (xy 122.575362 174.399354) (xy 122.586848 174.387741) - (xy 122.590473 174.38453) (xy 122.594247 174.379061) (xy 122.648527 174.335071) (xy 122.696298 174.3255) - (xy 162.953419 174.3255) (xy 162.95342 174.3255) (xy 163.00117 174.312705) (xy 163.048922 174.29991) - (xy 163.134546 174.250475) (xy 163.204459 174.180562) (xy 167.243326 170.141693) (xy 167.304647 170.10821) - (xy 167.374339 170.113194) (xy 167.421797 170.146133) (xy 167.422341 170.145618) (xy 167.424243 170.147625) - (xy 167.424248 170.14763) (xy 167.42425 170.147632) (xy 167.457024 170.179257) (xy 167.545359 170.225465) - (xy 167.54536 170.225465) (xy 167.54536 170.225466) (xy 167.595488 170.240184) (xy 167.612398 170.24515) - (xy 167.612402 170.24515) (xy 167.612404 170.245151) (xy 167.624035 170.246823) (xy 167.684383 170.2555) - (xy 167.684384 170.2555) (xy 172.00049 170.2555) (xy 172.067529 170.275185) (xy 172.113284 170.327989) - (xy 172.12449 170.3795) (xy 172.12449 174.649429) (xy 172.15008 174.744932) (xy 172.199415 174.830383) - (xy 172.199516 174.830557) (xy 174.715477 177.346518) (xy 174.748962 177.407841) (xy 174.750892 177.449143) - (xy 174.747051 177.480782) (xy 174.744718 177.5) (xy 174.762862 177.649434) (xy 174.763759 177.656817) - (xy 174.763758 177.656818) (xy 174.799994 177.752362) (xy 174.819776 177.804523) (xy 174.909513 177.93453) - (xy 174.94444 177.965472) (xy 175.027758 178.039285) (xy 175.125728 178.090704) (xy 175.175941 178.139289) - (xy 175.191915 178.207308) (xy 175.16858 178.273165) (xy 175.113343 178.315952) (xy 175.068102 178.3245) - (xy 163.500564 178.3245) (xy 163.405061 178.350089) (xy 163.319438 178.399525) (xy 163.319435 178.399527) - (xy 156.955781 184.763181) (xy 156.894458 184.796666) (xy 156.8681 184.7995) (xy 156.721014 184.7995) - (xy 156.567634 184.837303) (xy 156.427762 184.910715) (xy 156.309516 185.015471) (xy 156.219781 185.145475) - (xy 156.21978 185.145476) (xy 156.163762 185.293181) (xy 156.144722 185.449999) (xy 156.144722 185.45) - (xy 156.163762 185.606817) (xy 156.173178 185.631643) (xy 156.213769 185.738673) (xy 156.219136 185.808335) - (xy 156.185989 185.869841) (xy 156.124851 185.903663) (xy 156.097827 185.906643) (xy 150.596308 185.906643) - (xy 150.529269 185.886958) (xy 150.494257 185.853081) (xy 150.490483 185.847613) (xy 150.37224 185.74286) - (xy 150.372238 185.742859) (xy 150.372237 185.742858) (xy 150.232365 185.669446) (xy 150.078986 185.631643) - (xy 150.078985 185.631643) (xy 149.921015 185.631643) (xy 149.921014 185.631643) (xy 149.767634 185.669446) - (xy 149.627762 185.742858) (xy 149.509516 185.847614) (xy 149.449013 185.935268) (xy 149.39473 185.979258) - (xy 149.325281 185.986918) (xy 149.262717 185.955814) (xy 149.259282 185.952509) (xy 142.286295 178.979522) - (xy 142.286293 178.97952) (xy 142.221323 178.942009) (xy 142.194969 178.926793) (xy 142.130533 178.909528) - (xy 142.093107 178.8995) (xy 142.093106 178.8995) (xy 120.017255 178.8995) (xy 119.950216 178.879815) - (xy 119.929574 178.863181) (xy 118.736819 177.670426) (xy 118.703334 177.609103) (xy 118.7005 177.582745) - (xy 118.7005 176.302722) (xy 118.720185 176.235683) (xy 118.772989 176.189928) (xy 118.842147 176.179984) - (xy 118.905703 176.209009) (xy 118.920353 176.224057) (xy 118.995759 176.31594) (xy 119.148103 176.440966) - (xy 119.14811 176.44097) (xy 119.321909 176.533868) (xy 119.321912 176.533868) (xy 119.321916 176.533871) - (xy 119.510511 176.591081) (xy 119.706643 176.610398) (xy 119.902775 176.591081) (xy 120.09137 176.533871) - (xy 120.265181 176.440967) (xy 120.417526 176.31594) (xy 120.542553 176.163595) (xy 120.635457 175.989784) - (xy 120.692667 175.801189) (xy 120.711984 175.605057) (xy 120.692667 175.408925) (xy 120.635457 175.22033) - (xy 120.635454 175.220326) (xy 120.635454 175.220323) (xy 120.542556 175.046524) (xy 120.542552 175.046517) - (xy 120.417526 174.894173) (xy 120.265182 174.769147) (xy 120.265175 174.769143) (xy 120.091376 174.676245) - (xy 120.09137 174.676243) (xy 119.902775 174.619033) (xy 119.902772 174.619032) (xy 119.706643 174.599716) - (xy 119.510513 174.619032) (xy 119.321909 174.676245) (xy 119.14811 174.769143) (xy 119.148103 174.769147) - (xy 118.995759 174.894173) (xy 118.920353 174.986056) (xy 118.862607 175.02539) (xy 118.792762 175.027261) - (xy 118.732994 174.991073) (xy 118.702278 174.928317) (xy 118.7005 174.907391) (xy 118.7005 172.030899) - (xy 118.720185 171.96386) (xy 118.772989 171.918105) (xy 118.842147 171.908161) (xy 118.905703 171.937186) - (xy 118.912181 171.943218) (xy 119.599525 172.630562) (xy 119.669438 172.700475) (xy 119.755062 172.74991) - (xy 119.802811 172.762705) (xy 119.802812 172.762705) (xy 119.812903 172.765408) (xy 119.850564 172.7755) - (xy 119.850565 172.7755) (xy 120.003692 172.7755) (xy 120.070731 172.795185) (xy 120.105742 172.829061) - (xy 120.108163 172.832569) (xy 120.109515 172.834528) (xy 120.109517 172.83453) (xy 120.22776 172.939283) - (xy 120.227762 172.939284) (xy 120.367634 173.012696) (xy 120.521014 173.0505) (xy 120.521015 173.0505) - (xy 120.678985 173.0505) (xy 120.832365 173.012696) (xy 120.97224 172.939283) (xy 121.090483 172.83453) - (xy 121.18022 172.704523) (xy 121.236237 172.556818) (xy 121.255278 172.4) (xy 121.236237 172.243182) - (xy 121.231441 172.230537) (xy 121.214992 172.187164) (xy 121.18022 172.095477) (xy 121.090483 171.96547) - (xy 120.97224 171.860717) (xy 120.972238 171.860716) (xy 120.972237 171.860715) (xy 120.832365 171.787303) - (xy 120.678986 171.7495) (xy 120.678985 171.7495) (xy 120.521015 171.7495) (xy 120.521014 171.7495) - (xy 120.367634 171.787303) (xy 120.227761 171.860715) (xy 120.227759 171.860717) (xy 120.136963 171.941154) - (xy 120.07373 171.970875) (xy 120.004466 171.961691) (xy 119.967056 171.936019) (xy 119.211819 171.180782) - (xy 119.178334 171.119459) (xy 119.1755 171.093101) (xy 119.1755 156.224999) (xy 144.274722 156.224999) - (xy 144.274722 156.225) (xy 144.293762 156.381818) (xy 144.346349 156.520476) (xy 144.34978 156.529523) - (xy 144.439517 156.65953) (xy 144.55776 156.764283) (xy 144.557762 156.764284) (xy 144.697634 156.837696) - (xy 144.851014 156.8755) (xy 144.851015 156.8755) (xy 145.008985 156.8755) (xy 145.162365 156.837696) - (xy 145.186557 156.824999) (xy 145.30224 156.764283) (xy 145.420483 156.65953) (xy 145.424257 156.654061) - (xy 145.478537 156.610071) (xy 145.526308 156.6005) (xy 145.704435 156.6005) (xy 145.704436 156.6005) - (xy 145.752186 156.587705) (xy 145.799938 156.57491) (xy 145.885562 156.525475) (xy 145.955475 156.455562) - (xy 148.599218 153.811819) (xy 148.660541 153.778334) (xy 148.686899 153.7755) (xy 149.103692 153.7755) - (xy 149.170731 153.795185) (xy 149.205742 153.829061) (xy 149.208163 153.832569) (xy 149.209515 153.834528) - (xy 149.209517 153.83453) (xy 149.32776 153.939283) (xy 149.327762 153.939284) (xy 149.467634 154.012696) - (xy 149.621014 154.0505) (xy 149.621015 154.0505) (xy 149.778985 154.0505) (xy 149.932365 154.012696) - (xy 149.940604 154.008372) (xy 150.07224 153.939283) (xy 150.190483 153.83453) (xy 150.28022 153.704523) - (xy 150.336237 153.556818) (xy 150.355278 153.4) (xy 150.355221 153.399526) (xy 150.336237 153.243181) - (xy 150.314992 153.187164) (xy 150.28022 153.095477) (xy 150.190483 152.96547) (xy 150.07224 152.860717) - (xy 150.072238 152.860716) (xy 150.072237 152.860715) (xy 149.932365 152.787303) (xy 149.778986 152.7495) - (xy 149.778985 152.7495) (xy 149.621015 152.7495) (xy 149.621014 152.7495) (xy 149.467634 152.787303) - (xy 149.327762 152.860715) (xy 149.209516 152.96547) (xy 149.207089 152.968987) (xy 149.205742 152.970938) - (xy 149.151463 153.014929) (xy 149.103692 153.0245) (xy 148.430564 153.0245) (xy 148.382812 153.037295) - (xy 148.382811 153.037294) (xy 148.335063 153.050089) (xy 148.335062 153.050089) (xy 148.26753 153.089079) - (xy 148.25645 153.095477) (xy 148.249435 153.099527) (xy 145.576199 155.772763) (xy 145.514876 155.806248) - (xy 145.445184 155.801264) (xy 145.406294 155.777899) (xy 145.30224 155.685717) (xy 145.302237 155.685714) - (xy 145.162365 155.612303) (xy 145.008986 155.5745) (xy 145.008985 155.5745) (xy 144.851015 155.5745) - (xy 144.851014 155.5745) (xy 144.697634 155.612303) (xy 144.557762 155.685715) (xy 144.439516 155.790471) - (xy 144.349781 155.920475) (xy 144.34978 155.920476) (xy 144.293762 156.068181) (xy 144.274722 156.224999) - (xy 119.1755 156.224999) (xy 119.1755 153.706899) (xy 119.195185 153.63986) (xy 119.211819 153.619218) - (xy 129.519219 143.311819) (xy 129.580542 143.278334) (xy 129.6069 143.2755) (xy 136.649434 143.2755) - (xy 136.649436 143.2755) (xy 136.698155 143.262445) (xy 136.708451 143.259687) (xy 136.724536 143.255376) - (xy 136.744938 143.24991) (xy 136.830562 143.200475) (xy 136.900475 143.130562) (xy 136.900474 143.130562) - (xy 136.959043 143.071993) (xy 136.959042 143.071993) (xy 139.444218 140.586819) (xy 139.505541 140.553334) - (xy 139.531899 140.5505) (xy 139.678985 140.5505) (xy 139.832365 140.512696) (xy 139.97224 140.439283) - (xy 140.090483 140.33453) (xy 140.18022 140.204523) (xy 140.236237 140.056818) (xy 140.255278 139.9) - (xy 140.236237 139.743182) (xy 140.18022 139.595477) (xy 140.090483 139.46547) (xy 139.97224 139.360717) - (xy 139.972238 139.360716) (xy 139.972237 139.360715) (xy 139.832365 139.287303) (xy 139.678986 139.2495) - (xy 139.678985 139.2495) (xy 139.521015 139.2495) (xy 139.521014 139.2495) (xy 139.367634 139.287303) - (xy 139.227762 139.360715) (xy 139.109516 139.465471) (xy 139.019781 139.595475) (xy 139.01978 139.595476) - (xy 138.963763 139.743181) (xy 138.944722 139.9) (xy 138.944722 139.900001) (xy 138.950896 139.950854) - (xy 138.939435 140.019777) (xy 138.915481 140.05348) (xy 136.480782 142.488181) (xy 136.419459 142.521666) - (xy 136.393101 142.5245) (xy 129.350564 142.5245) (xy 129.255063 142.550089) (xy 129.25506 142.55009) - (xy 129.16944 142.599522) (xy 129.169435 142.599526) (xy 118.912181 152.856781) (xy 118.850858 152.890266) - (xy 118.781166 152.885282) (xy 118.725233 152.84341) (xy 118.700816 152.777946) (xy 118.7005 152.7691) - (xy 118.7005 150.017253) (xy 118.720185 149.950214) (xy 118.736814 149.929577) (xy 122.935703 145.730687) - (xy 122.935708 145.730684) (xy 122.945911 145.72048) (xy 122.945913 145.72048) (xy 123.02048 145.645913) - (xy 123.073207 145.554587) (xy 123.078559 145.534614) (xy 123.100501 145.452727) (xy 123.100501 145.347273) - (xy 123.100501 145.339678) (xy 123.1005 145.33966) (xy 123.1005 133.860307) (xy 123.120185 133.793268) - (xy 123.166874 133.750511) (xy 123.222232 133.721456) (xy 123.22223 133.721456) (xy 123.22224 133.721452) - (xy 123.340483 133.616699) (xy 123.43022 133.486692) (xy 123.486237 133.338987) (xy 123.505278 133.182169) - (xy 123.502048 133.155563) (xy 123.486237 133.02535) (xy 123.455074 132.943181) (xy 123.43022 132.877646) - (xy 123.340483 132.747639) (xy 123.228 132.647989) (xy 123.222237 132.642883) (xy 123.109965 132.583958) - (xy 123.059752 132.535373) (xy 123.043778 132.467354) (xy 123.067114 132.401496) (xy 123.079903 132.386488) - (xy 126.319574 129.146819) (xy 126.380897 129.113334) (xy 126.407255 129.1105) (xy 126.488985 129.1105) - (xy 126.642365 129.072696) (xy 126.673157 129.056535) (xy 126.78224 128.999283) (xy 126.900483 128.89453) - (xy 126.99022 128.764523) (xy 127.046237 128.616818) (xy 127.065278 128.46) (xy 127.058463 128.403868) - (xy 127.046237 128.303181) (xy 127.015348 128.221734) (xy 126.99022 128.155477) (xy 126.931177 128.069939) - (xy 126.909295 128.003586) (xy 126.92676 127.935934) (xy 126.978028 127.888464) (xy 127.033228 127.8755) - (xy 129.889064 127.8755) (xy 129.956103 127.895185) (xy 129.976745 127.911819) (xy 141.225491 139.160565) - (xy 141.258976 139.221888) (xy 141.260905 139.233295) (xy 141.263761 139.256809) (xy 141.263763 139.256821) - (xy 141.314802 139.391397) (xy 141.31978 139.404523) (xy 141.409517 139.53453) (xy 141.52776 139.639283) - (xy 141.527762 139.639284) (xy 141.667634 139.712696) (xy 141.821014 139.7505) (xy 141.821015 139.7505) - (xy 141.978985 139.7505) (xy 142.132365 139.712696) (xy 142.27224 139.639283) (xy 142.390483 139.53453) - (xy 142.48022 139.404523) (xy 142.536237 139.256818) (xy 142.555278 139.1) (xy 142.551021 139.064944) - (xy 142.536237 138.943182) (xy 142.521672 138.904777) (xy 142.483899 138.805179) (xy 142.478533 138.735521) - (xy 142.51168 138.674014) (xy 142.572818 138.640193) (xy 142.642536 138.644794) (xy 142.647435 138.647084) - (xy 142.647553 138.6468) (xy 142.655056 138.649907) (xy 142.655063 138.649911) (xy 142.750564 138.6755) - (xy 142.750565 138.6755) (xy 143.203692 138.6755) (xy 143.270731 138.695185) (xy 143.305742 138.729061) - (xy 143.308163 138.732569) (xy 143.309515 138.734528) (xy 143.309517 138.73453) (xy 143.42776 138.839283) - (xy 143.427762 138.839284) (xy 143.567634 138.912696) (xy 143.721014 138.9505) (xy 143.721015 138.9505) - (xy 143.878985 138.9505) (xy 144.032365 138.912696) (xy 144.09605 138.879271) (xy 144.17224 138.839283) - (xy 144.290483 138.73453) (xy 144.38022 138.604523) (xy 144.436237 138.456818) (xy 144.455278 138.3) - (xy 144.443964 138.206815) (xy 144.436237 138.143181) (xy 144.409258 138.072044) (xy 144.38022 137.995477) - (xy 144.290483 137.86547) (xy 144.17224 137.760717) (xy 144.172238 137.760716) (xy 144.172237 137.760715) - (xy 144.032365 137.687303) (xy 143.878986 137.6495) (xy 143.878985 137.6495) (xy 143.721015 137.6495) - (xy 143.721014 137.6495) (xy 143.567634 137.687303) (xy 143.427762 137.760715) (xy 143.309516 137.86547) - (xy 143.307089 137.868987) (xy 143.305742 137.870938) (xy 143.251463 137.914929) (xy 143.203692 137.9245) - (xy 143.0069 137.9245) (xy 142.939861 137.904815) (xy 142.919219 137.888181) (xy 129.630563 124.599526) - (xy 129.630562 124.599525) (xy 129.544938 124.55009) (xy 129.492846 124.536132) (xy 129.492845 124.536131) - (xy 129.449436 124.5245) (xy 129.449435 124.5245) (xy 118.296308 124.5245) (xy 118.229269 124.504815) - (xy 118.194257 124.470938) (xy 118.190483 124.46547) (xy 118.07224 124.360717) (xy 118.072238 124.360716) - (xy 118.072237 124.360715) (xy 117.932365 124.287303) (xy 117.778986 124.2495) (xy 117.778985 124.2495) - (xy 117.621015 124.2495) (xy 117.621014 124.2495) (xy 117.467634 124.287303) (xy 117.327762 124.360715) - (xy 117.209516 124.465471) (xy 117.119781 124.595475) (xy 117.11978 124.595476) (xy 117.063762 124.743181) - (xy 117.044722 124.899999) (xy 117.044722 124.9) (xy 117.063762 125.056818) (xy 117.114083 125.189501) - (xy 117.11978 125.204523) (xy 117.209517 125.33453) (xy 117.32776 125.439283) (xy 117.327762 125.439284) - (xy 117.467634 125.512696) (xy 117.621014 125.5505) (xy 117.621015 125.5505) (xy 117.778985 125.5505) - (xy 117.932365 125.512696) (xy 117.960642 125.497855) (xy 118.07224 125.439283) (xy 118.190483 125.33453) - (xy 118.194257 125.329061) (xy 118.248537 125.285071) (xy 118.296308 125.2755) (xy 129.193101 125.2755) - (xy 129.26014 125.295185) (xy 129.280782 125.311819) (xy 142.247686 138.278724) (xy 142.281171 138.340047) - (xy 142.276187 138.409739) (xy 142.234315 138.465672) (xy 142.168851 138.490089) (xy 142.130331 138.486802) - (xy 141.978986 138.4495) (xy 141.978985 138.4495) (xy 141.821015 138.4495) (xy 141.821014 138.4495) - (xy 141.692752 138.481113) (xy 141.62295 138.478044) (xy 141.575397 138.448397) (xy 130.326526 127.199526) - (xy 130.326525 127.199525) (xy 130.240901 127.15009) (xy 130.193149 127.137295) (xy 130.193147 127.137294) - (xy 130.193145 127.137293) (xy 130.145399 127.1245) (xy 130.145398 127.1245) (xy 119.006899 127.1245) - (xy 118.93986 127.104815) (xy 118.919218 127.088181) (xy 118.884517 127.05348) (xy 118.851032 126.992157) - (xy 118.849102 126.950857) (xy 118.855278 126.9) (xy 118.836237 126.743182) (xy 118.78022 126.595477) - (xy 118.690483 126.46547) (xy 118.57224 126.360717) (xy 118.572238 126.360716) (xy 118.572237 126.360715) - (xy 118.432365 126.287303) (xy 118.278986 126.2495) (xy 118.278985 126.2495) (xy 118.121015 126.2495) - (xy 118.121014 126.2495) (xy 117.967634 126.287303) (xy 117.827762 126.360715) (xy 117.709516 126.465471) - (xy 117.619781 126.595475) (xy 117.61978 126.595476) (xy 117.563762 126.743181) (xy 117.544722 126.899999) - (xy 117.544722 126.9) (xy 117.563762 127.056818) (xy 117.617885 127.199526) (xy 117.61978 127.204523) - (xy 117.709517 127.33453) (xy 117.82776 127.439283) (xy 117.827762 127.439284) (xy 117.967634 127.512696) - (xy 118.121014 127.5505) (xy 118.268101 127.5505) (xy 118.33514 127.570185) (xy 118.355782 127.586819) - (xy 118.499525 127.730562) (xy 118.569438 127.800475) (xy 118.655062 127.84991) (xy 118.667952 127.853364) - (xy 118.680841 127.856818) (xy 118.680842 127.856818) (xy 118.695576 127.860765) (xy 118.750564 127.8755) - (xy 118.750565 127.8755) (xy 125.786772 127.8755) (xy 125.853811 127.895185) (xy 125.899566 127.947989) - (xy 125.90951 128.017147) (xy 125.888822 128.06994) (xy 125.829781 128.155475) (xy 125.82978 128.155476) - (xy 125.773762 128.303181) (xy 125.754722 128.459999) (xy 125.754722 128.460001) (xy 125.760316 128.506078) - (xy 125.748855 128.575002) (xy 125.724901 128.608704) (xy 124.631228 129.702377) (xy 124.569905 129.735862) - (xy 124.500213 129.730878) (xy 124.44428 129.689006) (xy 124.419863 129.623542) (xy 124.42045 129.599755) - (xy 124.425278 129.56) (xy 124.406237 129.403182) (xy 124.401501 129.390695) (xy 124.382366 129.34024) - (xy 124.35022 129.255477) (xy 124.260483 129.12547) (xy 124.14224 129.020717) (xy 124.142238 129.020716) - (xy 124.142237 129.020715) (xy 124.002365 128.947303) (xy 123.848986 128.9095) (xy 123.848985 128.9095) - (xy 123.691015 128.9095) (xy 123.691014 128.9095) (xy 123.537634 128.947303) (xy 123.397762 129.020715) - (xy 123.279516 129.125471) (xy 123.189781 129.255475) (xy 123.18978 129.255476) (xy 123.133762 129.403181) - (xy 123.114722 129.559999) (xy 123.114722 129.560002) (xy 123.117068 129.579328) (xy 123.105606 129.648251) - (xy 123.081653 129.681952) (xy 121.644066 131.119539) (xy 121.582743 131.153024) (xy 121.513051 131.14804) - (xy 121.498771 131.141659) (xy 121.452365 131.117304) (xy 121.452364 131.117303) (xy 121.452363 131.117303) - (xy 121.298985 131.0795) (xy 121.141015 131.0795) (xy 121.141014 131.0795) (xy 120.987634 131.117303) - (xy 120.847762 131.190715) (xy 120.776139 131.254167) (xy 120.735596 131.290085) (xy 120.729516 131.295471) - (xy 120.639781 131.425475) (xy 120.63978 131.425476) (xy 120.583762 131.573181) (xy 120.564722 131.729999) - (xy 120.564722 131.73) (xy 120.583762 131.886818) (xy 120.638292 132.0306) (xy 120.63978 132.034523) - (xy 120.729517 132.16453) (xy 120.84776 132.269283) (xy 120.847762 132.269284) (xy 120.987634 132.342696) - (xy 121.141014 132.3805) (xy 121.141015 132.3805) (xy 121.298985 132.3805) (xy 121.452365 132.342696) - (xy 121.478626 132.328913) (xy 121.59224 132.269283) (xy 121.710483 132.16453) (xy 121.73577 132.127893) - (xy 121.775815 132.090951) (xy 121.845913 132.05048) (xy 123.649573 130.246818) (xy 123.710896 130.213334) - (xy 123.737254 130.2105) (xy 123.823744 130.2105) (xy 123.890783 130.230185) (xy 123.936538 130.282989) - (xy 123.946482 130.352147) (xy 123.917457 130.415703) (xy 123.911425 130.422181) (xy 121.350168 132.983437) - (xy 121.288845 133.016922) (xy 121.232813 133.016153) (xy 121.188718 133.005285) (xy 121.030748 133.005285) - (xy 121.030747 133.005285) (xy 120.877367 133.043088) (xy 120.737495 133.1165) (xy 120.619249 133.221256) - (xy 120.529514 133.35126) (xy 120.529513 133.351261) (xy 120.473495 133.498966) (xy 120.454455 133.655784) - (xy 120.454455 133.655785) (xy 120.473495 133.812603) (xy 120.529513 133.960308) (xy 120.529514 133.960309) - (xy 120.61925 134.090316) (xy 120.682726 134.146549) (xy 120.719853 134.205738) (xy 120.7245 134.239365) - (xy 120.7245 145.157745) (xy 120.704815 145.224784) (xy 120.688181 145.245426) (xy 116.979522 148.954084) - (xy 116.97952 148.954087) (xy 116.926793 149.045412) (xy 116.904699 149.127868) (xy 116.902619 149.13563) - (xy 116.8995 149.14727) (xy 116.8995 178.452726) (xy 116.926793 178.554589) (xy 116.93024 178.560559) - (xy 116.97952 178.645913) (xy 116.979521 178.645914) (xy 116.979522 178.645915) (xy 118.875179 180.541571) - (xy 118.875189 180.541582) (xy 118.879519 180.545912) (xy 118.87952 180.545913) (xy 118.954087 180.62048) - (xy 118.983205 180.637291) (xy 119.045412 180.673207) (xy 119.147273 180.7005) (xy 119.252727 180.7005) - (xy 141.282745 180.7005) (xy 141.349784 180.720185) (xy 141.370426 180.736819) (xy 146.041426 185.407819) - (xy 146.074911 185.469142) (xy 146.069927 185.538834) (xy 146.028055 185.594767) (xy 145.962591 185.619184) - (xy 145.953745 185.6195) (xy 145.921014 185.6195) (xy 145.767634 185.657303) (xy 145.627762 185.730715) - (xy 145.509516 185.83547) (xy 145.507089 185.838987) (xy 145.505742 185.840938) (xy 145.451463 185.884929) - (xy 145.403692 185.8945) (xy 133.485563 185.8945) (xy 133.440247 185.906642) (xy 133.440247 185.906643) - (xy 133.390062 185.92009) (xy 133.390061 185.92009) (xy 133.390059 185.920091) (xy 133.304436 185.969526) - (xy 132.710282 186.563681) (xy 132.648959 186.597166) (xy 132.622601 186.6) (xy 126.5 186.6) (xy 126.5 193.3576) - (xy 126.480315 193.424639) (xy 126.463681 193.445281) (xy 115.430782 204.478181) (xy 115.369459 204.511666) - (xy 115.343101 204.5145) (xy 114.526308 204.5145) (xy 114.459269 204.494815) (xy 114.424257 204.460938) - (xy 114.420483 204.45547) (xy 114.30224 204.350717) (xy 114.302238 204.350716) (xy 114.302237 204.350715) - (xy 114.162365 204.277303) (xy 114.008986 204.2395) (xy 114.008985 204.2395) (xy 113.851015 204.2395) - (xy 113.851014 204.2395) (xy 113.697634 204.277303) (xy 113.557762 204.350715) (xy 113.439516 204.455471) - (xy 113.349781 204.585475) (xy 113.34978 204.585476) (xy 113.293762 204.733181) (xy 113.274722 204.889999) - (xy 112.3005 204.889999) (xy 112.3005 111.085321) (xy 114.6395 111.085321) (xy 114.6395 112.634678) - (xy 114.654032 112.707735) (xy 114.654033 112.707739) (xy 114.654034 112.70774) (xy 114.709399 112.790601) - (xy 114.79226 112.845966) (xy 114.792264 112.845967) (xy 114.865321 112.860499) (xy 114.865324 112.8605) - (xy 114.865326 112.8605) (xy 116.414676 112.8605) (xy 116.414677 112.860499) (xy 116.48774 112.845966) - (xy 116.570601 112.790601) (xy 116.625966 112.70774) (xy 116.6405 112.634674) (xy 116.6405 111.86) - (xy 117.134659 111.86) (xy 117.153975 112.056129) (xy 117.153976 112.056132) (xy 117.206662 112.229815) - (xy 117.211188 112.244733) (xy 117.304086 112.418532) (xy 117.30409 112.418539) (xy 117.429116 112.570883) - (xy 117.58146 112.695909) (xy 117.581467 112.695913) (xy 117.755266 112.788811) (xy 117.755269 112.788811) - (xy 117.755273 112.788814) (xy 117.943868 112.846024) (xy 118.14 112.865341) (xy 118.336132 112.846024) - (xy 118.524727 112.788814) (xy 118.698538 112.69591) (xy 118.850883 112.570883) (xy 118.97591 112.418538) - (xy 119.050846 112.278343) (xy 119.068811 112.244733) (xy 119.068811 112.244732) (xy 119.068814 112.244727) - (xy 119.126024 112.056132) (xy 119.145341 111.86) (xy 119.126024 111.663868) (xy 119.068814 111.475273) - (xy 119.068811 111.475269) (xy 119.068811 111.475266) (xy 118.975913 111.301467) (xy 118.975909 111.30146) - (xy 118.850883 111.149116) (xy 118.698539 111.02409) (xy 118.698532 111.024086) (xy 118.524733 110.931188) - (xy 118.524727 110.931186) (xy 118.336132 110.873976) (xy 118.336129 110.873975) (xy 118.14 110.854659) - (xy 117.94387 110.873975) (xy 117.755266 110.931188) (xy 117.581467 111.024086) (xy 117.58146 111.02409) - (xy 117.429116 111.149116) (xy 117.30409 111.30146) (xy 117.304086 111.301467) (xy 117.211188 111.475266) - (xy 117.153975 111.66387) (xy 117.134659 111.86) (xy 116.6405 111.86) (xy 116.6405 111.085326) (xy 116.6405 111.085323) - (xy 116.640499 111.085321) (xy 116.625967 111.012264) (xy 116.625966 111.01226) (xy 116.617774 111) - (xy 116.570601 110.929399) (xy 116.48774 110.874034) (xy 116.487739 110.874033) (xy 116.487735 110.874032) - (xy 116.414677 110.8595) (xy 116.414674 110.8595) (xy 114.865326 110.8595) (xy 114.865323 110.8595) - (xy 114.792264 110.874032) (xy 114.79226 110.874033) (xy 114.709399 110.929399) (xy 114.654033 111.01226) - (xy 114.654032 111.012264) (xy 114.6395 111.085321) (xy 112.3005 111.085321) (xy 112.3005 109.309999) - (xy 112.804722 109.309999) (xy 112.804722 109.31) (xy 112.823762 109.466818) (xy 112.85173 109.540562) - (xy 112.87978 109.614523) (xy 112.969517 109.74453) (xy 113.08776 109.849283) (xy 113.087762 109.849284) - (xy 113.227634 109.922696) (xy 113.381014 109.9605) (xy 113.381015 109.9605) (xy 113.538985 109.9605) - (xy 113.692365 109.922696) (xy 113.72699 109.904523) (xy 113.83224 109.849283) (xy 113.950483 109.74453) - (xy 113.954257 109.739061) (xy 114.008537 109.695071) (xy 114.056308 109.6855) (xy 118.469435 109.6855) - (xy 118.469436 109.6855) (xy 118.517186 109.672705) (xy 118.564938 109.65991) (xy 118.650562 109.610475) - (xy 118.720475 109.540562) (xy 137.754217 90.506818) (xy 137.81554 90.473334) (xy 137.841898 90.4705) - (xy 137.988985 90.4705) (xy 138.142365 90.432696) (xy 138.28224 90.359283) (xy 138.400483 90.25453) - (xy 138.49022 90.124523) (xy 138.546237 89.976818) (xy 138.565278 89.82) (xy 138.555478 89.739284) - (xy 138.546237 89.663181) (xy 138.514058 89.578334) (xy 138.49022 89.515477) (xy 138.400483 89.38547) - (xy 138.28224 89.280717) (xy 138.282238 89.280716) (xy 138.282237 89.280715) (xy 138.142365 89.207303) - (xy 137.988986 89.1695) (xy 137.988985 89.1695) (xy 137.831015 89.1695) (xy 137.831014 89.1695) - (xy 137.677634 89.207303) (xy 137.537762 89.280715) (xy 137.419516 89.385471) (xy 137.329781 89.515475) - (xy 137.32978 89.515476) (xy 137.273763 89.663181) (xy 137.254722 89.82) (xy 137.254722 89.820001) - (xy 137.260896 89.870854) (xy 137.249435 89.939777) (xy 137.225481 89.97348) (xy 118.300782 108.898181) - (xy 118.239459 108.931666) (xy 118.213101 108.9345) (xy 114.056308 108.9345) (xy 113.989269 108.914815) - (xy 113.954257 108.880938) (xy 113.950483 108.87547) (xy 113.83224 108.770717) (xy 113.832238 108.770716) - (xy 113.832237 108.770715) (xy 113.692365 108.697303) (xy 113.538986 108.6595) (xy 113.538985 108.6595) - (xy 113.381015 108.6595) (xy 113.381014 108.6595) (xy 113.227634 108.697303) (xy 113.087762 108.770715) - (xy 112.969516 108.875471) (xy 112.879781 109.005475) (xy 112.87978 109.005476) (xy 112.823762 109.153181) - (xy 112.804722 109.309999) (xy 112.3005 109.309999) (xy 112.3005 69.27) (xy 123.284659 69.27) (xy 123.303975 69.466129) - (xy 123.303976 69.466132) (xy 123.348927 69.614316) (xy 123.361188 69.654733) (xy 123.454086 69.828532) - (xy 123.45409 69.828539) (xy 123.579116 69.980883) (xy 123.73146 70.105909) (xy 123.731467 70.105913) - (xy 123.905266 70.198811) (xy 123.905269 70.198811) (xy 123.905273 70.198814) (xy 124.093868 70.256024) - (xy 124.29 70.275341) (xy 124.486132 70.256024) (xy 124.674727 70.198814) (xy 124.848538 70.10591) - (xy 125.000883 69.980883) (xy 125.12591 69.828538) (xy 125.192197 69.704524) (xy 125.218811 69.654733) - (xy 125.218811 69.654732) (xy 125.218814 69.654727) (xy 125.276024 69.466132) (xy 125.295341 69.27) - (xy 125.276024 69.073868) (xy 125.218814 68.885273) (xy 125.218811 68.885269) (xy 125.218811 68.885266) - (xy 125.125913 68.711467) (xy 125.125909 68.71146) (xy 125.000883 68.559116) (xy 124.848539 68.43409) - (xy 124.848532 68.434086) (xy 124.674733 68.341188) (xy 124.674727 68.341186) (xy 124.486132 68.283976) - (xy 124.486129 68.283975) (xy 124.29 68.264659) (xy 124.09387 68.283975) (xy 123.905266 68.341188) - (xy 123.731467 68.434086) (xy 123.73146 68.43409) (xy 123.579116 68.559116) (xy 123.45409 68.71146) - (xy 123.454086 68.711467) (xy 123.361188 68.885266) (xy 123.303975 69.07387) (xy 123.284659 69.27) - (xy 112.3005 69.27) (xy 112.3005 68.041121) (xy 129.869 68.041121) (xy 129.869 69.610478) (xy 129.883532 69.683535) - (xy 129.883533 69.683539) (xy 129.897554 69.704523) (xy 129.938899 69.766401) (xy 130.02176 69.821766) - (xy 130.021764 69.821767) (xy 130.094821 69.836299) (xy 130.094824 69.8363) (xy 130.094826 69.8363) - (xy 131.664176 69.8363) (xy 131.664177 69.836299) (xy 131.73724 69.821766) (xy 131.820101 69.766401) - (xy 131.875466 69.68354) (xy 131.89 69.610474) (xy 131.89 68.041126) (xy 131.89 68.041123) (xy 131.889999 68.041121) - (xy 131.875467 67.968064) (xy 131.875466 67.96806) (xy 131.835457 67.908182) (xy 131.820101 67.885199) - (xy 131.73724 67.829834) (xy 131.737239 67.829833) (xy 131.737235 67.829832) (xy 131.664177 67.8153) - (xy 131.664174 67.8153) (xy 130.094826 67.8153) (xy 130.094823 67.8153) (xy 130.021764 67.829832) - (xy 130.02176 67.829833) (xy 129.938899 67.885199) (xy 129.883533 67.96806) (xy 129.883532 67.968064) - (xy 129.869 68.041121) (xy 112.3005 68.041121) (xy 112.3005 65.995321) (xy 123.2895 65.995321) (xy 123.2895 67.544678) + (xy 117.0755 117.450568) (xy 117.0755 117.450565) (xy 117.074735 117.44771) (xy 117.074735 117.447694) + (xy 117.074731 117.447696) (xy 117.04991 117.355063) (xy 117.04991 117.355062) (xy 117.032265 117.3245) + (xy 117.000475 117.269438) (xy 116.930562 117.199525) (xy 115.478754 115.747717) (xy 115.445269 115.686394) + (xy 115.450253 115.616702) (xy 115.450403 115.616304) (xy 115.486237 115.521818) (xy 115.505278 115.365) + (xy 115.491539 115.251844) (xy 115.486237 115.208181) (xy 115.434012 115.070476) (xy 115.43022 115.060477) + (xy 115.340483 114.93047) (xy 115.22224 114.825717) (xy 115.222238 114.825716) (xy 115.222237 114.825715) + (xy 115.082365 114.752303) (xy 114.928986 114.7145) (xy 114.928985 114.7145) (xy 114.771015 114.7145) + (xy 114.771014 114.7145) (xy 114.617634 114.752303) (xy 114.477762 114.825715) (xy 114.47776 114.825717) + (xy 114.372652 114.918834) (xy 114.359516 114.930471) (xy 114.269781 115.060475) (xy 114.26978 115.060476) + (xy 114.213762 115.208181) (xy 114.194722 115.364999) (xy 112.3005 115.364999) (xy 112.3005 111.085321) + (xy 114.6395 111.085321) (xy 114.6395 112.634678) (xy 114.654032 112.707735) (xy 114.654033 112.707739) + (xy 114.654034 112.70774) (xy 114.709399 112.790601) (xy 114.79226 112.845966) (xy 114.792264 112.845967) + (xy 114.865321 112.860499) (xy 114.865324 112.8605) (xy 114.865326 112.8605) (xy 116.414676 112.8605) + (xy 116.414677 112.860499) (xy 116.48774 112.845966) (xy 116.570601 112.790601) (xy 116.625966 112.70774) + (xy 116.6405 112.634674) (xy 116.6405 111.86) (xy 117.134659 111.86) (xy 117.153975 112.056129) + (xy 117.153976 112.056132) (xy 117.206662 112.229815) (xy 117.211188 112.244733) (xy 117.304086 112.418532) + (xy 117.30409 112.418539) (xy 117.429116 112.570883) (xy 117.58146 112.695909) (xy 117.581467 112.695913) + (xy 117.755266 112.788811) (xy 117.755269 112.788811) (xy 117.755273 112.788814) (xy 117.943868 112.846024) + (xy 118.14 112.865341) (xy 118.336132 112.846024) (xy 118.524727 112.788814) (xy 118.698538 112.69591) + (xy 118.850883 112.570883) (xy 118.97591 112.418538) (xy 119.050846 112.278343) (xy 119.068811 112.244733) + (xy 119.068811 112.244732) (xy 119.068814 112.244727) (xy 119.126024 112.056132) (xy 119.145341 111.86) + (xy 119.126024 111.663868) (xy 119.068814 111.475273) (xy 119.068811 111.475269) (xy 119.068811 111.475266) + (xy 118.975913 111.301467) (xy 118.975909 111.30146) (xy 118.850883 111.149116) (xy 118.698539 111.02409) + (xy 118.698532 111.024086) (xy 118.524733 110.931188) (xy 118.524727 110.931186) (xy 118.336132 110.873976) + (xy 118.336129 110.873975) (xy 118.14 110.854659) (xy 117.94387 110.873975) (xy 117.755266 110.931188) + (xy 117.581467 111.024086) (xy 117.58146 111.02409) (xy 117.429116 111.149116) (xy 117.30409 111.30146) + (xy 117.304086 111.301467) (xy 117.211188 111.475266) (xy 117.153975 111.66387) (xy 117.134659 111.86) + (xy 116.6405 111.86) (xy 116.6405 111.085326) (xy 116.6405 111.085323) (xy 116.640499 111.085321) + (xy 116.625967 111.012264) (xy 116.625966 111.01226) (xy 116.617774 111) (xy 116.570601 110.929399) + (xy 116.48774 110.874034) (xy 116.487739 110.874033) (xy 116.487735 110.874032) (xy 116.414677 110.8595) + (xy 116.414674 110.8595) (xy 114.865326 110.8595) (xy 114.865323 110.8595) (xy 114.792264 110.874032) + (xy 114.79226 110.874033) (xy 114.709399 110.929399) (xy 114.654033 111.01226) (xy 114.654032 111.012264) + (xy 114.6395 111.085321) (xy 112.3005 111.085321) (xy 112.3005 108.999999) (xy 112.804722 108.999999) + (xy 112.804722 109) (xy 112.823762 109.156818) (xy 112.877885 109.299526) (xy 112.87978 109.304523) + (xy 112.969517 109.43453) (xy 113.08776 109.539283) (xy 113.087762 109.539284) (xy 113.227634 109.612696) + (xy 113.381014 109.6505) (xy 113.381015 109.6505) (xy 113.538985 109.6505) (xy 113.692365 109.612696) + (xy 113.716557 109.599999) (xy 113.83224 109.539283) (xy 113.950483 109.43453) (xy 113.954257 109.429061) + (xy 114.008537 109.385071) (xy 114.056308 109.3755) (xy 118.779435 109.3755) (xy 118.779436 109.3755) + (xy 118.852456 109.355934) (xy 118.874938 109.34991) (xy 118.960562 109.300475) (xy 119.030475 109.230562) + (xy 137.754217 90.506818) (xy 137.81554 90.473334) (xy 137.841898 90.4705) (xy 137.988985 90.4705) + (xy 138.142365 90.432696) (xy 138.28224 90.359283) (xy 138.400483 90.25453) (xy 138.49022 90.124523) + (xy 138.546237 89.976818) (xy 138.565278 89.82) (xy 138.555478 89.739284) (xy 138.546237 89.663181) + (xy 138.514058 89.578334) (xy 138.49022 89.515477) (xy 138.400483 89.38547) (xy 138.28224 89.280717) + (xy 138.282238 89.280716) (xy 138.282237 89.280715) (xy 138.142365 89.207303) (xy 137.988986 89.1695) + (xy 137.988985 89.1695) (xy 137.831015 89.1695) (xy 137.831014 89.1695) (xy 137.677634 89.207303) + (xy 137.537762 89.280715) (xy 137.419516 89.385471) (xy 137.329781 89.515475) (xy 137.32978 89.515476) + (xy 137.273763 89.663181) (xy 137.254722 89.82) (xy 137.254722 89.820001) (xy 137.260896 89.870854) + (xy 137.249435 89.939777) (xy 137.225481 89.97348) (xy 118.610782 108.588181) (xy 118.549459 108.621666) + (xy 118.523101 108.6245) (xy 114.056308 108.6245) (xy 113.989269 108.604815) (xy 113.954257 108.570938) + (xy 113.950483 108.56547) (xy 113.83224 108.460717) (xy 113.832238 108.460716) (xy 113.832237 108.460715) + (xy 113.692365 108.387303) (xy 113.538986 108.3495) (xy 113.538985 108.3495) (xy 113.381015 108.3495) + (xy 113.381014 108.3495) (xy 113.227634 108.387303) (xy 113.087762 108.460715) (xy 113.08776 108.460717) + (xy 112.969968 108.565071) (xy 112.969516 108.565471) (xy 112.879781 108.695475) (xy 112.87978 108.695476) + (xy 112.823762 108.843181) (xy 112.804722 108.999999) (xy 112.3005 108.999999) (xy 112.3005 69.27) + (xy 123.284659 69.27) (xy 123.303975 69.466129) (xy 123.303976 69.466132) (xy 123.348927 69.614316) + (xy 123.361188 69.654733) (xy 123.454086 69.828532) (xy 123.45409 69.828539) (xy 123.579116 69.980883) + (xy 123.73146 70.105909) (xy 123.731467 70.105913) (xy 123.905266 70.198811) (xy 123.905269 70.198811) + (xy 123.905273 70.198814) (xy 124.093868 70.256024) (xy 124.29 70.275341) (xy 124.486132 70.256024) + (xy 124.674727 70.198814) (xy 124.848538 70.10591) (xy 125.000883 69.980883) (xy 125.12591 69.828538) + (xy 125.192197 69.704524) (xy 125.218811 69.654733) (xy 125.218811 69.654732) (xy 125.218814 69.654727) + (xy 125.276024 69.466132) (xy 125.295341 69.27) (xy 125.276024 69.073868) (xy 125.218814 68.885273) + (xy 125.218811 68.885269) (xy 125.218811 68.885266) (xy 125.125913 68.711467) (xy 125.125909 68.71146) + (xy 125.000883 68.559116) (xy 124.848539 68.43409) (xy 124.848532 68.434086) (xy 124.674733 68.341188) + (xy 124.674727 68.341186) (xy 124.486132 68.283976) (xy 124.486129 68.283975) (xy 124.29 68.264659) + (xy 124.09387 68.283975) (xy 123.905266 68.341188) (xy 123.731467 68.434086) (xy 123.73146 68.43409) + (xy 123.579116 68.559116) (xy 123.45409 68.71146) (xy 123.454086 68.711467) (xy 123.361188 68.885266) + (xy 123.303975 69.07387) (xy 123.284659 69.27) (xy 112.3005 69.27) (xy 112.3005 68.041121) (xy 129.869 68.041121) + (xy 129.869 69.610478) (xy 129.883532 69.683535) (xy 129.883533 69.683539) (xy 129.897554 69.704523) + (xy 129.938899 69.766401) (xy 130.02176 69.821766) (xy 130.021764 69.821767) (xy 130.094821 69.836299) + (xy 130.094824 69.8363) (xy 130.094826 69.8363) (xy 131.664176 69.8363) (xy 131.664177 69.836299) + (xy 131.73724 69.821766) (xy 131.820101 69.766401) (xy 131.875466 69.68354) (xy 131.89 69.610474) + (xy 131.89 68.041126) (xy 131.89 68.041123) (xy 131.889999 68.041121) (xy 131.875467 67.968064) + (xy 131.875466 67.96806) (xy 131.835457 67.908182) (xy 131.820101 67.885199) (xy 131.73724 67.829834) + (xy 131.737239 67.829833) (xy 131.737235 67.829832) (xy 131.664177 67.8153) (xy 131.664174 67.8153) + (xy 130.094826 67.8153) (xy 130.094823 67.8153) (xy 130.021764 67.829832) (xy 130.02176 67.829833) + (xy 129.938899 67.885199) (xy 129.883533 67.96806) (xy 129.883532 67.968064) (xy 129.869 68.041121) + (xy 112.3005 68.041121) (xy 112.3005 65.995321) (xy 123.2895 65.995321) (xy 123.2895 67.544678) (xy 123.304032 67.617735) (xy 123.304033 67.617739) (xy 123.305395 67.619777) (xy 123.359399 67.700601) (xy 123.44226 67.755966) (xy 123.442264 67.755967) (xy 123.515321 67.770499) (xy 123.515324 67.7705) (xy 123.515326 67.7705) (xy 125.064676 67.7705) (xy 125.064677 67.770499) (xy 125.13774 67.755966) @@ -179461,128 +184008,128 @@ (xy 164.817065 169.981982) (xy 164.793224 169.97724) (xy 164.629001 169.927424) (xy 164.606543 169.918121) (xy 164.455201 169.837227) (xy 164.434989 169.823722) (xy 164.302333 169.714854) (xy 164.285145 169.697666) (xy 164.208705 169.604524) (xy 164.176276 169.565008) (xy 164.162772 169.544798) (xy 164.081878 169.393456) - (xy 164.072575 169.370998) (xy 164.066054 169.3495) (xy 164.022757 169.206769) (xy 164.018018 169.182941) - (xy 164.000597 169.006061) (xy 164 168.993907) (xy 164 152.030399) (xy 164.019685 151.96336) (xy 164.072489 151.917605) - (xy 164.141647 151.907661) (xy 164.205203 151.936686) (xy 164.211681 151.942718) (xy 165.199525 152.930562) - (xy 165.269438 153.000475) (xy 165.355062 153.04991) (xy 165.402811 153.062705) (xy 165.402812 153.062705) - (xy 165.412903 153.065408) (xy 165.450564 153.0755) (xy 165.450565 153.0755) (xy 172.503692 153.0755) - (xy 172.570731 153.095185) (xy 172.605742 153.129061) (xy 172.608163 153.132569) (xy 172.609515 153.134528) - (xy 172.609517 153.13453) (xy 172.72776 153.239283) (xy 172.727762 153.239284) (xy 172.867634 153.312696) - (xy 173.021014 153.3505) (xy 173.021015 153.3505) (xy 173.178985 153.3505) (xy 173.332365 153.312696) - (xy 173.372836 153.291455) (xy 173.47224 153.239283) (xy 173.590483 153.13453) (xy 173.68022 153.004523) - (xy 173.736237 152.856818) (xy 173.755278 152.7) (xy 173.753737 152.687304) (xy 173.736237 152.543181) - (xy 173.702823 152.455077) (xy 173.68022 152.395477) (xy 173.626988 152.318357) (xy 173.605106 152.252005) - (xy 173.622571 152.184353) (xy 173.646814 152.155102) (xy 173.668583 152.135817) (xy 173.75832 152.00581) - (xy 173.814337 151.858105) (xy 173.833378 151.701287) (xy 173.820531 151.595477) (xy 173.814337 151.544468) - (xy 173.77832 151.4495) (xy 173.75832 151.396764) (xy 173.747845 151.381588) (xy 173.725962 151.315233) - (xy 173.743428 151.247581) (xy 173.767669 151.218332) (xy 173.772238 151.214283) (xy 173.77224 151.214283) - (xy 173.890483 151.10953) (xy 173.98022 150.979523) (xy 174.036237 150.831818) (xy 174.055278 150.675) - (xy 174.036237 150.518182) (xy 174.029341 150.5) (xy 173.991519 150.400271) (xy 173.98022 150.370477) - (xy 173.890483 150.24047) (xy 173.77224 150.135717) (xy 173.772238 150.135716) (xy 173.772237 150.135715) - (xy 173.632365 150.062303) (xy 173.478986 150.0245) (xy 173.478985 150.0245) (xy 173.321015 150.0245) - (xy 173.321014 150.0245) (xy 173.167634 150.062303) (xy 173.027762 150.135715) (xy 172.909516 150.24047) - (xy 172.907089 150.243987) (xy 172.905742 150.245938) (xy 172.851463 150.289929) (xy 172.803692 150.2995) - (xy 166.887343 150.2995) (xy 166.820304 150.279815) (xy 166.774549 150.227011) (xy 166.764605 150.157853) - (xy 166.785293 150.10506) (xy 166.79909 150.085071) (xy 166.821859 150.052085) (xy 166.877876 149.90438) - (xy 166.896917 149.747562) (xy 166.890741 149.696706) (xy 166.9022 149.627786) (xy 166.926153 149.594083) - (xy 167.80842 148.711819) (xy 167.869743 148.678334) (xy 167.896101 148.6755) (xy 174.049433 148.6755) - (xy 174.049434 148.6755) (xy 174.097184 148.662705) (xy 174.144936 148.64991) (xy 174.23056 148.600475) - (xy 174.300473 148.530562) (xy 174.744215 148.086818) (xy 174.805538 148.053334) (xy 174.831896 148.0505) - (xy 174.978983 148.0505) (xy 175.132363 148.012696) (xy 175.157458 147.999525) (xy 175.272238 147.939283) - (xy 175.390481 147.83453) (xy 175.480218 147.704523) (xy 175.536235 147.556818) (xy 175.555276 147.4) - (xy 175.553791 147.387765) (xy 175.536235 147.243181) (xy 175.506762 147.165468) (xy 175.480218 147.095477) - (xy 175.390481 146.96547) (xy 175.272238 146.860717) (xy 175.272236 146.860716) (xy 175.272235 146.860715) - (xy 175.132363 146.787303) (xy 174.978984 146.7495) (xy 174.978983 146.7495) (xy 174.821013 146.7495) - (xy 174.821012 146.7495) (xy 174.667632 146.787303) (xy 174.52776 146.860715) (xy 174.472128 146.91) - (xy 174.42925 146.947987) (xy 174.409514 146.965471) (xy 174.319779 147.095475) (xy 174.319778 147.095476) - (xy 174.263761 147.243181) (xy 174.24472 147.4) (xy 174.24472 147.400001) (xy 174.250894 147.450854) - (xy 174.239433 147.519777) (xy 174.215479 147.55348) (xy 173.880778 147.888182) (xy 173.819457 147.921666) - (xy 173.793099 147.9245) (xy 167.639765 147.9245) (xy 167.544264 147.950089) (xy 167.544261 147.95009) - (xy 167.458641 147.999522) (xy 167.458636 147.999526) (xy 166.416959 149.041203) (xy 166.355636 149.074688) - (xy 166.285944 149.069704) (xy 166.230011 149.027832) (xy 166.206552 148.964937) (xy 166.206182 148.964982) - (xy 166.205995 148.963443) (xy 166.205594 148.962368) (xy 166.205481 148.95921) (xy 166.201375 148.925394) - (xy 166.189091 148.824226) (xy 166.200551 148.755306) (xy 166.224503 148.721604) (xy 168.805724 146.140385) - (xy 168.867047 146.1069) (xy 168.893405 146.104066) (xy 173.91665 146.104066) (xy 173.983689 146.123751) - (xy 174.0187 146.157627) (xy 174.021121 146.161135) (xy 174.022473 146.163094) (xy 174.022475 146.163096) - (xy 174.140718 146.267849) (xy 174.14072 146.26785) (xy 174.280592 146.341262) (xy 174.433972 146.379066) - (xy 174.433973 146.379066) (xy 174.591943 146.379066) (xy 174.745323 146.341262) (xy 174.792655 146.31642) - (xy 174.885198 146.267849) (xy 175.003441 146.163096) (xy 175.093178 146.033089) (xy 175.149195 145.885384) - (xy 175.168236 145.728566) (xy 175.168004 145.726651) (xy 175.149195 145.571747) (xy 175.1032 145.45047) - (xy 175.093178 145.424043) (xy 175.003441 145.294036) (xy 174.885198 145.189283) (xy 174.885196 145.189282) - (xy 174.885195 145.189281) (xy 174.745323 145.115869) (xy 174.591944 145.078066) (xy 174.591943 145.078066) - (xy 174.433973 145.078066) (xy 174.433972 145.078066) (xy 174.280592 145.115869) (xy 174.14072 145.189281) - (xy 174.022474 145.294036) (xy 174.020047 145.297553) (xy 174.0187 145.299504) (xy 173.964421 145.343495) - (xy 173.91665 145.353066) (xy 168.637069 145.353066) (xy 168.593409 145.364765) (xy 168.566448 145.371989) - (xy 168.496598 145.370326) (xy 168.438736 145.331163) (xy 168.418413 145.296185) (xy 168.38022 145.195477) - (xy 168.290483 145.06547) (xy 168.17224 144.960717) (xy 168.172238 144.960716) (xy 168.172237 144.960715) - (xy 168.032365 144.887303) (xy 167.878986 144.8495) (xy 167.878985 144.8495) (xy 167.7319 144.8495) - (xy 167.664861 144.829815) (xy 167.644219 144.813181) (xy 166.311819 143.480781) (xy 166.278334 143.419458) - (xy 166.2755 143.3931) (xy 166.2755 141.994877) (xy 166.295185 141.927838) (xy 166.29745 141.924437) - (xy 166.314207 141.900158) (xy 166.38022 141.804523) (xy 166.436237 141.656818) (xy 166.450334 141.540711) - (xy 166.477955 141.476535) (xy 166.535889 141.437478) (xy 166.605742 141.435943) (xy 166.665336 141.472417) - (xy 166.67548 141.485219) (xy 166.709517 141.53453) (xy 166.82776 141.639283) (xy 166.827762 141.639284) - (xy 166.967634 141.712696) (xy 167.121014 141.7505) (xy 167.268101 141.7505) (xy 167.33514 141.770185) - (xy 167.355782 141.786819) (xy 168.999525 143.430562) (xy 169.069438 143.500475) (xy 169.155062 143.54991) - (xy 169.196962 143.561137) (xy 169.250564 143.5755) (xy 169.250565 143.5755) (xy 173.518569 143.5755) - (xy 173.576194 143.589703) (xy 173.667635 143.637696) (xy 173.744325 143.656598) (xy 173.821014 143.6755) - (xy 173.821015 143.6755) (xy 173.978985 143.6755) (xy 174.132365 143.637696) (xy 174.161408 143.622453) - (xy 174.27224 143.564283) (xy 174.390483 143.45953) (xy 174.48022 143.329523) (xy 174.536237 143.181818) - (xy 174.555278 143.025) (xy 174.548646 142.970376) (xy 174.536237 142.868181) (xy 174.505897 142.788181) - (xy 174.48022 142.720477) (xy 174.390483 142.59047) (xy 174.27224 142.485717) (xy 174.272238 142.485716) - (xy 174.272237 142.485715) (xy 174.132365 142.412303) (xy 173.978986 142.3745) (xy 173.978985 142.3745) - (xy 173.821015 142.3745) (xy 173.821014 142.3745) (xy 173.667634 142.412303) (xy 173.527762 142.485715) - (xy 173.495581 142.514225) (xy 173.437702 142.565501) (xy 173.409516 142.590471) (xy 173.319781 142.720475) - (xy 173.319779 142.720478) (xy 173.310679 142.744473) (xy 173.2685 142.800175) (xy 173.202903 142.824231) - (xy 173.194738 142.8245) (xy 169.506899 142.8245) (xy 169.43986 142.804815) (xy 169.419218 142.788181) - (xy 167.884517 141.25348) (xy 167.851032 141.192157) (xy 167.849102 141.150857) (xy 167.855278 141.1) - (xy 167.836237 140.943182) (xy 167.78022 140.795477) (xy 167.690483 140.66547) (xy 167.57224 140.560717) - (xy 167.572238 140.560716) (xy 167.572237 140.560715) (xy 167.432365 140.487303) (xy 167.278986 140.4495) - (xy 167.278985 140.4495) (xy 167.121015 140.4495) (xy 167.121014 140.4495) (xy 166.967634 140.487303) - (xy 166.827762 140.560715) (xy 166.709516 140.665471) (xy 166.619781 140.795475) (xy 166.61978 140.795476) - (xy 166.563763 140.94318) (xy 166.549665 141.059287) (xy 166.522043 141.123465) (xy 166.464109 141.162521) - (xy 166.394256 141.164056) (xy 166.334662 141.127582) (xy 166.324519 141.11478) (xy 166.314317 141.1) - (xy 166.290483 141.06547) (xy 166.17224 140.960717) (xy 166.172238 140.960716) (xy 166.172237 140.960715) - (xy 166.032365 140.887303) (xy 165.878986 140.8495) (xy 165.878985 140.8495) (xy 165.721015 140.8495) - (xy 165.721014 140.8495) (xy 165.567634 140.887303) (xy 165.427762 140.960715) (xy 165.378411 141.004436) - (xy 165.332513 141.045098) (xy 165.309516 141.065471) (xy 165.219781 141.195475) (xy 165.21978 141.195476) - (xy 165.163762 141.343181) (xy 165.144722 141.499999) (xy 165.144722 141.5) (xy 165.163762 141.656818) - (xy 165.202841 141.759859) (xy 165.21978 141.804523) (xy 165.24131 141.835715) (xy 165.309517 141.934531) - (xy 165.390788 142.006529) (xy 165.42776 142.039283) (xy 165.427764 142.039285) (xy 165.427767 142.039287) - (xy 165.458124 142.055219) (xy 165.508337 142.103802) (xy 165.5245 142.165016) (xy 165.5245 143.649436) - (xy 165.531483 143.675499) (xy 165.531484 143.675499) (xy 165.531484 143.6755) (xy 165.55009 143.744938) - (xy 165.586097 143.807304) (xy 165.586098 143.807306) (xy 165.586097 143.807306) (xy 165.599522 143.830557) - (xy 165.599528 143.830566) (xy 167.115481 145.346518) (xy 167.148966 145.407841) (xy 167.150896 145.449143) - (xy 167.144722 145.499997) (xy 167.144722 145.5) (xy 167.163762 145.656818) (xy 167.21978 145.804523) - (xy 167.309517 145.93453) (xy 167.42776 146.039283) (xy 167.551192 146.104066) (xy 167.552008 146.104494) - (xy 167.60222 146.153078) (xy 167.618195 146.221097) (xy 167.59486 146.286955) (xy 167.582063 146.301971) - (xy 165.613318 148.270717) (xy 165.551995 148.304202) (xy 165.525637 148.307036) (xy 165.471014 148.307036) - (xy 165.310351 148.346635) (xy 165.309991 148.345177) (xy 165.248797 148.349887) (xy 165.187294 148.316734) - (xy 165.153478 148.255592) (xy 165.1505 148.22858) (xy 165.1505 143.705568) (xy 165.1505 143.705565) - (xy 165.147797 143.695477) (xy 165.147796 143.695473) (xy 165.147796 143.695472) (xy 165.124912 143.610065) - (xy 165.124911 143.610064) (xy 165.124911 143.610063) (xy 165.075475 143.524437) (xy 164.036319 142.485281) - (xy 164.002834 142.423958) (xy 164 142.3976) (xy 164 137.469999) (xy 176.154722 137.469999) (xy 176.154722 137.47) - (xy 176.173762 137.626818) (xy 176.20366 137.705651) (xy 176.22978 137.774523) (xy 176.319517 137.90453) - (xy 176.43776 138.009283) (xy 176.437762 138.009284) (xy 176.577634 138.082696) (xy 176.731014 138.1205) - (xy 176.731015 138.1205) (xy 176.888985 138.1205) (xy 177.042365 138.082696) (xy 177.084242 138.060717) - (xy 177.18224 138.009283) (xy 177.300483 137.90453) (xy 177.39022 137.774523) (xy 177.446237 137.626818) - (xy 177.465278 137.47) (xy 177.446237 137.313182) (xy 177.415335 137.231701) (xy 177.409969 137.162042) - (xy 177.443116 137.100535) (xy 177.504254 137.066714) (xy 177.570308 137.071073) (xy 177.570351 137.070901) - (xy 177.57132 137.07114) (xy 177.573972 137.071315) (xy 177.575254 137.071793) (xy 177.577632 137.072694) - (xy 177.577635 137.072696) (xy 177.650751 137.090717) (xy 177.731014 137.1105) (xy 177.731015 137.1105) - (xy 177.888985 137.1105) (xy 178.042365 137.072696) (xy 178.18224 136.999283) (xy 178.300483 136.89453) - (xy 178.39022 136.764523) (xy 178.446237 136.616818) (xy 178.465278 136.46) (xy 178.451983 136.3505) - (xy 178.446237 136.303181) (xy 178.393172 136.163261) (xy 178.39022 136.155477) (xy 178.300483 136.02547) - (xy 178.18224 135.920717) (xy 178.182238 135.920716) (xy 178.182237 135.920715) (xy 178.042365 135.847303) - (xy 177.888986 135.8095) (xy 177.888985 135.8095) (xy 177.731015 135.8095) (xy 177.731014 135.8095) - (xy 177.577634 135.847303) (xy 177.437762 135.920715) (xy 177.319516 136.025471) (xy 177.229781 136.155475) - (xy 177.22978 136.155476) (xy 177.173762 136.303181) (xy 177.154722 136.459999) (xy 177.154722 136.46) - (xy 177.173763 136.616818) (xy 177.204663 136.698295) (xy 177.21003 136.767958) (xy 177.176883 136.829464) - (xy 177.115744 136.863286) (xy 177.049691 136.858925) (xy 177.049649 136.859099) (xy 177.048674 136.858858) - (xy 177.046026 136.858684) (xy 177.044752 136.858209) (xy 177.042364 136.857303) (xy 176.888986 136.8195) - (xy 176.888985 136.8195) (xy 176.731015 136.8195) (xy 176.731014 136.8195) (xy 176.577634 136.857303) - (xy 176.437762 136.930715) (xy 176.319516 137.035471) (xy 176.229781 137.165475) (xy 176.22978 137.165476) - (xy 176.173762 137.313181) (xy 176.154722 137.469999) (xy 164 137.469999) (xy 164 134.7895) (xy 164.019685 134.722461) - (xy 164.072489 134.676706) (xy 164.124 134.6655) (xy 178.433101 134.6655) + (xy 164.072575 169.370998) (xy 164.022757 169.206769) (xy 164.018018 169.182941) (xy 164.000597 169.006061) + (xy 164 168.993907) (xy 164 152.030399) (xy 164.019685 151.96336) (xy 164.072489 151.917605) (xy 164.141647 151.907661) + (xy 164.205203 151.936686) (xy 164.211681 151.942718) (xy 165.199525 152.930562) (xy 165.269438 153.000475) + (xy 165.355062 153.04991) (xy 165.402811 153.062705) (xy 165.402812 153.062705) (xy 165.412903 153.065408) + (xy 165.450564 153.0755) (xy 165.450565 153.0755) (xy 172.503692 153.0755) (xy 172.570731 153.095185) + (xy 172.605742 153.129061) (xy 172.608163 153.132569) (xy 172.609515 153.134528) (xy 172.609517 153.13453) + (xy 172.72776 153.239283) (xy 172.727762 153.239284) (xy 172.867634 153.312696) (xy 173.021014 153.3505) + (xy 173.021015 153.3505) (xy 173.178985 153.3505) (xy 173.332365 153.312696) (xy 173.372836 153.291455) + (xy 173.47224 153.239283) (xy 173.590483 153.13453) (xy 173.68022 153.004523) (xy 173.736237 152.856818) + (xy 173.755278 152.7) (xy 173.753737 152.687304) (xy 173.736237 152.543181) (xy 173.702823 152.455077) + (xy 173.68022 152.395477) (xy 173.626988 152.318357) (xy 173.605106 152.252005) (xy 173.622571 152.184353) + (xy 173.646814 152.155102) (xy 173.668583 152.135817) (xy 173.75832 152.00581) (xy 173.814337 151.858105) + (xy 173.833378 151.701287) (xy 173.820531 151.595477) (xy 173.814337 151.544468) (xy 173.77832 151.4495) + (xy 173.75832 151.396764) (xy 173.747845 151.381588) (xy 173.725962 151.315233) (xy 173.743428 151.247581) + (xy 173.767669 151.218332) (xy 173.772238 151.214283) (xy 173.77224 151.214283) (xy 173.890483 151.10953) + (xy 173.98022 150.979523) (xy 174.036237 150.831818) (xy 174.055278 150.675) (xy 174.036237 150.518182) + (xy 174.029341 150.5) (xy 173.991519 150.400271) (xy 173.98022 150.370477) (xy 173.890483 150.24047) + (xy 173.77224 150.135717) (xy 173.772238 150.135716) (xy 173.772237 150.135715) (xy 173.632365 150.062303) + (xy 173.478986 150.0245) (xy 173.478985 150.0245) (xy 173.321015 150.0245) (xy 173.321014 150.0245) + (xy 173.167634 150.062303) (xy 173.027762 150.135715) (xy 172.909516 150.24047) (xy 172.907089 150.243987) + (xy 172.905742 150.245938) (xy 172.851463 150.289929) (xy 172.803692 150.2995) (xy 166.887343 150.2995) + (xy 166.820304 150.279815) (xy 166.774549 150.227011) (xy 166.764605 150.157853) (xy 166.785293 150.10506) + (xy 166.79909 150.085071) (xy 166.821859 150.052085) (xy 166.877876 149.90438) (xy 166.896917 149.747562) + (xy 166.890741 149.696706) (xy 166.9022 149.627786) (xy 166.926153 149.594083) (xy 167.80842 148.711819) + (xy 167.869743 148.678334) (xy 167.896101 148.6755) (xy 174.049433 148.6755) (xy 174.049434 148.6755) + (xy 174.097184 148.662705) (xy 174.144936 148.64991) (xy 174.23056 148.600475) (xy 174.300473 148.530562) + (xy 174.744215 148.086818) (xy 174.805538 148.053334) (xy 174.831896 148.0505) (xy 174.978983 148.0505) + (xy 175.132363 148.012696) (xy 175.157458 147.999525) (xy 175.272238 147.939283) (xy 175.390481 147.83453) + (xy 175.480218 147.704523) (xy 175.536235 147.556818) (xy 175.555276 147.4) (xy 175.553791 147.387765) + (xy 175.536235 147.243181) (xy 175.506762 147.165468) (xy 175.480218 147.095477) (xy 175.390481 146.96547) + (xy 175.272238 146.860717) (xy 175.272236 146.860716) (xy 175.272235 146.860715) (xy 175.132363 146.787303) + (xy 174.978984 146.7495) (xy 174.978983 146.7495) (xy 174.821013 146.7495) (xy 174.821012 146.7495) + (xy 174.667632 146.787303) (xy 174.52776 146.860715) (xy 174.472128 146.91) (xy 174.42925 146.947987) + (xy 174.409514 146.965471) (xy 174.319779 147.095475) (xy 174.319778 147.095476) (xy 174.263761 147.243181) + (xy 174.24472 147.4) (xy 174.24472 147.400001) (xy 174.250894 147.450854) (xy 174.239433 147.519777) + (xy 174.215479 147.55348) (xy 173.880778 147.888182) (xy 173.819457 147.921666) (xy 173.793099 147.9245) + (xy 167.639765 147.9245) (xy 167.544264 147.950089) (xy 167.544261 147.95009) (xy 167.458641 147.999522) + (xy 167.458636 147.999526) (xy 166.416959 149.041203) (xy 166.355636 149.074688) (xy 166.285944 149.069704) + (xy 166.230011 149.027832) (xy 166.206552 148.964937) (xy 166.206182 148.964982) (xy 166.205995 148.963443) + (xy 166.205594 148.962368) (xy 166.205481 148.95921) (xy 166.201375 148.925394) (xy 166.189091 148.824226) + (xy 166.200551 148.755306) (xy 166.224503 148.721604) (xy 168.805724 146.140385) (xy 168.867047 146.1069) + (xy 168.893405 146.104066) (xy 173.91665 146.104066) (xy 173.983689 146.123751) (xy 174.0187 146.157627) + (xy 174.021121 146.161135) (xy 174.022473 146.163094) (xy 174.022475 146.163096) (xy 174.140718 146.267849) + (xy 174.14072 146.26785) (xy 174.280592 146.341262) (xy 174.433972 146.379066) (xy 174.433973 146.379066) + (xy 174.591943 146.379066) (xy 174.745323 146.341262) (xy 174.792655 146.31642) (xy 174.885198 146.267849) + (xy 175.003441 146.163096) (xy 175.093178 146.033089) (xy 175.149195 145.885384) (xy 175.168236 145.728566) + (xy 175.168004 145.726651) (xy 175.149195 145.571747) (xy 175.1032 145.45047) (xy 175.093178 145.424043) + (xy 175.003441 145.294036) (xy 174.885198 145.189283) (xy 174.885196 145.189282) (xy 174.885195 145.189281) + (xy 174.745323 145.115869) (xy 174.591944 145.078066) (xy 174.591943 145.078066) (xy 174.433973 145.078066) + (xy 174.433972 145.078066) (xy 174.280592 145.115869) (xy 174.14072 145.189281) (xy 174.022474 145.294036) + (xy 174.020047 145.297553) (xy 174.0187 145.299504) (xy 173.964421 145.343495) (xy 173.91665 145.353066) + (xy 168.637069 145.353066) (xy 168.593409 145.364765) (xy 168.566448 145.371989) (xy 168.496598 145.370326) + (xy 168.438736 145.331163) (xy 168.418413 145.296185) (xy 168.38022 145.195477) (xy 168.290483 145.06547) + (xy 168.17224 144.960717) (xy 168.172238 144.960716) (xy 168.172237 144.960715) (xy 168.032365 144.887303) + (xy 167.878986 144.8495) (xy 167.878985 144.8495) (xy 167.7319 144.8495) (xy 167.664861 144.829815) + (xy 167.644219 144.813181) (xy 166.311819 143.480781) (xy 166.278334 143.419458) (xy 166.2755 143.3931) + (xy 166.2755 141.994877) (xy 166.295185 141.927838) (xy 166.29745 141.924437) (xy 166.314207 141.900158) + (xy 166.38022 141.804523) (xy 166.436237 141.656818) (xy 166.450334 141.540711) (xy 166.477955 141.476535) + (xy 166.535889 141.437478) (xy 166.605742 141.435943) (xy 166.665336 141.472417) (xy 166.67548 141.485219) + (xy 166.709517 141.53453) (xy 166.82776 141.639283) (xy 166.827762 141.639284) (xy 166.967634 141.712696) + (xy 167.121014 141.7505) (xy 167.268101 141.7505) (xy 167.33514 141.770185) (xy 167.355782 141.786819) + (xy 168.999525 143.430562) (xy 169.069438 143.500475) (xy 169.155062 143.54991) (xy 169.196962 143.561137) + (xy 169.250564 143.5755) (xy 169.250565 143.5755) (xy 173.518569 143.5755) (xy 173.576194 143.589703) + (xy 173.667635 143.637696) (xy 173.744325 143.656598) (xy 173.821014 143.6755) (xy 173.821015 143.6755) + (xy 173.978985 143.6755) (xy 174.132365 143.637696) (xy 174.161408 143.622453) (xy 174.27224 143.564283) + (xy 174.390483 143.45953) (xy 174.48022 143.329523) (xy 174.536237 143.181818) (xy 174.555278 143.025) + (xy 174.548646 142.970376) (xy 174.536237 142.868181) (xy 174.505897 142.788181) (xy 174.48022 142.720477) + (xy 174.390483 142.59047) (xy 174.27224 142.485717) (xy 174.272238 142.485716) (xy 174.272237 142.485715) + (xy 174.132365 142.412303) (xy 173.978986 142.3745) (xy 173.978985 142.3745) (xy 173.821015 142.3745) + (xy 173.821014 142.3745) (xy 173.667634 142.412303) (xy 173.527762 142.485715) (xy 173.495581 142.514225) + (xy 173.437702 142.565501) (xy 173.409516 142.590471) (xy 173.319781 142.720475) (xy 173.319779 142.720478) + (xy 173.310679 142.744473) (xy 173.2685 142.800175) (xy 173.202903 142.824231) (xy 173.194738 142.8245) + (xy 169.506899 142.8245) (xy 169.43986 142.804815) (xy 169.419218 142.788181) (xy 167.884517 141.25348) + (xy 167.851032 141.192157) (xy 167.849102 141.150857) (xy 167.855278 141.1) (xy 167.836237 140.943182) + (xy 167.78022 140.795477) (xy 167.690483 140.66547) (xy 167.57224 140.560717) (xy 167.572238 140.560716) + (xy 167.572237 140.560715) (xy 167.432365 140.487303) (xy 167.278986 140.4495) (xy 167.278985 140.4495) + (xy 167.121015 140.4495) (xy 167.121014 140.4495) (xy 166.967634 140.487303) (xy 166.827762 140.560715) + (xy 166.709516 140.665471) (xy 166.619781 140.795475) (xy 166.61978 140.795476) (xy 166.563763 140.94318) + (xy 166.549665 141.059287) (xy 166.522043 141.123465) (xy 166.464109 141.162521) (xy 166.394256 141.164056) + (xy 166.334662 141.127582) (xy 166.324519 141.11478) (xy 166.314317 141.1) (xy 166.290483 141.06547) + (xy 166.17224 140.960717) (xy 166.172238 140.960716) (xy 166.172237 140.960715) (xy 166.032365 140.887303) + (xy 165.878986 140.8495) (xy 165.878985 140.8495) (xy 165.721015 140.8495) (xy 165.721014 140.8495) + (xy 165.567634 140.887303) (xy 165.427762 140.960715) (xy 165.378411 141.004436) (xy 165.332513 141.045098) + (xy 165.309516 141.065471) (xy 165.219781 141.195475) (xy 165.21978 141.195476) (xy 165.163762 141.343181) + (xy 165.144722 141.499999) (xy 165.144722 141.5) (xy 165.163762 141.656818) (xy 165.202841 141.759859) + (xy 165.21978 141.804523) (xy 165.24131 141.835715) (xy 165.309517 141.934531) (xy 165.390788 142.006529) + (xy 165.42776 142.039283) (xy 165.427764 142.039285) (xy 165.427767 142.039287) (xy 165.458124 142.055219) + (xy 165.508337 142.103802) (xy 165.5245 142.165016) (xy 165.5245 143.649436) (xy 165.531483 143.675499) + (xy 165.531484 143.675499) (xy 165.531484 143.6755) (xy 165.55009 143.744938) (xy 165.586097 143.807304) + (xy 165.586098 143.807306) (xy 165.586097 143.807306) (xy 165.599522 143.830557) (xy 165.599528 143.830566) + (xy 167.115481 145.346518) (xy 167.148966 145.407841) (xy 167.150896 145.449143) (xy 167.144722 145.499997) + (xy 167.144722 145.5) (xy 167.163762 145.656818) (xy 167.21978 145.804523) (xy 167.309517 145.93453) + (xy 167.42776 146.039283) (xy 167.551192 146.104066) (xy 167.552008 146.104494) (xy 167.60222 146.153078) + (xy 167.618195 146.221097) (xy 167.59486 146.286955) (xy 167.582063 146.301971) (xy 165.613318 148.270717) + (xy 165.551995 148.304202) (xy 165.525637 148.307036) (xy 165.471014 148.307036) (xy 165.310351 148.346635) + (xy 165.309991 148.345177) (xy 165.248797 148.349887) (xy 165.187294 148.316734) (xy 165.153478 148.255592) + (xy 165.1505 148.22858) (xy 165.1505 143.705568) (xy 165.1505 143.705565) (xy 165.147797 143.695477) + (xy 165.147796 143.695473) (xy 165.147796 143.695472) (xy 165.124912 143.610065) (xy 165.124911 143.610064) + (xy 165.124911 143.610063) (xy 165.075475 143.524437) (xy 164.036319 142.485281) (xy 164.002834 142.423958) + (xy 164 142.3976) (xy 164 137.469999) (xy 176.154722 137.469999) (xy 176.154722 137.47) (xy 176.173762 137.626818) + (xy 176.20366 137.705651) (xy 176.22978 137.774523) (xy 176.319517 137.90453) (xy 176.43776 138.009283) + (xy 176.437762 138.009284) (xy 176.577634 138.082696) (xy 176.731014 138.1205) (xy 176.731015 138.1205) + (xy 176.888985 138.1205) (xy 177.042365 138.082696) (xy 177.084242 138.060717) (xy 177.18224 138.009283) + (xy 177.300483 137.90453) (xy 177.39022 137.774523) (xy 177.446237 137.626818) (xy 177.465278 137.47) + (xy 177.446237 137.313182) (xy 177.415335 137.231701) (xy 177.409969 137.162042) (xy 177.443116 137.100535) + (xy 177.504254 137.066714) (xy 177.570308 137.071073) (xy 177.570351 137.070901) (xy 177.57132 137.07114) + (xy 177.573972 137.071315) (xy 177.575254 137.071793) (xy 177.577632 137.072694) (xy 177.577635 137.072696) + (xy 177.650751 137.090717) (xy 177.731014 137.1105) (xy 177.731015 137.1105) (xy 177.888985 137.1105) + (xy 178.042365 137.072696) (xy 178.18224 136.999283) (xy 178.300483 136.89453) (xy 178.39022 136.764523) + (xy 178.446237 136.616818) (xy 178.465278 136.46) (xy 178.451983 136.3505) (xy 178.446237 136.303181) + (xy 178.393172 136.163261) (xy 178.39022 136.155477) (xy 178.300483 136.02547) (xy 178.18224 135.920717) + (xy 178.182238 135.920716) (xy 178.182237 135.920715) (xy 178.042365 135.847303) (xy 177.888986 135.8095) + (xy 177.888985 135.8095) (xy 177.731015 135.8095) (xy 177.731014 135.8095) (xy 177.577634 135.847303) + (xy 177.437762 135.920715) (xy 177.319516 136.025471) (xy 177.229781 136.155475) (xy 177.22978 136.155476) + (xy 177.173762 136.303181) (xy 177.154722 136.459999) (xy 177.154722 136.46) (xy 177.173763 136.616818) + (xy 177.204663 136.698295) (xy 177.21003 136.767958) (xy 177.176883 136.829464) (xy 177.115744 136.863286) + (xy 177.049691 136.858925) (xy 177.049649 136.859099) (xy 177.048674 136.858858) (xy 177.046026 136.858684) + (xy 177.044752 136.858209) (xy 177.042364 136.857303) (xy 176.888986 136.8195) (xy 176.888985 136.8195) + (xy 176.731015 136.8195) (xy 176.731014 136.8195) (xy 176.577634 136.857303) (xy 176.437762 136.930715) + (xy 176.319516 137.035471) (xy 176.229781 137.165475) (xy 176.22978 137.165476) (xy 176.173762 137.313181) + (xy 176.154722 137.469999) (xy 164 137.469999) (xy 164 134.7895) (xy 164.019685 134.722461) (xy 164.072489 134.676706) + (xy 164.124 134.6655) (xy 178.433101 134.6655) ) ) (filled_polygon @@ -179650,273 +184197,286 @@ (xy 186.172237 159.160715) (xy 186.032365 159.087303) (xy 185.878986 159.0495) (xy 185.878985 159.0495) (xy 185.721015 159.0495) (xy 185.721014 159.0495) (xy 185.567634 159.087303) (xy 185.427762 159.160715) (xy 185.309516 159.265471) (xy 185.219781 159.395475) (xy 185.21978 159.395476) (xy 185.163762 159.543181) - (xy 185.144722 159.699999) (xy 185.144722 159.7) (xy 185.163762 159.856818) (xy 185.201688 159.956818) + (xy 185.144722 159.699999) (xy 185.144722 159.7) (xy 185.163762 159.856818) (xy 185.19173 159.930562) (xy 185.21978 160.004523) (xy 185.309517 160.13453) (xy 185.42776 160.239283) (xy 185.427762 160.239284) (xy 185.567634 160.312696) (xy 185.721014 160.3505) (xy 185.721015 160.3505) (xy 185.878985 160.3505) - (xy 186.032365 160.312696) (xy 186.060682 160.297834) (xy 186.17224 160.239283) (xy 186.290483 160.13453) - (xy 186.294257 160.129061) (xy 186.348537 160.085071) (xy 186.396308 160.0755) (xy 192.703692 160.0755) - (xy 192.770731 160.095185) (xy 192.805742 160.129061) (xy 192.808163 160.132569) (xy 192.809515 160.134528) - (xy 192.809517 160.13453) (xy 192.92776 160.239283) (xy 192.927762 160.239284) (xy 193.067634 160.312696) - (xy 193.221014 160.3505) (xy 193.221015 160.3505) (xy 193.378985 160.3505) (xy 193.532365 160.312696) - (xy 193.560682 160.297834) (xy 193.67224 160.239283) (xy 193.790483 160.13453) (xy 193.88022 160.004523) - (xy 193.936237 159.856818) (xy 193.955278 159.7) (xy 193.936237 159.543182) (xy 193.931214 159.529939) - (xy 193.925846 159.460278) (xy 193.958993 159.398771) (xy 194.02013 159.364948) (xy 194.089848 159.369548) - (xy 194.134837 159.398286) (xy 195.449276 160.712725) (xy 195.482761 160.774048) (xy 195.484691 160.81535) - (xy 195.478517 160.866204) (xy 195.478517 160.866207) (xy 195.497557 161.023025) (xy 195.539845 161.134528) - (xy 195.553575 161.17073) (xy 195.643312 161.300737) (xy 195.761555 161.40549) (xy 195.761557 161.405491) - (xy 195.901429 161.478903) (xy 195.919087 161.483255) (xy 195.942588 161.489047) (xy 196.002969 161.524201) - (xy 196.034759 161.58642) (xy 196.027864 161.655949) (xy 196.012681 161.680463) (xy 196.01378 161.681222) - (xy 196.009517 161.687397) (xy 196.009517 161.687398) (xy 196.005742 161.692866) (xy 195.951463 161.736857) - (xy 195.903692 161.746428) (xy 186.227508 161.746428) (xy 186.128636 161.746428) (xy 186.033135 161.772017) - (xy 186.033134 161.772017) (xy 186.033132 161.772018) (xy 186.033129 161.772019) (xy 185.947514 161.82145) - (xy 185.944352 161.823877) (xy 185.941203 161.825093) (xy 185.940473 161.825516) (xy 185.940407 161.825401) - (xy 185.879183 161.84907) (xy 185.868867 161.8495) (xy 185.721014 161.8495) (xy 185.567634 161.887303) - (xy 185.427762 161.960715) (xy 185.309516 162.065471) (xy 185.219781 162.195475) (xy 185.21978 162.195476) - (xy 185.163762 162.343181) (xy 185.144722 162.499999) (xy 185.144722 162.5) (xy 185.163762 162.656818) - (xy 185.215142 162.792294) (xy 185.21978 162.804523) (xy 185.309517 162.93453) (xy 185.42776 163.039283) - (xy 185.427762 163.039284) (xy 185.567634 163.112696) (xy 185.721014 163.1505) (xy 185.721015 163.1505) - (xy 185.878985 163.1505) (xy 186.039649 163.110901) (xy 186.040097 163.112721) (xy 186.099964 163.1081) - (xy 186.161476 163.141238) (xy 186.195306 163.202371) (xy 186.190716 163.27209) (xy 186.190233 163.273383) - (xy 186.163763 163.343178) (xy 186.163763 163.34318) (xy 186.144722 163.499999) (xy 186.144722 163.5) - (xy 186.163762 163.656818) (xy 186.216052 163.794694) (xy 186.21978 163.804523) (xy 186.309517 163.93453) - (xy 186.42776 164.039283) (xy 186.427762 164.039284) (xy 186.567634 164.112696) (xy 186.721014 164.1505) - (xy 186.721015 164.1505) (xy 186.878985 164.1505) (xy 187.032365 164.112696) (xy 187.03717 164.110174) - (xy 187.17224 164.039283) (xy 187.290483 163.93453) (xy 187.38022 163.804523) (xy 187.436237 163.656818) - (xy 187.445889 163.577321) (xy 187.47351 163.513145) (xy 187.531444 163.474088) (xy 187.568985 163.468269) - (xy 196.303658 163.468269) (xy 196.370697 163.487954) (xy 196.405708 163.52183) (xy 196.409483 163.527299) - (xy 196.527726 163.632052) (xy 196.527728 163.632053) (xy 196.6676 163.705465) (xy 196.82098 163.743269) - (xy 196.820981 163.743269) (xy 196.978951 163.743269) (xy 197.139615 163.70367) (xy 197.139974 163.705129) - (xy 197.201152 163.700413) (xy 197.26266 163.733558) (xy 197.296484 163.794694) (xy 197.299466 163.821724) - (xy 197.299466 165.278774) (xy 197.279781 165.345813) (xy 197.226977 165.391568) (xy 197.157819 165.401512) - (xy 197.094263 165.372487) (xy 197.059524 165.322746) (xy 197.058266 165.319429) (xy 197.03022 165.245477) - (xy 196.940483 165.11547) (xy 196.82224 165.010717) (xy 196.822238 165.010716) (xy 196.822237 165.010715) - (xy 196.682365 164.937303) (xy 196.528986 164.8995) (xy 196.528985 164.8995) (xy 196.371015 164.8995) - (xy 196.371014 164.8995) (xy 196.217634 164.937303) (xy 196.077762 165.010715) (xy 195.959516 165.115471) - (xy 195.869781 165.245475) (xy 195.86978 165.245476) (xy 195.813762 165.393181) (xy 195.794722 165.549999) - (xy 195.794722 165.55) (xy 195.813762 165.706818) (xy 195.86978 165.854523) (xy 195.959517 165.98453) - (xy 196.07776 166.089283) (xy 196.077762 166.089284) (xy 196.217634 166.162696) (xy 196.371014 166.2005) - (xy 196.518101 166.2005) (xy 196.58514 166.220185) (xy 196.605782 166.236819) (xy 198.138181 167.769218) - (xy 198.171666 167.830541) (xy 198.1745 167.856899) (xy 198.1745 169.876) (xy 198.154815 169.943039) - (xy 198.102011 169.988794) (xy 198.0505 170) (xy 191.417789 170) (xy 191.35075 169.980315) (xy 191.304995 169.927511) - (xy 191.295051 169.858353) (xy 191.324076 169.794797) (xy 191.335563 169.783184) (xy 191.390482 169.734531) - (xy 191.404064 169.714854) (xy 191.48022 169.604523) (xy 191.536237 169.456818) (xy 191.555278 169.3) - (xy 191.544678 169.212696) (xy 191.536237 169.143181) (xy 191.514262 169.085238) (xy 191.48022 168.995477) - (xy 191.390483 168.86547) (xy 191.27224 168.760717) (xy 191.272238 168.760716) (xy 191.272237 168.760715) - (xy 191.132365 168.687303) (xy 190.978986 168.6495) (xy 190.978985 168.6495) (xy 190.821015 168.6495) - (xy 190.821014 168.6495) (xy 190.667634 168.687303) (xy 190.527762 168.760715) (xy 190.409516 168.865471) - (xy 190.319781 168.995475) (xy 190.31978 168.995476) (xy 190.263762 169.143181) (xy 190.243818 169.307445) - (xy 190.240775 169.307075) (xy 190.225037 169.360675) (xy 190.172233 169.40643) (xy 190.103075 169.416374) - (xy 190.063097 169.403433) (xy 190.032364 169.387303) (xy 189.878986 169.3495) (xy 189.878985 169.3495) - (xy 189.780899 169.3495) (xy 189.71386 169.329815) (xy 189.668105 169.277011) (xy 189.658161 169.207853) - (xy 189.687186 169.144297) (xy 189.693218 169.137819) (xy 190.494218 168.336819) (xy 190.555541 168.303334) - (xy 190.581899 168.3005) (xy 190.728985 168.3005) (xy 190.882365 168.262696) (xy 190.925297 168.240163) - (xy 191.02224 168.189283) (xy 191.140483 168.08453) (xy 191.23022 167.954523) (xy 191.286237 167.806818) - (xy 191.305278 167.65) (xy 191.28768 167.505062) (xy 191.286237 167.493181) (xy 191.231755 167.349525) - (xy 191.23022 167.345477) (xy 191.140483 167.21547) (xy 191.02224 167.110717) (xy 191.022238 167.110716) - (xy 191.022237 167.110715) (xy 190.882365 167.037303) (xy 190.728986 166.9995) (xy 190.728985 166.9995) - (xy 190.571015 166.9995) (xy 190.571014 166.9995) (xy 190.417634 167.037303) (xy 190.277762 167.110715) - (xy 190.159516 167.215471) (xy 190.069781 167.345475) (xy 190.06978 167.345476) (xy 190.013762 167.493181) - (xy 189.994722 167.649999) (xy 189.994722 167.65) (xy 190.000896 167.700853) (xy 189.989435 167.769776) - (xy 189.965481 167.803479) (xy 187.80528 169.963681) (xy 187.743957 169.997166) (xy 187.717599 170) - (xy 174.6995 170) (xy 174.632461 169.980315) (xy 174.586706 169.927511) (xy 174.5755 169.876) (xy 174.5755 168.650092) - (xy 176.8345 168.650092) (xy 176.8345 168.799907) (xy 176.863723 168.946822) (xy 176.863725 168.94683) - (xy 176.921051 169.085229) (xy 176.921056 169.085238) (xy 177.00428 169.20979) (xy 177.004283 169.209794) - (xy 177.110205 169.315716) (xy 177.110209 169.315719) (xy 177.234761 169.398943) (xy 177.23477 169.398948) - (xy 177.266123 169.411934) (xy 177.37317 169.456275) (xy 177.520092 169.485499) (xy 177.520096 169.4855) - (xy 177.520097 169.4855) (xy 177.669904 169.4855) (xy 177.669905 169.485499) (xy 177.81683 169.456275) - (xy 177.955232 169.398947) (xy 178.079791 169.315719) (xy 178.185719 169.209791) (xy 178.268947 169.085232) - (xy 178.326275 168.94683) (xy 178.3555 168.799903) (xy 178.3555 168.650097) (xy 178.326275 168.50317) - (xy 178.268947 168.364768) (xy 178.268946 168.364767) (xy 178.268943 168.364761) (xy 178.185719 168.240209) - (xy 178.185716 168.240205) (xy 178.079794 168.134283) (xy 178.07979 168.13428) (xy 177.955238 168.051056) - (xy 177.955229 168.051051) (xy 177.81683 167.993725) (xy 177.816822 167.993723) (xy 177.669907 167.9645) - (xy 177.669903 167.9645) (xy 177.520097 167.9645) (xy 177.520092 167.9645) (xy 177.373177 167.993723) - (xy 177.373169 167.993725) (xy 177.23477 168.051051) (xy 177.234761 168.051056) (xy 177.110209 168.13428) - (xy 177.110205 168.134283) (xy 177.004283 168.240205) (xy 177.00428 168.240209) (xy 176.921056 168.364761) - (xy 176.921051 168.36477) (xy 176.863725 168.503169) (xy 176.863723 168.503177) (xy 176.8345 168.650092) - (xy 174.5755 168.650092) (xy 174.5755 165.892202) (xy 174.595185 165.825163) (xy 174.617274 165.799386) - (xy 174.690482 165.734531) (xy 174.709611 165.706818) (xy 174.78022 165.604523) (xy 174.836237 165.456818) - (xy 174.855278 165.3) (xy 174.836237 165.143182) (xy 174.836236 165.143179) (xy 174.836236 165.143178) - (xy 174.826866 165.11847) (xy 174.821499 165.048807) (xy 174.854647 164.987301) (xy 174.915786 164.95348) - (xy 174.942808 164.9505) (xy 177.614149 164.9505) (xy 177.681188 164.970185) (xy 177.726943 165.022989) - (xy 177.736887 165.092147) (xy 177.710003 165.153164) (xy 177.69909 165.166461) (xy 177.699086 165.166467) - (xy 177.606188 165.340266) (xy 177.548975 165.52887) (xy 177.529659 165.725) (xy 177.548975 165.921129) - (xy 177.606188 166.109733) (xy 177.699086 166.283532) (xy 177.69909 166.283539) (xy 177.824116 166.435883) - (xy 177.97646 166.560909) (xy 177.976467 166.560913) (xy 178.150266 166.653811) (xy 178.150269 166.653811) - (xy 178.150273 166.653814) (xy 178.338868 166.711024) (xy 178.535 166.730341) (xy 178.731132 166.711024) - (xy 178.919727 166.653814) (xy 179.093538 166.56091) (xy 179.245883 166.435883) (xy 179.37091 166.283538) - (xy 179.419573 166.192496) (xy 179.463811 166.109733) (xy 179.463811 166.109732) (xy 179.463814 166.109727) - (xy 179.521024 165.921132) (xy 179.540341 165.725) (xy 179.521024 165.528868) (xy 179.463814 165.340273) - (xy 179.463811 165.340269) (xy 179.463811 165.340266) (xy 179.370913 165.166467) (xy 179.370909 165.166461) - (xy 179.359997 165.153164) (xy 179.332685 165.088854) (xy 179.344476 165.019987) (xy 179.391629 164.968427) - (xy 179.455851 164.9505) (xy 180.614149 164.9505) (xy 180.681188 164.970185) (xy 180.726943 165.022989) - (xy 180.736887 165.092147) (xy 180.710003 165.153164) (xy 180.69909 165.166461) (xy 180.699086 165.166467) - (xy 180.606188 165.340266) (xy 180.548975 165.52887) (xy 180.529659 165.725) (xy 180.548975 165.921129) - (xy 180.606188 166.109733) (xy 180.699086 166.283532) (xy 180.69909 166.283539) (xy 180.824116 166.435883) - (xy 180.97646 166.560909) (xy 180.976467 166.560913) (xy 181.150266 166.653811) (xy 181.150269 166.653811) - (xy 181.150273 166.653814) (xy 181.338868 166.711024) (xy 181.535 166.730341) (xy 181.731132 166.711024) - (xy 181.919727 166.653814) (xy 182.093538 166.56091) (xy 182.245883 166.435883) (xy 182.37091 166.283538) - (xy 182.419573 166.192496) (xy 182.463811 166.109733) (xy 182.463811 166.109732) (xy 182.463814 166.109727) - (xy 182.521024 165.921132) (xy 182.540341 165.725) (xy 182.521024 165.528868) (xy 182.463814 165.340273) - (xy 182.463811 165.340269) (xy 182.463811 165.340266) (xy 182.370913 165.166467) (xy 182.370909 165.16646) - (xy 182.245883 165.014116) (xy 182.138005 164.925582) (xy 182.098671 164.867836) (xy 182.0968 164.797991) - (xy 182.128989 164.742048) (xy 182.760863 164.110174) (xy 183.396993 163.474044) (xy 183.396994 163.474043) - (xy 183.446429 163.388419) (xy 183.45137 163.369979) (xy 183.46591 163.315719) (xy 183.471332 163.295479) - (xy 183.472019 163.292917) (xy 183.472019 163.194045) (xy 183.472019 156.060508) (xy 183.491704 155.993469) - (xy 183.513793 155.967692) (xy 183.587001 155.902837) (xy 183.587002 155.902836) (xy 183.676739 155.772829) - (xy 183.718842 155.661811) (xy 183.76102 155.606109) (xy 183.826617 155.582052) (xy 183.89241 155.595987) - (xy 183.9535 155.62805) (xy 184.10688 155.665854) (xy 184.106881 155.665854) (xy 184.264851 155.665854) - (xy 184.373243 155.639138) (xy 184.443043 155.642207) (xy 184.500105 155.682527) (xy 184.526012 155.744588) - (xy 184.535755 155.824827) (xy 184.567857 155.909473) (xy 184.591772 155.972531) (xy 184.681509 156.102538) - (xy 184.799752 156.207291) (xy 184.799754 156.207292) (xy 184.939626 156.280704) (xy 185.093006 156.318508) - (xy 185.093007 156.318508) (xy 185.250977 156.318508) (xy 185.404357 156.280704) (xy 185.544232 156.207291) - (xy 185.662475 156.102538) (xy 185.752212 155.972531) (xy 185.808229 155.824826) (xy 185.82727 155.668008) - (xy 185.827009 155.665854) (xy 185.808229 155.511189) (xy 185.775315 155.424404) (xy 185.752212 155.363485) - (xy 185.662475 155.233478) (xy 185.544232 155.128725) (xy 185.54423 155.128724) (xy 185.544229 155.128723) - (xy 185.404357 155.055311) (xy 185.250978 155.017508) (xy 185.250977 155.017508) (xy 185.093007 155.017508) - (xy 185.093006 155.017508) (xy 184.984615 155.044223) (xy 184.914813 155.041153) (xy 184.857751 155.000833) - (xy 184.831845 154.938772) (xy 184.831474 154.935715) (xy 184.822103 154.858536) (xy 184.766086 154.710831) - (xy 184.676349 154.580824) (xy 184.558106 154.476071) (xy 184.558104 154.47607) (xy 184.558103 154.476069) - (xy 184.418231 154.402657) (xy 184.264852 154.364854) (xy 184.264851 154.364854) (xy 184.106881 154.364854) - (xy 184.10688 154.364854) (xy 183.9535 154.402657) (xy 183.813628 154.476069) (xy 183.779874 154.505972) - (xy 183.697009 154.579384) (xy 183.695382 154.580825) (xy 183.605647 154.710828) (xy 183.563542 154.821848) - (xy 183.521363 154.877551) (xy 183.455765 154.901607) (xy 183.389974 154.887673) (xy 183.380802 154.882859) - (xy 183.328884 154.85561) (xy 183.328881 154.855609) (xy 183.175505 154.817806) (xy 183.175504 154.817806) - (xy 183.017534 154.817806) (xy 183.017533 154.817806) (xy 182.864153 154.855609) (xy 182.724281 154.929021) - (xy 182.606035 155.033777) (xy 182.5163 155.163781) (xy 182.516299 155.163782) (xy 182.460281 155.311487) - (xy 182.441241 155.468305) (xy 182.441241 155.468306) (xy 182.460281 155.625124) (xy 182.516299 155.772829) - (xy 182.5163 155.77283) (xy 182.606036 155.902837) (xy 182.679245 155.967692) (xy 182.716372 156.02688) - (xy 182.721019 156.060508) (xy 182.721019 158.944808) (xy 182.701334 159.011847) (xy 182.64853 159.057602) - (xy 182.579372 159.067546) (xy 182.515816 159.038521) (xy 182.480837 158.988141) (xy 182.478797 158.982672) - (xy 182.478796 158.982671) (xy 182.478796 158.98267) (xy 182.392546 158.867454) (xy 182.27733 158.781204) - (xy 182.277328 158.781203) (xy 182.277327 158.781202) (xy 182.142481 158.730908) (xy 182.142482 158.730908) - (xy 182.082882 158.724501) (xy 182.08288 158.7245) (xy 182.082872 158.7245) (xy 180.987128 158.7245) - (xy 180.98712 158.7245) (xy 180.987117 158.724501) (xy 180.927518 158.730908) (xy 180.792672 158.781202) - (xy 180.79267 158.781204) (xy 180.677454 158.867454) (xy 180.591204 158.98267) (xy 180.591202 158.982672) - (xy 180.540908 159.117518) (xy 180.534501 159.177117) (xy 180.5345 159.177136) (xy 180.5345 160.272863) - (xy 180.534501 160.272882) (xy 180.540908 160.332481) (xy 180.591202 160.467327) (xy 180.591203 160.467328) - (xy 180.591204 160.46733) (xy 180.677454 160.582546) (xy 180.79267 160.668796) (xy 180.792671 160.668796) - (xy 180.792672 160.668797) (xy 180.927518 160.719091) (xy 180.927517 160.719091) (xy 180.934445 160.719835) - (xy 180.987128 160.7255) (xy 180.987137 160.7255) (xy 182.082863 160.7255) (xy 182.082872 160.7255) - (xy 182.142482 160.719091) (xy 182.27733 160.668796) (xy 182.392546 160.582546) (xy 182.478796 160.46733) - (xy 182.480836 160.461861) (xy 182.522706 160.405926) (xy 182.58817 160.381507) (xy 182.656443 160.396357) - (xy 182.70585 160.445761) (xy 182.721019 160.505191) (xy 182.721019 162.352224) (xy 182.701334 162.419263) - (xy 182.64853 162.465018) (xy 182.579372 162.474962) (xy 182.515816 162.445937) (xy 182.478359 162.38822) - (xy 182.470015 162.360716) (xy 182.463814 162.340273) (xy 182.448281 162.311212) (xy 182.370913 162.166467) - (xy 182.370909 162.16646) (xy 182.245883 162.014116) (xy 182.093539 161.88909) (xy 182.093532 161.889086) - (xy 181.919733 161.796188) (xy 181.919727 161.796186) (xy 181.731132 161.738976) (xy 181.731129 161.738975) - (xy 181.535 161.719659) (xy 181.33887 161.738975) (xy 181.150266 161.796188) (xy 180.976467 161.889086) - (xy 180.97646 161.88909) (xy 180.824116 162.014116) (xy 180.69909 162.16646) (xy 180.699086 162.166467) - (xy 180.606188 162.340266) (xy 180.548975 162.52887) (xy 180.529659 162.725) (xy 180.548975 162.921129) - (xy 180.548976 162.921132) (xy 180.605692 163.1081) (xy 180.606188 163.109733) (xy 180.699086 163.283532) - (xy 180.69909 163.283539) (xy 180.824116 163.435883) (xy 180.97646 163.560909) (xy 180.976467 163.560913) - (xy 181.150266 163.653811) (xy 181.150269 163.653811) (xy 181.150273 163.653814) (xy 181.338868 163.711024) - (xy 181.535 163.730341) (xy 181.731132 163.711024) (xy 181.783939 163.695004) (xy 181.853805 163.69438) - (xy 181.912919 163.731628) (xy 181.94251 163.794922) (xy 181.933185 163.864167) (xy 181.907616 163.901346) - (xy 181.645782 164.163181) (xy 181.584459 164.196666) (xy 181.558101 164.1995) (xy 174.881899 164.1995) - (xy 174.81486 164.179815) (xy 174.769105 164.127011) (xy 174.759161 164.057853) (xy 174.777333 164.011482) - (xy 174.776733 164.011167) (xy 174.779592 164.005718) (xy 174.779852 164.005056) (xy 174.78022 164.004523) - (xy 174.836237 163.856818) (xy 174.855278 163.7) (xy 174.840383 163.577323) (xy 174.836237 163.543181) - (xy 174.800684 163.449436) (xy 174.78022 163.395477) (xy 174.690483 163.26547) (xy 174.57224 163.160717) - (xy 174.572238 163.160716) (xy 174.572237 163.160715) (xy 174.432366 163.087304) (xy 174.369825 163.071889) - (xy 174.309444 163.036732) (xy 174.277656 162.974513) (xy 174.2755 162.951492) (xy 174.2755 162.725) - (xy 177.529659 162.725) (xy 177.548975 162.921129) (xy 177.548976 162.921132) (xy 177.605692 163.1081) - (xy 177.606188 163.109733) (xy 177.699086 163.283532) (xy 177.69909 163.283539) (xy 177.824116 163.435883) - (xy 177.97646 163.560909) (xy 177.976467 163.560913) (xy 178.150266 163.653811) (xy 178.150269 163.653811) - (xy 178.150273 163.653814) (xy 178.338868 163.711024) (xy 178.535 163.730341) (xy 178.731132 163.711024) - (xy 178.919727 163.653814) (xy 179.093538 163.56091) (xy 179.245883 163.435883) (xy 179.37091 163.283538) - (xy 179.446971 163.141238) (xy 179.463811 163.109733) (xy 179.463811 163.109732) (xy 179.463814 163.109727) - (xy 179.521024 162.921132) (xy 179.540341 162.725) (xy 179.521024 162.528868) (xy 179.463814 162.340273) - (xy 179.463811 162.340269) (xy 179.463811 162.340266) (xy 179.370913 162.166467) (xy 179.370909 162.16646) - (xy 179.245883 162.014116) (xy 179.093539 161.88909) (xy 179.093532 161.889086) (xy 178.919733 161.796188) - (xy 178.919727 161.796186) (xy 178.731132 161.738976) (xy 178.731129 161.738975) (xy 178.535 161.719659) - (xy 178.33887 161.738975) (xy 178.150266 161.796188) (xy 177.976467 161.889086) (xy 177.97646 161.88909) - (xy 177.824116 162.014116) (xy 177.69909 162.16646) (xy 177.699086 162.166467) (xy 177.606188 162.340266) - (xy 177.548975 162.52887) (xy 177.529659 162.725) (xy 174.2755 162.725) (xy 174.2755 157.210882) - (xy 174.295185 157.143843) (xy 174.311814 157.123206) (xy 174.612821 156.822199) (xy 174.674142 156.788716) - (xy 174.743834 156.7937) (xy 174.799767 156.835572) (xy 174.824184 156.901036) (xy 174.8245 156.909882) - (xy 174.8245 159.207796) (xy 174.804815 159.274835) (xy 174.782727 159.300611) (xy 174.709518 159.365468) - (xy 174.619781 159.495475) (xy 174.61978 159.495476) (xy 174.563762 159.643181) (xy 174.544722 159.799999) - (xy 174.544722 159.8) (xy 174.563762 159.956818) (xy 174.608773 160.0755) (xy 174.61978 160.104523) - (xy 174.709517 160.23453) (xy 174.82776 160.339283) (xy 174.827762 160.339284) (xy 174.967634 160.412696) - (xy 175.121014 160.4505) (xy 175.121015 160.4505) (xy 175.278985 160.4505) (xy 175.334946 160.436707) - (xy 175.404747 160.439776) (xy 175.461809 160.480096) (xy 175.488015 160.544865) (xy 175.475043 160.61352) - (xy 175.46667 160.627543) (xy 175.419783 160.69547) (xy 175.41978 160.695476) (xy 175.363762 160.843181) - (xy 175.344722 160.999999) (xy 175.344722 161) (xy 175.363762 161.156818) (xy 175.395038 161.239284) - (xy 175.41978 161.304523) (xy 175.509517 161.43453) (xy 175.62776 161.539283) (xy 175.627762 161.539284) - (xy 175.767634 161.612696) (xy 175.921014 161.6505) (xy 175.921015 161.6505) (xy 176.078985 161.6505) - (xy 176.232365 161.612696) (xy 176.282429 161.58642) (xy 176.37224 161.539283) (xy 176.490483 161.43453) - (xy 176.58022 161.304523) (xy 176.636237 161.156818) (xy 176.655278 161) (xy 176.653737 160.987304) - (xy 176.636237 160.843181) (xy 176.610018 160.774048) (xy 176.58022 160.695477) (xy 176.490483 160.56547) - (xy 176.465325 160.543182) (xy 176.417273 160.500611) (xy 176.380146 160.441422) (xy 176.3755 160.407796) - (xy 176.3755 159.725) (xy 177.529659 159.725) (xy 177.548975 159.921129) (xy 177.548976 159.921132) - (xy 177.604607 160.104523) (xy 177.606188 160.109733) (xy 177.699086 160.283532) (xy 177.69909 160.283539) - (xy 177.824116 160.435883) (xy 177.97646 160.560909) (xy 177.976467 160.560913) (xy 178.150266 160.653811) - (xy 178.150269 160.653811) (xy 178.150273 160.653814) (xy 178.338868 160.711024) (xy 178.535 160.730341) - (xy 178.731132 160.711024) (xy 178.919727 160.653814) (xy 179.093538 160.56091) (xy 179.245883 160.435883) - (xy 179.37091 160.283538) (xy 179.463814 160.109727) (xy 179.521024 159.921132) (xy 179.540341 159.725) - (xy 179.521024 159.528868) (xy 179.463814 159.340273) (xy 179.463811 159.340269) (xy 179.463811 159.340266) - (xy 179.370913 159.166467) (xy 179.370909 159.16646) (xy 179.245883 159.014116) (xy 179.093539 158.88909) - (xy 179.093532 158.889086) (xy 178.919733 158.796188) (xy 178.919727 158.796186) (xy 178.74594 158.743468) - (xy 178.731129 158.738975) (xy 178.535 158.719659) (xy 178.33887 158.738975) (xy 178.150266 158.796188) - (xy 177.976467 158.889086) (xy 177.97646 158.88909) (xy 177.824116 159.014116) (xy 177.69909 159.16646) - (xy 177.699086 159.166467) (xy 177.606188 159.340266) (xy 177.548975 159.52887) (xy 177.529659 159.725) - (xy 176.3755 159.725) (xy 176.3755 157.27532) (xy 176.395185 157.208281) (xy 176.411819 157.187639) - (xy 176.538743 157.060715) (xy 176.670674 156.928783) (xy 176.731995 156.8953) (xy 176.801686 156.900284) - (xy 176.85762 156.942155) (xy 176.872914 156.969014) (xy 176.921049 157.085225) (xy 176.921056 157.085238) - (xy 177.00428 157.20979) (xy 177.004283 157.209794) (xy 177.110205 157.315716) (xy 177.110209 157.315719) - (xy 177.234761 157.398943) (xy 177.234767 157.398946) (xy 177.234768 157.398947) (xy 177.37317 157.456275) - (xy 177.520092 157.485499) (xy 177.520096 157.4855) (xy 177.520097 157.4855) (xy 177.669904 157.4855) - (xy 177.669905 157.485499) (xy 177.81683 157.456275) (xy 177.955232 157.398947) (xy 178.079791 157.315719) - (xy 178.185719 157.209791) (xy 178.268947 157.085232) (xy 178.326275 156.94683) (xy 178.3555 156.799903) - (xy 178.3555 156.650097) (xy 178.326275 156.50317) (xy 178.268947 156.364768) (xy 178.268946 156.364767) - (xy 178.268943 156.364761) (xy 178.185719 156.240209) (xy 178.185716 156.240205) (xy 178.079794 156.134283) - (xy 178.07979 156.13428) (xy 177.955238 156.051056) (xy 177.955225 156.051049) (xy 177.839014 156.002914) - (xy 177.78461 155.959073) (xy 177.762545 155.892779) (xy 177.779824 155.82508) (xy 177.798781 155.800676) - (xy 181.012638 152.586818) (xy 181.073961 152.553334) (xy 181.100319 152.5505) (xy 181.247406 152.5505) - (xy 181.351088 152.524945) (xy 181.420888 152.528014) (xy 181.465636 152.559633) (xy 181.477237 152.49824) - (xy 181.525267 152.447497) (xy 181.530018 152.444868) (xy 181.540661 152.439283) (xy 181.658904 152.33453) - (xy 181.748641 152.204523) (xy 181.804658 152.056818) (xy 181.823699 151.9) (xy 181.819296 151.863738) - (xy 181.830756 151.794815) (xy 181.87766 151.743029) (xy 181.945116 151.724822) (xy 182.011707 151.745974) - (xy 182.030073 151.761111) (xy 182.251446 151.982484) (xy 182.3239 152.024315) (xy 182.372114 152.07488) - (xy 182.385338 152.143487) (xy 182.35937 152.208352) (xy 182.34958 152.219382) (xy 181.955781 152.613181) - (xy 181.894458 152.646666) (xy 181.8681 152.6495) (xy 181.721014 152.6495) (xy 181.617333 152.675054) - (xy 181.547531 152.671984) (xy 181.502783 152.640365) (xy 181.491184 152.701758) (xy 181.443154 152.752501) - (xy 181.438392 152.755136) (xy 181.427762 152.760715) (xy 181.309516 152.865471) (xy 181.219781 152.995475) - (xy 181.21978 152.995476) (xy 181.163762 153.143181) (xy 181.144722 153.299999) (xy 181.144722 153.3) - (xy 181.163762 153.456818) (xy 181.193685 153.535717) (xy 181.21978 153.604523) (xy 181.309517 153.73453) - (xy 181.42776 153.839283) (xy 181.427762 153.839284) (xy 181.567634 153.912696) (xy 181.721014 153.9505) - (xy 181.721015 153.9505) (xy 181.878985 153.9505) (xy 182.032365 153.912696) (xy 182.067722 153.894139) - (xy 182.17224 153.839283) (xy 182.290483 153.73453) (xy 182.38022 153.604523) (xy 182.436237 153.456818) - (xy 182.455278 153.3) (xy 182.449102 153.249144) (xy 182.460561 153.180224) (xy 182.484514 153.146521) - (xy 182.919218 152.711819) (xy 182.980541 152.678334) (xy 183.006899 152.6755) (xy 189.552721 152.6755) - (xy 189.61976 152.695185) (xy 189.640402 152.711819) (xy 192.145291 155.216708) (xy 192.178776 155.278031) - (xy 192.180706 155.319333) (xy 192.174532 155.370187) (xy 192.174532 155.37019) (xy 192.193572 155.527008) - (xy 192.209924 155.570123) (xy 192.24959 155.674713) (xy 192.339327 155.80472) (xy 192.45757 155.909473) - (xy 192.457572 155.909474) (xy 192.597444 155.982886) (xy 192.750824 156.02069) (xy 192.750825 156.02069) - (xy 192.908795 156.02069) (xy 193.062175 155.982886) (xy 193.20205 155.909473) (xy 193.320293 155.80472) - (xy 193.41003 155.674713) (xy 193.466047 155.527008) (xy 193.485088 155.37019) (xy 193.468489 155.233479) - (xy 193.466047 155.213371) (xy 193.428071 155.113238) (xy 193.41003 155.065667) (xy 193.320293 154.93566) - (xy 193.20205 154.830907) (xy 193.202048 154.830906) (xy 193.202047 154.830905) (xy 193.062175 154.757493) - (xy 192.908796 154.71969) (xy 192.908795 154.71969) (xy 192.761709 154.71969) (xy 192.69467 154.700005) - (xy 192.674028 154.683371) (xy 190.259847 152.26919) (xy 190.226362 152.207867) (xy 190.231346 152.138175) - (xy 190.273218 152.082242) (xy 190.338682 152.057825) (xy 190.347528 152.057509) (xy 192.221683 152.057509) - (xy 192.288722 152.077194) (xy 192.323733 152.11107) (xy 192.326154 152.114578) (xy 192.327506 152.116537) - (xy 192.327508 152.116539) (xy 192.445751 152.221292) (xy 192.445753 152.221293) (xy 192.585625 152.294705) - (xy 192.739005 152.332509) (xy 192.739006 152.332509) (xy 192.896976 152.332509) (xy 193.050356 152.294705) - (xy 193.081159 152.278538) (xy 193.190231 152.221292) (xy 193.308474 152.116539) (xy 193.398211 151.986532) - (xy 193.454228 151.838827) (xy 193.473269 151.682009) (xy 193.454881 151.530564) (xy 193.454228 151.52519) - (xy 193.425522 151.4495) (xy 193.398211 151.377486) (xy 193.308474 151.247479) (xy 193.190231 151.142726) - (xy 193.190229 151.142725) (xy 193.190228 151.142724) (xy 193.050356 151.069312) (xy 192.896977 151.031509) - (xy 192.896976 151.031509) (xy 192.739006 151.031509) (xy 192.739005 151.031509) (xy 192.585625 151.069312) - (xy 192.445753 151.142724) (xy 192.327507 151.247479) (xy 192.326331 151.249184) (xy 192.323733 151.252947) - (xy 192.269454 151.296938) (xy 192.221683 151.306509) (xy 182.688909 151.306509) (xy 182.62187 151.286824) - (xy 182.601228 151.27019) (xy 177.911819 146.580781) (xy 177.878334 146.519458) (xy 177.8755 146.4931) - (xy 177.8755 143.689492) (xy 177.895185 143.622453) (xy 177.947989 143.576698) (xy 178.017147 143.566754) - (xy 178.057126 143.579696) (xy 178.167634 143.637696) (xy 178.321014 143.6755) (xy 178.321015 143.6755) - (xy 178.478985 143.6755) (xy 178.632365 143.637696) (xy 178.661408 143.622453) (xy 178.77224 143.564283) - (xy 178.890483 143.45953) (xy 178.98022 143.329523) (xy 179.036237 143.181818) (xy 179.038841 143.16037) - (xy 179.054118 143.034554) (xy 179.08174 142.970376) (xy 179.139674 142.931319) (xy 179.177214 142.9255) - (xy 185.953426 142.9255) + (xy 186.032365 160.312696) (xy 186.17224 160.239283) (xy 186.290483 160.13453) (xy 186.294257 160.129061) + (xy 186.348537 160.085071) (xy 186.396308 160.0755) (xy 192.703692 160.0755) (xy 192.770731 160.095185) + (xy 192.805742 160.129061) (xy 192.808163 160.132569) (xy 192.809515 160.134528) (xy 192.809517 160.13453) + (xy 192.92776 160.239283) (xy 192.927762 160.239284) (xy 193.067634 160.312696) (xy 193.221014 160.3505) + (xy 193.221015 160.3505) (xy 193.378985 160.3505) (xy 193.532365 160.312696) (xy 193.67224 160.239283) + (xy 193.790483 160.13453) (xy 193.88022 160.004523) (xy 193.936237 159.856818) (xy 193.955278 159.7) + (xy 193.936237 159.543182) (xy 193.931214 159.529939) (xy 193.925846 159.460278) (xy 193.958993 159.398771) + (xy 194.02013 159.364948) (xy 194.089848 159.369548) (xy 194.134837 159.398286) (xy 195.449276 160.712725) + (xy 195.482761 160.774048) (xy 195.484691 160.81535) (xy 195.478517 160.866204) (xy 195.478517 160.866207) + (xy 195.497557 161.023025) (xy 195.539845 161.134528) (xy 195.553575 161.17073) (xy 195.643312 161.300737) + (xy 195.761555 161.40549) (xy 195.761557 161.405491) (xy 195.901429 161.478903) (xy 195.919087 161.483255) + (xy 195.942588 161.489047) (xy 196.002969 161.524201) (xy 196.034759 161.58642) (xy 196.027864 161.655949) + (xy 196.012681 161.680463) (xy 196.01378 161.681222) (xy 196.009517 161.687397) (xy 196.009517 161.687398) + (xy 196.005742 161.692866) (xy 195.951463 161.736857) (xy 195.903692 161.746428) (xy 186.227508 161.746428) + (xy 186.128636 161.746428) (xy 186.033135 161.772017) (xy 186.033134 161.772017) (xy 186.033132 161.772018) + (xy 186.033129 161.772019) (xy 185.947514 161.82145) (xy 185.944352 161.823877) (xy 185.941203 161.825093) + (xy 185.940473 161.825516) (xy 185.940407 161.825401) (xy 185.879183 161.84907) (xy 185.868867 161.8495) + (xy 185.721014 161.8495) (xy 185.567634 161.887303) (xy 185.427762 161.960715) (xy 185.309516 162.065471) + (xy 185.219781 162.195475) (xy 185.21978 162.195476) (xy 185.163762 162.343181) (xy 185.144722 162.499999) + (xy 185.144722 162.5) (xy 185.163762 162.656818) (xy 185.215142 162.792294) (xy 185.21978 162.804523) + (xy 185.309517 162.93453) (xy 185.42776 163.039283) (xy 185.427762 163.039284) (xy 185.567634 163.112696) + (xy 185.721014 163.1505) (xy 185.721015 163.1505) (xy 185.878985 163.1505) (xy 186.039649 163.110901) + (xy 186.040097 163.112721) (xy 186.099964 163.1081) (xy 186.161476 163.141238) (xy 186.195306 163.202371) + (xy 186.190716 163.27209) (xy 186.190233 163.273383) (xy 186.163763 163.343178) (xy 186.163763 163.34318) + (xy 186.144722 163.499999) (xy 186.144722 163.5) (xy 186.163762 163.656818) (xy 186.216052 163.794694) + (xy 186.21978 163.804523) (xy 186.309517 163.93453) (xy 186.42776 164.039283) (xy 186.427762 164.039284) + (xy 186.567634 164.112696) (xy 186.721014 164.1505) (xy 186.721015 164.1505) (xy 186.878985 164.1505) + (xy 187.032365 164.112696) (xy 187.03717 164.110174) (xy 187.17224 164.039283) (xy 187.290483 163.93453) + (xy 187.38022 163.804523) (xy 187.436237 163.656818) (xy 187.445889 163.577321) (xy 187.47351 163.513145) + (xy 187.531444 163.474088) (xy 187.568985 163.468269) (xy 196.303658 163.468269) (xy 196.370697 163.487954) + (xy 196.405708 163.52183) (xy 196.409483 163.527299) (xy 196.527726 163.632052) (xy 196.527728 163.632053) + (xy 196.6676 163.705465) (xy 196.82098 163.743269) (xy 196.820981 163.743269) (xy 196.978951 163.743269) + (xy 197.139615 163.70367) (xy 197.139974 163.705129) (xy 197.201152 163.700413) (xy 197.26266 163.733558) + (xy 197.296484 163.794694) (xy 197.299466 163.821724) (xy 197.299466 165.278774) (xy 197.279781 165.345813) + (xy 197.226977 165.391568) (xy 197.157819 165.401512) (xy 197.094263 165.372487) (xy 197.059524 165.322746) + (xy 197.058266 165.319429) (xy 197.03022 165.245477) (xy 196.940483 165.11547) (xy 196.82224 165.010717) + (xy 196.822238 165.010716) (xy 196.822237 165.010715) (xy 196.682365 164.937303) (xy 196.528986 164.8995) + (xy 196.528985 164.8995) (xy 196.371015 164.8995) (xy 196.371014 164.8995) (xy 196.217634 164.937303) + (xy 196.077762 165.010715) (xy 195.959516 165.115471) (xy 195.869781 165.245475) (xy 195.86978 165.245476) + (xy 195.813762 165.393181) (xy 195.794722 165.549999) (xy 195.794722 165.55) (xy 195.813762 165.706818) + (xy 195.86978 165.854523) (xy 195.959517 165.98453) (xy 196.07776 166.089283) (xy 196.077762 166.089284) + (xy 196.217634 166.162696) (xy 196.371014 166.2005) (xy 196.518101 166.2005) (xy 196.58514 166.220185) + (xy 196.605782 166.236819) (xy 198.138181 167.769218) (xy 198.171666 167.830541) (xy 198.1745 167.856899) + (xy 198.1745 169.876) (xy 198.154815 169.943039) (xy 198.102011 169.988794) (xy 198.0505 170) (xy 191.417789 170) + (xy 191.35075 169.980315) (xy 191.304995 169.927511) (xy 191.295051 169.858353) (xy 191.324076 169.794797) + (xy 191.335563 169.783184) (xy 191.390482 169.734531) (xy 191.390483 169.73453) (xy 191.48022 169.604523) + (xy 191.536237 169.456818) (xy 191.555278 169.3) (xy 191.544678 169.212696) (xy 191.536237 169.143181) + (xy 191.514262 169.085238) (xy 191.48022 168.995477) (xy 191.390483 168.86547) (xy 191.27224 168.760717) + (xy 191.272238 168.760716) (xy 191.272237 168.760715) (xy 191.132365 168.687303) (xy 190.978986 168.6495) + (xy 190.978985 168.6495) (xy 190.821015 168.6495) (xy 190.821014 168.6495) (xy 190.667634 168.687303) + (xy 190.527762 168.760715) (xy 190.409516 168.865471) (xy 190.319781 168.995475) (xy 190.31978 168.995476) + (xy 190.263762 169.143181) (xy 190.244722 169.299999) (xy 190.244722 169.3) (xy 190.263762 169.456818) + (xy 190.31978 169.604523) (xy 190.319781 169.604524) (xy 190.409517 169.734531) (xy 190.464437 169.783184) + (xy 190.501564 169.842373) (xy 190.500798 169.912238) (xy 190.462381 169.970598) (xy 190.39851 169.998924) + (xy 190.382211 170) (xy 189.61779 170) (xy 189.550751 169.980315) (xy 189.504996 169.927511) (xy 189.495052 169.858353) + (xy 189.524077 169.794797) (xy 189.535563 169.783184) (xy 189.590483 169.73453) (xy 189.68022 169.604523) + (xy 189.736237 169.456818) (xy 189.755278 169.3) (xy 189.744678 169.212696) (xy 189.736237 169.143181) + (xy 189.714262 169.085238) (xy 189.68022 168.995477) (xy 189.590483 168.86547) (xy 189.47224 168.760717) + (xy 189.472238 168.760716) (xy 189.472237 168.760715) (xy 189.332365 168.687303) (xy 189.178986 168.6495) + (xy 189.178985 168.6495) (xy 189.021015 168.6495) (xy 189.021014 168.6495) (xy 188.867634 168.687303) + (xy 188.727762 168.760715) (xy 188.609516 168.865471) (xy 188.519781 168.995475) (xy 188.51978 168.995476) + (xy 188.463762 169.143181) (xy 188.444722 169.299999) (xy 188.444722 169.300001) (xy 188.450896 169.350854) + (xy 188.439435 169.419777) (xy 188.415481 169.45348) (xy 188.264439 169.604523) (xy 187.941452 169.927511) + (xy 187.905282 169.963681) (xy 187.843959 169.997166) (xy 187.817601 170) (xy 187.0304 170) (xy 186.963361 169.980315) + (xy 186.917606 169.927511) (xy 186.907662 169.858353) (xy 186.936687 169.794797) (xy 186.942719 169.788319) + (xy 188.669219 168.061819) (xy 188.730542 168.028334) (xy 188.7569 168.0255) (xy 189.603696 168.0255) + (xy 189.670735 168.045185) (xy 189.705746 168.079061) (xy 189.708167 168.082569) (xy 189.709519 168.084528) + (xy 189.709521 168.08453) (xy 189.827764 168.189283) (xy 189.827766 168.189284) (xy 189.967638 168.262696) + (xy 190.121018 168.3005) (xy 190.121019 168.3005) (xy 190.278989 168.3005) (xy 190.432369 168.262696) + (xy 190.475301 168.240163) (xy 190.572244 168.189283) (xy 190.690487 168.08453) (xy 190.780224 167.954523) + (xy 190.836241 167.806818) (xy 190.855282 167.65) (xy 190.837684 167.505062) (xy 190.836241 167.493181) + (xy 190.808274 167.419438) (xy 190.780224 167.345477) (xy 190.690487 167.21547) (xy 190.572244 167.110717) + (xy 190.572242 167.110716) (xy 190.572241 167.110715) (xy 190.432369 167.037303) (xy 190.27899 166.9995) + (xy 190.278989 166.9995) (xy 190.121019 166.9995) (xy 190.121018 166.9995) (xy 189.967638 167.037303) + (xy 189.827766 167.110715) (xy 189.70952 167.21547) (xy 189.707093 167.218987) (xy 189.705746 167.220938) + (xy 189.651467 167.264929) (xy 189.603696 167.2745) (xy 188.500564 167.2745) (xy 188.452812 167.287295) + (xy 188.452811 167.287294) (xy 188.405066 167.300088) (xy 188.405059 167.300091) (xy 188.381126 167.313908) + (xy 188.36225 167.324807) (xy 188.351546 167.330986) (xy 188.31944 167.349522) (xy 188.319435 167.349526) + (xy 185.705281 169.963681) (xy 185.643958 169.997166) (xy 185.6176 170) (xy 174.6995 170) (xy 174.632461 169.980315) + (xy 174.586706 169.927511) (xy 174.5755 169.876) (xy 174.5755 168.650092) (xy 176.8345 168.650092) + (xy 176.8345 168.799907) (xy 176.863723 168.946822) (xy 176.863725 168.94683) (xy 176.921051 169.085229) + (xy 176.921056 169.085238) (xy 177.00428 169.20979) (xy 177.004283 169.209794) (xy 177.110205 169.315716) + (xy 177.110209 169.315719) (xy 177.234761 169.398943) (xy 177.234767 169.398946) (xy 177.234768 169.398947) + (xy 177.37317 169.456275) (xy 177.520092 169.485499) (xy 177.520096 169.4855) (xy 177.520097 169.4855) + (xy 177.669904 169.4855) (xy 177.669905 169.485499) (xy 177.81683 169.456275) (xy 177.955232 169.398947) + (xy 178.079791 169.315719) (xy 178.185719 169.209791) (xy 178.268947 169.085232) (xy 178.326275 168.94683) + (xy 178.3555 168.799903) (xy 178.3555 168.650097) (xy 178.326275 168.50317) (xy 178.268947 168.364768) + (xy 178.268946 168.364767) (xy 178.268943 168.364761) (xy 178.185719 168.240209) (xy 178.185716 168.240205) + (xy 178.079794 168.134283) (xy 178.07979 168.13428) (xy 177.955238 168.051056) (xy 177.955229 168.051051) + (xy 177.81683 167.993725) (xy 177.816822 167.993723) (xy 177.669907 167.9645) (xy 177.669903 167.9645) + (xy 177.520097 167.9645) (xy 177.520092 167.9645) (xy 177.373177 167.993723) (xy 177.373169 167.993725) + (xy 177.23477 168.051051) (xy 177.234761 168.051056) (xy 177.110209 168.13428) (xy 177.110205 168.134283) + (xy 177.004283 168.240205) (xy 177.00428 168.240209) (xy 176.921056 168.364761) (xy 176.921051 168.36477) + (xy 176.863725 168.503169) (xy 176.863723 168.503177) (xy 176.8345 168.650092) (xy 174.5755 168.650092) + (xy 174.5755 165.892202) (xy 174.595185 165.825163) (xy 174.617274 165.799386) (xy 174.690482 165.734531) + (xy 174.709611 165.706818) (xy 174.78022 165.604523) (xy 174.836237 165.456818) (xy 174.855278 165.3) + (xy 174.836237 165.143182) (xy 174.836236 165.143179) (xy 174.836236 165.143178) (xy 174.826866 165.11847) + (xy 174.821499 165.048807) (xy 174.854647 164.987301) (xy 174.915786 164.95348) (xy 174.942808 164.9505) + (xy 177.614149 164.9505) (xy 177.681188 164.970185) (xy 177.726943 165.022989) (xy 177.736887 165.092147) + (xy 177.710003 165.153164) (xy 177.69909 165.166461) (xy 177.699086 165.166467) (xy 177.606188 165.340266) + (xy 177.548975 165.52887) (xy 177.529659 165.725) (xy 177.548975 165.921129) (xy 177.606188 166.109733) + (xy 177.699086 166.283532) (xy 177.69909 166.283539) (xy 177.824116 166.435883) (xy 177.97646 166.560909) + (xy 177.976467 166.560913) (xy 178.150266 166.653811) (xy 178.150269 166.653811) (xy 178.150273 166.653814) + (xy 178.338868 166.711024) (xy 178.535 166.730341) (xy 178.731132 166.711024) (xy 178.919727 166.653814) + (xy 179.093538 166.56091) (xy 179.245883 166.435883) (xy 179.37091 166.283538) (xy 179.419573 166.192496) + (xy 179.463811 166.109733) (xy 179.463811 166.109732) (xy 179.463814 166.109727) (xy 179.521024 165.921132) + (xy 179.540341 165.725) (xy 179.521024 165.528868) (xy 179.463814 165.340273) (xy 179.463811 165.340269) + (xy 179.463811 165.340266) (xy 179.370913 165.166467) (xy 179.370909 165.166461) (xy 179.359997 165.153164) + (xy 179.332685 165.088854) (xy 179.344476 165.019987) (xy 179.391629 164.968427) (xy 179.455851 164.9505) + (xy 180.614149 164.9505) (xy 180.681188 164.970185) (xy 180.726943 165.022989) (xy 180.736887 165.092147) + (xy 180.710003 165.153164) (xy 180.69909 165.166461) (xy 180.699086 165.166467) (xy 180.606188 165.340266) + (xy 180.548975 165.52887) (xy 180.529659 165.725) (xy 180.548975 165.921129) (xy 180.606188 166.109733) + (xy 180.699086 166.283532) (xy 180.69909 166.283539) (xy 180.824116 166.435883) (xy 180.97646 166.560909) + (xy 180.976467 166.560913) (xy 181.150266 166.653811) (xy 181.150269 166.653811) (xy 181.150273 166.653814) + (xy 181.338868 166.711024) (xy 181.535 166.730341) (xy 181.731132 166.711024) (xy 181.919727 166.653814) + (xy 182.093538 166.56091) (xy 182.245883 166.435883) (xy 182.37091 166.283538) (xy 182.419573 166.192496) + (xy 182.463811 166.109733) (xy 182.463811 166.109732) (xy 182.463814 166.109727) (xy 182.521024 165.921132) + (xy 182.540341 165.725) (xy 182.521024 165.528868) (xy 182.463814 165.340273) (xy 182.463811 165.340269) + (xy 182.463811 165.340266) (xy 182.370913 165.166467) (xy 182.370909 165.16646) (xy 182.245883 165.014116) + (xy 182.138005 164.925582) (xy 182.098671 164.867836) (xy 182.0968 164.797991) (xy 182.128989 164.742048) + (xy 182.760863 164.110174) (xy 183.396993 163.474044) (xy 183.396994 163.474043) (xy 183.446429 163.388419) + (xy 183.45137 163.369979) (xy 183.46591 163.315719) (xy 183.471332 163.295479) (xy 183.472019 163.292917) + (xy 183.472019 163.194045) (xy 183.472019 156.060508) (xy 183.491704 155.993469) (xy 183.513793 155.967692) + (xy 183.587001 155.902837) (xy 183.587002 155.902836) (xy 183.676739 155.772829) (xy 183.718842 155.661811) + (xy 183.76102 155.606109) (xy 183.826617 155.582052) (xy 183.89241 155.595987) (xy 183.9535 155.62805) + (xy 184.10688 155.665854) (xy 184.106881 155.665854) (xy 184.264851 155.665854) (xy 184.373243 155.639138) + (xy 184.443043 155.642207) (xy 184.500105 155.682527) (xy 184.526012 155.744588) (xy 184.535755 155.824827) + (xy 184.567857 155.909473) (xy 184.591772 155.972531) (xy 184.681509 156.102538) (xy 184.799752 156.207291) + (xy 184.799754 156.207292) (xy 184.939626 156.280704) (xy 185.093006 156.318508) (xy 185.093007 156.318508) + (xy 185.250977 156.318508) (xy 185.404357 156.280704) (xy 185.544232 156.207291) (xy 185.662475 156.102538) + (xy 185.752212 155.972531) (xy 185.808229 155.824826) (xy 185.82727 155.668008) (xy 185.827009 155.665854) + (xy 185.808229 155.511189) (xy 185.775315 155.424404) (xy 185.752212 155.363485) (xy 185.662475 155.233478) + (xy 185.544232 155.128725) (xy 185.54423 155.128724) (xy 185.544229 155.128723) (xy 185.404357 155.055311) + (xy 185.250978 155.017508) (xy 185.250977 155.017508) (xy 185.093007 155.017508) (xy 185.093006 155.017508) + (xy 184.984615 155.044223) (xy 184.914813 155.041153) (xy 184.857751 155.000833) (xy 184.831845 154.938772) + (xy 184.831474 154.935715) (xy 184.822103 154.858536) (xy 184.766086 154.710831) (xy 184.676349 154.580824) + (xy 184.558106 154.476071) (xy 184.558104 154.47607) (xy 184.558103 154.476069) (xy 184.418231 154.402657) + (xy 184.264852 154.364854) (xy 184.264851 154.364854) (xy 184.106881 154.364854) (xy 184.10688 154.364854) + (xy 183.9535 154.402657) (xy 183.813628 154.476069) (xy 183.779874 154.505972) (xy 183.697009 154.579384) + (xy 183.695382 154.580825) (xy 183.605647 154.710828) (xy 183.563542 154.821848) (xy 183.521363 154.877551) + (xy 183.455765 154.901607) (xy 183.389974 154.887673) (xy 183.380802 154.882859) (xy 183.328884 154.85561) + (xy 183.328881 154.855609) (xy 183.175505 154.817806) (xy 183.175504 154.817806) (xy 183.017534 154.817806) + (xy 183.017533 154.817806) (xy 182.864153 154.855609) (xy 182.724281 154.929021) (xy 182.606035 155.033777) + (xy 182.5163 155.163781) (xy 182.516299 155.163782) (xy 182.460281 155.311487) (xy 182.441241 155.468305) + (xy 182.441241 155.468306) (xy 182.460281 155.625124) (xy 182.516299 155.772829) (xy 182.5163 155.77283) + (xy 182.606036 155.902837) (xy 182.679245 155.967692) (xy 182.716372 156.02688) (xy 182.721019 156.060508) + (xy 182.721019 158.944808) (xy 182.701334 159.011847) (xy 182.64853 159.057602) (xy 182.579372 159.067546) + (xy 182.515816 159.038521) (xy 182.480837 158.988141) (xy 182.478797 158.982672) (xy 182.478796 158.982671) + (xy 182.478796 158.98267) (xy 182.392546 158.867454) (xy 182.27733 158.781204) (xy 182.277328 158.781203) + (xy 182.277327 158.781202) (xy 182.142481 158.730908) (xy 182.142482 158.730908) (xy 182.082882 158.724501) + (xy 182.08288 158.7245) (xy 182.082872 158.7245) (xy 180.987128 158.7245) (xy 180.98712 158.7245) + (xy 180.987117 158.724501) (xy 180.927518 158.730908) (xy 180.792672 158.781202) (xy 180.79267 158.781204) + (xy 180.677454 158.867454) (xy 180.591204 158.98267) (xy 180.591202 158.982672) (xy 180.540908 159.117518) + (xy 180.534501 159.177117) (xy 180.5345 159.177136) (xy 180.5345 160.272863) (xy 180.534501 160.272882) + (xy 180.540908 160.332481) (xy 180.591202 160.467327) (xy 180.591203 160.467328) (xy 180.591204 160.46733) + (xy 180.677454 160.582546) (xy 180.79267 160.668796) (xy 180.792671 160.668796) (xy 180.792672 160.668797) + (xy 180.927518 160.719091) (xy 180.927517 160.719091) (xy 180.934445 160.719835) (xy 180.987128 160.7255) + (xy 180.987137 160.7255) (xy 182.082863 160.7255) (xy 182.082872 160.7255) (xy 182.142482 160.719091) + (xy 182.27733 160.668796) (xy 182.392546 160.582546) (xy 182.478796 160.46733) (xy 182.480836 160.461861) + (xy 182.522706 160.405926) (xy 182.58817 160.381507) (xy 182.656443 160.396357) (xy 182.70585 160.445761) + (xy 182.721019 160.505191) (xy 182.721019 162.352224) (xy 182.701334 162.419263) (xy 182.64853 162.465018) + (xy 182.579372 162.474962) (xy 182.515816 162.445937) (xy 182.478359 162.38822) (xy 182.470015 162.360716) + (xy 182.463814 162.340273) (xy 182.448281 162.311212) (xy 182.370913 162.166467) (xy 182.370909 162.16646) + (xy 182.245883 162.014116) (xy 182.093539 161.88909) (xy 182.093532 161.889086) (xy 181.919733 161.796188) + (xy 181.919727 161.796186) (xy 181.731132 161.738976) (xy 181.731129 161.738975) (xy 181.535 161.719659) + (xy 181.33887 161.738975) (xy 181.150266 161.796188) (xy 180.976467 161.889086) (xy 180.97646 161.88909) + (xy 180.824116 162.014116) (xy 180.69909 162.16646) (xy 180.699086 162.166467) (xy 180.606188 162.340266) + (xy 180.548975 162.52887) (xy 180.529659 162.725) (xy 180.548975 162.921129) (xy 180.548976 162.921132) + (xy 180.605692 163.1081) (xy 180.606188 163.109733) (xy 180.699086 163.283532) (xy 180.69909 163.283539) + (xy 180.824116 163.435883) (xy 180.97646 163.560909) (xy 180.976467 163.560913) (xy 181.150266 163.653811) + (xy 181.150269 163.653811) (xy 181.150273 163.653814) (xy 181.338868 163.711024) (xy 181.535 163.730341) + (xy 181.731132 163.711024) (xy 181.783939 163.695004) (xy 181.853805 163.69438) (xy 181.912919 163.731628) + (xy 181.94251 163.794922) (xy 181.933185 163.864167) (xy 181.907616 163.901346) (xy 181.645782 164.163181) + (xy 181.584459 164.196666) (xy 181.558101 164.1995) (xy 174.881899 164.1995) (xy 174.81486 164.179815) + (xy 174.769105 164.127011) (xy 174.759161 164.057853) (xy 174.777333 164.011482) (xy 174.776733 164.011167) + (xy 174.779592 164.005718) (xy 174.779852 164.005056) (xy 174.78022 164.004523) (xy 174.836237 163.856818) + (xy 174.855278 163.7) (xy 174.840383 163.577323) (xy 174.836237 163.543181) (xy 174.800684 163.449436) + (xy 174.78022 163.395477) (xy 174.690483 163.26547) (xy 174.57224 163.160717) (xy 174.572238 163.160716) + (xy 174.572237 163.160715) (xy 174.432366 163.087304) (xy 174.369825 163.071889) (xy 174.309444 163.036732) + (xy 174.277656 162.974513) (xy 174.2755 162.951492) (xy 174.2755 162.725) (xy 177.529659 162.725) + (xy 177.548975 162.921129) (xy 177.548976 162.921132) (xy 177.605692 163.1081) (xy 177.606188 163.109733) + (xy 177.699086 163.283532) (xy 177.69909 163.283539) (xy 177.824116 163.435883) (xy 177.97646 163.560909) + (xy 177.976467 163.560913) (xy 178.150266 163.653811) (xy 178.150269 163.653811) (xy 178.150273 163.653814) + (xy 178.338868 163.711024) (xy 178.535 163.730341) (xy 178.731132 163.711024) (xy 178.919727 163.653814) + (xy 179.093538 163.56091) (xy 179.245883 163.435883) (xy 179.37091 163.283538) (xy 179.446971 163.141238) + (xy 179.463811 163.109733) (xy 179.463811 163.109732) (xy 179.463814 163.109727) (xy 179.521024 162.921132) + (xy 179.540341 162.725) (xy 179.521024 162.528868) (xy 179.463814 162.340273) (xy 179.463811 162.340269) + (xy 179.463811 162.340266) (xy 179.370913 162.166467) (xy 179.370909 162.16646) (xy 179.245883 162.014116) + (xy 179.093539 161.88909) (xy 179.093532 161.889086) (xy 178.919733 161.796188) (xy 178.919727 161.796186) + (xy 178.731132 161.738976) (xy 178.731129 161.738975) (xy 178.535 161.719659) (xy 178.33887 161.738975) + (xy 178.150266 161.796188) (xy 177.976467 161.889086) (xy 177.97646 161.88909) (xy 177.824116 162.014116) + (xy 177.69909 162.16646) (xy 177.699086 162.166467) (xy 177.606188 162.340266) (xy 177.548975 162.52887) + (xy 177.529659 162.725) (xy 174.2755 162.725) (xy 174.2755 157.210882) (xy 174.295185 157.143843) + (xy 174.311814 157.123206) (xy 174.612821 156.822199) (xy 174.674142 156.788716) (xy 174.743834 156.7937) + (xy 174.799767 156.835572) (xy 174.824184 156.901036) (xy 174.8245 156.909882) (xy 174.8245 159.207796) + (xy 174.804815 159.274835) (xy 174.782727 159.300611) (xy 174.709518 159.365468) (xy 174.619781 159.495475) + (xy 174.61978 159.495476) (xy 174.563762 159.643181) (xy 174.544722 159.799999) (xy 174.544722 159.8) + (xy 174.563762 159.956818) (xy 174.608773 160.0755) (xy 174.61978 160.104523) (xy 174.709517 160.23453) + (xy 174.82776 160.339283) (xy 174.827762 160.339284) (xy 174.967634 160.412696) (xy 175.121014 160.4505) + (xy 175.121015 160.4505) (xy 175.278985 160.4505) (xy 175.334946 160.436707) (xy 175.404747 160.439776) + (xy 175.461809 160.480096) (xy 175.488015 160.544865) (xy 175.475043 160.61352) (xy 175.46667 160.627543) + (xy 175.419783 160.69547) (xy 175.41978 160.695476) (xy 175.363762 160.843181) (xy 175.344722 160.999999) + (xy 175.344722 161) (xy 175.363762 161.156818) (xy 175.395038 161.239284) (xy 175.41978 161.304523) + (xy 175.509517 161.43453) (xy 175.62776 161.539283) (xy 175.627762 161.539284) (xy 175.767634 161.612696) + (xy 175.921014 161.6505) (xy 175.921015 161.6505) (xy 176.078985 161.6505) (xy 176.232365 161.612696) + (xy 176.282429 161.58642) (xy 176.37224 161.539283) (xy 176.490483 161.43453) (xy 176.58022 161.304523) + (xy 176.636237 161.156818) (xy 176.655278 161) (xy 176.653737 160.987304) (xy 176.636237 160.843181) + (xy 176.610018 160.774048) (xy 176.58022 160.695477) (xy 176.490483 160.56547) (xy 176.465324 160.543181) + (xy 176.417273 160.500611) (xy 176.380146 160.441422) (xy 176.3755 160.407796) (xy 176.3755 159.725) + (xy 177.529659 159.725) (xy 177.548975 159.921129) (xy 177.559801 159.956818) (xy 177.604607 160.104523) + (xy 177.606188 160.109733) (xy 177.699086 160.283532) (xy 177.69909 160.283539) (xy 177.824116 160.435883) + (xy 177.97646 160.560909) (xy 177.976467 160.560913) (xy 178.150266 160.653811) (xy 178.150269 160.653811) + (xy 178.150273 160.653814) (xy 178.338868 160.711024) (xy 178.535 160.730341) (xy 178.731132 160.711024) + (xy 178.919727 160.653814) (xy 179.093538 160.56091) (xy 179.245883 160.435883) (xy 179.37091 160.283538) + (xy 179.463814 160.109727) (xy 179.521024 159.921132) (xy 179.540341 159.725) (xy 179.521024 159.528868) + (xy 179.463814 159.340273) (xy 179.463811 159.340269) (xy 179.463811 159.340266) (xy 179.370913 159.166467) + (xy 179.370909 159.16646) (xy 179.245883 159.014116) (xy 179.093539 158.88909) (xy 179.093532 158.889086) + (xy 178.919733 158.796188) (xy 178.919727 158.796186) (xy 178.74594 158.743468) (xy 178.731129 158.738975) + (xy 178.535 158.719659) (xy 178.33887 158.738975) (xy 178.150266 158.796188) (xy 177.976467 158.889086) + (xy 177.97646 158.88909) (xy 177.824116 159.014116) (xy 177.69909 159.16646) (xy 177.699086 159.166467) + (xy 177.606188 159.340266) (xy 177.548975 159.52887) (xy 177.529659 159.725) (xy 176.3755 159.725) + (xy 176.3755 157.27532) (xy 176.395185 157.208281) (xy 176.411819 157.187639) (xy 176.538743 157.060715) + (xy 176.670674 156.928783) (xy 176.731995 156.8953) (xy 176.801686 156.900284) (xy 176.85762 156.942155) + (xy 176.872914 156.969014) (xy 176.921049 157.085225) (xy 176.921056 157.085238) (xy 177.00428 157.20979) + (xy 177.004283 157.209794) (xy 177.110205 157.315716) (xy 177.110209 157.315719) (xy 177.234761 157.398943) + (xy 177.234767 157.398946) (xy 177.234768 157.398947) (xy 177.37317 157.456275) (xy 177.520092 157.485499) + (xy 177.520096 157.4855) (xy 177.520097 157.4855) (xy 177.669904 157.4855) (xy 177.669905 157.485499) + (xy 177.81683 157.456275) (xy 177.955232 157.398947) (xy 178.079791 157.315719) (xy 178.185719 157.209791) + (xy 178.268947 157.085232) (xy 178.326275 156.94683) (xy 178.3555 156.799903) (xy 178.3555 156.650097) + (xy 178.326275 156.50317) (xy 178.268947 156.364768) (xy 178.268946 156.364767) (xy 178.268943 156.364761) + (xy 178.185719 156.240209) (xy 178.185716 156.240205) (xy 178.079794 156.134283) (xy 178.07979 156.13428) + (xy 177.955238 156.051056) (xy 177.955225 156.051049) (xy 177.839014 156.002914) (xy 177.78461 155.959073) + (xy 177.762545 155.892779) (xy 177.779824 155.82508) (xy 177.798781 155.800676) (xy 181.012638 152.586818) + (xy 181.073961 152.553334) (xy 181.100319 152.5505) (xy 181.247406 152.5505) (xy 181.351088 152.524945) + (xy 181.420888 152.528014) (xy 181.465636 152.559633) (xy 181.477237 152.49824) (xy 181.525267 152.447497) + (xy 181.530018 152.444868) (xy 181.540661 152.439283) (xy 181.658904 152.33453) (xy 181.748641 152.204523) + (xy 181.804658 152.056818) (xy 181.823699 151.9) (xy 181.819296 151.863738) (xy 181.830756 151.794815) + (xy 181.87766 151.743029) (xy 181.945116 151.724822) (xy 182.011707 151.745974) (xy 182.030073 151.761111) + (xy 182.251446 151.982484) (xy 182.3239 152.024315) (xy 182.372114 152.07488) (xy 182.385338 152.143487) + (xy 182.35937 152.208352) (xy 182.34958 152.219382) (xy 181.955781 152.613181) (xy 181.894458 152.646666) + (xy 181.8681 152.6495) (xy 181.721014 152.6495) (xy 181.617333 152.675054) (xy 181.547531 152.671984) + (xy 181.502783 152.640365) (xy 181.491184 152.701758) (xy 181.443154 152.752501) (xy 181.438392 152.755136) + (xy 181.427762 152.760715) (xy 181.309516 152.865471) (xy 181.219781 152.995475) (xy 181.21978 152.995476) + (xy 181.163762 153.143181) (xy 181.144722 153.299999) (xy 181.144722 153.3) (xy 181.163762 153.456818) + (xy 181.193685 153.535717) (xy 181.21978 153.604523) (xy 181.309517 153.73453) (xy 181.42776 153.839283) + (xy 181.427762 153.839284) (xy 181.567634 153.912696) (xy 181.721014 153.9505) (xy 181.721015 153.9505) + (xy 181.878985 153.9505) (xy 182.032365 153.912696) (xy 182.067722 153.894139) (xy 182.17224 153.839283) + (xy 182.290483 153.73453) (xy 182.38022 153.604523) (xy 182.436237 153.456818) (xy 182.455278 153.3) + (xy 182.449102 153.249144) (xy 182.460561 153.180224) (xy 182.484514 153.146521) (xy 182.919218 152.711819) + (xy 182.980541 152.678334) (xy 183.006899 152.6755) (xy 189.552721 152.6755) (xy 189.61976 152.695185) + (xy 189.640402 152.711819) (xy 192.145291 155.216708) (xy 192.178776 155.278031) (xy 192.180706 155.319333) + (xy 192.174532 155.370187) (xy 192.174532 155.37019) (xy 192.193572 155.527008) (xy 192.209924 155.570123) + (xy 192.24959 155.674713) (xy 192.339327 155.80472) (xy 192.45757 155.909473) (xy 192.457572 155.909474) + (xy 192.597444 155.982886) (xy 192.750824 156.02069) (xy 192.750825 156.02069) (xy 192.908795 156.02069) + (xy 193.062175 155.982886) (xy 193.20205 155.909473) (xy 193.320293 155.80472) (xy 193.41003 155.674713) + (xy 193.466047 155.527008) (xy 193.485088 155.37019) (xy 193.468489 155.233479) (xy 193.466047 155.213371) + (xy 193.428071 155.113238) (xy 193.41003 155.065667) (xy 193.320293 154.93566) (xy 193.20205 154.830907) + (xy 193.202048 154.830906) (xy 193.202047 154.830905) (xy 193.062175 154.757493) (xy 192.908796 154.71969) + (xy 192.908795 154.71969) (xy 192.761709 154.71969) (xy 192.69467 154.700005) (xy 192.674028 154.683371) + (xy 190.259847 152.26919) (xy 190.226362 152.207867) (xy 190.231346 152.138175) (xy 190.273218 152.082242) + (xy 190.338682 152.057825) (xy 190.347528 152.057509) (xy 192.221683 152.057509) (xy 192.288722 152.077194) + (xy 192.323733 152.11107) (xy 192.326154 152.114578) (xy 192.327506 152.116537) (xy 192.327508 152.116539) + (xy 192.445751 152.221292) (xy 192.445753 152.221293) (xy 192.585625 152.294705) (xy 192.739005 152.332509) + (xy 192.739006 152.332509) (xy 192.896976 152.332509) (xy 193.050356 152.294705) (xy 193.081159 152.278538) + (xy 193.190231 152.221292) (xy 193.308474 152.116539) (xy 193.398211 151.986532) (xy 193.454228 151.838827) + (xy 193.473269 151.682009) (xy 193.454881 151.530564) (xy 193.454228 151.52519) (xy 193.425522 151.4495) + (xy 193.398211 151.377486) (xy 193.308474 151.247479) (xy 193.190231 151.142726) (xy 193.190229 151.142725) + (xy 193.190228 151.142724) (xy 193.050356 151.069312) (xy 192.896977 151.031509) (xy 192.896976 151.031509) + (xy 192.739006 151.031509) (xy 192.739005 151.031509) (xy 192.585625 151.069312) (xy 192.445753 151.142724) + (xy 192.327507 151.247479) (xy 192.326331 151.249184) (xy 192.323733 151.252947) (xy 192.269454 151.296938) + (xy 192.221683 151.306509) (xy 182.688909 151.306509) (xy 182.62187 151.286824) (xy 182.601228 151.27019) + (xy 177.911819 146.580781) (xy 177.878334 146.519458) (xy 177.8755 146.4931) (xy 177.8755 143.689492) + (xy 177.895185 143.622453) (xy 177.947989 143.576698) (xy 178.017147 143.566754) (xy 178.057126 143.579696) + (xy 178.167634 143.637696) (xy 178.321014 143.6755) (xy 178.321015 143.6755) (xy 178.478985 143.6755) + (xy 178.632365 143.637696) (xy 178.661408 143.622453) (xy 178.77224 143.564283) (xy 178.890483 143.45953) + (xy 178.98022 143.329523) (xy 179.036237 143.181818) (xy 179.038841 143.16037) (xy 179.054118 143.034554) + (xy 179.08174 142.970376) (xy 179.139674 142.931319) (xy 179.177214 142.9255) (xy 185.953426 142.9255) ) ) (filled_polygon @@ -180080,175 +184640,174 @@ (xy 206.937681 165.22221) (xy 206.985433 165.209415) (xy 207.071057 165.15998) (xy 207.14097 165.090067) (xy 210.844217 161.386818) (xy 210.90554 161.353334) (xy 210.931898 161.3505) (xy 211.078985 161.3505) (xy 211.232365 161.312696) (xy 211.255154 161.300735) (xy 211.37224 161.239283) (xy 211.490483 161.13453) - (xy 211.58022 161.004523) (xy 211.636237 160.856818) (xy 211.655278 160.7) (xy 211.641016 160.582545) - (xy 211.636237 160.543182) (xy 211.620092 160.500611) (xy 211.599425 160.446118) (xy 211.594059 160.376457) - (xy 211.627206 160.314951) (xy 211.688344 160.28113) (xy 211.715368 160.278149) (xy 221.121243 160.278149) - (xy 221.178868 160.292352) (xy 221.217629 160.312696) (xy 221.294319 160.331598) (xy 221.371008 160.3505) - (xy 221.371009 160.3505) (xy 221.528979 160.3505) (xy 221.682359 160.312696) (xy 221.710676 160.297834) - (xy 221.822234 160.239283) (xy 221.940477 160.13453) (xy 222.030214 160.004523) (xy 222.086231 159.856818) - (xy 222.105272 159.7) (xy 222.086231 159.543182) (xy 222.081209 159.529941) (xy 222.052659 159.45466) - (xy 222.030214 159.395477) (xy 221.940477 159.26547) (xy 221.822234 159.160717) (xy 221.822232 159.160716) - (xy 221.822231 159.160715) (xy 221.682359 159.087303) (xy 221.52898 159.0495) (xy 221.528979 159.0495) - (xy 221.371009 159.0495) (xy 221.371008 159.0495) (xy 221.217628 159.087303) (xy 221.077756 159.160715) - (xy 220.95951 159.265471) (xy 220.869775 159.395475) (xy 220.869774 159.395475) (xy 220.850189 159.44712) - (xy 220.808012 159.502822) (xy 220.742414 159.52688) (xy 220.734247 159.527149) (xy 213.026846 159.527149) - (xy 212.959807 159.507464) (xy 212.914052 159.45466) (xy 212.904108 159.385502) (xy 212.933133 159.321946) - (xy 212.96922 159.293353) (xy 213.014863 159.269397) (xy 213.07224 159.239283) (xy 213.190483 159.13453) - (xy 213.194257 159.129061) (xy 213.248537 159.085071) (xy 213.296308 159.0755) (xy 214.656712 159.0755) - (xy 214.656713 159.0755) (xy 214.704463 159.062705) (xy 214.752215 159.04991) (xy 214.837839 159.000475) - (xy 214.907752 158.930562) (xy 219.184806 154.653506) (xy 219.246129 154.620022) (xy 219.272487 154.617188) - (xy 219.419574 154.617188) (xy 219.572954 154.579384) (xy 219.604733 154.562705) (xy 219.712829 154.505971) - (xy 219.831072 154.401218) (xy 219.920809 154.271211) (xy 219.976826 154.123506) (xy 219.991132 154.005679) - (xy 220.018753 153.941503) (xy 220.076687 153.902446) (xy 220.14654 153.900911) (xy 220.201909 153.932946) - (xy 223.588181 157.319218) (xy 223.621666 157.380541) (xy 223.6245 157.406899) (xy 223.6245 157.849437) - (xy 223.635759 157.891458) (xy 223.650088 157.944934) (xy 223.650089 157.944937) (xy 223.65009 157.944938) - (xy 223.699525 158.030562) (xy 223.699526 158.030563) (xy 223.699527 158.030564) (xy 223.811114 158.142151) - (xy 223.844599 158.203474) (xy 223.846529 158.214885) (xy 223.863763 158.356819) (xy 223.91978 158.504523) - (xy 224.009517 158.63453) (xy 224.12776 158.739283) (xy 224.127762 158.739284) (xy 224.267634 158.812696) - (xy 224.421014 158.8505) (xy 224.421015 158.8505) (xy 224.578985 158.8505) (xy 224.732365 158.812696) - (xy 224.763822 158.796186) (xy 224.87224 158.739283) (xy 224.990483 158.63453) (xy 225.08022 158.504523) - (xy 225.136237 158.356818) (xy 225.155278 158.2) (xy 225.152223 158.174835) (xy 225.136237 158.043181) - (xy 225.098978 157.944938) (xy 225.08022 157.895477) (xy 224.990483 157.76547) (xy 224.87224 157.660717) - (xy 224.872238 157.660716) (xy 224.872237 157.660715) (xy 224.732365 157.587303) (xy 224.578986 157.5495) - (xy 224.578985 157.5495) (xy 224.4995 157.5495) (xy 224.432461 157.529815) (xy 224.386706 157.477011) - (xy 224.3755 157.4255) (xy 224.3755 157.150566) (xy 224.3755 157.150565) (xy 224.3755 157.150564) - (xy 224.349911 157.055063) (xy 224.317846 156.999525) (xy 224.300477 156.96944) (xy 224.300473 156.969435) - (xy 222.250173 154.919135) (xy 222.216688 154.857812) (xy 222.221672 154.78812) (xy 222.263544 154.732187) - (xy 222.308179 154.711057) (xy 222.402964 154.687696) (xy 222.542839 154.614283) (xy 222.661082 154.50953) - (xy 222.750819 154.379523) (xy 222.806836 154.231818) (xy 222.825877 154.075) (xy 222.819734 154.024403) - (xy 222.806836 153.918181) (xy 222.776914 153.839284) (xy 222.762015 153.799999) (xy 228.644722 153.799999) - (xy 228.644722 153.8) (xy 228.663762 153.956818) (xy 228.695038 154.039284) (xy 228.71978 154.104523) - (xy 228.809517 154.23453) (xy 228.92776 154.339283) (xy 228.927762 154.339284) (xy 229.067634 154.412696) - (xy 229.221014 154.4505) (xy 229.221015 154.4505) (xy 229.378985 154.4505) (xy 229.532365 154.412696) - (xy 229.67224 154.339283) (xy 229.790483 154.23453) (xy 229.88022 154.104523) (xy 229.936237 153.956818) - (xy 229.955278 153.8) (xy 229.95392 153.788811) (xy 229.936237 153.643181) (xy 229.881935 153.5) - (xy 229.88022 153.495477) (xy 229.790483 153.36547) (xy 229.67224 153.260717) (xy 229.672238 153.260716) - (xy 229.672237 153.260715) (xy 229.532365 153.187303) (xy 229.378986 153.1495) (xy 229.378985 153.1495) - (xy 229.221015 153.1495) (xy 229.221014 153.1495) (xy 229.067634 153.187303) (xy 228.927762 153.260715) - (xy 228.809516 153.365471) (xy 228.719781 153.495475) (xy 228.71978 153.495476) (xy 228.663762 153.643181) - (xy 228.644722 153.799999) (xy 222.762015 153.799999) (xy 222.750819 153.770477) (xy 222.661082 153.64047) - (xy 222.542839 153.535717) (xy 222.542837 153.535716) (xy 222.542836 153.535715) (xy 222.402964 153.462303) - (xy 222.249585 153.4245) (xy 222.249584 153.4245) (xy 222.091614 153.4245) (xy 222.091613 153.4245) - (xy 221.938233 153.462303) (xy 221.798361 153.535715) (xy 221.680115 153.640471) (xy 221.59038 153.770475) - (xy 221.590379 153.770476) (xy 221.534361 153.918181) (xy 221.53436 153.918185) (xy 221.534184 153.919642) - (xy 221.533758 153.920631) (xy 221.532567 153.925464) (xy 221.531763 153.925265) (xy 221.506559 153.983818) - (xy 221.448623 154.022872) (xy 221.37877 154.024403) (xy 221.323408 153.99237) (xy 216.818218 149.487181) - (xy 216.784733 149.425858) (xy 216.789717 149.356166) (xy 216.831589 149.300233) (xy 216.897053 149.275816) - (xy 216.905899 149.2755) (xy 220.532259 149.2755) (xy 220.599298 149.295185) (xy 220.645053 149.347989) - (xy 220.654997 149.417147) (xy 220.634309 149.469939) (xy 220.609783 149.50547) (xy 220.60978 149.505476) - (xy 220.553762 149.653181) (xy 220.534722 149.809999) (xy 220.534722 149.81) (xy 220.553762 149.966818) - (xy 220.60978 150.114523) (xy 220.699517 150.24453) (xy 220.81776 150.349283) (xy 220.817762 150.349284) - (xy 220.957634 150.422696) (xy 221.111014 150.4605) (xy 221.111015 150.4605) (xy 221.268985 150.4605) - (xy 221.422365 150.422696) (xy 221.56224 150.349283) (xy 221.680483 150.24453) (xy 221.77022 150.114523) - (xy 221.826237 149.966818) (xy 221.845278 149.81) (xy 221.826237 149.653182) (xy 221.817732 149.630757) - (xy 221.787295 149.5505) (xy 221.77022 149.505477) (xy 221.770218 149.505474) (xy 221.770216 149.50547) - (xy 221.745691 149.469939) (xy 221.723808 149.403585) (xy 221.741274 149.335933) (xy 221.792542 149.288464) - (xy 221.847741 149.2755) (xy 223.093101 149.2755) (xy 223.16014 149.295185) (xy 223.180782 149.311819) - (xy 226.126309 152.257346) (xy 226.159794 152.318669) (xy 226.161724 152.359973) (xy 226.144722 152.499999) - (xy 226.144722 152.5) (xy 226.163762 152.656818) (xy 226.203949 152.76278) (xy 226.21978 152.804523) - (xy 226.309517 152.93453) (xy 226.42776 153.039283) (xy 226.427762 153.039284) (xy 226.567634 153.112696) - (xy 226.721014 153.1505) (xy 226.721015 153.1505) (xy 226.878985 153.1505) (xy 227.032365 153.112696) - (xy 227.103237 153.075499) (xy 227.17224 153.039283) (xy 227.290483 152.93453) (xy 227.38022 152.804523) - (xy 227.436237 152.656818) (xy 227.455278 152.5) (xy 227.449824 152.455077) (xy 227.436237 152.343181) - (xy 227.411721 152.278538) (xy 227.38022 152.195477) (xy 227.290483 152.06547) (xy 227.17224 151.960717) - (xy 227.172238 151.960716) (xy 227.172237 151.960715) (xy 227.032365 151.887303) (xy 226.878986 151.8495) - (xy 226.878985 151.8495) (xy 226.831899 151.8495) (xy 226.76486 151.829815) (xy 226.744218 151.813181) - (xy 225.431036 150.499999) (xy 228.644722 150.499999) (xy 228.644722 150.5) (xy 228.663762 150.656818) - (xy 228.714722 150.791186) (xy 228.71978 150.804523) (xy 228.809517 150.93453) (xy 228.92776 151.039283) - (xy 228.927762 151.039284) (xy 229.067634 151.112696) (xy 229.221014 151.1505) (xy 229.221015 151.1505) - (xy 229.378985 151.1505) (xy 229.532365 151.112696) (xy 229.541097 151.108113) (xy 229.67224 151.039283) - (xy 229.790483 150.93453) (xy 229.88022 150.804523) (xy 229.936237 150.656818) (xy 229.955278 150.5) - (xy 229.936237 150.343182) (xy 229.931451 150.330563) (xy 229.898823 150.24453) (xy 229.88022 150.195477) - (xy 229.790483 150.06547) (xy 229.67224 149.960717) (xy 229.672238 149.960716) (xy 229.672237 149.960715) - (xy 229.532365 149.887303) (xy 229.378986 149.8495) (xy 229.378985 149.8495) (xy 229.221015 149.8495) - (xy 229.221014 149.8495) (xy 229.067634 149.887303) (xy 228.927762 149.960715) (xy 228.809516 150.065471) - (xy 228.719781 150.195475) (xy 228.71978 150.195476) (xy 228.663762 150.343181) (xy 228.644722 150.499999) - (xy 225.431036 150.499999) (xy 223.530563 148.599526) (xy 223.530562 148.599525) (xy 223.444938 148.55009) - (xy 223.444937 148.550089) (xy 223.444933 148.550088) (xy 223.395844 148.536934) (xy 223.395844 148.536935) - (xy 223.349436 148.5245) (xy 223.349435 148.5245) (xy 200.364643 148.5245) (xy 200.297604 148.504815) - (xy 200.251849 148.452011) (xy 200.241905 148.382853) (xy 200.262593 148.33006) (xy 200.280219 148.304524) - (xy 200.28022 148.304523) (xy 200.336237 148.156818) (xy 200.355278 148) (xy 200.35522 147.999526) - (xy 200.336237 147.843182) (xy 200.316567 147.791317) (xy 200.288887 147.718332) (xy 200.283521 147.648671) - (xy 200.316668 147.587165) (xy 200.377806 147.553344) (xy 200.434504 147.553966) (xy 200.461014 147.5605) - (xy 200.461015 147.5605) (xy 200.618985 147.5605) (xy 200.772365 147.522696) (xy 200.777927 147.519777) - (xy 200.91224 147.449283) (xy 201.030483 147.34453) (xy 201.12022 147.214523) (xy 201.176237 147.066818) - (xy 201.195278 146.91) (xy 201.193515 146.895476) (xy 201.176237 146.753181) (xy 201.147293 146.676862) - (xy 201.12022 146.605477) (xy 201.030483 146.47547) (xy 200.91224 146.370717) (xy 200.912238 146.370716) - (xy 200.912237 146.370715) (xy 200.772365 146.297303) (xy 200.618986 146.2595) (xy 200.618985 146.2595) - (xy 200.461015 146.2595) (xy 200.461014 146.2595) (xy 200.307634 146.297303) (xy 200.257126 146.323813) - (xy 200.188618 146.337539) (xy 200.123565 146.312047) (xy 200.08262 146.255431) (xy 200.0755 146.214017) - (xy 200.0755 145.079768) (xy 200.095185 145.012729) (xy 200.141873 144.969972) (xy 200.16224 144.959283) - (xy 200.280483 144.85453) (xy 200.37022 144.724523) (xy 200.426237 144.576818) (xy 200.445278 144.42) - (xy 200.426237 144.263182) (xy 200.421427 144.2505) (xy 200.404992 144.207164) (xy 200.37022 144.115477) - (xy 200.280483 143.98547) (xy 200.16224 143.880717) (xy 200.162238 143.880716) (xy 200.162237 143.880715) - (xy 200.022365 143.807303) (xy 199.868986 143.7695) (xy 199.868985 143.7695) (xy 199.711015 143.7695) - (xy 199.711014 143.7695) (xy 199.557634 143.807303) (xy 199.417762 143.880715) (xy 199.299516 143.985471) - (xy 199.209781 144.115475) (xy 199.20978 144.115476) (xy 199.153762 144.263181) (xy 199.134722 144.419999) - (xy 199.134722 144.42) (xy 199.153762 144.576818) (xy 199.20978 144.724523) (xy 199.20978 144.724524) - (xy 199.234106 144.759766) (xy 199.299517 144.85453) (xy 199.299518 144.854531) (xy 199.30255 144.858923) - (xy 199.324433 144.925277) (xy 199.3245 144.929363) (xy 199.3245 147.407796) (xy 199.304815 147.474835) - (xy 199.282727 147.500611) (xy 199.209518 147.565468) (xy 199.119781 147.695475) (xy 199.11978 147.695476) - (xy 199.063762 147.843181) (xy 199.044722 147.999999) (xy 199.044722 148) (xy 199.063762 148.156818) - (xy 199.098731 148.249021) (xy 199.104098 148.318684) (xy 199.070951 148.38019) (xy 199.009813 148.414012) - (xy 198.940095 148.40941) (xy 198.900563 148.385808) (xy 198.87224 148.360717) (xy 198.872238 148.360715) - (xy 198.732365 148.287303) (xy 198.578986 148.2495) (xy 198.578985 148.2495) (xy 198.421015 148.2495) - (xy 198.421014 148.2495) (xy 198.267634 148.287303) (xy 198.127762 148.360715) (xy 198.009516 148.465471) - (xy 197.919781 148.595475) (xy 197.91978 148.595476) (xy 197.863762 148.743181) (xy 197.844722 148.899999) - (xy 197.844722 148.9) (xy 197.863762 149.056818) (xy 197.91978 149.204523) (xy 198.009517 149.33453) - (xy 198.12776 149.439283) (xy 198.127762 149.439284) (xy 198.267634 149.512696) (xy 198.421014 149.5505) - (xy 198.421015 149.5505) (xy 198.578985 149.5505) (xy 198.732365 149.512696) (xy 198.746133 149.50547) - (xy 198.87224 149.439283) (xy 198.990483 149.33453) (xy 198.994257 149.329061) (xy 199.048537 149.285071) - (xy 199.096308 149.2755) (xy 203.706155 149.2755) (xy 203.773194 149.295185) (xy 203.818949 149.347989) - (xy 203.828893 149.417147) (xy 203.822097 149.443471) (xy 203.793763 149.518181) (xy 203.774722 149.674999) - (xy 203.774722 149.675) (xy 203.793762 149.831818) (xy 203.842429 149.96014) (xy 203.84978 149.979523) - (xy 203.939517 150.10953) (xy 204.05776 150.214283) (xy 204.057762 150.214284) (xy 204.197634 150.287696) - (xy 204.351014 150.3255) (xy 204.351015 150.3255) (xy 204.508985 150.3255) (xy 204.662365 150.287696) - (xy 204.677381 150.279815) (xy 204.80224 150.214283) (xy 204.920483 150.10953) (xy 205.01022 149.979523) - (xy 205.066237 149.831818) (xy 205.085278 149.675) (xy 205.066237 149.518182) (xy 205.037903 149.443471) - (xy 205.032536 149.373808) (xy 205.065683 149.312302) (xy 205.126822 149.27848) (xy 205.153845 149.2755) - (xy 209.185636 149.2755) (xy 209.252675 149.295185) (xy 209.29843 149.347989) (xy 209.308374 149.417147) - (xy 209.301578 149.443471) (xy 209.263763 149.543181) (xy 209.244722 149.699999) (xy 209.244722 149.7) - (xy 209.263762 149.856818) (xy 209.30548 149.966818) (xy 209.31978 150.004523) (xy 209.409517 150.13453) - (xy 209.52776 150.239283) (xy 209.527762 150.239284) (xy 209.667634 150.312696) (xy 209.821014 150.3505) - (xy 209.821015 150.3505) (xy 209.978985 150.3505) (xy 210.132365 150.312696) (xy 210.27224 150.239283) - (xy 210.390483 150.13453) (xy 210.394257 150.129061) (xy 210.448537 150.085071) (xy 210.496308 150.0755) - (xy 216.293101 150.0755) (xy 216.36014 150.095185) (xy 216.380782 150.111819) (xy 219.37347 153.104507) - (xy 219.406955 153.16583) (xy 219.401971 153.235522) (xy 219.360099 153.291455) (xy 219.294635 153.315872) - (xy 219.285789 153.316188) (xy 219.261603 153.316188) (xy 219.108223 153.353991) (xy 218.96835 153.427403) - (xy 218.968348 153.427405) (xy 218.854569 153.528203) (xy 218.791336 153.557924) (xy 218.722073 153.54874) - (xy 218.66877 153.503567) (xy 218.649247 153.450333) (xy 218.646463 153.427403) (xy 218.636237 153.343182) - (xy 218.58022 153.195477) (xy 218.490483 153.06547) (xy 218.37224 152.960717) (xy 218.372238 152.960716) - (xy 218.372237 152.960715) (xy 218.232365 152.887303) (xy 218.078986 152.8495) (xy 218.078985 152.8495) - (xy 217.921015 152.8495) (xy 217.921014 152.8495) (xy 217.767635 152.887303) (xy 217.681941 152.932279) - (xy 217.613433 152.946003) (xy 217.54838 152.920511) (xy 217.508374 152.866453) (xy 217.503278 152.853016) - (xy 217.482212 152.797469) (xy 217.392475 152.667462) (xy 217.274232 152.562709) (xy 217.27423 152.562708) - (xy 217.274229 152.562707) (xy 217.134357 152.489295) (xy 216.980978 152.451492) (xy 216.980977 152.451492) - (xy 216.823007 152.451492) (xy 216.823006 152.451492) (xy 216.683689 152.485829) (xy 216.613887 152.482759) - (xy 216.556825 152.442439) (xy 216.538073 152.409403) (xy 216.532791 152.395476) (xy 216.523145 152.37004) - (xy 216.516196 152.359973) (xy 216.469206 152.291896) (xy 216.433408 152.240033) (xy 216.315165 152.13528) - (xy 216.315163 152.135279) (xy 216.315162 152.135278) (xy 216.175291 152.061867) (xy 216.02217 152.024127) - (xy 215.96179 151.988971) (xy 215.930001 151.926752) (xy 215.928442 151.891579) (xy 215.945341 151.72) - (xy 215.926024 151.523868) (xy 215.868814 151.335273) (xy 215.868811 151.335269) (xy 215.868811 151.335266) - (xy 215.775913 151.161467) (xy 215.775909 151.16146) (xy 215.650883 151.009116) (xy 215.498539 150.88409) - (xy 215.498532 150.884086) (xy 215.324733 150.791188) (xy 215.324727 150.791186) (xy 215.136132 150.733976) - (xy 215.136129 150.733975) (xy 214.94 150.714659) (xy 214.74387 150.733975) (xy 214.555266 150.791188) - (xy 214.381467 150.884086) (xy 214.38146 150.88409) (xy 214.229116 151.009116) (xy 214.10409 151.16146) - (xy 214.104086 151.161467) (xy 214.011188 151.335266) (xy 213.953975 151.52387) (xy 213.934659 151.72) - (xy 213.953975 151.916129) (xy 213.960211 151.936686) (xy 214.00271 152.076787) (xy 214.011188 152.104733) - (xy 214.104086 152.278532) (xy 214.10409 152.278539) (xy 214.229116 152.430883) (xy 214.38146 152.555909) - (xy 214.381467 152.555913) (xy 214.488608 152.613181) (xy 214.555273 152.648814) (xy 214.583917 152.657503) - (xy 214.664143 152.68184) (xy 214.722581 152.720137) (xy 214.751038 152.78395) (xy 214.740477 152.853016) - (xy 214.694252 152.90541) (xy 214.628147 152.9245) (xy 213.050564 152.9245) (xy 213.002812 152.937295) - (xy 213.002811 152.937294) (xy 212.955063 152.950089) (xy 212.955062 152.950089) (xy 212.88753 152.989079) - (xy 212.87645 152.995477) (xy 212.869435 152.999527) (xy 208.799527 157.069435) (xy 208.799525 157.069437) - (xy 208.799525 157.069438) (xy 208.75009 157.155062) (xy 208.75009 157.155063) (xy 208.73163 157.223958) - (xy 208.724816 157.249388) (xy 208.724803 157.249436) (xy 208.7245 157.250564) (xy 208.7245 158.107796) - (xy 208.704815 158.174835) (xy 208.682727 158.200611) (xy 208.609518 158.265468) (xy 208.519781 158.395475) - (xy 208.51978 158.395476) (xy 208.463762 158.543181) (xy 208.444722 158.699999) (xy 208.444722 158.7) - (xy 208.463762 158.856818) (xy 208.491307 158.929446) (xy 208.51978 159.004523) (xy 208.609517 159.13453) - (xy 208.72776 159.239283) (xy 208.727762 159.239284) (xy 208.83078 159.293353) (xy 208.880993 159.341937) - (xy 208.896967 159.409956) (xy 208.873632 159.475814) (xy 208.818396 159.518601) (xy 208.773154 159.527149) - (xy 201.245531 159.527149) (xy 201.178492 159.507464) (xy 201.15785 159.49083) (xy 196.652508 154.985489) + (xy 211.58022 161.004523) (xy 211.636237 160.856818) (xy 211.655278 160.7) (xy 211.641017 160.582545) + (xy 211.636237 160.543181) (xy 211.59929 160.445761) (xy 211.58022 160.395477) (xy 211.493567 160.269938) + (xy 211.471685 160.203586) (xy 211.48915 160.135934) (xy 211.540418 160.088464) (xy 211.595618 160.0755) + (xy 220.853686 160.0755) (xy 220.920725 160.095185) (xy 220.955736 160.129061) (xy 220.958157 160.132569) + (xy 220.959509 160.134528) (xy 220.959511 160.13453) (xy 221.077754 160.239283) (xy 221.077756 160.239284) + (xy 221.217628 160.312696) (xy 221.371008 160.3505) (xy 221.371009 160.3505) (xy 221.528979 160.3505) + (xy 221.682359 160.312696) (xy 221.822234 160.239283) (xy 221.940477 160.13453) (xy 222.030214 160.004523) + (xy 222.086231 159.856818) (xy 222.105272 159.7) (xy 222.086231 159.543182) (xy 222.081209 159.529941) + (xy 222.031279 159.398286) (xy 222.030214 159.395477) (xy 221.940477 159.26547) (xy 221.822234 159.160717) + (xy 221.822232 159.160716) (xy 221.822231 159.160715) (xy 221.682359 159.087303) (xy 221.52898 159.0495) + (xy 221.528979 159.0495) (xy 221.371009 159.0495) (xy 221.371008 159.0495) (xy 221.217628 159.087303) + (xy 221.077756 159.160715) (xy 220.95951 159.26547) (xy 220.957083 159.268987) (xy 220.955736 159.270938) + (xy 220.901457 159.314929) (xy 220.853686 159.3245) (xy 213.295618 159.3245) (xy 213.228579 159.304815) + (xy 213.182824 159.252011) (xy 213.17288 159.182853) (xy 213.193555 159.130079) (xy 213.194248 159.129075) + (xy 213.248521 159.085078) (xy 213.296308 159.0755) (xy 214.656712 159.0755) (xy 214.656713 159.0755) + (xy 214.704463 159.062705) (xy 214.752215 159.04991) (xy 214.837839 159.000475) (xy 214.907752 158.930562) + (xy 219.184806 154.653506) (xy 219.246129 154.620022) (xy 219.272487 154.617188) (xy 219.419574 154.617188) + (xy 219.572954 154.579384) (xy 219.604733 154.562705) (xy 219.712829 154.505971) (xy 219.831072 154.401218) + (xy 219.920809 154.271211) (xy 219.976826 154.123506) (xy 219.991132 154.005679) (xy 220.018753 153.941503) + (xy 220.076687 153.902446) (xy 220.14654 153.900911) (xy 220.201909 153.932946) (xy 223.588181 157.319218) + (xy 223.621666 157.380541) (xy 223.6245 157.406899) (xy 223.6245 157.849437) (xy 223.635759 157.891458) + (xy 223.650088 157.944934) (xy 223.650089 157.944937) (xy 223.65009 157.944938) (xy 223.699525 158.030562) + (xy 223.699526 158.030563) (xy 223.699527 158.030564) (xy 223.811114 158.142151) (xy 223.844599 158.203474) + (xy 223.846529 158.214885) (xy 223.863763 158.356819) (xy 223.91978 158.504523) (xy 224.009517 158.63453) + (xy 224.12776 158.739283) (xy 224.127762 158.739284) (xy 224.267634 158.812696) (xy 224.421014 158.8505) + (xy 224.421015 158.8505) (xy 224.578985 158.8505) (xy 224.732365 158.812696) (xy 224.763822 158.796186) + (xy 224.87224 158.739283) (xy 224.990483 158.63453) (xy 225.08022 158.504523) (xy 225.136237 158.356818) + (xy 225.155278 158.2) (xy 225.152223 158.174835) (xy 225.136237 158.043181) (xy 225.098978 157.944938) + (xy 225.08022 157.895477) (xy 224.990483 157.76547) (xy 224.87224 157.660717) (xy 224.872238 157.660716) + (xy 224.872237 157.660715) (xy 224.732365 157.587303) (xy 224.578986 157.5495) (xy 224.578985 157.5495) + (xy 224.4995 157.5495) (xy 224.432461 157.529815) (xy 224.386706 157.477011) (xy 224.3755 157.4255) + (xy 224.3755 157.150566) (xy 224.3755 157.150565) (xy 224.3755 157.150564) (xy 224.349911 157.055063) + (xy 224.317846 156.999525) (xy 224.300477 156.96944) (xy 224.300473 156.969435) (xy 222.250173 154.919135) + (xy 222.216688 154.857812) (xy 222.221672 154.78812) (xy 222.263544 154.732187) (xy 222.308179 154.711057) + (xy 222.402964 154.687696) (xy 222.542839 154.614283) (xy 222.661082 154.50953) (xy 222.750819 154.379523) + (xy 222.806836 154.231818) (xy 222.825877 154.075) (xy 222.819734 154.024403) (xy 222.806836 153.918181) + (xy 222.776914 153.839284) (xy 222.762015 153.799999) (xy 228.644722 153.799999) (xy 228.644722 153.8) + (xy 228.663762 153.956818) (xy 228.695038 154.039284) (xy 228.71978 154.104523) (xy 228.809517 154.23453) + (xy 228.92776 154.339283) (xy 228.927762 154.339284) (xy 229.067634 154.412696) (xy 229.221014 154.4505) + (xy 229.221015 154.4505) (xy 229.378985 154.4505) (xy 229.532365 154.412696) (xy 229.67224 154.339283) + (xy 229.790483 154.23453) (xy 229.88022 154.104523) (xy 229.936237 153.956818) (xy 229.955278 153.8) + (xy 229.95392 153.788811) (xy 229.936237 153.643181) (xy 229.881935 153.5) (xy 229.88022 153.495477) + (xy 229.790483 153.36547) (xy 229.67224 153.260717) (xy 229.672238 153.260716) (xy 229.672237 153.260715) + (xy 229.532365 153.187303) (xy 229.378986 153.1495) (xy 229.378985 153.1495) (xy 229.221015 153.1495) + (xy 229.221014 153.1495) (xy 229.067634 153.187303) (xy 228.927762 153.260715) (xy 228.809516 153.365471) + (xy 228.719781 153.495475) (xy 228.71978 153.495476) (xy 228.663762 153.643181) (xy 228.644722 153.799999) + (xy 222.762015 153.799999) (xy 222.750819 153.770477) (xy 222.661082 153.64047) (xy 222.542839 153.535717) + (xy 222.542837 153.535716) (xy 222.542836 153.535715) (xy 222.402964 153.462303) (xy 222.249585 153.4245) + (xy 222.249584 153.4245) (xy 222.091614 153.4245) (xy 222.091613 153.4245) (xy 221.938233 153.462303) + (xy 221.798361 153.535715) (xy 221.680115 153.640471) (xy 221.59038 153.770475) (xy 221.590379 153.770476) + (xy 221.534361 153.918181) (xy 221.53436 153.918185) (xy 221.534184 153.919642) (xy 221.533758 153.920631) + (xy 221.532567 153.925464) (xy 221.531763 153.925265) (xy 221.506559 153.983818) (xy 221.448623 154.022872) + (xy 221.37877 154.024403) (xy 221.323408 153.99237) (xy 216.818218 149.487181) (xy 216.784733 149.425858) + (xy 216.789717 149.356166) (xy 216.831589 149.300233) (xy 216.897053 149.275816) (xy 216.905899 149.2755) + (xy 220.532259 149.2755) (xy 220.599298 149.295185) (xy 220.645053 149.347989) (xy 220.654997 149.417147) + (xy 220.634309 149.469939) (xy 220.609783 149.50547) (xy 220.60978 149.505476) (xy 220.553762 149.653181) + (xy 220.534722 149.809999) (xy 220.534722 149.81) (xy 220.553762 149.966818) (xy 220.60978 150.114523) + (xy 220.699517 150.24453) (xy 220.81776 150.349283) (xy 220.817762 150.349284) (xy 220.957634 150.422696) + (xy 221.111014 150.4605) (xy 221.111015 150.4605) (xy 221.268985 150.4605) (xy 221.422365 150.422696) + (xy 221.56224 150.349283) (xy 221.680483 150.24453) (xy 221.77022 150.114523) (xy 221.826237 149.966818) + (xy 221.845278 149.81) (xy 221.826237 149.653182) (xy 221.817732 149.630757) (xy 221.787295 149.5505) + (xy 221.77022 149.505477) (xy 221.770218 149.505474) (xy 221.770216 149.50547) (xy 221.745691 149.469939) + (xy 221.723808 149.403585) (xy 221.741274 149.335933) (xy 221.792542 149.288464) (xy 221.847741 149.2755) + (xy 223.093101 149.2755) (xy 223.16014 149.295185) (xy 223.180782 149.311819) (xy 226.126309 152.257346) + (xy 226.159794 152.318669) (xy 226.161724 152.359973) (xy 226.144722 152.499999) (xy 226.144722 152.5) + (xy 226.163762 152.656818) (xy 226.203949 152.76278) (xy 226.21978 152.804523) (xy 226.309517 152.93453) + (xy 226.42776 153.039283) (xy 226.427762 153.039284) (xy 226.567634 153.112696) (xy 226.721014 153.1505) + (xy 226.721015 153.1505) (xy 226.878985 153.1505) (xy 227.032365 153.112696) (xy 227.103237 153.075499) + (xy 227.17224 153.039283) (xy 227.290483 152.93453) (xy 227.38022 152.804523) (xy 227.436237 152.656818) + (xy 227.455278 152.5) (xy 227.449824 152.455077) (xy 227.436237 152.343181) (xy 227.411721 152.278538) + (xy 227.38022 152.195477) (xy 227.290483 152.06547) (xy 227.17224 151.960717) (xy 227.172238 151.960716) + (xy 227.172237 151.960715) (xy 227.032365 151.887303) (xy 226.878986 151.8495) (xy 226.878985 151.8495) + (xy 226.831899 151.8495) (xy 226.76486 151.829815) (xy 226.744218 151.813181) (xy 225.431036 150.499999) + (xy 228.644722 150.499999) (xy 228.644722 150.5) (xy 228.663762 150.656818) (xy 228.714722 150.791186) + (xy 228.71978 150.804523) (xy 228.809517 150.93453) (xy 228.92776 151.039283) (xy 228.927762 151.039284) + (xy 229.067634 151.112696) (xy 229.221014 151.1505) (xy 229.221015 151.1505) (xy 229.378985 151.1505) + (xy 229.532365 151.112696) (xy 229.541097 151.108113) (xy 229.67224 151.039283) (xy 229.790483 150.93453) + (xy 229.88022 150.804523) (xy 229.936237 150.656818) (xy 229.955278 150.5) (xy 229.936237 150.343182) + (xy 229.931451 150.330563) (xy 229.898823 150.24453) (xy 229.88022 150.195477) (xy 229.790483 150.06547) + (xy 229.67224 149.960717) (xy 229.672238 149.960716) (xy 229.672237 149.960715) (xy 229.532365 149.887303) + (xy 229.378986 149.8495) (xy 229.378985 149.8495) (xy 229.221015 149.8495) (xy 229.221014 149.8495) + (xy 229.067634 149.887303) (xy 228.927762 149.960715) (xy 228.809516 150.065471) (xy 228.719781 150.195475) + (xy 228.71978 150.195476) (xy 228.663762 150.343181) (xy 228.644722 150.499999) (xy 225.431036 150.499999) + (xy 223.530563 148.599526) (xy 223.530562 148.599525) (xy 223.444938 148.55009) (xy 223.444937 148.550089) + (xy 223.444933 148.550088) (xy 223.395844 148.536934) (xy 223.395844 148.536935) (xy 223.349436 148.5245) + (xy 223.349435 148.5245) (xy 200.364643 148.5245) (xy 200.297604 148.504815) (xy 200.251849 148.452011) + (xy 200.241905 148.382853) (xy 200.262593 148.33006) (xy 200.280219 148.304524) (xy 200.28022 148.304523) + (xy 200.336237 148.156818) (xy 200.355278 148) (xy 200.35522 147.999526) (xy 200.336237 147.843182) + (xy 200.316567 147.791317) (xy 200.288887 147.718332) (xy 200.283521 147.648671) (xy 200.316668 147.587165) + (xy 200.377806 147.553344) (xy 200.434504 147.553966) (xy 200.461014 147.5605) (xy 200.461015 147.5605) + (xy 200.618985 147.5605) (xy 200.772365 147.522696) (xy 200.777927 147.519777) (xy 200.91224 147.449283) + (xy 201.030483 147.34453) (xy 201.12022 147.214523) (xy 201.176237 147.066818) (xy 201.195278 146.91) + (xy 201.193515 146.895476) (xy 201.176237 146.753181) (xy 201.147293 146.676862) (xy 201.12022 146.605477) + (xy 201.030483 146.47547) (xy 200.91224 146.370717) (xy 200.912238 146.370716) (xy 200.912237 146.370715) + (xy 200.772365 146.297303) (xy 200.618986 146.2595) (xy 200.618985 146.2595) (xy 200.461015 146.2595) + (xy 200.461014 146.2595) (xy 200.307634 146.297303) (xy 200.257126 146.323813) (xy 200.188618 146.337539) + (xy 200.123565 146.312047) (xy 200.08262 146.255431) (xy 200.0755 146.214017) (xy 200.0755 145.079768) + (xy 200.095185 145.012729) (xy 200.141873 144.969972) (xy 200.16224 144.959283) (xy 200.280483 144.85453) + (xy 200.37022 144.724523) (xy 200.426237 144.576818) (xy 200.445278 144.42) (xy 200.426237 144.263182) + (xy 200.421427 144.2505) (xy 200.404992 144.207164) (xy 200.37022 144.115477) (xy 200.280483 143.98547) + (xy 200.16224 143.880717) (xy 200.162238 143.880716) (xy 200.162237 143.880715) (xy 200.022365 143.807303) + (xy 199.868986 143.7695) (xy 199.868985 143.7695) (xy 199.711015 143.7695) (xy 199.711014 143.7695) + (xy 199.557634 143.807303) (xy 199.417762 143.880715) (xy 199.299516 143.985471) (xy 199.209781 144.115475) + (xy 199.20978 144.115476) (xy 199.153762 144.263181) (xy 199.134722 144.419999) (xy 199.134722 144.42) + (xy 199.153762 144.576818) (xy 199.20978 144.724523) (xy 199.20978 144.724524) (xy 199.234106 144.759766) + (xy 199.299517 144.85453) (xy 199.299518 144.854531) (xy 199.30255 144.858923) (xy 199.324433 144.925277) + (xy 199.3245 144.929363) (xy 199.3245 147.407796) (xy 199.304815 147.474835) (xy 199.282727 147.500611) + (xy 199.209518 147.565468) (xy 199.119781 147.695475) (xy 199.11978 147.695476) (xy 199.063762 147.843181) + (xy 199.044722 147.999999) (xy 199.044722 148) (xy 199.063762 148.156818) (xy 199.098731 148.249021) + (xy 199.104098 148.318684) (xy 199.070951 148.38019) (xy 199.009813 148.414012) (xy 198.940095 148.40941) + (xy 198.900563 148.385808) (xy 198.87224 148.360717) (xy 198.872238 148.360715) (xy 198.732365 148.287303) + (xy 198.578986 148.2495) (xy 198.578985 148.2495) (xy 198.421015 148.2495) (xy 198.421014 148.2495) + (xy 198.267634 148.287303) (xy 198.127762 148.360715) (xy 198.009516 148.465471) (xy 197.919781 148.595475) + (xy 197.91978 148.595476) (xy 197.863762 148.743181) (xy 197.844722 148.899999) (xy 197.844722 148.9) + (xy 197.863762 149.056818) (xy 197.91978 149.204523) (xy 198.009517 149.33453) (xy 198.12776 149.439283) + (xy 198.127762 149.439284) (xy 198.267634 149.512696) (xy 198.421014 149.5505) (xy 198.421015 149.5505) + (xy 198.578985 149.5505) (xy 198.732365 149.512696) (xy 198.746133 149.50547) (xy 198.87224 149.439283) + (xy 198.990483 149.33453) (xy 198.994257 149.329061) (xy 199.048537 149.285071) (xy 199.096308 149.2755) + (xy 203.706155 149.2755) (xy 203.773194 149.295185) (xy 203.818949 149.347989) (xy 203.828893 149.417147) + (xy 203.822097 149.443471) (xy 203.793763 149.518181) (xy 203.774722 149.674999) (xy 203.774722 149.675) + (xy 203.793762 149.831818) (xy 203.842429 149.96014) (xy 203.84978 149.979523) (xy 203.939517 150.10953) + (xy 204.05776 150.214283) (xy 204.057762 150.214284) (xy 204.197634 150.287696) (xy 204.351014 150.3255) + (xy 204.351015 150.3255) (xy 204.508985 150.3255) (xy 204.662365 150.287696) (xy 204.677381 150.279815) + (xy 204.80224 150.214283) (xy 204.920483 150.10953) (xy 205.01022 149.979523) (xy 205.066237 149.831818) + (xy 205.085278 149.675) (xy 205.066237 149.518182) (xy 205.037903 149.443471) (xy 205.032536 149.373808) + (xy 205.065683 149.312302) (xy 205.126822 149.27848) (xy 205.153845 149.2755) (xy 209.185636 149.2755) + (xy 209.252675 149.295185) (xy 209.29843 149.347989) (xy 209.308374 149.417147) (xy 209.301578 149.443471) + (xy 209.263763 149.543181) (xy 209.244722 149.699999) (xy 209.244722 149.7) (xy 209.263762 149.856818) + (xy 209.30548 149.966818) (xy 209.31978 150.004523) (xy 209.409517 150.13453) (xy 209.52776 150.239283) + (xy 209.527762 150.239284) (xy 209.667634 150.312696) (xy 209.821014 150.3505) (xy 209.821015 150.3505) + (xy 209.978985 150.3505) (xy 210.132365 150.312696) (xy 210.27224 150.239283) (xy 210.390483 150.13453) + (xy 210.394257 150.129061) (xy 210.448537 150.085071) (xy 210.496308 150.0755) (xy 216.293101 150.0755) + (xy 216.36014 150.095185) (xy 216.380782 150.111819) (xy 219.37347 153.104507) (xy 219.406955 153.16583) + (xy 219.401971 153.235522) (xy 219.360099 153.291455) (xy 219.294635 153.315872) (xy 219.285789 153.316188) + (xy 219.261603 153.316188) (xy 219.108223 153.353991) (xy 218.96835 153.427403) (xy 218.968348 153.427405) + (xy 218.854569 153.528203) (xy 218.791336 153.557924) (xy 218.722073 153.54874) (xy 218.66877 153.503567) + (xy 218.649247 153.450333) (xy 218.646463 153.427403) (xy 218.636237 153.343182) (xy 218.58022 153.195477) + (xy 218.490483 153.06547) (xy 218.37224 152.960717) (xy 218.372238 152.960716) (xy 218.372237 152.960715) + (xy 218.232365 152.887303) (xy 218.078986 152.8495) (xy 218.078985 152.8495) (xy 217.921015 152.8495) + (xy 217.921014 152.8495) (xy 217.767635 152.887303) (xy 217.681941 152.932279) (xy 217.613433 152.946003) + (xy 217.54838 152.920511) (xy 217.508374 152.866453) (xy 217.503278 152.853016) (xy 217.482212 152.797469) + (xy 217.392475 152.667462) (xy 217.274232 152.562709) (xy 217.27423 152.562708) (xy 217.274229 152.562707) + (xy 217.134357 152.489295) (xy 216.980978 152.451492) (xy 216.980977 152.451492) (xy 216.823007 152.451492) + (xy 216.823006 152.451492) (xy 216.683689 152.485829) (xy 216.613887 152.482759) (xy 216.556825 152.442439) + (xy 216.538073 152.409403) (xy 216.532791 152.395476) (xy 216.523145 152.37004) (xy 216.516196 152.359973) + (xy 216.469206 152.291896) (xy 216.433408 152.240033) (xy 216.315165 152.13528) (xy 216.315163 152.135279) + (xy 216.315162 152.135278) (xy 216.175291 152.061867) (xy 216.02217 152.024127) (xy 215.96179 151.988971) + (xy 215.930001 151.926752) (xy 215.928442 151.891579) (xy 215.945341 151.72) (xy 215.926024 151.523868) + (xy 215.868814 151.335273) (xy 215.868811 151.335269) (xy 215.868811 151.335266) (xy 215.775913 151.161467) + (xy 215.775909 151.16146) (xy 215.650883 151.009116) (xy 215.498539 150.88409) (xy 215.498532 150.884086) + (xy 215.324733 150.791188) (xy 215.324727 150.791186) (xy 215.136132 150.733976) (xy 215.136129 150.733975) + (xy 214.94 150.714659) (xy 214.74387 150.733975) (xy 214.555266 150.791188) (xy 214.381467 150.884086) + (xy 214.38146 150.88409) (xy 214.229116 151.009116) (xy 214.10409 151.16146) (xy 214.104086 151.161467) + (xy 214.011188 151.335266) (xy 213.953975 151.52387) (xy 213.934659 151.72) (xy 213.953975 151.916129) + (xy 213.960211 151.936686) (xy 214.00271 152.076787) (xy 214.011188 152.104733) (xy 214.104086 152.278532) + (xy 214.10409 152.278539) (xy 214.229116 152.430883) (xy 214.38146 152.555909) (xy 214.381467 152.555913) + (xy 214.488608 152.613181) (xy 214.555273 152.648814) (xy 214.583917 152.657503) (xy 214.664143 152.68184) + (xy 214.722581 152.720137) (xy 214.751038 152.78395) (xy 214.740477 152.853016) (xy 214.694252 152.90541) + (xy 214.628147 152.9245) (xy 213.050564 152.9245) (xy 213.002812 152.937295) (xy 213.002811 152.937294) + (xy 212.955063 152.950089) (xy 212.955062 152.950089) (xy 212.88753 152.989079) (xy 212.87645 152.995477) + (xy 212.869435 152.999527) (xy 208.799527 157.069435) (xy 208.799525 157.069437) (xy 208.799525 157.069438) + (xy 208.75009 157.155062) (xy 208.75009 157.155063) (xy 208.73163 157.223958) (xy 208.724816 157.249388) + (xy 208.724803 157.249436) (xy 208.7245 157.250564) (xy 208.7245 158.107796) (xy 208.704815 158.174835) + (xy 208.682727 158.200611) (xy 208.609518 158.265468) (xy 208.519781 158.395475) (xy 208.51978 158.395476) + (xy 208.463762 158.543181) (xy 208.444722 158.699999) (xy 208.444722 158.7) (xy 208.463762 158.856818) + (xy 208.491307 158.929446) (xy 208.51978 159.004523) (xy 208.576919 159.087304) (xy 208.606432 159.13006) + (xy 208.628315 159.196414) (xy 208.61085 159.264066) (xy 208.559582 159.311536) (xy 208.504382 159.3245) + (xy 201.042881 159.3245) (xy 200.975842 159.304815) (xy 200.9552 159.288181) (xy 196.652508 154.985489) (xy 196.619023 154.924166) (xy 196.617093 154.882866) (xy 196.623269 154.832009) (xy 196.604228 154.675191) (xy 196.548211 154.527486) (xy 196.458474 154.397479) (xy 196.340231 154.292726) (xy 196.340229 154.292725) (xy 196.340228 154.292724) (xy 196.200356 154.219312) (xy 196.046977 154.181509) (xy 196.046976 154.181509) @@ -180804,4 +185363,13 @@ "ca5477eb-70db-40f2-8a1b-c3d74b7b697d" ) ) + (group "" + (uuid "edb82ac6-ffaa-487f-a403-e0628d59b2dd") + (members "034b30aa-f423-45af-beea-b597a729e30e" "0af8e8d1-032e-44a9-94a6-4e4b9ab7b14b" + "0b873f77-3436-4d63-830a-5c67b40d06f5" "10dcca2c-22e2-44de-a049-a05ca63f13f6" + "440246cd-c37b-45eb-b777-df313e36b717" "b185de1f-615c-4b08-8ed5-2ac8415e12c5" + "c439a31a-82dd-4354-9214-d9b3e644691f" "cf47c5c5-fdf5-4a1c-ada6-ff2c05a58914" + "d8d2066d-b11b-4491-999f-a85b10805486" + ) + ) ) diff --git a/Hardware/FT25_PDU.kicad_pro b/Hardware/FT25_PDU.kicad_pro index 024c532..7bce5f6 100644 --- a/Hardware/FT25_PDU.kicad_pro +++ b/Hardware/FT25_PDU.kicad_pro @@ -38,8 +38,8 @@ "other_text_upright": false, "pads": { "drill": 0.0, - "height": 1.5, - "width": 1.0 + "height": 2.2, + "width": 1.55 }, "silk_line_width": 0.15, "silk_text_italic": false, @@ -145,7 +145,7 @@ "teardrop_parameters": [ { "td_allow_use_two_tracks": true, - "td_curve_segcount": 0, + "td_curve_segcount": 5, "td_height_ratio": 1.0, "td_length_ratio": 0.5, "td_maxheight": 2.0, @@ -156,7 +156,7 @@ }, { "td_allow_use_two_tracks": true, - "td_curve_segcount": 0, + "td_curve_segcount": 5, "td_height_ratio": 1.0, "td_length_ratio": 0.5, "td_maxheight": 2.0, @@ -167,7 +167,7 @@ }, { "td_allow_use_two_tracks": true, - "td_curve_segcount": 0, + "td_curve_segcount": 5, "td_height_ratio": 1.0, "td_length_ratio": 0.5, "td_maxheight": 2.0, @@ -217,7 +217,7 @@ "drill": 0.0 } ], - "zones_allow_external_fillets": false + "zones_allow_external_fillets": true }, "ipc2581": { "dist": "", @@ -654,7 +654,7 @@ "pos_files": "", "specctra_dsn": "", "step": "FT25_PDU_final_fr_fr.step", - "svg": "", + "svg": "C:/Users/janek/Downloads/", "vrml": "" }, "page_layout_descr_file": "" diff --git a/Hardware/FT25_PDU.kicad_sch b/Hardware/FT25_PDU.kicad_sch index 66e8438..f00ba58 100644 --- a/Hardware/FT25_PDU.kicad_sch +++ b/Hardware/FT25_PDU.kicad_sch @@ -6,8 +6,8 @@ (paper "A3") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) @@ -550,7 +550,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "45a2780d-c966-4bde-be6e-96cda1cd3a4a") (property "Sheetname" "MCU" @@ -708,7 +708,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "473b5d64-7aa4-4707-813f-ece239add7ea") (property "Sheetname" "power supply" @@ -746,7 +746,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "523904a0-40b6-4f2d-ba58-ca74b3f4752e") (property "Sheetname" "EBSR" @@ -794,7 +794,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "780d04e9-366d-4b48-88f6-229428c96c3a") (property "Sheetname" "powerstages" @@ -922,7 +922,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "9403c48f-9f4e-4909-8513-9d0d9e2137d2") (property "Sheetname" "RBR" @@ -990,7 +990,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "fe13a4b9-36ea-4c93-a2fd-eec83db6d38d") (property "Sheetname" "connectors" diff --git a/Hardware/RBR.kicad_sch b/Hardware/RBR.kicad_sch index 65e0b20..0c7e675 100644 --- a/Hardware/RBR.kicad_sch +++ b/Hardware/RBR.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/connectors.kicad_sch b/Hardware/connectors.kicad_sch index e694378..c345e76 100644 --- a/Hardware/connectors.kicad_sch +++ b/Hardware/connectors.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/epsc.kicad_sch b/Hardware/epsc.kicad_sch index 556f027..00c68b6 100644 --- a/Hardware/epsc.kicad_sch +++ b/Hardware/epsc.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/libraries/brain.pretty/heart.kicad_mod b/Hardware/libraries/brain.pretty/heart.kicad_mod new file mode 100644 index 0000000..d3fe5b9 --- /dev/null +++ b/Hardware/libraries/brain.pretty/heart.kicad_mod @@ -0,0 +1,129 @@ +(footprint "LOGO" (version 20221018) (generator "bitmap2component") (generator_version "8.0") + (layer "F.Cu") + (attr board_only exclude_from_pos_files exclude_from_bom) + (fp_text reference "G***" (at 0 0) (layer "F.SilkS") + (effects (font (size 1.5 1.5) (thickness 0.3))) + (uuid 2c8f3a7f-3908-4eea-8a2e-36d1632ce845) + ) + (fp_text value "LOGO" (at 0.75 0) (layer "F.SilkS") hide + (effects (font (size 1.5 1.5) (thickness 0.3))) + (uuid 117c3a36-af9c-43b6-9992-df3f5d98bd88) + ) + (fp_poly + (pts + (xy 0.494225 -0.80869) + (xy 0.560131 -0.795643) + (xy 0.62442 -0.773307) + (xy 0.685896 -0.741897) + (xy 0.730386 -0.711799) + (xy 0.778049 -0.669228) + (xy 0.819844 -0.618777) + (xy 0.855302 -0.56173) + (xy 0.883953 -0.49937) + (xy 0.905326 -0.432981) + (xy 0.918953 -0.363846) + (xy 0.924361 -0.293248) + (xy 0.921083 -0.222471) + (xy 0.91803 -0.199393) + (xy 0.906174 -0.141614) + (xy 0.888346 -0.084542) + (xy 0.86413 -0.027574) + (xy 0.83311 0.029887) + (xy 0.794867 0.088445) + (xy 0.748987 0.148698) + (xy 0.695051 0.211247) + (xy 0.632643 0.276694) + (xy 0.561346 0.345638) + (xy 0.502453 0.399409) + (xy 0.47372 0.424925) + (xy 0.440913 0.453773) + (xy 0.404869 0.485239) + (xy 0.366425 0.518611) + (xy 0.326416 0.553175) + (xy 0.285678 0.588219) + (xy 0.245047 0.62303) + (xy 0.20536 0.656895) + (xy 0.167453 0.689103) + (xy 0.132162 0.718938) + (xy 0.100322 0.74569) + (xy 0.07277 0.768646) + (xy 0.050342 0.787092) + (xy 0.033875 0.800315) + (xy 0.024204 0.807604) + (xy 0.022251 0.808774) + (xy 0.00593 0.812984) + (xy -0.008789 0.8109) + (xy -0.025836 0.801779) + (xy -0.030079 0.798901) + (xy -0.04397 0.788556) + (xy -0.064928 0.772006) + (xy -0.092015 0.750046) + (xy -0.124291 0.723469) + (xy -0.160818 0.693069) + (xy -0.200657 0.65964) + (xy -0.242867 0.623976) + (xy -0.286512 0.586871) + (xy -0.33065 0.549118) + (xy -0.374344 0.511513) + (xy -0.416654 0.474847) + (xy -0.456641 0.439916) + (xy -0.493366 0.407514) + (xy -0.499812 0.401785) + (xy -0.580049 0.328096) + (xy -0.650882 0.258083) + (xy -0.71268 0.191233) + (xy -0.765814 0.127032) + (xy -0.810651 0.064965) + (xy -0.847563 0.004518) + (xy -0.876919 -0.054822) + (xy -0.899087 -0.113571) + (xy -0.914438 -0.172241) + (xy -0.915237 -0.176211) + (xy -0.918693 -0.201619) + (xy -0.920868 -0.234349) + (xy -0.921788 -0.271469) + (xy -0.921484 -0.310045) + (xy -0.919981 -0.347146) + (xy -0.917309 -0.379837) + (xy -0.913494 -0.405186) + (xy -0.913039 -0.407257) + (xy -0.891293 -0.481377) + (xy -0.861585 -0.549392) + (xy -0.824359 -0.610811) + (xy -0.780063 -0.665149) + (xy -0.729141 -0.711916) + (xy -0.67204 -0.750626) + (xy -0.609205 -0.780789) + (xy -0.555642 -0.798299) + (xy -0.515154 -0.806076) + (xy -0.46884 -0.810184) + (xy -0.420449 -0.810618) + (xy -0.373726 -0.807376) + (xy -0.332422 -0.800456) + (xy -0.32456 -0.798474) + (xy -0.261649 -0.776067) + (xy -0.201138 -0.743961) + (xy -0.144116 -0.703007) + (xy -0.091673 -0.65406) + (xy -0.044899 -0.597972) + (xy -0.018418 -0.558685) + (xy -0.008485 -0.542875) + (xy -0.000921 -0.531366) + (xy 0.002769 -0.52644) + (xy 0.002866 -0.526398) + (xy 0.006152 -0.53055) + (xy 0.014114 -0.541867) + (xy 0.025571 -0.558638) + (xy 0.03934 -0.579153) + (xy 0.039858 -0.57993) + (xy 0.086216 -0.641852) + (xy 0.136459 -0.694024) + (xy 0.190927 -0.736723) + (xy 0.249964 -0.770227) + (xy 0.298737 -0.789929) + (xy 0.362333 -0.806049) + (xy 0.427894 -0.81223) + ) + + (stroke (width 0.000000) (type solid)) (fill solid) (layer "F.SilkS") (uuid 57e5c2ac-c926-4922-a9e8-0ae54e349522)) +) diff --git a/Hardware/lidar_DCDC.kicad_sch b/Hardware/lidar_DCDC.kicad_sch index e215074..1ab37d8 100644 --- a/Hardware/lidar_DCDC.kicad_sch +++ b/Hardware/lidar_DCDC.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/mcu.kicad_sch b/Hardware/mcu.kicad_sch index 1d3f79b..4523131 100644 --- a/Hardware/mcu.kicad_sch +++ b/Hardware/mcu.kicad_sch @@ -6,8 +6,8 @@ (paper "A3") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/power_supply.kicad_sch b/Hardware/power_supply.kicad_sch index 9f881ee..6f7ccf1 100644 --- a/Hardware/power_supply.kicad_sch +++ b/Hardware/power_supply.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Hardware/powerstages.kicad_sch b/Hardware/powerstages.kicad_sch index 7485300..926f713 100644 --- a/Hardware/powerstages.kicad_sch +++ b/Hardware/powerstages.kicad_sch @@ -6,8 +6,8 @@ (paper "A3") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) @@ -9500,7 +9500,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "04f74e90-4601-4705-835d-93116911b970") (property "Sheetname" "DRS (4.5A)" @@ -9578,7 +9578,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "0984a678-ce7e-47f8-88e4-8d596fed053b") (property "Sheetname" "TS Cooling (9A)" @@ -9665,7 +9665,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "157b2c84-cc96-4ba7-baf9-ba113a1815cc") (property "Sheetname" "ACU (DVB) (9A)" @@ -9743,7 +9743,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "17568c05-22d2-49aa-af34-9ae20e28dafd") (property "Sheetname" "DRS-DCDC (24V->7.2V)" @@ -9801,7 +9801,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "1c5136fc-5bc2-411e-8bfa-12bb6fc3dce0") (property "Sheetname" "Inverter (9A)" @@ -9888,7 +9888,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "1c9f025b-a2ef-4464-a4f8-af874b23022b") (property "Sheetname" "ACU-DCDC (24V->19V)" @@ -9946,7 +9946,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "2688228a-78b0-463b-82bd-42a0dedab640") (property "Sheetname" "ACC pump DCDC" @@ -10004,7 +10004,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "2b5b64bc-8cb7-4f13-a951-4ca5ea87b1d9") (property "Sheetname" "EPSC (9A)" @@ -10111,7 +10111,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "36ed45c6-442d-4eee-9bdb-46289aebb151") (property "Sheetname" "Lidar-DCDC (24->15V)" @@ -10169,7 +10169,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "63b20f96-617c-43ad-ab9b-609143d283a4") (property "Sheetname" "always on (4.5A)" @@ -10247,7 +10247,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "71d8f5cf-0f92-4762-80f1-5fa539de32a1") (property "Sheetname" "TS pump DCDC" @@ -10305,7 +10305,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "853200ca-7128-4e24-9e2e-43888de24ec0") (property "Sheetname" "EBS Valves (1A)" @@ -10443,7 +10443,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "86c43eea-c07d-4b85-a03d-0e621c0f0a8f") (property "Sheetname" "Lidar (4.5A)" @@ -10521,7 +10521,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "c7c98efe-16ca-43c1-a63c-3bafee393e99") (property "Sheetname" "SDC (4.5A)" @@ -10599,7 +10599,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "c87eede0-a4a4-48e4-a564-9cae38116cba") (property "Sheetname" "ACC Cooling (9A)" @@ -10677,7 +10677,7 @@ (type solid) ) (fill - (color 255 250 208 1.0000) + (color 0 0 0 0.0000) ) (uuid "f83d6f2f-0918-42cb-afa7-d105b5080366") (property "Sheetname" "MISC (4.5A)" diff --git a/Hardware/pumpDCDC.kicad_sch b/Hardware/pumpDCDC.kicad_sch index fb152a2..0e29a64 100644 --- a/Hardware/pumpDCDC.kicad_sch +++ b/Hardware/pumpDCDC.kicad_sch @@ -6,8 +6,8 @@ (paper "A4") (title_block (title "PDU FT25") - (date "2025-01-06") - (rev "V1.1") + (date "2025-01-15") + (rev "V1.2") (company "Janek Herm") (comment 1 "FaSTTUBe Electronics") ) diff --git a/Software/Code/.cproject b/Software/Code/.cproject new file mode 100644 index 0000000..2c45d26 --- /dev/null +++ b/Software/Code/.cproject @@ -0,0 +1,176 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Code/.mxproject b/Software/Code/.mxproject new file mode 100644 index 0000000..9fb57ea --- /dev/null +++ b/Software/Code/.mxproject @@ -0,0 +1,25 @@ +[PreviousGenFiles] +AdvancedFolderStructure=true +HeaderFileListSize=3 +HeaderFiles#0=..\Core\Inc\stm32f3xx_it.h +HeaderFiles#1=..\Core\Inc\stm32f3xx_hal_conf.h +HeaderFiles#2=..\Core\Inc\main.h +HeaderFolderListSize=1 +HeaderPath#0=..\Core\Inc +HeaderFiles=; +SourceFileListSize=3 +SourceFiles#0=..\Core\Src\stm32f3xx_it.c +SourceFiles#1=..\Core\Src\stm32f3xx_hal_msp.c +SourceFiles#2=..\Core\Src\main.c +SourceFolderListSize=1 +SourcePath#0=..\Core\Src +SourceFiles=; + +[PreviousLibFiles] +LibFiles=Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_adc.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_adc.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_adc_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_def.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_rcc.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_rcc_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_bus.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_rcc.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_crs.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_system.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_utils.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_gpio.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_gpio_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_gpio.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_dma_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_dma.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_dma.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_cortex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_cortex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_pwr.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_pwr_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_pwr.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_flash.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_flash_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_i2c.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_i2c_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_exti.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_exti.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_can.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_tim.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_tim_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_tim.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_uart.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_usart.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_uart_ex.h;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_adc.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_adc_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_rcc.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_rcc_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_gpio.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_dma.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_cortex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_pwr.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_pwr_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_flash.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_flash_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_i2c.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_i2c_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_exti.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_can.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_uart.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_uart_ex.c;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_adc.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_adc.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_adc_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_def.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_rcc.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_rcc_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_bus.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_rcc.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_crs.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_system.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_utils.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_gpio.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_gpio_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_gpio.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_dma_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_dma.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_dma.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_cortex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_cortex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_pwr.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_pwr_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_pwr.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_flash.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_flash_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_i2c.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_i2c_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_exti.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_exti.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_can.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_tim.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_tim_ex.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_tim.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_uart.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_ll_usart.h;Drivers\STM32F3xx_HAL_Driver\Inc\stm32f3xx_hal_uart_ex.h;Drivers\CMSIS\Device\ST\STM32F3xx\Include\stm32f302xc.h;Drivers\CMSIS\Device\ST\STM32F3xx\Include\stm32f3xx.h;Drivers\CMSIS\Device\ST\STM32F3xx\Include\system_stm32f3xx.h;Drivers\CMSIS\Device\ST\STM32F3xx\Include\system_stm32f3xx.h;Drivers\CMSIS\Device\ST\STM32F3xx\Source\Templates\system_stm32f3xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h; + +[PreviousUsedCubeIDEFiles] +SourceFiles=Core\Src\main.c;Core\Src\stm32f3xx_it.c;Core\Src\stm32f3xx_hal_msp.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_adc.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_adc_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_rcc.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_rcc_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_gpio.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_dma.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_cortex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_pwr.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_pwr_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_flash.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_flash_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_i2c.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_i2c_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_exti.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_can.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_uart.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_uart_ex.c;Drivers\CMSIS\Device\ST\STM32F3xx\Source\Templates\system_stm32f3xx.c;Core\Src\system_stm32f3xx.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_adc.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_adc_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_rcc.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_rcc_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_gpio.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_dma.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_cortex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_pwr.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_pwr_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_flash.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_flash_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_i2c.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_i2c_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_exti.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_can.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim_ex.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_uart.c;Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_uart_ex.c;Drivers\CMSIS\Device\ST\STM32F3xx\Source\Templates\system_stm32f3xx.c;Core\Src\system_stm32f3xx.c;;; +HeaderPath=Drivers\STM32F3xx_HAL_Driver\Inc;Drivers\STM32F3xx_HAL_Driver\Inc\Legacy;Drivers\CMSIS\Device\ST\STM32F3xx\Include;Drivers\CMSIS\Include;Core\Inc; +CDefines=USE_HAL_DRIVER;STM32F302xC;USE_HAL_DRIVER;USE_HAL_DRIVER; + diff --git a/Software/Code/.project b/Software/Code/.project new file mode 100644 index 0000000..2fa4d04 --- /dev/null +++ b/Software/Code/.project @@ -0,0 +1,32 @@ + + + PDU_FT25 + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + com.st.stm32cube.ide.mcu.MCUProjectNature + com.st.stm32cube.ide.mcu.MCUCubeProjectNature + org.eclipse.cdt.core.cnature + com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature + com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature + com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature + com.st.stm32cube.ide.mcu.MCURootProjectNature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + diff --git a/Software/Code/.settings/stm32cubeide.project.prefs b/Software/Code/.settings/stm32cubeide.project.prefs new file mode 100644 index 0000000..596df75 --- /dev/null +++ b/Software/Code/.settings/stm32cubeide.project.prefs @@ -0,0 +1,3 @@ +66BE74F758C12D739921AEA421D593D3=0 +DC22A860405A8BF2F2C095E5B6529F12=75A976C2EECA00C915ADE0412978B13E +eclipse.preferences.version=1 diff --git a/Software/Code/Core/Inc/main.h b/Software/Code/Core/Inc/main.h new file mode 100644 index 0000000..0600e56 --- /dev/null +++ b/Software/Code/Core/Inc/main.h @@ -0,0 +1,137 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.h + * @brief : Header for main.c file. + * This file contains the common defines of the application. + ****************************************************************************** + * @attention + * + * Copyright (c) 2025 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __MAIN_H +#define __MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void Error_Handler(void); + +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +/* Private defines -----------------------------------------------------------*/ +#define LVMS_Vsense_Pin GPIO_PIN_0 +#define LVMS_Vsense_GPIO_Port GPIOC +#define IS10_Pin GPIO_PIN_1 +#define IS10_GPIO_Port GPIOC +#define IS6_Pin GPIO_PIN_2 +#define IS6_GPIO_Port GPIOC +#define IS7_Pin GPIO_PIN_3 +#define IS7_GPIO_Port GPIOC +#define ASMS_Vsense_Pin GPIO_PIN_0 +#define ASMS_Vsense_GPIO_Port GPIOA +#define IS1_Pin GPIO_PIN_1 +#define IS1_GPIO_Port GPIOA +#define IS2_Pin GPIO_PIN_2 +#define IS2_GPIO_Port GPIOA +#define IS9_Pin GPIO_PIN_3 +#define IS9_GPIO_Port GPIOA +#define IS11_Pin GPIO_PIN_4 +#define IS11_GPIO_Port GPIOF +#define IS3_Pin GPIO_PIN_4 +#define IS3_GPIO_Port GPIOA +#define IS8_Pin GPIO_PIN_5 +#define IS8_GPIO_Port GPIOA +#define IS4_Pin GPIO_PIN_6 +#define IS4_GPIO_Port GPIOA +#define IS5_Pin GPIO_PIN_7 +#define IS5_GPIO_Port GPIOA +#define PC_Read_Pin GPIO_PIN_4 +#define PC_Read_GPIO_Port GPIOC +#define IN11_Pin GPIO_PIN_0 +#define IN11_GPIO_Port GPIOB +#define IN12_Pin GPIO_PIN_1 +#define IN12_GPIO_Port GPIOB +#define IN13_Pin GPIO_PIN_10 +#define IN13_GPIO_Port GPIOB +#define IN9_Pin GPIO_PIN_11 +#define IN9_GPIO_Port GPIOB +#define IN3_Pin GPIO_PIN_12 +#define IN3_GPIO_Port GPIOB +#define IN8_Pin GPIO_PIN_13 +#define IN8_GPIO_Port GPIOB +#define IN5_Pin GPIO_PIN_14 +#define IN5_GPIO_Port GPIOB +#define IN4_Pin GPIO_PIN_15 +#define IN4_GPIO_Port GPIOB +#define LED4_Pin GPIO_PIN_6 +#define LED4_GPIO_Port GPIOC +#define LED3_Pin GPIO_PIN_7 +#define LED3_GPIO_Port GPIOC +#define LED2_Pin GPIO_PIN_8 +#define LED2_GPIO_Port GPIOC +#define LED1_Pin GPIO_PIN_9 +#define LED1_GPIO_Port GPIOC +#define IN2_Pin GPIO_PIN_8 +#define IN2_GPIO_Port GPIOA +#define IN1_Pin GPIO_PIN_9 +#define IN1_GPIO_Port GPIOA +#define IN6_Pin GPIO_PIN_10 +#define IN6_GPIO_Port GPIOA +#define DSEL0_Pin GPIO_PIN_4 +#define DSEL0_GPIO_Port GPIOB +#define DSEL1_Pin GPIO_PIN_5 +#define DSEL1_GPIO_Port GPIOB +#define PC_EN_Pin GPIO_PIN_6 +#define PC_EN_GPIO_Port GPIOB +#define IN7_Pin GPIO_PIN_8 +#define IN7_GPIO_Port GPIOB +#define IN10_Pin GPIO_PIN_9 +#define IN10_GPIO_Port GPIOB + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MAIN_H */ diff --git a/Software/Code/Core/Inc/stm32f3xx_hal_conf.h b/Software/Code/Core/Inc/stm32f3xx_hal_conf.h new file mode 100644 index 0000000..0231aba --- /dev/null +++ b/Software/Code/Core/Inc/stm32f3xx_hal_conf.h @@ -0,0 +1,359 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32f3xx_hal_conf.h + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_CONF_H +#define __STM32F3xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ + +#define HAL_MODULE_ENABLED + #define HAL_ADC_MODULE_ENABLED +/*#define HAL_CRYP_MODULE_ENABLED */ +#define HAL_CAN_MODULE_ENABLED +/*#define HAL_CEC_MODULE_ENABLED */ +/*#define HAL_NAND_MODULE_ENABLED */ +/*#define HAL_NOR_MODULE_ENABLED */ +/*#define HAL_PCCARD_MODULE_ENABLED */ +/*#define HAL_SRAM_MODULE_ENABLED */ +/*#define HAL_HRTIM_MODULE_ENABLED */ +/*#define HAL_OPAMP_MODULE_ENABLED */ +/*#define HAL_SDADC_MODULE_ENABLED */ +/*#define HAL_TSC_MODULE_ENABLED */ +/*#define HAL_COMP_MODULE_ENABLED */ +/*#define HAL_CRC_MODULE_ENABLED */ +/*#define HAL_CRYP_MODULE_ENABLED */ +/*#define HAL_DAC_MODULE_ENABLED */ +/*#define HAL_I2S_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +/*#define HAL_RNG_MODULE_ENABLED */ +/*#define HAL_RTC_MODULE_ENABLED */ +/*#define HAL_SPI_MODULE_ENABLED */ +#define HAL_TIM_MODULE_ENABLED +#define HAL_UART_MODULE_ENABLED +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +/*#define HAL_PCD_MODULE_ENABLED */ +#define HAL_GPIO_MODULE_ENABLED +#define HAL_EXTI_MODULE_ENABLED +/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ +#define HAL_DMA_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +/* ########################## HSE/HSI Values adaptation ##################### */ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)16000000) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +/** + * @brief In the following line adjust the External High Speed oscillator (HSE) Startup + * Timeout value + */ +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup + * Timeout value + */ +#if !defined (HSI_STARTUP_TIMEOUT) + #define HSI_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSI start up */ +#endif /* HSI_STARTUP_TIMEOUT */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)40000) +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature. */ +/** + * @brief External Low Speed oscillator (LSE) value. + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ +#endif /* LSE_VALUE */ + +/** + * @brief Time out for LSE start up value in ms. + */ +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for I2S peripheral + * This value is used by the I2S HAL module to compute the I2S clock source + * frequency, this source is inserted directly through I2S_CKIN pad. + * - External clock generated through external PLL component on EVAL 303 (based on MCO or crystal) + * - External clock not generated on EVAL 373 + */ +#if !defined (EXTERNAL_CLOCK_VALUE) + #define EXTERNAL_CLOCK_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz*/ +#endif /* EXTERNAL_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ + +#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)15) /*!< tick interrupt priority (lowest by default) */ +#define USE_RTOS 0 +#define PREFETCH_ENABLE 1 +#define INSTRUCTION_CACHE_ENABLE 0 +#define DATA_CACHE_ENABLE 0 +#define USE_SPI_CRC 0U + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ +#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ +#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ +#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ +#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ +#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ +#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ +#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ +#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ +#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ +#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ +#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ +#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ +#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* OPAMP register callback disabled */ +#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ +#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ +#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ +#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ +#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ +#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32f3xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32f3xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED + #include "stm32f3xx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32f3xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32f3xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32f3xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_CAN_MODULE_ENABLED + #include "stm32f3xx_hal_can.h" +#endif /* HAL_CAN_MODULE_ENABLED */ + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED + #include "stm32f3xx_hal_can_legacy.h" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +#ifdef HAL_CEC_MODULE_ENABLED + #include "stm32f3xx_hal_cec.h" +#endif /* HAL_CEC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32f3xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32f3xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32f3xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32f3xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_SRAM_MODULE_ENABLED + #include "stm32f3xx_hal_sram.h" +#endif /* HAL_SRAM_MODULE_ENABLED */ + +#ifdef HAL_NOR_MODULE_ENABLED + #include "stm32f3xx_hal_nor.h" +#endif /* HAL_NOR_MODULE_ENABLED */ + +#ifdef HAL_NAND_MODULE_ENABLED + #include "stm32f3xx_hal_nand.h" +#endif /* HAL_NAND_MODULE_ENABLED */ + +#ifdef HAL_PCCARD_MODULE_ENABLED + #include "stm32f3xx_hal_pccard.h" +#endif /* HAL_PCCARD_MODULE_ENABLED */ + +#ifdef HAL_HRTIM_MODULE_ENABLED + #include "stm32f3xx_hal_hrtim.h" +#endif /* HAL_HRTIM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32f3xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32f3xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32f3xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32f3xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_OPAMP_MODULE_ENABLED + #include "stm32f3xx_hal_opamp.h" +#endif /* HAL_OPAMP_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32f3xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32f3xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32f3xx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SDADC_MODULE_ENABLED + #include "stm32f3xx_hal_sdadc.h" +#endif /* HAL_SDADC_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32f3xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32f3xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32f3xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32f3xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32f3xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32f3xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32f3xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32f3xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(uint8_t* file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_CONF_H */ diff --git a/Software/Code/Core/Inc/stm32f3xx_it.h b/Software/Code/Core/Inc/stm32f3xx_it.h new file mode 100644 index 0000000..69298d1 --- /dev/null +++ b/Software/Code/Core/Inc/stm32f3xx_it.h @@ -0,0 +1,70 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32f3xx_it.h + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + * Copyright (c) 2025 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_IT_H +#define __STM32F3xx_IT_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void NMI_Handler(void); +void HardFault_Handler(void); +void MemManage_Handler(void); +void BusFault_Handler(void); +void UsageFault_Handler(void); +void SVC_Handler(void); +void DebugMon_Handler(void); +void PendSV_Handler(void); +void SysTick_Handler(void); +void DMA1_Channel1_IRQHandler(void); +void ADC1_2_IRQHandler(void); +void TIM6_DAC_IRQHandler(void); +void DMA2_Channel1_IRQHandler(void); +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_IT_H */ diff --git a/Software/Code/Core/Src/main.c b/Software/Code/Core/Src/main.c new file mode 100644 index 0000000..da42d6a --- /dev/null +++ b/Software/Code/Core/Src/main.c @@ -0,0 +1,617 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.c + * @brief : Main program body + ****************************************************************************** + * @attention + * + * Copyright (c) 2025 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +ADC_HandleTypeDef hadc1; +ADC_HandleTypeDef hadc2; +DMA_HandleTypeDef hdma_adc1; +DMA_HandleTypeDef hdma_adc2; + +CAN_HandleTypeDef hcan; + +TIM_HandleTypeDef htim6; + +UART_HandleTypeDef huart4; + +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +void SystemClock_Config(void); +static void MX_GPIO_Init(void); +static void MX_DMA_Init(void); +static void MX_ADC1_Init(void); +static void MX_ADC2_Init(void); +static void MX_CAN_Init(void); +static void MX_UART4_Init(void); +static void MX_TIM6_Init(void); +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/** + * @brief The application entry point. + * @retval int + */ +int main(void) +{ + + /* USER CODE BEGIN 1 */ + + /* USER CODE END 1 */ + + /* MCU Configuration--------------------------------------------------------*/ + + /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + HAL_Init(); + + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* Configure the system clock */ + SystemClock_Config(); + + /* USER CODE BEGIN SysInit */ + + /* USER CODE END SysInit */ + + /* Initialize all configured peripherals */ + MX_GPIO_Init(); + MX_DMA_Init(); + MX_ADC1_Init(); + MX_ADC2_Init(); + MX_CAN_Init(); + MX_UART4_Init(); + MX_TIM6_Init(); + /* USER CODE BEGIN 2 */ + + /* USER CODE END 2 */ + + /* Infinite loop */ + /* USER CODE BEGIN WHILE */ + while (1) + { + /* USER CODE END WHILE */ + + /* USER CODE BEGIN 3 */ + } + /* USER CODE END 3 */ +} + +/** + * @brief System Clock Configuration + * @retval None + */ +void SystemClock_Config(void) +{ + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; + RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; + + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_ON; + RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL4; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + + /** Initializes the CPU, AHB and APB buses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK + |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) + { + Error_Handler(); + } + PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_UART4|RCC_PERIPHCLK_ADC12; + PeriphClkInit.Uart4ClockSelection = RCC_UART4CLKSOURCE_PCLK1; + PeriphClkInit.Adc12ClockSelection = RCC_ADC12PLLCLK_DIV1; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) + { + Error_Handler(); + } +} + +/** + * @brief ADC1 Initialization Function + * @param None + * @retval None + */ +static void MX_ADC1_Init(void) +{ + + /* USER CODE BEGIN ADC1_Init 0 */ + + /* USER CODE END ADC1_Init 0 */ + + ADC_MultiModeTypeDef multimode = {0}; + ADC_ChannelConfTypeDef sConfig = {0}; + + /* USER CODE BEGIN ADC1_Init 1 */ + + /* USER CODE END ADC1_Init 1 */ + + /** Common config + */ + hadc1.Instance = ADC1; + hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; + hadc1.Init.Resolution = ADC_RESOLUTION_12B; + hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE; + hadc1.Init.ContinuousConvMode = DISABLE; + hadc1.Init.DiscontinuousConvMode = DISABLE; + hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING; + hadc1.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T6_TRGO; + hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT; + hadc1.Init.NbrOfConversion = 8; + hadc1.Init.DMAContinuousRequests = ENABLE; + hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV; + hadc1.Init.LowPowerAutoWait = DISABLE; + hadc1.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; + if (HAL_ADC_Init(&hadc1) != HAL_OK) + { + Error_Handler(); + } + + /** Configure the ADC multi-mode + */ + multimode.Mode = ADC_MODE_INDEPENDENT; + if (HAL_ADCEx_MultiModeConfigChannel(&hadc1, &multimode) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Channel = ADC_CHANNEL_2; + sConfig.Rank = ADC_REGULAR_RANK_1; + sConfig.SingleDiff = ADC_SINGLE_ENDED; + sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5; + sConfig.OffsetNumber = ADC_OFFSET_NONE; + sConfig.Offset = 0; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Channel = ADC_CHANNEL_1; + sConfig.Rank = ADC_REGULAR_RANK_2; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_3; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_4; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_5; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_6; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_7; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_8; + if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN ADC1_Init 2 */ + + /* USER CODE END ADC1_Init 2 */ + +} + +/** + * @brief ADC2 Initialization Function + * @param None + * @retval None + */ +static void MX_ADC2_Init(void) +{ + + /* USER CODE BEGIN ADC2_Init 0 */ + + /* USER CODE END ADC2_Init 0 */ + + ADC_ChannelConfTypeDef sConfig = {0}; + + /* USER CODE BEGIN ADC2_Init 1 */ + + /* USER CODE END ADC2_Init 1 */ + + /** Common config + */ + hadc2.Instance = ADC2; + hadc2.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1; + hadc2.Init.Resolution = ADC_RESOLUTION_12B; + hadc2.Init.ScanConvMode = ADC_SCAN_ENABLE; + hadc2.Init.ContinuousConvMode = DISABLE; + hadc2.Init.DiscontinuousConvMode = DISABLE; + hadc2.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING; + hadc2.Init.ExternalTrigConv = ADC_EXTERNALTRIGCONV_T6_TRGO; + hadc2.Init.DataAlign = ADC_DATAALIGN_RIGHT; + hadc2.Init.NbrOfConversion = 6; + hadc2.Init.DMAContinuousRequests = ENABLE; + hadc2.Init.EOCSelection = ADC_EOC_SEQ_CONV; + hadc2.Init.LowPowerAutoWait = DISABLE; + hadc2.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; + if (HAL_ADC_Init(&hadc2) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Channel = ADC_CHANNEL_1; + sConfig.Rank = ADC_REGULAR_RANK_1; + sConfig.SingleDiff = ADC_SINGLE_ENDED; + sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5; + sConfig.OffsetNumber = ADC_OFFSET_NONE; + sConfig.Offset = 0; + if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_2; + if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_3; + if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_4; + if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_5; + if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK) + { + Error_Handler(); + } + + /** Configure Regular Channel + */ + sConfig.Rank = ADC_REGULAR_RANK_6; + if (HAL_ADC_ConfigChannel(&hadc2, &sConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN ADC2_Init 2 */ + + /* USER CODE END ADC2_Init 2 */ + +} + +/** + * @brief CAN Initialization Function + * @param None + * @retval None + */ +static void MX_CAN_Init(void) +{ + + /* USER CODE BEGIN CAN_Init 0 */ + + /* USER CODE END CAN_Init 0 */ + + /* USER CODE BEGIN CAN_Init 1 */ + + /* USER CODE END CAN_Init 1 */ + hcan.Instance = CAN; + hcan.Init.Prescaler = 1; + hcan.Init.Mode = CAN_MODE_NORMAL; + hcan.Init.SyncJumpWidth = CAN_SJW_1TQ; + hcan.Init.TimeSeg1 = CAN_BS1_13TQ; + hcan.Init.TimeSeg2 = CAN_BS2_2TQ; + hcan.Init.TimeTriggeredMode = DISABLE; + hcan.Init.AutoBusOff = DISABLE; + hcan.Init.AutoWakeUp = DISABLE; + hcan.Init.AutoRetransmission = DISABLE; + hcan.Init.ReceiveFifoLocked = DISABLE; + hcan.Init.TransmitFifoPriority = DISABLE; + if (HAL_CAN_Init(&hcan) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN CAN_Init 2 */ + + /* USER CODE END CAN_Init 2 */ + +} + +/** + * @brief TIM6 Initialization Function + * @param None + * @retval None + */ +static void MX_TIM6_Init(void) +{ + + /* USER CODE BEGIN TIM6_Init 0 */ + + /* USER CODE END TIM6_Init 0 */ + + TIM_MasterConfigTypeDef sMasterConfig = {0}; + + /* USER CODE BEGIN TIM6_Init 1 */ + + /* USER CODE END TIM6_Init 1 */ + htim6.Instance = TIM6; + htim6.Init.Prescaler = 400; + htim6.Init.CounterMode = TIM_COUNTERMODE_UP; + htim6.Init.Period = 8000-1; + htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; + if (HAL_TIM_Base_Init(&htim6) != HAL_OK) + { + Error_Handler(); + } + sMasterConfig.MasterOutputTrigger = TIM_TRGO_UPDATE; + sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE; + if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN TIM6_Init 2 */ + + /* USER CODE END TIM6_Init 2 */ + +} + +/** + * @brief UART4 Initialization Function + * @param None + * @retval None + */ +static void MX_UART4_Init(void) +{ + + /* USER CODE BEGIN UART4_Init 0 */ + + /* USER CODE END UART4_Init 0 */ + + /* USER CODE BEGIN UART4_Init 1 */ + + /* USER CODE END UART4_Init 1 */ + huart4.Instance = UART4; + huart4.Init.BaudRate = 115200; + huart4.Init.WordLength = UART_WORDLENGTH_8B; + huart4.Init.StopBits = UART_STOPBITS_1; + huart4.Init.Parity = UART_PARITY_NONE; + huart4.Init.Mode = UART_MODE_TX_RX; + huart4.Init.HwFlowCtl = UART_HWCONTROL_NONE; + huart4.Init.OverSampling = UART_OVERSAMPLING_16; + huart4.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; + huart4.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; + if (HAL_UART_Init(&huart4) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN UART4_Init 2 */ + + /* USER CODE END UART4_Init 2 */ + +} + +/** + * Enable DMA controller clock + */ +static void MX_DMA_Init(void) +{ + + /* DMA controller clock enable */ + __HAL_RCC_DMA1_CLK_ENABLE(); + __HAL_RCC_DMA2_CLK_ENABLE(); + + /* DMA interrupt init */ + /* DMA1_Channel1_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn); + /* DMA2_Channel1_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(DMA2_Channel1_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(DMA2_Channel1_IRQn); + +} + +/** + * @brief GPIO Initialization Function + * @param None + * @retval None + */ +static void MX_GPIO_Init(void) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; +/* USER CODE BEGIN MX_GPIO_Init_1 */ +/* USER CODE END MX_GPIO_Init_1 */ + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOF_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOB, IN11_Pin|IN12_Pin|IN13_Pin|IN9_Pin + |IN3_Pin|IN8_Pin|IN5_Pin|IN4_Pin + |DSEL0_Pin|DSEL1_Pin|PC_EN_Pin|IN7_Pin + |IN10_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOC, LED4_Pin|LED3_Pin|LED2_Pin|LED1_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(GPIOA, IN2_Pin|IN1_Pin|IN6_Pin, GPIO_PIN_RESET); + + /*Configure GPIO pins : IN11_Pin IN12_Pin IN13_Pin IN9_Pin + IN3_Pin IN8_Pin IN5_Pin IN4_Pin + DSEL0_Pin DSEL1_Pin PC_EN_Pin IN7_Pin + IN10_Pin */ + GPIO_InitStruct.Pin = IN11_Pin|IN12_Pin|IN13_Pin|IN9_Pin + |IN3_Pin|IN8_Pin|IN5_Pin|IN4_Pin + |DSEL0_Pin|DSEL1_Pin|PC_EN_Pin|IN7_Pin + |IN10_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + /*Configure GPIO pins : LED4_Pin LED3_Pin LED2_Pin LED1_Pin */ + GPIO_InitStruct.Pin = LED4_Pin|LED3_Pin|LED2_Pin|LED1_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /*Configure GPIO pins : IN2_Pin IN1_Pin IN6_Pin */ + GPIO_InitStruct.Pin = IN2_Pin|IN1_Pin|IN6_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + +/* USER CODE BEGIN MX_GPIO_Init_2 */ +/* USER CODE END MX_GPIO_Init_2 */ +} + +/* USER CODE BEGIN 4 */ + +/* USER CODE END 4 */ + +/** + * @brief This function is executed in case of error occurrence. + * @retval None + */ +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + __disable_irq(); + while (1) + { + } + /* USER CODE END Error_Handler_Debug */ +} + +#ifdef USE_FULL_ASSERT +/** + * @brief Reports the name of the source file and the source line number + * where the assert_param error has occurred. + * @param file: pointer to the source file name + * @param line: assert_param error line source number + * @retval None + */ +void assert_failed(uint8_t *file, uint32_t line) +{ + /* USER CODE BEGIN 6 */ + /* User can add his own implementation to report the file name and line number, + ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ + /* USER CODE END 6 */ +} +#endif /* USE_FULL_ASSERT */ diff --git a/Software/Code/Core/Src/stm32f3xx_hal_msp.c b/Software/Code/Core/Src/stm32f3xx_hal_msp.c new file mode 100644 index 0000000..aeee5fc --- /dev/null +++ b/Software/Code/Core/Src/stm32f3xx_hal_msp.c @@ -0,0 +1,490 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32f3xx_hal_msp.c + * @brief This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + * Copyright (c) 2025 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ +extern DMA_HandleTypeDef hdma_adc1; + +extern DMA_HandleTypeDef hdma_adc2; + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Define */ + +/* USER CODE END Define */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Macro */ + +/* USER CODE END Macro */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* External functions --------------------------------------------------------*/ +/* USER CODE BEGIN ExternalFunctions */ + +/* USER CODE END ExternalFunctions */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_SYSCFG_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); + + /* System interrupt init*/ + + /* USER CODE BEGIN MspInit 1 */ + + /* USER CODE END MspInit 1 */ +} + +static uint32_t HAL_RCC_ADC12_CLK_ENABLED=0; + +/** +* @brief ADC MSP Initialization +* This function configures the hardware resources used in this example +* @param hadc: ADC handle pointer +* @retval None +*/ +void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(hadc->Instance==ADC1) + { + /* USER CODE BEGIN ADC1_MspInit 0 */ + + /* USER CODE END ADC1_MspInit 0 */ + /* Peripheral clock enable */ + HAL_RCC_ADC12_CLK_ENABLED++; + if(HAL_RCC_ADC12_CLK_ENABLED==1){ + __HAL_RCC_ADC12_CLK_ENABLE(); + } + + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOF_CLK_ENABLE(); + /**ADC1 GPIO Configuration + PC0 ------> ADC1_IN6 + PC1 ------> ADC1_IN7 + PC2 ------> ADC1_IN8 + PA0 ------> ADC1_IN1 + PA1 ------> ADC1_IN2 + PA2 ------> ADC1_IN3 + PA3 ------> ADC1_IN4 + PF4 ------> ADC1_IN5 + */ + GPIO_InitStruct.Pin = LVMS_Vsense_Pin|IS10_Pin|IS6_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = ASMS_Vsense_Pin|IS1_Pin|IS2_Pin|IS9_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = IS11_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(IS11_GPIO_Port, &GPIO_InitStruct); + + /* ADC1 DMA Init */ + /* ADC1 Init */ + hdma_adc1.Instance = DMA1_Channel1; + hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_adc1.Init.MemInc = DMA_MINC_ENABLE; + hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; + hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; + hdma_adc1.Init.Mode = DMA_CIRCULAR; + hdma_adc1.Init.Priority = DMA_PRIORITY_LOW; + if (HAL_DMA_Init(&hdma_adc1) != HAL_OK) + { + Error_Handler(); + } + + __HAL_LINKDMA(hadc,DMA_Handle,hdma_adc1); + + /* ADC1 interrupt Init */ + HAL_NVIC_SetPriority(ADC1_2_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(ADC1_2_IRQn); + /* USER CODE BEGIN ADC1_MspInit 1 */ + + /* USER CODE END ADC1_MspInit 1 */ + } + else if(hadc->Instance==ADC2) + { + /* USER CODE BEGIN ADC2_MspInit 0 */ + + /* USER CODE END ADC2_MspInit 0 */ + /* Peripheral clock enable */ + HAL_RCC_ADC12_CLK_ENABLED++; + if(HAL_RCC_ADC12_CLK_ENABLED==1){ + __HAL_RCC_ADC12_CLK_ENABLE(); + } + + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**ADC2 GPIO Configuration + PC3 ------> ADC2_IN9 + PA4 ------> ADC2_IN1 + PA5 ------> ADC2_IN2 + PA6 ------> ADC2_IN3 + PA7 ------> ADC2_IN4 + PC4 ------> ADC2_IN5 + */ + GPIO_InitStruct.Pin = IS7_Pin|PC_Read_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = IS3_Pin|IS8_Pin|IS4_Pin|IS5_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* ADC2 DMA Init */ + /* ADC2 Init */ + hdma_adc2.Instance = DMA2_Channel1; + hdma_adc2.Init.Direction = DMA_PERIPH_TO_MEMORY; + hdma_adc2.Init.PeriphInc = DMA_PINC_DISABLE; + hdma_adc2.Init.MemInc = DMA_MINC_ENABLE; + hdma_adc2.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD; + hdma_adc2.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD; + hdma_adc2.Init.Mode = DMA_CIRCULAR; + hdma_adc2.Init.Priority = DMA_PRIORITY_LOW; + if (HAL_DMA_Init(&hdma_adc2) != HAL_OK) + { + Error_Handler(); + } + + __HAL_LINKDMA(hadc,DMA_Handle,hdma_adc2); + + /* ADC2 interrupt Init */ + HAL_NVIC_SetPriority(ADC1_2_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(ADC1_2_IRQn); + /* USER CODE BEGIN ADC2_MspInit 1 */ + + /* USER CODE END ADC2_MspInit 1 */ + } + +} + +/** +* @brief ADC MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param hadc: ADC handle pointer +* @retval None +*/ +void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc) +{ + if(hadc->Instance==ADC1) + { + /* USER CODE BEGIN ADC1_MspDeInit 0 */ + + /* USER CODE END ADC1_MspDeInit 0 */ + /* Peripheral clock disable */ + HAL_RCC_ADC12_CLK_ENABLED--; + if(HAL_RCC_ADC12_CLK_ENABLED==0){ + __HAL_RCC_ADC12_CLK_DISABLE(); + } + + /**ADC1 GPIO Configuration + PC0 ------> ADC1_IN6 + PC1 ------> ADC1_IN7 + PC2 ------> ADC1_IN8 + PA0 ------> ADC1_IN1 + PA1 ------> ADC1_IN2 + PA2 ------> ADC1_IN3 + PA3 ------> ADC1_IN4 + PF4 ------> ADC1_IN5 + */ + HAL_GPIO_DeInit(GPIOC, LVMS_Vsense_Pin|IS10_Pin|IS6_Pin); + + HAL_GPIO_DeInit(GPIOA, ASMS_Vsense_Pin|IS1_Pin|IS2_Pin|IS9_Pin); + + HAL_GPIO_DeInit(IS11_GPIO_Port, IS11_Pin); + + /* ADC1 DMA DeInit */ + HAL_DMA_DeInit(hadc->DMA_Handle); + + /* ADC1 interrupt DeInit */ + /* USER CODE BEGIN ADC1:ADC1_2_IRQn disable */ + /** + * Uncomment the line below to disable the "ADC1_2_IRQn" interrupt + * Be aware, disabling shared interrupt may affect other IPs + */ + /* HAL_NVIC_DisableIRQ(ADC1_2_IRQn); */ + /* USER CODE END ADC1:ADC1_2_IRQn disable */ + + /* USER CODE BEGIN ADC1_MspDeInit 1 */ + + /* USER CODE END ADC1_MspDeInit 1 */ + } + else if(hadc->Instance==ADC2) + { + /* USER CODE BEGIN ADC2_MspDeInit 0 */ + + /* USER CODE END ADC2_MspDeInit 0 */ + /* Peripheral clock disable */ + HAL_RCC_ADC12_CLK_ENABLED--; + if(HAL_RCC_ADC12_CLK_ENABLED==0){ + __HAL_RCC_ADC12_CLK_DISABLE(); + } + + /**ADC2 GPIO Configuration + PC3 ------> ADC2_IN9 + PA4 ------> ADC2_IN1 + PA5 ------> ADC2_IN2 + PA6 ------> ADC2_IN3 + PA7 ------> ADC2_IN4 + PC4 ------> ADC2_IN5 + */ + HAL_GPIO_DeInit(GPIOC, IS7_Pin|PC_Read_Pin); + + HAL_GPIO_DeInit(GPIOA, IS3_Pin|IS8_Pin|IS4_Pin|IS5_Pin); + + /* ADC2 DMA DeInit */ + HAL_DMA_DeInit(hadc->DMA_Handle); + + /* ADC2 interrupt DeInit */ + /* USER CODE BEGIN ADC2:ADC1_2_IRQn disable */ + /** + * Uncomment the line below to disable the "ADC1_2_IRQn" interrupt + * Be aware, disabling shared interrupt may affect other IPs + */ + /* HAL_NVIC_DisableIRQ(ADC1_2_IRQn); */ + /* USER CODE END ADC2:ADC1_2_IRQn disable */ + + /* USER CODE BEGIN ADC2_MspDeInit 1 */ + + /* USER CODE END ADC2_MspDeInit 1 */ + } + +} + +/** +* @brief CAN MSP Initialization +* This function configures the hardware resources used in this example +* @param hcan: CAN handle pointer +* @retval None +*/ +void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(hcan->Instance==CAN) + { + /* USER CODE BEGIN CAN_MspInit 0 */ + + /* USER CODE END CAN_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_CAN1_CLK_ENABLE(); + + __HAL_RCC_GPIOA_CLK_ENABLE(); + /**CAN GPIO Configuration + PA11 ------> CAN_RX + PA12 ------> CAN_TX + */ + GPIO_InitStruct.Pin = GPIO_PIN_11|GPIO_PIN_12; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF9_CAN; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + /* USER CODE BEGIN CAN_MspInit 1 */ + + /* USER CODE END CAN_MspInit 1 */ + } + +} + +/** +* @brief CAN MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param hcan: CAN handle pointer +* @retval None +*/ +void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan) +{ + if(hcan->Instance==CAN) + { + /* USER CODE BEGIN CAN_MspDeInit 0 */ + + /* USER CODE END CAN_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_CAN1_CLK_DISABLE(); + + /**CAN GPIO Configuration + PA11 ------> CAN_RX + PA12 ------> CAN_TX + */ + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12); + + /* USER CODE BEGIN CAN_MspDeInit 1 */ + + /* USER CODE END CAN_MspDeInit 1 */ + } + +} + +/** +* @brief TIM_Base MSP Initialization +* This function configures the hardware resources used in this example +* @param htim_base: TIM_Base handle pointer +* @retval None +*/ +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base) +{ + if(htim_base->Instance==TIM6) + { + /* USER CODE BEGIN TIM6_MspInit 0 */ + + /* USER CODE END TIM6_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_TIM6_CLK_ENABLE(); + /* TIM6 interrupt Init */ + HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 0, 0); + HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn); + /* USER CODE BEGIN TIM6_MspInit 1 */ + + /* USER CODE END TIM6_MspInit 1 */ + } + +} + +/** +* @brief TIM_Base MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param htim_base: TIM_Base handle pointer +* @retval None +*/ +void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base) +{ + if(htim_base->Instance==TIM6) + { + /* USER CODE BEGIN TIM6_MspDeInit 0 */ + + /* USER CODE END TIM6_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_TIM6_CLK_DISABLE(); + + /* TIM6 interrupt DeInit */ + HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn); + /* USER CODE BEGIN TIM6_MspDeInit 1 */ + + /* USER CODE END TIM6_MspDeInit 1 */ + } + +} + +/** +* @brief UART MSP Initialization +* This function configures the hardware resources used in this example +* @param huart: UART handle pointer +* @retval None +*/ +void HAL_UART_MspInit(UART_HandleTypeDef* huart) +{ + GPIO_InitTypeDef GPIO_InitStruct = {0}; + if(huart->Instance==UART4) + { + /* USER CODE BEGIN UART4_MspInit 0 */ + + /* USER CODE END UART4_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_UART4_CLK_ENABLE(); + + __HAL_RCC_GPIOC_CLK_ENABLE(); + /**UART4 GPIO Configuration + PC10 ------> UART4_TX + PC11 ------> UART4_RX + */ + GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF5_UART4; + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); + + /* USER CODE BEGIN UART4_MspInit 1 */ + + /* USER CODE END UART4_MspInit 1 */ + } + +} + +/** +* @brief UART MSP De-Initialization +* This function freeze the hardware resources used in this example +* @param huart: UART handle pointer +* @retval None +*/ +void HAL_UART_MspDeInit(UART_HandleTypeDef* huart) +{ + if(huart->Instance==UART4) + { + /* USER CODE BEGIN UART4_MspDeInit 0 */ + + /* USER CODE END UART4_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_UART4_CLK_DISABLE(); + + /**UART4 GPIO Configuration + PC10 ------> UART4_TX + PC11 ------> UART4_RX + */ + HAL_GPIO_DeInit(GPIOC, GPIO_PIN_10|GPIO_PIN_11); + + /* USER CODE BEGIN UART4_MspDeInit 1 */ + + /* USER CODE END UART4_MspDeInit 1 */ + } + +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ diff --git a/Software/Code/Core/Src/stm32f3xx_it.c b/Software/Code/Core/Src/stm32f3xx_it.c new file mode 100644 index 0000000..0fd478f --- /dev/null +++ b/Software/Code/Core/Src/stm32f3xx_it.c @@ -0,0 +1,264 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32f3xx_it.c + * @brief Interrupt Service Routines. + ****************************************************************************** + * @attention + * + * Copyright (c) 2025 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "stm32f3xx_it.h" +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ + +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Private user code ---------------------------------------------------------*/ +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ + +/* External variables --------------------------------------------------------*/ +extern DMA_HandleTypeDef hdma_adc1; +extern DMA_HandleTypeDef hdma_adc2; +extern ADC_HandleTypeDef hadc1; +extern ADC_HandleTypeDef hadc2; +extern TIM_HandleTypeDef htim6; +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/******************************************************************************/ +/* Cortex-M4 Processor Interruption and Exception Handlers */ +/******************************************************************************/ +/** + * @brief This function handles Non maskable interrupt. + */ +void NMI_Handler(void) +{ + /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ + + /* USER CODE END NonMaskableInt_IRQn 0 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ + while (1) + { + } + /* USER CODE END NonMaskableInt_IRQn 1 */ +} + +/** + * @brief This function handles Hard fault interrupt. + */ +void HardFault_Handler(void) +{ + /* USER CODE BEGIN HardFault_IRQn 0 */ + + /* USER CODE END HardFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + /* USER CODE END W1_HardFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } +} + +/** + * @brief This function handles Pre-fetch fault, memory access fault. + */ +void BusFault_Handler(void) +{ + /* USER CODE BEGIN BusFault_IRQn 0 */ + + /* USER CODE END BusFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_BusFault_IRQn 0 */ + /* USER CODE END W1_BusFault_IRQn 0 */ + } +} + +/** + * @brief This function handles Undefined instruction or illegal state. + */ +void UsageFault_Handler(void) +{ + /* USER CODE BEGIN UsageFault_IRQn 0 */ + + /* USER CODE END UsageFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ + /* USER CODE END W1_UsageFault_IRQn 0 */ + } +} + +/** + * @brief This function handles System service call via SWI instruction. + */ +void SVC_Handler(void) +{ + /* USER CODE BEGIN SVCall_IRQn 0 */ + + /* USER CODE END SVCall_IRQn 0 */ + /* USER CODE BEGIN SVCall_IRQn 1 */ + + /* USER CODE END SVCall_IRQn 1 */ +} + +/** + * @brief This function handles Debug monitor. + */ +void DebugMon_Handler(void) +{ + /* USER CODE BEGIN DebugMonitor_IRQn 0 */ + + /* USER CODE END DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 1 */ + + /* USER CODE END DebugMonitor_IRQn 1 */ +} + +/** + * @brief This function handles Pendable request for system service. + */ +void PendSV_Handler(void) +{ + /* USER CODE BEGIN PendSV_IRQn 0 */ + + /* USER CODE END PendSV_IRQn 0 */ + /* USER CODE BEGIN PendSV_IRQn 1 */ + + /* USER CODE END PendSV_IRQn 1 */ +} + +/** + * @brief This function handles System tick timer. + */ +void SysTick_Handler(void) +{ + /* USER CODE BEGIN SysTick_IRQn 0 */ + + /* USER CODE END SysTick_IRQn 0 */ + HAL_IncTick(); + /* USER CODE BEGIN SysTick_IRQn 1 */ + + /* USER CODE END SysTick_IRQn 1 */ +} + +/******************************************************************************/ +/* STM32F3xx Peripheral Interrupt Handlers */ +/* Add here the Interrupt Handlers for the used peripherals. */ +/* For the available peripheral interrupt handler names, */ +/* please refer to the startup file (startup_stm32f3xx.s). */ +/******************************************************************************/ + +/** + * @brief This function handles DMA1 channel1 global interrupt. + */ +void DMA1_Channel1_IRQHandler(void) +{ + /* USER CODE BEGIN DMA1_Channel1_IRQn 0 */ + + /* USER CODE END DMA1_Channel1_IRQn 0 */ + HAL_DMA_IRQHandler(&hdma_adc1); + /* USER CODE BEGIN DMA1_Channel1_IRQn 1 */ + + /* USER CODE END DMA1_Channel1_IRQn 1 */ +} + +/** + * @brief This function handles ADC1 and ADC2 interrupts. + */ +void ADC1_2_IRQHandler(void) +{ + /* USER CODE BEGIN ADC1_2_IRQn 0 */ + + /* USER CODE END ADC1_2_IRQn 0 */ + HAL_ADC_IRQHandler(&hadc1); + HAL_ADC_IRQHandler(&hadc2); + /* USER CODE BEGIN ADC1_2_IRQn 1 */ + + /* USER CODE END ADC1_2_IRQn 1 */ +} + +/** + * @brief This function handles Timer 6 interrupt and DAC underrun interrupts. + */ +void TIM6_DAC_IRQHandler(void) +{ + /* USER CODE BEGIN TIM6_DAC_IRQn 0 */ + + /* USER CODE END TIM6_DAC_IRQn 0 */ + HAL_TIM_IRQHandler(&htim6); + /* USER CODE BEGIN TIM6_DAC_IRQn 1 */ + + /* USER CODE END TIM6_DAC_IRQn 1 */ +} + +/** + * @brief This function handles DMA2 channel1 global interrupt. + */ +void DMA2_Channel1_IRQHandler(void) +{ + /* USER CODE BEGIN DMA2_Channel1_IRQn 0 */ + + /* USER CODE END DMA2_Channel1_IRQn 0 */ + HAL_DMA_IRQHandler(&hdma_adc2); + /* USER CODE BEGIN DMA2_Channel1_IRQn 1 */ + + /* USER CODE END DMA2_Channel1_IRQn 1 */ +} + +/* USER CODE BEGIN 1 */ + +/* USER CODE END 1 */ diff --git a/Software/Code/Core/Src/syscalls.c b/Software/Code/Core/Src/syscalls.c new file mode 100644 index 0000000..f3462a0 --- /dev/null +++ b/Software/Code/Core/Src/syscalls.c @@ -0,0 +1,176 @@ +/** + ****************************************************************************** + * @file syscalls.c + * @author Auto-generated by STM32CubeIDE + * @brief STM32CubeIDE Minimal System calls file + * + * For more information about which c-functions + * need which of these lowlevel functions + * please consult the Newlib libc-manual + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2024 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes */ +#include +#include +#include +#include +#include +#include +#include +#include + + +/* Variables */ +extern int __io_putchar(int ch) __attribute__((weak)); +extern int __io_getchar(void) __attribute__((weak)); + + +char *__env[1] = { 0 }; +char **environ = __env; + + +/* Functions */ +void initialise_monitor_handles() +{ +} + +int _getpid(void) +{ + return 1; +} + +int _kill(int pid, int sig) +{ + (void)pid; + (void)sig; + errno = EINVAL; + return -1; +} + +void _exit (int status) +{ + _kill(status, -1); + while (1) {} /* Make sure we hang here */ +} + +__attribute__((weak)) int _read(int file, char *ptr, int len) +{ + (void)file; + int DataIdx; + + for (DataIdx = 0; DataIdx < len; DataIdx++) + { + *ptr++ = __io_getchar(); + } + + return len; +} + +__attribute__((weak)) int _write(int file, char *ptr, int len) +{ + (void)file; + int DataIdx; + + for (DataIdx = 0; DataIdx < len; DataIdx++) + { + __io_putchar(*ptr++); + } + return len; +} + +int _close(int file) +{ + (void)file; + return -1; +} + + +int _fstat(int file, struct stat *st) +{ + (void)file; + st->st_mode = S_IFCHR; + return 0; +} + +int _isatty(int file) +{ + (void)file; + return 1; +} + +int _lseek(int file, int ptr, int dir) +{ + (void)file; + (void)ptr; + (void)dir; + return 0; +} + +int _open(char *path, int flags, ...) +{ + (void)path; + (void)flags; + /* Pretend like we always fail */ + return -1; +} + +int _wait(int *status) +{ + (void)status; + errno = ECHILD; + return -1; +} + +int _unlink(char *name) +{ + (void)name; + errno = ENOENT; + return -1; +} + +int _times(struct tms *buf) +{ + (void)buf; + return -1; +} + +int _stat(char *file, struct stat *st) +{ + (void)file; + st->st_mode = S_IFCHR; + return 0; +} + +int _link(char *old, char *new) +{ + (void)old; + (void)new; + errno = EMLINK; + return -1; +} + +int _fork(void) +{ + errno = EAGAIN; + return -1; +} + +int _execve(char *name, char **argv, char **env) +{ + (void)name; + (void)argv; + (void)env; + errno = ENOMEM; + return -1; +} diff --git a/Software/Code/Core/Src/sysmem.c b/Software/Code/Core/Src/sysmem.c new file mode 100644 index 0000000..6122419 --- /dev/null +++ b/Software/Code/Core/Src/sysmem.c @@ -0,0 +1,79 @@ +/** + ****************************************************************************** + * @file sysmem.c + * @author Generated by STM32CubeIDE + * @brief STM32CubeIDE System Memory calls file + * + * For more information about which C functions + * need which of these lowlevel functions + * please consult the newlib libc manual + ****************************************************************************** + * @attention + * + * Copyright (c) 2024 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes */ +#include +#include + +/** + * Pointer to the current high watermark of the heap usage + */ +static uint8_t *__sbrk_heap_end = NULL; + +/** + * @brief _sbrk() allocates memory to the newlib heap and is used by malloc + * and others from the C library + * + * @verbatim + * ############################################################################ + * # .data # .bss # newlib heap # MSP stack # + * # # # # Reserved by _Min_Stack_Size # + * ############################################################################ + * ^-- RAM start ^-- _end _estack, RAM end --^ + * @endverbatim + * + * This implementation starts allocating at the '_end' linker symbol + * The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack + * The implementation considers '_estack' linker symbol to be RAM end + * NOTE: If the MSP stack, at any point during execution, grows larger than the + * reserved size, please increase the '_Min_Stack_Size'. + * + * @param incr Memory size + * @return Pointer to allocated memory + */ +void *_sbrk(ptrdiff_t incr) +{ + extern uint8_t _end; /* Symbol defined in the linker script */ + extern uint8_t _estack; /* Symbol defined in the linker script */ + extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */ + const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size; + const uint8_t *max_heap = (uint8_t *)stack_limit; + uint8_t *prev_heap_end; + + /* Initialize heap end at first call */ + if (NULL == __sbrk_heap_end) + { + __sbrk_heap_end = &_end; + } + + /* Protect heap from growing into the reserved MSP stack */ + if (__sbrk_heap_end + incr > max_heap) + { + errno = ENOMEM; + return (void *)-1; + } + + prev_heap_end = __sbrk_heap_end; + __sbrk_heap_end += incr; + + return (void *)prev_heap_end; +} diff --git a/Software/Code/Core/Src/system_stm32f3xx.c b/Software/Code/Core/Src/system_stm32f3xx.c new file mode 100644 index 0000000..27d9350 --- /dev/null +++ b/Software/Code/Core/Src/system_stm32f3xx.c @@ -0,0 +1,287 @@ +/** + ****************************************************************************** + * @file system_stm32f3xx.c + * @author MCD Application Team + * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. + * + * 1. This file provides two functions and one global variable to be called from + * user application: + * - SystemInit(): This function is called at startup just after reset and + * before branch to main program. This call is made inside + * the "startup_stm32f3xx.s" file. + * + * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used + * by the user application to setup the SysTick + * timer or configure other parameters. + * + * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must + * be called whenever the core clock is changed + * during program execution. + * + * 2. After each device reset the HSI (8 MHz) is used as system clock source. + * Then SystemInit() function is called, in "startup_stm32f3xx.s" file, to + * configure the system clock before to branch to main program. + * + * 3. This file configures the system clock as follows: + *============================================================================= + * Supported STM32F3xx device + *----------------------------------------------------------------------------- + * System Clock source | HSI + *----------------------------------------------------------------------------- + * SYSCLK(Hz) | 8000000 + *----------------------------------------------------------------------------- + * HCLK(Hz) | 8000000 + *----------------------------------------------------------------------------- + * AHB Prescaler | 1 + *----------------------------------------------------------------------------- + * APB2 Prescaler | 1 + *----------------------------------------------------------------------------- + * APB1 Prescaler | 1 + *----------------------------------------------------------------------------- + * USB Clock | DISABLE + *----------------------------------------------------------------------------- + *============================================================================= + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/** @addtogroup CMSIS + * @{ + */ + +/** @addtogroup stm32f3xx_system + * @{ + */ + +/** @addtogroup STM32F3xx_System_Private_Includes + * @{ + */ + +#include "stm32f3xx.h" + +/** + * @} + */ + +/** @addtogroup STM32F3xx_System_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F3xx_System_Private_Defines + * @{ + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz. + This value can be provided and adapted by the user application. */ +#endif /* HSE_VALUE */ + +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)8000000) /*!< Default value of the Internal oscillator in Hz. + This value can be provided and adapted by the user application. */ +#endif /* HSI_VALUE */ + +/* Note: Following vector table addresses must be defined in line with linker + configuration. */ +/*!< Uncomment the following line if you need to relocate the vector table + anywhere in Flash or Sram, else the vector table is kept at the automatic + remap of boot address selected */ +/* #define USER_VECT_TAB_ADDRESS */ + +#if defined(USER_VECT_TAB_ADDRESS) +/*!< Uncomment the following line if you need to relocate your vector Table + in Sram else user remap will be done in Flash. */ +/* #define VECT_TAB_SRAM */ +#if defined(VECT_TAB_SRAM) +#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field. + This value must be a multiple of 0x200. */ +#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. + This value must be a multiple of 0x200. */ +#else +#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field. + This value must be a multiple of 0x200. */ +#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field. + This value must be a multiple of 0x200. */ +#endif /* VECT_TAB_SRAM */ +#endif /* USER_VECT_TAB_ADDRESS */ + +/******************************************************************************/ +/** + * @} + */ + +/** @addtogroup STM32F3xx_System_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F3xx_System_Private_Variables + * @{ + */ + /* This variable is updated in three ways: + 1) by calling CMSIS function SystemCoreClockUpdate() + 2) by calling HAL API function HAL_RCC_GetHCLKFreq() + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + Note: If you use this function to configure the system clock there is no need to + call the 2 first functions listed above, since SystemCoreClock variable is + updated automatically. + */ +uint32_t SystemCoreClock = 8000000; + +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + +/** + * @} + */ + +/** @addtogroup STM32F3xx_System_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32F3xx_System_Private_Functions + * @{ + */ + +/** + * @brief Setup the microcontroller system + * @param None + * @retval None + */ +void SystemInit(void) +{ +/* FPU settings --------------------------------------------------------------*/ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ +#endif + + /* Configure the Vector Table location -------------------------------------*/ +#if defined(USER_VECT_TAB_ADDRESS) + SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ +#endif /* USER_VECT_TAB_ADDRESS */ +} + +/** + * @brief Update SystemCoreClock variable according to Clock Register Values. + * The SystemCoreClock variable contains the core clock (HCLK), it can + * be used by the user application to setup the SysTick timer or configure + * other parameters. + * + * @note Each time the core clock (HCLK) changes, this function must be called + * to update SystemCoreClock variable value. Otherwise, any configuration + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * + * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) + * + * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) + * or HSI_VALUE(*) multiplied/divided by the PLL factors. + * + * (*) HSI_VALUE is a constant defined in stm32f3xx_hal.h file (default value + * 8 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (**) HSE_VALUE is a constant defined in stm32f3xx_hal.h file (default value + * 8 MHz), user has to ensure that HSE_VALUE is same as the real + * frequency of the crystal used. Otherwise, this function may + * have wrong result. + * + * - The result of this function could be not correct when using fractional + * value for HSE crystal. + * + * @param None + * @retval None + */ +void SystemCoreClockUpdate (void) +{ + uint32_t tmp = 0, pllmull = 0, pllsource = 0, predivfactor = 0; + + /* Get SYSCLK source -------------------------------------------------------*/ + tmp = RCC->CFGR & RCC_CFGR_SWS; + + switch (tmp) + { + case RCC_CFGR_SWS_HSI: /* HSI used as system clock */ + SystemCoreClock = HSI_VALUE; + break; + case RCC_CFGR_SWS_HSE: /* HSE used as system clock */ + SystemCoreClock = HSE_VALUE; + break; + case RCC_CFGR_SWS_PLL: /* PLL used as system clock */ + /* Get PLL clock source and multiplication factor ----------------------*/ + pllmull = RCC->CFGR & RCC_CFGR_PLLMUL; + pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; + pllmull = ( pllmull >> 18) + 2; + +#if defined (STM32F302xE) || defined (STM32F303xE) || defined (STM32F398xx) + predivfactor = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1; + if (pllsource == RCC_CFGR_PLLSRC_HSE_PREDIV) + { + /* HSE oscillator clock selected as PREDIV1 clock entry */ + SystemCoreClock = (HSE_VALUE / predivfactor) * pllmull; + } + else + { + /* HSI oscillator clock selected as PREDIV1 clock entry */ + SystemCoreClock = (HSI_VALUE / predivfactor) * pllmull; + } +#else + if (pllsource == RCC_CFGR_PLLSRC_HSI_DIV2) + { + /* HSI oscillator clock divided by 2 selected as PLL clock entry */ + SystemCoreClock = (HSI_VALUE >> 1) * pllmull; + } + else + { + predivfactor = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1; + /* HSE oscillator clock selected as PREDIV1 clock entry */ + SystemCoreClock = (HSE_VALUE / predivfactor) * pllmull; + } +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + break; + default: /* HSI used as system clock */ + SystemCoreClock = HSI_VALUE; + break; + } + /* Compute HCLK clock frequency ----------------*/ + /* Get HCLK prescaler */ + tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; + /* HCLK clock frequency */ + SystemCoreClock >>= tmp; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ diff --git a/Software/Code/Core/Startup/startup_stm32f302rbtx.s b/Software/Code/Core/Startup/startup_stm32f302rbtx.s new file mode 100644 index 0000000..b57b511 --- /dev/null +++ b/Software/Code/Core/Startup/startup_stm32f302rbtx.s @@ -0,0 +1,441 @@ +/** + ****************************************************************************** + * @file startup_stm32f302xc.s + * @author MCD Application Team + * @brief STM32F302xB/STM32F302xC devices vector table for GCC toolchain. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address, + * - Configure the clock system + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss + +.equ BootRAM, 0xF1E0F85F +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + ldr sp, =_estack /* Atollic update: set stack pointer */ + +/* Call the clock system initialization function.*/ + bl SystemInit + +/* Copy the data segment initializers from flash to SRAM */ + ldr r0, =_sdata + ldr r1, =_edata + ldr r2, =_sidata + movs r3, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r4, [r2, r3] + str r4, [r0, r3] + adds r3, r3, #4 + +LoopCopyDataInit: + adds r4, r0, r3 + cmp r4, r1 + bcc CopyDataInit + +/* Zero fill the bss segment. */ + ldr r2, =_sbss + ldr r4, =_ebss + movs r3, #0 + b LoopFillZerobss + +FillZerobss: + str r3, [r2] + adds r2, r2, #4 + +LoopFillZerobss: + cmp r2, r4 + bcc FillZerobss + +/* Call static constructors */ + bl __libc_init_array +/* Call the application's entry point.*/ + bl main + +LoopForever: + b LoopForever + +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * + * @param None + * @retval : None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex-M4. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + + +g_pfnVectors: + .word _estack + .word Reset_Handler + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + .word WWDG_IRQHandler + .word PVD_IRQHandler + .word TAMP_STAMP_IRQHandler + .word RTC_WKUP_IRQHandler + .word FLASH_IRQHandler + .word RCC_IRQHandler + .word EXTI0_IRQHandler + .word EXTI1_IRQHandler + .word EXTI2_TSC_IRQHandler + .word EXTI3_IRQHandler + .word EXTI4_IRQHandler + .word DMA1_Channel1_IRQHandler + .word DMA1_Channel2_IRQHandler + .word DMA1_Channel3_IRQHandler + .word DMA1_Channel4_IRQHandler + .word DMA1_Channel5_IRQHandler + .word DMA1_Channel6_IRQHandler + .word DMA1_Channel7_IRQHandler + .word ADC1_2_IRQHandler + .word USB_HP_CAN_TX_IRQHandler + .word USB_LP_CAN_RX0_IRQHandler + .word CAN_RX1_IRQHandler + .word CAN_SCE_IRQHandler + .word EXTI9_5_IRQHandler + .word TIM1_BRK_TIM15_IRQHandler + .word TIM1_UP_TIM16_IRQHandler + .word TIM1_TRG_COM_TIM17_IRQHandler + .word TIM1_CC_IRQHandler + .word TIM2_IRQHandler + .word TIM3_IRQHandler + .word TIM4_IRQHandler + .word I2C1_EV_IRQHandler + .word I2C1_ER_IRQHandler + .word I2C2_EV_IRQHandler + .word I2C2_ER_IRQHandler + .word SPI1_IRQHandler + .word SPI2_IRQHandler + .word USART1_IRQHandler + .word USART2_IRQHandler + .word USART3_IRQHandler + .word EXTI15_10_IRQHandler + .word RTC_Alarm_IRQHandler + .word USBWakeUp_IRQHandler + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word SPI3_IRQHandler + .word UART4_IRQHandler + .word UART5_IRQHandler + .word TIM6_DAC_IRQHandler + .word 0 + .word DMA2_Channel1_IRQHandler + .word DMA2_Channel2_IRQHandler + .word DMA2_Channel3_IRQHandler + .word DMA2_Channel4_IRQHandler + .word DMA2_Channel5_IRQHandler + .word 0 + .word 0 + .word 0 + .word COMP1_2_IRQHandler + .word COMP4_6_IRQHandler + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word USB_HP_IRQHandler + .word USB_LP_IRQHandler + .word USBWakeUp_RMP_IRQHandler + .word 0 + .word 0 + .word 0 + .word 0 + .word FPU_IRQHandler + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_IRQHandler + .thumb_set PVD_IRQHandler,Default_Handler + + .weak TAMP_STAMP_IRQHandler + .thumb_set TAMP_STAMP_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_TSC_IRQHandler + .thumb_set EXTI2_TSC_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Channel1_IRQHandler + .thumb_set DMA1_Channel1_IRQHandler,Default_Handler + + .weak DMA1_Channel2_IRQHandler + .thumb_set DMA1_Channel2_IRQHandler,Default_Handler + + .weak DMA1_Channel3_IRQHandler + .thumb_set DMA1_Channel3_IRQHandler,Default_Handler + + .weak DMA1_Channel4_IRQHandler + .thumb_set DMA1_Channel4_IRQHandler,Default_Handler + + .weak DMA1_Channel5_IRQHandler + .thumb_set DMA1_Channel5_IRQHandler,Default_Handler + + .weak DMA1_Channel6_IRQHandler + .thumb_set DMA1_Channel6_IRQHandler,Default_Handler + + .weak DMA1_Channel7_IRQHandler + .thumb_set DMA1_Channel7_IRQHandler,Default_Handler + + .weak ADC1_2_IRQHandler + .thumb_set ADC1_2_IRQHandler,Default_Handler + + .weak USB_HP_CAN_TX_IRQHandler + .thumb_set USB_HP_CAN_TX_IRQHandler,Default_Handler + + .weak USB_LP_CAN_RX0_IRQHandler + .thumb_set USB_LP_CAN_RX0_IRQHandler,Default_Handler + + .weak CAN_RX1_IRQHandler + .thumb_set CAN_RX1_IRQHandler,Default_Handler + + .weak CAN_SCE_IRQHandler + .thumb_set CAN_SCE_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_TIM15_IRQHandler + .thumb_set TIM1_BRK_TIM15_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM16_IRQHandler + .thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM17_IRQHandler + .thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak TIM3_IRQHandler + .thumb_set TIM3_IRQHandler,Default_Handler + + .weak TIM4_IRQHandler + .thumb_set TIM4_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C2_EV_IRQHandler + .thumb_set I2C2_EV_IRQHandler,Default_Handler + + .weak I2C2_ER_IRQHandler + .thumb_set I2C2_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak USART2_IRQHandler + .thumb_set USART2_IRQHandler,Default_Handler + + .weak USART3_IRQHandler + .thumb_set USART3_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak USBWakeUp_IRQHandler + .thumb_set USBWakeUp_IRQHandler,Default_Handler + + .weak SPI3_IRQHandler + .thumb_set SPI3_IRQHandler,Default_Handler + + .weak UART4_IRQHandler + .thumb_set UART4_IRQHandler,Default_Handler + + .weak UART5_IRQHandler + .thumb_set UART5_IRQHandler,Default_Handler + + .weak TIM6_DAC_IRQHandler + .thumb_set TIM6_DAC_IRQHandler,Default_Handler + + .weak DMA2_Channel1_IRQHandler + .thumb_set DMA2_Channel1_IRQHandler,Default_Handler + + .weak DMA2_Channel2_IRQHandler + .thumb_set DMA2_Channel2_IRQHandler,Default_Handler + + .weak DMA2_Channel3_IRQHandler + .thumb_set DMA2_Channel3_IRQHandler,Default_Handler + + .weak DMA2_Channel4_IRQHandler + .thumb_set DMA2_Channel4_IRQHandler,Default_Handler + + .weak DMA2_Channel5_IRQHandler + .thumb_set DMA2_Channel5_IRQHandler,Default_Handler + + .weak COMP1_2_IRQHandler + .thumb_set COMP1_2_IRQHandler,Default_Handler + + .weak COMP4_6_IRQHandler + .thumb_set COMP4_6_IRQHandler,Default_Handler + + .weak USB_HP_IRQHandler + .thumb_set USB_HP_IRQHandler,Default_Handler + + .weak USB_LP_IRQHandler + .thumb_set USB_LP_IRQHandler,Default_Handler + + .weak USBWakeUp_RMP_IRQHandler + .thumb_set USBWakeUp_RMP_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/Software/Code/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f302xc.h b/Software/Code/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f302xc.h new file mode 100644 index 0000000..e666f1a --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f302xc.h @@ -0,0 +1,12736 @@ +/** + ****************************************************************************** + * @file stm32f302xc.h + * @author MCD Application Team + * @brief CMSIS STM32F302xC Devices Peripheral Access Layer Header File. + * + * This file contains: + * - Data structures and the address mapping for all peripherals + * - Peripheral's registers declarations and bits definition + * - Macros to access peripheral's registers hardware + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/** @addtogroup CMSIS_Device + * @{ + */ + +/** @addtogroup stm32f302xc + * @{ + */ + +#ifndef __STM32F302xC_H +#define __STM32F302xC_H + +#ifdef __cplusplus + extern "C" { +#endif /* __cplusplus */ + +/** @addtogroup Configuration_section_for_CMSIS + * @{ + */ + +/** + * @brief Configuration of the Cortex-M4 Processor and Core Peripherals + */ +#define __CM4_REV 0x0001U /*!< Core revision r0p1 */ +#define __MPU_PRESENT 1U /*!< STM32F302xC devices provide an MPU */ +#define __NVIC_PRIO_BITS 4U /*!< STM32F302xC devices use 4 Bits for the Priority Levels */ +#define __Vendor_SysTickConfig 0U /*!< Set to 1 if different SysTick Config is used */ +#define __FPU_PRESENT 1U /*!< STM32F302xC devices provide an FPU */ + +/** + * @} + */ + +/** @addtogroup Peripheral_interrupt_number_definition + * @{ + */ + +/** + * @brief STM32F302xC devices Interrupt Number Definition, according to the selected device + * in @ref Library_configuration_section + */ +typedef enum +{ +/****** Cortex-M4 Processor Exceptions Numbers ****************************************************************/ + NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */ + HardFault_IRQn = -13, /*!< 3 Cortex-M4 Hard Fault Interrupt */ + MemoryManagement_IRQn = -12, /*!< 4 Cortex-M4 Memory Management Interrupt */ + BusFault_IRQn = -11, /*!< 5 Cortex-M4 Bus Fault Interrupt */ + UsageFault_IRQn = -10, /*!< 6 Cortex-M4 Usage Fault Interrupt */ + SVCall_IRQn = -5, /*!< 11 Cortex-M4 SV Call Interrupt */ + DebugMonitor_IRQn = -4, /*!< 12 Cortex-M4 Debug Monitor Interrupt */ + PendSV_IRQn = -2, /*!< 14 Cortex-M4 Pend SV Interrupt */ + SysTick_IRQn = -1, /*!< 15 Cortex-M4 System Tick Interrupt */ +/****** STM32 specific Interrupt Numbers **********************************************************************/ + WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */ + PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */ + TAMP_STAMP_IRQn = 2, /*!< Tamper and TimeStamp interrupts through the EXTI line 19 */ + RTC_WKUP_IRQn = 3, /*!< RTC Wakeup interrupt through the EXTI line 20 */ + FLASH_IRQn = 4, /*!< FLASH global Interrupt */ + RCC_IRQn = 5, /*!< RCC global Interrupt */ + EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */ + EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */ + EXTI2_TSC_IRQn = 8, /*!< EXTI Line2 Interrupt and Touch Sense Controller Interrupt */ + EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */ + EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */ + DMA1_Channel1_IRQn = 11, /*!< DMA1 Channel 1 Interrupt */ + DMA1_Channel2_IRQn = 12, /*!< DMA1 Channel 2 Interrupt */ + DMA1_Channel3_IRQn = 13, /*!< DMA1 Channel 3 Interrupt */ + DMA1_Channel4_IRQn = 14, /*!< DMA1 Channel 4 Interrupt */ + DMA1_Channel5_IRQn = 15, /*!< DMA1 Channel 5 Interrupt */ + DMA1_Channel6_IRQn = 16, /*!< DMA1 Channel 6 Interrupt */ + DMA1_Channel7_IRQn = 17, /*!< DMA1 Channel 7 Interrupt */ + ADC1_2_IRQn = 18, /*!< ADC1 & ADC2 Interrupts */ + USB_HP_CAN_TX_IRQn = 19, /*!< USB Device High Priority or CAN TX Interrupts */ + USB_LP_CAN_RX0_IRQn = 20, /*!< USB Device Low Priority or CAN RX0 Interrupts */ + CAN_RX1_IRQn = 21, /*!< CAN RX1 Interrupt */ + CAN_SCE_IRQn = 22, /*!< CAN SCE Interrupt */ + EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */ + TIM1_BRK_TIM15_IRQn = 24, /*!< TIM1 Break and TIM15 Interrupts */ + TIM1_UP_TIM16_IRQn = 25, /*!< TIM1 Update and TIM16 Interrupts */ + TIM1_TRG_COM_TIM17_IRQn = 26, /*!< TIM1 Trigger and Commutation and TIM17 Interrupt */ + TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */ + TIM2_IRQn = 28, /*!< TIM2 global Interrupt */ + TIM3_IRQn = 29, /*!< TIM3 global Interrupt */ + TIM4_IRQn = 30, /*!< TIM4 global Interrupt */ + I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt & EXTI Line23 Interrupt (I2C1 wakeup) */ + I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */ + I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt & EXTI Line24 Interrupt (I2C2 wakeup) */ + I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */ + SPI1_IRQn = 35, /*!< SPI1 global Interrupt */ + SPI2_IRQn = 36, /*!< SPI2 global Interrupt */ + USART1_IRQn = 37, /*!< USART1 global Interrupt & EXTI Line25 Interrupt (USART1 wakeup) */ + USART2_IRQn = 38, /*!< USART2 global Interrupt & EXTI Line26 Interrupt (USART2 wakeup) */ + USART3_IRQn = 39, /*!< USART3 global Interrupt & EXTI Line28 Interrupt (USART3 wakeup) */ + EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */ + RTC_Alarm_IRQn = 41, /*!< RTC Alarm (A and B) through EXTI Line 17 Interrupt */ + USBWakeUp_IRQn = 42, /*!< USB Wakeup Interrupt */ + SPI3_IRQn = 51, /*!< SPI3 global Interrupt */ + UART4_IRQn = 52, /*!< UART4 global Interrupt & EXTI Line34 Interrupt (UART4 wakeup) */ + UART5_IRQn = 53, /*!< UART5 global Interrupt & EXTI Line35 Interrupt (UART5 wakeup) */ + TIM6_DAC_IRQn = 54, /*!< TIM6 global and DAC underrun error Interrupt */ + DMA2_Channel1_IRQn = 56, /*!< DMA2 Channel 1 global Interrupt */ + DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */ + DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */ + DMA2_Channel4_IRQn = 59, /*!< DMA2 Channel 4 global Interrupt */ + DMA2_Channel5_IRQn = 60, /*!< DMA2 Channel 5 global Interrupt */ + COMP1_2_IRQn = 64, /*!< COMP1 and COMP2 global Interrupt via EXTI Line21 and 22 */ + COMP4_6_IRQn = 65, /*!< COMP4 and COMP6 global Interrupt via EXTI Line30 and 32 */ + USB_HP_IRQn = 74, /*!< USB High Priority global Interrupt */ + USB_LP_IRQn = 75, /*!< USB Low Priority global Interrupt */ + USBWakeUp_RMP_IRQn = 76, /*!< USB Wakeup Interrupt remap */ + FPU_IRQn = 81, /*!< Floating point Interrupt */ +} IRQn_Type; + +/** + * @} + */ + +#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */ +#include "system_stm32f3xx.h" /* STM32F3xx System Header */ +#include + +/** @addtogroup Peripheral_registers_structures + * @{ + */ + +/** + * @brief Analog to Digital Converter + */ + +typedef struct +{ + __IO uint32_t ISR; /*!< ADC Interrupt and Status Register, Address offset: 0x00 */ + __IO uint32_t IER; /*!< ADC Interrupt Enable Register, Address offset: 0x04 */ + __IO uint32_t CR; /*!< ADC control register, Address offset: 0x08 */ + __IO uint32_t CFGR; /*!< ADC Configuration register, Address offset: 0x0C */ + uint32_t RESERVED0; /*!< Reserved, 0x010 */ + __IO uint32_t SMPR1; /*!< ADC sample time register 1, Address offset: 0x14 */ + __IO uint32_t SMPR2; /*!< ADC sample time register 2, Address offset: 0x18 */ + uint32_t RESERVED1; /*!< Reserved, 0x01C */ + __IO uint32_t TR1; /*!< ADC watchdog threshold register 1, Address offset: 0x20 */ + __IO uint32_t TR2; /*!< ADC watchdog threshold register 2, Address offset: 0x24 */ + __IO uint32_t TR3; /*!< ADC watchdog threshold register 3, Address offset: 0x28 */ + uint32_t RESERVED2; /*!< Reserved, 0x02C */ + __IO uint32_t SQR1; /*!< ADC regular sequence register 1, Address offset: 0x30 */ + __IO uint32_t SQR2; /*!< ADC regular sequence register 2, Address offset: 0x34 */ + __IO uint32_t SQR3; /*!< ADC regular sequence register 3, Address offset: 0x38 */ + __IO uint32_t SQR4; /*!< ADC regular sequence register 4, Address offset: 0x3C */ + __IO uint32_t DR; /*!< ADC regular data register, Address offset: 0x40 */ + uint32_t RESERVED3; /*!< Reserved, 0x044 */ + uint32_t RESERVED4; /*!< Reserved, 0x048 */ + __IO uint32_t JSQR; /*!< ADC injected sequence register, Address offset: 0x4C */ + uint32_t RESERVED5[4]; /*!< Reserved, 0x050 - 0x05C */ + __IO uint32_t OFR1; /*!< ADC offset register 1, Address offset: 0x60 */ + __IO uint32_t OFR2; /*!< ADC offset register 2, Address offset: 0x64 */ + __IO uint32_t OFR3; /*!< ADC offset register 3, Address offset: 0x68 */ + __IO uint32_t OFR4; /*!< ADC offset register 4, Address offset: 0x6C */ + uint32_t RESERVED6[4]; /*!< Reserved, 0x070 - 0x07C */ + __IO uint32_t JDR1; /*!< ADC injected data register 1, Address offset: 0x80 */ + __IO uint32_t JDR2; /*!< ADC injected data register 2, Address offset: 0x84 */ + __IO uint32_t JDR3; /*!< ADC injected data register 3, Address offset: 0x88 */ + __IO uint32_t JDR4; /*!< ADC injected data register 4, Address offset: 0x8C */ + uint32_t RESERVED7[4]; /*!< Reserved, 0x090 - 0x09C */ + __IO uint32_t AWD2CR; /*!< ADC Analog Watchdog 2 Configuration Register, Address offset: 0xA0 */ + __IO uint32_t AWD3CR; /*!< ADC Analog Watchdog 3 Configuration Register, Address offset: 0xA4 */ + uint32_t RESERVED8; /*!< Reserved, 0x0A8 */ + uint32_t RESERVED9; /*!< Reserved, 0x0AC */ + __IO uint32_t DIFSEL; /*!< ADC Differential Mode Selection Register, Address offset: 0xB0 */ + __IO uint32_t CALFACT; /*!< ADC Calibration Factors, Address offset: 0xB4 */ + +} ADC_TypeDef; + +typedef struct +{ + __IO uint32_t CSR; /*!< ADC Common status register, Address offset: ADC1/3 base address + 0x300 */ + uint32_t RESERVED; /*!< Reserved, ADC1/3 base address + 0x304 */ + __IO uint32_t CCR; /*!< ADC common control register, Address offset: ADC1/3 base address + 0x308 */ + __IO uint32_t CDR; /*!< ADC common regular data register for dual + AND triple modes, Address offset: ADC1/3 base address + 0x30C */ +} ADC_Common_TypeDef; + +/** + * @brief Controller Area Network TxMailBox + */ +typedef struct +{ + __IO uint32_t TIR; /*!< CAN TX mailbox identifier register */ + __IO uint32_t TDTR; /*!< CAN mailbox data length control and time stamp register */ + __IO uint32_t TDLR; /*!< CAN mailbox data low register */ + __IO uint32_t TDHR; /*!< CAN mailbox data high register */ +} CAN_TxMailBox_TypeDef; + +/** + * @brief Controller Area Network FIFOMailBox + */ +typedef struct +{ + __IO uint32_t RIR; /*!< CAN receive FIFO mailbox identifier register */ + __IO uint32_t RDTR; /*!< CAN receive FIFO mailbox data length control and time stamp register */ + __IO uint32_t RDLR; /*!< CAN receive FIFO mailbox data low register */ + __IO uint32_t RDHR; /*!< CAN receive FIFO mailbox data high register */ +} CAN_FIFOMailBox_TypeDef; + +/** + * @brief Controller Area Network FilterRegister + */ +typedef struct +{ + __IO uint32_t FR1; /*!< CAN Filter bank register 1 */ + __IO uint32_t FR2; /*!< CAN Filter bank register 1 */ +} CAN_FilterRegister_TypeDef; + +/** + * @brief Controller Area Network + */ +typedef struct +{ + __IO uint32_t MCR; /*!< CAN master control register, Address offset: 0x00 */ + __IO uint32_t MSR; /*!< CAN master status register, Address offset: 0x04 */ + __IO uint32_t TSR; /*!< CAN transmit status register, Address offset: 0x08 */ + __IO uint32_t RF0R; /*!< CAN receive FIFO 0 register, Address offset: 0x0C */ + __IO uint32_t RF1R; /*!< CAN receive FIFO 1 register, Address offset: 0x10 */ + __IO uint32_t IER; /*!< CAN interrupt enable register, Address offset: 0x14 */ + __IO uint32_t ESR; /*!< CAN error status register, Address offset: 0x18 */ + __IO uint32_t BTR; /*!< CAN bit timing register, Address offset: 0x1C */ + uint32_t RESERVED0[88]; /*!< Reserved, 0x020 - 0x17F */ + CAN_TxMailBox_TypeDef sTxMailBox[3]; /*!< CAN Tx MailBox, Address offset: 0x180 - 0x1AC */ + CAN_FIFOMailBox_TypeDef sFIFOMailBox[2]; /*!< CAN FIFO MailBox, Address offset: 0x1B0 - 0x1CC */ + uint32_t RESERVED1[12]; /*!< Reserved, 0x1D0 - 0x1FF */ + __IO uint32_t FMR; /*!< CAN filter master register, Address offset: 0x200 */ + __IO uint32_t FM1R; /*!< CAN filter mode register, Address offset: 0x204 */ + uint32_t RESERVED2; /*!< Reserved, 0x208 */ + __IO uint32_t FS1R; /*!< CAN filter scale register, Address offset: 0x20C */ + uint32_t RESERVED3; /*!< Reserved, 0x210 */ + __IO uint32_t FFA1R; /*!< CAN filter FIFO assignment register, Address offset: 0x214 */ + uint32_t RESERVED4; /*!< Reserved, 0x218 */ + __IO uint32_t FA1R; /*!< CAN filter activation register, Address offset: 0x21C */ + uint32_t RESERVED5[8]; /*!< Reserved, 0x220-0x23F */ + CAN_FilterRegister_TypeDef sFilterRegister[28]; /*!< CAN Filter Register, Address offset: 0x240-0x31C */ +} CAN_TypeDef; + +/** + * @brief Analog Comparators + */ +typedef struct +{ + __IO uint32_t CSR; /*!< COMP control and status register, Address offset: 0x00 */ +} COMP_TypeDef; + +typedef struct +{ + __IO uint32_t CSR; /*!< COMP control and status register, used for bits common to several COMP instances, Address offset: 0x00 */ +} COMP_Common_TypeDef; + +/** + * @brief CRC calculation unit + */ + +typedef struct +{ + __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */ + __IO uint8_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */ + uint8_t RESERVED0; /*!< Reserved, 0x05 */ + uint16_t RESERVED1; /*!< Reserved, 0x06 */ + __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */ + uint32_t RESERVED2; /*!< Reserved, 0x0C */ + __IO uint32_t INIT; /*!< Initial CRC value register, Address offset: 0x10 */ + __IO uint32_t POL; /*!< CRC polynomial register, Address offset: 0x14 */ +} CRC_TypeDef; + +/** + * @brief Digital to Analog Converter + */ + +typedef struct +{ + __IO uint32_t CR; /*!< DAC control register, Address offset: 0x00 */ + __IO uint32_t SWTRIGR; /*!< DAC software trigger register, Address offset: 0x04 */ + __IO uint32_t DHR12R1; /*!< DAC channel1 12-bit right-aligned data holding register, Address offset: 0x08 */ + __IO uint32_t DHR12L1; /*!< DAC channel1 12-bit left aligned data holding register, Address offset: 0x0C */ + __IO uint32_t DHR8R1; /*!< DAC channel1 8-bit right aligned data holding register, Address offset: 0x10 */ + __IO uint32_t RESERVED0; /*!< Reserved, 0x14 */ + __IO uint32_t RESERVED1; /*!< Reserved, 0x18 */ + __IO uint32_t RESERVED2; /*!< Reserved, 0x1C */ + __IO uint32_t DHR12RD; /*!< Dual DAC 12-bit right-aligned data holding register, Address offset: 0x20 */ + __IO uint32_t DHR12LD; /*!< DUAL DAC 12-bit left aligned data holding register, Address offset: 0x24 */ + __IO uint32_t DHR8RD; /*!< DUAL DAC 8-bit right aligned data holding register, Address offset: 0x28 */ + __IO uint32_t DOR1; /*!< DAC channel1 data output register, Address offset: 0x2C */ + __IO uint32_t RESERVED3; /*!< Reserved, 0x30 */ + __IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */ +} DAC_TypeDef; + +/** + * @brief Debug MCU + */ + +typedef struct +{ + __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */ + __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */ + __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */ + __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */ +}DBGMCU_TypeDef; + +/** + * @brief DMA Controller + */ + +typedef struct +{ + __IO uint32_t CCR; /*!< DMA channel x configuration register */ + __IO uint32_t CNDTR; /*!< DMA channel x number of data register */ + __IO uint32_t CPAR; /*!< DMA channel x peripheral address register */ + __IO uint32_t CMAR; /*!< DMA channel x memory address register */ +} DMA_Channel_TypeDef; + +typedef struct +{ + __IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */ + __IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */ +} DMA_TypeDef; + +/** + * @brief External Interrupt/Event Controller + */ + +typedef struct +{ + __IO uint32_t IMR; /*!>= 1U; value != 0U; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ + return result; +} +#endif + + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +#define __CLZ __clz + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) +#else + #define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) +#else + #define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) +#else + #define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXB(value, ptr) __strex(value, ptr) +#else + #define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXH(value, ptr) __strex(value, ptr) +#else + #define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) + #define __STREXW(value, ptr) __strex(value, ptr) +#else + #define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") +#endif + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +#define __CLREX __clrex + + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __ssat + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __usat + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +#ifndef __NO_EMBEDDED_ASM +__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) +{ + rrx r0, r0 + bx lr +} +#endif + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr)) + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr)) + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr)) + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRBT(value, ptr) __strt(value, ptr) + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRHT(value, ptr) __strt(value, ptr) + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +#define __STRT(value, ptr) __strt(value, ptr) + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) + +#define __SADD8 __sadd8 +#define __QADD8 __qadd8 +#define __SHADD8 __shadd8 +#define __UADD8 __uadd8 +#define __UQADD8 __uqadd8 +#define __UHADD8 __uhadd8 +#define __SSUB8 __ssub8 +#define __QSUB8 __qsub8 +#define __SHSUB8 __shsub8 +#define __USUB8 __usub8 +#define __UQSUB8 __uqsub8 +#define __UHSUB8 __uhsub8 +#define __SADD16 __sadd16 +#define __QADD16 __qadd16 +#define __SHADD16 __shadd16 +#define __UADD16 __uadd16 +#define __UQADD16 __uqadd16 +#define __UHADD16 __uhadd16 +#define __SSUB16 __ssub16 +#define __QSUB16 __qsub16 +#define __SHSUB16 __shsub16 +#define __USUB16 __usub16 +#define __UQSUB16 __uqsub16 +#define __UHSUB16 __uhsub16 +#define __SASX __sasx +#define __QASX __qasx +#define __SHASX __shasx +#define __UASX __uasx +#define __UQASX __uqasx +#define __UHASX __uhasx +#define __SSAX __ssax +#define __QSAX __qsax +#define __SHSAX __shsax +#define __USAX __usax +#define __UQSAX __uqsax +#define __UHSAX __uhsax +#define __USAD8 __usad8 +#define __USADA8 __usada8 +#define __SSAT16 __ssat16 +#define __USAT16 __usat16 +#define __UXTB16 __uxtb16 +#define __UXTAB16 __uxtab16 +#define __SXTB16 __sxtb16 +#define __SXTAB16 __sxtab16 +#define __SMUAD __smuad +#define __SMUADX __smuadx +#define __SMLAD __smlad +#define __SMLADX __smladx +#define __SMLALD __smlald +#define __SMLALDX __smlaldx +#define __SMUSD __smusd +#define __SMUSDX __smusdx +#define __SMLSD __smlsd +#define __SMLSDX __smlsdx +#define __SMLSLD __smlsld +#define __SMLSLDX __smlsldx +#define __SEL __sel +#define __QADD __qadd +#define __QSUB __qsub + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \ + ((int64_t)(ARG3) << 32U) ) >> 32U)) + +#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CMSIS_ARMCC_H */ diff --git a/Software/Code/Drivers/CMSIS/Include/cmsis_armclang.h b/Software/Code/Drivers/CMSIS/Include/cmsis_armclang.h new file mode 100644 index 0000000..162a400 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/cmsis_armclang.h @@ -0,0 +1,1869 @@ +/**************************************************************************//** + * @file cmsis_armclang.h + * @brief CMSIS compiler armclang (Arm Compiler 6) header file + * @version V5.0.4 + * @date 10. January 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*lint -esym(9058, IRQn)*/ /* disable MISRA 2012 Rule 2.4 for IRQn */ + +#ifndef __CMSIS_ARMCLANG_H +#define __CMSIS_ARMCLANG_H + +#pragma clang system_header /* treat file as system include file */ + +#ifndef __ARM_COMPAT_H +#include /* Compatibility header for Arm Compiler 5 intrinsics */ +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE __inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static __inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __attribute__((always_inline)) static __inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((__noreturn__)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed, aligned(1))) +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32 */ + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_WRITE */ + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT16_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT16_READ */ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_WRITE)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_WRITE */ + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wpacked" +/*lint -esym(9058, T_UINT32_READ)*/ /* disable MISRA 2012 Rule 2.4 for T_UINT32_READ */ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #pragma clang diagnostic pop + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif + + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __enable_irq(); see arm_compat.h */ + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +/* intrinsic void __disable_irq(); see arm_compat.h */ + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} + + +/** + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __enable_fault_irq __enable_fiq /* see arm_compat.h */ + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +#define __disable_fault_irq __disable_fiq /* see arm_compat.h */ + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif +} + +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __get_FPSCR (uint32_t)__builtin_arm_get_fpscr +#else +#define __get_FPSCR() ((uint32_t)0U) +#endif + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#define __set_FPSCR __builtin_arm_set_fpscr +#else +#define __set_FPSCR(x) ((void)(x)) +#endif + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP __builtin_arm_nop + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI __builtin_arm_wfi + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE __builtin_arm_wfe + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV __builtin_arm_sev + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +#define __ISB() __builtin_arm_isb(0xF); + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +#define __DSB() __builtin_arm_dsb(0xF); + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +#define __DMB() __builtin_arm_dmb(0xF); + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV(value) __builtin_bswap32(value) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REV16(value) __ROR(__REV(value), 16) + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +#define __REVSH(value) (int16_t)__builtin_bswap16(value) + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +#define __RBIT __builtin_arm_rbit + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +#define __CLZ (uint8_t)__builtin_clz + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDREXB (uint8_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDREXH (uint16_t)__builtin_arm_ldrex + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDREXW (uint32_t)__builtin_arm_ldrex + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXB (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXH (uint32_t)__builtin_arm_strex + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STREXW (uint32_t)__builtin_arm_strex + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +#define __CLREX __builtin_arm_clrex + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT __builtin_arm_ssat + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT __builtin_arm_usat + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +#define __LDAEXB (uint8_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +#define __LDAEXH (uint16_t)__builtin_arm_ldaex + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +#define __LDAEX (uint32_t)__builtin_arm_ldaex + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXB (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEXH (uint32_t)__builtin_arm_stlex + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +#define __STLEX (uint32_t)__builtin_arm_stlex + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) + +__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#define __SSAT16(ARG1,ARG2) \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +#define __USAT16(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +#if 0 +#define __PKHBT(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) + +#define __PKHTB(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + if (ARG3 == 0) \ + __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ + else \ + __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) +#endif + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#endif /* __CMSIS_ARMCLANG_H */ diff --git a/Software/Code/Drivers/CMSIS/Include/cmsis_compiler.h b/Software/Code/Drivers/CMSIS/Include/cmsis_compiler.h new file mode 100644 index 0000000..94212eb --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/cmsis_compiler.h @@ -0,0 +1,266 @@ +/**************************************************************************//** + * @file cmsis_compiler.h + * @brief CMSIS compiler generic header file + * @version V5.0.4 + * @date 10. January 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_COMPILER_H +#define __CMSIS_COMPILER_H + +#include + +/* + * Arm Compiler 4/5 + */ +#if defined ( __CC_ARM ) + #include "cmsis_armcc.h" + + +/* + * Arm Compiler 6 (armclang) + */ +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #include "cmsis_armclang.h" + + +/* + * GNU Compiler + */ +#elif defined ( __GNUC__ ) + #include "cmsis_gcc.h" + + +/* + * IAR Compiler + */ +#elif defined ( __ICCARM__ ) + #include + + +/* + * TI Arm Compiler + */ +#elif defined ( __TI_ARM__ ) + #include + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) + #endif + #ifndef __USED + #define __USED __attribute__((used)) + #endif + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + #ifndef __PACKED + #define __PACKED __attribute__((packed)) + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed)) + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed)) + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) + #endif + #ifndef __RESTRICT + #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. + #define __RESTRICT + #endif + + +/* + * TASKING Compiler + */ +#elif defined ( __TASKING__ ) + /* + * The CMSIS functions have been implemented as intrinsics in the compiler. + * Please use "carm -?i" to get an up to date list of all intrinsics, + * Including the CMSIS ones. + */ + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) + #endif + #ifndef __USED + #define __USED __attribute__((used)) + #endif + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + #ifndef __PACKED + #define __PACKED __packed__ + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __packed__ + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION union __packed__ + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + struct __packed__ T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #define __ALIGNED(x) __align(x) + #endif + #ifndef __RESTRICT + #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. + #define __RESTRICT + #endif + + +/* + * COSMIC Compiler + */ +#elif defined ( __CSMC__ ) + #include + + #ifndef __ASM + #define __ASM _asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __STATIC_INLINE + #endif + #ifndef __NO_RETURN + // NO RETURN is automatically detected hence no warning here + #define __NO_RETURN + #endif + #ifndef __USED + #warning No compiler specific solution for __USED. __USED is ignored. + #define __USED + #endif + #ifndef __WEAK + #define __WEAK __weak + #endif + #ifndef __PACKED + #define __PACKED @packed + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT @packed struct + #endif + #ifndef __PACKED_UNION + #define __PACKED_UNION @packed union + #endif + #ifndef __UNALIGNED_UINT32 /* deprecated */ + @packed struct T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __UNALIGNED_UINT16_WRITE + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT16_READ + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) + #endif + #ifndef __UNALIGNED_UINT32_WRITE + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) + #endif + #ifndef __UNALIGNED_UINT32_READ + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) + #endif + #ifndef __ALIGNED + #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. + #define __ALIGNED(x) + #endif + #ifndef __RESTRICT + #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. + #define __RESTRICT + #endif + + +#else + #error Unknown compiler. +#endif + + +#endif /* __CMSIS_COMPILER_H */ + diff --git a/Software/Code/Drivers/CMSIS/Include/cmsis_gcc.h b/Software/Code/Drivers/CMSIS/Include/cmsis_gcc.h new file mode 100644 index 0000000..2d9db15 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/cmsis_gcc.h @@ -0,0 +1,2085 @@ +/**************************************************************************//** + * @file cmsis_gcc.h + * @brief CMSIS compiler GCC header file + * @version V5.0.4 + * @date 09. April 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_GCC_H +#define __CMSIS_GCC_H + +/* ignore some GCC warnings */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wunused-parameter" + +/* Fallback for __has_builtin */ +#ifndef __has_builtin + #define __has_builtin(x) (0) +#endif + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline +#endif +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((__noreturn__)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_UNION + #define __PACKED_UNION union __attribute__((packed, aligned(1))) +#endif +#ifndef __UNALIGNED_UINT32 /* deprecated */ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __UNALIGNED_UINT16_WRITE + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT16_READ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) +#endif +#ifndef __UNALIGNED_UINT32_WRITE + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) +#endif +#ifndef __UNALIGNED_UINT32_READ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wpacked" + #pragma GCC diagnostic ignored "-Wattributes" + __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; + #pragma GCC diagnostic pop + #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif + + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __enable_irq(void) +{ + __ASM volatile ("cpsie i" : : : "memory"); +} + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i" : : : "memory"); +} + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__STATIC_FORCEINLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__STATIC_FORCEINLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__STATIC_FORCEINLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSP(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Stack Pointer (non-secure) + \details Returns the current value of the non-secure Stack Pointer (SP) when in secure state. + \return SP Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_SP_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, sp_ns" : "=r" (result) ); + return(result); +} + + +/** + \brief Set Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Stack Pointer (SP) when in secure state. + \param [in] topOfStack Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_SP_NS(uint32_t topOfStack) +{ + __ASM volatile ("MSR sp_ns, %0" : : "r" (topOfStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) :: "memory"); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) :: "memory"); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__STATIC_FORCEINLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __enable_fault_irq(void) +{ + __ASM volatile ("cpsie f" : : : "memory"); +} + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__STATIC_FORCEINLINE void __disable_fault_irq(void) +{ + __ASM volatile ("cpsid f" : : : "memory"); +} + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__STATIC_FORCEINLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__STATIC_FORCEINLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_PSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return result; +#endif +} + +#if (defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)ProcStackPtrLimit; +#else + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +#endif +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always in non-secure + mode. + + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __get_MSPLIM(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + return result; +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence zero is returned always. + + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__STATIC_FORCEINLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + return 0U; +#else + uint32_t result; + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return result; +#endif +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored in non-secure + mode. + + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__STATIC_FORCEINLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +#endif +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer Limit (non-secure) + Devices without ARMv8-M Main Extensions (i.e. Cortex-M23) lack the non-secure + Stack Pointer Limit register hence the write is silently ignored. + + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__STATIC_FORCEINLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ +#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)MainStackPtrLimit; +#else + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +#endif +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +__STATIC_FORCEINLINE uint32_t __get_FPSCR(void) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#if __has_builtin(__builtin_arm_get_fpscr) +// Re-enable using built-in when GCC has been fixed +// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) + /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ + return __builtin_arm_get_fpscr(); +#else + uint32_t result; + + __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); + return(result); +#endif +#else + return(0U); +#endif +} + + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +__STATIC_FORCEINLINE void __set_FPSCR(uint32_t fpscr) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) +#if __has_builtin(__builtin_arm_set_fpscr) +// Re-enable using built-in when GCC has been fixed +// || (__GNUC__ > 7) || (__GNUC__ == 7 && __GNUC_MINOR__ >= 2) + /* see https://gcc.gnu.org/ml/gcc-patches/2017-04/msg00443.html */ + __builtin_arm_set_fpscr(fpscr); +#else + __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); +#endif +#else + (void)fpscr; +#endif +} + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_RW_REG(r) "+l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_RW_REG(r) "+r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +#define __NOP() __ASM volatile ("nop") + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +#define __WFI() __ASM volatile ("wfi") + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +#define __WFE() __ASM volatile ("wfe") + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +#define __SEV() __ASM volatile ("sev") + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +__STATIC_FORCEINLINE void __ISB(void) +{ + __ASM volatile ("isb 0xF":::"memory"); +} + + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +__STATIC_FORCEINLINE void __DSB(void) +{ + __ASM volatile ("dsb 0xF":::"memory"); +} + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +__STATIC_FORCEINLINE void __DMB(void) +{ + __ASM volatile ("dmb 0xF":::"memory"); +} + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __REV(uint32_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) + return __builtin_bswap32(value); +#else + uint32_t result; + + __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +#endif +} + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __REV16(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +} + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE int16_t __REVSH(int16_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + return (int16_t)__builtin_bswap16(value); +#else + int16_t result; + + __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return result; +#endif +} + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + op2 %= 32U; + if (op2 == 0U) + { + return op1; + } + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +__STATIC_FORCEINLINE uint32_t __RBIT(uint32_t value) +{ + uint32_t result; + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); +#else + uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ + + result = value; /* r will be reversed bits of v; first get LSB of v */ + for (value >>= 1U; value != 0U; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ +#endif + return result; +} + + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +#define __CLZ (uint8_t)__builtin_clz + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDREXB(volatile uint8_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDREXH(volatile uint16_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDREXW(volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); + return(result); +} + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); + return(result); +} + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +__STATIC_FORCEINLINE void __CLREX(void) +{ + __ASM volatile ("clrex" ::: "memory"); +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] ARG1 Value to be saturated + \param [in] ARG2 Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT(ARG1,ARG2) \ +__extension__ \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] ARG1 Value to be saturated + \param [in] ARG2 Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT(ARG1,ARG2) \ + __extension__ \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__STATIC_FORCEINLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +__STATIC_FORCEINLINE int32_t __SSAT(int32_t val, uint32_t sat) +{ + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; +} + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +__STATIC_FORCEINLINE uint32_t __USAT(int32_t val, uint32_t sat) +{ + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__STATIC_FORCEINLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__STATIC_FORCEINLINE uint8_t __LDAEXB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__STATIC_FORCEINLINE uint16_t __LDAEXH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__STATIC_FORCEINLINE uint32_t __LDAEX(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__STATIC_FORCEINLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)) + +__STATIC_FORCEINLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__STATIC_FORCEINLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#define __SSAT16(ARG1,ARG2) \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +#define __USAT16(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +__STATIC_FORCEINLINE uint32_t __UXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__STATIC_FORCEINLINE uint32_t __SEL (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QADD( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__STATIC_FORCEINLINE int32_t __QSUB( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +#if 0 +#define __PKHBT(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) + +#define __PKHTB(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + if (ARG3 == 0) \ + __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ + else \ + __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) +#endif + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +__STATIC_FORCEINLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#pragma GCC diagnostic pop + +#endif /* __CMSIS_GCC_H */ diff --git a/Software/Code/Drivers/CMSIS/Include/cmsis_iccarm.h b/Software/Code/Drivers/CMSIS/Include/cmsis_iccarm.h new file mode 100644 index 0000000..11c4af0 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/cmsis_iccarm.h @@ -0,0 +1,935 @@ +/**************************************************************************//** + * @file cmsis_iccarm.h + * @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file + * @version V5.0.7 + * @date 19. June 2018 + ******************************************************************************/ + +//------------------------------------------------------------------------------ +// +// Copyright (c) 2017-2018 IAR Systems +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//------------------------------------------------------------------------------ + + +#ifndef __CMSIS_ICCARM_H__ +#define __CMSIS_ICCARM_H__ + +#ifndef __ICCARM__ + #error This file should only be compiled by ICCARM +#endif + +#pragma system_include + +#define __IAR_FT _Pragma("inline=forced") __intrinsic + +#if (__VER__ >= 8000000) + #define __ICCARM_V8 1 +#else + #define __ICCARM_V8 0 +#endif + +#ifndef __ALIGNED + #if __ICCARM_V8 + #define __ALIGNED(x) __attribute__((aligned(x))) + #elif (__VER__ >= 7080000) + /* Needs IAR language extensions */ + #define __ALIGNED(x) __attribute__((aligned(x))) + #else + #warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored. + #define __ALIGNED(x) + #endif +#endif + + +/* Define compiler macros for CPU architecture, used in CMSIS 5. + */ +#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__ +/* Macros already defined */ +#else + #if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #elif defined(__ARM8M_BASELINE__) + #define __ARM_ARCH_8M_BASE__ 1 + #elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M' + #if __ARM_ARCH == 6 + #define __ARM_ARCH_6M__ 1 + #elif __ARM_ARCH == 7 + #if __ARM_FEATURE_DSP + #define __ARM_ARCH_7EM__ 1 + #else + #define __ARM_ARCH_7M__ 1 + #endif + #endif /* __ARM_ARCH */ + #endif /* __ARM_ARCH_PROFILE == 'M' */ +#endif + +/* Alternativ core deduction for older ICCARM's */ +#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \ + !defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__) + #if defined(__ARM6M__) && (__CORE__ == __ARM6M__) + #define __ARM_ARCH_6M__ 1 + #elif defined(__ARM7M__) && (__CORE__ == __ARM7M__) + #define __ARM_ARCH_7M__ 1 + #elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__) + #define __ARM_ARCH_7EM__ 1 + #elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__) + #define __ARM_ARCH_8M_BASE__ 1 + #elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__) + #define __ARM_ARCH_8M_MAIN__ 1 + #else + #error "Unknown target." + #endif +#endif + + + +#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1 + #define __IAR_M0_FAMILY 1 +#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1 + #define __IAR_M0_FAMILY 1 +#else + #define __IAR_M0_FAMILY 0 +#endif + + +#ifndef __ASM + #define __ASM __asm +#endif + +#ifndef __INLINE + #define __INLINE inline +#endif + +#ifndef __NO_RETURN + #if __ICCARM_V8 + #define __NO_RETURN __attribute__((__noreturn__)) + #else + #define __NO_RETURN _Pragma("object_attribute=__noreturn") + #endif +#endif + +#ifndef __PACKED + #if __ICCARM_V8 + #define __PACKED __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED __packed + #endif +#endif + +#ifndef __PACKED_STRUCT + #if __ICCARM_V8 + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED_STRUCT __packed struct + #endif +#endif + +#ifndef __PACKED_UNION + #if __ICCARM_V8 + #define __PACKED_UNION union __attribute__((packed, aligned(1))) + #else + /* Needs IAR language extensions */ + #define __PACKED_UNION __packed union + #endif +#endif + +#ifndef __RESTRICT + #define __RESTRICT __restrict +#endif + +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline +#endif + +#ifndef __FORCEINLINE + #define __FORCEINLINE _Pragma("inline=forced") +#endif + +#ifndef __STATIC_FORCEINLINE + #define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE +#endif + +#ifndef __UNALIGNED_UINT16_READ +#pragma language=save +#pragma language=extended +__IAR_FT uint16_t __iar_uint16_read(void const *ptr) +{ + return *(__packed uint16_t*)(ptr); +} +#pragma language=restore +#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR) +#endif + + +#ifndef __UNALIGNED_UINT16_WRITE +#pragma language=save +#pragma language=extended +__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) +{ + *(__packed uint16_t*)(ptr) = val;; +} +#pragma language=restore +#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL) +#endif + +#ifndef __UNALIGNED_UINT32_READ +#pragma language=save +#pragma language=extended +__IAR_FT uint32_t __iar_uint32_read(void const *ptr) +{ + return *(__packed uint32_t*)(ptr); +} +#pragma language=restore +#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR) +#endif + +#ifndef __UNALIGNED_UINT32_WRITE +#pragma language=save +#pragma language=extended +__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) +{ + *(__packed uint32_t*)(ptr) = val;; +} +#pragma language=restore +#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL) +#endif + +#ifndef __UNALIGNED_UINT32 /* deprecated */ +#pragma language=save +#pragma language=extended +__packed struct __iar_u32 { uint32_t v; }; +#pragma language=restore +#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v) +#endif + +#ifndef __USED + #if __ICCARM_V8 + #define __USED __attribute__((used)) + #else + #define __USED _Pragma("__root") + #endif +#endif + +#ifndef __WEAK + #if __ICCARM_V8 + #define __WEAK __attribute__((weak)) + #else + #define __WEAK _Pragma("__weak") + #endif +#endif + + +#ifndef __ICCARM_INTRINSICS_VERSION__ + #define __ICCARM_INTRINSICS_VERSION__ 0 +#endif + +#if __ICCARM_INTRINSICS_VERSION__ == 2 + + #if defined(__CLZ) + #undef __CLZ + #endif + #if defined(__REVSH) + #undef __REVSH + #endif + #if defined(__RBIT) + #undef __RBIT + #endif + #if defined(__SSAT) + #undef __SSAT + #endif + #if defined(__USAT) + #undef __USAT + #endif + + #include "iccarm_builtin.h" + + #define __disable_fault_irq __iar_builtin_disable_fiq + #define __disable_irq __iar_builtin_disable_interrupt + #define __enable_fault_irq __iar_builtin_enable_fiq + #define __enable_irq __iar_builtin_enable_interrupt + #define __arm_rsr __iar_builtin_rsr + #define __arm_wsr __iar_builtin_wsr + + + #define __get_APSR() (__arm_rsr("APSR")) + #define __get_BASEPRI() (__arm_rsr("BASEPRI")) + #define __get_CONTROL() (__arm_rsr("CONTROL")) + #define __get_FAULTMASK() (__arm_rsr("FAULTMASK")) + + #if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + #define __get_FPSCR() (__arm_rsr("FPSCR")) + #define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE))) + #else + #define __get_FPSCR() ( 0 ) + #define __set_FPSCR(VALUE) ((void)VALUE) + #endif + + #define __get_IPSR() (__arm_rsr("IPSR")) + #define __get_MSP() (__arm_rsr("MSP")) + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + #define __get_MSPLIM() (0U) + #else + #define __get_MSPLIM() (__arm_rsr("MSPLIM")) + #endif + #define __get_PRIMASK() (__arm_rsr("PRIMASK")) + #define __get_PSP() (__arm_rsr("PSP")) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __get_PSPLIM() (0U) + #else + #define __get_PSPLIM() (__arm_rsr("PSPLIM")) + #endif + + #define __get_xPSR() (__arm_rsr("xPSR")) + + #define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE))) + #define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE))) + #define __set_CONTROL(VALUE) (__arm_wsr("CONTROL", (VALUE))) + #define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE))) + #define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE))) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + #define __set_MSPLIM(VALUE) ((void)(VALUE)) + #else + #define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE))) + #endif + #define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE))) + #define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE))) + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __set_PSPLIM(VALUE) ((void)(VALUE)) + #else + #define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE))) + #endif + + #define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS")) + #define __TZ_set_CONTROL_NS(VALUE) (__arm_wsr("CONTROL_NS", (VALUE))) + #define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS")) + #define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE))) + #define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS")) + #define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE))) + #define __TZ_get_SP_NS() (__arm_rsr("SP_NS")) + #define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE))) + #define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS")) + #define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE))) + #define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS")) + #define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE))) + #define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS")) + #define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE))) + + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + #define __TZ_get_PSPLIM_NS() (0U) + #define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE)) + #else + #define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS")) + #define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE))) + #endif + + #define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS")) + #define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE))) + + #define __NOP __iar_builtin_no_operation + + #define __CLZ __iar_builtin_CLZ + #define __CLREX __iar_builtin_CLREX + + #define __DMB __iar_builtin_DMB + #define __DSB __iar_builtin_DSB + #define __ISB __iar_builtin_ISB + + #define __LDREXB __iar_builtin_LDREXB + #define __LDREXH __iar_builtin_LDREXH + #define __LDREXW __iar_builtin_LDREX + + #define __RBIT __iar_builtin_RBIT + #define __REV __iar_builtin_REV + #define __REV16 __iar_builtin_REV16 + + __IAR_FT int16_t __REVSH(int16_t val) + { + return (int16_t) __iar_builtin_REVSH(val); + } + + #define __ROR __iar_builtin_ROR + #define __RRX __iar_builtin_RRX + + #define __SEV __iar_builtin_SEV + + #if !__IAR_M0_FAMILY + #define __SSAT __iar_builtin_SSAT + #endif + + #define __STREXB __iar_builtin_STREXB + #define __STREXH __iar_builtin_STREXH + #define __STREXW __iar_builtin_STREX + + #if !__IAR_M0_FAMILY + #define __USAT __iar_builtin_USAT + #endif + + #define __WFE __iar_builtin_WFE + #define __WFI __iar_builtin_WFI + + #if __ARM_MEDIA__ + #define __SADD8 __iar_builtin_SADD8 + #define __QADD8 __iar_builtin_QADD8 + #define __SHADD8 __iar_builtin_SHADD8 + #define __UADD8 __iar_builtin_UADD8 + #define __UQADD8 __iar_builtin_UQADD8 + #define __UHADD8 __iar_builtin_UHADD8 + #define __SSUB8 __iar_builtin_SSUB8 + #define __QSUB8 __iar_builtin_QSUB8 + #define __SHSUB8 __iar_builtin_SHSUB8 + #define __USUB8 __iar_builtin_USUB8 + #define __UQSUB8 __iar_builtin_UQSUB8 + #define __UHSUB8 __iar_builtin_UHSUB8 + #define __SADD16 __iar_builtin_SADD16 + #define __QADD16 __iar_builtin_QADD16 + #define __SHADD16 __iar_builtin_SHADD16 + #define __UADD16 __iar_builtin_UADD16 + #define __UQADD16 __iar_builtin_UQADD16 + #define __UHADD16 __iar_builtin_UHADD16 + #define __SSUB16 __iar_builtin_SSUB16 + #define __QSUB16 __iar_builtin_QSUB16 + #define __SHSUB16 __iar_builtin_SHSUB16 + #define __USUB16 __iar_builtin_USUB16 + #define __UQSUB16 __iar_builtin_UQSUB16 + #define __UHSUB16 __iar_builtin_UHSUB16 + #define __SASX __iar_builtin_SASX + #define __QASX __iar_builtin_QASX + #define __SHASX __iar_builtin_SHASX + #define __UASX __iar_builtin_UASX + #define __UQASX __iar_builtin_UQASX + #define __UHASX __iar_builtin_UHASX + #define __SSAX __iar_builtin_SSAX + #define __QSAX __iar_builtin_QSAX + #define __SHSAX __iar_builtin_SHSAX + #define __USAX __iar_builtin_USAX + #define __UQSAX __iar_builtin_UQSAX + #define __UHSAX __iar_builtin_UHSAX + #define __USAD8 __iar_builtin_USAD8 + #define __USADA8 __iar_builtin_USADA8 + #define __SSAT16 __iar_builtin_SSAT16 + #define __USAT16 __iar_builtin_USAT16 + #define __UXTB16 __iar_builtin_UXTB16 + #define __UXTAB16 __iar_builtin_UXTAB16 + #define __SXTB16 __iar_builtin_SXTB16 + #define __SXTAB16 __iar_builtin_SXTAB16 + #define __SMUAD __iar_builtin_SMUAD + #define __SMUADX __iar_builtin_SMUADX + #define __SMMLA __iar_builtin_SMMLA + #define __SMLAD __iar_builtin_SMLAD + #define __SMLADX __iar_builtin_SMLADX + #define __SMLALD __iar_builtin_SMLALD + #define __SMLALDX __iar_builtin_SMLALDX + #define __SMUSD __iar_builtin_SMUSD + #define __SMUSDX __iar_builtin_SMUSDX + #define __SMLSD __iar_builtin_SMLSD + #define __SMLSDX __iar_builtin_SMLSDX + #define __SMLSLD __iar_builtin_SMLSLD + #define __SMLSLDX __iar_builtin_SMLSLDX + #define __SEL __iar_builtin_SEL + #define __QADD __iar_builtin_QADD + #define __QSUB __iar_builtin_QSUB + #define __PKHBT __iar_builtin_PKHBT + #define __PKHTB __iar_builtin_PKHTB + #endif + +#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */ + + #if __IAR_M0_FAMILY + /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ + #define __CLZ __cmsis_iar_clz_not_active + #define __SSAT __cmsis_iar_ssat_not_active + #define __USAT __cmsis_iar_usat_not_active + #define __RBIT __cmsis_iar_rbit_not_active + #define __get_APSR __cmsis_iar_get_APSR_not_active + #endif + + + #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) + #define __get_FPSCR __cmsis_iar_get_FPSR_not_active + #define __set_FPSCR __cmsis_iar_set_FPSR_not_active + #endif + + #ifdef __INTRINSICS_INCLUDED + #error intrinsics.h is already included previously! + #endif + + #include + + #if __IAR_M0_FAMILY + /* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */ + #undef __CLZ + #undef __SSAT + #undef __USAT + #undef __RBIT + #undef __get_APSR + + __STATIC_INLINE uint8_t __CLZ(uint32_t data) + { + if (data == 0U) { return 32U; } + + uint32_t count = 0U; + uint32_t mask = 0x80000000U; + + while ((data & mask) == 0U) + { + count += 1U; + mask = mask >> 1U; + } + return count; + } + + __STATIC_INLINE uint32_t __RBIT(uint32_t v) + { + uint8_t sc = 31U; + uint32_t r = v; + for (v >>= 1U; v; v >>= 1U) + { + r <<= 1U; + r |= v & 1U; + sc--; + } + return (r << sc); + } + + __STATIC_INLINE uint32_t __get_APSR(void) + { + uint32_t res; + __asm("MRS %0,APSR" : "=r" (res)); + return res; + } + + #endif + + #if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) )) + #undef __get_FPSCR + #undef __set_FPSCR + #define __get_FPSCR() (0) + #define __set_FPSCR(VALUE) ((void)VALUE) + #endif + + #pragma diag_suppress=Pe940 + #pragma diag_suppress=Pe177 + + #define __enable_irq __enable_interrupt + #define __disable_irq __disable_interrupt + #define __NOP __no_operation + + #define __get_xPSR __get_PSR + + #if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0) + + __IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr) + { + return __LDREX((unsigned long *)ptr); + } + + __IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr) + { + return __STREX(value, (unsigned long *)ptr); + } + #endif + + + /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ + #if (__CORTEX_M >= 0x03) + + __IAR_FT uint32_t __RRX(uint32_t value) + { + uint32_t result; + __ASM("RRX %0, %1" : "=r"(result) : "r" (value) : "cc"); + return(result); + } + + __IAR_FT void __set_BASEPRI_MAX(uint32_t value) + { + __asm volatile("MSR BASEPRI_MAX,%0"::"r" (value)); + } + + + #define __enable_fault_irq __enable_fiq + #define __disable_fault_irq __disable_fiq + + + #endif /* (__CORTEX_M >= 0x03) */ + + __IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2) + { + return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2)); + } + + #if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + + __IAR_FT uint32_t __get_MSPLIM(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,MSPLIM" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __set_MSPLIM(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure MSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR MSPLIM,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __get_PSPLIM(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,PSPLIM" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __set_PSPLIM(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR PSPLIM,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __TZ_get_CONTROL_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,CONTROL_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_CONTROL_NS(uint32_t value) + { + __asm volatile("MSR CONTROL_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PSP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,PSP_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_PSP_NS(uint32_t value) + { + __asm volatile("MSR PSP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_MSP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,MSP_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_MSP_NS(uint32_t value) + { + __asm volatile("MSR MSP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_SP_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,SP_NS" : "=r" (res)); + return res; + } + __IAR_FT void __TZ_set_SP_NS(uint32_t value) + { + __asm volatile("MSR SP_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PRIMASK_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,PRIMASK_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value) + { + __asm volatile("MSR PRIMASK_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_BASEPRI_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,BASEPRI_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value) + { + __asm volatile("MSR BASEPRI_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_FAULTMASK_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,FAULTMASK_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value) + { + __asm volatile("MSR FAULTMASK_NS,%0" :: "r" (value)); + } + + __IAR_FT uint32_t __TZ_get_PSPLIM_NS(void) + { + uint32_t res; + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + res = 0U; + #else + __asm volatile("MRS %0,PSPLIM_NS" : "=r" (res)); + #endif + return res; + } + + __IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value) + { + #if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \ + (!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3))) + // without main extensions, the non-secure PSPLIM is RAZ/WI + (void)value; + #else + __asm volatile("MSR PSPLIM_NS,%0" :: "r" (value)); + #endif + } + + __IAR_FT uint32_t __TZ_get_MSPLIM_NS(void) + { + uint32_t res; + __asm volatile("MRS %0,MSPLIM_NS" : "=r" (res)); + return res; + } + + __IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value) + { + __asm volatile("MSR MSPLIM_NS,%0" :: "r" (value)); + } + + #endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ + +#endif /* __ICCARM_INTRINSICS_VERSION__ == 2 */ + +#define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value)) + +#if __IAR_M0_FAMILY + __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) + { + if ((sat >= 1U) && (sat <= 32U)) + { + const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); + const int32_t min = -1 - max ; + if (val > max) + { + return max; + } + else if (val < min) + { + return min; + } + } + return val; + } + + __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) + { + if (sat <= 31U) + { + const uint32_t max = ((1U << sat) - 1U); + if (val > (int32_t)max) + { + return max; + } + else if (val < 0) + { + return 0U; + } + } + return (uint32_t)val; + } +#endif + +#if (__CORTEX_M >= 0x03) /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */ + + __IAR_FT uint8_t __LDRBT(volatile uint8_t *addr) + { + uint32_t res; + __ASM("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDRHT(volatile uint16_t *addr) + { + uint32_t res; + __ASM("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDRT(volatile uint32_t *addr) + { + uint32_t res; + __ASM("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory"); + return res; + } + + __IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr) + { + __ASM("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); + } + + __IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr) + { + __ASM("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory"); + } + + __IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr) + { + __ASM("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory"); + } + +#endif /* (__CORTEX_M >= 0x03) */ + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + + + __IAR_FT uint8_t __LDAB(volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDAH(volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDA(volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return res; + } + + __IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr) + { + __ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr) + { + __ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr) + { + __ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory"); + } + + __IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint8_t)res); + } + + __IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return ((uint16_t)res); + } + + __IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + + __IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) + { + uint32_t res; + __ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory"); + return res; + } + +#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */ + +#undef __IAR_FT +#undef __IAR_M0_FAMILY +#undef __ICCARM_V8 + +#pragma diag_default=Pe940 +#pragma diag_default=Pe177 + +#endif /* __CMSIS_ICCARM_H__ */ diff --git a/Software/Code/Drivers/CMSIS/Include/cmsis_version.h b/Software/Code/Drivers/CMSIS/Include/cmsis_version.h new file mode 100644 index 0000000..660f612 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/cmsis_version.h @@ -0,0 +1,39 @@ +/**************************************************************************//** + * @file cmsis_version.h + * @brief CMSIS Core(M) Version definitions + * @version V5.0.2 + * @date 19. April 2017 + ******************************************************************************/ +/* + * Copyright (c) 2009-2017 ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CMSIS_VERSION_H +#define __CMSIS_VERSION_H + +/* CMSIS Version definitions */ +#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ +#define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ +#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ + __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ +#endif diff --git a/Software/Code/Drivers/CMSIS/Include/core_armv8mbl.h b/Software/Code/Drivers/CMSIS/Include/core_armv8mbl.h new file mode 100644 index 0000000..251e4ed --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_armv8mbl.h @@ -0,0 +1,1918 @@ +/**************************************************************************//** + * @file core_armv8mbl.h + * @brief CMSIS Armv8-M Baseline Core Peripheral Access Layer Header File + * @version V5.0.7 + * @date 22. June 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_ARMV8MBL_H_GENERIC +#define __CORE_ARMV8MBL_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_ARMv8MBL + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS definitions */ +#define __ARMv8MBL_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __ARMv8MBL_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __ARMv8MBL_CMSIS_VERSION ((__ARMv8MBL_CMSIS_VERSION_MAIN << 16U) | \ + __ARMv8MBL_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M ( 2U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV8MBL_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_ARMV8MBL_H_DEPENDANT +#define __CORE_ARMV8MBL_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __ARMv8MBL_REV + #define __ARMv8MBL_REV 0x0000U + #warning "__ARMv8MBL_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __VTOR_PRESENT + #define __VTOR_PRESENT 0U + #warning "__VTOR_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif + + #ifndef __ETM_PRESENT + #define __ETM_PRESENT 0U + #warning "__ETM_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MTB_PRESENT + #define __MTB_PRESENT 0U + #warning "__MTB_PRESENT not defined in device header file; using default!" + #endif + +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group ARMv8MBL */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint32_t IPR[124U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ +#else + uint32_t RESERVED0; +#endif + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHPR[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + uint32_t RESERVED0[6U]; + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x3UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Sizes Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Sizes Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[809U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) Software Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) Software Lock Status Register */ + uint32_t RESERVED4[4U]; + __IM uint32_t TYPE; /*!< Offset: 0xFC8 (R/ ) Device Identifier Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_SWOSCALER_Pos 0U /*!< TPI ACPR: SWOSCALER Position */ +#define TPI_ACPR_SWOSCALER_Msk (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/) /*!< TPI ACPR: SWOSCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI Periodic Synchronization Control Register Definitions */ +#define TPI_PSCR_PSCount_Pos 0U /*!< TPI PSCR: PSCount Position */ +#define TPI_PSCR_PSCount_Msk (0x1FUL /*<< TPI_PSCR_PSCount_Pos*/) /*!< TPI PSCR: TPSCount Mask */ + +/* TPI Software Lock Status Register Definitions */ +#define TPI_LSR_nTT_Pos 1U /*!< TPI LSR: Not thirty-two bit. Position */ +#define TPI_LSR_nTT_Msk (0x1UL << TPI_LSR_nTT_Pos) /*!< TPI LSR: Not thirty-two bit. Mask */ + +#define TPI_LSR_SLK_Pos 1U /*!< TPI LSR: Software Lock status Position */ +#define TPI_LSR_SLK_Msk (0x1UL << TPI_LSR_SLK_Pos) /*!< TPI LSR: Software Lock status Mask */ + +#define TPI_LSR_SLI_Pos 0U /*!< TPI LSR: Software Lock implemented Position */ +#define TPI_LSR_SLI_Msk (0x1UL /*<< TPI_LSR_SLI_Pos*/) /*!< TPI LSR: Software Lock implemented Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFO depth Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFO depth Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + uint32_t RESERVED0[7U]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 1U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: EN Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: EN Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#endif +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register */ +#define CoreDebug_DEMCR_DWTENA_Pos 24U /*!< CoreDebug DEMCR: DWTENA Position */ +#define CoreDebug_DEMCR_DWTENA_Msk (1UL << CoreDebug_DEMCR_DWTENA_Pos) /*!< CoreDebug DEMCR: DWTENA Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000002UL) /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + If VTOR is not present address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC_NS->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB_NS->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB_NS->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB_NS->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV8MBL_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_armv8mml.h b/Software/Code/Drivers/CMSIS/Include/core_armv8mml.h new file mode 100644 index 0000000..3a3148e --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_armv8mml.h @@ -0,0 +1,2927 @@ +/**************************************************************************//** + * @file core_armv8mml.h + * @brief CMSIS Armv8-M Mainline Core Peripheral Access Layer Header File + * @version V5.0.7 + * @date 06. July 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_ARMV8MML_H_GENERIC +#define __CORE_ARMV8MML_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_ARMv8MML + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS Armv8MML definitions */ +#define __ARMv8MML_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __ARMv8MML_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __ARMv8MML_CMSIS_VERSION ((__ARMv8MML_CMSIS_VERSION_MAIN << 16U) | \ + __ARMv8MML_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (81U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined(__ARM_FEATURE_DSP) + #if defined(__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV8MML_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_ARMV8MML_H_DEPENDANT +#define __CORE_ARMV8MML_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __ARMv8MML_REV + #define __ARMv8MML_REV 0x0000U + #warning "__ARMv8MML_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DSP_PRESENT + #define __DSP_PRESENT 0U + #warning "__DSP_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group ARMv8MML */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ +#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ + uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ + uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ +#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ + +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED6[580U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ + uint32_t RESERVED3[92U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ + uint32_t RESERVED7[6U]; + __IOM uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */ + __IOM uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */ + __IOM uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */ + __IOM uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */ + __IOM uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */ + uint32_t RESERVED8[1U]; + __IOM uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ +#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ +#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ + +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ +#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ +#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Non-Secure Access Control Register Definitions */ +#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ +#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ + +#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ +#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ + +#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ +#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/* Instruction Tightly-Coupled Memory Control Register Definitions */ +#define SCB_ITCMCR_SZ_Pos 3U /*!< SCB ITCMCR: SZ Position */ +#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */ + +#define SCB_ITCMCR_RETEN_Pos 2U /*!< SCB ITCMCR: RETEN Position */ +#define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */ + +#define SCB_ITCMCR_RMW_Pos 1U /*!< SCB ITCMCR: RMW Position */ +#define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */ + +#define SCB_ITCMCR_EN_Pos 0U /*!< SCB ITCMCR: EN Position */ +#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */ + +/* Data Tightly-Coupled Memory Control Register Definitions */ +#define SCB_DTCMCR_SZ_Pos 3U /*!< SCB DTCMCR: SZ Position */ +#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */ + +#define SCB_DTCMCR_RETEN_Pos 2U /*!< SCB DTCMCR: RETEN Position */ +#define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */ + +#define SCB_DTCMCR_RMW_Pos 1U /*!< SCB DTCMCR: RMW Position */ +#define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */ + +#define SCB_DTCMCR_EN_Pos 0U /*!< SCB DTCMCR: EN Position */ +#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */ + +/* AHBP Control Register Definitions */ +#define SCB_AHBPCR_SZ_Pos 1U /*!< SCB AHBPCR: SZ Position */ +#define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */ + +#define SCB_AHBPCR_EN_Pos 0U /*!< SCB AHBPCR: EN Position */ +#define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */ + +/* L1 Cache Control Register Definitions */ +#define SCB_CACR_FORCEWT_Pos 2U /*!< SCB CACR: FORCEWT Position */ +#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */ + +#define SCB_CACR_ECCEN_Pos 1U /*!< SCB CACR: ECCEN Position */ +#define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< SCB CACR: ECCEN Mask */ + +#define SCB_CACR_SIWT_Pos 0U /*!< SCB CACR: SIWT Position */ +#define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */ + +/* AHBS Control Register Definitions */ +#define SCB_AHBSCR_INITCOUNT_Pos 11U /*!< SCB AHBSCR: INITCOUNT Position */ +#define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */ + +#define SCB_AHBSCR_TPRI_Pos 2U /*!< SCB AHBSCR: TPRI Position */ +#define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBPCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */ + +#define SCB_AHBSCR_CTL_Pos 0U /*!< SCB AHBSCR: CTL Position*/ +#define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBPCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */ + +/* Auxiliary Bus Fault Status Register Definitions */ +#define SCB_ABFSR_AXIMTYPE_Pos 8U /*!< SCB ABFSR: AXIMTYPE Position*/ +#define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */ + +#define SCB_ABFSR_EPPB_Pos 4U /*!< SCB ABFSR: EPPB Position*/ +#define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */ + +#define SCB_ABFSR_AXIM_Pos 3U /*!< SCB ABFSR: AXIM Position*/ +#define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */ + +#define SCB_ABFSR_AHBP_Pos 2U /*!< SCB ABFSR: AHBP Position*/ +#define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */ + +#define SCB_ABFSR_DTCM_Pos 1U /*!< SCB ABFSR: DTCM Position*/ +#define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */ + +#define SCB_ABFSR_ITCM_Pos 0U /*!< SCB ABFSR: ITCM Position*/ +#define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ + __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29U]; + __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ + uint32_t RESERVED6[4U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Stimulus Port Register Definitions */ +#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ +#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ + +#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ +#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ +#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ + +#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ +#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ + uint32_t RESERVED32[934U]; + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ + uint32_t RESERVED33[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ +#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Sizes Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Sizes Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[809U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) Software Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) Software Lock Status Register */ + uint32_t RESERVED4[4U]; + __IM uint32_t TYPE; /*!< Offset: 0xFC8 (R/ ) Device Identifier Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_SWOSCALER_Pos 0U /*!< TPI ACPR: SWOSCALER Position */ +#define TPI_ACPR_SWOSCALER_Msk (0xFFFFUL /*<< TPI_ACPR_SWOSCALER_Pos*/) /*!< TPI ACPR: SWOSCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI Periodic Synchronization Control Register Definitions */ +#define TPI_PSCR_PSCount_Pos 0U /*!< TPI PSCR: PSCount Position */ +#define TPI_PSCR_PSCount_Msk (0x1FUL /*<< TPI_PSCR_PSCount_Pos*/) /*!< TPI PSCR: TPSCount Mask */ + +/* TPI Software Lock Status Register Definitions */ +#define TPI_LSR_nTT_Pos 1U /*!< TPI LSR: Not thirty-two bit. Position */ +#define TPI_LSR_nTT_Msk (0x1UL << TPI_LSR_nTT_Pos) /*!< TPI LSR: Not thirty-two bit. Mask */ + +#define TPI_LSR_SLK_Pos 1U /*!< TPI LSR: Software Lock status Position */ +#define TPI_LSR_SLK_Msk (0x1UL << TPI_LSR_SLK_Pos) /*!< TPI LSR: Software Lock status Mask */ + +#define TPI_LSR_SLI_Pos 0U /*!< TPI LSR: Software Lock implemented Position */ +#define TPI_LSR_SLI_Msk (0x1UL /*<< TPI_LSR_SLI_Pos*/) /*!< TPI LSR: Software Lock implemented Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFO depth Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFO depth Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ + __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ + __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ + __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ + uint32_t RESERVED0[1]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#else + uint32_t RESERVED0[3]; +#endif + __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/* Secure Fault Status Register Definitions */ +#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ +#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ + +#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ +#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ + +#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ +#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ + +#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ +#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ + +#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ +#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ + +#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ +#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ + +#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ +#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ + +#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ +#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ +#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ + +#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ +#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ + +#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ +#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ + +#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ +#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ + +#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ +#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ + +#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ +#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ +#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ +#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + + #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ + #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + + #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ + #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000002UL) /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Priority Grouping (non-secure) + \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB_NS->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + SCB_NS->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping (non-secure) + \details Reads the priority grouping field from the non-secure NVIC when in secure state. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) +{ + return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_ARMV8MML_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_cm0.h b/Software/Code/Drivers/CMSIS/Include/core_cm0.h new file mode 100644 index 0000000..f929bba --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_cm0.h @@ -0,0 +1,949 @@ +/**************************************************************************//** + * @file core_cm0.h + * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File + * @version V5.0.5 + * @date 28. May 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM0_H_GENERIC +#define __CORE_CM0_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M0 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM0 definitions */ +#define __CM0_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM0_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \ + __CM0_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (0U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM0_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM0_H_DEPENDANT +#define __CORE_CM0_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM0_REV + #define __CM0_REV 0x0000U + #warning "__CM0_REV not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M0 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t _reserved0:1; /*!< bit: 0 Reserved */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[31U]; + __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[31U]; + __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[31U]; + __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[31U]; + uint32_t RESERVED4[64U]; + __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + uint32_t RESERVED0; + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. + Therefore they are not covered by the Cortex-M0 header file. + @{ + */ +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ +/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0 */ + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + Address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)0x0U; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)0x0U; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM0_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_cm0plus.h b/Software/Code/Drivers/CMSIS/Include/core_cm0plus.h new file mode 100644 index 0000000..424011a --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_cm0plus.h @@ -0,0 +1,1083 @@ +/**************************************************************************//** + * @file core_cm0plus.h + * @brief CMSIS Cortex-M0+ Core Peripheral Access Layer Header File + * @version V5.0.6 + * @date 28. May 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM0PLUS_H_GENERIC +#define __CORE_CM0PLUS_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex-M0+ + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM0+ definitions */ +#define __CM0PLUS_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM0PLUS_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM0PLUS_CMSIS_VERSION ((__CM0PLUS_CMSIS_VERSION_MAIN << 16U) | \ + __CM0PLUS_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (0U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM0PLUS_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM0PLUS_H_DEPENDANT +#define __CORE_CM0PLUS_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM0PLUS_REV + #define __CM0PLUS_REV 0x0000U + #warning "__CM0PLUS_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __VTOR_PRESENT + #define __VTOR_PRESENT 0U + #warning "__VTOR_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex-M0+ */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[31U]; + __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[31U]; + __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[31U]; + __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[31U]; + uint32_t RESERVED4[64U]; + __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ +#else + uint32_t RESERVED0; +#endif + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) +/* SCB Interrupt Control State Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 8U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0xFFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 1U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 8U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Cortex-M0+ Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. + Therefore they are not covered by the Cortex-M0+ header file. + @{ + */ +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ +/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0+ */ + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + If VTOR is not present address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; + +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM0PLUS_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_cm1.h b/Software/Code/Drivers/CMSIS/Include/core_cm1.h new file mode 100644 index 0000000..0ed678e --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_cm1.h @@ -0,0 +1,976 @@ +/**************************************************************************//** + * @file core_cm1.h + * @brief CMSIS Cortex-M1 Core Peripheral Access Layer Header File + * @version V1.0.0 + * @date 23. July 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM1_H_GENERIC +#define __CORE_CM1_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M1 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM1 definitions */ +#define __CM1_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM1_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM1_CMSIS_VERSION ((__CM1_CMSIS_VERSION_MAIN << 16U) | \ + __CM1_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (1U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM1_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM1_H_DEPENDANT +#define __CORE_CM1_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM1_REV + #define __CM1_REV 0x0100U + #warning "__CM1_REV not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M1 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t _reserved0:1; /*!< bit: 0 Reserved */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[31U]; + __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[31U]; + __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[31U]; + __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[31U]; + uint32_t RESERVED4[64U]; + __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + uint32_t RESERVED0; + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_ITCMUAEN_Pos 4U /*!< ACTLR: Instruction TCM Upper Alias Enable Position */ +#define SCnSCB_ACTLR_ITCMUAEN_Msk (1UL << SCnSCB_ACTLR_ITCMUAEN_Pos) /*!< ACTLR: Instruction TCM Upper Alias Enable Mask */ + +#define SCnSCB_ACTLR_ITCMLAEN_Pos 3U /*!< ACTLR: Instruction TCM Lower Alias Enable Position */ +#define SCnSCB_ACTLR_ITCMLAEN_Msk (1UL << SCnSCB_ACTLR_ITCMLAEN_Pos) /*!< ACTLR: Instruction TCM Lower Alias Enable Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Cortex-M1 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. + Therefore they are not covered by the Cortex-M1 header file. + @{ + */ +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ +/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M1 */ + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + Address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)0x0U; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)0x0U; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM1_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_cm23.h b/Software/Code/Drivers/CMSIS/Include/core_cm23.h new file mode 100644 index 0000000..acbc5df --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_cm23.h @@ -0,0 +1,1993 @@ +/**************************************************************************//** + * @file core_cm23.h + * @brief CMSIS Cortex-M23 Core Peripheral Access Layer Header File + * @version V5.0.7 + * @date 22. June 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM23_H_GENERIC +#define __CORE_CM23_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M23 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS definitions */ +#define __CM23_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM23_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM23_CMSIS_VERSION ((__CM23_CMSIS_VERSION_MAIN << 16U) | \ + __CM23_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (23U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM23_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM23_H_DEPENDANT +#define __CORE_CM23_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM23_REV + #define __CM23_REV 0x0000U + #warning "__CM23_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __VTOR_PRESENT + #define __VTOR_PRESENT 0U + #warning "__VTOR_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif + + #ifndef __ETM_PRESENT + #define __ETM_PRESENT 0U + #warning "__ETM_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MTB_PRESENT + #define __MTB_PRESENT 0U + #warning "__MTB_PRESENT not defined in device header file; using default!" + #endif + +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M23 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint32_t IPR[124U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ +#else + uint32_t RESERVED0; +#endif + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED1; + __IOM uint32_t SHPR[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + uint32_t RESERVED0[6U]; + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x3UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */ + __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */ + __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) Device Configuration Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration Test FIFO Test Data 0 Register Definitions */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */ +#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */ +#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */ +#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */ + +/* TPI Integration Test ATB Control Register 2 Register Definitions */ +#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */ +#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */ + +#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */ +#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */ + +#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */ +#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */ + +#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */ +#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */ + +/* TPI Integration Test FIFO Test Data 1 Register Definitions */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */ +#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */ +#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */ +#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */ + +/* TPI Integration Test ATB Control Register 0 Definitions */ +#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */ +#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */ + +#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */ +#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */ + +#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */ +#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */ + +#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */ +#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + uint32_t RESERVED0[7U]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 1U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: EN Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: EN Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#endif +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register */ +#define CoreDebug_DEMCR_DWTENA_Pos 24U /*!< CoreDebug DEMCR: DWTENA Position */ +#define CoreDebug_DEMCR_DWTENA_Msk (1UL << CoreDebug_DEMCR_DWTENA_Pos) /*!< CoreDebug DEMCR: DWTENA Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else +/*#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping not available for Cortex-M23 */ +/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for Cortex-M23 */ + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000002UL) /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + +#define __NVIC_SetPriorityGrouping(X) (void)(X) +#define __NVIC_GetPriorityGrouping() (0U) + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + If VTOR is not present address 0 must be mapped to SRAM. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ +#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U) + uint32_t *vectors = (uint32_t *)SCB->VTOR; +#else + uint32_t *vectors = (uint32_t *)0x0U; +#endif + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[_IP_IDX(IRQn)] = ((uint32_t)(NVIC_NS->IPR[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB_NS->SHPR[_SHP_IDX(IRQn)] = ((uint32_t)(SCB_NS->SHPR[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IPR[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB_NS->SHPR[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM23_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_cm3.h b/Software/Code/Drivers/CMSIS/Include/core_cm3.h new file mode 100644 index 0000000..74bff64 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_cm3.h @@ -0,0 +1,1941 @@ +/**************************************************************************//** + * @file core_cm3.h + * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File + * @version V5.0.8 + * @date 04. June 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM3_H_GENERIC +#define __CORE_CM3_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M3 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM3 definitions */ +#define __CM3_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM3_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16U) | \ + __CM3_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (3U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM3_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM3_H_DEPENDANT +#define __CORE_CM3_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM3_REV + #define __CM3_REV 0x0200U + #warning "__CM3_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M3 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t _reserved1:8; /*!< bit: 16..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5U]; + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#if defined (__CM3_REV) && (__CM3_REV < 0x0201U) /* core r2p1 */ +#define SCB_VTOR_TBLBASE_Pos 29U /*!< SCB VTOR: TBLBASE Position */ +#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ + +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#else +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ +#endif + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ +#if defined (__CM3_REV) && (__CM3_REV >= 0x200U) + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +#else + uint32_t RESERVED1[1U]; +#endif +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29U]; + __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM3_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_cm33.h b/Software/Code/Drivers/CMSIS/Include/core_cm33.h new file mode 100644 index 0000000..6cd2db7 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_cm33.h @@ -0,0 +1,3002 @@ +/**************************************************************************//** + * @file core_cm33.h + * @brief CMSIS Cortex-M33 Core Peripheral Access Layer Header File + * @version V5.0.9 + * @date 06. July 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM33_H_GENERIC +#define __CORE_CM33_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M33 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM33 definitions */ +#define __CM33_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM33_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM33_CMSIS_VERSION ((__CM33_CMSIS_VERSION_MAIN << 16U) | \ + __CM33_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (33U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined (__TARGET_FPU_VFP) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined (__ARM_PCS_VFP) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined (__ARMVFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + + #if defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1U) + #if defined (__DSP_PRESENT) && (__DSP_PRESENT == 1U) + #define __DSP_USED 1U + #else + #error "Compiler generates DSP (SIMD) instructions for a devices without DSP extensions (check __DSP_PRESENT)" + #define __DSP_USED 0U + #endif + #else + #define __DSP_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined (__TI_VFP_SUPPORT__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined (__FPU_VFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM33_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM33_H_DEPENDANT +#define __CORE_CM33_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM33_REV + #define __CM33_REV 0x0000U + #warning "__CM33_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __SAUREGION_PRESENT + #define __SAUREGION_PRESENT 0U + #warning "__SAUREGION_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DSP_PRESENT + #define __DSP_PRESENT 0U + #warning "__DSP_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M33 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core SAU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ +#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack-pointer select */ + uint32_t FPCA:1; /*!< bit: 2 Floating-point context active */ + uint32_t SFPA:1; /*!< bit: 3 Secure floating-point active */ + uint32_t _reserved1:28; /*!< bit: 4..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SFPA_Pos 3U /*!< CONTROL: SFPA Position */ +#define CONTROL_SFPA_Msk (1UL << CONTROL_SFPA_Pos) /*!< CONTROL: SFPA Mask */ + +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[16U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[16U]; + __IOM uint32_t ICER[16U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[16U]; + __IOM uint32_t ISPR[16U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[16U]; + __IOM uint32_t ICPR[16U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[16U]; + __IOM uint32_t IABR[16U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[16U]; + __IOM uint32_t ITNS[16U]; /*!< Offset: 0x280 (R/W) Interrupt Non-Secure State Register */ + uint32_t RESERVED5[16U]; + __IOM uint8_t IPR[496U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED6[580U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[6U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + __IOM uint32_t NSACR; /*!< Offset: 0x08C (R/W) Non-Secure Access Control Register */ + uint32_t RESERVED3[92U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ + uint32_t RESERVED7[6U]; + __IOM uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */ + __IOM uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */ + __IOM uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */ + __IOM uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */ + __IOM uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */ + uint32_t RESERVED8[1U]; + __IOM uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_PENDNMISET_Pos 31U /*!< SCB ICSR: PENDNMISET Position */ +#define SCB_ICSR_PENDNMISET_Msk (1UL << SCB_ICSR_PENDNMISET_Pos) /*!< SCB ICSR: PENDNMISET Mask */ + +#define SCB_ICSR_NMIPENDSET_Pos SCB_ICSR_PENDNMISET_Pos /*!< SCB ICSR: NMIPENDSET Position, backward compatibility */ +#define SCB_ICSR_NMIPENDSET_Msk SCB_ICSR_PENDNMISET_Msk /*!< SCB ICSR: NMIPENDSET Mask, backward compatibility */ + +#define SCB_ICSR_PENDNMICLR_Pos 30U /*!< SCB ICSR: PENDNMICLR Position */ +#define SCB_ICSR_PENDNMICLR_Msk (1UL << SCB_ICSR_PENDNMICLR_Pos) /*!< SCB ICSR: PENDNMICLR Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_STTNS_Pos 24U /*!< SCB ICSR: STTNS Position (Security Extension) */ +#define SCB_ICSR_STTNS_Msk (1UL << SCB_ICSR_STTNS_Pos) /*!< SCB ICSR: STTNS Mask (Security Extension) */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIS_Pos 14U /*!< SCB AIRCR: PRIS Position */ +#define SCB_AIRCR_PRIS_Msk (1UL << SCB_AIRCR_PRIS_Pos) /*!< SCB AIRCR: PRIS Mask */ + +#define SCB_AIRCR_BFHFNMINS_Pos 13U /*!< SCB AIRCR: BFHFNMINS Position */ +#define SCB_AIRCR_BFHFNMINS_Msk (1UL << SCB_AIRCR_BFHFNMINS_Pos) /*!< SCB AIRCR: BFHFNMINS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQS_Pos 3U /*!< SCB AIRCR: SYSRESETREQS Position */ +#define SCB_AIRCR_SYSRESETREQS_Msk (1UL << SCB_AIRCR_SYSRESETREQS_Pos) /*!< SCB AIRCR: SYSRESETREQS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEPS_Pos 3U /*!< SCB SCR: SLEEPDEEPS Position */ +#define SCB_SCR_SLEEPDEEPS_Msk (1UL << SCB_SCR_SLEEPDEEPS_Pos) /*!< SCB SCR: SLEEPDEEPS Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: BP Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: BP Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: IC Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: IC Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: DC Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: DC Mask */ + +#define SCB_CCR_STKOFHFNMIGN_Pos 10U /*!< SCB CCR: STKOFHFNMIGN Position */ +#define SCB_CCR_STKOFHFNMIGN_Msk (1UL << SCB_CCR_STKOFHFNMIGN_Pos) /*!< SCB CCR: STKOFHFNMIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_HARDFAULTPENDED_Pos 21U /*!< SCB SHCSR: HARDFAULTPENDED Position */ +#define SCB_SHCSR_HARDFAULTPENDED_Msk (1UL << SCB_SHCSR_HARDFAULTPENDED_Pos) /*!< SCB SHCSR: HARDFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTPENDED_Pos 20U /*!< SCB SHCSR: SECUREFAULTPENDED Position */ +#define SCB_SHCSR_SECUREFAULTPENDED_Msk (1UL << SCB_SHCSR_SECUREFAULTPENDED_Pos) /*!< SCB SHCSR: SECUREFAULTPENDED Mask */ + +#define SCB_SHCSR_SECUREFAULTENA_Pos 19U /*!< SCB SHCSR: SECUREFAULTENA Position */ +#define SCB_SHCSR_SECUREFAULTENA_Msk (1UL << SCB_SHCSR_SECUREFAULTENA_Pos) /*!< SCB SHCSR: SECUREFAULTENA Mask */ + +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_NMIACT_Pos 5U /*!< SCB SHCSR: NMIACT Position */ +#define SCB_SHCSR_NMIACT_Msk (1UL << SCB_SHCSR_NMIACT_Pos) /*!< SCB SHCSR: NMIACT Mask */ + +#define SCB_SHCSR_SECUREFAULTACT_Pos 4U /*!< SCB SHCSR: SECUREFAULTACT Position */ +#define SCB_SHCSR_SECUREFAULTACT_Msk (1UL << SCB_SHCSR_SECUREFAULTACT_Pos) /*!< SCB SHCSR: SECUREFAULTACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_HARDFAULTACT_Pos 2U /*!< SCB SHCSR: HARDFAULTACT Position */ +#define SCB_SHCSR_HARDFAULTACT_Msk (1UL << SCB_SHCSR_HARDFAULTACT_Pos) /*!< SCB SHCSR: HARDFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_STKOF_Pos (SCB_CFSR_USGFAULTSR_Pos + 4U) /*!< SCB CFSR (UFSR): STKOF Position */ +#define SCB_CFSR_STKOF_Msk (1UL << SCB_CFSR_STKOF_Pos) /*!< SCB CFSR (UFSR): STKOF Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Non-Secure Access Control Register Definitions */ +#define SCB_NSACR_CP11_Pos 11U /*!< SCB NSACR: CP11 Position */ +#define SCB_NSACR_CP11_Msk (1UL << SCB_NSACR_CP11_Pos) /*!< SCB NSACR: CP11 Mask */ + +#define SCB_NSACR_CP10_Pos 10U /*!< SCB NSACR: CP10 Position */ +#define SCB_NSACR_CP10_Msk (1UL << SCB_NSACR_CP10_Pos) /*!< SCB NSACR: CP10 Mask */ + +#define SCB_NSACR_CPn_Pos 0U /*!< SCB NSACR: CPn Position */ +#define SCB_NSACR_CPn_Msk (1UL /*<< SCB_NSACR_CPn_Pos*/) /*!< SCB NSACR: CPn Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/* Instruction Tightly-Coupled Memory Control Register Definitions */ +#define SCB_ITCMCR_SZ_Pos 3U /*!< SCB ITCMCR: SZ Position */ +#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */ + +#define SCB_ITCMCR_RETEN_Pos 2U /*!< SCB ITCMCR: RETEN Position */ +#define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */ + +#define SCB_ITCMCR_RMW_Pos 1U /*!< SCB ITCMCR: RMW Position */ +#define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */ + +#define SCB_ITCMCR_EN_Pos 0U /*!< SCB ITCMCR: EN Position */ +#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */ + +/* Data Tightly-Coupled Memory Control Register Definitions */ +#define SCB_DTCMCR_SZ_Pos 3U /*!< SCB DTCMCR: SZ Position */ +#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */ + +#define SCB_DTCMCR_RETEN_Pos 2U /*!< SCB DTCMCR: RETEN Position */ +#define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */ + +#define SCB_DTCMCR_RMW_Pos 1U /*!< SCB DTCMCR: RMW Position */ +#define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */ + +#define SCB_DTCMCR_EN_Pos 0U /*!< SCB DTCMCR: EN Position */ +#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */ + +/* AHBP Control Register Definitions */ +#define SCB_AHBPCR_SZ_Pos 1U /*!< SCB AHBPCR: SZ Position */ +#define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */ + +#define SCB_AHBPCR_EN_Pos 0U /*!< SCB AHBPCR: EN Position */ +#define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */ + +/* L1 Cache Control Register Definitions */ +#define SCB_CACR_FORCEWT_Pos 2U /*!< SCB CACR: FORCEWT Position */ +#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */ + +#define SCB_CACR_ECCEN_Pos 1U /*!< SCB CACR: ECCEN Position */ +#define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< SCB CACR: ECCEN Mask */ + +#define SCB_CACR_SIWT_Pos 0U /*!< SCB CACR: SIWT Position */ +#define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */ + +/* AHBS Control Register Definitions */ +#define SCB_AHBSCR_INITCOUNT_Pos 11U /*!< SCB AHBSCR: INITCOUNT Position */ +#define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */ + +#define SCB_AHBSCR_TPRI_Pos 2U /*!< SCB AHBSCR: TPRI Position */ +#define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBPCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */ + +#define SCB_AHBSCR_CTL_Pos 0U /*!< SCB AHBSCR: CTL Position*/ +#define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBPCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */ + +/* Auxiliary Bus Fault Status Register Definitions */ +#define SCB_ABFSR_AXIMTYPE_Pos 8U /*!< SCB ABFSR: AXIMTYPE Position*/ +#define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */ + +#define SCB_ABFSR_EPPB_Pos 4U /*!< SCB ABFSR: EPPB Position*/ +#define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */ + +#define SCB_ABFSR_AXIM_Pos 3U /*!< SCB ABFSR: AXIM Position*/ +#define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */ + +#define SCB_ABFSR_AHBP_Pos 2U /*!< SCB ABFSR: AHBP Position*/ +#define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */ + +#define SCB_ABFSR_DTCM_Pos 1U /*!< SCB ABFSR: DTCM Position*/ +#define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */ + +#define SCB_ABFSR_ITCM_Pos 0U /*!< SCB ABFSR: ITCM Position*/ +#define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ + __IOM uint32_t CPPWR; /*!< Offset: 0x00C (R/W) Coprocessor Power Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29U]; + __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) ITM Device Architecture Register */ + uint32_t RESERVED6[4U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Stimulus Port Register Definitions */ +#define ITM_STIM_DISABLED_Pos 1U /*!< ITM STIM: DISABLED Position */ +#define ITM_STIM_DISABLED_Msk (0x1UL << ITM_STIM_DISABLED_Pos) /*!< ITM STIM: DISABLED Mask */ + +#define ITM_STIM_FIFOREADY_Pos 0U /*!< ITM STIM: FIFOREADY Position */ +#define ITM_STIM_FIFOREADY_Msk (0x1UL /*<< ITM_STIM_FIFOREADY_Pos*/) /*!< ITM STIM: FIFOREADY Mask */ + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TRACEBUSID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TRACEBUSID_Msk (0x7FUL << ITM_TCR_TRACEBUSID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPRESCALE_Pos 8U /*!< ITM TCR: TSPRESCALE Position */ +#define ITM_TCR_TSPRESCALE_Msk (3UL << ITM_TCR_TSPRESCALE_Pos) /*!< ITM TCR: TSPRESCALE Mask */ + +#define ITM_TCR_STALLENA_Pos 5U /*!< ITM TCR: STALLENA Position */ +#define ITM_TCR_STALLENA_Msk (1UL << ITM_TCR_STALLENA_Pos) /*!< ITM TCR: STALLENA Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + uint32_t RESERVED3[1U]; + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED4[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + uint32_t RESERVED5[1U]; + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED6[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + uint32_t RESERVED7[1U]; + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED8[1U]; + __IOM uint32_t COMP4; /*!< Offset: 0x060 (R/W) Comparator Register 4 */ + uint32_t RESERVED9[1U]; + __IOM uint32_t FUNCTION4; /*!< Offset: 0x068 (R/W) Function Register 4 */ + uint32_t RESERVED10[1U]; + __IOM uint32_t COMP5; /*!< Offset: 0x070 (R/W) Comparator Register 5 */ + uint32_t RESERVED11[1U]; + __IOM uint32_t FUNCTION5; /*!< Offset: 0x078 (R/W) Function Register 5 */ + uint32_t RESERVED12[1U]; + __IOM uint32_t COMP6; /*!< Offset: 0x080 (R/W) Comparator Register 6 */ + uint32_t RESERVED13[1U]; + __IOM uint32_t FUNCTION6; /*!< Offset: 0x088 (R/W) Function Register 6 */ + uint32_t RESERVED14[1U]; + __IOM uint32_t COMP7; /*!< Offset: 0x090 (R/W) Comparator Register 7 */ + uint32_t RESERVED15[1U]; + __IOM uint32_t FUNCTION7; /*!< Offset: 0x098 (R/W) Function Register 7 */ + uint32_t RESERVED16[1U]; + __IOM uint32_t COMP8; /*!< Offset: 0x0A0 (R/W) Comparator Register 8 */ + uint32_t RESERVED17[1U]; + __IOM uint32_t FUNCTION8; /*!< Offset: 0x0A8 (R/W) Function Register 8 */ + uint32_t RESERVED18[1U]; + __IOM uint32_t COMP9; /*!< Offset: 0x0B0 (R/W) Comparator Register 9 */ + uint32_t RESERVED19[1U]; + __IOM uint32_t FUNCTION9; /*!< Offset: 0x0B8 (R/W) Function Register 9 */ + uint32_t RESERVED20[1U]; + __IOM uint32_t COMP10; /*!< Offset: 0x0C0 (R/W) Comparator Register 10 */ + uint32_t RESERVED21[1U]; + __IOM uint32_t FUNCTION10; /*!< Offset: 0x0C8 (R/W) Function Register 10 */ + uint32_t RESERVED22[1U]; + __IOM uint32_t COMP11; /*!< Offset: 0x0D0 (R/W) Comparator Register 11 */ + uint32_t RESERVED23[1U]; + __IOM uint32_t FUNCTION11; /*!< Offset: 0x0D8 (R/W) Function Register 11 */ + uint32_t RESERVED24[1U]; + __IOM uint32_t COMP12; /*!< Offset: 0x0E0 (R/W) Comparator Register 12 */ + uint32_t RESERVED25[1U]; + __IOM uint32_t FUNCTION12; /*!< Offset: 0x0E8 (R/W) Function Register 12 */ + uint32_t RESERVED26[1U]; + __IOM uint32_t COMP13; /*!< Offset: 0x0F0 (R/W) Comparator Register 13 */ + uint32_t RESERVED27[1U]; + __IOM uint32_t FUNCTION13; /*!< Offset: 0x0F8 (R/W) Function Register 13 */ + uint32_t RESERVED28[1U]; + __IOM uint32_t COMP14; /*!< Offset: 0x100 (R/W) Comparator Register 14 */ + uint32_t RESERVED29[1U]; + __IOM uint32_t FUNCTION14; /*!< Offset: 0x108 (R/W) Function Register 14 */ + uint32_t RESERVED30[1U]; + __IOM uint32_t COMP15; /*!< Offset: 0x110 (R/W) Comparator Register 15 */ + uint32_t RESERVED31[1U]; + __IOM uint32_t FUNCTION15; /*!< Offset: 0x118 (R/W) Function Register 15 */ + uint32_t RESERVED32[934U]; + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ + uint32_t RESERVED33[1U]; + __IM uint32_t DEVARCH; /*!< Offset: 0xFBC (R/ ) Device Architecture Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCDISS_Pos 23U /*!< DWT CTRL: CYCDISS Position */ +#define DWT_CTRL_CYCDISS_Msk (0x1UL << DWT_CTRL_CYCDISS_Pos) /*!< DWT CTRL: CYCDISS Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_ID_Pos 27U /*!< DWT FUNCTION: ID Position */ +#define DWT_FUNCTION_ID_Msk (0x1FUL << DWT_FUNCTION_ID_Pos) /*!< DWT FUNCTION: ID Mask */ + +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_ACTION_Pos 4U /*!< DWT FUNCTION: ACTION Position */ +#define DWT_FUNCTION_ACTION_Msk (0x1UL << DWT_FUNCTION_ACTION_Pos) /*!< DWT FUNCTION: ACTION Mask */ + +#define DWT_FUNCTION_MATCH_Pos 0U /*!< DWT FUNCTION: MATCH Position */ +#define DWT_FUNCTION_MATCH_Msk (0xFUL /*<< DWT_FUNCTION_MATCH_Pos*/) /*!< DWT FUNCTION: MATCH Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IOM uint32_t PSCR; /*!< Offset: 0x308 (R/W) Periodic Synchronization Control Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t ITFTTD0; /*!< Offset: 0xEEC (R/ ) Integration Test FIFO Test Data 0 Register */ + __IOM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/W) Integration Test ATB Control Register 2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) Integration Test ATB Control Register 0 */ + __IM uint32_t ITFTTD1; /*!< Offset: 0xEFC (R/ ) Integration Test FIFO Test Data 1 Register */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) Device Configuration Register */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) Device Type Identifier Register */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_FOnMan_Pos 6U /*!< TPI FFCR: FOnMan Position */ +#define TPI_FFCR_FOnMan_Msk (0x1UL << TPI_FFCR_FOnMan_Pos) /*!< TPI FFCR: FOnMan Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration Test FIFO Test Data 0 Register Definitions */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD0: ATB Interface 2 ATVALIDPosition */ +#define TPI_ITFTTD0_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD0: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD0_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD0_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD0: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD0_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD0: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD0_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD0_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD0: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data2_Pos 16U /*!< TPI ITFTTD0: ATB Interface 1 data2 Position */ +#define TPI_ITFTTD0_ATB_IF1_data2_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data2 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data1_Pos 8U /*!< TPI ITFTTD0: ATB Interface 1 data1 Position */ +#define TPI_ITFTTD0_ATB_IF1_data1_Msk (0xFFUL << TPI_ITFTTD0_ATB_IF1_data1_Pos) /*!< TPI ITFTTD0: ATB Interface 1 data1 Mask */ + +#define TPI_ITFTTD0_ATB_IF1_data0_Pos 0U /*!< TPI ITFTTD0: ATB Interface 1 data0 Position */ +#define TPI_ITFTTD0_ATB_IF1_data0_Msk (0xFFUL /*<< TPI_ITFTTD0_ATB_IF1_data0_Pos*/) /*!< TPI ITFTTD0: ATB Interface 1 data0 Mask */ + +/* TPI Integration Test ATB Control Register 2 Register Definitions */ +#define TPI_ITATBCTR2_AFVALID2S_Pos 1U /*!< TPI ITATBCTR2: AFVALID2S Position */ +#define TPI_ITATBCTR2_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID2S_Pos) /*!< TPI ITATBCTR2: AFVALID2SS Mask */ + +#define TPI_ITATBCTR2_AFVALID1S_Pos 1U /*!< TPI ITATBCTR2: AFVALID1S Position */ +#define TPI_ITATBCTR2_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR2_AFVALID1S_Pos) /*!< TPI ITATBCTR2: AFVALID1SS Mask */ + +#define TPI_ITATBCTR2_ATREADY2S_Pos 0U /*!< TPI ITATBCTR2: ATREADY2S Position */ +#define TPI_ITATBCTR2_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2S_Pos*/) /*!< TPI ITATBCTR2: ATREADY2S Mask */ + +#define TPI_ITATBCTR2_ATREADY1S_Pos 0U /*!< TPI ITATBCTR2: ATREADY1S Position */ +#define TPI_ITATBCTR2_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1S_Pos*/) /*!< TPI ITATBCTR2: ATREADY1S Mask */ + +/* TPI Integration Test FIFO Test Data 1 Register Definitions */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Pos 29U /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF2_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 2 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF2_bytecount_Pos 27U /*!< TPI ITFTTD1: ATB Interface 2 byte count Position */ +#define TPI_ITFTTD1_ATB_IF2_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF2_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 2 byte count Mask */ + +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Pos 26U /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Position */ +#define TPI_ITFTTD1_ATB_IF1_ATVALID_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_ATVALID_Pos) /*!< TPI ITFTTD1: ATB Interface 1 ATVALID Mask */ + +#define TPI_ITFTTD1_ATB_IF1_bytecount_Pos 24U /*!< TPI ITFTTD1: ATB Interface 1 byte count Position */ +#define TPI_ITFTTD1_ATB_IF1_bytecount_Msk (0x3UL << TPI_ITFTTD1_ATB_IF1_bytecount_Pos) /*!< TPI ITFTTD1: ATB Interface 1 byte countt Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data2_Pos 16U /*!< TPI ITFTTD1: ATB Interface 2 data2 Position */ +#define TPI_ITFTTD1_ATB_IF2_data2_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data2 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data1_Pos 8U /*!< TPI ITFTTD1: ATB Interface 2 data1 Position */ +#define TPI_ITFTTD1_ATB_IF2_data1_Msk (0xFFUL << TPI_ITFTTD1_ATB_IF2_data1_Pos) /*!< TPI ITFTTD1: ATB Interface 2 data1 Mask */ + +#define TPI_ITFTTD1_ATB_IF2_data0_Pos 0U /*!< TPI ITFTTD1: ATB Interface 2 data0 Position */ +#define TPI_ITFTTD1_ATB_IF2_data0_Msk (0xFFUL /*<< TPI_ITFTTD1_ATB_IF2_data0_Pos*/) /*!< TPI ITFTTD1: ATB Interface 2 data0 Mask */ + +/* TPI Integration Test ATB Control Register 0 Definitions */ +#define TPI_ITATBCTR0_AFVALID2S_Pos 1U /*!< TPI ITATBCTR0: AFVALID2S Position */ +#define TPI_ITATBCTR0_AFVALID2S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID2S_Pos) /*!< TPI ITATBCTR0: AFVALID2SS Mask */ + +#define TPI_ITATBCTR0_AFVALID1S_Pos 1U /*!< TPI ITATBCTR0: AFVALID1S Position */ +#define TPI_ITATBCTR0_AFVALID1S_Msk (0x1UL << TPI_ITATBCTR0_AFVALID1S_Pos) /*!< TPI ITATBCTR0: AFVALID1SS Mask */ + +#define TPI_ITATBCTR0_ATREADY2S_Pos 0U /*!< TPI ITATBCTR0: ATREADY2S Position */ +#define TPI_ITATBCTR0_ATREADY2S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2S_Pos*/) /*!< TPI ITATBCTR0: ATREADY2S Mask */ + +#define TPI_ITATBCTR0_ATREADY1S_Pos 0U /*!< TPI ITATBCTR0: ATREADY1S Position */ +#define TPI_ITATBCTR0_ATREADY1S_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1S_Pos*/) /*!< TPI ITATBCTR0: ATREADY1S Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_FIFOSZ_Pos 6U /*!< TPI DEVID: FIFOSZ Position */ +#define TPI_DEVID_FIFOSZ_Msk (0x7UL << TPI_DEVID_FIFOSZ_Pos) /*!< TPI DEVID: FIFOSZ Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x3FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) MPU Region Limit Address Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Region Base Address Register Alias 1 */ + __IOM uint32_t RLAR_A1; /*!< Offset: 0x018 (R/W) MPU Region Limit Address Register Alias 1 */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Region Base Address Register Alias 2 */ + __IOM uint32_t RLAR_A2; /*!< Offset: 0x020 (R/W) MPU Region Limit Address Register Alias 2 */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Region Base Address Register Alias 3 */ + __IOM uint32_t RLAR_A3; /*!< Offset: 0x028 (R/W) MPU Region Limit Address Register Alias 3 */ + uint32_t RESERVED0[1]; + union { + __IOM uint32_t MAIR[2]; + struct { + __IOM uint32_t MAIR0; /*!< Offset: 0x030 (R/W) MPU Memory Attribute Indirection Register 0 */ + __IOM uint32_t MAIR1; /*!< Offset: 0x034 (R/W) MPU Memory Attribute Indirection Register 1 */ + }; + }; +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_BASE_Pos 5U /*!< MPU RBAR: BASE Position */ +#define MPU_RBAR_BASE_Msk (0x7FFFFFFUL << MPU_RBAR_BASE_Pos) /*!< MPU RBAR: BASE Mask */ + +#define MPU_RBAR_SH_Pos 3U /*!< MPU RBAR: SH Position */ +#define MPU_RBAR_SH_Msk (0x3UL << MPU_RBAR_SH_Pos) /*!< MPU RBAR: SH Mask */ + +#define MPU_RBAR_AP_Pos 1U /*!< MPU RBAR: AP Position */ +#define MPU_RBAR_AP_Msk (0x3UL << MPU_RBAR_AP_Pos) /*!< MPU RBAR: AP Mask */ + +#define MPU_RBAR_XN_Pos 0U /*!< MPU RBAR: XN Position */ +#define MPU_RBAR_XN_Msk (01UL /*<< MPU_RBAR_XN_Pos*/) /*!< MPU RBAR: XN Mask */ + +/* MPU Region Limit Address Register Definitions */ +#define MPU_RLAR_LIMIT_Pos 5U /*!< MPU RLAR: LIMIT Position */ +#define MPU_RLAR_LIMIT_Msk (0x7FFFFFFUL << MPU_RLAR_LIMIT_Pos) /*!< MPU RLAR: LIMIT Mask */ + +#define MPU_RLAR_AttrIndx_Pos 1U /*!< MPU RLAR: AttrIndx Position */ +#define MPU_RLAR_AttrIndx_Msk (0x7UL << MPU_RLAR_AttrIndx_Pos) /*!< MPU RLAR: AttrIndx Mask */ + +#define MPU_RLAR_EN_Pos 0U /*!< MPU RLAR: Region enable bit Position */ +#define MPU_RLAR_EN_Msk (1UL /*<< MPU_RLAR_EN_Pos*/) /*!< MPU RLAR: Region enable bit Disable Mask */ + +/* MPU Memory Attribute Indirection Register 0 Definitions */ +#define MPU_MAIR0_Attr3_Pos 24U /*!< MPU MAIR0: Attr3 Position */ +#define MPU_MAIR0_Attr3_Msk (0xFFUL << MPU_MAIR0_Attr3_Pos) /*!< MPU MAIR0: Attr3 Mask */ + +#define MPU_MAIR0_Attr2_Pos 16U /*!< MPU MAIR0: Attr2 Position */ +#define MPU_MAIR0_Attr2_Msk (0xFFUL << MPU_MAIR0_Attr2_Pos) /*!< MPU MAIR0: Attr2 Mask */ + +#define MPU_MAIR0_Attr1_Pos 8U /*!< MPU MAIR0: Attr1 Position */ +#define MPU_MAIR0_Attr1_Msk (0xFFUL << MPU_MAIR0_Attr1_Pos) /*!< MPU MAIR0: Attr1 Mask */ + +#define MPU_MAIR0_Attr0_Pos 0U /*!< MPU MAIR0: Attr0 Position */ +#define MPU_MAIR0_Attr0_Msk (0xFFUL /*<< MPU_MAIR0_Attr0_Pos*/) /*!< MPU MAIR0: Attr0 Mask */ + +/* MPU Memory Attribute Indirection Register 1 Definitions */ +#define MPU_MAIR1_Attr7_Pos 24U /*!< MPU MAIR1: Attr7 Position */ +#define MPU_MAIR1_Attr7_Msk (0xFFUL << MPU_MAIR1_Attr7_Pos) /*!< MPU MAIR1: Attr7 Mask */ + +#define MPU_MAIR1_Attr6_Pos 16U /*!< MPU MAIR1: Attr6 Position */ +#define MPU_MAIR1_Attr6_Msk (0xFFUL << MPU_MAIR1_Attr6_Pos) /*!< MPU MAIR1: Attr6 Mask */ + +#define MPU_MAIR1_Attr5_Pos 8U /*!< MPU MAIR1: Attr5 Position */ +#define MPU_MAIR1_Attr5_Msk (0xFFUL << MPU_MAIR1_Attr5_Pos) /*!< MPU MAIR1: Attr5 Mask */ + +#define MPU_MAIR1_Attr4_Pos 0U /*!< MPU MAIR1: Attr4 Position */ +#define MPU_MAIR1_Attr4_Msk (0xFFUL /*<< MPU_MAIR1_Attr4_Pos*/) /*!< MPU MAIR1: Attr4 Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SAU Security Attribution Unit (SAU) + \brief Type definitions for the Security Attribution Unit (SAU) + @{ + */ + +/** + \brief Structure type to access the Security Attribution Unit (SAU). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SAU Control Register */ + __IM uint32_t TYPE; /*!< Offset: 0x004 (R/ ) SAU Type Register */ +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) SAU Region Number Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) SAU Region Base Address Register */ + __IOM uint32_t RLAR; /*!< Offset: 0x010 (R/W) SAU Region Limit Address Register */ +#else + uint32_t RESERVED0[3]; +#endif + __IOM uint32_t SFSR; /*!< Offset: 0x014 (R/W) Secure Fault Status Register */ + __IOM uint32_t SFAR; /*!< Offset: 0x018 (R/W) Secure Fault Address Register */ +} SAU_Type; + +/* SAU Control Register Definitions */ +#define SAU_CTRL_ALLNS_Pos 1U /*!< SAU CTRL: ALLNS Position */ +#define SAU_CTRL_ALLNS_Msk (1UL << SAU_CTRL_ALLNS_Pos) /*!< SAU CTRL: ALLNS Mask */ + +#define SAU_CTRL_ENABLE_Pos 0U /*!< SAU CTRL: ENABLE Position */ +#define SAU_CTRL_ENABLE_Msk (1UL /*<< SAU_CTRL_ENABLE_Pos*/) /*!< SAU CTRL: ENABLE Mask */ + +/* SAU Type Register Definitions */ +#define SAU_TYPE_SREGION_Pos 0U /*!< SAU TYPE: SREGION Position */ +#define SAU_TYPE_SREGION_Msk (0xFFUL /*<< SAU_TYPE_SREGION_Pos*/) /*!< SAU TYPE: SREGION Mask */ + +#if defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) +/* SAU Region Number Register Definitions */ +#define SAU_RNR_REGION_Pos 0U /*!< SAU RNR: REGION Position */ +#define SAU_RNR_REGION_Msk (0xFFUL /*<< SAU_RNR_REGION_Pos*/) /*!< SAU RNR: REGION Mask */ + +/* SAU Region Base Address Register Definitions */ +#define SAU_RBAR_BADDR_Pos 5U /*!< SAU RBAR: BADDR Position */ +#define SAU_RBAR_BADDR_Msk (0x7FFFFFFUL << SAU_RBAR_BADDR_Pos) /*!< SAU RBAR: BADDR Mask */ + +/* SAU Region Limit Address Register Definitions */ +#define SAU_RLAR_LADDR_Pos 5U /*!< SAU RLAR: LADDR Position */ +#define SAU_RLAR_LADDR_Msk (0x7FFFFFFUL << SAU_RLAR_LADDR_Pos) /*!< SAU RLAR: LADDR Mask */ + +#define SAU_RLAR_NSC_Pos 1U /*!< SAU RLAR: NSC Position */ +#define SAU_RLAR_NSC_Msk (1UL << SAU_RLAR_NSC_Pos) /*!< SAU RLAR: NSC Mask */ + +#define SAU_RLAR_ENABLE_Pos 0U /*!< SAU RLAR: ENABLE Position */ +#define SAU_RLAR_ENABLE_Msk (1UL /*<< SAU_RLAR_ENABLE_Pos*/) /*!< SAU RLAR: ENABLE Mask */ + +#endif /* defined (__SAUREGION_PRESENT) && (__SAUREGION_PRESENT == 1U) */ + +/* Secure Fault Status Register Definitions */ +#define SAU_SFSR_LSERR_Pos 7U /*!< SAU SFSR: LSERR Position */ +#define SAU_SFSR_LSERR_Msk (1UL << SAU_SFSR_LSERR_Pos) /*!< SAU SFSR: LSERR Mask */ + +#define SAU_SFSR_SFARVALID_Pos 6U /*!< SAU SFSR: SFARVALID Position */ +#define SAU_SFSR_SFARVALID_Msk (1UL << SAU_SFSR_SFARVALID_Pos) /*!< SAU SFSR: SFARVALID Mask */ + +#define SAU_SFSR_LSPERR_Pos 5U /*!< SAU SFSR: LSPERR Position */ +#define SAU_SFSR_LSPERR_Msk (1UL << SAU_SFSR_LSPERR_Pos) /*!< SAU SFSR: LSPERR Mask */ + +#define SAU_SFSR_INVTRAN_Pos 4U /*!< SAU SFSR: INVTRAN Position */ +#define SAU_SFSR_INVTRAN_Msk (1UL << SAU_SFSR_INVTRAN_Pos) /*!< SAU SFSR: INVTRAN Mask */ + +#define SAU_SFSR_AUVIOL_Pos 3U /*!< SAU SFSR: AUVIOL Position */ +#define SAU_SFSR_AUVIOL_Msk (1UL << SAU_SFSR_AUVIOL_Pos) /*!< SAU SFSR: AUVIOL Mask */ + +#define SAU_SFSR_INVER_Pos 2U /*!< SAU SFSR: INVER Position */ +#define SAU_SFSR_INVER_Msk (1UL << SAU_SFSR_INVER_Pos) /*!< SAU SFSR: INVER Mask */ + +#define SAU_SFSR_INVIS_Pos 1U /*!< SAU SFSR: INVIS Position */ +#define SAU_SFSR_INVIS_Msk (1UL << SAU_SFSR_INVIS_Pos) /*!< SAU SFSR: INVIS Mask */ + +#define SAU_SFSR_INVEP_Pos 0U /*!< SAU SFSR: INVEP Position */ +#define SAU_SFSR_INVEP_Msk (1UL /*<< SAU_SFSR_INVEP_Pos*/) /*!< SAU SFSR: INVEP Mask */ + +/*@} end of group CMSIS_SAU */ +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_LSPENS_Pos 29U /*!< FPCCR: LSPENS Position */ +#define FPU_FPCCR_LSPENS_Msk (1UL << FPU_FPCCR_LSPENS_Pos) /*!< FPCCR: LSPENS bit Mask */ + +#define FPU_FPCCR_CLRONRET_Pos 28U /*!< FPCCR: CLRONRET Position */ +#define FPU_FPCCR_CLRONRET_Msk (1UL << FPU_FPCCR_CLRONRET_Pos) /*!< FPCCR: CLRONRET bit Mask */ + +#define FPU_FPCCR_CLRONRETS_Pos 27U /*!< FPCCR: CLRONRETS Position */ +#define FPU_FPCCR_CLRONRETS_Msk (1UL << FPU_FPCCR_CLRONRETS_Pos) /*!< FPCCR: CLRONRETS bit Mask */ + +#define FPU_FPCCR_TS_Pos 26U /*!< FPCCR: TS Position */ +#define FPU_FPCCR_TS_Msk (1UL << FPU_FPCCR_TS_Pos) /*!< FPCCR: TS bit Mask */ + +#define FPU_FPCCR_UFRDY_Pos 10U /*!< FPCCR: UFRDY Position */ +#define FPU_FPCCR_UFRDY_Msk (1UL << FPU_FPCCR_UFRDY_Pos) /*!< FPCCR: UFRDY bit Mask */ + +#define FPU_FPCCR_SPLIMVIOL_Pos 9U /*!< FPCCR: SPLIMVIOL Position */ +#define FPU_FPCCR_SPLIMVIOL_Msk (1UL << FPU_FPCCR_SPLIMVIOL_Pos) /*!< FPCCR: SPLIMVIOL bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_SFRDY_Pos 7U /*!< FPCCR: SFRDY Position */ +#define FPU_FPCCR_SFRDY_Msk (1UL << FPU_FPCCR_SFRDY_Pos) /*!< FPCCR: SFRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_S_Pos 2U /*!< FPCCR: Security status of the FP context bit Position */ +#define FPU_FPCCR_S_Msk (1UL << FPU_FPCCR_S_Pos) /*!< FPCCR: Security status of the FP context bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ + uint32_t RESERVED4[1U]; + __IOM uint32_t DAUTHCTRL; /*!< Offset: 0x014 (R/W) Debug Authentication Control Register */ + __IOM uint32_t DSCSR; /*!< Offset: 0x018 (R/W) Debug Security Control and Status Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESTART_ST_Pos 26U /*!< CoreDebug DHCSR: S_RESTART_ST Position */ +#define CoreDebug_DHCSR_S_RESTART_ST_Msk (1UL << CoreDebug_DHCSR_S_RESTART_ST_Pos) /*!< CoreDebug DHCSR: S_RESTART_ST Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/* Debug Authentication Control Register Definitions */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos 3U /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Position */ +#define CoreDebug_DAUTHCTRL_INTSPNIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPNIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPNIDEN, Mask */ + +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos 2U /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPNIDENSEL_Msk (1UL << CoreDebug_DAUTHCTRL_SPNIDENSEL_Pos) /*!< CoreDebug DAUTHCTRL: SPNIDENSEL Mask */ + +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Pos 1U /*!< CoreDebug DAUTHCTRL: INTSPIDEN Position */ +#define CoreDebug_DAUTHCTRL_INTSPIDEN_Msk (1UL << CoreDebug_DAUTHCTRL_INTSPIDEN_Pos) /*!< CoreDebug DAUTHCTRL: INTSPIDEN Mask */ + +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Pos 0U /*!< CoreDebug DAUTHCTRL: SPIDENSEL Position */ +#define CoreDebug_DAUTHCTRL_SPIDENSEL_Msk (1UL /*<< CoreDebug_DAUTHCTRL_SPIDENSEL_Pos*/) /*!< CoreDebug DAUTHCTRL: SPIDENSEL Mask */ + +/* Debug Security Control and Status Register Definitions */ +#define CoreDebug_DSCSR_CDS_Pos 16U /*!< CoreDebug DSCSR: CDS Position */ +#define CoreDebug_DSCSR_CDS_Msk (1UL << CoreDebug_DSCSR_CDS_Pos) /*!< CoreDebug DSCSR: CDS Mask */ + +#define CoreDebug_DSCSR_SBRSEL_Pos 1U /*!< CoreDebug DSCSR: SBRSEL Position */ +#define CoreDebug_DSCSR_SBRSEL_Msk (1UL << CoreDebug_DSCSR_SBRSEL_Pos) /*!< CoreDebug DSCSR: SBRSEL Mask */ + +#define CoreDebug_DSCSR_SBRSELEN_Pos 0U /*!< CoreDebug DSCSR: SBRSELEN Position */ +#define CoreDebug_DSCSR_SBRSELEN_Msk (1UL /*<< CoreDebug_DSCSR_SBRSELEN_Pos*/) /*!< CoreDebug DSCSR: SBRSELEN Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ + #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ + #define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ + #define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ + #define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ + #define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ + #define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ + #define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ + #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + + #define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ + #define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ + #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ + #define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + #define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ + #define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ + #define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ + #define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE ) /*!< Core Debug configuration struct */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ + #endif + + #if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SAU_BASE (SCS_BASE + 0x0DD0UL) /*!< Security Attribution Unit */ + #define SAU ((SAU_Type *) SAU_BASE ) /*!< Security Attribution Unit */ + #endif + + #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ + #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + #define SCS_BASE_NS (0xE002E000UL) /*!< System Control Space Base Address (non-secure address space) */ + #define CoreDebug_BASE_NS (0xE002EDF0UL) /*!< Core Debug Base Address (non-secure address space) */ + #define SysTick_BASE_NS (SCS_BASE_NS + 0x0010UL) /*!< SysTick Base Address (non-secure address space) */ + #define NVIC_BASE_NS (SCS_BASE_NS + 0x0100UL) /*!< NVIC Base Address (non-secure address space) */ + #define SCB_BASE_NS (SCS_BASE_NS + 0x0D00UL) /*!< System Control Block Base Address (non-secure address space) */ + + #define SCnSCB_NS ((SCnSCB_Type *) SCS_BASE_NS ) /*!< System control Register not in SCB(non-secure address space) */ + #define SCB_NS ((SCB_Type *) SCB_BASE_NS ) /*!< SCB configuration struct (non-secure address space) */ + #define SysTick_NS ((SysTick_Type *) SysTick_BASE_NS ) /*!< SysTick configuration struct (non-secure address space) */ + #define NVIC_NS ((NVIC_Type *) NVIC_BASE_NS ) /*!< NVIC configuration struct (non-secure address space) */ + #define CoreDebug_NS ((CoreDebug_Type *) CoreDebug_BASE_NS) /*!< Core Debug configuration struct (non-secure address space) */ + + #if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE_NS (SCS_BASE_NS + 0x0D90UL) /*!< Memory Protection Unit (non-secure address space) */ + #define MPU_NS ((MPU_Type *) MPU_BASE_NS ) /*!< Memory Protection Unit (non-secure address space) */ + #endif + + #define FPU_BASE_NS (SCS_BASE_NS + 0x0F30UL) /*!< Floating Point Unit (non-secure address space) */ + #define FPU_NS ((FPU_Type *) FPU_BASE_NS ) /*!< Floating Point Unit (non-secure address space) */ + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* Special LR values for Secure/Non-Secure call handling and exception handling */ + +/* Function Return Payload (from ARMv8-M Architecture Reference Manual) LR value on entry from Secure BLXNS */ +#define FNC_RETURN (0xFEFFFFFFUL) /* bit [0] ignored when processing a branch */ + +/* The following EXC_RETURN mask values are used to evaluate the LR on exception entry */ +#define EXC_RETURN_PREFIX (0xFF000000UL) /* bits [31:24] set to indicate an EXC_RETURN value */ +#define EXC_RETURN_S (0x00000040UL) /* bit [6] stack used to push registers: 0=Non-secure 1=Secure */ +#define EXC_RETURN_DCRS (0x00000020UL) /* bit [5] stacking rules for called registers: 0=skipped 1=saved */ +#define EXC_RETURN_FTYPE (0x00000010UL) /* bit [4] allocate stack for floating-point context: 0=done 1=skipped */ +#define EXC_RETURN_MODE (0x00000008UL) /* bit [3] processor mode for return: 0=Handler mode 1=Thread mode */ +#define EXC_RETURN_SPSEL (0x00000002UL) /* bit [1] stack pointer used to restore context: 0=MSP 1=PSP */ +#define EXC_RETURN_ES (0x00000001UL) /* bit [0] security state exception was taken to: 0=Non-secure 1=Secure */ + +/* Integrity Signature (from ARMv8-M Architecture Reference Manual) for exception context stacking */ +#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) /* Value for processors with floating-point extension: */ +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125AUL) /* bit [0] SFTC must match LR bit[4] EXC_RETURN_FTYPE */ +#else +#define EXC_INTEGRITY_SIGNATURE (0xFEFA125BUL) /* Value for processors without floating-point extension */ +#endif + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8U) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Get Interrupt Target State + \details Reads the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + \return 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_GetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Target State + \details Sets the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_SetTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] |= ((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Clear Interrupt Target State + \details Clears the interrupt target field in the NVIC and returns the interrupt target bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 if interrupt is assigned to Secure + 1 if interrupt is assigned to Non Secure + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t NVIC_ClearTargetState(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] &= ~((uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL))); + return((uint32_t)(((NVIC->ITNS[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief Set Priority Grouping (non-secure) + \details Sets the non-secure priority grouping field when in secure state using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void TZ_NVIC_SetPriorityGrouping_NS(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB_NS->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB_NS->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping (non-secure) + \details Reads the priority grouping field from the non-secure NVIC when in secure state. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriorityGrouping_NS(void) +{ + return ((uint32_t)((SCB_NS->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt (non-secure) + \details Enables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_EnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status (non-secure) + \details Returns a device specific interrupt enable status from the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetEnableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt (non-secure) + \details Disables a device specific interrupt in the non-secure NVIC interrupt controller when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_DisableIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Pending Interrupt (non-secure) + \details Reads the NVIC pending register in the non-secure NVIC when in secure state and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt (non-secure) + \details Sets the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_SetPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt (non-secure) + \details Clears the pending bit of a device specific interrupt in the non-secure NVIC pending register when in secure state. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void TZ_NVIC_ClearPendingIRQ_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt (non-secure) + \details Reads the active register in non-secure NVIC when in secure state and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetActive_NS(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC_NS->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority (non-secure) + \details Sets the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every non-secure processor exception. + */ +__STATIC_INLINE void TZ_NVIC_SetPriority_NS(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC_NS->IPR[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority (non-secure) + \details Reads the priority of a non-secure device specific interrupt or a non-secure processor exception when in secure state. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t TZ_NVIC_GetPriority_NS(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC_NS->IPR[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB_NS->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} +#endif /* defined (__ARM_FEATURE_CMSE) &&(__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv8.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## SAU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SAUFunctions SAU Functions + \brief Functions that configure the SAU. + @{ + */ + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + +/** + \brief Enable SAU + \details Enables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Enable(void) +{ + SAU->CTRL |= (SAU_CTRL_ENABLE_Msk); +} + + + +/** + \brief Disable SAU + \details Disables the Security Attribution Unit (SAU). + */ +__STATIC_INLINE void TZ_SAU_Disable(void) +{ + SAU->CTRL &= ~(SAU_CTRL_ENABLE_Msk); +} + +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +/*@} end of CMSIS_Core_SAUFunctions */ + + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +/** + \brief System Tick Configuration (non-secure) + \details Initializes the non-secure System Timer and its interrupt when in secure state, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function TZ_SysTick_Config_NS is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + + */ +__STATIC_INLINE uint32_t TZ_SysTick_Config_NS(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick_NS->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + TZ_NVIC_SetPriority_NS (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick_NS->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick_NS->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} +#endif /* defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) */ + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM33_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_cm4.h b/Software/Code/Drivers/CMSIS/Include/core_cm4.h new file mode 100644 index 0000000..7d56873 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_cm4.h @@ -0,0 +1,2129 @@ +/**************************************************************************//** + * @file core_cm4.h + * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File + * @version V5.0.8 + * @date 04. June 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM4_H_GENERIC +#define __CORE_CM4_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M4 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM4 definitions */ +#define __CM4_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM4_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16U) | \ + __CM4_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (4U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM4_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM4_H_DEPENDANT +#define __CORE_CM4_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM4_REV + #define __CM4_REV 0x0000U + #warning "__CM4_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M4 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ + uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5U]; + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISOOFP_Pos 9U /*!< ACTLR: DISOOFP Position */ +#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */ + +#define SCnSCB_ACTLR_DISFPCA_Pos 8U /*!< ACTLR: DISFPCA Position */ +#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29U]; + __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +#define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ +#define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ +#define EXC_RETURN_HANDLER_FPU (0xFFFFFFE1UL) /* return to Handler mode, uses MSP after return, restore floating-point state */ +#define EXC_RETURN_THREAD_MSP_FPU (0xFFFFFFE9UL) /* return to Thread mode, uses MSP after return, restore floating-point state */ +#define EXC_RETURN_THREAD_PSP_FPU (0xFFFFFFEDUL) /* return to Thread mode, uses PSP after return, restore floating-point state */ + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM4_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_cm7.h b/Software/Code/Drivers/CMSIS/Include/core_cm7.h new file mode 100644 index 0000000..a14dc62 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_cm7.h @@ -0,0 +1,2671 @@ +/**************************************************************************//** + * @file core_cm7.h + * @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File + * @version V5.0.8 + * @date 04. June 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM7_H_GENERIC +#define __CORE_CM7_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M7 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS CM7 definitions */ +#define __CM7_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __CM7_CMSIS_VERSION_SUB ( __CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16U) | \ + __CM7_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_M (7U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM7_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM7_H_DEPENDANT +#define __CORE_CM7_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM7_REV + #define __CM7_REV 0x0000U + #warning "__CM7_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __ICACHE_PRESENT + #define __ICACHE_PRESENT 0U + #warning "__ICACHE_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DCACHE_PRESENT + #define __DCACHE_PRESENT 0U + #warning "__DCACHE_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __DTCM_PRESENT + #define __DTCM_PRESENT 0U + #warning "__DTCM_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M7 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ + uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t ID_MFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ID_ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[1U]; + __IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */ + __IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */ + __IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */ + __IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */ + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + uint32_t RESERVED3[93U]; + __OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */ + uint32_t RESERVED4[15U]; + __IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */ + uint32_t RESERVED5[1U]; + __OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */ + uint32_t RESERVED6[1U]; + __OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */ + __OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */ + __OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */ + __OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */ + __OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */ + __OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */ + __OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */ + __OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */ + uint32_t RESERVED7[6U]; + __IOM uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */ + __IOM uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */ + __IOM uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */ + __IOM uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */ + __IOM uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */ + uint32_t RESERVED8[1U]; + __IOM uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: Branch prediction enable bit Position */ +#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: Branch prediction enable bit Mask */ + +#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: Instruction cache enable bit Position */ +#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: Instruction cache enable bit Mask */ + +#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: Cache enable bit Position */ +#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: Cache enable bit Mask */ + +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/* SCB Cache Level ID Register Definitions */ +#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */ +#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */ + +#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */ +#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */ + +/* SCB Cache Type Register Definitions */ +#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */ +#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */ + +#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */ +#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */ + +#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */ +#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */ + +#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */ +#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */ + +#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */ +#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */ + +/* SCB Cache Size ID Register Definitions */ +#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */ +#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */ + +#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */ +#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */ + +#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */ +#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */ + +#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */ +#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */ + +#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */ +#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */ + +#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */ +#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */ + +#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */ +#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */ + +/* SCB Cache Size Selection Register Definitions */ +#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */ +#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */ + +#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */ +#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */ + +/* SCB Software Triggered Interrupt Register Definitions */ +#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */ +#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */ + +/* SCB D-Cache Invalidate by Set-way Register Definitions */ +#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */ +#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */ + +#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */ +#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */ + +/* SCB D-Cache Clean by Set-way Register Definitions */ +#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */ +#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */ + +#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */ +#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */ + +/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */ +#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */ +#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */ + +#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */ +#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */ + +/* Instruction Tightly-Coupled Memory Control Register Definitions */ +#define SCB_ITCMCR_SZ_Pos 3U /*!< SCB ITCMCR: SZ Position */ +#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */ + +#define SCB_ITCMCR_RETEN_Pos 2U /*!< SCB ITCMCR: RETEN Position */ +#define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */ + +#define SCB_ITCMCR_RMW_Pos 1U /*!< SCB ITCMCR: RMW Position */ +#define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */ + +#define SCB_ITCMCR_EN_Pos 0U /*!< SCB ITCMCR: EN Position */ +#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */ + +/* Data Tightly-Coupled Memory Control Register Definitions */ +#define SCB_DTCMCR_SZ_Pos 3U /*!< SCB DTCMCR: SZ Position */ +#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */ + +#define SCB_DTCMCR_RETEN_Pos 2U /*!< SCB DTCMCR: RETEN Position */ +#define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */ + +#define SCB_DTCMCR_RMW_Pos 1U /*!< SCB DTCMCR: RMW Position */ +#define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */ + +#define SCB_DTCMCR_EN_Pos 0U /*!< SCB DTCMCR: EN Position */ +#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */ + +/* AHBP Control Register Definitions */ +#define SCB_AHBPCR_SZ_Pos 1U /*!< SCB AHBPCR: SZ Position */ +#define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */ + +#define SCB_AHBPCR_EN_Pos 0U /*!< SCB AHBPCR: EN Position */ +#define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */ + +/* L1 Cache Control Register Definitions */ +#define SCB_CACR_FORCEWT_Pos 2U /*!< SCB CACR: FORCEWT Position */ +#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */ + +#define SCB_CACR_ECCEN_Pos 1U /*!< SCB CACR: ECCEN Position */ +#define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< SCB CACR: ECCEN Mask */ + +#define SCB_CACR_SIWT_Pos 0U /*!< SCB CACR: SIWT Position */ +#define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */ + +/* AHBS Control Register Definitions */ +#define SCB_AHBSCR_INITCOUNT_Pos 11U /*!< SCB AHBSCR: INITCOUNT Position */ +#define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBPCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */ + +#define SCB_AHBSCR_TPRI_Pos 2U /*!< SCB AHBSCR: TPRI Position */ +#define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBPCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */ + +#define SCB_AHBSCR_CTL_Pos 0U /*!< SCB AHBSCR: CTL Position*/ +#define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBPCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */ + +/* Auxiliary Bus Fault Status Register Definitions */ +#define SCB_ABFSR_AXIMTYPE_Pos 8U /*!< SCB ABFSR: AXIMTYPE Position*/ +#define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */ + +#define SCB_ABFSR_EPPB_Pos 4U /*!< SCB ABFSR: EPPB Position*/ +#define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */ + +#define SCB_ABFSR_AXIM_Pos 3U /*!< SCB ABFSR: AXIM Position*/ +#define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */ + +#define SCB_ABFSR_AHBP_Pos 2U /*!< SCB ABFSR: AHBP Position*/ +#define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */ + +#define SCB_ABFSR_DTCM_Pos 1U /*!< SCB ABFSR: DTCM Position*/ +#define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */ + +#define SCB_ABFSR_ITCM_Pos 0U /*!< SCB ABFSR: ITCM Position*/ +#define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISITMATBFLUSH_Pos 12U /*!< ACTLR: DISITMATBFLUSH Position */ +#define SCnSCB_ACTLR_DISITMATBFLUSH_Msk (1UL << SCnSCB_ACTLR_DISITMATBFLUSH_Pos) /*!< ACTLR: DISITMATBFLUSH Mask */ + +#define SCnSCB_ACTLR_DISRAMODE_Pos 11U /*!< ACTLR: DISRAMODE Position */ +#define SCnSCB_ACTLR_DISRAMODE_Msk (1UL << SCnSCB_ACTLR_DISRAMODE_Pos) /*!< ACTLR: DISRAMODE Mask */ + +#define SCnSCB_ACTLR_FPEXCODIS_Pos 10U /*!< ACTLR: FPEXCODIS Position */ +#define SCnSCB_ACTLR_FPEXCODIS_Msk (1UL << SCnSCB_ACTLR_FPEXCODIS_Pos) /*!< ACTLR: FPEXCODIS Mask */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29U]; + __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ + uint32_t RESERVED3[981U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( W) Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +#define MPU_TYPE_RALIASES 4U + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ + __IM uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and FP Feature Register 2 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/* Media and FP Feature Register 2 Definitions */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +#define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ +#define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ +#define EXC_RETURN_HANDLER_FPU (0xFFFFFFE1UL) /* return to Handler mode, uses MSP after return, restore floating-point state */ +#define EXC_RETURN_THREAD_MSP_FPU (0xFFFFFFE9UL) /* return to Thread mode, uses MSP after return, restore floating-point state */ +#define EXC_RETURN_THREAD_PSP_FPU (0xFFFFFFEDUL) /* return to Thread mode, uses PSP after return, restore floating-point state */ + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + +/* ########################## MPU functions #################################### */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + +#include "mpu_armv7.h" + +#endif + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = SCB->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U) + { + return 2U; /* Double + Single precision FPU */ + } + else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ########################## Cache functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_CacheFunctions Cache Functions + \brief Functions that configure Instruction and Data cache. + @{ + */ + +/* Cache Size ID Register Macros */ +#define CCSIDR_WAYS(x) (((x) & SCB_CCSIDR_ASSOCIATIVITY_Msk) >> SCB_CCSIDR_ASSOCIATIVITY_Pos) +#define CCSIDR_SETS(x) (((x) & SCB_CCSIDR_NUMSETS_Msk ) >> SCB_CCSIDR_NUMSETS_Pos ) + + +/** + \brief Enable I-Cache + \details Turns on I-Cache + */ +__STATIC_INLINE void SCB_EnableICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + __DSB(); + __ISB(); + SCB->ICIALLU = 0UL; /* invalidate I-Cache */ + __DSB(); + __ISB(); + SCB->CCR |= (uint32_t)SCB_CCR_IC_Msk; /* enable I-Cache */ + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Disable I-Cache + \details Turns off I-Cache + */ +__STATIC_INLINE void SCB_DisableICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + __DSB(); + __ISB(); + SCB->CCR &= ~(uint32_t)SCB_CCR_IC_Msk; /* disable I-Cache */ + SCB->ICIALLU = 0UL; /* invalidate I-Cache */ + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Invalidate I-Cache + \details Invalidates I-Cache + */ +__STATIC_INLINE void SCB_InvalidateICache (void) +{ + #if defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U) + __DSB(); + __ISB(); + SCB->ICIALLU = 0UL; + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Enable D-Cache + \details Turns on D-Cache + */ +__STATIC_INLINE void SCB_EnableDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) | + ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + __DSB(); + + SCB->CCR |= (uint32_t)SCB_CCR_DC_Msk; /* enable D-Cache */ + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Disable D-Cache + \details Turns off D-Cache + */ +__STATIC_INLINE void SCB_DisableDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* Level 1 data cache */ + __DSB(); + + SCB->CCR &= ~(uint32_t)SCB_CCR_DC_Msk; /* disable D-Cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean & invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | + ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Invalidate D-Cache + \details Invalidates D-Cache + */ +__STATIC_INLINE void SCB_InvalidateDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCISW = (((sets << SCB_DCISW_SET_Pos) & SCB_DCISW_SET_Msk) | + ((ways << SCB_DCISW_WAY_Pos) & SCB_DCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Clean D-Cache + \details Cleans D-Cache + */ +__STATIC_INLINE void SCB_CleanDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCSW = (((sets << SCB_DCCSW_SET_Pos) & SCB_DCCSW_SET_Msk) | + ((ways << SCB_DCCSW_WAY_Pos) & SCB_DCCSW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief Clean & Invalidate D-Cache + \details Cleans and Invalidates D-Cache + */ +__STATIC_INLINE void SCB_CleanInvalidateDCache (void) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + uint32_t ccsidr; + uint32_t sets; + uint32_t ways; + + SCB->CSSELR = 0U; /*(0U << 1U) | 0U;*/ /* Level 1 data cache */ + __DSB(); + + ccsidr = SCB->CCSIDR; + + /* clean & invalidate D-Cache */ + sets = (uint32_t)(CCSIDR_SETS(ccsidr)); + do { + ways = (uint32_t)(CCSIDR_WAYS(ccsidr)); + do { + SCB->DCCISW = (((sets << SCB_DCCISW_SET_Pos) & SCB_DCCISW_SET_Msk) | + ((ways << SCB_DCCISW_WAY_Pos) & SCB_DCCISW_WAY_Msk) ); + #if defined ( __CC_ARM ) + __schedule_barrier(); + #endif + } while (ways-- != 0U); + } while(sets-- != 0U); + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief D-Cache Invalidate by address + \details Invalidates D-Cache for the given address + \param[in] addr address (aligned to 32-byte boundary) + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_INLINE void SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + int32_t op_size = dsize; + uint32_t op_addr = (uint32_t)addr; + int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ + + __DSB(); + + while (op_size > 0) { + SCB->DCIMVAC = op_addr; + op_addr += (uint32_t)linesize; + op_size -= linesize; + } + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief D-Cache Clean by address + \details Cleans D-Cache for the given address + \param[in] addr address (aligned to 32-byte boundary) + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_INLINE void SCB_CleanDCache_by_Addr (uint32_t *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + int32_t op_size = dsize; + uint32_t op_addr = (uint32_t) addr; + int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ + + __DSB(); + + while (op_size > 0) { + SCB->DCCMVAC = op_addr; + op_addr += (uint32_t)linesize; + op_size -= linesize; + } + + __DSB(); + __ISB(); + #endif +} + + +/** + \brief D-Cache Clean and Invalidate by address + \details Cleans and invalidates D_Cache for the given address + \param[in] addr address (aligned to 32-byte boundary) + \param[in] dsize size of memory block (in number of bytes) +*/ +__STATIC_INLINE void SCB_CleanInvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize) +{ + #if defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U) + int32_t op_size = dsize; + uint32_t op_addr = (uint32_t) addr; + int32_t linesize = 32; /* in Cortex-M7 size of cache line is fixed to 8 words (32 bytes) */ + + __DSB(); + + while (op_size > 0) { + SCB->DCCIMVAC = op_addr; + op_addr += (uint32_t)linesize; + op_size -= linesize; + } + + __DSB(); + __ISB(); + #endif +} + + +/*@} end of CMSIS_Core_CacheFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM7_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_sc000.h b/Software/Code/Drivers/CMSIS/Include/core_sc000.h new file mode 100644 index 0000000..9b67c92 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_sc000.h @@ -0,0 +1,1022 @@ +/**************************************************************************//** + * @file core_sc000.h + * @brief CMSIS SC000 Core Peripheral Access Layer Header File + * @version V5.0.5 + * @date 28. May 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_SC000_H_GENERIC +#define __CORE_SC000_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup SC000 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS SC000 definitions */ +#define __SC000_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __SC000_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN << 16U) | \ + __SC000_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_SC (000U) /*!< Cortex secure core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_SC000_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_SC000_H_DEPENDANT +#define __CORE_SC000_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __SC000_REV + #define __SC000_REV 0x0000U + #warning "__SC000_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 2U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group SC000 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ + uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t _reserved0:1; /*!< bit: 0 Reserved */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[31U]; + __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[31U]; + __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[31U]; + __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[31U]; + uint32_t RESERVED4[64U]; + __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ +} NVIC_Type; + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + uint32_t RESERVED0[1U]; + __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + uint32_t RESERVED1[154U]; + __IOM uint32_t SFCR; /*!< Offset: 0x290 (R/W) Security Features Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ +} MPU_Type; + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 8U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0xFFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief SC000 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. + Therefore they are not covered by the SC000 header file. + @{ + */ +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else +/*#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping not available for SC000 */ +/*#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping not available for SC000 */ + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ +/*#define NVIC_GetActive __NVIC_GetActive not available for SC000 */ + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + +/* Interrupt Priorities are WORD accessible only under Armv6-M */ +/* The following MACROS handle generation of the register offset and byte masks */ +#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) +#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) +#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } + else + { + SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | + (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + SCB_AIRCR_SYSRESETREQ_Msk); + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_SC000_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/core_sc300.h b/Software/Code/Drivers/CMSIS/Include/core_sc300.h new file mode 100644 index 0000000..3e8a471 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/core_sc300.h @@ -0,0 +1,1915 @@ +/**************************************************************************//** + * @file core_sc300.h + * @brief CMSIS SC300 Core Peripheral Access Layer Header File + * @version V5.0.6 + * @date 04. June 2018 + ******************************************************************************/ +/* + * Copyright (c) 2009-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_SC300_H_GENERIC +#define __CORE_SC300_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup SC3000 + @{ + */ + +#include "cmsis_version.h" + +/* CMSIS SC300 definitions */ +#define __SC300_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ +#define __SC300_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ +#define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN << 16U) | \ + __SC300_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ + +#define __CORTEX_SC (300U) /*!< Cortex secure core */ + +/** __FPU_USED indicates whether an FPU is used or not. + This core does not support an FPU at all +*/ +#define __FPU_USED 0U + +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_SC300_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_SC300_H_DEPENDANT +#define __CORE_SC300_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __SC300_REV + #define __SC300_REV 0x0000U + #warning "__SC300_REV not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group SC300 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:27; /*!< bit: 0..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t _reserved1:8; /*!< bit: 16..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5U]; + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ + uint32_t RESERVED1[129U]; + __IOM uint32_t SFCR; /*!< Offset: 0x290 (R/W) Security Features Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLBASE_Pos 29U /*!< SCB VTOR: TBLBASE Position */ +#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */ + +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + uint32_t RESERVED1[1U]; +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29U]; + __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */ +#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */ + +#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */ +#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */ +#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */ + +#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */ +#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + +/* The following EXC_RETURN values are saved the LR on exception entry */ +#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ +#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ +#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ + + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHP[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + return 0U; /* No FPU */ +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_SC300_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/Software/Code/Drivers/CMSIS/Include/mpu_armv7.h b/Software/Code/Drivers/CMSIS/Include/mpu_armv7.h new file mode 100644 index 0000000..0142203 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/mpu_armv7.h @@ -0,0 +1,270 @@ +/****************************************************************************** + * @file mpu_armv7.h + * @brief CMSIS MPU API for Armv7-M MPU + * @version V5.0.4 + * @date 10. January 2018 + ******************************************************************************/ +/* + * Copyright (c) 2017-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef ARM_MPU_ARMV7_H +#define ARM_MPU_ARMV7_H + +#define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) ///!< MPU Region Size 32 Bytes +#define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) ///!< MPU Region Size 64 Bytes +#define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) ///!< MPU Region Size 128 Bytes +#define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) ///!< MPU Region Size 256 Bytes +#define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) ///!< MPU Region Size 512 Bytes +#define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) ///!< MPU Region Size 1 KByte +#define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) ///!< MPU Region Size 2 KBytes +#define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) ///!< MPU Region Size 4 KBytes +#define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) ///!< MPU Region Size 8 KBytes +#define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) ///!< MPU Region Size 16 KBytes +#define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) ///!< MPU Region Size 32 KBytes +#define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) ///!< MPU Region Size 64 KBytes +#define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) ///!< MPU Region Size 128 KBytes +#define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) ///!< MPU Region Size 256 KBytes +#define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) ///!< MPU Region Size 512 KBytes +#define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) ///!< MPU Region Size 1 MByte +#define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) ///!< MPU Region Size 2 MBytes +#define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) ///!< MPU Region Size 4 MBytes +#define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) ///!< MPU Region Size 8 MBytes +#define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) ///!< MPU Region Size 16 MBytes +#define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) ///!< MPU Region Size 32 MBytes +#define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) ///!< MPU Region Size 64 MBytes +#define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) ///!< MPU Region Size 128 MBytes +#define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) ///!< MPU Region Size 256 MBytes +#define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) ///!< MPU Region Size 512 MBytes +#define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) ///!< MPU Region Size 1 GByte +#define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) ///!< MPU Region Size 2 GBytes +#define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) ///!< MPU Region Size 4 GBytes + +#define ARM_MPU_AP_NONE 0U ///!< MPU Access Permission no access +#define ARM_MPU_AP_PRIV 1U ///!< MPU Access Permission privileged access only +#define ARM_MPU_AP_URO 2U ///!< MPU Access Permission unprivileged access read-only +#define ARM_MPU_AP_FULL 3U ///!< MPU Access Permission full access +#define ARM_MPU_AP_PRO 5U ///!< MPU Access Permission privileged access read-only +#define ARM_MPU_AP_RO 6U ///!< MPU Access Permission read-only access + +/** MPU Region Base Address Register Value +* +* \param Region The region to be configured, number 0 to 15. +* \param BaseAddress The base address for the region. +*/ +#define ARM_MPU_RBAR(Region, BaseAddress) \ + (((BaseAddress) & MPU_RBAR_ADDR_Msk) | \ + ((Region) & MPU_RBAR_REGION_Msk) | \ + (MPU_RBAR_VALID_Msk)) + +/** +* MPU Memory Access Attributes +* +* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. +* \param IsShareable Region is shareable between multiple bus masters. +* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. +* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. +*/ +#define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable) \ + ((((TypeExtField ) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \ + (((IsShareable ) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \ + (((IsCacheable ) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \ + (((IsBufferable ) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk)) + +/** +* MPU Region Attribute and Size Register Value +* +* \param DisableExec Instruction access disable bit, 1= disable instruction fetches. +* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. +* \param AccessAttributes Memory access attribution, see \ref ARM_MPU_ACCESS_. +* \param SubRegionDisable Sub-region disable field. +* \param Size Region size of the region to be configured, for example 4K, 8K. +*/ +#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \ + ((((DisableExec ) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \ + (((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \ + (((AccessAttributes) ) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk))) + +/** +* MPU Region Attribute and Size Register Value +* +* \param DisableExec Instruction access disable bit, 1= disable instruction fetches. +* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode. +* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral. +* \param IsShareable Region is shareable between multiple bus masters. +* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache. +* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy. +* \param SubRegionDisable Sub-region disable field. +* \param Size Region size of the region to be configured, for example 4K, 8K. +*/ +#define ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, SubRegionDisable, Size) \ + ARM_MPU_RASR_EX(DisableExec, AccessPermission, ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable), SubRegionDisable, Size) + +/** +* MPU Memory Access Attribute for strongly ordered memory. +* - TEX: 000b +* - Shareable +* - Non-cacheable +* - Non-bufferable +*/ +#define ARM_MPU_ACCESS_ORDERED ARM_MPU_ACCESS_(0U, 1U, 0U, 0U) + +/** +* MPU Memory Access Attribute for device memory. +* - TEX: 000b (if non-shareable) or 010b (if shareable) +* - Shareable or non-shareable +* - Non-cacheable +* - Bufferable (if shareable) or non-bufferable (if non-shareable) +* +* \param IsShareable Configures the device memory as shareable or non-shareable. +*/ +#define ARM_MPU_ACCESS_DEVICE(IsShareable) ((IsShareable) ? ARM_MPU_ACCESS_(0U, 1U, 0U, 1U) : ARM_MPU_ACCESS_(2U, 0U, 0U, 0U)) + +/** +* MPU Memory Access Attribute for normal memory. +* - TEX: 1BBb (reflecting outer cacheability rules) +* - Shareable or non-shareable +* - Cacheable or non-cacheable (reflecting inner cacheability rules) +* - Bufferable or non-bufferable (reflecting inner cacheability rules) +* +* \param OuterCp Configures the outer cache policy. +* \param InnerCp Configures the inner cache policy. +* \param IsShareable Configures the memory as shareable or non-shareable. +*/ +#define ARM_MPU_ACCESS_NORMAL(OuterCp, InnerCp, IsShareable) ARM_MPU_ACCESS_((4U | (OuterCp)), IsShareable, ((InnerCp) & 2U), ((InnerCp) & 1U)) + +/** +* MPU Memory Access Attribute non-cacheable policy. +*/ +#define ARM_MPU_CACHEP_NOCACHE 0U + +/** +* MPU Memory Access Attribute write-back, write and read allocate policy. +*/ +#define ARM_MPU_CACHEP_WB_WRA 1U + +/** +* MPU Memory Access Attribute write-through, no write allocate policy. +*/ +#define ARM_MPU_CACHEP_WT_NWA 2U + +/** +* MPU Memory Access Attribute write-back, no write allocate policy. +*/ +#define ARM_MPU_CACHEP_WB_NWA 3U + + +/** +* Struct for a single MPU Region +*/ +typedef struct { + uint32_t RBAR; //!< The region base address register value (RBAR) + uint32_t RASR; //!< The region attribute and size register value (RASR) \ref MPU_RASR +} ARM_MPU_Region_t; + +/** Enable the MPU. +* \param MPU_Control Default access permissions for unconfigured regions. +*/ +__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) +{ + __DSB(); + __ISB(); + MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; +#endif +} + +/** Disable the MPU. +*/ +__STATIC_INLINE void ARM_MPU_Disable(void) +{ + __DSB(); + __ISB(); +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; +#endif + MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; +} + +/** Clear and disable the given MPU region. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) +{ + MPU->RNR = rnr; + MPU->RASR = 0U; +} + +/** Configure an MPU region. +* \param rbar Value for RBAR register. +* \param rsar Value for RSAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rbar, uint32_t rasr) +{ + MPU->RBAR = rbar; + MPU->RASR = rasr; +} + +/** Configure the given MPU region. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rsar Value for RSAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegionEx(uint32_t rnr, uint32_t rbar, uint32_t rasr) +{ + MPU->RNR = rnr; + MPU->RBAR = rbar; + MPU->RASR = rasr; +} + +/** Memcopy with strictly ordered memory access, e.g. for register targets. +* \param dst Destination data is copied to. +* \param src Source data is copied from. +* \param len Amount of data words to be copied. +*/ +__STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) +{ + uint32_t i; + for (i = 0U; i < len; ++i) + { + dst[i] = src[i]; + } +} + +/** Load the given number of MPU regions from a table. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_Load(ARM_MPU_Region_t const* table, uint32_t cnt) +{ + const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; + while (cnt > MPU_TYPE_RALIASES) { + orderedCpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize); + table += MPU_TYPE_RALIASES; + cnt -= MPU_TYPE_RALIASES; + } + orderedCpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize); +} + +#endif diff --git a/Software/Code/Drivers/CMSIS/Include/mpu_armv8.h b/Software/Code/Drivers/CMSIS/Include/mpu_armv8.h new file mode 100644 index 0000000..62571da --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/mpu_armv8.h @@ -0,0 +1,333 @@ +/****************************************************************************** + * @file mpu_armv8.h + * @brief CMSIS MPU API for Armv8-M MPU + * @version V5.0.4 + * @date 10. January 2018 + ******************************************************************************/ +/* + * Copyright (c) 2017-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef ARM_MPU_ARMV8_H +#define ARM_MPU_ARMV8_H + +/** \brief Attribute for device memory (outer only) */ +#define ARM_MPU_ATTR_DEVICE ( 0U ) + +/** \brief Attribute for non-cacheable, normal memory */ +#define ARM_MPU_ATTR_NON_CACHEABLE ( 4U ) + +/** \brief Attribute for normal memory (outer and inner) +* \param NT Non-Transient: Set to 1 for non-transient data. +* \param WB Write-Back: Set to 1 to use write-back update policy. +* \param RA Read Allocation: Set to 1 to use cache allocation on read miss. +* \param WA Write Allocation: Set to 1 to use cache allocation on write miss. +*/ +#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \ + (((NT & 1U) << 3U) | ((WB & 1U) << 2U) | ((RA & 1U) << 1U) | (WA & 1U)) + +/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */ +#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U) + +/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */ +#define ARM_MPU_ATTR_DEVICE_nGnRE (1U) + +/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */ +#define ARM_MPU_ATTR_DEVICE_nGRE (2U) + +/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */ +#define ARM_MPU_ATTR_DEVICE_GRE (3U) + +/** \brief Memory Attribute +* \param O Outer memory attributes +* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes +*/ +#define ARM_MPU_ATTR(O, I) (((O & 0xFU) << 4U) | (((O & 0xFU) != 0U) ? (I & 0xFU) : ((I & 0x3U) << 2U))) + +/** \brief Normal memory non-shareable */ +#define ARM_MPU_SH_NON (0U) + +/** \brief Normal memory outer shareable */ +#define ARM_MPU_SH_OUTER (2U) + +/** \brief Normal memory inner shareable */ +#define ARM_MPU_SH_INNER (3U) + +/** \brief Memory access permissions +* \param RO Read-Only: Set to 1 for read-only memory. +* \param NP Non-Privileged: Set to 1 for non-privileged memory. +*/ +#define ARM_MPU_AP_(RO, NP) (((RO & 1U) << 1U) | (NP & 1U)) + +/** \brief Region Base Address Register value +* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned. +* \param SH Defines the Shareability domain for this memory region. +* \param RO Read-Only: Set to 1 for a read-only memory region. +* \param NP Non-Privileged: Set to 1 for a non-privileged memory region. +* \oaram XN eXecute Never: Set to 1 for a non-executable memory region. +*/ +#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \ + ((BASE & MPU_RBAR_BASE_Msk) | \ + ((SH << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \ + ((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \ + ((XN << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk)) + +/** \brief Region Limit Address Register value +* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended. +* \param IDX The attribute index to be associated with this memory region. +*/ +#define ARM_MPU_RLAR(LIMIT, IDX) \ + ((LIMIT & MPU_RLAR_LIMIT_Msk) | \ + ((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \ + (MPU_RLAR_EN_Msk)) + +/** +* Struct for a single MPU Region +*/ +typedef struct { + uint32_t RBAR; /*!< Region Base Address Register value */ + uint32_t RLAR; /*!< Region Limit Address Register value */ +} ARM_MPU_Region_t; + +/** Enable the MPU. +* \param MPU_Control Default access permissions for unconfigured regions. +*/ +__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control) +{ + __DSB(); + __ISB(); + MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; +#endif +} + +/** Disable the MPU. +*/ +__STATIC_INLINE void ARM_MPU_Disable(void) +{ + __DSB(); + __ISB(); +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; +#endif + MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk; +} + +#ifdef MPU_NS +/** Enable the Non-secure MPU. +* \param MPU_Control Default access permissions for unconfigured regions. +*/ +__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control) +{ + __DSB(); + __ISB(); + MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; +#endif +} + +/** Disable the Non-secure MPU. +*/ +__STATIC_INLINE void ARM_MPU_Disable_NS(void) +{ + __DSB(); + __ISB(); +#ifdef SCB_SHCSR_MEMFAULTENA_Msk + SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; +#endif + MPU_NS->CTRL &= ~MPU_CTRL_ENABLE_Msk; +} +#endif + +/** Set the memory attribute encoding to the given MPU. +* \param mpu Pointer to the MPU to be configured. +* \param idx The attribute index to be set [0-7] +* \param attr The attribute value to be set. +*/ +__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr) +{ + const uint8_t reg = idx / 4U; + const uint32_t pos = ((idx % 4U) * 8U); + const uint32_t mask = 0xFFU << pos; + + if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) { + return; // invalid index + } + + mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask)); +} + +/** Set the memory attribute encoding. +* \param idx The attribute index to be set [0-7] +* \param attr The attribute value to be set. +*/ +__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr) +{ + ARM_MPU_SetMemAttrEx(MPU, idx, attr); +} + +#ifdef MPU_NS +/** Set the memory attribute encoding to the Non-secure MPU. +* \param idx The attribute index to be set [0-7] +* \param attr The attribute value to be set. +*/ +__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr) +{ + ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr); +} +#endif + +/** Clear and disable the given MPU region of the given MPU. +* \param mpu Pointer to MPU to be used. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr) +{ + mpu->RNR = rnr; + mpu->RLAR = 0U; +} + +/** Clear and disable the given MPU region. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr) +{ + ARM_MPU_ClrRegionEx(MPU, rnr); +} + +#ifdef MPU_NS +/** Clear and disable the given Non-secure MPU region. +* \param rnr Region number to be cleared. +*/ +__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr) +{ + ARM_MPU_ClrRegionEx(MPU_NS, rnr); +} +#endif + +/** Configure the given MPU region of the given MPU. +* \param mpu Pointer to MPU to be used. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rlar Value for RLAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar) +{ + mpu->RNR = rnr; + mpu->RBAR = rbar; + mpu->RLAR = rlar; +} + +/** Configure the given MPU region. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rlar Value for RLAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar) +{ + ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar); +} + +#ifdef MPU_NS +/** Configure the given Non-secure MPU region. +* \param rnr Region number to be configured. +* \param rbar Value for RBAR register. +* \param rlar Value for RLAR register. +*/ +__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar) +{ + ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar); +} +#endif + +/** Memcopy with strictly ordered memory access, e.g. for register targets. +* \param dst Destination data is copied to. +* \param src Source data is copied from. +* \param len Amount of data words to be copied. +*/ +__STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len) +{ + uint32_t i; + for (i = 0U; i < len; ++i) + { + dst[i] = src[i]; + } +} + +/** Load the given number of MPU regions from a table to the given MPU. +* \param mpu Pointer to the MPU registers to be used. +* \param rnr First region number to be configured. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) +{ + const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U; + if (cnt == 1U) { + mpu->RNR = rnr; + orderedCpy(&(mpu->RBAR), &(table->RBAR), rowWordSize); + } else { + uint32_t rnrBase = rnr & ~(MPU_TYPE_RALIASES-1U); + uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES; + + mpu->RNR = rnrBase; + while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) { + uint32_t c = MPU_TYPE_RALIASES - rnrOffset; + orderedCpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize); + table += c; + cnt -= c; + rnrOffset = 0U; + rnrBase += MPU_TYPE_RALIASES; + mpu->RNR = rnrBase; + } + + orderedCpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize); + } +} + +/** Load the given number of MPU regions from a table. +* \param rnr First region number to be configured. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) +{ + ARM_MPU_LoadEx(MPU, rnr, table, cnt); +} + +#ifdef MPU_NS +/** Load the given number of MPU regions from a table to the Non-secure MPU. +* \param rnr First region number to be configured. +* \param table Pointer to the MPU configuration table. +* \param cnt Amount of regions to be configured. +*/ +__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt) +{ + ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt); +} +#endif + +#endif + diff --git a/Software/Code/Drivers/CMSIS/Include/tz_context.h b/Software/Code/Drivers/CMSIS/Include/tz_context.h new file mode 100644 index 0000000..0d09749 --- /dev/null +++ b/Software/Code/Drivers/CMSIS/Include/tz_context.h @@ -0,0 +1,70 @@ +/****************************************************************************** + * @file tz_context.h + * @brief Context Management for Armv8-M TrustZone + * @version V1.0.1 + * @date 10. January 2018 + ******************************************************************************/ +/* + * Copyright (c) 2017-2018 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__clang__) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef TZ_CONTEXT_H +#define TZ_CONTEXT_H + +#include + +#ifndef TZ_MODULEID_T +#define TZ_MODULEID_T +/// \details Data type that identifies secure software modules called by a process. +typedef uint32_t TZ_ModuleId_t; +#endif + +/// \details TZ Memory ID identifies an allocated memory slot. +typedef uint32_t TZ_MemoryId_t; + +/// Initialize secure context memory system +/// \return execution status (1: success, 0: error) +uint32_t TZ_InitContextSystem_S (void); + +/// Allocate context memory for calling secure software modules in TrustZone +/// \param[in] module identifies software modules called from non-secure mode +/// \return value != 0 id TrustZone memory slot identifier +/// \return value 0 no memory available or internal error +TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); + +/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S +/// \param[in] id TrustZone memory slot identifier +/// \return execution status (1: success, 0: error) +uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); + +/// Load secure context (called on RTOS thread context switch) +/// \param[in] id TrustZone memory slot identifier +/// \return execution status (1: success, 0: error) +uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); + +/// Store secure context (called on RTOS thread context switch) +/// \param[in] id TrustZone memory slot identifier +/// \return execution status (1: success, 0: error) +uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); + +#endif // TZ_CONTEXT_H diff --git a/Software/Code/Drivers/CMSIS/LICENSE.txt b/Software/Code/Drivers/CMSIS/LICENSE.txt new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/Software/Code/Drivers/CMSIS/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h new file mode 100644 index 0000000..f321b33 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h @@ -0,0 +1,4329 @@ +/** + ****************************************************************************** + * @file stm32_hal_legacy.h + * @author MCD Application Team + * @brief This file contains aliases definition for the STM32Cube HAL constants + * macros and functions maintained for legacy purpose. + ****************************************************************************** + * @attention + * + * Copyright (c) 2023 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32_HAL_LEGACY +#define STM32_HAL_LEGACY + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/** @defgroup HAL_AES_Aliased_Defines HAL CRYP Aliased Defines maintained for legacy purpose + * @{ + */ +#define AES_FLAG_RDERR CRYP_FLAG_RDERR +#define AES_FLAG_WRERR CRYP_FLAG_WRERR +#define AES_CLEARFLAG_CCF CRYP_CLEARFLAG_CCF +#define AES_CLEARFLAG_RDERR CRYP_CLEARFLAG_RDERR +#define AES_CLEARFLAG_WRERR CRYP_CLEARFLAG_WRERR +#if defined(STM32U5) || defined(STM32H7) || defined(STM32MP1) +#define CRYP_DATATYPE_32B CRYP_NO_SWAP +#define CRYP_DATATYPE_16B CRYP_HALFWORD_SWAP +#define CRYP_DATATYPE_8B CRYP_BYTE_SWAP +#define CRYP_DATATYPE_1B CRYP_BIT_SWAP +#if defined(STM32U5) +#define CRYP_CCF_CLEAR CRYP_CLEAR_CCF +#define CRYP_ERR_CLEAR CRYP_CLEAR_RWEIF +#endif /* STM32U5 */ +#endif /* STM32U5 || STM32H7 || STM32MP1 */ +/** + * @} + */ + +/** @defgroup HAL_ADC_Aliased_Defines HAL ADC Aliased Defines maintained for legacy purpose + * @{ + */ +#define ADC_RESOLUTION12b ADC_RESOLUTION_12B +#define ADC_RESOLUTION10b ADC_RESOLUTION_10B +#define ADC_RESOLUTION8b ADC_RESOLUTION_8B +#define ADC_RESOLUTION6b ADC_RESOLUTION_6B +#define OVR_DATA_OVERWRITTEN ADC_OVR_DATA_OVERWRITTEN +#define OVR_DATA_PRESERVED ADC_OVR_DATA_PRESERVED +#define EOC_SINGLE_CONV ADC_EOC_SINGLE_CONV +#define EOC_SEQ_CONV ADC_EOC_SEQ_CONV +#define EOC_SINGLE_SEQ_CONV ADC_EOC_SINGLE_SEQ_CONV +#define REGULAR_GROUP ADC_REGULAR_GROUP +#define INJECTED_GROUP ADC_INJECTED_GROUP +#define REGULAR_INJECTED_GROUP ADC_REGULAR_INJECTED_GROUP +#define AWD_EVENT ADC_AWD_EVENT +#define AWD1_EVENT ADC_AWD1_EVENT +#define AWD2_EVENT ADC_AWD2_EVENT +#define AWD3_EVENT ADC_AWD3_EVENT +#define OVR_EVENT ADC_OVR_EVENT +#define JQOVF_EVENT ADC_JQOVF_EVENT +#define ALL_CHANNELS ADC_ALL_CHANNELS +#define REGULAR_CHANNELS ADC_REGULAR_CHANNELS +#define INJECTED_CHANNELS ADC_INJECTED_CHANNELS +#define SYSCFG_FLAG_SENSOR_ADC ADC_FLAG_SENSOR +#define SYSCFG_FLAG_VREF_ADC ADC_FLAG_VREFINT +#define ADC_CLOCKPRESCALER_PCLK_DIV1 ADC_CLOCK_SYNC_PCLK_DIV1 +#define ADC_CLOCKPRESCALER_PCLK_DIV2 ADC_CLOCK_SYNC_PCLK_DIV2 +#define ADC_CLOCKPRESCALER_PCLK_DIV4 ADC_CLOCK_SYNC_PCLK_DIV4 +#define ADC_CLOCKPRESCALER_PCLK_DIV6 ADC_CLOCK_SYNC_PCLK_DIV6 +#define ADC_CLOCKPRESCALER_PCLK_DIV8 ADC_CLOCK_SYNC_PCLK_DIV8 +#define ADC_EXTERNALTRIG0_T6_TRGO ADC_EXTERNALTRIGCONV_T6_TRGO +#define ADC_EXTERNALTRIG1_T21_CC2 ADC_EXTERNALTRIGCONV_T21_CC2 +#define ADC_EXTERNALTRIG2_T2_TRGO ADC_EXTERNALTRIGCONV_T2_TRGO +#define ADC_EXTERNALTRIG3_T2_CC4 ADC_EXTERNALTRIGCONV_T2_CC4 +#define ADC_EXTERNALTRIG4_T22_TRGO ADC_EXTERNALTRIGCONV_T22_TRGO +#define ADC_EXTERNALTRIG7_EXT_IT11 ADC_EXTERNALTRIGCONV_EXT_IT11 +#define ADC_CLOCK_ASYNC ADC_CLOCK_ASYNC_DIV1 +#define ADC_EXTERNALTRIG_EDGE_NONE ADC_EXTERNALTRIGCONVEDGE_NONE +#define ADC_EXTERNALTRIG_EDGE_RISING ADC_EXTERNALTRIGCONVEDGE_RISING +#define ADC_EXTERNALTRIG_EDGE_FALLING ADC_EXTERNALTRIGCONVEDGE_FALLING +#define ADC_EXTERNALTRIG_EDGE_RISINGFALLING ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING +#define ADC_SAMPLETIME_2CYCLE_5 ADC_SAMPLETIME_2CYCLES_5 + +#define HAL_ADC_STATE_BUSY_REG HAL_ADC_STATE_REG_BUSY +#define HAL_ADC_STATE_BUSY_INJ HAL_ADC_STATE_INJ_BUSY +#define HAL_ADC_STATE_EOC_REG HAL_ADC_STATE_REG_EOC +#define HAL_ADC_STATE_EOC_INJ HAL_ADC_STATE_INJ_EOC +#define HAL_ADC_STATE_ERROR HAL_ADC_STATE_ERROR_INTERNAL +#define HAL_ADC_STATE_BUSY HAL_ADC_STATE_BUSY_INTERNAL +#define HAL_ADC_STATE_AWD HAL_ADC_STATE_AWD1 + +#if defined(STM32H7) +#define ADC_CHANNEL_VBAT_DIV4 ADC_CHANNEL_VBAT +#endif /* STM32H7 */ + +#if defined(STM32U5) +#define ADC_SAMPLETIME_5CYCLE ADC_SAMPLETIME_5CYCLES +#define ADC_SAMPLETIME_391CYCLES_5 ADC_SAMPLETIME_391CYCLES +#define ADC4_SAMPLETIME_160CYCLES_5 ADC4_SAMPLETIME_814CYCLES_5 +#endif /* STM32U5 */ + +#if defined(STM32H5) +#define ADC_CHANNEL_VCORE ADC_CHANNEL_VDDCORE +#endif /* STM32H5 */ +/** + * @} + */ + +/** @defgroup HAL_CEC_Aliased_Defines HAL CEC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define __HAL_CEC_GET_IT __HAL_CEC_GET_FLAG + +/** + * @} + */ + +/** @defgroup HAL_COMP_Aliased_Defines HAL COMP Aliased Defines maintained for legacy purpose + * @{ + */ +#define COMP_WINDOWMODE_DISABLED COMP_WINDOWMODE_DISABLE +#define COMP_WINDOWMODE_ENABLED COMP_WINDOWMODE_ENABLE +#define COMP_EXTI_LINE_COMP1_EVENT COMP_EXTI_LINE_COMP1 +#define COMP_EXTI_LINE_COMP2_EVENT COMP_EXTI_LINE_COMP2 +#define COMP_EXTI_LINE_COMP3_EVENT COMP_EXTI_LINE_COMP3 +#define COMP_EXTI_LINE_COMP4_EVENT COMP_EXTI_LINE_COMP4 +#define COMP_EXTI_LINE_COMP5_EVENT COMP_EXTI_LINE_COMP5 +#define COMP_EXTI_LINE_COMP6_EVENT COMP_EXTI_LINE_COMP6 +#define COMP_EXTI_LINE_COMP7_EVENT COMP_EXTI_LINE_COMP7 +#if defined(STM32L0) +#define COMP_LPTIMCONNECTION_ENABLED ((uint32_t)0x00000003U) /*!< COMPX output generic naming: connected to LPTIM + input 1 for COMP1, LPTIM input 2 for COMP2 */ +#endif +#define COMP_OUTPUT_COMP6TIM2OCREFCLR COMP_OUTPUT_COMP6_TIM2OCREFCLR +#if defined(STM32F373xC) || defined(STM32F378xx) +#define COMP_OUTPUT_TIM3IC1 COMP_OUTPUT_COMP1_TIM3IC1 +#define COMP_OUTPUT_TIM3OCREFCLR COMP_OUTPUT_COMP1_TIM3OCREFCLR +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32L0) || defined(STM32L4) +#define COMP_WINDOWMODE_ENABLE COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON + +#define COMP_NONINVERTINGINPUT_IO1 COMP_INPUT_PLUS_IO1 +#define COMP_NONINVERTINGINPUT_IO2 COMP_INPUT_PLUS_IO2 +#define COMP_NONINVERTINGINPUT_IO3 COMP_INPUT_PLUS_IO3 +#define COMP_NONINVERTINGINPUT_IO4 COMP_INPUT_PLUS_IO4 +#define COMP_NONINVERTINGINPUT_IO5 COMP_INPUT_PLUS_IO5 +#define COMP_NONINVERTINGINPUT_IO6 COMP_INPUT_PLUS_IO6 + +#define COMP_INVERTINGINPUT_1_4VREFINT COMP_INPUT_MINUS_1_4VREFINT +#define COMP_INVERTINGINPUT_1_2VREFINT COMP_INPUT_MINUS_1_2VREFINT +#define COMP_INVERTINGINPUT_3_4VREFINT COMP_INPUT_MINUS_3_4VREFINT +#define COMP_INVERTINGINPUT_VREFINT COMP_INPUT_MINUS_VREFINT +#define COMP_INVERTINGINPUT_DAC1_CH1 COMP_INPUT_MINUS_DAC1_CH1 +#define COMP_INVERTINGINPUT_DAC1_CH2 COMP_INPUT_MINUS_DAC1_CH2 +#define COMP_INVERTINGINPUT_DAC1 COMP_INPUT_MINUS_DAC1_CH1 +#define COMP_INVERTINGINPUT_DAC2 COMP_INPUT_MINUS_DAC1_CH2 +#define COMP_INVERTINGINPUT_IO1 COMP_INPUT_MINUS_IO1 +#if defined(STM32L0) +/* Issue fixed on STM32L0 COMP driver: only 2 dedicated IO (IO1 and IO2), */ +/* IO2 was wrongly assigned to IO shared with DAC and IO3 was corresponding */ +/* to the second dedicated IO (only for COMP2). */ +#define COMP_INVERTINGINPUT_IO2 COMP_INPUT_MINUS_DAC1_CH2 +#define COMP_INVERTINGINPUT_IO3 COMP_INPUT_MINUS_IO2 +#else +#define COMP_INVERTINGINPUT_IO2 COMP_INPUT_MINUS_IO2 +#define COMP_INVERTINGINPUT_IO3 COMP_INPUT_MINUS_IO3 +#endif +#define COMP_INVERTINGINPUT_IO4 COMP_INPUT_MINUS_IO4 +#define COMP_INVERTINGINPUT_IO5 COMP_INPUT_MINUS_IO5 + +#define COMP_OUTPUTLEVEL_LOW COMP_OUTPUT_LEVEL_LOW +#define COMP_OUTPUTLEVEL_HIGH COMP_OUTPUT_LEVEL_HIGH + +/* Note: Literal "COMP_FLAG_LOCK" kept for legacy purpose. */ +/* To check COMP lock state, use macro "__HAL_COMP_IS_LOCKED()". */ +#if defined(COMP_CSR_LOCK) +#define COMP_FLAG_LOCK COMP_CSR_LOCK +#elif defined(COMP_CSR_COMP1LOCK) +#define COMP_FLAG_LOCK COMP_CSR_COMP1LOCK +#elif defined(COMP_CSR_COMPxLOCK) +#define COMP_FLAG_LOCK COMP_CSR_COMPxLOCK +#endif + +#if defined(STM32L4) +#define COMP_BLANKINGSRCE_TIM1OC5 COMP_BLANKINGSRC_TIM1_OC5_COMP1 +#define COMP_BLANKINGSRCE_TIM2OC3 COMP_BLANKINGSRC_TIM2_OC3_COMP1 +#define COMP_BLANKINGSRCE_TIM3OC3 COMP_BLANKINGSRC_TIM3_OC3_COMP1 +#define COMP_BLANKINGSRCE_TIM3OC4 COMP_BLANKINGSRC_TIM3_OC4_COMP2 +#define COMP_BLANKINGSRCE_TIM8OC5 COMP_BLANKINGSRC_TIM8_OC5_COMP2 +#define COMP_BLANKINGSRCE_TIM15OC1 COMP_BLANKINGSRC_TIM15_OC1_COMP2 +#define COMP_BLANKINGSRCE_NONE COMP_BLANKINGSRC_NONE +#endif + +#if defined(STM32L0) +#define COMP_MODE_HIGHSPEED COMP_POWERMODE_MEDIUMSPEED +#define COMP_MODE_LOWSPEED COMP_POWERMODE_ULTRALOWPOWER +#else +#define COMP_MODE_HIGHSPEED COMP_POWERMODE_HIGHSPEED +#define COMP_MODE_MEDIUMSPEED COMP_POWERMODE_MEDIUMSPEED +#define COMP_MODE_LOWPOWER COMP_POWERMODE_LOWPOWER +#define COMP_MODE_ULTRALOWPOWER COMP_POWERMODE_ULTRALOWPOWER +#endif + +#endif + +#if defined(STM32U5) +#define __HAL_COMP_COMP1_EXTI_CLEAR_RASING_FLAG __HAL_COMP_COMP1_EXTI_CLEAR_RISING_FLAG +#endif + +/** + * @} + */ + +/** @defgroup HAL_CORTEX_Aliased_Defines HAL CORTEX Aliased Defines maintained for legacy purpose + * @{ + */ +#define __HAL_CORTEX_SYSTICKCLK_CONFIG HAL_SYSTICK_CLKSourceConfig +#if defined(STM32U5) +#define MPU_DEVICE_nGnRnE MPU_DEVICE_NGNRNE +#define MPU_DEVICE_nGnRE MPU_DEVICE_NGNRE +#define MPU_DEVICE_nGRE MPU_DEVICE_NGRE +#endif /* STM32U5 */ +/** + * @} + */ + +/** @defgroup CRC_Aliases CRC API aliases + * @{ + */ +#if defined(STM32H5) || defined(STM32C0) +#else +#define HAL_CRC_Input_Data_Reverse HAL_CRCEx_Input_Data_Reverse /*!< Aliased to HAL_CRCEx_Input_Data_Reverse for + inter STM32 series compatibility */ +#define HAL_CRC_Output_Data_Reverse HAL_CRCEx_Output_Data_Reverse /*!< Aliased to HAL_CRCEx_Output_Data_Reverse for + inter STM32 series compatibility */ +#endif +/** + * @} + */ + +/** @defgroup HAL_CRC_Aliased_Defines HAL CRC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define CRC_OUTPUTDATA_INVERSION_DISABLED CRC_OUTPUTDATA_INVERSION_DISABLE +#define CRC_OUTPUTDATA_INVERSION_ENABLED CRC_OUTPUTDATA_INVERSION_ENABLE + +/** + * @} + */ + +/** @defgroup HAL_DAC_Aliased_Defines HAL DAC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define DAC1_CHANNEL_1 DAC_CHANNEL_1 +#define DAC1_CHANNEL_2 DAC_CHANNEL_2 +#define DAC2_CHANNEL_1 DAC_CHANNEL_1 +#define DAC_WAVE_NONE 0x00000000U +#define DAC_WAVE_NOISE DAC_CR_WAVE1_0 +#define DAC_WAVE_TRIANGLE DAC_CR_WAVE1_1 +#define DAC_WAVEGENERATION_NONE DAC_WAVE_NONE +#define DAC_WAVEGENERATION_NOISE DAC_WAVE_NOISE +#define DAC_WAVEGENERATION_TRIANGLE DAC_WAVE_TRIANGLE + +#if defined(STM32G4) || defined(STM32L5) || defined(STM32H7) || defined (STM32U5) +#define DAC_CHIPCONNECT_DISABLE DAC_CHIPCONNECT_EXTERNAL +#define DAC_CHIPCONNECT_ENABLE DAC_CHIPCONNECT_INTERNAL +#endif + +#if defined(STM32U5) +#define DAC_TRIGGER_STOP_LPTIM1_OUT DAC_TRIGGER_STOP_LPTIM1_CH1 +#define DAC_TRIGGER_STOP_LPTIM3_OUT DAC_TRIGGER_STOP_LPTIM3_CH1 +#define DAC_TRIGGER_LPTIM1_OUT DAC_TRIGGER_LPTIM1_CH1 +#define DAC_TRIGGER_LPTIM3_OUT DAC_TRIGGER_LPTIM3_CH1 +#endif + +#if defined(STM32H5) +#define DAC_TRIGGER_LPTIM1_OUT DAC_TRIGGER_LPTIM1_CH1 +#define DAC_TRIGGER_LPTIM2_OUT DAC_TRIGGER_LPTIM2_CH1 +#endif + +#if defined(STM32L1) || defined(STM32L4) || defined(STM32G0) || defined(STM32L5) || defined(STM32H7) || \ + defined(STM32F4) || defined(STM32G4) +#define HAL_DAC_MSP_INIT_CB_ID HAL_DAC_MSPINIT_CB_ID +#define HAL_DAC_MSP_DEINIT_CB_ID HAL_DAC_MSPDEINIT_CB_ID +#endif + +/** + * @} + */ + +/** @defgroup HAL_DMA_Aliased_Defines HAL DMA Aliased Defines maintained for legacy purpose + * @{ + */ +#define HAL_REMAPDMA_ADC_DMA_CH2 DMA_REMAP_ADC_DMA_CH2 +#define HAL_REMAPDMA_USART1_TX_DMA_CH4 DMA_REMAP_USART1_TX_DMA_CH4 +#define HAL_REMAPDMA_USART1_RX_DMA_CH5 DMA_REMAP_USART1_RX_DMA_CH5 +#define HAL_REMAPDMA_TIM16_DMA_CH4 DMA_REMAP_TIM16_DMA_CH4 +#define HAL_REMAPDMA_TIM17_DMA_CH2 DMA_REMAP_TIM17_DMA_CH2 +#define HAL_REMAPDMA_USART3_DMA_CH32 DMA_REMAP_USART3_DMA_CH32 +#define HAL_REMAPDMA_TIM16_DMA_CH6 DMA_REMAP_TIM16_DMA_CH6 +#define HAL_REMAPDMA_TIM17_DMA_CH7 DMA_REMAP_TIM17_DMA_CH7 +#define HAL_REMAPDMA_SPI2_DMA_CH67 DMA_REMAP_SPI2_DMA_CH67 +#define HAL_REMAPDMA_USART2_DMA_CH67 DMA_REMAP_USART2_DMA_CH67 +#define HAL_REMAPDMA_I2C1_DMA_CH76 DMA_REMAP_I2C1_DMA_CH76 +#define HAL_REMAPDMA_TIM1_DMA_CH6 DMA_REMAP_TIM1_DMA_CH6 +#define HAL_REMAPDMA_TIM2_DMA_CH7 DMA_REMAP_TIM2_DMA_CH7 +#define HAL_REMAPDMA_TIM3_DMA_CH6 DMA_REMAP_TIM3_DMA_CH6 + +#define IS_HAL_REMAPDMA IS_DMA_REMAP +#define __HAL_REMAPDMA_CHANNEL_ENABLE __HAL_DMA_REMAP_CHANNEL_ENABLE +#define __HAL_REMAPDMA_CHANNEL_DISABLE __HAL_DMA_REMAP_CHANNEL_DISABLE + +#if defined(STM32L4) + +#define HAL_DMAMUX1_REQUEST_GEN_EXTI0 HAL_DMAMUX1_REQ_GEN_EXTI0 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI1 HAL_DMAMUX1_REQ_GEN_EXTI1 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI2 HAL_DMAMUX1_REQ_GEN_EXTI2 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI3 HAL_DMAMUX1_REQ_GEN_EXTI3 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI4 HAL_DMAMUX1_REQ_GEN_EXTI4 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI5 HAL_DMAMUX1_REQ_GEN_EXTI5 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI6 HAL_DMAMUX1_REQ_GEN_EXTI6 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI7 HAL_DMAMUX1_REQ_GEN_EXTI7 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI8 HAL_DMAMUX1_REQ_GEN_EXTI8 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI9 HAL_DMAMUX1_REQ_GEN_EXTI9 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI10 HAL_DMAMUX1_REQ_GEN_EXTI10 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI11 HAL_DMAMUX1_REQ_GEN_EXTI11 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI12 HAL_DMAMUX1_REQ_GEN_EXTI12 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI13 HAL_DMAMUX1_REQ_GEN_EXTI13 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI14 HAL_DMAMUX1_REQ_GEN_EXTI14 +#define HAL_DMAMUX1_REQUEST_GEN_EXTI15 HAL_DMAMUX1_REQ_GEN_EXTI15 +#define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH0_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH0_EVT +#define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH1_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH1_EVT +#define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH2_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH2_EVT +#define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH3_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH3_EVT +#define HAL_DMAMUX1_REQUEST_GEN_LPTIM1_OUT HAL_DMAMUX1_REQ_GEN_LPTIM1_OUT +#define HAL_DMAMUX1_REQUEST_GEN_LPTIM2_OUT HAL_DMAMUX1_REQ_GEN_LPTIM2_OUT +#define HAL_DMAMUX1_REQUEST_GEN_DSI_TE HAL_DMAMUX1_REQ_GEN_DSI_TE +#define HAL_DMAMUX1_REQUEST_GEN_DSI_EOT HAL_DMAMUX1_REQ_GEN_DSI_EOT +#define HAL_DMAMUX1_REQUEST_GEN_DMA2D_EOT HAL_DMAMUX1_REQ_GEN_DMA2D_EOT +#define HAL_DMAMUX1_REQUEST_GEN_LTDC_IT HAL_DMAMUX1_REQ_GEN_LTDC_IT + +#define HAL_DMAMUX_REQUEST_GEN_NO_EVENT HAL_DMAMUX_REQ_GEN_NO_EVENT +#define HAL_DMAMUX_REQUEST_GEN_RISING HAL_DMAMUX_REQ_GEN_RISING +#define HAL_DMAMUX_REQUEST_GEN_FALLING HAL_DMAMUX_REQ_GEN_FALLING +#define HAL_DMAMUX_REQUEST_GEN_RISING_FALLING HAL_DMAMUX_REQ_GEN_RISING_FALLING + +#if defined(STM32L4R5xx) || defined(STM32L4R9xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || \ + defined(STM32L4S7xx) || defined(STM32L4S9xx) +#define DMA_REQUEST_DCMI_PSSI DMA_REQUEST_DCMI +#endif + +#endif /* STM32L4 */ + +#if defined(STM32G0) +#define DMA_REQUEST_DAC1_CHANNEL1 DMA_REQUEST_DAC1_CH1 +#define DMA_REQUEST_DAC1_CHANNEL2 DMA_REQUEST_DAC1_CH2 +#define DMA_REQUEST_TIM16_TRIG_COM DMA_REQUEST_TIM16_COM +#define DMA_REQUEST_TIM17_TRIG_COM DMA_REQUEST_TIM17_COM + +#define LL_DMAMUX_REQ_TIM16_TRIG_COM LL_DMAMUX_REQ_TIM16_COM +#define LL_DMAMUX_REQ_TIM17_TRIG_COM LL_DMAMUX_REQ_TIM17_COM +#endif + +#if defined(STM32H7) + +#define DMA_REQUEST_DAC1 DMA_REQUEST_DAC1_CH1 +#define DMA_REQUEST_DAC2 DMA_REQUEST_DAC1_CH2 + +#define BDMA_REQUEST_LP_UART1_RX BDMA_REQUEST_LPUART1_RX +#define BDMA_REQUEST_LP_UART1_TX BDMA_REQUEST_LPUART1_TX + +#define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH0_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH0_EVT +#define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH1_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH1_EVT +#define HAL_DMAMUX1_REQUEST_GEN_DMAMUX1_CH2_EVT HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH2_EVT +#define HAL_DMAMUX1_REQUEST_GEN_LPTIM1_OUT HAL_DMAMUX1_REQ_GEN_LPTIM1_OUT +#define HAL_DMAMUX1_REQUEST_GEN_LPTIM2_OUT HAL_DMAMUX1_REQ_GEN_LPTIM2_OUT +#define HAL_DMAMUX1_REQUEST_GEN_LPTIM3_OUT HAL_DMAMUX1_REQ_GEN_LPTIM3_OUT +#define HAL_DMAMUX1_REQUEST_GEN_EXTI0 HAL_DMAMUX1_REQ_GEN_EXTI0 +#define HAL_DMAMUX1_REQUEST_GEN_TIM12_TRGO HAL_DMAMUX1_REQ_GEN_TIM12_TRGO + +#define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH0_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH0_EVT +#define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH1_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH1_EVT +#define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH2_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH2_EVT +#define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH3_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH3_EVT +#define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH4_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH4_EVT +#define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH5_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH5_EVT +#define HAL_DMAMUX2_REQUEST_GEN_DMAMUX2_CH6_EVT HAL_DMAMUX2_REQ_GEN_DMAMUX2_CH6_EVT +#define HAL_DMAMUX2_REQUEST_GEN_LPUART1_RX_WKUP HAL_DMAMUX2_REQ_GEN_LPUART1_RX_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_LPUART1_TX_WKUP HAL_DMAMUX2_REQ_GEN_LPUART1_TX_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_LPTIM2_WKUP HAL_DMAMUX2_REQ_GEN_LPTIM2_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_LPTIM2_OUT HAL_DMAMUX2_REQ_GEN_LPTIM2_OUT +#define HAL_DMAMUX2_REQUEST_GEN_LPTIM3_WKUP HAL_DMAMUX2_REQ_GEN_LPTIM3_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_LPTIM3_OUT HAL_DMAMUX2_REQ_GEN_LPTIM3_OUT +#define HAL_DMAMUX2_REQUEST_GEN_LPTIM4_WKUP HAL_DMAMUX2_REQ_GEN_LPTIM4_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_LPTIM5_WKUP HAL_DMAMUX2_REQ_GEN_LPTIM5_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_I2C4_WKUP HAL_DMAMUX2_REQ_GEN_I2C4_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_SPI6_WKUP HAL_DMAMUX2_REQ_GEN_SPI6_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_COMP1_OUT HAL_DMAMUX2_REQ_GEN_COMP1_OUT +#define HAL_DMAMUX2_REQUEST_GEN_COMP2_OUT HAL_DMAMUX2_REQ_GEN_COMP2_OUT +#define HAL_DMAMUX2_REQUEST_GEN_RTC_WKUP HAL_DMAMUX2_REQ_GEN_RTC_WKUP +#define HAL_DMAMUX2_REQUEST_GEN_EXTI0 HAL_DMAMUX2_REQ_GEN_EXTI0 +#define HAL_DMAMUX2_REQUEST_GEN_EXTI2 HAL_DMAMUX2_REQ_GEN_EXTI2 +#define HAL_DMAMUX2_REQUEST_GEN_I2C4_IT_EVT HAL_DMAMUX2_REQ_GEN_I2C4_IT_EVT +#define HAL_DMAMUX2_REQUEST_GEN_SPI6_IT HAL_DMAMUX2_REQ_GEN_SPI6_IT +#define HAL_DMAMUX2_REQUEST_GEN_LPUART1_TX_IT HAL_DMAMUX2_REQ_GEN_LPUART1_TX_IT +#define HAL_DMAMUX2_REQUEST_GEN_LPUART1_RX_IT HAL_DMAMUX2_REQ_GEN_LPUART1_RX_IT +#define HAL_DMAMUX2_REQUEST_GEN_ADC3_IT HAL_DMAMUX2_REQ_GEN_ADC3_IT +#define HAL_DMAMUX2_REQUEST_GEN_ADC3_AWD1_OUT HAL_DMAMUX2_REQ_GEN_ADC3_AWD1_OUT +#define HAL_DMAMUX2_REQUEST_GEN_BDMA_CH0_IT HAL_DMAMUX2_REQ_GEN_BDMA_CH0_IT +#define HAL_DMAMUX2_REQUEST_GEN_BDMA_CH1_IT HAL_DMAMUX2_REQ_GEN_BDMA_CH1_IT + +#define HAL_DMAMUX_REQUEST_GEN_NO_EVENT HAL_DMAMUX_REQ_GEN_NO_EVENT +#define HAL_DMAMUX_REQUEST_GEN_RISING HAL_DMAMUX_REQ_GEN_RISING +#define HAL_DMAMUX_REQUEST_GEN_FALLING HAL_DMAMUX_REQ_GEN_FALLING +#define HAL_DMAMUX_REQUEST_GEN_RISING_FALLING HAL_DMAMUX_REQ_GEN_RISING_FALLING + +#define DFSDM_FILTER_EXT_TRIG_LPTIM1 DFSDM_FILTER_EXT_TRIG_LPTIM1_OUT +#define DFSDM_FILTER_EXT_TRIG_LPTIM2 DFSDM_FILTER_EXT_TRIG_LPTIM2_OUT +#define DFSDM_FILTER_EXT_TRIG_LPTIM3 DFSDM_FILTER_EXT_TRIG_LPTIM3_OUT + +#define DAC_TRIGGER_LP1_OUT DAC_TRIGGER_LPTIM1_OUT +#define DAC_TRIGGER_LP2_OUT DAC_TRIGGER_LPTIM2_OUT + +#endif /* STM32H7 */ + +#if defined(STM32U5) +#define GPDMA1_REQUEST_DCMI GPDMA1_REQUEST_DCMI_PSSI +#endif /* STM32U5 */ +/** + * @} + */ + +/** @defgroup HAL_FLASH_Aliased_Defines HAL FLASH Aliased Defines maintained for legacy purpose + * @{ + */ + +#define TYPEPROGRAM_BYTE FLASH_TYPEPROGRAM_BYTE +#define TYPEPROGRAM_HALFWORD FLASH_TYPEPROGRAM_HALFWORD +#define TYPEPROGRAM_WORD FLASH_TYPEPROGRAM_WORD +#define TYPEPROGRAM_DOUBLEWORD FLASH_TYPEPROGRAM_DOUBLEWORD +#define TYPEERASE_SECTORS FLASH_TYPEERASE_SECTORS +#define TYPEERASE_PAGES FLASH_TYPEERASE_PAGES +#define TYPEERASE_PAGEERASE FLASH_TYPEERASE_PAGES +#define TYPEERASE_MASSERASE FLASH_TYPEERASE_MASSERASE +#define WRPSTATE_DISABLE OB_WRPSTATE_DISABLE +#define WRPSTATE_ENABLE OB_WRPSTATE_ENABLE +#define HAL_FLASH_TIMEOUT_VALUE FLASH_TIMEOUT_VALUE +#define OBEX_PCROP OPTIONBYTE_PCROP +#define OBEX_BOOTCONFIG OPTIONBYTE_BOOTCONFIG +#define PCROPSTATE_DISABLE OB_PCROP_STATE_DISABLE +#define PCROPSTATE_ENABLE OB_PCROP_STATE_ENABLE +#define TYPEERASEDATA_BYTE FLASH_TYPEERASEDATA_BYTE +#define TYPEERASEDATA_HALFWORD FLASH_TYPEERASEDATA_HALFWORD +#define TYPEERASEDATA_WORD FLASH_TYPEERASEDATA_WORD +#define TYPEPROGRAMDATA_BYTE FLASH_TYPEPROGRAMDATA_BYTE +#define TYPEPROGRAMDATA_HALFWORD FLASH_TYPEPROGRAMDATA_HALFWORD +#define TYPEPROGRAMDATA_WORD FLASH_TYPEPROGRAMDATA_WORD +#define TYPEPROGRAMDATA_FASTBYTE FLASH_TYPEPROGRAMDATA_FASTBYTE +#define TYPEPROGRAMDATA_FASTHALFWORD FLASH_TYPEPROGRAMDATA_FASTHALFWORD +#define TYPEPROGRAMDATA_FASTWORD FLASH_TYPEPROGRAMDATA_FASTWORD +#define PAGESIZE FLASH_PAGE_SIZE +#define TYPEPROGRAM_FASTBYTE FLASH_TYPEPROGRAM_BYTE +#define TYPEPROGRAM_FASTHALFWORD FLASH_TYPEPROGRAM_HALFWORD +#define TYPEPROGRAM_FASTWORD FLASH_TYPEPROGRAM_WORD +#define VOLTAGE_RANGE_1 FLASH_VOLTAGE_RANGE_1 +#define VOLTAGE_RANGE_2 FLASH_VOLTAGE_RANGE_2 +#define VOLTAGE_RANGE_3 FLASH_VOLTAGE_RANGE_3 +#define VOLTAGE_RANGE_4 FLASH_VOLTAGE_RANGE_4 +#define TYPEPROGRAM_FAST FLASH_TYPEPROGRAM_FAST +#define TYPEPROGRAM_FAST_AND_LAST FLASH_TYPEPROGRAM_FAST_AND_LAST +#define WRPAREA_BANK1_AREAA OB_WRPAREA_BANK1_AREAA +#define WRPAREA_BANK1_AREAB OB_WRPAREA_BANK1_AREAB +#define WRPAREA_BANK2_AREAA OB_WRPAREA_BANK2_AREAA +#define WRPAREA_BANK2_AREAB OB_WRPAREA_BANK2_AREAB +#define IWDG_STDBY_FREEZE OB_IWDG_STDBY_FREEZE +#define IWDG_STDBY_ACTIVE OB_IWDG_STDBY_RUN +#define IWDG_STOP_FREEZE OB_IWDG_STOP_FREEZE +#define IWDG_STOP_ACTIVE OB_IWDG_STOP_RUN +#define FLASH_ERROR_NONE HAL_FLASH_ERROR_NONE +#define FLASH_ERROR_RD HAL_FLASH_ERROR_RD +#define FLASH_ERROR_PG HAL_FLASH_ERROR_PROG +#define FLASH_ERROR_PGP HAL_FLASH_ERROR_PGS +#define FLASH_ERROR_WRP HAL_FLASH_ERROR_WRP +#define FLASH_ERROR_OPTV HAL_FLASH_ERROR_OPTV +#define FLASH_ERROR_OPTVUSR HAL_FLASH_ERROR_OPTVUSR +#define FLASH_ERROR_PROG HAL_FLASH_ERROR_PROG +#define FLASH_ERROR_OP HAL_FLASH_ERROR_OPERATION +#define FLASH_ERROR_PGA HAL_FLASH_ERROR_PGA +#define FLASH_ERROR_SIZE HAL_FLASH_ERROR_SIZE +#define FLASH_ERROR_SIZ HAL_FLASH_ERROR_SIZE +#define FLASH_ERROR_PGS HAL_FLASH_ERROR_PGS +#define FLASH_ERROR_MIS HAL_FLASH_ERROR_MIS +#define FLASH_ERROR_FAST HAL_FLASH_ERROR_FAST +#define FLASH_ERROR_FWWERR HAL_FLASH_ERROR_FWWERR +#define FLASH_ERROR_NOTZERO HAL_FLASH_ERROR_NOTZERO +#define FLASH_ERROR_OPERATION HAL_FLASH_ERROR_OPERATION +#define FLASH_ERROR_ERS HAL_FLASH_ERROR_ERS +#define OB_WDG_SW OB_IWDG_SW +#define OB_WDG_HW OB_IWDG_HW +#define OB_SDADC12_VDD_MONITOR_SET OB_SDACD_VDD_MONITOR_SET +#define OB_SDADC12_VDD_MONITOR_RESET OB_SDACD_VDD_MONITOR_RESET +#define OB_RAM_PARITY_CHECK_SET OB_SRAM_PARITY_SET +#define OB_RAM_PARITY_CHECK_RESET OB_SRAM_PARITY_RESET +#define IS_OB_SDADC12_VDD_MONITOR IS_OB_SDACD_VDD_MONITOR +#define OB_RDP_LEVEL0 OB_RDP_LEVEL_0 +#define OB_RDP_LEVEL1 OB_RDP_LEVEL_1 +#define OB_RDP_LEVEL2 OB_RDP_LEVEL_2 +#if defined(STM32G0) || defined(STM32C0) +#define OB_BOOT_LOCK_DISABLE OB_BOOT_ENTRY_FORCED_NONE +#define OB_BOOT_LOCK_ENABLE OB_BOOT_ENTRY_FORCED_FLASH +#else +#define OB_BOOT_ENTRY_FORCED_NONE OB_BOOT_LOCK_DISABLE +#define OB_BOOT_ENTRY_FORCED_FLASH OB_BOOT_LOCK_ENABLE +#endif +#if defined(STM32H7) +#define FLASH_FLAG_SNECCE_BANK1RR FLASH_FLAG_SNECCERR_BANK1 +#define FLASH_FLAG_DBECCE_BANK1RR FLASH_FLAG_DBECCERR_BANK1 +#define FLASH_FLAG_STRBER_BANK1R FLASH_FLAG_STRBERR_BANK1 +#define FLASH_FLAG_SNECCE_BANK2RR FLASH_FLAG_SNECCERR_BANK2 +#define FLASH_FLAG_DBECCE_BANK2RR FLASH_FLAG_DBECCERR_BANK2 +#define FLASH_FLAG_STRBER_BANK2R FLASH_FLAG_STRBERR_BANK2 +#define FLASH_FLAG_WDW FLASH_FLAG_WBNE +#define OB_WRP_SECTOR_All OB_WRP_SECTOR_ALL +#endif /* STM32H7 */ +#if defined(STM32U5) +#define OB_USER_nRST_STOP OB_USER_NRST_STOP +#define OB_USER_nRST_STDBY OB_USER_NRST_STDBY +#define OB_USER_nRST_SHDW OB_USER_NRST_SHDW +#define OB_USER_nSWBOOT0 OB_USER_NSWBOOT0 +#define OB_USER_nBOOT0 OB_USER_NBOOT0 +#define OB_nBOOT0_RESET OB_NBOOT0_RESET +#define OB_nBOOT0_SET OB_NBOOT0_SET +#define OB_USER_SRAM134_RST OB_USER_SRAM_RST +#define OB_SRAM134_RST_ERASE OB_SRAM_RST_ERASE +#define OB_SRAM134_RST_NOT_ERASE OB_SRAM_RST_NOT_ERASE +#endif /* STM32U5 */ + +/** + * @} + */ + +/** @defgroup HAL_JPEG_Aliased_Macros HAL JPEG Aliased Macros maintained for legacy purpose + * @{ + */ + +#if defined(STM32H7) +#define __HAL_RCC_JPEG_CLK_ENABLE __HAL_RCC_JPGDECEN_CLK_ENABLE +#define __HAL_RCC_JPEG_CLK_DISABLE __HAL_RCC_JPGDECEN_CLK_DISABLE +#define __HAL_RCC_JPEG_FORCE_RESET __HAL_RCC_JPGDECRST_FORCE_RESET +#define __HAL_RCC_JPEG_RELEASE_RESET __HAL_RCC_JPGDECRST_RELEASE_RESET +#define __HAL_RCC_JPEG_CLK_SLEEP_ENABLE __HAL_RCC_JPGDEC_CLK_SLEEP_ENABLE +#define __HAL_RCC_JPEG_CLK_SLEEP_DISABLE __HAL_RCC_JPGDEC_CLK_SLEEP_DISABLE +#endif /* STM32H7 */ + +/** + * @} + */ + +/** @defgroup HAL_SYSCFG_Aliased_Defines HAL SYSCFG Aliased Defines maintained for legacy purpose + * @{ + */ + +#define HAL_SYSCFG_FASTMODEPLUS_I2C_PA9 I2C_FASTMODEPLUS_PA9 +#define HAL_SYSCFG_FASTMODEPLUS_I2C_PA10 I2C_FASTMODEPLUS_PA10 +#define HAL_SYSCFG_FASTMODEPLUS_I2C_PB6 I2C_FASTMODEPLUS_PB6 +#define HAL_SYSCFG_FASTMODEPLUS_I2C_PB7 I2C_FASTMODEPLUS_PB7 +#define HAL_SYSCFG_FASTMODEPLUS_I2C_PB8 I2C_FASTMODEPLUS_PB8 +#define HAL_SYSCFG_FASTMODEPLUS_I2C_PB9 I2C_FASTMODEPLUS_PB9 +#define HAL_SYSCFG_FASTMODEPLUS_I2C1 I2C_FASTMODEPLUS_I2C1 +#define HAL_SYSCFG_FASTMODEPLUS_I2C2 I2C_FASTMODEPLUS_I2C2 +#define HAL_SYSCFG_FASTMODEPLUS_I2C3 I2C_FASTMODEPLUS_I2C3 +#if defined(STM32G4) + +#define HAL_SYSCFG_EnableIOAnalogSwitchBooster HAL_SYSCFG_EnableIOSwitchBooster +#define HAL_SYSCFG_DisableIOAnalogSwitchBooster HAL_SYSCFG_DisableIOSwitchBooster +#define HAL_SYSCFG_EnableIOAnalogSwitchVDD HAL_SYSCFG_EnableIOSwitchVDD +#define HAL_SYSCFG_DisableIOAnalogSwitchVDD HAL_SYSCFG_DisableIOSwitchVDD +#endif /* STM32G4 */ + +#if defined(STM32H5) +#define SYSCFG_IT_FPU_IOC SBS_IT_FPU_IOC +#define SYSCFG_IT_FPU_DZC SBS_IT_FPU_DZC +#define SYSCFG_IT_FPU_UFC SBS_IT_FPU_UFC +#define SYSCFG_IT_FPU_OFC SBS_IT_FPU_OFC +#define SYSCFG_IT_FPU_IDC SBS_IT_FPU_IDC +#define SYSCFG_IT_FPU_IXC SBS_IT_FPU_IXC + +#define SYSCFG_BREAK_FLASH_ECC SBS_BREAK_FLASH_ECC +#define SYSCFG_BREAK_PVD SBS_BREAK_PVD +#define SYSCFG_BREAK_SRAM_ECC SBS_BREAK_SRAM_ECC +#define SYSCFG_BREAK_LOCKUP SBS_BREAK_LOCKUP + +#define SYSCFG_VREFBUF_VOLTAGE_SCALE0 VREFBUF_VOLTAGE_SCALE0 +#define SYSCFG_VREFBUF_VOLTAGE_SCALE1 VREFBUF_VOLTAGE_SCALE1 +#define SYSCFG_VREFBUF_VOLTAGE_SCALE2 VREFBUF_VOLTAGE_SCALE2 +#define SYSCFG_VREFBUF_VOLTAGE_SCALE3 VREFBUF_VOLTAGE_SCALE3 + +#define SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE VREFBUF_HIGH_IMPEDANCE_DISABLE +#define SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE VREFBUF_HIGH_IMPEDANCE_ENABLE + +#define SYSCFG_FASTMODEPLUS_PB6 SBS_FASTMODEPLUS_PB6 +#define SYSCFG_FASTMODEPLUS_PB7 SBS_FASTMODEPLUS_PB7 +#define SYSCFG_FASTMODEPLUS_PB8 SBS_FASTMODEPLUS_PB8 +#define SYSCFG_FASTMODEPLUS_PB9 SBS_FASTMODEPLUS_PB9 + +#define SYSCFG_ETH_MII SBS_ETH_MII +#define SYSCFG_ETH_RMII SBS_ETH_RMII +#define IS_SYSCFG_ETHERNET_CONFIG IS_SBS_ETHERNET_CONFIG + +#define SYSCFG_MEMORIES_ERASE_FLAG_IPMEE SBS_MEMORIES_ERASE_FLAG_IPMEE +#define SYSCFG_MEMORIES_ERASE_FLAG_MCLR SBS_MEMORIES_ERASE_FLAG_MCLR +#define IS_SYSCFG_MEMORIES_ERASE_FLAG IS_SBS_MEMORIES_ERASE_FLAG + +#define IS_SYSCFG_CODE_CONFIG IS_SBS_CODE_CONFIG + +#define SYSCFG_MPU_NSEC SBS_MPU_NSEC +#define SYSCFG_VTOR_NSEC SBS_VTOR_NSEC +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +#define SYSCFG_SAU SBS_SAU +#define SYSCFG_MPU_SEC SBS_MPU_SEC +#define SYSCFG_VTOR_AIRCR_SEC SBS_VTOR_AIRCR_SEC +#define SYSCFG_LOCK_ALL SBS_LOCK_ALL +#else +#define SYSCFG_LOCK_ALL SBS_LOCK_ALL +#endif /* __ARM_FEATURE_CMSE */ + +#define SYSCFG_CLK SBS_CLK +#define SYSCFG_CLASSB SBS_CLASSB +#define SYSCFG_FPU SBS_FPU +#define SYSCFG_ALL SBS_ALL + +#define SYSCFG_SEC SBS_SEC +#define SYSCFG_NSEC SBS_NSEC + +#define __HAL_SYSCFG_FPU_INTERRUPT_ENABLE __HAL_SBS_FPU_INTERRUPT_ENABLE +#define __HAL_SYSCFG_FPU_INTERRUPT_DISABLE __HAL_SBS_FPU_INTERRUPT_DISABLE + +#define __HAL_SYSCFG_BREAK_ECC_LOCK __HAL_SBS_BREAK_ECC_LOCK +#define __HAL_SYSCFG_BREAK_LOCKUP_LOCK __HAL_SBS_BREAK_LOCKUP_LOCK +#define __HAL_SYSCFG_BREAK_PVD_LOCK __HAL_SBS_BREAK_PVD_LOCK +#define __HAL_SYSCFG_BREAK_SRAM_ECC_LOCK __HAL_SBS_BREAK_SRAM_ECC_LOCK + +#define __HAL_SYSCFG_FASTMODEPLUS_ENABLE __HAL_SBS_FASTMODEPLUS_ENABLE +#define __HAL_SYSCFG_FASTMODEPLUS_DISABLE __HAL_SBS_FASTMODEPLUS_DISABLE + +#define __HAL_SYSCFG_GET_MEMORIES_ERASE_STATUS __HAL_SBS_GET_MEMORIES_ERASE_STATUS +#define __HAL_SYSCFG_CLEAR_MEMORIES_ERASE_STATUS __HAL_SBS_CLEAR_MEMORIES_ERASE_STATUS + +#define IS_SYSCFG_FPU_INTERRUPT IS_SBS_FPU_INTERRUPT +#define IS_SYSCFG_BREAK_CONFIG IS_SBS_BREAK_CONFIG +#define IS_SYSCFG_VREFBUF_VOLTAGE_SCALE IS_VREFBUF_VOLTAGE_SCALE +#define IS_SYSCFG_VREFBUF_HIGH_IMPEDANCE IS_VREFBUF_HIGH_IMPEDANCE +#define IS_SYSCFG_VREFBUF_TRIMMING IS_VREFBUF_TRIMMING +#define IS_SYSCFG_FASTMODEPLUS IS_SBS_FASTMODEPLUS +#define IS_SYSCFG_ITEMS_ATTRIBUTES IS_SBS_ITEMS_ATTRIBUTES +#define IS_SYSCFG_ATTRIBUTES IS_SBS_ATTRIBUTES +#define IS_SYSCFG_LOCK_ITEMS IS_SBS_LOCK_ITEMS + +#define HAL_SYSCFG_VREFBUF_VoltageScalingConfig HAL_VREFBUF_VoltageScalingConfig +#define HAL_SYSCFG_VREFBUF_HighImpedanceConfig HAL_VREFBUF_HighImpedanceConfig +#define HAL_SYSCFG_VREFBUF_TrimmingConfig HAL_VREFBUF_TrimmingConfig +#define HAL_SYSCFG_EnableVREFBUF HAL_EnableVREFBUF +#define HAL_SYSCFG_DisableVREFBUF HAL_DisableVREFBUF + +#define HAL_SYSCFG_EnableIOAnalogSwitchBooster HAL_SBS_EnableIOAnalogSwitchBooster +#define HAL_SYSCFG_DisableIOAnalogSwitchBooster HAL_SBS_DisableIOAnalogSwitchBooster +#define HAL_SYSCFG_ETHInterfaceSelect HAL_SBS_ETHInterfaceSelect + +#define HAL_SYSCFG_Lock HAL_SBS_Lock +#define HAL_SYSCFG_GetLock HAL_SBS_GetLock + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +#define HAL_SYSCFG_ConfigAttributes HAL_SBS_ConfigAttributes +#define HAL_SYSCFG_GetConfigAttributes HAL_SBS_GetConfigAttributes +#endif /* __ARM_FEATURE_CMSE */ + +#endif /* STM32H5 */ + + +/** + * @} + */ + + +/** @defgroup LL_FMC_Aliased_Defines LL FMC Aliased Defines maintained for compatibility purpose + * @{ + */ +#if defined(STM32L4) || defined(STM32F7) || defined(STM32H7) || defined(STM32G4) +#define FMC_NAND_PCC_WAIT_FEATURE_DISABLE FMC_NAND_WAIT_FEATURE_DISABLE +#define FMC_NAND_PCC_WAIT_FEATURE_ENABLE FMC_NAND_WAIT_FEATURE_ENABLE +#define FMC_NAND_PCC_MEM_BUS_WIDTH_8 FMC_NAND_MEM_BUS_WIDTH_8 +#define FMC_NAND_PCC_MEM_BUS_WIDTH_16 FMC_NAND_MEM_BUS_WIDTH_16 +#elif defined(STM32F1) || defined(STM32F2) || defined(STM32F3) || defined(STM32F4) +#define FMC_NAND_WAIT_FEATURE_DISABLE FMC_NAND_PCC_WAIT_FEATURE_DISABLE +#define FMC_NAND_WAIT_FEATURE_ENABLE FMC_NAND_PCC_WAIT_FEATURE_ENABLE +#define FMC_NAND_MEM_BUS_WIDTH_8 FMC_NAND_PCC_MEM_BUS_WIDTH_8 +#define FMC_NAND_MEM_BUS_WIDTH_16 FMC_NAND_PCC_MEM_BUS_WIDTH_16 +#endif +/** + * @} + */ + +/** @defgroup LL_FSMC_Aliased_Defines LL FSMC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define FSMC_NORSRAM_TYPEDEF FSMC_NORSRAM_TypeDef +#define FSMC_NORSRAM_EXTENDED_TYPEDEF FSMC_NORSRAM_EXTENDED_TypeDef +/** + * @} + */ + +/** @defgroup HAL_GPIO_Aliased_Macros HAL GPIO Aliased Macros maintained for legacy purpose + * @{ + */ +#define GET_GPIO_SOURCE GPIO_GET_INDEX +#define GET_GPIO_INDEX GPIO_GET_INDEX + +#if defined(STM32F4) +#define GPIO_AF12_SDMMC GPIO_AF12_SDIO +#define GPIO_AF12_SDMMC1 GPIO_AF12_SDIO +#endif + +#if defined(STM32F7) +#define GPIO_AF12_SDIO GPIO_AF12_SDMMC1 +#define GPIO_AF12_SDMMC GPIO_AF12_SDMMC1 +#endif + +#if defined(STM32L4) +#define GPIO_AF12_SDIO GPIO_AF12_SDMMC1 +#define GPIO_AF12_SDMMC GPIO_AF12_SDMMC1 +#endif + +#if defined(STM32H7) +#define GPIO_AF7_SDIO1 GPIO_AF7_SDMMC1 +#define GPIO_AF8_SDIO1 GPIO_AF8_SDMMC1 +#define GPIO_AF12_SDIO1 GPIO_AF12_SDMMC1 +#define GPIO_AF9_SDIO2 GPIO_AF9_SDMMC2 +#define GPIO_AF10_SDIO2 GPIO_AF10_SDMMC2 +#define GPIO_AF11_SDIO2 GPIO_AF11_SDMMC2 + +#if defined (STM32H743xx) || defined (STM32H753xx) || defined (STM32H750xx) || defined (STM32H742xx) || \ + defined (STM32H745xx) || defined (STM32H755xx) || defined (STM32H747xx) || defined (STM32H757xx) +#define GPIO_AF10_OTG2_HS GPIO_AF10_OTG2_FS +#define GPIO_AF10_OTG1_FS GPIO_AF10_OTG1_HS +#define GPIO_AF12_OTG2_FS GPIO_AF12_OTG1_FS +#endif /*STM32H743xx || STM32H753xx || STM32H750xx || STM32H742xx || STM32H745xx || STM32H755xx || STM32H747xx || \ + STM32H757xx */ +#endif /* STM32H7 */ + +#define GPIO_AF0_LPTIM GPIO_AF0_LPTIM1 +#define GPIO_AF1_LPTIM GPIO_AF1_LPTIM1 +#define GPIO_AF2_LPTIM GPIO_AF2_LPTIM1 + +#if defined(STM32L0) || defined(STM32L4) || defined(STM32F4) || defined(STM32F2) || defined(STM32F7) || \ + defined(STM32G4) || defined(STM32H7) || defined(STM32WB) || defined(STM32U5) +#define GPIO_SPEED_LOW GPIO_SPEED_FREQ_LOW +#define GPIO_SPEED_MEDIUM GPIO_SPEED_FREQ_MEDIUM +#define GPIO_SPEED_FAST GPIO_SPEED_FREQ_HIGH +#define GPIO_SPEED_HIGH GPIO_SPEED_FREQ_VERY_HIGH +#endif /* STM32L0 || STM32L4 || STM32F4 || STM32F2 || STM32F7 || STM32G4 || STM32H7 || STM32WB || STM32U5*/ + +#if defined(STM32L1) +#define GPIO_SPEED_VERY_LOW GPIO_SPEED_FREQ_LOW +#define GPIO_SPEED_LOW GPIO_SPEED_FREQ_MEDIUM +#define GPIO_SPEED_MEDIUM GPIO_SPEED_FREQ_HIGH +#define GPIO_SPEED_HIGH GPIO_SPEED_FREQ_VERY_HIGH +#endif /* STM32L1 */ + +#if defined(STM32F0) || defined(STM32F3) || defined(STM32F1) +#define GPIO_SPEED_LOW GPIO_SPEED_FREQ_LOW +#define GPIO_SPEED_MEDIUM GPIO_SPEED_FREQ_MEDIUM +#define GPIO_SPEED_HIGH GPIO_SPEED_FREQ_HIGH +#endif /* STM32F0 || STM32F3 || STM32F1 */ + +#define GPIO_AF6_DFSDM GPIO_AF6_DFSDM1 + +#if defined(STM32U5) || defined(STM32H5) +#define GPIO_AF0_RTC_50Hz GPIO_AF0_RTC_50HZ +#endif /* STM32U5 || STM32H5 */ +#if defined(STM32U5) +#define GPIO_AF0_S2DSTOP GPIO_AF0_SRDSTOP +#define GPIO_AF11_LPGPIO GPIO_AF11_LPGPIO1 +#endif /* STM32U5 */ +/** + * @} + */ + +/** @defgroup HAL_GTZC_Aliased_Defines HAL GTZC Aliased Defines maintained for legacy purpose + * @{ + */ +#if defined(STM32U5) +#define GTZC_PERIPH_DCMI GTZC_PERIPH_DCMI_PSSI +#define GTZC_PERIPH_LTDC GTZC_PERIPH_LTDCUSB +#endif /* STM32U5 */ +#if defined(STM32H5) +#define GTZC_PERIPH_DAC12 GTZC_PERIPH_DAC1 +#define GTZC_PERIPH_ADC12 GTZC_PERIPH_ADC +#define GTZC_PERIPH_USBFS GTZC_PERIPH_USB +#endif /* STM32H5 */ +#if defined(STM32H5) || defined(STM32U5) +#define GTZC_MCPBB_NB_VCTR_REG_MAX GTZC_MPCBB_NB_VCTR_REG_MAX +#define GTZC_MCPBB_NB_LCK_VCTR_REG_MAX GTZC_MPCBB_NB_LCK_VCTR_REG_MAX +#define GTZC_MCPBB_SUPERBLOCK_UNLOCKED GTZC_MPCBB_SUPERBLOCK_UNLOCKED +#define GTZC_MCPBB_SUPERBLOCK_LOCKED GTZC_MPCBB_SUPERBLOCK_LOCKED +#define GTZC_MCPBB_BLOCK_NSEC GTZC_MPCBB_BLOCK_NSEC +#define GTZC_MCPBB_BLOCK_SEC GTZC_MPCBB_BLOCK_SEC +#define GTZC_MCPBB_BLOCK_NPRIV GTZC_MPCBB_BLOCK_NPRIV +#define GTZC_MCPBB_BLOCK_PRIV GTZC_MPCBB_BLOCK_PRIV +#define GTZC_MCPBB_LOCK_OFF GTZC_MPCBB_LOCK_OFF +#define GTZC_MCPBB_LOCK_ON GTZC_MPCBB_LOCK_ON +#endif /* STM32H5 || STM32U5 */ +/** + * @} + */ + +/** @defgroup HAL_HRTIM_Aliased_Macros HAL HRTIM Aliased Macros maintained for legacy purpose + * @{ + */ +#define HRTIM_TIMDELAYEDPROTECTION_DISABLED HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED +#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT1_EEV68 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_EEV6 +#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT2_EEV68 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_EEV6 +#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDBOTH_EEV68 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV6 +#define HRTIM_TIMDELAYEDPROTECTION_BALANCED_EEV68 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV6 +#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT1_DEEV79 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_DEEV7 +#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDOUT2_DEEV79 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_DEEV7 +#define HRTIM_TIMDELAYEDPROTECTION_DELAYEDBOTH_EEV79 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV7 +#define HRTIM_TIMDELAYEDPROTECTION_BALANCED_EEV79 HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV7 + +#define __HAL_HRTIM_SetCounter __HAL_HRTIM_SETCOUNTER +#define __HAL_HRTIM_GetCounter __HAL_HRTIM_GETCOUNTER +#define __HAL_HRTIM_SetPeriod __HAL_HRTIM_SETPERIOD +#define __HAL_HRTIM_GetPeriod __HAL_HRTIM_GETPERIOD +#define __HAL_HRTIM_SetClockPrescaler __HAL_HRTIM_SETCLOCKPRESCALER +#define __HAL_HRTIM_GetClockPrescaler __HAL_HRTIM_GETCLOCKPRESCALER +#define __HAL_HRTIM_SetCompare __HAL_HRTIM_SETCOMPARE +#define __HAL_HRTIM_GetCompare __HAL_HRTIM_GETCOMPARE + +#if defined(STM32G4) +#define HAL_HRTIM_ExternalEventCounterConfig HAL_HRTIM_ExtEventCounterConfig +#define HAL_HRTIM_ExternalEventCounterEnable HAL_HRTIM_ExtEventCounterEnable +#define HAL_HRTIM_ExternalEventCounterDisable HAL_HRTIM_ExtEventCounterDisable +#define HAL_HRTIM_ExternalEventCounterReset HAL_HRTIM_ExtEventCounterReset +#define HRTIM_TIMEEVENT_A HRTIM_EVENTCOUNTER_A +#define HRTIM_TIMEEVENT_B HRTIM_EVENTCOUNTER_B +#define HRTIM_TIMEEVENTRESETMODE_UNCONDITIONAL HRTIM_EVENTCOUNTER_RSTMODE_UNCONDITIONAL +#define HRTIM_TIMEEVENTRESETMODE_CONDITIONAL HRTIM_EVENTCOUNTER_RSTMODE_CONDITIONAL +#endif /* STM32G4 */ + +#if defined(STM32H7) +#define HRTIM_OUTPUTSET_TIMAEV1_TIMBCMP1 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTSET_TIMAEV2_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTSET_TIMAEV3_TIMCCMP2 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTSET_TIMAEV4_TIMCCMP3 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTSET_TIMAEV5_TIMDCMP1 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTSET_TIMAEV6_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTSET_TIMAEV7_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTSET_TIMAEV8_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTSET_TIMAEV9_TIMFCMP4 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTSET_TIMBEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTSET_TIMBEV2_TIMACMP2 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTSET_TIMBEV3_TIMCCMP3 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTSET_TIMBEV4_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTSET_TIMBEV5_TIMDCMP3 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTSET_TIMBEV6_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTSET_TIMBEV7_TIMECMP1 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTSET_TIMBEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTSET_TIMBEV9_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTSET_TIMCEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTSET_TIMCEV2_TIMACMP2 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTSET_TIMCEV3_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTSET_TIMCEV4_TIMBCMP3 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTSET_TIMCEV5_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTSET_TIMCEV6_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTSET_TIMCEV7_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTSET_TIMCEV8_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTSET_TIMCEV9_TIMFCMP2 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTSET_TIMDEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTSET_TIMDEV2_TIMACMP4 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTSET_TIMDEV3_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTSET_TIMDEV4_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTSET_TIMDEV5_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTSET_TIMDEV6_TIMECMP1 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTSET_TIMDEV7_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTSET_TIMDEV8_TIMFCMP1 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTSET_TIMDEV9_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTSET_TIMEEV1_TIMACMP4 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTSET_TIMEEV2_TIMBCMP3 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTSET_TIMEEV3_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTSET_TIMEEV4_TIMCCMP1 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTSET_TIMEEV5_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTSET_TIMEEV6_TIMDCMP1 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTSET_TIMEEV7_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTSET_TIMEEV8_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTSET_TIMEEV9_TIMFCMP4 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTSET_TIMFEV1_TIMACMP3 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTSET_TIMFEV2_TIMBCMP1 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTSET_TIMFEV3_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTSET_TIMFEV4_TIMCCMP1 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTSET_TIMFEV5_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTSET_TIMFEV6_TIMDCMP3 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTSET_TIMFEV7_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTSET_TIMFEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTSET_TIMFEV9_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_9 + +#define HRTIM_OUTPUTRESET_TIMAEV1_TIMBCMP1 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTRESET_TIMAEV2_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTRESET_TIMAEV3_TIMCCMP2 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTRESET_TIMAEV4_TIMCCMP3 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTRESET_TIMAEV5_TIMDCMP1 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTRESET_TIMAEV6_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTRESET_TIMAEV7_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTRESET_TIMAEV8_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTRESET_TIMAEV9_TIMFCMP4 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTRESET_TIMBEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTRESET_TIMBEV2_TIMACMP2 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTRESET_TIMBEV3_TIMCCMP3 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTRESET_TIMBEV4_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTRESET_TIMBEV5_TIMDCMP3 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTRESET_TIMBEV6_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTRESET_TIMBEV7_TIMECMP1 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTRESET_TIMBEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTRESET_TIMBEV9_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTRESET_TIMCEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTRESET_TIMCEV2_TIMACMP2 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTRESET_TIMCEV3_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTRESET_TIMCEV4_TIMBCMP3 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTRESET_TIMCEV5_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTRESET_TIMCEV6_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTRESET_TIMCEV7_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTRESET_TIMCEV8_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTRESET_TIMCEV9_TIMFCMP2 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTRESET_TIMDEV1_TIMACMP1 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTRESET_TIMDEV2_TIMACMP4 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTRESET_TIMDEV3_TIMBCMP2 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTRESET_TIMDEV4_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTRESET_TIMDEV5_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTRESET_TIMDEV6_TIMECMP1 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTRESET_TIMDEV7_TIMECMP4 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTRESET_TIMDEV8_TIMFCMP1 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTRESET_TIMDEV9_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTRESET_TIMEEV1_TIMACMP4 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTRESET_TIMEEV2_TIMBCMP3 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTRESET_TIMEEV3_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTRESET_TIMEEV4_TIMCCMP1 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTRESET_TIMEEV5_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTRESET_TIMEEV6_TIMDCMP1 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTRESET_TIMEEV7_TIMDCMP2 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTRESET_TIMEEV8_TIMFCMP3 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTRESET_TIMEEV9_TIMFCMP4 HRTIM_OUTPUTSET_TIMEV_9 +#define HRTIM_OUTPUTRESET_TIMFEV1_TIMACMP3 HRTIM_OUTPUTSET_TIMEV_1 +#define HRTIM_OUTPUTRESET_TIMFEV2_TIMBCMP1 HRTIM_OUTPUTSET_TIMEV_2 +#define HRTIM_OUTPUTRESET_TIMFEV3_TIMBCMP4 HRTIM_OUTPUTSET_TIMEV_3 +#define HRTIM_OUTPUTRESET_TIMFEV4_TIMCCMP1 HRTIM_OUTPUTSET_TIMEV_4 +#define HRTIM_OUTPUTRESET_TIMFEV5_TIMCCMP4 HRTIM_OUTPUTSET_TIMEV_5 +#define HRTIM_OUTPUTRESET_TIMFEV6_TIMDCMP3 HRTIM_OUTPUTSET_TIMEV_6 +#define HRTIM_OUTPUTRESET_TIMFEV7_TIMDCMP4 HRTIM_OUTPUTSET_TIMEV_7 +#define HRTIM_OUTPUTRESET_TIMFEV8_TIMECMP2 HRTIM_OUTPUTSET_TIMEV_8 +#define HRTIM_OUTPUTRESET_TIMFEV9_TIMECMP3 HRTIM_OUTPUTSET_TIMEV_9 +#endif /* STM32H7 */ + +#if defined(STM32F3) +/** @brief Constants defining available sources associated to external events. + */ +#define HRTIM_EVENTSRC_1 (0x00000000U) +#define HRTIM_EVENTSRC_2 (HRTIM_EECR1_EE1SRC_0) +#define HRTIM_EVENTSRC_3 (HRTIM_EECR1_EE1SRC_1) +#define HRTIM_EVENTSRC_4 (HRTIM_EECR1_EE1SRC_1 | HRTIM_EECR1_EE1SRC_0) + +/** @brief Constants defining the DLL calibration periods (in micro seconds) + */ +#define HRTIM_CALIBRATIONRATE_7300 0x00000000U +#define HRTIM_CALIBRATIONRATE_910 (HRTIM_DLLCR_CALRTE_0) +#define HRTIM_CALIBRATIONRATE_114 (HRTIM_DLLCR_CALRTE_1) +#define HRTIM_CALIBRATIONRATE_14 (HRTIM_DLLCR_CALRTE_1 | HRTIM_DLLCR_CALRTE_0) + +#endif /* STM32F3 */ +/** + * @} + */ + +/** @defgroup HAL_I2C_Aliased_Defines HAL I2C Aliased Defines maintained for legacy purpose + * @{ + */ +#define I2C_DUALADDRESS_DISABLED I2C_DUALADDRESS_DISABLE +#define I2C_DUALADDRESS_ENABLED I2C_DUALADDRESS_ENABLE +#define I2C_GENERALCALL_DISABLED I2C_GENERALCALL_DISABLE +#define I2C_GENERALCALL_ENABLED I2C_GENERALCALL_ENABLE +#define I2C_NOSTRETCH_DISABLED I2C_NOSTRETCH_DISABLE +#define I2C_NOSTRETCH_ENABLED I2C_NOSTRETCH_ENABLE +#define I2C_ANALOGFILTER_ENABLED I2C_ANALOGFILTER_ENABLE +#define I2C_ANALOGFILTER_DISABLED I2C_ANALOGFILTER_DISABLE +#if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32G0) || defined(STM32L4) || \ + defined(STM32L1) || defined(STM32F7) +#define HAL_I2C_STATE_MEM_BUSY_TX HAL_I2C_STATE_BUSY_TX +#define HAL_I2C_STATE_MEM_BUSY_RX HAL_I2C_STATE_BUSY_RX +#define HAL_I2C_STATE_MASTER_BUSY_TX HAL_I2C_STATE_BUSY_TX +#define HAL_I2C_STATE_MASTER_BUSY_RX HAL_I2C_STATE_BUSY_RX +#define HAL_I2C_STATE_SLAVE_BUSY_TX HAL_I2C_STATE_BUSY_TX +#define HAL_I2C_STATE_SLAVE_BUSY_RX HAL_I2C_STATE_BUSY_RX +#endif +/** + * @} + */ + +/** @defgroup HAL_IRDA_Aliased_Defines HAL IRDA Aliased Defines maintained for legacy purpose + * @{ + */ +#define IRDA_ONE_BIT_SAMPLE_DISABLED IRDA_ONE_BIT_SAMPLE_DISABLE +#define IRDA_ONE_BIT_SAMPLE_ENABLED IRDA_ONE_BIT_SAMPLE_ENABLE + +/** + * @} + */ + +/** @defgroup HAL_IWDG_Aliased_Defines HAL IWDG Aliased Defines maintained for legacy purpose + * @{ + */ +#define KR_KEY_RELOAD IWDG_KEY_RELOAD +#define KR_KEY_ENABLE IWDG_KEY_ENABLE +#define KR_KEY_EWA IWDG_KEY_WRITE_ACCESS_ENABLE +#define KR_KEY_DWA IWDG_KEY_WRITE_ACCESS_DISABLE +/** + * @} + */ + +/** @defgroup HAL_LPTIM_Aliased_Defines HAL LPTIM Aliased Defines maintained for legacy purpose + * @{ + */ + +#define LPTIM_CLOCKSAMPLETIME_DIRECTTRANSISTION LPTIM_CLOCKSAMPLETIME_DIRECTTRANSITION +#define LPTIM_CLOCKSAMPLETIME_2TRANSISTIONS LPTIM_CLOCKSAMPLETIME_2TRANSITIONS +#define LPTIM_CLOCKSAMPLETIME_4TRANSISTIONS LPTIM_CLOCKSAMPLETIME_4TRANSITIONS +#define LPTIM_CLOCKSAMPLETIME_8TRANSISTIONS LPTIM_CLOCKSAMPLETIME_8TRANSITIONS + +#define LPTIM_CLOCKPOLARITY_RISINGEDGE LPTIM_CLOCKPOLARITY_RISING +#define LPTIM_CLOCKPOLARITY_FALLINGEDGE LPTIM_CLOCKPOLARITY_FALLING +#define LPTIM_CLOCKPOLARITY_BOTHEDGES LPTIM_CLOCKPOLARITY_RISING_FALLING + +#define LPTIM_TRIGSAMPLETIME_DIRECTTRANSISTION LPTIM_TRIGSAMPLETIME_DIRECTTRANSITION +#define LPTIM_TRIGSAMPLETIME_2TRANSISTIONS LPTIM_TRIGSAMPLETIME_2TRANSITIONS +#define LPTIM_TRIGSAMPLETIME_4TRANSISTIONS LPTIM_TRIGSAMPLETIME_4TRANSITIONS +#define LPTIM_TRIGSAMPLETIME_8TRANSISTIONS LPTIM_TRIGSAMPLETIME_8TRANSITIONS + +/* The following 3 definition have also been present in a temporary version of lptim.h */ +/* They need to be renamed also to the right name, just in case */ +#define LPTIM_TRIGSAMPLETIME_2TRANSITION LPTIM_TRIGSAMPLETIME_2TRANSITIONS +#define LPTIM_TRIGSAMPLETIME_4TRANSITION LPTIM_TRIGSAMPLETIME_4TRANSITIONS +#define LPTIM_TRIGSAMPLETIME_8TRANSITION LPTIM_TRIGSAMPLETIME_8TRANSITIONS + + +/** @defgroup HAL_LPTIM_Aliased_Defines HAL LPTIM Aliased Defines maintained for legacy purpose + * @{ + */ +#define HAL_LPTIM_ReadCompare HAL_LPTIM_ReadCapturedValue +/** + * @} + */ + +#if defined(STM32U5) +#define LPTIM_ISR_CC1 LPTIM_ISR_CC1IF +#define LPTIM_ISR_CC2 LPTIM_ISR_CC2IF +#define LPTIM_CHANNEL_ALL 0x00000000U +#endif /* STM32U5 */ +/** + * @} + */ + +/** @defgroup HAL_NAND_Aliased_Defines HAL NAND Aliased Defines maintained for legacy purpose + * @{ + */ +#define HAL_NAND_Read_Page HAL_NAND_Read_Page_8b +#define HAL_NAND_Write_Page HAL_NAND_Write_Page_8b +#define HAL_NAND_Read_SpareArea HAL_NAND_Read_SpareArea_8b +#define HAL_NAND_Write_SpareArea HAL_NAND_Write_SpareArea_8b + +#define NAND_AddressTypedef NAND_AddressTypeDef + +#define __ARRAY_ADDRESS ARRAY_ADDRESS +#define __ADDR_1st_CYCLE ADDR_1ST_CYCLE +#define __ADDR_2nd_CYCLE ADDR_2ND_CYCLE +#define __ADDR_3rd_CYCLE ADDR_3RD_CYCLE +#define __ADDR_4th_CYCLE ADDR_4TH_CYCLE +/** + * @} + */ + +/** @defgroup HAL_NOR_Aliased_Defines HAL NOR Aliased Defines maintained for legacy purpose + * @{ + */ +#define NOR_StatusTypedef HAL_NOR_StatusTypeDef +#define NOR_SUCCESS HAL_NOR_STATUS_SUCCESS +#define NOR_ONGOING HAL_NOR_STATUS_ONGOING +#define NOR_ERROR HAL_NOR_STATUS_ERROR +#define NOR_TIMEOUT HAL_NOR_STATUS_TIMEOUT + +#define __NOR_WRITE NOR_WRITE +#define __NOR_ADDR_SHIFT NOR_ADDR_SHIFT +/** + * @} + */ + +/** @defgroup HAL_OPAMP_Aliased_Defines HAL OPAMP Aliased Defines maintained for legacy purpose + * @{ + */ + +#define OPAMP_NONINVERTINGINPUT_VP0 OPAMP_NONINVERTINGINPUT_IO0 +#define OPAMP_NONINVERTINGINPUT_VP1 OPAMP_NONINVERTINGINPUT_IO1 +#define OPAMP_NONINVERTINGINPUT_VP2 OPAMP_NONINVERTINGINPUT_IO2 +#define OPAMP_NONINVERTINGINPUT_VP3 OPAMP_NONINVERTINGINPUT_IO3 + +#define OPAMP_SEC_NONINVERTINGINPUT_VP0 OPAMP_SEC_NONINVERTINGINPUT_IO0 +#define OPAMP_SEC_NONINVERTINGINPUT_VP1 OPAMP_SEC_NONINVERTINGINPUT_IO1 +#define OPAMP_SEC_NONINVERTINGINPUT_VP2 OPAMP_SEC_NONINVERTINGINPUT_IO2 +#define OPAMP_SEC_NONINVERTINGINPUT_VP3 OPAMP_SEC_NONINVERTINGINPUT_IO3 + +#define OPAMP_INVERTINGINPUT_VM0 OPAMP_INVERTINGINPUT_IO0 +#define OPAMP_INVERTINGINPUT_VM1 OPAMP_INVERTINGINPUT_IO1 + +#define IOPAMP_INVERTINGINPUT_VM0 OPAMP_INVERTINGINPUT_IO0 +#define IOPAMP_INVERTINGINPUT_VM1 OPAMP_INVERTINGINPUT_IO1 + +#define OPAMP_SEC_INVERTINGINPUT_VM0 OPAMP_SEC_INVERTINGINPUT_IO0 +#define OPAMP_SEC_INVERTINGINPUT_VM1 OPAMP_SEC_INVERTINGINPUT_IO1 + +#define OPAMP_INVERTINGINPUT_VINM OPAMP_SEC_INVERTINGINPUT_IO1 + +#define OPAMP_PGACONNECT_NO OPAMP_PGA_CONNECT_INVERTINGINPUT_NO +#define OPAMP_PGACONNECT_VM0 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0 +#define OPAMP_PGACONNECT_VM1 OPAMP_PGA_CONNECT_INVERTINGINPUT_IO1 + +#if defined(STM32L1) || defined(STM32L4) || defined(STM32L5) || defined(STM32H7) || defined(STM32G4) || defined(STM32U5) +#define HAL_OPAMP_MSP_INIT_CB_ID HAL_OPAMP_MSPINIT_CB_ID +#define HAL_OPAMP_MSP_DEINIT_CB_ID HAL_OPAMP_MSPDEINIT_CB_ID +#endif + +#if defined(STM32L4) || defined(STM32L5) +#define OPAMP_POWERMODE_NORMAL OPAMP_POWERMODE_NORMALPOWER +#elif defined(STM32G4) +#define OPAMP_POWERMODE_NORMAL OPAMP_POWERMODE_NORMALSPEED +#endif + +/** + * @} + */ + +/** @defgroup HAL_I2S_Aliased_Defines HAL I2S Aliased Defines maintained for legacy purpose + * @{ + */ +#define I2S_STANDARD_PHILLIPS I2S_STANDARD_PHILIPS + +#if defined(STM32H7) +#define I2S_IT_TXE I2S_IT_TXP +#define I2S_IT_RXNE I2S_IT_RXP + +#define I2S_FLAG_TXE I2S_FLAG_TXP +#define I2S_FLAG_RXNE I2S_FLAG_RXP +#endif + +#if defined(STM32F7) +#define I2S_CLOCK_SYSCLK I2S_CLOCK_PLL +#endif +/** + * @} + */ + +/** @defgroup HAL_PCCARD_Aliased_Defines HAL PCCARD Aliased Defines maintained for legacy purpose + * @{ + */ + +/* Compact Flash-ATA registers description */ +#define CF_DATA ATA_DATA +#define CF_SECTOR_COUNT ATA_SECTOR_COUNT +#define CF_SECTOR_NUMBER ATA_SECTOR_NUMBER +#define CF_CYLINDER_LOW ATA_CYLINDER_LOW +#define CF_CYLINDER_HIGH ATA_CYLINDER_HIGH +#define CF_CARD_HEAD ATA_CARD_HEAD +#define CF_STATUS_CMD ATA_STATUS_CMD +#define CF_STATUS_CMD_ALTERNATE ATA_STATUS_CMD_ALTERNATE +#define CF_COMMON_DATA_AREA ATA_COMMON_DATA_AREA + +/* Compact Flash-ATA commands */ +#define CF_READ_SECTOR_CMD ATA_READ_SECTOR_CMD +#define CF_WRITE_SECTOR_CMD ATA_WRITE_SECTOR_CMD +#define CF_ERASE_SECTOR_CMD ATA_ERASE_SECTOR_CMD +#define CF_IDENTIFY_CMD ATA_IDENTIFY_CMD + +#define PCCARD_StatusTypedef HAL_PCCARD_StatusTypeDef +#define PCCARD_SUCCESS HAL_PCCARD_STATUS_SUCCESS +#define PCCARD_ONGOING HAL_PCCARD_STATUS_ONGOING +#define PCCARD_ERROR HAL_PCCARD_STATUS_ERROR +#define PCCARD_TIMEOUT HAL_PCCARD_STATUS_TIMEOUT +/** + * @} + */ + +/** @defgroup HAL_RTC_Aliased_Defines HAL RTC Aliased Defines maintained for legacy purpose + * @{ + */ + +#define FORMAT_BIN RTC_FORMAT_BIN +#define FORMAT_BCD RTC_FORMAT_BCD + +#define RTC_ALARMSUBSECONDMASK_None RTC_ALARMSUBSECONDMASK_NONE +#define RTC_TAMPERERASEBACKUP_DISABLED RTC_TAMPER_ERASE_BACKUP_DISABLE +#define RTC_TAMPERMASK_FLAG_DISABLED RTC_TAMPERMASK_FLAG_DISABLE +#define RTC_TAMPERMASK_FLAG_ENABLED RTC_TAMPERMASK_FLAG_ENABLE + +#define RTC_MASKTAMPERFLAG_DISABLED RTC_TAMPERMASK_FLAG_DISABLE +#define RTC_MASKTAMPERFLAG_ENABLED RTC_TAMPERMASK_FLAG_ENABLE +#define RTC_TAMPERERASEBACKUP_ENABLED RTC_TAMPER_ERASE_BACKUP_ENABLE +#define RTC_TAMPER1_2_INTERRUPT RTC_ALL_TAMPER_INTERRUPT +#define RTC_TAMPER1_2_3_INTERRUPT RTC_ALL_TAMPER_INTERRUPT + +#define RTC_TIMESTAMPPIN_PC13 RTC_TIMESTAMPPIN_DEFAULT +#define RTC_TIMESTAMPPIN_PA0 RTC_TIMESTAMPPIN_POS1 +#define RTC_TIMESTAMPPIN_PI8 RTC_TIMESTAMPPIN_POS1 +#define RTC_TIMESTAMPPIN_PC1 RTC_TIMESTAMPPIN_POS2 + +#define RTC_OUTPUT_REMAP_PC13 RTC_OUTPUT_REMAP_NONE +#define RTC_OUTPUT_REMAP_PB14 RTC_OUTPUT_REMAP_POS1 +#define RTC_OUTPUT_REMAP_PB2 RTC_OUTPUT_REMAP_POS1 + +#define RTC_TAMPERPIN_PC13 RTC_TAMPERPIN_DEFAULT +#define RTC_TAMPERPIN_PA0 RTC_TAMPERPIN_POS1 +#define RTC_TAMPERPIN_PI8 RTC_TAMPERPIN_POS1 + +#if defined(STM32H5) +#define TAMP_SECRETDEVICE_ERASE_NONE TAMP_DEVICESECRETS_ERASE_NONE +#define TAMP_SECRETDEVICE_ERASE_BKP_SRAM TAMP_DEVICESECRETS_ERASE_BKPSRAM +#endif /* STM32H5 */ + +#if defined(STM32WBA) +#define TAMP_SECRETDEVICE_ERASE_NONE TAMP_DEVICESECRETS_ERASE_NONE +#define TAMP_SECRETDEVICE_ERASE_SRAM2 TAMP_DEVICESECRETS_ERASE_SRAM2 +#define TAMP_SECRETDEVICE_ERASE_RHUK TAMP_DEVICESECRETS_ERASE_RHUK +#define TAMP_SECRETDEVICE_ERASE_ICACHE TAMP_DEVICESECRETS_ERASE_ICACHE +#define TAMP_SECRETDEVICE_ERASE_SAES_AES_HASH TAMP_DEVICESECRETS_ERASE_SAES_AES_HASH +#define TAMP_SECRETDEVICE_ERASE_PKA_SRAM TAMP_DEVICESECRETS_ERASE_PKA_SRAM +#define TAMP_SECRETDEVICE_ERASE_ALL TAMP_DEVICESECRETS_ERASE_ALL +#endif /* STM32WBA */ + +#if defined(STM32H5) || defined(STM32WBA) +#define TAMP_SECRETDEVICE_ERASE_DISABLE TAMP_DEVICESECRETS_ERASE_NONE +#define TAMP_SECRETDEVICE_ERASE_ENABLE TAMP_SECRETDEVICE_ERASE_ALL +#endif /* STM32H5 || STM32WBA */ + +#if defined(STM32F7) +#define RTC_TAMPCR_TAMPXE RTC_TAMPER_ENABLE_BITS_MASK +#define RTC_TAMPCR_TAMPXIE RTC_TAMPER_IT_ENABLE_BITS_MASK +#endif /* STM32F7 */ + +#if defined(STM32H7) +#define RTC_TAMPCR_TAMPXE RTC_TAMPER_X +#define RTC_TAMPCR_TAMPXIE RTC_TAMPER_X_INTERRUPT +#endif /* STM32H7 */ + +#if defined(STM32F7) || defined(STM32H7) || defined(STM32L0) +#define RTC_TAMPER1_INTERRUPT RTC_IT_TAMP1 +#define RTC_TAMPER2_INTERRUPT RTC_IT_TAMP2 +#define RTC_TAMPER3_INTERRUPT RTC_IT_TAMP3 +#define RTC_ALL_TAMPER_INTERRUPT RTC_IT_TAMP +#endif /* STM32F7 || STM32H7 || STM32L0 */ + +/** + * @} + */ + + +/** @defgroup HAL_SMARTCARD_Aliased_Defines HAL SMARTCARD Aliased Defines maintained for legacy purpose + * @{ + */ +#define SMARTCARD_NACK_ENABLED SMARTCARD_NACK_ENABLE +#define SMARTCARD_NACK_DISABLED SMARTCARD_NACK_DISABLE + +#define SMARTCARD_ONEBIT_SAMPLING_DISABLED SMARTCARD_ONE_BIT_SAMPLE_DISABLE +#define SMARTCARD_ONEBIT_SAMPLING_ENABLED SMARTCARD_ONE_BIT_SAMPLE_ENABLE +#define SMARTCARD_ONEBIT_SAMPLING_DISABLE SMARTCARD_ONE_BIT_SAMPLE_DISABLE +#define SMARTCARD_ONEBIT_SAMPLING_ENABLE SMARTCARD_ONE_BIT_SAMPLE_ENABLE + +#define SMARTCARD_TIMEOUT_DISABLED SMARTCARD_TIMEOUT_DISABLE +#define SMARTCARD_TIMEOUT_ENABLED SMARTCARD_TIMEOUT_ENABLE + +#define SMARTCARD_LASTBIT_DISABLED SMARTCARD_LASTBIT_DISABLE +#define SMARTCARD_LASTBIT_ENABLED SMARTCARD_LASTBIT_ENABLE +/** + * @} + */ + + +/** @defgroup HAL_SMBUS_Aliased_Defines HAL SMBUS Aliased Defines maintained for legacy purpose + * @{ + */ +#define SMBUS_DUALADDRESS_DISABLED SMBUS_DUALADDRESS_DISABLE +#define SMBUS_DUALADDRESS_ENABLED SMBUS_DUALADDRESS_ENABLE +#define SMBUS_GENERALCALL_DISABLED SMBUS_GENERALCALL_DISABLE +#define SMBUS_GENERALCALL_ENABLED SMBUS_GENERALCALL_ENABLE +#define SMBUS_NOSTRETCH_DISABLED SMBUS_NOSTRETCH_DISABLE +#define SMBUS_NOSTRETCH_ENABLED SMBUS_NOSTRETCH_ENABLE +#define SMBUS_ANALOGFILTER_ENABLED SMBUS_ANALOGFILTER_ENABLE +#define SMBUS_ANALOGFILTER_DISABLED SMBUS_ANALOGFILTER_DISABLE +#define SMBUS_PEC_DISABLED SMBUS_PEC_DISABLE +#define SMBUS_PEC_ENABLED SMBUS_PEC_ENABLE +#define HAL_SMBUS_STATE_SLAVE_LISTEN HAL_SMBUS_STATE_LISTEN +/** + * @} + */ + +/** @defgroup HAL_SPI_Aliased_Defines HAL SPI Aliased Defines maintained for legacy purpose + * @{ + */ +#define SPI_TIMODE_DISABLED SPI_TIMODE_DISABLE +#define SPI_TIMODE_ENABLED SPI_TIMODE_ENABLE + +#define SPI_CRCCALCULATION_DISABLED SPI_CRCCALCULATION_DISABLE +#define SPI_CRCCALCULATION_ENABLED SPI_CRCCALCULATION_ENABLE + +#define SPI_NSS_PULSE_DISABLED SPI_NSS_PULSE_DISABLE +#define SPI_NSS_PULSE_ENABLED SPI_NSS_PULSE_ENABLE + +#if defined(STM32H7) + +#define SPI_FLAG_TXE SPI_FLAG_TXP +#define SPI_FLAG_RXNE SPI_FLAG_RXP + +#define SPI_IT_TXE SPI_IT_TXP +#define SPI_IT_RXNE SPI_IT_RXP + +#define SPI_FRLVL_EMPTY SPI_RX_FIFO_0PACKET +#define SPI_FRLVL_QUARTER_FULL SPI_RX_FIFO_1PACKET +#define SPI_FRLVL_HALF_FULL SPI_RX_FIFO_2PACKET +#define SPI_FRLVL_FULL SPI_RX_FIFO_3PACKET + +#endif /* STM32H7 */ + +/** + * @} + */ + +/** @defgroup HAL_TIM_Aliased_Defines HAL TIM Aliased Defines maintained for legacy purpose + * @{ + */ +#define CCER_CCxE_MASK TIM_CCER_CCxE_MASK +#define CCER_CCxNE_MASK TIM_CCER_CCxNE_MASK + +#define TIM_DMABase_CR1 TIM_DMABASE_CR1 +#define TIM_DMABase_CR2 TIM_DMABASE_CR2 +#define TIM_DMABase_SMCR TIM_DMABASE_SMCR +#define TIM_DMABase_DIER TIM_DMABASE_DIER +#define TIM_DMABase_SR TIM_DMABASE_SR +#define TIM_DMABase_EGR TIM_DMABASE_EGR +#define TIM_DMABase_CCMR1 TIM_DMABASE_CCMR1 +#define TIM_DMABase_CCMR2 TIM_DMABASE_CCMR2 +#define TIM_DMABase_CCER TIM_DMABASE_CCER +#define TIM_DMABase_CNT TIM_DMABASE_CNT +#define TIM_DMABase_PSC TIM_DMABASE_PSC +#define TIM_DMABase_ARR TIM_DMABASE_ARR +#define TIM_DMABase_RCR TIM_DMABASE_RCR +#define TIM_DMABase_CCR1 TIM_DMABASE_CCR1 +#define TIM_DMABase_CCR2 TIM_DMABASE_CCR2 +#define TIM_DMABase_CCR3 TIM_DMABASE_CCR3 +#define TIM_DMABase_CCR4 TIM_DMABASE_CCR4 +#define TIM_DMABase_BDTR TIM_DMABASE_BDTR +#define TIM_DMABase_DCR TIM_DMABASE_DCR +#define TIM_DMABase_DMAR TIM_DMABASE_DMAR +#define TIM_DMABase_OR1 TIM_DMABASE_OR1 +#define TIM_DMABase_CCMR3 TIM_DMABASE_CCMR3 +#define TIM_DMABase_CCR5 TIM_DMABASE_CCR5 +#define TIM_DMABase_CCR6 TIM_DMABASE_CCR6 +#define TIM_DMABase_OR2 TIM_DMABASE_OR2 +#define TIM_DMABase_OR3 TIM_DMABASE_OR3 +#define TIM_DMABase_OR TIM_DMABASE_OR + +#define TIM_EventSource_Update TIM_EVENTSOURCE_UPDATE +#define TIM_EventSource_CC1 TIM_EVENTSOURCE_CC1 +#define TIM_EventSource_CC2 TIM_EVENTSOURCE_CC2 +#define TIM_EventSource_CC3 TIM_EVENTSOURCE_CC3 +#define TIM_EventSource_CC4 TIM_EVENTSOURCE_CC4 +#define TIM_EventSource_COM TIM_EVENTSOURCE_COM +#define TIM_EventSource_Trigger TIM_EVENTSOURCE_TRIGGER +#define TIM_EventSource_Break TIM_EVENTSOURCE_BREAK +#define TIM_EventSource_Break2 TIM_EVENTSOURCE_BREAK2 + +#define TIM_DMABurstLength_1Transfer TIM_DMABURSTLENGTH_1TRANSFER +#define TIM_DMABurstLength_2Transfers TIM_DMABURSTLENGTH_2TRANSFERS +#define TIM_DMABurstLength_3Transfers TIM_DMABURSTLENGTH_3TRANSFERS +#define TIM_DMABurstLength_4Transfers TIM_DMABURSTLENGTH_4TRANSFERS +#define TIM_DMABurstLength_5Transfers TIM_DMABURSTLENGTH_5TRANSFERS +#define TIM_DMABurstLength_6Transfers TIM_DMABURSTLENGTH_6TRANSFERS +#define TIM_DMABurstLength_7Transfers TIM_DMABURSTLENGTH_7TRANSFERS +#define TIM_DMABurstLength_8Transfers TIM_DMABURSTLENGTH_8TRANSFERS +#define TIM_DMABurstLength_9Transfers TIM_DMABURSTLENGTH_9TRANSFERS +#define TIM_DMABurstLength_10Transfers TIM_DMABURSTLENGTH_10TRANSFERS +#define TIM_DMABurstLength_11Transfers TIM_DMABURSTLENGTH_11TRANSFERS +#define TIM_DMABurstLength_12Transfers TIM_DMABURSTLENGTH_12TRANSFERS +#define TIM_DMABurstLength_13Transfers TIM_DMABURSTLENGTH_13TRANSFERS +#define TIM_DMABurstLength_14Transfers TIM_DMABURSTLENGTH_14TRANSFERS +#define TIM_DMABurstLength_15Transfers TIM_DMABURSTLENGTH_15TRANSFERS +#define TIM_DMABurstLength_16Transfers TIM_DMABURSTLENGTH_16TRANSFERS +#define TIM_DMABurstLength_17Transfers TIM_DMABURSTLENGTH_17TRANSFERS +#define TIM_DMABurstLength_18Transfers TIM_DMABURSTLENGTH_18TRANSFERS + +#if defined(STM32L0) +#define TIM22_TI1_GPIO1 TIM22_TI1_GPIO +#define TIM22_TI1_GPIO2 TIM22_TI1_GPIO +#endif + +#if defined(STM32F3) +#define IS_TIM_HALL_INTERFACE_INSTANCE IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE +#endif + +#if defined(STM32H7) +#define TIM_TIM1_ETR_COMP1_OUT TIM_TIM1_ETR_COMP1 +#define TIM_TIM1_ETR_COMP2_OUT TIM_TIM1_ETR_COMP2 +#define TIM_TIM8_ETR_COMP1_OUT TIM_TIM8_ETR_COMP1 +#define TIM_TIM8_ETR_COMP2_OUT TIM_TIM8_ETR_COMP2 +#define TIM_TIM2_ETR_COMP1_OUT TIM_TIM2_ETR_COMP1 +#define TIM_TIM2_ETR_COMP2_OUT TIM_TIM2_ETR_COMP2 +#define TIM_TIM3_ETR_COMP1_OUT TIM_TIM3_ETR_COMP1 +#define TIM_TIM1_TI1_COMP1_OUT TIM_TIM1_TI1_COMP1 +#define TIM_TIM8_TI1_COMP2_OUT TIM_TIM8_TI1_COMP2 +#define TIM_TIM2_TI4_COMP1_OUT TIM_TIM2_TI4_COMP1 +#define TIM_TIM2_TI4_COMP2_OUT TIM_TIM2_TI4_COMP2 +#define TIM_TIM2_TI4_COMP1COMP2_OUT TIM_TIM2_TI4_COMP1_COMP2 +#define TIM_TIM3_TI1_COMP1_OUT TIM_TIM3_TI1_COMP1 +#define TIM_TIM3_TI1_COMP2_OUT TIM_TIM3_TI1_COMP2 +#define TIM_TIM3_TI1_COMP1COMP2_OUT TIM_TIM3_TI1_COMP1_COMP2 +#endif + +#if defined(STM32U5) +#define OCREF_CLEAR_SELECT_Pos OCREF_CLEAR_SELECT_POS +#define OCREF_CLEAR_SELECT_Msk OCREF_CLEAR_SELECT_MSK +#endif +/** + * @} + */ + +/** @defgroup HAL_TSC_Aliased_Defines HAL TSC Aliased Defines maintained for legacy purpose + * @{ + */ +#define TSC_SYNC_POL_FALL TSC_SYNC_POLARITY_FALLING +#define TSC_SYNC_POL_RISE_HIGH TSC_SYNC_POLARITY_RISING +/** + * @} + */ + +/** @defgroup HAL_UART_Aliased_Defines HAL UART Aliased Defines maintained for legacy purpose + * @{ + */ +#define UART_ONEBIT_SAMPLING_DISABLED UART_ONE_BIT_SAMPLE_DISABLE +#define UART_ONEBIT_SAMPLING_ENABLED UART_ONE_BIT_SAMPLE_ENABLE +#define UART_ONE_BIT_SAMPLE_DISABLED UART_ONE_BIT_SAMPLE_DISABLE +#define UART_ONE_BIT_SAMPLE_ENABLED UART_ONE_BIT_SAMPLE_ENABLE + +#define __HAL_UART_ONEBIT_ENABLE __HAL_UART_ONE_BIT_SAMPLE_ENABLE +#define __HAL_UART_ONEBIT_DISABLE __HAL_UART_ONE_BIT_SAMPLE_DISABLE + +#define __DIV_SAMPLING16 UART_DIV_SAMPLING16 +#define __DIVMANT_SAMPLING16 UART_DIVMANT_SAMPLING16 +#define __DIVFRAQ_SAMPLING16 UART_DIVFRAQ_SAMPLING16 +#define __UART_BRR_SAMPLING16 UART_BRR_SAMPLING16 + +#define __DIV_SAMPLING8 UART_DIV_SAMPLING8 +#define __DIVMANT_SAMPLING8 UART_DIVMANT_SAMPLING8 +#define __DIVFRAQ_SAMPLING8 UART_DIVFRAQ_SAMPLING8 +#define __UART_BRR_SAMPLING8 UART_BRR_SAMPLING8 + +#define __DIV_LPUART UART_DIV_LPUART + +#define UART_WAKEUPMETHODE_IDLELINE UART_WAKEUPMETHOD_IDLELINE +#define UART_WAKEUPMETHODE_ADDRESSMARK UART_WAKEUPMETHOD_ADDRESSMARK + +/** + * @} + */ + + +/** @defgroup HAL_USART_Aliased_Defines HAL USART Aliased Defines maintained for legacy purpose + * @{ + */ + +#define USART_CLOCK_DISABLED USART_CLOCK_DISABLE +#define USART_CLOCK_ENABLED USART_CLOCK_ENABLE + +#define USARTNACK_ENABLED USART_NACK_ENABLE +#define USARTNACK_DISABLED USART_NACK_DISABLE +/** + * @} + */ + +/** @defgroup HAL_WWDG_Aliased_Defines HAL WWDG Aliased Defines maintained for legacy purpose + * @{ + */ +#define CFR_BASE WWDG_CFR_BASE + +/** + * @} + */ + +/** @defgroup HAL_CAN_Aliased_Defines HAL CAN Aliased Defines maintained for legacy purpose + * @{ + */ +#define CAN_FilterFIFO0 CAN_FILTER_FIFO0 +#define CAN_FilterFIFO1 CAN_FILTER_FIFO1 +#define CAN_IT_RQCP0 CAN_IT_TME +#define CAN_IT_RQCP1 CAN_IT_TME +#define CAN_IT_RQCP2 CAN_IT_TME +#define INAK_TIMEOUT CAN_TIMEOUT_VALUE +#define SLAK_TIMEOUT CAN_TIMEOUT_VALUE +#define CAN_TXSTATUS_FAILED ((uint8_t)0x00U) +#define CAN_TXSTATUS_OK ((uint8_t)0x01U) +#define CAN_TXSTATUS_PENDING ((uint8_t)0x02U) + +/** + * @} + */ + +/** @defgroup HAL_ETH_Aliased_Defines HAL ETH Aliased Defines maintained for legacy purpose + * @{ + */ + +#define VLAN_TAG ETH_VLAN_TAG +#define MIN_ETH_PAYLOAD ETH_MIN_ETH_PAYLOAD +#define MAX_ETH_PAYLOAD ETH_MAX_ETH_PAYLOAD +#define JUMBO_FRAME_PAYLOAD ETH_JUMBO_FRAME_PAYLOAD +#define MACMIIAR_CR_MASK ETH_MACMIIAR_CR_MASK +#define MACCR_CLEAR_MASK ETH_MACCR_CLEAR_MASK +#define MACFCR_CLEAR_MASK ETH_MACFCR_CLEAR_MASK +#define DMAOMR_CLEAR_MASK ETH_DMAOMR_CLEAR_MASK + +#define ETH_MMCCR 0x00000100U +#define ETH_MMCRIR 0x00000104U +#define ETH_MMCTIR 0x00000108U +#define ETH_MMCRIMR 0x0000010CU +#define ETH_MMCTIMR 0x00000110U +#define ETH_MMCTGFSCCR 0x0000014CU +#define ETH_MMCTGFMSCCR 0x00000150U +#define ETH_MMCTGFCR 0x00000168U +#define ETH_MMCRFCECR 0x00000194U +#define ETH_MMCRFAECR 0x00000198U +#define ETH_MMCRGUFCR 0x000001C4U + +#define ETH_MAC_TXFIFO_FULL 0x02000000U /* Tx FIFO full */ +#define ETH_MAC_TXFIFONOT_EMPTY 0x01000000U /* Tx FIFO not empty */ +#define ETH_MAC_TXFIFO_WRITE_ACTIVE 0x00400000U /* Tx FIFO write active */ +#define ETH_MAC_TXFIFO_IDLE 0x00000000U /* Tx FIFO read status: Idle */ +#define ETH_MAC_TXFIFO_READ 0x00100000U /* Tx FIFO read status: Read (transferring data to + the MAC transmitter) */ +#define ETH_MAC_TXFIFO_WAITING 0x00200000U /* Tx FIFO read status: Waiting for TxStatus from + MAC transmitter */ +#define ETH_MAC_TXFIFO_WRITING 0x00300000U /* Tx FIFO read status: Writing the received TxStatus + or flushing the TxFIFO */ +#define ETH_MAC_TRANSMISSION_PAUSE 0x00080000U /* MAC transmitter in pause */ +#define ETH_MAC_TRANSMITFRAMECONTROLLER_IDLE 0x00000000U /* MAC transmit frame controller: Idle */ +#define ETH_MAC_TRANSMITFRAMECONTROLLER_WAITING 0x00020000U /* MAC transmit frame controller: Waiting for Status + of previous frame or IFG/backoff period to be over */ +#define ETH_MAC_TRANSMITFRAMECONTROLLER_GENRATING_PCF 0x00040000U /* MAC transmit frame controller: Generating and + transmitting a Pause control frame (in full duplex mode) */ +#define ETH_MAC_TRANSMITFRAMECONTROLLER_TRANSFERRING 0x00060000U /* MAC transmit frame controller: Transferring input + frame for transmission */ +#define ETH_MAC_MII_TRANSMIT_ACTIVE 0x00010000U /* MAC MII transmit engine active */ +#define ETH_MAC_RXFIFO_EMPTY 0x00000000U /* Rx FIFO fill level: empty */ +#define ETH_MAC_RXFIFO_BELOW_THRESHOLD 0x00000100U /* Rx FIFO fill level: fill-level below flow-control + de-activate threshold */ +#define ETH_MAC_RXFIFO_ABOVE_THRESHOLD 0x00000200U /* Rx FIFO fill level: fill-level above flow-control + activate threshold */ +#define ETH_MAC_RXFIFO_FULL 0x00000300U /* Rx FIFO fill level: full */ +#if defined(STM32F1) +#else +#define ETH_MAC_READCONTROLLER_IDLE 0x00000000U /* Rx FIFO read controller IDLE state */ +#define ETH_MAC_READCONTROLLER_READING_DATA 0x00000020U /* Rx FIFO read controller Reading frame data */ +#define ETH_MAC_READCONTROLLER_READING_STATUS 0x00000040U /* Rx FIFO read controller Reading frame status + (or time-stamp) */ +#endif +#define ETH_MAC_READCONTROLLER_FLUSHING 0x00000060U /* Rx FIFO read controller Flushing the frame data and + status */ +#define ETH_MAC_RXFIFO_WRITE_ACTIVE 0x00000010U /* Rx FIFO write controller active */ +#define ETH_MAC_SMALL_FIFO_NOTACTIVE 0x00000000U /* MAC small FIFO read / write controllers not active */ +#define ETH_MAC_SMALL_FIFO_READ_ACTIVE 0x00000002U /* MAC small FIFO read controller active */ +#define ETH_MAC_SMALL_FIFO_WRITE_ACTIVE 0x00000004U /* MAC small FIFO write controller active */ +#define ETH_MAC_SMALL_FIFO_RW_ACTIVE 0x00000006U /* MAC small FIFO read / write controllers active */ +#define ETH_MAC_MII_RECEIVE_PROTOCOL_ACTIVE 0x00000001U /* MAC MII receive protocol engine active */ + +/** + * @} + */ + +/** @defgroup HAL_DCMI_Aliased_Defines HAL DCMI Aliased Defines maintained for legacy purpose + * @{ + */ +#define HAL_DCMI_ERROR_OVF HAL_DCMI_ERROR_OVR +#define DCMI_IT_OVF DCMI_IT_OVR +#define DCMI_FLAG_OVFRI DCMI_FLAG_OVRRI +#define DCMI_FLAG_OVFMI DCMI_FLAG_OVRMI + +#define HAL_DCMI_ConfigCROP HAL_DCMI_ConfigCrop +#define HAL_DCMI_EnableCROP HAL_DCMI_EnableCrop +#define HAL_DCMI_DisableCROP HAL_DCMI_DisableCrop + +/** + * @} + */ + +#if defined(STM32L4) || defined(STM32F7) || defined(STM32F427xx) || defined(STM32F437xx) \ + || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx) \ + || defined(STM32H7) +/** @defgroup HAL_DMA2D_Aliased_Defines HAL DMA2D Aliased Defines maintained for legacy purpose + * @{ + */ +#define DMA2D_ARGB8888 DMA2D_OUTPUT_ARGB8888 +#define DMA2D_RGB888 DMA2D_OUTPUT_RGB888 +#define DMA2D_RGB565 DMA2D_OUTPUT_RGB565 +#define DMA2D_ARGB1555 DMA2D_OUTPUT_ARGB1555 +#define DMA2D_ARGB4444 DMA2D_OUTPUT_ARGB4444 + +#define CM_ARGB8888 DMA2D_INPUT_ARGB8888 +#define CM_RGB888 DMA2D_INPUT_RGB888 +#define CM_RGB565 DMA2D_INPUT_RGB565 +#define CM_ARGB1555 DMA2D_INPUT_ARGB1555 +#define CM_ARGB4444 DMA2D_INPUT_ARGB4444 +#define CM_L8 DMA2D_INPUT_L8 +#define CM_AL44 DMA2D_INPUT_AL44 +#define CM_AL88 DMA2D_INPUT_AL88 +#define CM_L4 DMA2D_INPUT_L4 +#define CM_A8 DMA2D_INPUT_A8 +#define CM_A4 DMA2D_INPUT_A4 +/** + * @} + */ +#endif /* STM32L4 || STM32F7 || STM32F4 || STM32H7 */ + +#if defined(STM32L4) || defined(STM32F7) || defined(STM32F427xx) || defined(STM32F437xx) \ + || defined(STM32F429xx) || defined(STM32F439xx) || defined(STM32F469xx) || defined(STM32F479xx) \ + || defined(STM32H7) || defined(STM32U5) +/** @defgroup DMA2D_Aliases DMA2D API Aliases + * @{ + */ +#define HAL_DMA2D_DisableCLUT HAL_DMA2D_CLUTLoading_Abort /*!< Aliased to HAL_DMA2D_CLUTLoading_Abort + for compatibility with legacy code */ +/** + * @} + */ + +#endif /* STM32L4 || STM32F7 || STM32F4 || STM32H7 || STM32U5 */ + +/** @defgroup HAL_PPP_Aliased_Defines HAL PPP Aliased Defines maintained for legacy purpose + * @{ + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup HAL_CRYP_Aliased_Functions HAL CRYP Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_CRYP_ComputationCpltCallback HAL_CRYPEx_ComputationCpltCallback +/** + * @} + */ + +/** @defgroup HAL_DCACHE_Aliased_Functions HAL DCACHE Aliased Functions maintained for legacy purpose + * @{ + */ + +#if defined(STM32U5) +#define HAL_DCACHE_CleanInvalidateByAddr HAL_DCACHE_CleanInvalidByAddr +#define HAL_DCACHE_CleanInvalidateByAddr_IT HAL_DCACHE_CleanInvalidByAddr_IT +#endif /* STM32U5 */ + +/** + * @} + */ + +#if !defined(STM32F2) +/** @defgroup HASH_alias HASH API alias + * @{ + */ +#define HAL_HASHEx_IRQHandler HAL_HASH_IRQHandler /*!< Redirection for compatibility with legacy code */ +/** + * + * @} + */ +#endif /* STM32F2 */ +/** @defgroup HAL_HASH_Aliased_Functions HAL HASH Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_HASH_STATETypeDef HAL_HASH_StateTypeDef +#define HAL_HASHPhaseTypeDef HAL_HASH_PhaseTypeDef +#define HAL_HMAC_MD5_Finish HAL_HASH_MD5_Finish +#define HAL_HMAC_SHA1_Finish HAL_HASH_SHA1_Finish +#define HAL_HMAC_SHA224_Finish HAL_HASH_SHA224_Finish +#define HAL_HMAC_SHA256_Finish HAL_HASH_SHA256_Finish + +/*HASH Algorithm Selection*/ + +#define HASH_AlgoSelection_SHA1 HASH_ALGOSELECTION_SHA1 +#define HASH_AlgoSelection_SHA224 HASH_ALGOSELECTION_SHA224 +#define HASH_AlgoSelection_SHA256 HASH_ALGOSELECTION_SHA256 +#define HASH_AlgoSelection_MD5 HASH_ALGOSELECTION_MD5 + +#define HASH_AlgoMode_HASH HASH_ALGOMODE_HASH +#define HASH_AlgoMode_HMAC HASH_ALGOMODE_HMAC + +#define HASH_HMACKeyType_ShortKey HASH_HMAC_KEYTYPE_SHORTKEY +#define HASH_HMACKeyType_LongKey HASH_HMAC_KEYTYPE_LONGKEY + +#if defined(STM32L4) || defined(STM32L5) || defined(STM32F2) || defined(STM32F4) || defined(STM32F7) || defined(STM32H7) + +#define HAL_HASH_MD5_Accumulate HAL_HASH_MD5_Accmlt +#define HAL_HASH_MD5_Accumulate_End HAL_HASH_MD5_Accmlt_End +#define HAL_HASH_MD5_Accumulate_IT HAL_HASH_MD5_Accmlt_IT +#define HAL_HASH_MD5_Accumulate_End_IT HAL_HASH_MD5_Accmlt_End_IT + +#define HAL_HASH_SHA1_Accumulate HAL_HASH_SHA1_Accmlt +#define HAL_HASH_SHA1_Accumulate_End HAL_HASH_SHA1_Accmlt_End +#define HAL_HASH_SHA1_Accumulate_IT HAL_HASH_SHA1_Accmlt_IT +#define HAL_HASH_SHA1_Accumulate_End_IT HAL_HASH_SHA1_Accmlt_End_IT + +#define HAL_HASHEx_SHA224_Accumulate HAL_HASHEx_SHA224_Accmlt +#define HAL_HASHEx_SHA224_Accumulate_End HAL_HASHEx_SHA224_Accmlt_End +#define HAL_HASHEx_SHA224_Accumulate_IT HAL_HASHEx_SHA224_Accmlt_IT +#define HAL_HASHEx_SHA224_Accumulate_End_IT HAL_HASHEx_SHA224_Accmlt_End_IT + +#define HAL_HASHEx_SHA256_Accumulate HAL_HASHEx_SHA256_Accmlt +#define HAL_HASHEx_SHA256_Accumulate_End HAL_HASHEx_SHA256_Accmlt_End +#define HAL_HASHEx_SHA256_Accumulate_IT HAL_HASHEx_SHA256_Accmlt_IT +#define HAL_HASHEx_SHA256_Accumulate_End_IT HAL_HASHEx_SHA256_Accmlt_End_IT + +#endif /* STM32L4 || STM32L5 || STM32F2 || STM32F4 || STM32F7 || STM32H7 */ +/** + * @} + */ + +/** @defgroup HAL_Aliased_Functions HAL Generic Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_EnableDBGSleepMode HAL_DBGMCU_EnableDBGSleepMode +#define HAL_DisableDBGSleepMode HAL_DBGMCU_DisableDBGSleepMode +#define HAL_EnableDBGStopMode HAL_DBGMCU_EnableDBGStopMode +#define HAL_DisableDBGStopMode HAL_DBGMCU_DisableDBGStopMode +#define HAL_EnableDBGStandbyMode HAL_DBGMCU_EnableDBGStandbyMode +#define HAL_DisableDBGStandbyMode HAL_DBGMCU_DisableDBGStandbyMode +#define HAL_DBG_LowPowerConfig(Periph, cmd) (((cmd\ + )==ENABLE)? HAL_DBGMCU_DBG_EnableLowPowerConfig(Periph) : \ + HAL_DBGMCU_DBG_DisableLowPowerConfig(Periph)) +#define HAL_VREFINT_OutputSelect HAL_SYSCFG_VREFINT_OutputSelect +#define HAL_Lock_Cmd(cmd) (((cmd)==ENABLE) ? HAL_SYSCFG_Enable_Lock_VREFINT() : HAL_SYSCFG_Disable_Lock_VREFINT()) +#if defined(STM32L0) +#else +#define HAL_VREFINT_Cmd(cmd) (((cmd)==ENABLE)? HAL_SYSCFG_EnableVREFINT() : HAL_SYSCFG_DisableVREFINT()) +#endif +#define HAL_ADC_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? HAL_ADCEx_EnableVREFINT() : HAL_ADCEx_DisableVREFINT()) +#define HAL_ADC_EnableBufferSensor_Cmd(cmd) (((cmd\ + )==ENABLE) ? HAL_ADCEx_EnableVREFINTTempSensor() : \ + HAL_ADCEx_DisableVREFINTTempSensor()) +#if defined(STM32H7A3xx) || defined(STM32H7B3xx) || defined(STM32H7B0xx) || defined(STM32H7A3xxQ) || \ + defined(STM32H7B3xxQ) || defined(STM32H7B0xxQ) +#define HAL_EnableSRDomainDBGStopMode HAL_EnableDomain3DBGStopMode +#define HAL_DisableSRDomainDBGStopMode HAL_DisableDomain3DBGStopMode +#define HAL_EnableSRDomainDBGStandbyMode HAL_EnableDomain3DBGStandbyMode +#define HAL_DisableSRDomainDBGStandbyMode HAL_DisableDomain3DBGStandbyMode +#endif /* STM32H7A3xx || STM32H7B3xx || STM32H7B0xx || STM32H7A3xxQ || STM32H7B3xxQ || STM32H7B0xxQ */ + +/** + * @} + */ + +/** @defgroup HAL_FLASH_Aliased_Functions HAL FLASH Aliased Functions maintained for legacy purpose + * @{ + */ +#define FLASH_HalfPageProgram HAL_FLASHEx_HalfPageProgram +#define FLASH_EnableRunPowerDown HAL_FLASHEx_EnableRunPowerDown +#define FLASH_DisableRunPowerDown HAL_FLASHEx_DisableRunPowerDown +#define HAL_DATA_EEPROMEx_Unlock HAL_FLASHEx_DATAEEPROM_Unlock +#define HAL_DATA_EEPROMEx_Lock HAL_FLASHEx_DATAEEPROM_Lock +#define HAL_DATA_EEPROMEx_Erase HAL_FLASHEx_DATAEEPROM_Erase +#define HAL_DATA_EEPROMEx_Program HAL_FLASHEx_DATAEEPROM_Program + +/** + * @} + */ + +/** @defgroup HAL_I2C_Aliased_Functions HAL I2C Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_I2CEx_AnalogFilter_Config HAL_I2CEx_ConfigAnalogFilter +#define HAL_I2CEx_DigitalFilter_Config HAL_I2CEx_ConfigDigitalFilter +#define HAL_FMPI2CEx_AnalogFilter_Config HAL_FMPI2CEx_ConfigAnalogFilter +#define HAL_FMPI2CEx_DigitalFilter_Config HAL_FMPI2CEx_ConfigDigitalFilter + +#define HAL_I2CFastModePlusConfig(SYSCFG_I2CFastModePlus, cmd) ((cmd == ENABLE)? \ + HAL_I2CEx_EnableFastModePlus(SYSCFG_I2CFastModePlus): \ + HAL_I2CEx_DisableFastModePlus(SYSCFG_I2CFastModePlus)) + +#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F0) || defined(STM32F1) || \ + defined(STM32F2) || defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || \ + defined(STM32L4) || defined(STM32L5) || defined(STM32G4) || defined(STM32L1) +#define HAL_I2C_Master_Sequential_Transmit_IT HAL_I2C_Master_Seq_Transmit_IT +#define HAL_I2C_Master_Sequential_Receive_IT HAL_I2C_Master_Seq_Receive_IT +#define HAL_I2C_Slave_Sequential_Transmit_IT HAL_I2C_Slave_Seq_Transmit_IT +#define HAL_I2C_Slave_Sequential_Receive_IT HAL_I2C_Slave_Seq_Receive_IT +#endif /* STM32H7 || STM32WB || STM32G0 || STM32F0 || STM32F1 || STM32F2 || STM32F3 || STM32F4 || STM32F7 || STM32L0 || + STM32L4 || STM32L5 || STM32G4 || STM32L1 */ +#if defined(STM32H7) || defined(STM32WB) || defined(STM32G0) || defined(STM32F4) || defined(STM32F7) || \ + defined(STM32L0) || defined(STM32L4) || defined(STM32L5) || defined(STM32G4)|| defined(STM32L1) +#define HAL_I2C_Master_Sequential_Transmit_DMA HAL_I2C_Master_Seq_Transmit_DMA +#define HAL_I2C_Master_Sequential_Receive_DMA HAL_I2C_Master_Seq_Receive_DMA +#define HAL_I2C_Slave_Sequential_Transmit_DMA HAL_I2C_Slave_Seq_Transmit_DMA +#define HAL_I2C_Slave_Sequential_Receive_DMA HAL_I2C_Slave_Seq_Receive_DMA +#endif /* STM32H7 || STM32WB || STM32G0 || STM32F4 || STM32F7 || STM32L0 || STM32L4 || STM32L5 || STM32G4 || STM32L1 */ + +#if defined(STM32F4) +#define HAL_FMPI2C_Master_Sequential_Transmit_IT HAL_FMPI2C_Master_Seq_Transmit_IT +#define HAL_FMPI2C_Master_Sequential_Receive_IT HAL_FMPI2C_Master_Seq_Receive_IT +#define HAL_FMPI2C_Slave_Sequential_Transmit_IT HAL_FMPI2C_Slave_Seq_Transmit_IT +#define HAL_FMPI2C_Slave_Sequential_Receive_IT HAL_FMPI2C_Slave_Seq_Receive_IT +#define HAL_FMPI2C_Master_Sequential_Transmit_DMA HAL_FMPI2C_Master_Seq_Transmit_DMA +#define HAL_FMPI2C_Master_Sequential_Receive_DMA HAL_FMPI2C_Master_Seq_Receive_DMA +#define HAL_FMPI2C_Slave_Sequential_Transmit_DMA HAL_FMPI2C_Slave_Seq_Transmit_DMA +#define HAL_FMPI2C_Slave_Sequential_Receive_DMA HAL_FMPI2C_Slave_Seq_Receive_DMA +#endif /* STM32F4 */ +/** + * @} + */ + +/** @defgroup HAL_PWR_Aliased HAL PWR Aliased maintained for legacy purpose + * @{ + */ + +#if defined(STM32G0) +#define HAL_PWR_ConfigPVD HAL_PWREx_ConfigPVD +#define HAL_PWR_EnablePVD HAL_PWREx_EnablePVD +#define HAL_PWR_DisablePVD HAL_PWREx_DisablePVD +#define HAL_PWR_PVD_IRQHandler HAL_PWREx_PVD_IRQHandler +#endif +#define HAL_PWR_PVDConfig HAL_PWR_ConfigPVD +#define HAL_PWR_DisableBkUpReg HAL_PWREx_DisableBkUpReg +#define HAL_PWR_DisableFlashPowerDown HAL_PWREx_DisableFlashPowerDown +#define HAL_PWR_DisableVddio2Monitor HAL_PWREx_DisableVddio2Monitor +#define HAL_PWR_EnableBkUpReg HAL_PWREx_EnableBkUpReg +#define HAL_PWR_EnableFlashPowerDown HAL_PWREx_EnableFlashPowerDown +#define HAL_PWR_EnableVddio2Monitor HAL_PWREx_EnableVddio2Monitor +#define HAL_PWR_PVD_PVM_IRQHandler HAL_PWREx_PVD_PVM_IRQHandler +#define HAL_PWR_PVDLevelConfig HAL_PWR_ConfigPVD +#define HAL_PWR_Vddio2Monitor_IRQHandler HAL_PWREx_Vddio2Monitor_IRQHandler +#define HAL_PWR_Vddio2MonitorCallback HAL_PWREx_Vddio2MonitorCallback +#define HAL_PWREx_ActivateOverDrive HAL_PWREx_EnableOverDrive +#define HAL_PWREx_DeactivateOverDrive HAL_PWREx_DisableOverDrive +#define HAL_PWREx_DisableSDADCAnalog HAL_PWREx_DisableSDADC +#define HAL_PWREx_EnableSDADCAnalog HAL_PWREx_EnableSDADC +#define HAL_PWREx_PVMConfig HAL_PWREx_ConfigPVM + +#define PWR_MODE_NORMAL PWR_PVD_MODE_NORMAL +#define PWR_MODE_IT_RISING PWR_PVD_MODE_IT_RISING +#define PWR_MODE_IT_FALLING PWR_PVD_MODE_IT_FALLING +#define PWR_MODE_IT_RISING_FALLING PWR_PVD_MODE_IT_RISING_FALLING +#define PWR_MODE_EVENT_RISING PWR_PVD_MODE_EVENT_RISING +#define PWR_MODE_EVENT_FALLING PWR_PVD_MODE_EVENT_FALLING +#define PWR_MODE_EVENT_RISING_FALLING PWR_PVD_MODE_EVENT_RISING_FALLING + +#define CR_OFFSET_BB PWR_CR_OFFSET_BB +#define CSR_OFFSET_BB PWR_CSR_OFFSET_BB +#define PMODE_BIT_NUMBER VOS_BIT_NUMBER +#define CR_PMODE_BB CR_VOS_BB + +#define DBP_BitNumber DBP_BIT_NUMBER +#define PVDE_BitNumber PVDE_BIT_NUMBER +#define PMODE_BitNumber PMODE_BIT_NUMBER +#define EWUP_BitNumber EWUP_BIT_NUMBER +#define FPDS_BitNumber FPDS_BIT_NUMBER +#define ODEN_BitNumber ODEN_BIT_NUMBER +#define ODSWEN_BitNumber ODSWEN_BIT_NUMBER +#define MRLVDS_BitNumber MRLVDS_BIT_NUMBER +#define LPLVDS_BitNumber LPLVDS_BIT_NUMBER +#define BRE_BitNumber BRE_BIT_NUMBER + +#define PWR_MODE_EVT PWR_PVD_MODE_NORMAL + +#if defined (STM32U5) +#define PWR_SRAM1_PAGE1_STOP_RETENTION PWR_SRAM1_PAGE1_STOP +#define PWR_SRAM1_PAGE2_STOP_RETENTION PWR_SRAM1_PAGE2_STOP +#define PWR_SRAM1_PAGE3_STOP_RETENTION PWR_SRAM1_PAGE3_STOP +#define PWR_SRAM1_PAGE4_STOP_RETENTION PWR_SRAM1_PAGE4_STOP +#define PWR_SRAM1_PAGE5_STOP_RETENTION PWR_SRAM1_PAGE5_STOP +#define PWR_SRAM1_PAGE6_STOP_RETENTION PWR_SRAM1_PAGE6_STOP +#define PWR_SRAM1_PAGE7_STOP_RETENTION PWR_SRAM1_PAGE7_STOP +#define PWR_SRAM1_PAGE8_STOP_RETENTION PWR_SRAM1_PAGE8_STOP +#define PWR_SRAM1_PAGE9_STOP_RETENTION PWR_SRAM1_PAGE9_STOP +#define PWR_SRAM1_PAGE10_STOP_RETENTION PWR_SRAM1_PAGE10_STOP +#define PWR_SRAM1_PAGE11_STOP_RETENTION PWR_SRAM1_PAGE11_STOP +#define PWR_SRAM1_PAGE12_STOP_RETENTION PWR_SRAM1_PAGE12_STOP +#define PWR_SRAM1_FULL_STOP_RETENTION PWR_SRAM1_FULL_STOP + +#define PWR_SRAM2_PAGE1_STOP_RETENTION PWR_SRAM2_PAGE1_STOP +#define PWR_SRAM2_PAGE2_STOP_RETENTION PWR_SRAM2_PAGE2_STOP +#define PWR_SRAM2_FULL_STOP_RETENTION PWR_SRAM2_FULL_STOP + +#define PWR_SRAM3_PAGE1_STOP_RETENTION PWR_SRAM3_PAGE1_STOP +#define PWR_SRAM3_PAGE2_STOP_RETENTION PWR_SRAM3_PAGE2_STOP +#define PWR_SRAM3_PAGE3_STOP_RETENTION PWR_SRAM3_PAGE3_STOP +#define PWR_SRAM3_PAGE4_STOP_RETENTION PWR_SRAM3_PAGE4_STOP +#define PWR_SRAM3_PAGE5_STOP_RETENTION PWR_SRAM3_PAGE5_STOP +#define PWR_SRAM3_PAGE6_STOP_RETENTION PWR_SRAM3_PAGE6_STOP +#define PWR_SRAM3_PAGE7_STOP_RETENTION PWR_SRAM3_PAGE7_STOP +#define PWR_SRAM3_PAGE8_STOP_RETENTION PWR_SRAM3_PAGE8_STOP +#define PWR_SRAM3_PAGE9_STOP_RETENTION PWR_SRAM3_PAGE9_STOP +#define PWR_SRAM3_PAGE10_STOP_RETENTION PWR_SRAM3_PAGE10_STOP +#define PWR_SRAM3_PAGE11_STOP_RETENTION PWR_SRAM3_PAGE11_STOP +#define PWR_SRAM3_PAGE12_STOP_RETENTION PWR_SRAM3_PAGE12_STOP +#define PWR_SRAM3_PAGE13_STOP_RETENTION PWR_SRAM3_PAGE13_STOP +#define PWR_SRAM3_FULL_STOP_RETENTION PWR_SRAM3_FULL_STOP + +#define PWR_SRAM4_FULL_STOP_RETENTION PWR_SRAM4_FULL_STOP + +#define PWR_SRAM5_PAGE1_STOP_RETENTION PWR_SRAM5_PAGE1_STOP +#define PWR_SRAM5_PAGE2_STOP_RETENTION PWR_SRAM5_PAGE2_STOP +#define PWR_SRAM5_PAGE3_STOP_RETENTION PWR_SRAM5_PAGE3_STOP +#define PWR_SRAM5_PAGE4_STOP_RETENTION PWR_SRAM5_PAGE4_STOP +#define PWR_SRAM5_PAGE5_STOP_RETENTION PWR_SRAM5_PAGE5_STOP +#define PWR_SRAM5_PAGE6_STOP_RETENTION PWR_SRAM5_PAGE6_STOP +#define PWR_SRAM5_PAGE7_STOP_RETENTION PWR_SRAM5_PAGE7_STOP +#define PWR_SRAM5_PAGE8_STOP_RETENTION PWR_SRAM5_PAGE8_STOP +#define PWR_SRAM5_PAGE9_STOP_RETENTION PWR_SRAM5_PAGE9_STOP +#define PWR_SRAM5_PAGE10_STOP_RETENTION PWR_SRAM5_PAGE10_STOP +#define PWR_SRAM5_PAGE11_STOP_RETENTION PWR_SRAM5_PAGE11_STOP +#define PWR_SRAM5_PAGE12_STOP_RETENTION PWR_SRAM5_PAGE12_STOP +#define PWR_SRAM5_PAGE13_STOP_RETENTION PWR_SRAM5_PAGE13_STOP +#define PWR_SRAM5_FULL_STOP_RETENTION PWR_SRAM5_FULL_STOP + +#define PWR_SRAM6_PAGE1_STOP_RETENTION PWR_SRAM6_PAGE1_STOP +#define PWR_SRAM6_PAGE2_STOP_RETENTION PWR_SRAM6_PAGE2_STOP +#define PWR_SRAM6_PAGE3_STOP_RETENTION PWR_SRAM6_PAGE3_STOP +#define PWR_SRAM6_PAGE4_STOP_RETENTION PWR_SRAM6_PAGE4_STOP +#define PWR_SRAM6_PAGE5_STOP_RETENTION PWR_SRAM6_PAGE5_STOP +#define PWR_SRAM6_PAGE6_STOP_RETENTION PWR_SRAM6_PAGE6_STOP +#define PWR_SRAM6_PAGE7_STOP_RETENTION PWR_SRAM6_PAGE7_STOP +#define PWR_SRAM6_PAGE8_STOP_RETENTION PWR_SRAM6_PAGE8_STOP +#define PWR_SRAM6_FULL_STOP_RETENTION PWR_SRAM6_FULL_STOP + + +#define PWR_ICACHE_FULL_STOP_RETENTION PWR_ICACHE_FULL_STOP +#define PWR_DCACHE1_FULL_STOP_RETENTION PWR_DCACHE1_FULL_STOP +#define PWR_DCACHE2_FULL_STOP_RETENTION PWR_DCACHE2_FULL_STOP +#define PWR_DMA2DRAM_FULL_STOP_RETENTION PWR_DMA2DRAM_FULL_STOP +#define PWR_PERIPHRAM_FULL_STOP_RETENTION PWR_PERIPHRAM_FULL_STOP +#define PWR_PKA32RAM_FULL_STOP_RETENTION PWR_PKA32RAM_FULL_STOP +#define PWR_GRAPHICPRAM_FULL_STOP_RETENTION PWR_GRAPHICPRAM_FULL_STOP +#define PWR_DSIRAM_FULL_STOP_RETENTION PWR_DSIRAM_FULL_STOP +#define PWR_JPEGRAM_FULL_STOP_RETENTION PWR_JPEGRAM_FULL_STOP + + +#define PWR_SRAM2_PAGE1_STANDBY_RETENTION PWR_SRAM2_PAGE1_STANDBY +#define PWR_SRAM2_PAGE2_STANDBY_RETENTION PWR_SRAM2_PAGE2_STANDBY +#define PWR_SRAM2_FULL_STANDBY_RETENTION PWR_SRAM2_FULL_STANDBY + +#define PWR_SRAM1_FULL_RUN_RETENTION PWR_SRAM1_FULL_RUN +#define PWR_SRAM2_FULL_RUN_RETENTION PWR_SRAM2_FULL_RUN +#define PWR_SRAM3_FULL_RUN_RETENTION PWR_SRAM3_FULL_RUN +#define PWR_SRAM4_FULL_RUN_RETENTION PWR_SRAM4_FULL_RUN +#define PWR_SRAM5_FULL_RUN_RETENTION PWR_SRAM5_FULL_RUN +#define PWR_SRAM6_FULL_RUN_RETENTION PWR_SRAM6_FULL_RUN + +#define PWR_ALL_RAM_RUN_RETENTION_MASK PWR_ALL_RAM_RUN_MASK +#endif + +/** + * @} + */ + +/** @defgroup HAL_RTC_Aliased_Functions HAL RTC Aliased Functions maintained for legacy purpose + * @{ + */ +#if defined(STM32H5) || defined(STM32WBA) +#define HAL_RTCEx_SetBoothardwareKey HAL_RTCEx_LockBootHardwareKey +#define HAL_RTCEx_BKUPBlock_Enable HAL_RTCEx_BKUPBlock +#define HAL_RTCEx_BKUPBlock_Disable HAL_RTCEx_BKUPUnblock +#define HAL_RTCEx_Erase_SecretDev_Conf HAL_RTCEx_ConfigEraseDeviceSecrets +#endif /* STM32H5 || STM32WBA */ + +/** + * @} + */ + +/** @defgroup HAL_SMBUS_Aliased_Functions HAL SMBUS Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_SMBUS_Slave_Listen_IT HAL_SMBUS_EnableListen_IT +#define HAL_SMBUS_SlaveAddrCallback HAL_SMBUS_AddrCallback +#define HAL_SMBUS_SlaveListenCpltCallback HAL_SMBUS_ListenCpltCallback +/** + * @} + */ + +/** @defgroup HAL_SPI_Aliased_Functions HAL SPI Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_SPI_FlushRxFifo HAL_SPIEx_FlushRxFifo +/** + * @} + */ + +/** @defgroup HAL_TIM_Aliased_Functions HAL TIM Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_TIM_DMADelayPulseCplt TIM_DMADelayPulseCplt +#define HAL_TIM_DMAError TIM_DMAError +#define HAL_TIM_DMACaptureCplt TIM_DMACaptureCplt +#define HAL_TIMEx_DMACommutationCplt TIMEx_DMACommutationCplt +#if defined(STM32H7) || defined(STM32G0) || defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || \ + defined(STM32F3) || defined(STM32F4) || defined(STM32F7) || defined(STM32L0) || defined(STM32L4) +#define HAL_TIM_SlaveConfigSynchronization HAL_TIM_SlaveConfigSynchro +#define HAL_TIM_SlaveConfigSynchronization_IT HAL_TIM_SlaveConfigSynchro_IT +#define HAL_TIMEx_CommutationCallback HAL_TIMEx_CommutCallback +#define HAL_TIMEx_ConfigCommutationEvent HAL_TIMEx_ConfigCommutEvent +#define HAL_TIMEx_ConfigCommutationEvent_IT HAL_TIMEx_ConfigCommutEvent_IT +#define HAL_TIMEx_ConfigCommutationEvent_DMA HAL_TIMEx_ConfigCommutEvent_DMA +#endif /* STM32H7 || STM32G0 || STM32F0 || STM32F1 || STM32F2 || STM32F3 || STM32F4 || STM32F7 || STM32L0 */ +/** + * @} + */ + +/** @defgroup HAL_UART_Aliased_Functions HAL UART Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_UART_WakeupCallback HAL_UARTEx_WakeupCallback +/** + * @} + */ + +/** @defgroup HAL_LTDC_Aliased_Functions HAL LTDC Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_LTDC_LineEvenCallback HAL_LTDC_LineEventCallback +#define HAL_LTDC_Relaod HAL_LTDC_Reload +#define HAL_LTDC_StructInitFromVideoConfig HAL_LTDCEx_StructInitFromVideoConfig +#define HAL_LTDC_StructInitFromAdaptedCommandConfig HAL_LTDCEx_StructInitFromAdaptedCommandConfig +/** + * @} + */ + + +/** @defgroup HAL_PPP_Aliased_Functions HAL PPP Aliased Functions maintained for legacy purpose + * @{ + */ + +/** + * @} + */ + +/* Exported macros ------------------------------------------------------------*/ + +/** @defgroup HAL_AES_Aliased_Macros HAL CRYP Aliased Macros maintained for legacy purpose + * @{ + */ +#define AES_IT_CC CRYP_IT_CC +#define AES_IT_ERR CRYP_IT_ERR +#define AES_FLAG_CCF CRYP_FLAG_CCF +/** + * @} + */ + +/** @defgroup HAL_Aliased_Macros HAL Generic Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_GET_BOOT_MODE __HAL_SYSCFG_GET_BOOT_MODE +#define __HAL_REMAPMEMORY_FLASH __HAL_SYSCFG_REMAPMEMORY_FLASH +#define __HAL_REMAPMEMORY_SYSTEMFLASH __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH +#define __HAL_REMAPMEMORY_SRAM __HAL_SYSCFG_REMAPMEMORY_SRAM +#define __HAL_REMAPMEMORY_FMC __HAL_SYSCFG_REMAPMEMORY_FMC +#define __HAL_REMAPMEMORY_FMC_SDRAM __HAL_SYSCFG_REMAPMEMORY_FMC_SDRAM +#define __HAL_REMAPMEMORY_FSMC __HAL_SYSCFG_REMAPMEMORY_FSMC +#define __HAL_REMAPMEMORY_QUADSPI __HAL_SYSCFG_REMAPMEMORY_QUADSPI +#define __HAL_FMC_BANK __HAL_SYSCFG_FMC_BANK +#define __HAL_GET_FLAG __HAL_SYSCFG_GET_FLAG +#define __HAL_CLEAR_FLAG __HAL_SYSCFG_CLEAR_FLAG +#define __HAL_VREFINT_OUT_ENABLE __HAL_SYSCFG_VREFINT_OUT_ENABLE +#define __HAL_VREFINT_OUT_DISABLE __HAL_SYSCFG_VREFINT_OUT_DISABLE +#define __HAL_SYSCFG_SRAM2_WRP_ENABLE __HAL_SYSCFG_SRAM2_WRP_0_31_ENABLE + +#define SYSCFG_FLAG_VREF_READY SYSCFG_FLAG_VREFINT_READY +#define SYSCFG_FLAG_RC48 RCC_FLAG_HSI48 +#define IS_SYSCFG_FASTMODEPLUS_CONFIG IS_I2C_FASTMODEPLUS +#define UFB_MODE_BitNumber UFB_MODE_BIT_NUMBER +#define CMP_PD_BitNumber CMP_PD_BIT_NUMBER + +/** + * @} + */ + + +/** @defgroup HAL_ADC_Aliased_Macros HAL ADC Aliased Macros maintained for legacy purpose + * @{ + */ +#define __ADC_ENABLE __HAL_ADC_ENABLE +#define __ADC_DISABLE __HAL_ADC_DISABLE +#define __HAL_ADC_ENABLING_CONDITIONS ADC_ENABLING_CONDITIONS +#define __HAL_ADC_DISABLING_CONDITIONS ADC_DISABLING_CONDITIONS +#define __HAL_ADC_IS_ENABLED ADC_IS_ENABLE +#define __ADC_IS_ENABLED ADC_IS_ENABLE +#define __HAL_ADC_IS_SOFTWARE_START_REGULAR ADC_IS_SOFTWARE_START_REGULAR +#define __HAL_ADC_IS_SOFTWARE_START_INJECTED ADC_IS_SOFTWARE_START_INJECTED +#define __HAL_ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED +#define __HAL_ADC_IS_CONVERSION_ONGOING_REGULAR ADC_IS_CONVERSION_ONGOING_REGULAR +#define __HAL_ADC_IS_CONVERSION_ONGOING_INJECTED ADC_IS_CONVERSION_ONGOING_INJECTED +#define __HAL_ADC_IS_CONVERSION_ONGOING ADC_IS_CONVERSION_ONGOING +#define __HAL_ADC_CLEAR_ERRORCODE ADC_CLEAR_ERRORCODE + +#define __HAL_ADC_GET_RESOLUTION ADC_GET_RESOLUTION +#define __HAL_ADC_JSQR_RK ADC_JSQR_RK +#define __HAL_ADC_CFGR_AWD1CH ADC_CFGR_AWD1CH_SHIFT +#define __HAL_ADC_CFGR_AWD23CR ADC_CFGR_AWD23CR +#define __HAL_ADC_CFGR_INJECT_AUTO_CONVERSION ADC_CFGR_INJECT_AUTO_CONVERSION +#define __HAL_ADC_CFGR_INJECT_CONTEXT_QUEUE ADC_CFGR_INJECT_CONTEXT_QUEUE +#define __HAL_ADC_CFGR_INJECT_DISCCONTINUOUS ADC_CFGR_INJECT_DISCCONTINUOUS +#define __HAL_ADC_CFGR_REG_DISCCONTINUOUS ADC_CFGR_REG_DISCCONTINUOUS +#define __HAL_ADC_CFGR_DISCONTINUOUS_NUM ADC_CFGR_DISCONTINUOUS_NUM +#define __HAL_ADC_CFGR_AUTOWAIT ADC_CFGR_AUTOWAIT +#define __HAL_ADC_CFGR_CONTINUOUS ADC_CFGR_CONTINUOUS +#define __HAL_ADC_CFGR_OVERRUN ADC_CFGR_OVERRUN +#define __HAL_ADC_CFGR_DMACONTREQ ADC_CFGR_DMACONTREQ +#define __HAL_ADC_CFGR_EXTSEL ADC_CFGR_EXTSEL_SET +#define __HAL_ADC_JSQR_JEXTSEL ADC_JSQR_JEXTSEL_SET +#define __HAL_ADC_OFR_CHANNEL ADC_OFR_CHANNEL +#define __HAL_ADC_DIFSEL_CHANNEL ADC_DIFSEL_CHANNEL +#define __HAL_ADC_CALFACT_DIFF_SET ADC_CALFACT_DIFF_SET +#define __HAL_ADC_CALFACT_DIFF_GET ADC_CALFACT_DIFF_GET +#define __HAL_ADC_TRX_HIGHTHRESHOLD ADC_TRX_HIGHTHRESHOLD + +#define __HAL_ADC_OFFSET_SHIFT_RESOLUTION ADC_OFFSET_SHIFT_RESOLUTION +#define __HAL_ADC_AWD1THRESHOLD_SHIFT_RESOLUTION ADC_AWD1THRESHOLD_SHIFT_RESOLUTION +#define __HAL_ADC_AWD23THRESHOLD_SHIFT_RESOLUTION ADC_AWD23THRESHOLD_SHIFT_RESOLUTION +#define __HAL_ADC_COMMON_REGISTER ADC_COMMON_REGISTER +#define __HAL_ADC_COMMON_CCR_MULTI ADC_COMMON_CCR_MULTI +#define __HAL_ADC_MULTIMODE_IS_ENABLED ADC_MULTIMODE_IS_ENABLE +#define __ADC_MULTIMODE_IS_ENABLED ADC_MULTIMODE_IS_ENABLE +#define __HAL_ADC_NONMULTIMODE_OR_MULTIMODEMASTER ADC_NONMULTIMODE_OR_MULTIMODEMASTER +#define __HAL_ADC_COMMON_ADC_OTHER ADC_COMMON_ADC_OTHER +#define __HAL_ADC_MULTI_SLAVE ADC_MULTI_SLAVE + +#define __HAL_ADC_SQR1_L ADC_SQR1_L_SHIFT +#define __HAL_ADC_JSQR_JL ADC_JSQR_JL_SHIFT +#define __HAL_ADC_JSQR_RK_JL ADC_JSQR_RK_JL +#define __HAL_ADC_CR1_DISCONTINUOUS_NUM ADC_CR1_DISCONTINUOUS_NUM +#define __HAL_ADC_CR1_SCAN ADC_CR1_SCAN_SET +#define __HAL_ADC_CONVCYCLES_MAX_RANGE ADC_CONVCYCLES_MAX_RANGE +#define __HAL_ADC_CLOCK_PRESCALER_RANGE ADC_CLOCK_PRESCALER_RANGE +#define __HAL_ADC_GET_CLOCK_PRESCALER ADC_GET_CLOCK_PRESCALER + +#define __HAL_ADC_SQR1 ADC_SQR1 +#define __HAL_ADC_SMPR1 ADC_SMPR1 +#define __HAL_ADC_SMPR2 ADC_SMPR2 +#define __HAL_ADC_SQR3_RK ADC_SQR3_RK +#define __HAL_ADC_SQR2_RK ADC_SQR2_RK +#define __HAL_ADC_SQR1_RK ADC_SQR1_RK +#define __HAL_ADC_CR2_CONTINUOUS ADC_CR2_CONTINUOUS +#define __HAL_ADC_CR1_DISCONTINUOUS ADC_CR1_DISCONTINUOUS +#define __HAL_ADC_CR1_SCANCONV ADC_CR1_SCANCONV +#define __HAL_ADC_CR2_EOCSelection ADC_CR2_EOCSelection +#define __HAL_ADC_CR2_DMAContReq ADC_CR2_DMAContReq +#define __HAL_ADC_JSQR ADC_JSQR + +#define __HAL_ADC_CHSELR_CHANNEL ADC_CHSELR_CHANNEL +#define __HAL_ADC_CFGR1_REG_DISCCONTINUOUS ADC_CFGR1_REG_DISCCONTINUOUS +#define __HAL_ADC_CFGR1_AUTOOFF ADC_CFGR1_AUTOOFF +#define __HAL_ADC_CFGR1_AUTOWAIT ADC_CFGR1_AUTOWAIT +#define __HAL_ADC_CFGR1_CONTINUOUS ADC_CFGR1_CONTINUOUS +#define __HAL_ADC_CFGR1_OVERRUN ADC_CFGR1_OVERRUN +#define __HAL_ADC_CFGR1_SCANDIR ADC_CFGR1_SCANDIR +#define __HAL_ADC_CFGR1_DMACONTREQ ADC_CFGR1_DMACONTREQ + +/** + * @} + */ + +/** @defgroup HAL_DAC_Aliased_Macros HAL DAC Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_DHR12R1_ALIGNEMENT DAC_DHR12R1_ALIGNMENT +#define __HAL_DHR12R2_ALIGNEMENT DAC_DHR12R2_ALIGNMENT +#define __HAL_DHR12RD_ALIGNEMENT DAC_DHR12RD_ALIGNMENT +#define IS_DAC_GENERATE_WAVE IS_DAC_WAVE + +/** + * @} + */ + +/** @defgroup HAL_DBGMCU_Aliased_Macros HAL DBGMCU Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_FREEZE_TIM1_DBGMCU __HAL_DBGMCU_FREEZE_TIM1 +#define __HAL_UNFREEZE_TIM1_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM1 +#define __HAL_FREEZE_TIM2_DBGMCU __HAL_DBGMCU_FREEZE_TIM2 +#define __HAL_UNFREEZE_TIM2_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM2 +#define __HAL_FREEZE_TIM3_DBGMCU __HAL_DBGMCU_FREEZE_TIM3 +#define __HAL_UNFREEZE_TIM3_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM3 +#define __HAL_FREEZE_TIM4_DBGMCU __HAL_DBGMCU_FREEZE_TIM4 +#define __HAL_UNFREEZE_TIM4_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM4 +#define __HAL_FREEZE_TIM5_DBGMCU __HAL_DBGMCU_FREEZE_TIM5 +#define __HAL_UNFREEZE_TIM5_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM5 +#define __HAL_FREEZE_TIM6_DBGMCU __HAL_DBGMCU_FREEZE_TIM6 +#define __HAL_UNFREEZE_TIM6_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM6 +#define __HAL_FREEZE_TIM7_DBGMCU __HAL_DBGMCU_FREEZE_TIM7 +#define __HAL_UNFREEZE_TIM7_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM7 +#define __HAL_FREEZE_TIM8_DBGMCU __HAL_DBGMCU_FREEZE_TIM8 +#define __HAL_UNFREEZE_TIM8_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM8 + +#define __HAL_FREEZE_TIM9_DBGMCU __HAL_DBGMCU_FREEZE_TIM9 +#define __HAL_UNFREEZE_TIM9_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM9 +#define __HAL_FREEZE_TIM10_DBGMCU __HAL_DBGMCU_FREEZE_TIM10 +#define __HAL_UNFREEZE_TIM10_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM10 +#define __HAL_FREEZE_TIM11_DBGMCU __HAL_DBGMCU_FREEZE_TIM11 +#define __HAL_UNFREEZE_TIM11_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM11 +#define __HAL_FREEZE_TIM12_DBGMCU __HAL_DBGMCU_FREEZE_TIM12 +#define __HAL_UNFREEZE_TIM12_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM12 +#define __HAL_FREEZE_TIM13_DBGMCU __HAL_DBGMCU_FREEZE_TIM13 +#define __HAL_UNFREEZE_TIM13_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM13 +#define __HAL_FREEZE_TIM14_DBGMCU __HAL_DBGMCU_FREEZE_TIM14 +#define __HAL_UNFREEZE_TIM14_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM14 +#define __HAL_FREEZE_CAN2_DBGMCU __HAL_DBGMCU_FREEZE_CAN2 +#define __HAL_UNFREEZE_CAN2_DBGMCU __HAL_DBGMCU_UNFREEZE_CAN2 + + +#define __HAL_FREEZE_TIM15_DBGMCU __HAL_DBGMCU_FREEZE_TIM15 +#define __HAL_UNFREEZE_TIM15_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM15 +#define __HAL_FREEZE_TIM16_DBGMCU __HAL_DBGMCU_FREEZE_TIM16 +#define __HAL_UNFREEZE_TIM16_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM16 +#define __HAL_FREEZE_TIM17_DBGMCU __HAL_DBGMCU_FREEZE_TIM17 +#define __HAL_UNFREEZE_TIM17_DBGMCU __HAL_DBGMCU_UNFREEZE_TIM17 +#define __HAL_FREEZE_RTC_DBGMCU __HAL_DBGMCU_FREEZE_RTC +#define __HAL_UNFREEZE_RTC_DBGMCU __HAL_DBGMCU_UNFREEZE_RTC +#if defined(STM32H7) +#define __HAL_FREEZE_WWDG_DBGMCU __HAL_DBGMCU_FREEZE_WWDG1 +#define __HAL_UNFREEZE_WWDG_DBGMCU __HAL_DBGMCU_UnFreeze_WWDG1 +#define __HAL_FREEZE_IWDG_DBGMCU __HAL_DBGMCU_FREEZE_IWDG1 +#define __HAL_UNFREEZE_IWDG_DBGMCU __HAL_DBGMCU_UnFreeze_IWDG1 +#else +#define __HAL_FREEZE_WWDG_DBGMCU __HAL_DBGMCU_FREEZE_WWDG +#define __HAL_UNFREEZE_WWDG_DBGMCU __HAL_DBGMCU_UNFREEZE_WWDG +#define __HAL_FREEZE_IWDG_DBGMCU __HAL_DBGMCU_FREEZE_IWDG +#define __HAL_UNFREEZE_IWDG_DBGMCU __HAL_DBGMCU_UNFREEZE_IWDG +#endif /* STM32H7 */ +#define __HAL_FREEZE_I2C1_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT +#define __HAL_UNFREEZE_I2C1_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT +#define __HAL_FREEZE_I2C2_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT +#define __HAL_UNFREEZE_I2C2_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT +#define __HAL_FREEZE_I2C3_TIMEOUT_DBGMCU __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT +#define __HAL_UNFREEZE_I2C3_TIMEOUT_DBGMCU __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT +#define __HAL_FREEZE_CAN1_DBGMCU __HAL_DBGMCU_FREEZE_CAN1 +#define __HAL_UNFREEZE_CAN1_DBGMCU __HAL_DBGMCU_UNFREEZE_CAN1 +#define __HAL_FREEZE_LPTIM1_DBGMCU __HAL_DBGMCU_FREEZE_LPTIM1 +#define __HAL_UNFREEZE_LPTIM1_DBGMCU __HAL_DBGMCU_UNFREEZE_LPTIM1 +#define __HAL_FREEZE_LPTIM2_DBGMCU __HAL_DBGMCU_FREEZE_LPTIM2 +#define __HAL_UNFREEZE_LPTIM2_DBGMCU __HAL_DBGMCU_UNFREEZE_LPTIM2 + +/** + * @} + */ + +/** @defgroup HAL_COMP_Aliased_Macros HAL COMP Aliased Macros maintained for legacy purpose + * @{ + */ +#if defined(STM32F3) +#define COMP_START __HAL_COMP_ENABLE +#define COMP_STOP __HAL_COMP_DISABLE +#define COMP_LOCK __HAL_COMP_LOCK + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || defined(STM32F303x8) || \ + defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_RISING_EDGE() : \ + __HAL_COMP_COMP6_EXTI_ENABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_RISING_EDGE() : \ + __HAL_COMP_COMP6_EXTI_DISABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP6_EXTI_ENABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP6_EXTI_DISABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_IT() : \ + __HAL_COMP_COMP6_EXTI_ENABLE_IT()) +#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_IT() : \ + __HAL_COMP_COMP6_EXTI_DISABLE_IT()) +#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_GET_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_GET_FLAG() : \ + __HAL_COMP_COMP6_EXTI_GET_FLAG()) +#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_CLEAR_FLAG() : \ + __HAL_COMP_COMP6_EXTI_CLEAR_FLAG()) +# endif +# if defined(STM32F302xE) || defined(STM32F302xC) +#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_RISING_EDGE() : \ + __HAL_COMP_COMP6_EXTI_ENABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_RISING_EDGE() : \ + __HAL_COMP_COMP6_EXTI_DISABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP6_EXTI_ENABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP6_EXTI_DISABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_IT() : \ + __HAL_COMP_COMP6_EXTI_ENABLE_IT()) +#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_IT() : \ + __HAL_COMP_COMP6_EXTI_DISABLE_IT()) +#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_GET_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_GET_FLAG() : \ + __HAL_COMP_COMP6_EXTI_GET_FLAG()) +#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_CLEAR_FLAG() : \ + __HAL_COMP_COMP6_EXTI_CLEAR_FLAG()) +# endif +# if defined(STM32F303xE) || defined(STM32F398xx) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_ENABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_ENABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_ENABLE_RISING_EDGE() : \ + __HAL_COMP_COMP7_EXTI_ENABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_DISABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_DISABLE_RISING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_DISABLE_RISING_EDGE() : \ + __HAL_COMP_COMP7_EXTI_DISABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_ENABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_ENABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_ENABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP7_EXTI_ENABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_DISABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_DISABLE_FALLING_EDGE() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_DISABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP7_EXTI_DISABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_ENABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_ENABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_ENABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_ENABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_ENABLE_IT() : \ + __HAL_COMP_COMP7_EXTI_ENABLE_IT()) +#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_DISABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_DISABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_DISABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_DISABLE_IT() : \ + ((__EXTILINE__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_DISABLE_IT() : \ + __HAL_COMP_COMP7_EXTI_DISABLE_IT()) +#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_GET_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_GET_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_GET_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_GET_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_GET_FLAG() : \ + __HAL_COMP_COMP7_EXTI_GET_FLAG()) +#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP2) ? __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP3) ? __HAL_COMP_COMP3_EXTI_CLEAR_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP4) ? __HAL_COMP_COMP4_EXTI_CLEAR_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP5) ? __HAL_COMP_COMP5_EXTI_CLEAR_FLAG() : \ + ((__FLAG__) == COMP_EXTI_LINE_COMP6) ? __HAL_COMP_COMP6_EXTI_CLEAR_FLAG() : \ + __HAL_COMP_COMP7_EXTI_CLEAR_FLAG()) +# endif +# if defined(STM32F373xC) ||defined(STM32F378xx) +#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_IT()) +#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_IT()) +#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \ + __HAL_COMP_COMP2_EXTI_GET_FLAG()) +#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \ + __HAL_COMP_COMP2_EXTI_CLEAR_FLAG()) +# endif +#else +#define __HAL_COMP_EXTI_RISING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_RISING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_ENABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_FALLING_IT_DISABLE(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE()) +#define __HAL_COMP_EXTI_ENABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_ENABLE_IT() : \ + __HAL_COMP_COMP2_EXTI_ENABLE_IT()) +#define __HAL_COMP_EXTI_DISABLE_IT(__EXTILINE__) (((__EXTILINE__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_DISABLE_IT() : \ + __HAL_COMP_COMP2_EXTI_DISABLE_IT()) +#define __HAL_COMP_EXTI_GET_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_GET_FLAG() : \ + __HAL_COMP_COMP2_EXTI_GET_FLAG()) +#define __HAL_COMP_EXTI_CLEAR_FLAG(__FLAG__) (((__FLAG__) == COMP_EXTI_LINE_COMP1) ? __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() : \ + __HAL_COMP_COMP2_EXTI_CLEAR_FLAG()) +#endif + +#define __HAL_COMP_GET_EXTI_LINE COMP_GET_EXTI_LINE + +#if defined(STM32L0) || defined(STM32L4) +/* Note: On these STM32 families, the only argument of this macro */ +/* is COMP_FLAG_LOCK. */ +/* This macro is replaced by __HAL_COMP_IS_LOCKED with only HAL handle */ +/* argument. */ +#define __HAL_COMP_GET_FLAG(__HANDLE__, __FLAG__) (__HAL_COMP_IS_LOCKED(__HANDLE__)) +#endif +/** + * @} + */ + +#if defined(STM32L0) || defined(STM32L4) +/** @defgroup HAL_COMP_Aliased_Functions HAL COMP Aliased Functions maintained for legacy purpose + * @{ + */ +#define HAL_COMP_Start_IT HAL_COMP_Start /* Function considered as legacy as EXTI event or IT configuration is + done into HAL_COMP_Init() */ +#define HAL_COMP_Stop_IT HAL_COMP_Stop /* Function considered as legacy as EXTI event or IT configuration is + done into HAL_COMP_Init() */ +/** + * @} + */ +#endif + +/** @defgroup HAL_DAC_Aliased_Macros HAL DAC Aliased Macros maintained for legacy purpose + * @{ + */ + +#define IS_DAC_WAVE(WAVE) (((WAVE) == DAC_WAVE_NONE) || \ + ((WAVE) == DAC_WAVE_NOISE)|| \ + ((WAVE) == DAC_WAVE_TRIANGLE)) + +/** + * @} + */ + +/** @defgroup HAL_FLASH_Aliased_Macros HAL FLASH Aliased Macros maintained for legacy purpose + * @{ + */ + +#define IS_WRPAREA IS_OB_WRPAREA +#define IS_TYPEPROGRAM IS_FLASH_TYPEPROGRAM +#define IS_TYPEPROGRAMFLASH IS_FLASH_TYPEPROGRAM +#define IS_TYPEERASE IS_FLASH_TYPEERASE +#define IS_NBSECTORS IS_FLASH_NBSECTORS +#define IS_OB_WDG_SOURCE IS_OB_IWDG_SOURCE + +/** + * @} + */ + +/** @defgroup HAL_I2C_Aliased_Macros HAL I2C Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_I2C_RESET_CR2 I2C_RESET_CR2 +#define __HAL_I2C_GENERATE_START I2C_GENERATE_START +#if defined(STM32F1) +#define __HAL_I2C_FREQ_RANGE I2C_FREQRANGE +#else +#define __HAL_I2C_FREQ_RANGE I2C_FREQ_RANGE +#endif /* STM32F1 */ +#define __HAL_I2C_RISE_TIME I2C_RISE_TIME +#define __HAL_I2C_SPEED_STANDARD I2C_SPEED_STANDARD +#define __HAL_I2C_SPEED_FAST I2C_SPEED_FAST +#define __HAL_I2C_SPEED I2C_SPEED +#define __HAL_I2C_7BIT_ADD_WRITE I2C_7BIT_ADD_WRITE +#define __HAL_I2C_7BIT_ADD_READ I2C_7BIT_ADD_READ +#define __HAL_I2C_10BIT_ADDRESS I2C_10BIT_ADDRESS +#define __HAL_I2C_10BIT_HEADER_WRITE I2C_10BIT_HEADER_WRITE +#define __HAL_I2C_10BIT_HEADER_READ I2C_10BIT_HEADER_READ +#define __HAL_I2C_MEM_ADD_MSB I2C_MEM_ADD_MSB +#define __HAL_I2C_MEM_ADD_LSB I2C_MEM_ADD_LSB +#define __HAL_I2C_FREQRANGE I2C_FREQRANGE +/** + * @} + */ + +/** @defgroup HAL_I2S_Aliased_Macros HAL I2S Aliased Macros maintained for legacy purpose + * @{ + */ + +#define IS_I2S_INSTANCE IS_I2S_ALL_INSTANCE +#define IS_I2S_INSTANCE_EXT IS_I2S_ALL_INSTANCE_EXT + +#if defined(STM32H7) +#define __HAL_I2S_CLEAR_FREFLAG __HAL_I2S_CLEAR_TIFREFLAG +#endif + +/** + * @} + */ + +/** @defgroup HAL_IRDA_Aliased_Macros HAL IRDA Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __IRDA_DISABLE __HAL_IRDA_DISABLE +#define __IRDA_ENABLE __HAL_IRDA_ENABLE + +#define __HAL_IRDA_GETCLOCKSOURCE IRDA_GETCLOCKSOURCE +#define __HAL_IRDA_MASK_COMPUTATION IRDA_MASK_COMPUTATION +#define __IRDA_GETCLOCKSOURCE IRDA_GETCLOCKSOURCE +#define __IRDA_MASK_COMPUTATION IRDA_MASK_COMPUTATION + +#define IS_IRDA_ONEBIT_SAMPLE IS_IRDA_ONE_BIT_SAMPLE + + +/** + * @} + */ + + +/** @defgroup HAL_IWDG_Aliased_Macros HAL IWDG Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_IWDG_ENABLE_WRITE_ACCESS IWDG_ENABLE_WRITE_ACCESS +#define __HAL_IWDG_DISABLE_WRITE_ACCESS IWDG_DISABLE_WRITE_ACCESS +/** + * @} + */ + + +/** @defgroup HAL_LPTIM_Aliased_Macros HAL LPTIM Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_LPTIM_ENABLE_INTERRUPT __HAL_LPTIM_ENABLE_IT +#define __HAL_LPTIM_DISABLE_INTERRUPT __HAL_LPTIM_DISABLE_IT +#define __HAL_LPTIM_GET_ITSTATUS __HAL_LPTIM_GET_IT_SOURCE + +/** + * @} + */ + + +/** @defgroup HAL_OPAMP_Aliased_Macros HAL OPAMP Aliased Macros maintained for legacy purpose + * @{ + */ +#define __OPAMP_CSR_OPAXPD OPAMP_CSR_OPAXPD +#define __OPAMP_CSR_S3SELX OPAMP_CSR_S3SELX +#define __OPAMP_CSR_S4SELX OPAMP_CSR_S4SELX +#define __OPAMP_CSR_S5SELX OPAMP_CSR_S5SELX +#define __OPAMP_CSR_S6SELX OPAMP_CSR_S6SELX +#define __OPAMP_CSR_OPAXCAL_L OPAMP_CSR_OPAXCAL_L +#define __OPAMP_CSR_OPAXCAL_H OPAMP_CSR_OPAXCAL_H +#define __OPAMP_CSR_OPAXLPM OPAMP_CSR_OPAXLPM +#define __OPAMP_CSR_ALL_SWITCHES OPAMP_CSR_ALL_SWITCHES +#define __OPAMP_CSR_ANAWSELX OPAMP_CSR_ANAWSELX +#define __OPAMP_CSR_OPAXCALOUT OPAMP_CSR_OPAXCALOUT +#define __OPAMP_OFFSET_TRIM_BITSPOSITION OPAMP_OFFSET_TRIM_BITSPOSITION +#define __OPAMP_OFFSET_TRIM_SET OPAMP_OFFSET_TRIM_SET + +/** + * @} + */ + + +/** @defgroup HAL_PWR_Aliased_Macros HAL PWR Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_PVD_EVENT_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_EVENT +#define __HAL_PVD_EVENT_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_EVENT +#define __HAL_PVD_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE +#define __HAL_PVD_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE +#define __HAL_PVD_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE +#define __HAL_PVD_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE +#define __HAL_PVM_EVENT_DISABLE __HAL_PWR_PVM_EVENT_DISABLE +#define __HAL_PVM_EVENT_ENABLE __HAL_PWR_PVM_EVENT_ENABLE +#define __HAL_PVM_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVM_EXTI_FALLINGTRIGGER_DISABLE +#define __HAL_PVM_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVM_EXTI_FALLINGTRIGGER_ENABLE +#define __HAL_PVM_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVM_EXTI_RISINGTRIGGER_DISABLE +#define __HAL_PVM_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVM_EXTI_RISINGTRIGGER_ENABLE +#define __HAL_PWR_INTERNALWAKEUP_DISABLE HAL_PWREx_DisableInternalWakeUpLine +#define __HAL_PWR_INTERNALWAKEUP_ENABLE HAL_PWREx_EnableInternalWakeUpLine +#define __HAL_PWR_PULL_UP_DOWN_CONFIG_DISABLE HAL_PWREx_DisablePullUpPullDownConfig +#define __HAL_PWR_PULL_UP_DOWN_CONFIG_ENABLE HAL_PWREx_EnablePullUpPullDownConfig +#define __HAL_PWR_PVD_EXTI_CLEAR_EGDE_TRIGGER() do { __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE(); \ + __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); \ + } while(0) +#define __HAL_PWR_PVD_EXTI_EVENT_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_EVENT +#define __HAL_PWR_PVD_EXTI_EVENT_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_EVENT +#define __HAL_PWR_PVD_EXTI_FALLINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE +#define __HAL_PWR_PVD_EXTI_FALLINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE +#define __HAL_PWR_PVD_EXTI_RISINGTRIGGER_DISABLE __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE +#define __HAL_PWR_PVD_EXTI_RISINGTRIGGER_ENABLE __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE +#define __HAL_PWR_PVD_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE +#define __HAL_PWR_PVD_EXTI_SET_RISING_EDGE_TRIGGER __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE +#define __HAL_PWR_PVM_DISABLE() do { HAL_PWREx_DisablePVM1();HAL_PWREx_DisablePVM2(); \ + HAL_PWREx_DisablePVM3();HAL_PWREx_DisablePVM4(); \ + } while(0) +#define __HAL_PWR_PVM_ENABLE() do { HAL_PWREx_EnablePVM1();HAL_PWREx_EnablePVM2(); \ + HAL_PWREx_EnablePVM3();HAL_PWREx_EnablePVM4(); \ + } while(0) +#define __HAL_PWR_SRAM2CONTENT_PRESERVE_DISABLE HAL_PWREx_DisableSRAM2ContentRetention +#define __HAL_PWR_SRAM2CONTENT_PRESERVE_ENABLE HAL_PWREx_EnableSRAM2ContentRetention +#define __HAL_PWR_VDDIO2_DISABLE HAL_PWREx_DisableVddIO2 +#define __HAL_PWR_VDDIO2_ENABLE HAL_PWREx_EnableVddIO2 +#define __HAL_PWR_VDDIO2_EXTI_CLEAR_EGDE_TRIGGER __HAL_PWR_VDDIO2_EXTI_DISABLE_FALLING_EDGE +#define __HAL_PWR_VDDIO2_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_PWR_VDDIO2_EXTI_ENABLE_FALLING_EDGE +#define __HAL_PWR_VDDUSB_DISABLE HAL_PWREx_DisableVddUSB +#define __HAL_PWR_VDDUSB_ENABLE HAL_PWREx_EnableVddUSB + +#if defined (STM32F4) +#define __HAL_PVD_EXTI_ENABLE_IT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_ENABLE_IT() +#define __HAL_PVD_EXTI_DISABLE_IT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_DISABLE_IT() +#define __HAL_PVD_EXTI_GET_FLAG(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_GET_FLAG() +#define __HAL_PVD_EXTI_CLEAR_FLAG(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_CLEAR_FLAG() +#define __HAL_PVD_EXTI_GENERATE_SWIT(PWR_EXTI_LINE_PVD) __HAL_PWR_PVD_EXTI_GENERATE_SWIT() +#else +#define __HAL_PVD_EXTI_CLEAR_FLAG __HAL_PWR_PVD_EXTI_CLEAR_FLAG +#define __HAL_PVD_EXTI_DISABLE_IT __HAL_PWR_PVD_EXTI_DISABLE_IT +#define __HAL_PVD_EXTI_ENABLE_IT __HAL_PWR_PVD_EXTI_ENABLE_IT +#define __HAL_PVD_EXTI_GENERATE_SWIT __HAL_PWR_PVD_EXTI_GENERATE_SWIT +#define __HAL_PVD_EXTI_GET_FLAG __HAL_PWR_PVD_EXTI_GET_FLAG +#endif /* STM32F4 */ +/** + * @} + */ + + +/** @defgroup HAL_RCC_Aliased HAL RCC Aliased maintained for legacy purpose + * @{ + */ + +#define RCC_StopWakeUpClock_MSI RCC_STOP_WAKEUPCLOCK_MSI +#define RCC_StopWakeUpClock_HSI RCC_STOP_WAKEUPCLOCK_HSI + +#define HAL_RCC_CCSCallback HAL_RCC_CSSCallback +#define HAL_RC48_EnableBuffer_Cmd(cmd) (((cmd)==ENABLE) ? \ + HAL_RCCEx_EnableHSI48_VREFINT() : HAL_RCCEx_DisableHSI48_VREFINT()) + +#define __ADC_CLK_DISABLE __HAL_RCC_ADC_CLK_DISABLE +#define __ADC_CLK_ENABLE __HAL_RCC_ADC_CLK_ENABLE +#define __ADC_CLK_SLEEP_DISABLE __HAL_RCC_ADC_CLK_SLEEP_DISABLE +#define __ADC_CLK_SLEEP_ENABLE __HAL_RCC_ADC_CLK_SLEEP_ENABLE +#define __ADC_FORCE_RESET __HAL_RCC_ADC_FORCE_RESET +#define __ADC_RELEASE_RESET __HAL_RCC_ADC_RELEASE_RESET +#define __ADC1_CLK_DISABLE __HAL_RCC_ADC1_CLK_DISABLE +#define __ADC1_CLK_ENABLE __HAL_RCC_ADC1_CLK_ENABLE +#define __ADC1_FORCE_RESET __HAL_RCC_ADC1_FORCE_RESET +#define __ADC1_RELEASE_RESET __HAL_RCC_ADC1_RELEASE_RESET +#define __ADC1_CLK_SLEEP_ENABLE __HAL_RCC_ADC1_CLK_SLEEP_ENABLE +#define __ADC1_CLK_SLEEP_DISABLE __HAL_RCC_ADC1_CLK_SLEEP_DISABLE +#define __ADC2_CLK_DISABLE __HAL_RCC_ADC2_CLK_DISABLE +#define __ADC2_CLK_ENABLE __HAL_RCC_ADC2_CLK_ENABLE +#define __ADC2_FORCE_RESET __HAL_RCC_ADC2_FORCE_RESET +#define __ADC2_RELEASE_RESET __HAL_RCC_ADC2_RELEASE_RESET +#define __ADC3_CLK_DISABLE __HAL_RCC_ADC3_CLK_DISABLE +#define __ADC3_CLK_ENABLE __HAL_RCC_ADC3_CLK_ENABLE +#define __ADC3_FORCE_RESET __HAL_RCC_ADC3_FORCE_RESET +#define __ADC3_RELEASE_RESET __HAL_RCC_ADC3_RELEASE_RESET +#define __AES_CLK_DISABLE __HAL_RCC_AES_CLK_DISABLE +#define __AES_CLK_ENABLE __HAL_RCC_AES_CLK_ENABLE +#define __AES_CLK_SLEEP_DISABLE __HAL_RCC_AES_CLK_SLEEP_DISABLE +#define __AES_CLK_SLEEP_ENABLE __HAL_RCC_AES_CLK_SLEEP_ENABLE +#define __AES_FORCE_RESET __HAL_RCC_AES_FORCE_RESET +#define __AES_RELEASE_RESET __HAL_RCC_AES_RELEASE_RESET +#define __CRYP_CLK_SLEEP_ENABLE __HAL_RCC_CRYP_CLK_SLEEP_ENABLE +#define __CRYP_CLK_SLEEP_DISABLE __HAL_RCC_CRYP_CLK_SLEEP_DISABLE +#define __CRYP_CLK_ENABLE __HAL_RCC_CRYP_CLK_ENABLE +#define __CRYP_CLK_DISABLE __HAL_RCC_CRYP_CLK_DISABLE +#define __CRYP_FORCE_RESET __HAL_RCC_CRYP_FORCE_RESET +#define __CRYP_RELEASE_RESET __HAL_RCC_CRYP_RELEASE_RESET +#define __AFIO_CLK_DISABLE __HAL_RCC_AFIO_CLK_DISABLE +#define __AFIO_CLK_ENABLE __HAL_RCC_AFIO_CLK_ENABLE +#define __AFIO_FORCE_RESET __HAL_RCC_AFIO_FORCE_RESET +#define __AFIO_RELEASE_RESET __HAL_RCC_AFIO_RELEASE_RESET +#define __AHB_FORCE_RESET __HAL_RCC_AHB_FORCE_RESET +#define __AHB_RELEASE_RESET __HAL_RCC_AHB_RELEASE_RESET +#define __AHB1_FORCE_RESET __HAL_RCC_AHB1_FORCE_RESET +#define __AHB1_RELEASE_RESET __HAL_RCC_AHB1_RELEASE_RESET +#define __AHB2_FORCE_RESET __HAL_RCC_AHB2_FORCE_RESET +#define __AHB2_RELEASE_RESET __HAL_RCC_AHB2_RELEASE_RESET +#define __AHB3_FORCE_RESET __HAL_RCC_AHB3_FORCE_RESET +#define __AHB3_RELEASE_RESET __HAL_RCC_AHB3_RELEASE_RESET +#define __APB1_FORCE_RESET __HAL_RCC_APB1_FORCE_RESET +#define __APB1_RELEASE_RESET __HAL_RCC_APB1_RELEASE_RESET +#define __APB2_FORCE_RESET __HAL_RCC_APB2_FORCE_RESET +#define __APB2_RELEASE_RESET __HAL_RCC_APB2_RELEASE_RESET +#define __BKP_CLK_DISABLE __HAL_RCC_BKP_CLK_DISABLE +#define __BKP_CLK_ENABLE __HAL_RCC_BKP_CLK_ENABLE +#define __BKP_FORCE_RESET __HAL_RCC_BKP_FORCE_RESET +#define __BKP_RELEASE_RESET __HAL_RCC_BKP_RELEASE_RESET +#define __CAN1_CLK_DISABLE __HAL_RCC_CAN1_CLK_DISABLE +#define __CAN1_CLK_ENABLE __HAL_RCC_CAN1_CLK_ENABLE +#define __CAN1_CLK_SLEEP_DISABLE __HAL_RCC_CAN1_CLK_SLEEP_DISABLE +#define __CAN1_CLK_SLEEP_ENABLE __HAL_RCC_CAN1_CLK_SLEEP_ENABLE +#define __CAN1_FORCE_RESET __HAL_RCC_CAN1_FORCE_RESET +#define __CAN1_RELEASE_RESET __HAL_RCC_CAN1_RELEASE_RESET +#define __CAN_CLK_DISABLE __HAL_RCC_CAN1_CLK_DISABLE +#define __CAN_CLK_ENABLE __HAL_RCC_CAN1_CLK_ENABLE +#define __CAN_FORCE_RESET __HAL_RCC_CAN1_FORCE_RESET +#define __CAN_RELEASE_RESET __HAL_RCC_CAN1_RELEASE_RESET +#define __CAN2_CLK_DISABLE __HAL_RCC_CAN2_CLK_DISABLE +#define __CAN2_CLK_ENABLE __HAL_RCC_CAN2_CLK_ENABLE +#define __CAN2_FORCE_RESET __HAL_RCC_CAN2_FORCE_RESET +#define __CAN2_RELEASE_RESET __HAL_RCC_CAN2_RELEASE_RESET +#define __CEC_CLK_DISABLE __HAL_RCC_CEC_CLK_DISABLE +#define __CEC_CLK_ENABLE __HAL_RCC_CEC_CLK_ENABLE +#define __COMP_CLK_DISABLE __HAL_RCC_COMP_CLK_DISABLE +#define __COMP_CLK_ENABLE __HAL_RCC_COMP_CLK_ENABLE +#define __COMP_FORCE_RESET __HAL_RCC_COMP_FORCE_RESET +#define __COMP_RELEASE_RESET __HAL_RCC_COMP_RELEASE_RESET +#define __COMP_CLK_SLEEP_ENABLE __HAL_RCC_COMP_CLK_SLEEP_ENABLE +#define __COMP_CLK_SLEEP_DISABLE __HAL_RCC_COMP_CLK_SLEEP_DISABLE +#define __CEC_FORCE_RESET __HAL_RCC_CEC_FORCE_RESET +#define __CEC_RELEASE_RESET __HAL_RCC_CEC_RELEASE_RESET +#define __CRC_CLK_DISABLE __HAL_RCC_CRC_CLK_DISABLE +#define __CRC_CLK_ENABLE __HAL_RCC_CRC_CLK_ENABLE +#define __CRC_CLK_SLEEP_DISABLE __HAL_RCC_CRC_CLK_SLEEP_DISABLE +#define __CRC_CLK_SLEEP_ENABLE __HAL_RCC_CRC_CLK_SLEEP_ENABLE +#define __CRC_FORCE_RESET __HAL_RCC_CRC_FORCE_RESET +#define __CRC_RELEASE_RESET __HAL_RCC_CRC_RELEASE_RESET +#define __DAC_CLK_DISABLE __HAL_RCC_DAC_CLK_DISABLE +#define __DAC_CLK_ENABLE __HAL_RCC_DAC_CLK_ENABLE +#define __DAC_FORCE_RESET __HAL_RCC_DAC_FORCE_RESET +#define __DAC_RELEASE_RESET __HAL_RCC_DAC_RELEASE_RESET +#define __DAC1_CLK_DISABLE __HAL_RCC_DAC1_CLK_DISABLE +#define __DAC1_CLK_ENABLE __HAL_RCC_DAC1_CLK_ENABLE +#define __DAC1_CLK_SLEEP_DISABLE __HAL_RCC_DAC1_CLK_SLEEP_DISABLE +#define __DAC1_CLK_SLEEP_ENABLE __HAL_RCC_DAC1_CLK_SLEEP_ENABLE +#define __DAC1_FORCE_RESET __HAL_RCC_DAC1_FORCE_RESET +#define __DAC1_RELEASE_RESET __HAL_RCC_DAC1_RELEASE_RESET +#define __DBGMCU_CLK_ENABLE __HAL_RCC_DBGMCU_CLK_ENABLE +#define __DBGMCU_CLK_DISABLE __HAL_RCC_DBGMCU_CLK_DISABLE +#define __DBGMCU_FORCE_RESET __HAL_RCC_DBGMCU_FORCE_RESET +#define __DBGMCU_RELEASE_RESET __HAL_RCC_DBGMCU_RELEASE_RESET +#define __DFSDM_CLK_DISABLE __HAL_RCC_DFSDM_CLK_DISABLE +#define __DFSDM_CLK_ENABLE __HAL_RCC_DFSDM_CLK_ENABLE +#define __DFSDM_CLK_SLEEP_DISABLE __HAL_RCC_DFSDM_CLK_SLEEP_DISABLE +#define __DFSDM_CLK_SLEEP_ENABLE __HAL_RCC_DFSDM_CLK_SLEEP_ENABLE +#define __DFSDM_FORCE_RESET __HAL_RCC_DFSDM_FORCE_RESET +#define __DFSDM_RELEASE_RESET __HAL_RCC_DFSDM_RELEASE_RESET +#define __DMA1_CLK_DISABLE __HAL_RCC_DMA1_CLK_DISABLE +#define __DMA1_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE +#define __DMA1_CLK_SLEEP_DISABLE __HAL_RCC_DMA1_CLK_SLEEP_DISABLE +#define __DMA1_CLK_SLEEP_ENABLE __HAL_RCC_DMA1_CLK_SLEEP_ENABLE +#define __DMA1_FORCE_RESET __HAL_RCC_DMA1_FORCE_RESET +#define __DMA1_RELEASE_RESET __HAL_RCC_DMA1_RELEASE_RESET +#define __DMA2_CLK_DISABLE __HAL_RCC_DMA2_CLK_DISABLE +#define __DMA2_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE +#define __DMA2_CLK_SLEEP_DISABLE __HAL_RCC_DMA2_CLK_SLEEP_DISABLE +#define __DMA2_CLK_SLEEP_ENABLE __HAL_RCC_DMA2_CLK_SLEEP_ENABLE +#define __DMA2_FORCE_RESET __HAL_RCC_DMA2_FORCE_RESET +#define __DMA2_RELEASE_RESET __HAL_RCC_DMA2_RELEASE_RESET +#define __ETHMAC_CLK_DISABLE __HAL_RCC_ETHMAC_CLK_DISABLE +#define __ETHMAC_CLK_ENABLE __HAL_RCC_ETHMAC_CLK_ENABLE +#define __ETHMAC_FORCE_RESET __HAL_RCC_ETHMAC_FORCE_RESET +#define __ETHMAC_RELEASE_RESET __HAL_RCC_ETHMAC_RELEASE_RESET +#define __ETHMACRX_CLK_DISABLE __HAL_RCC_ETHMACRX_CLK_DISABLE +#define __ETHMACRX_CLK_ENABLE __HAL_RCC_ETHMACRX_CLK_ENABLE +#define __ETHMACTX_CLK_DISABLE __HAL_RCC_ETHMACTX_CLK_DISABLE +#define __ETHMACTX_CLK_ENABLE __HAL_RCC_ETHMACTX_CLK_ENABLE +#define __FIREWALL_CLK_DISABLE __HAL_RCC_FIREWALL_CLK_DISABLE +#define __FIREWALL_CLK_ENABLE __HAL_RCC_FIREWALL_CLK_ENABLE +#define __FLASH_CLK_DISABLE __HAL_RCC_FLASH_CLK_DISABLE +#define __FLASH_CLK_ENABLE __HAL_RCC_FLASH_CLK_ENABLE +#define __FLASH_CLK_SLEEP_DISABLE __HAL_RCC_FLASH_CLK_SLEEP_DISABLE +#define __FLASH_CLK_SLEEP_ENABLE __HAL_RCC_FLASH_CLK_SLEEP_ENABLE +#define __FLASH_FORCE_RESET __HAL_RCC_FLASH_FORCE_RESET +#define __FLASH_RELEASE_RESET __HAL_RCC_FLASH_RELEASE_RESET +#define __FLITF_CLK_DISABLE __HAL_RCC_FLITF_CLK_DISABLE +#define __FLITF_CLK_ENABLE __HAL_RCC_FLITF_CLK_ENABLE +#define __FLITF_FORCE_RESET __HAL_RCC_FLITF_FORCE_RESET +#define __FLITF_RELEASE_RESET __HAL_RCC_FLITF_RELEASE_RESET +#define __FLITF_CLK_SLEEP_ENABLE __HAL_RCC_FLITF_CLK_SLEEP_ENABLE +#define __FLITF_CLK_SLEEP_DISABLE __HAL_RCC_FLITF_CLK_SLEEP_DISABLE +#define __FMC_CLK_DISABLE __HAL_RCC_FMC_CLK_DISABLE +#define __FMC_CLK_ENABLE __HAL_RCC_FMC_CLK_ENABLE +#define __FMC_CLK_SLEEP_DISABLE __HAL_RCC_FMC_CLK_SLEEP_DISABLE +#define __FMC_CLK_SLEEP_ENABLE __HAL_RCC_FMC_CLK_SLEEP_ENABLE +#define __FMC_FORCE_RESET __HAL_RCC_FMC_FORCE_RESET +#define __FMC_RELEASE_RESET __HAL_RCC_FMC_RELEASE_RESET +#define __FSMC_CLK_DISABLE __HAL_RCC_FSMC_CLK_DISABLE +#define __FSMC_CLK_ENABLE __HAL_RCC_FSMC_CLK_ENABLE +#define __GPIOA_CLK_DISABLE __HAL_RCC_GPIOA_CLK_DISABLE +#define __GPIOA_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define __GPIOA_CLK_SLEEP_DISABLE __HAL_RCC_GPIOA_CLK_SLEEP_DISABLE +#define __GPIOA_CLK_SLEEP_ENABLE __HAL_RCC_GPIOA_CLK_SLEEP_ENABLE +#define __GPIOA_FORCE_RESET __HAL_RCC_GPIOA_FORCE_RESET +#define __GPIOA_RELEASE_RESET __HAL_RCC_GPIOA_RELEASE_RESET +#define __GPIOB_CLK_DISABLE __HAL_RCC_GPIOB_CLK_DISABLE +#define __GPIOB_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE +#define __GPIOB_CLK_SLEEP_DISABLE __HAL_RCC_GPIOB_CLK_SLEEP_DISABLE +#define __GPIOB_CLK_SLEEP_ENABLE __HAL_RCC_GPIOB_CLK_SLEEP_ENABLE +#define __GPIOB_FORCE_RESET __HAL_RCC_GPIOB_FORCE_RESET +#define __GPIOB_RELEASE_RESET __HAL_RCC_GPIOB_RELEASE_RESET +#define __GPIOC_CLK_DISABLE __HAL_RCC_GPIOC_CLK_DISABLE +#define __GPIOC_CLK_ENABLE __HAL_RCC_GPIOC_CLK_ENABLE +#define __GPIOC_CLK_SLEEP_DISABLE __HAL_RCC_GPIOC_CLK_SLEEP_DISABLE +#define __GPIOC_CLK_SLEEP_ENABLE __HAL_RCC_GPIOC_CLK_SLEEP_ENABLE +#define __GPIOC_FORCE_RESET __HAL_RCC_GPIOC_FORCE_RESET +#define __GPIOC_RELEASE_RESET __HAL_RCC_GPIOC_RELEASE_RESET +#define __GPIOD_CLK_DISABLE __HAL_RCC_GPIOD_CLK_DISABLE +#define __GPIOD_CLK_ENABLE __HAL_RCC_GPIOD_CLK_ENABLE +#define __GPIOD_CLK_SLEEP_DISABLE __HAL_RCC_GPIOD_CLK_SLEEP_DISABLE +#define __GPIOD_CLK_SLEEP_ENABLE __HAL_RCC_GPIOD_CLK_SLEEP_ENABLE +#define __GPIOD_FORCE_RESET __HAL_RCC_GPIOD_FORCE_RESET +#define __GPIOD_RELEASE_RESET __HAL_RCC_GPIOD_RELEASE_RESET +#define __GPIOE_CLK_DISABLE __HAL_RCC_GPIOE_CLK_DISABLE +#define __GPIOE_CLK_ENABLE __HAL_RCC_GPIOE_CLK_ENABLE +#define __GPIOE_CLK_SLEEP_DISABLE __HAL_RCC_GPIOE_CLK_SLEEP_DISABLE +#define __GPIOE_CLK_SLEEP_ENABLE __HAL_RCC_GPIOE_CLK_SLEEP_ENABLE +#define __GPIOE_FORCE_RESET __HAL_RCC_GPIOE_FORCE_RESET +#define __GPIOE_RELEASE_RESET __HAL_RCC_GPIOE_RELEASE_RESET +#define __GPIOF_CLK_DISABLE __HAL_RCC_GPIOF_CLK_DISABLE +#define __GPIOF_CLK_ENABLE __HAL_RCC_GPIOF_CLK_ENABLE +#define __GPIOF_CLK_SLEEP_DISABLE __HAL_RCC_GPIOF_CLK_SLEEP_DISABLE +#define __GPIOF_CLK_SLEEP_ENABLE __HAL_RCC_GPIOF_CLK_SLEEP_ENABLE +#define __GPIOF_FORCE_RESET __HAL_RCC_GPIOF_FORCE_RESET +#define __GPIOF_RELEASE_RESET __HAL_RCC_GPIOF_RELEASE_RESET +#define __GPIOG_CLK_DISABLE __HAL_RCC_GPIOG_CLK_DISABLE +#define __GPIOG_CLK_ENABLE __HAL_RCC_GPIOG_CLK_ENABLE +#define __GPIOG_CLK_SLEEP_DISABLE __HAL_RCC_GPIOG_CLK_SLEEP_DISABLE +#define __GPIOG_CLK_SLEEP_ENABLE __HAL_RCC_GPIOG_CLK_SLEEP_ENABLE +#define __GPIOG_FORCE_RESET __HAL_RCC_GPIOG_FORCE_RESET +#define __GPIOG_RELEASE_RESET __HAL_RCC_GPIOG_RELEASE_RESET +#define __GPIOH_CLK_DISABLE __HAL_RCC_GPIOH_CLK_DISABLE +#define __GPIOH_CLK_ENABLE __HAL_RCC_GPIOH_CLK_ENABLE +#define __GPIOH_CLK_SLEEP_DISABLE __HAL_RCC_GPIOH_CLK_SLEEP_DISABLE +#define __GPIOH_CLK_SLEEP_ENABLE __HAL_RCC_GPIOH_CLK_SLEEP_ENABLE +#define __GPIOH_FORCE_RESET __HAL_RCC_GPIOH_FORCE_RESET +#define __GPIOH_RELEASE_RESET __HAL_RCC_GPIOH_RELEASE_RESET +#define __I2C1_CLK_DISABLE __HAL_RCC_I2C1_CLK_DISABLE +#define __I2C1_CLK_ENABLE __HAL_RCC_I2C1_CLK_ENABLE +#define __I2C1_CLK_SLEEP_DISABLE __HAL_RCC_I2C1_CLK_SLEEP_DISABLE +#define __I2C1_CLK_SLEEP_ENABLE __HAL_RCC_I2C1_CLK_SLEEP_ENABLE +#define __I2C1_FORCE_RESET __HAL_RCC_I2C1_FORCE_RESET +#define __I2C1_RELEASE_RESET __HAL_RCC_I2C1_RELEASE_RESET +#define __I2C2_CLK_DISABLE __HAL_RCC_I2C2_CLK_DISABLE +#define __I2C2_CLK_ENABLE __HAL_RCC_I2C2_CLK_ENABLE +#define __I2C2_CLK_SLEEP_DISABLE __HAL_RCC_I2C2_CLK_SLEEP_DISABLE +#define __I2C2_CLK_SLEEP_ENABLE __HAL_RCC_I2C2_CLK_SLEEP_ENABLE +#define __I2C2_FORCE_RESET __HAL_RCC_I2C2_FORCE_RESET +#define __I2C2_RELEASE_RESET __HAL_RCC_I2C2_RELEASE_RESET +#define __I2C3_CLK_DISABLE __HAL_RCC_I2C3_CLK_DISABLE +#define __I2C3_CLK_ENABLE __HAL_RCC_I2C3_CLK_ENABLE +#define __I2C3_CLK_SLEEP_DISABLE __HAL_RCC_I2C3_CLK_SLEEP_DISABLE +#define __I2C3_CLK_SLEEP_ENABLE __HAL_RCC_I2C3_CLK_SLEEP_ENABLE +#define __I2C3_FORCE_RESET __HAL_RCC_I2C3_FORCE_RESET +#define __I2C3_RELEASE_RESET __HAL_RCC_I2C3_RELEASE_RESET +#define __LCD_CLK_DISABLE __HAL_RCC_LCD_CLK_DISABLE +#define __LCD_CLK_ENABLE __HAL_RCC_LCD_CLK_ENABLE +#define __LCD_CLK_SLEEP_DISABLE __HAL_RCC_LCD_CLK_SLEEP_DISABLE +#define __LCD_CLK_SLEEP_ENABLE __HAL_RCC_LCD_CLK_SLEEP_ENABLE +#define __LCD_FORCE_RESET __HAL_RCC_LCD_FORCE_RESET +#define __LCD_RELEASE_RESET __HAL_RCC_LCD_RELEASE_RESET +#define __LPTIM1_CLK_DISABLE __HAL_RCC_LPTIM1_CLK_DISABLE +#define __LPTIM1_CLK_ENABLE __HAL_RCC_LPTIM1_CLK_ENABLE +#define __LPTIM1_CLK_SLEEP_DISABLE __HAL_RCC_LPTIM1_CLK_SLEEP_DISABLE +#define __LPTIM1_CLK_SLEEP_ENABLE __HAL_RCC_LPTIM1_CLK_SLEEP_ENABLE +#define __LPTIM1_FORCE_RESET __HAL_RCC_LPTIM1_FORCE_RESET +#define __LPTIM1_RELEASE_RESET __HAL_RCC_LPTIM1_RELEASE_RESET +#define __LPTIM2_CLK_DISABLE __HAL_RCC_LPTIM2_CLK_DISABLE +#define __LPTIM2_CLK_ENABLE __HAL_RCC_LPTIM2_CLK_ENABLE +#define __LPTIM2_CLK_SLEEP_DISABLE __HAL_RCC_LPTIM2_CLK_SLEEP_DISABLE +#define __LPTIM2_CLK_SLEEP_ENABLE __HAL_RCC_LPTIM2_CLK_SLEEP_ENABLE +#define __LPTIM2_FORCE_RESET __HAL_RCC_LPTIM2_FORCE_RESET +#define __LPTIM2_RELEASE_RESET __HAL_RCC_LPTIM2_RELEASE_RESET +#define __LPUART1_CLK_DISABLE __HAL_RCC_LPUART1_CLK_DISABLE +#define __LPUART1_CLK_ENABLE __HAL_RCC_LPUART1_CLK_ENABLE +#define __LPUART1_CLK_SLEEP_DISABLE __HAL_RCC_LPUART1_CLK_SLEEP_DISABLE +#define __LPUART1_CLK_SLEEP_ENABLE __HAL_RCC_LPUART1_CLK_SLEEP_ENABLE +#define __LPUART1_FORCE_RESET __HAL_RCC_LPUART1_FORCE_RESET +#define __LPUART1_RELEASE_RESET __HAL_RCC_LPUART1_RELEASE_RESET +#define __OPAMP_CLK_DISABLE __HAL_RCC_OPAMP_CLK_DISABLE +#define __OPAMP_CLK_ENABLE __HAL_RCC_OPAMP_CLK_ENABLE +#define __OPAMP_CLK_SLEEP_DISABLE __HAL_RCC_OPAMP_CLK_SLEEP_DISABLE +#define __OPAMP_CLK_SLEEP_ENABLE __HAL_RCC_OPAMP_CLK_SLEEP_ENABLE +#define __OPAMP_FORCE_RESET __HAL_RCC_OPAMP_FORCE_RESET +#define __OPAMP_RELEASE_RESET __HAL_RCC_OPAMP_RELEASE_RESET +#define __OTGFS_CLK_DISABLE __HAL_RCC_OTGFS_CLK_DISABLE +#define __OTGFS_CLK_ENABLE __HAL_RCC_OTGFS_CLK_ENABLE +#define __OTGFS_CLK_SLEEP_DISABLE __HAL_RCC_OTGFS_CLK_SLEEP_DISABLE +#define __OTGFS_CLK_SLEEP_ENABLE __HAL_RCC_OTGFS_CLK_SLEEP_ENABLE +#define __OTGFS_FORCE_RESET __HAL_RCC_OTGFS_FORCE_RESET +#define __OTGFS_RELEASE_RESET __HAL_RCC_OTGFS_RELEASE_RESET +#define __PWR_CLK_DISABLE __HAL_RCC_PWR_CLK_DISABLE +#define __PWR_CLK_ENABLE __HAL_RCC_PWR_CLK_ENABLE +#define __PWR_CLK_SLEEP_DISABLE __HAL_RCC_PWR_CLK_SLEEP_DISABLE +#define __PWR_CLK_SLEEP_ENABLE __HAL_RCC_PWR_CLK_SLEEP_ENABLE +#define __PWR_FORCE_RESET __HAL_RCC_PWR_FORCE_RESET +#define __PWR_RELEASE_RESET __HAL_RCC_PWR_RELEASE_RESET +#define __QSPI_CLK_DISABLE __HAL_RCC_QSPI_CLK_DISABLE +#define __QSPI_CLK_ENABLE __HAL_RCC_QSPI_CLK_ENABLE +#define __QSPI_CLK_SLEEP_DISABLE __HAL_RCC_QSPI_CLK_SLEEP_DISABLE +#define __QSPI_CLK_SLEEP_ENABLE __HAL_RCC_QSPI_CLK_SLEEP_ENABLE +#define __QSPI_FORCE_RESET __HAL_RCC_QSPI_FORCE_RESET +#define __QSPI_RELEASE_RESET __HAL_RCC_QSPI_RELEASE_RESET + +#if defined(STM32WB) +#define __HAL_RCC_QSPI_CLK_DISABLE __HAL_RCC_QUADSPI_CLK_DISABLE +#define __HAL_RCC_QSPI_CLK_ENABLE __HAL_RCC_QUADSPI_CLK_ENABLE +#define __HAL_RCC_QSPI_CLK_SLEEP_DISABLE __HAL_RCC_QUADSPI_CLK_SLEEP_DISABLE +#define __HAL_RCC_QSPI_CLK_SLEEP_ENABLE __HAL_RCC_QUADSPI_CLK_SLEEP_ENABLE +#define __HAL_RCC_QSPI_FORCE_RESET __HAL_RCC_QUADSPI_FORCE_RESET +#define __HAL_RCC_QSPI_RELEASE_RESET __HAL_RCC_QUADSPI_RELEASE_RESET +#define __HAL_RCC_QSPI_IS_CLK_ENABLED __HAL_RCC_QUADSPI_IS_CLK_ENABLED +#define __HAL_RCC_QSPI_IS_CLK_DISABLED __HAL_RCC_QUADSPI_IS_CLK_DISABLED +#define __HAL_RCC_QSPI_IS_CLK_SLEEP_ENABLED __HAL_RCC_QUADSPI_IS_CLK_SLEEP_ENABLED +#define __HAL_RCC_QSPI_IS_CLK_SLEEP_DISABLED __HAL_RCC_QUADSPI_IS_CLK_SLEEP_DISABLED +#define QSPI_IRQHandler QUADSPI_IRQHandler +#endif /* __HAL_RCC_QUADSPI_CLK_ENABLE */ + +#define __RNG_CLK_DISABLE __HAL_RCC_RNG_CLK_DISABLE +#define __RNG_CLK_ENABLE __HAL_RCC_RNG_CLK_ENABLE +#define __RNG_CLK_SLEEP_DISABLE __HAL_RCC_RNG_CLK_SLEEP_DISABLE +#define __RNG_CLK_SLEEP_ENABLE __HAL_RCC_RNG_CLK_SLEEP_ENABLE +#define __RNG_FORCE_RESET __HAL_RCC_RNG_FORCE_RESET +#define __RNG_RELEASE_RESET __HAL_RCC_RNG_RELEASE_RESET +#define __SAI1_CLK_DISABLE __HAL_RCC_SAI1_CLK_DISABLE +#define __SAI1_CLK_ENABLE __HAL_RCC_SAI1_CLK_ENABLE +#define __SAI1_CLK_SLEEP_DISABLE __HAL_RCC_SAI1_CLK_SLEEP_DISABLE +#define __SAI1_CLK_SLEEP_ENABLE __HAL_RCC_SAI1_CLK_SLEEP_ENABLE +#define __SAI1_FORCE_RESET __HAL_RCC_SAI1_FORCE_RESET +#define __SAI1_RELEASE_RESET __HAL_RCC_SAI1_RELEASE_RESET +#define __SAI2_CLK_DISABLE __HAL_RCC_SAI2_CLK_DISABLE +#define __SAI2_CLK_ENABLE __HAL_RCC_SAI2_CLK_ENABLE +#define __SAI2_CLK_SLEEP_DISABLE __HAL_RCC_SAI2_CLK_SLEEP_DISABLE +#define __SAI2_CLK_SLEEP_ENABLE __HAL_RCC_SAI2_CLK_SLEEP_ENABLE +#define __SAI2_FORCE_RESET __HAL_RCC_SAI2_FORCE_RESET +#define __SAI2_RELEASE_RESET __HAL_RCC_SAI2_RELEASE_RESET +#define __SDIO_CLK_DISABLE __HAL_RCC_SDIO_CLK_DISABLE +#define __SDIO_CLK_ENABLE __HAL_RCC_SDIO_CLK_ENABLE +#define __SDMMC_CLK_DISABLE __HAL_RCC_SDMMC_CLK_DISABLE +#define __SDMMC_CLK_ENABLE __HAL_RCC_SDMMC_CLK_ENABLE +#define __SDMMC_CLK_SLEEP_DISABLE __HAL_RCC_SDMMC_CLK_SLEEP_DISABLE +#define __SDMMC_CLK_SLEEP_ENABLE __HAL_RCC_SDMMC_CLK_SLEEP_ENABLE +#define __SDMMC_FORCE_RESET __HAL_RCC_SDMMC_FORCE_RESET +#define __SDMMC_RELEASE_RESET __HAL_RCC_SDMMC_RELEASE_RESET +#define __SPI1_CLK_DISABLE __HAL_RCC_SPI1_CLK_DISABLE +#define __SPI1_CLK_ENABLE __HAL_RCC_SPI1_CLK_ENABLE +#define __SPI1_CLK_SLEEP_DISABLE __HAL_RCC_SPI1_CLK_SLEEP_DISABLE +#define __SPI1_CLK_SLEEP_ENABLE __HAL_RCC_SPI1_CLK_SLEEP_ENABLE +#define __SPI1_FORCE_RESET __HAL_RCC_SPI1_FORCE_RESET +#define __SPI1_RELEASE_RESET __HAL_RCC_SPI1_RELEASE_RESET +#define __SPI2_CLK_DISABLE __HAL_RCC_SPI2_CLK_DISABLE +#define __SPI2_CLK_ENABLE __HAL_RCC_SPI2_CLK_ENABLE +#define __SPI2_CLK_SLEEP_DISABLE __HAL_RCC_SPI2_CLK_SLEEP_DISABLE +#define __SPI2_CLK_SLEEP_ENABLE __HAL_RCC_SPI2_CLK_SLEEP_ENABLE +#define __SPI2_FORCE_RESET __HAL_RCC_SPI2_FORCE_RESET +#define __SPI2_RELEASE_RESET __HAL_RCC_SPI2_RELEASE_RESET +#define __SPI3_CLK_DISABLE __HAL_RCC_SPI3_CLK_DISABLE +#define __SPI3_CLK_ENABLE __HAL_RCC_SPI3_CLK_ENABLE +#define __SPI3_CLK_SLEEP_DISABLE __HAL_RCC_SPI3_CLK_SLEEP_DISABLE +#define __SPI3_CLK_SLEEP_ENABLE __HAL_RCC_SPI3_CLK_SLEEP_ENABLE +#define __SPI3_FORCE_RESET __HAL_RCC_SPI3_FORCE_RESET +#define __SPI3_RELEASE_RESET __HAL_RCC_SPI3_RELEASE_RESET +#define __SRAM_CLK_DISABLE __HAL_RCC_SRAM_CLK_DISABLE +#define __SRAM_CLK_ENABLE __HAL_RCC_SRAM_CLK_ENABLE +#define __SRAM1_CLK_SLEEP_DISABLE __HAL_RCC_SRAM1_CLK_SLEEP_DISABLE +#define __SRAM1_CLK_SLEEP_ENABLE __HAL_RCC_SRAM1_CLK_SLEEP_ENABLE +#define __SRAM2_CLK_SLEEP_DISABLE __HAL_RCC_SRAM2_CLK_SLEEP_DISABLE +#define __SRAM2_CLK_SLEEP_ENABLE __HAL_RCC_SRAM2_CLK_SLEEP_ENABLE +#define __SWPMI1_CLK_DISABLE __HAL_RCC_SWPMI1_CLK_DISABLE +#define __SWPMI1_CLK_ENABLE __HAL_RCC_SWPMI1_CLK_ENABLE +#define __SWPMI1_CLK_SLEEP_DISABLE __HAL_RCC_SWPMI1_CLK_SLEEP_DISABLE +#define __SWPMI1_CLK_SLEEP_ENABLE __HAL_RCC_SWPMI1_CLK_SLEEP_ENABLE +#define __SWPMI1_FORCE_RESET __HAL_RCC_SWPMI1_FORCE_RESET +#define __SWPMI1_RELEASE_RESET __HAL_RCC_SWPMI1_RELEASE_RESET +#define __SYSCFG_CLK_DISABLE __HAL_RCC_SYSCFG_CLK_DISABLE +#define __SYSCFG_CLK_ENABLE __HAL_RCC_SYSCFG_CLK_ENABLE +#define __SYSCFG_CLK_SLEEP_DISABLE __HAL_RCC_SYSCFG_CLK_SLEEP_DISABLE +#define __SYSCFG_CLK_SLEEP_ENABLE __HAL_RCC_SYSCFG_CLK_SLEEP_ENABLE +#define __SYSCFG_FORCE_RESET __HAL_RCC_SYSCFG_FORCE_RESET +#define __SYSCFG_RELEASE_RESET __HAL_RCC_SYSCFG_RELEASE_RESET +#define __TIM1_CLK_DISABLE __HAL_RCC_TIM1_CLK_DISABLE +#define __TIM1_CLK_ENABLE __HAL_RCC_TIM1_CLK_ENABLE +#define __TIM1_CLK_SLEEP_DISABLE __HAL_RCC_TIM1_CLK_SLEEP_DISABLE +#define __TIM1_CLK_SLEEP_ENABLE __HAL_RCC_TIM1_CLK_SLEEP_ENABLE +#define __TIM1_FORCE_RESET __HAL_RCC_TIM1_FORCE_RESET +#define __TIM1_RELEASE_RESET __HAL_RCC_TIM1_RELEASE_RESET +#define __TIM10_CLK_DISABLE __HAL_RCC_TIM10_CLK_DISABLE +#define __TIM10_CLK_ENABLE __HAL_RCC_TIM10_CLK_ENABLE +#define __TIM10_FORCE_RESET __HAL_RCC_TIM10_FORCE_RESET +#define __TIM10_RELEASE_RESET __HAL_RCC_TIM10_RELEASE_RESET +#define __TIM11_CLK_DISABLE __HAL_RCC_TIM11_CLK_DISABLE +#define __TIM11_CLK_ENABLE __HAL_RCC_TIM11_CLK_ENABLE +#define __TIM11_FORCE_RESET __HAL_RCC_TIM11_FORCE_RESET +#define __TIM11_RELEASE_RESET __HAL_RCC_TIM11_RELEASE_RESET +#define __TIM12_CLK_DISABLE __HAL_RCC_TIM12_CLK_DISABLE +#define __TIM12_CLK_ENABLE __HAL_RCC_TIM12_CLK_ENABLE +#define __TIM12_FORCE_RESET __HAL_RCC_TIM12_FORCE_RESET +#define __TIM12_RELEASE_RESET __HAL_RCC_TIM12_RELEASE_RESET +#define __TIM13_CLK_DISABLE __HAL_RCC_TIM13_CLK_DISABLE +#define __TIM13_CLK_ENABLE __HAL_RCC_TIM13_CLK_ENABLE +#define __TIM13_FORCE_RESET __HAL_RCC_TIM13_FORCE_RESET +#define __TIM13_RELEASE_RESET __HAL_RCC_TIM13_RELEASE_RESET +#define __TIM14_CLK_DISABLE __HAL_RCC_TIM14_CLK_DISABLE +#define __TIM14_CLK_ENABLE __HAL_RCC_TIM14_CLK_ENABLE +#define __TIM14_FORCE_RESET __HAL_RCC_TIM14_FORCE_RESET +#define __TIM14_RELEASE_RESET __HAL_RCC_TIM14_RELEASE_RESET +#define __TIM15_CLK_DISABLE __HAL_RCC_TIM15_CLK_DISABLE +#define __TIM15_CLK_ENABLE __HAL_RCC_TIM15_CLK_ENABLE +#define __TIM15_CLK_SLEEP_DISABLE __HAL_RCC_TIM15_CLK_SLEEP_DISABLE +#define __TIM15_CLK_SLEEP_ENABLE __HAL_RCC_TIM15_CLK_SLEEP_ENABLE +#define __TIM15_FORCE_RESET __HAL_RCC_TIM15_FORCE_RESET +#define __TIM15_RELEASE_RESET __HAL_RCC_TIM15_RELEASE_RESET +#define __TIM16_CLK_DISABLE __HAL_RCC_TIM16_CLK_DISABLE +#define __TIM16_CLK_ENABLE __HAL_RCC_TIM16_CLK_ENABLE +#define __TIM16_CLK_SLEEP_DISABLE __HAL_RCC_TIM16_CLK_SLEEP_DISABLE +#define __TIM16_CLK_SLEEP_ENABLE __HAL_RCC_TIM16_CLK_SLEEP_ENABLE +#define __TIM16_FORCE_RESET __HAL_RCC_TIM16_FORCE_RESET +#define __TIM16_RELEASE_RESET __HAL_RCC_TIM16_RELEASE_RESET +#define __TIM17_CLK_DISABLE __HAL_RCC_TIM17_CLK_DISABLE +#define __TIM17_CLK_ENABLE __HAL_RCC_TIM17_CLK_ENABLE +#define __TIM17_CLK_SLEEP_DISABLE __HAL_RCC_TIM17_CLK_SLEEP_DISABLE +#define __TIM17_CLK_SLEEP_ENABLE __HAL_RCC_TIM17_CLK_SLEEP_ENABLE +#define __TIM17_FORCE_RESET __HAL_RCC_TIM17_FORCE_RESET +#define __TIM17_RELEASE_RESET __HAL_RCC_TIM17_RELEASE_RESET +#define __TIM2_CLK_DISABLE __HAL_RCC_TIM2_CLK_DISABLE +#define __TIM2_CLK_ENABLE __HAL_RCC_TIM2_CLK_ENABLE +#define __TIM2_CLK_SLEEP_DISABLE __HAL_RCC_TIM2_CLK_SLEEP_DISABLE +#define __TIM2_CLK_SLEEP_ENABLE __HAL_RCC_TIM2_CLK_SLEEP_ENABLE +#define __TIM2_FORCE_RESET __HAL_RCC_TIM2_FORCE_RESET +#define __TIM2_RELEASE_RESET __HAL_RCC_TIM2_RELEASE_RESET +#define __TIM3_CLK_DISABLE __HAL_RCC_TIM3_CLK_DISABLE +#define __TIM3_CLK_ENABLE __HAL_RCC_TIM3_CLK_ENABLE +#define __TIM3_CLK_SLEEP_DISABLE __HAL_RCC_TIM3_CLK_SLEEP_DISABLE +#define __TIM3_CLK_SLEEP_ENABLE __HAL_RCC_TIM3_CLK_SLEEP_ENABLE +#define __TIM3_FORCE_RESET __HAL_RCC_TIM3_FORCE_RESET +#define __TIM3_RELEASE_RESET __HAL_RCC_TIM3_RELEASE_RESET +#define __TIM4_CLK_DISABLE __HAL_RCC_TIM4_CLK_DISABLE +#define __TIM4_CLK_ENABLE __HAL_RCC_TIM4_CLK_ENABLE +#define __TIM4_CLK_SLEEP_DISABLE __HAL_RCC_TIM4_CLK_SLEEP_DISABLE +#define __TIM4_CLK_SLEEP_ENABLE __HAL_RCC_TIM4_CLK_SLEEP_ENABLE +#define __TIM4_FORCE_RESET __HAL_RCC_TIM4_FORCE_RESET +#define __TIM4_RELEASE_RESET __HAL_RCC_TIM4_RELEASE_RESET +#define __TIM5_CLK_DISABLE __HAL_RCC_TIM5_CLK_DISABLE +#define __TIM5_CLK_ENABLE __HAL_RCC_TIM5_CLK_ENABLE +#define __TIM5_CLK_SLEEP_DISABLE __HAL_RCC_TIM5_CLK_SLEEP_DISABLE +#define __TIM5_CLK_SLEEP_ENABLE __HAL_RCC_TIM5_CLK_SLEEP_ENABLE +#define __TIM5_FORCE_RESET __HAL_RCC_TIM5_FORCE_RESET +#define __TIM5_RELEASE_RESET __HAL_RCC_TIM5_RELEASE_RESET +#define __TIM6_CLK_DISABLE __HAL_RCC_TIM6_CLK_DISABLE +#define __TIM6_CLK_ENABLE __HAL_RCC_TIM6_CLK_ENABLE +#define __TIM6_CLK_SLEEP_DISABLE __HAL_RCC_TIM6_CLK_SLEEP_DISABLE +#define __TIM6_CLK_SLEEP_ENABLE __HAL_RCC_TIM6_CLK_SLEEP_ENABLE +#define __TIM6_FORCE_RESET __HAL_RCC_TIM6_FORCE_RESET +#define __TIM6_RELEASE_RESET __HAL_RCC_TIM6_RELEASE_RESET +#define __TIM7_CLK_DISABLE __HAL_RCC_TIM7_CLK_DISABLE +#define __TIM7_CLK_ENABLE __HAL_RCC_TIM7_CLK_ENABLE +#define __TIM7_CLK_SLEEP_DISABLE __HAL_RCC_TIM7_CLK_SLEEP_DISABLE +#define __TIM7_CLK_SLEEP_ENABLE __HAL_RCC_TIM7_CLK_SLEEP_ENABLE +#define __TIM7_FORCE_RESET __HAL_RCC_TIM7_FORCE_RESET +#define __TIM7_RELEASE_RESET __HAL_RCC_TIM7_RELEASE_RESET +#define __TIM8_CLK_DISABLE __HAL_RCC_TIM8_CLK_DISABLE +#define __TIM8_CLK_ENABLE __HAL_RCC_TIM8_CLK_ENABLE +#define __TIM8_CLK_SLEEP_DISABLE __HAL_RCC_TIM8_CLK_SLEEP_DISABLE +#define __TIM8_CLK_SLEEP_ENABLE __HAL_RCC_TIM8_CLK_SLEEP_ENABLE +#define __TIM8_FORCE_RESET __HAL_RCC_TIM8_FORCE_RESET +#define __TIM8_RELEASE_RESET __HAL_RCC_TIM8_RELEASE_RESET +#define __TIM9_CLK_DISABLE __HAL_RCC_TIM9_CLK_DISABLE +#define __TIM9_CLK_ENABLE __HAL_RCC_TIM9_CLK_ENABLE +#define __TIM9_FORCE_RESET __HAL_RCC_TIM9_FORCE_RESET +#define __TIM9_RELEASE_RESET __HAL_RCC_TIM9_RELEASE_RESET +#define __TSC_CLK_DISABLE __HAL_RCC_TSC_CLK_DISABLE +#define __TSC_CLK_ENABLE __HAL_RCC_TSC_CLK_ENABLE +#define __TSC_CLK_SLEEP_DISABLE __HAL_RCC_TSC_CLK_SLEEP_DISABLE +#define __TSC_CLK_SLEEP_ENABLE __HAL_RCC_TSC_CLK_SLEEP_ENABLE +#define __TSC_FORCE_RESET __HAL_RCC_TSC_FORCE_RESET +#define __TSC_RELEASE_RESET __HAL_RCC_TSC_RELEASE_RESET +#define __UART4_CLK_DISABLE __HAL_RCC_UART4_CLK_DISABLE +#define __UART4_CLK_ENABLE __HAL_RCC_UART4_CLK_ENABLE +#define __UART4_CLK_SLEEP_DISABLE __HAL_RCC_UART4_CLK_SLEEP_DISABLE +#define __UART4_CLK_SLEEP_ENABLE __HAL_RCC_UART4_CLK_SLEEP_ENABLE +#define __UART4_FORCE_RESET __HAL_RCC_UART4_FORCE_RESET +#define __UART4_RELEASE_RESET __HAL_RCC_UART4_RELEASE_RESET +#define __UART5_CLK_DISABLE __HAL_RCC_UART5_CLK_DISABLE +#define __UART5_CLK_ENABLE __HAL_RCC_UART5_CLK_ENABLE +#define __UART5_CLK_SLEEP_DISABLE __HAL_RCC_UART5_CLK_SLEEP_DISABLE +#define __UART5_CLK_SLEEP_ENABLE __HAL_RCC_UART5_CLK_SLEEP_ENABLE +#define __UART5_FORCE_RESET __HAL_RCC_UART5_FORCE_RESET +#define __UART5_RELEASE_RESET __HAL_RCC_UART5_RELEASE_RESET +#define __USART1_CLK_DISABLE __HAL_RCC_USART1_CLK_DISABLE +#define __USART1_CLK_ENABLE __HAL_RCC_USART1_CLK_ENABLE +#define __USART1_CLK_SLEEP_DISABLE __HAL_RCC_USART1_CLK_SLEEP_DISABLE +#define __USART1_CLK_SLEEP_ENABLE __HAL_RCC_USART1_CLK_SLEEP_ENABLE +#define __USART1_FORCE_RESET __HAL_RCC_USART1_FORCE_RESET +#define __USART1_RELEASE_RESET __HAL_RCC_USART1_RELEASE_RESET +#define __USART2_CLK_DISABLE __HAL_RCC_USART2_CLK_DISABLE +#define __USART2_CLK_ENABLE __HAL_RCC_USART2_CLK_ENABLE +#define __USART2_CLK_SLEEP_DISABLE __HAL_RCC_USART2_CLK_SLEEP_DISABLE +#define __USART2_CLK_SLEEP_ENABLE __HAL_RCC_USART2_CLK_SLEEP_ENABLE +#define __USART2_FORCE_RESET __HAL_RCC_USART2_FORCE_RESET +#define __USART2_RELEASE_RESET __HAL_RCC_USART2_RELEASE_RESET +#define __USART3_CLK_DISABLE __HAL_RCC_USART3_CLK_DISABLE +#define __USART3_CLK_ENABLE __HAL_RCC_USART3_CLK_ENABLE +#define __USART3_CLK_SLEEP_DISABLE __HAL_RCC_USART3_CLK_SLEEP_DISABLE +#define __USART3_CLK_SLEEP_ENABLE __HAL_RCC_USART3_CLK_SLEEP_ENABLE +#define __USART3_FORCE_RESET __HAL_RCC_USART3_FORCE_RESET +#define __USART3_RELEASE_RESET __HAL_RCC_USART3_RELEASE_RESET +#define __USART4_CLK_DISABLE __HAL_RCC_UART4_CLK_DISABLE +#define __USART4_CLK_ENABLE __HAL_RCC_UART4_CLK_ENABLE +#define __USART4_CLK_SLEEP_ENABLE __HAL_RCC_UART4_CLK_SLEEP_ENABLE +#define __USART4_CLK_SLEEP_DISABLE __HAL_RCC_UART4_CLK_SLEEP_DISABLE +#define __USART4_FORCE_RESET __HAL_RCC_UART4_FORCE_RESET +#define __USART4_RELEASE_RESET __HAL_RCC_UART4_RELEASE_RESET +#define __USART5_CLK_DISABLE __HAL_RCC_UART5_CLK_DISABLE +#define __USART5_CLK_ENABLE __HAL_RCC_UART5_CLK_ENABLE +#define __USART5_CLK_SLEEP_ENABLE __HAL_RCC_UART5_CLK_SLEEP_ENABLE +#define __USART5_CLK_SLEEP_DISABLE __HAL_RCC_UART5_CLK_SLEEP_DISABLE +#define __USART5_FORCE_RESET __HAL_RCC_UART5_FORCE_RESET +#define __USART5_RELEASE_RESET __HAL_RCC_UART5_RELEASE_RESET +#define __USART7_CLK_DISABLE __HAL_RCC_UART7_CLK_DISABLE +#define __USART7_CLK_ENABLE __HAL_RCC_UART7_CLK_ENABLE +#define __USART7_FORCE_RESET __HAL_RCC_UART7_FORCE_RESET +#define __USART7_RELEASE_RESET __HAL_RCC_UART7_RELEASE_RESET +#define __USART8_CLK_DISABLE __HAL_RCC_UART8_CLK_DISABLE +#define __USART8_CLK_ENABLE __HAL_RCC_UART8_CLK_ENABLE +#define __USART8_FORCE_RESET __HAL_RCC_UART8_FORCE_RESET +#define __USART8_RELEASE_RESET __HAL_RCC_UART8_RELEASE_RESET +#define __USB_CLK_DISABLE __HAL_RCC_USB_CLK_DISABLE +#define __USB_CLK_ENABLE __HAL_RCC_USB_CLK_ENABLE +#define __USB_FORCE_RESET __HAL_RCC_USB_FORCE_RESET +#define __USB_CLK_SLEEP_ENABLE __HAL_RCC_USB_CLK_SLEEP_ENABLE +#define __USB_CLK_SLEEP_DISABLE __HAL_RCC_USB_CLK_SLEEP_DISABLE +#define __USB_OTG_FS_CLK_DISABLE __HAL_RCC_USB_OTG_FS_CLK_DISABLE +#define __USB_OTG_FS_CLK_ENABLE __HAL_RCC_USB_OTG_FS_CLK_ENABLE +#define __USB_RELEASE_RESET __HAL_RCC_USB_RELEASE_RESET + +#if defined(STM32H7) +#define __HAL_RCC_WWDG_CLK_DISABLE __HAL_RCC_WWDG1_CLK_DISABLE +#define __HAL_RCC_WWDG_CLK_ENABLE __HAL_RCC_WWDG1_CLK_ENABLE +#define __HAL_RCC_WWDG_CLK_SLEEP_DISABLE __HAL_RCC_WWDG1_CLK_SLEEP_DISABLE +#define __HAL_RCC_WWDG_CLK_SLEEP_ENABLE __HAL_RCC_WWDG1_CLK_SLEEP_ENABLE + +#define __HAL_RCC_WWDG_FORCE_RESET ((void)0U) /* Not available on the STM32H7*/ +#define __HAL_RCC_WWDG_RELEASE_RESET ((void)0U) /* Not available on the STM32H7*/ + + +#define __HAL_RCC_WWDG_IS_CLK_ENABLED __HAL_RCC_WWDG1_IS_CLK_ENABLED +#define __HAL_RCC_WWDG_IS_CLK_DISABLED __HAL_RCC_WWDG1_IS_CLK_DISABLED +#define RCC_SPI4CLKSOURCE_D2PCLK1 RCC_SPI4CLKSOURCE_D2PCLK2 +#define RCC_SPI5CLKSOURCE_D2PCLK1 RCC_SPI5CLKSOURCE_D2PCLK2 +#define RCC_SPI45CLKSOURCE_D2PCLK1 RCC_SPI45CLKSOURCE_D2PCLK2 +#define RCC_SPI45CLKSOURCE_CDPCLK1 RCC_SPI45CLKSOURCE_CDPCLK2 +#define RCC_SPI45CLKSOURCE_PCLK1 RCC_SPI45CLKSOURCE_PCLK2 +#endif + +#define __WWDG_CLK_DISABLE __HAL_RCC_WWDG_CLK_DISABLE +#define __WWDG_CLK_ENABLE __HAL_RCC_WWDG_CLK_ENABLE +#define __WWDG_CLK_SLEEP_DISABLE __HAL_RCC_WWDG_CLK_SLEEP_DISABLE +#define __WWDG_CLK_SLEEP_ENABLE __HAL_RCC_WWDG_CLK_SLEEP_ENABLE +#define __WWDG_FORCE_RESET __HAL_RCC_WWDG_FORCE_RESET +#define __WWDG_RELEASE_RESET __HAL_RCC_WWDG_RELEASE_RESET + +#define __TIM21_CLK_ENABLE __HAL_RCC_TIM21_CLK_ENABLE +#define __TIM21_CLK_DISABLE __HAL_RCC_TIM21_CLK_DISABLE +#define __TIM21_FORCE_RESET __HAL_RCC_TIM21_FORCE_RESET +#define __TIM21_RELEASE_RESET __HAL_RCC_TIM21_RELEASE_RESET +#define __TIM21_CLK_SLEEP_ENABLE __HAL_RCC_TIM21_CLK_SLEEP_ENABLE +#define __TIM21_CLK_SLEEP_DISABLE __HAL_RCC_TIM21_CLK_SLEEP_DISABLE +#define __TIM22_CLK_ENABLE __HAL_RCC_TIM22_CLK_ENABLE +#define __TIM22_CLK_DISABLE __HAL_RCC_TIM22_CLK_DISABLE +#define __TIM22_FORCE_RESET __HAL_RCC_TIM22_FORCE_RESET +#define __TIM22_RELEASE_RESET __HAL_RCC_TIM22_RELEASE_RESET +#define __TIM22_CLK_SLEEP_ENABLE __HAL_RCC_TIM22_CLK_SLEEP_ENABLE +#define __TIM22_CLK_SLEEP_DISABLE __HAL_RCC_TIM22_CLK_SLEEP_DISABLE +#define __CRS_CLK_DISABLE __HAL_RCC_CRS_CLK_DISABLE +#define __CRS_CLK_ENABLE __HAL_RCC_CRS_CLK_ENABLE +#define __CRS_CLK_SLEEP_DISABLE __HAL_RCC_CRS_CLK_SLEEP_DISABLE +#define __CRS_CLK_SLEEP_ENABLE __HAL_RCC_CRS_CLK_SLEEP_ENABLE +#define __CRS_FORCE_RESET __HAL_RCC_CRS_FORCE_RESET +#define __CRS_RELEASE_RESET __HAL_RCC_CRS_RELEASE_RESET +#define __RCC_BACKUPRESET_FORCE __HAL_RCC_BACKUPRESET_FORCE +#define __RCC_BACKUPRESET_RELEASE __HAL_RCC_BACKUPRESET_RELEASE + +#define __USB_OTG_FS_FORCE_RESET __HAL_RCC_USB_OTG_FS_FORCE_RESET +#define __USB_OTG_FS_RELEASE_RESET __HAL_RCC_USB_OTG_FS_RELEASE_RESET +#define __USB_OTG_FS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_FS_CLK_SLEEP_ENABLE +#define __USB_OTG_FS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_FS_CLK_SLEEP_DISABLE +#define __USB_OTG_HS_CLK_DISABLE __HAL_RCC_USB_OTG_HS_CLK_DISABLE +#define __USB_OTG_HS_CLK_ENABLE __HAL_RCC_USB_OTG_HS_CLK_ENABLE +#define __USB_OTG_HS_ULPI_CLK_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE +#define __USB_OTG_HS_ULPI_CLK_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE +#define __TIM9_CLK_SLEEP_ENABLE __HAL_RCC_TIM9_CLK_SLEEP_ENABLE +#define __TIM9_CLK_SLEEP_DISABLE __HAL_RCC_TIM9_CLK_SLEEP_DISABLE +#define __TIM10_CLK_SLEEP_ENABLE __HAL_RCC_TIM10_CLK_SLEEP_ENABLE +#define __TIM10_CLK_SLEEP_DISABLE __HAL_RCC_TIM10_CLK_SLEEP_DISABLE +#define __TIM11_CLK_SLEEP_ENABLE __HAL_RCC_TIM11_CLK_SLEEP_ENABLE +#define __TIM11_CLK_SLEEP_DISABLE __HAL_RCC_TIM11_CLK_SLEEP_DISABLE +#define __ETHMACPTP_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACPTP_CLK_SLEEP_ENABLE +#define __ETHMACPTP_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACPTP_CLK_SLEEP_DISABLE +#define __ETHMACPTP_CLK_ENABLE __HAL_RCC_ETHMACPTP_CLK_ENABLE +#define __ETHMACPTP_CLK_DISABLE __HAL_RCC_ETHMACPTP_CLK_DISABLE +#define __HASH_CLK_ENABLE __HAL_RCC_HASH_CLK_ENABLE +#define __HASH_FORCE_RESET __HAL_RCC_HASH_FORCE_RESET +#define __HASH_RELEASE_RESET __HAL_RCC_HASH_RELEASE_RESET +#define __HASH_CLK_SLEEP_ENABLE __HAL_RCC_HASH_CLK_SLEEP_ENABLE +#define __HASH_CLK_SLEEP_DISABLE __HAL_RCC_HASH_CLK_SLEEP_DISABLE +#define __HASH_CLK_DISABLE __HAL_RCC_HASH_CLK_DISABLE +#define __SPI5_CLK_ENABLE __HAL_RCC_SPI5_CLK_ENABLE +#define __SPI5_CLK_DISABLE __HAL_RCC_SPI5_CLK_DISABLE +#define __SPI5_FORCE_RESET __HAL_RCC_SPI5_FORCE_RESET +#define __SPI5_RELEASE_RESET __HAL_RCC_SPI5_RELEASE_RESET +#define __SPI5_CLK_SLEEP_ENABLE __HAL_RCC_SPI5_CLK_SLEEP_ENABLE +#define __SPI5_CLK_SLEEP_DISABLE __HAL_RCC_SPI5_CLK_SLEEP_DISABLE +#define __SPI6_CLK_ENABLE __HAL_RCC_SPI6_CLK_ENABLE +#define __SPI6_CLK_DISABLE __HAL_RCC_SPI6_CLK_DISABLE +#define __SPI6_FORCE_RESET __HAL_RCC_SPI6_FORCE_RESET +#define __SPI6_RELEASE_RESET __HAL_RCC_SPI6_RELEASE_RESET +#define __SPI6_CLK_SLEEP_ENABLE __HAL_RCC_SPI6_CLK_SLEEP_ENABLE +#define __SPI6_CLK_SLEEP_DISABLE __HAL_RCC_SPI6_CLK_SLEEP_DISABLE +#define __LTDC_CLK_ENABLE __HAL_RCC_LTDC_CLK_ENABLE +#define __LTDC_CLK_DISABLE __HAL_RCC_LTDC_CLK_DISABLE +#define __LTDC_FORCE_RESET __HAL_RCC_LTDC_FORCE_RESET +#define __LTDC_RELEASE_RESET __HAL_RCC_LTDC_RELEASE_RESET +#define __LTDC_CLK_SLEEP_ENABLE __HAL_RCC_LTDC_CLK_SLEEP_ENABLE +#define __ETHMAC_CLK_SLEEP_ENABLE __HAL_RCC_ETHMAC_CLK_SLEEP_ENABLE +#define __ETHMAC_CLK_SLEEP_DISABLE __HAL_RCC_ETHMAC_CLK_SLEEP_DISABLE +#define __ETHMACTX_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACTX_CLK_SLEEP_ENABLE +#define __ETHMACTX_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACTX_CLK_SLEEP_DISABLE +#define __ETHMACRX_CLK_SLEEP_ENABLE __HAL_RCC_ETHMACRX_CLK_SLEEP_ENABLE +#define __ETHMACRX_CLK_SLEEP_DISABLE __HAL_RCC_ETHMACRX_CLK_SLEEP_DISABLE +#define __TIM12_CLK_SLEEP_ENABLE __HAL_RCC_TIM12_CLK_SLEEP_ENABLE +#define __TIM12_CLK_SLEEP_DISABLE __HAL_RCC_TIM12_CLK_SLEEP_DISABLE +#define __TIM13_CLK_SLEEP_ENABLE __HAL_RCC_TIM13_CLK_SLEEP_ENABLE +#define __TIM13_CLK_SLEEP_DISABLE __HAL_RCC_TIM13_CLK_SLEEP_DISABLE +#define __TIM14_CLK_SLEEP_ENABLE __HAL_RCC_TIM14_CLK_SLEEP_ENABLE +#define __TIM14_CLK_SLEEP_DISABLE __HAL_RCC_TIM14_CLK_SLEEP_DISABLE +#define __BKPSRAM_CLK_ENABLE __HAL_RCC_BKPSRAM_CLK_ENABLE +#define __BKPSRAM_CLK_DISABLE __HAL_RCC_BKPSRAM_CLK_DISABLE +#define __BKPSRAM_CLK_SLEEP_ENABLE __HAL_RCC_BKPSRAM_CLK_SLEEP_ENABLE +#define __BKPSRAM_CLK_SLEEP_DISABLE __HAL_RCC_BKPSRAM_CLK_SLEEP_DISABLE +#define __CCMDATARAMEN_CLK_ENABLE __HAL_RCC_CCMDATARAMEN_CLK_ENABLE +#define __CCMDATARAMEN_CLK_DISABLE __HAL_RCC_CCMDATARAMEN_CLK_DISABLE +#define __USART6_CLK_ENABLE __HAL_RCC_USART6_CLK_ENABLE +#define __USART6_CLK_DISABLE __HAL_RCC_USART6_CLK_DISABLE +#define __USART6_FORCE_RESET __HAL_RCC_USART6_FORCE_RESET +#define __USART6_RELEASE_RESET __HAL_RCC_USART6_RELEASE_RESET +#define __USART6_CLK_SLEEP_ENABLE __HAL_RCC_USART6_CLK_SLEEP_ENABLE +#define __USART6_CLK_SLEEP_DISABLE __HAL_RCC_USART6_CLK_SLEEP_DISABLE +#define __SPI4_CLK_ENABLE __HAL_RCC_SPI4_CLK_ENABLE +#define __SPI4_CLK_DISABLE __HAL_RCC_SPI4_CLK_DISABLE +#define __SPI4_FORCE_RESET __HAL_RCC_SPI4_FORCE_RESET +#define __SPI4_RELEASE_RESET __HAL_RCC_SPI4_RELEASE_RESET +#define __SPI4_CLK_SLEEP_ENABLE __HAL_RCC_SPI4_CLK_SLEEP_ENABLE +#define __SPI4_CLK_SLEEP_DISABLE __HAL_RCC_SPI4_CLK_SLEEP_DISABLE +#define __GPIOI_CLK_ENABLE __HAL_RCC_GPIOI_CLK_ENABLE +#define __GPIOI_CLK_DISABLE __HAL_RCC_GPIOI_CLK_DISABLE +#define __GPIOI_FORCE_RESET __HAL_RCC_GPIOI_FORCE_RESET +#define __GPIOI_RELEASE_RESET __HAL_RCC_GPIOI_RELEASE_RESET +#define __GPIOI_CLK_SLEEP_ENABLE __HAL_RCC_GPIOI_CLK_SLEEP_ENABLE +#define __GPIOI_CLK_SLEEP_DISABLE __HAL_RCC_GPIOI_CLK_SLEEP_DISABLE +#define __GPIOJ_CLK_ENABLE __HAL_RCC_GPIOJ_CLK_ENABLE +#define __GPIOJ_CLK_DISABLE __HAL_RCC_GPIOJ_CLK_DISABLE +#define __GPIOJ_FORCE_RESET __HAL_RCC_GPIOJ_FORCE_RESET +#define __GPIOJ_RELEASE_RESET __HAL_RCC_GPIOJ_RELEASE_RESET +#define __GPIOJ_CLK_SLEEP_ENABLE __HAL_RCC_GPIOJ_CLK_SLEEP_ENABLE +#define __GPIOJ_CLK_SLEEP_DISABLE __HAL_RCC_GPIOJ_CLK_SLEEP_DISABLE +#define __GPIOK_CLK_ENABLE __HAL_RCC_GPIOK_CLK_ENABLE +#define __GPIOK_CLK_DISABLE __HAL_RCC_GPIOK_CLK_DISABLE +#define __GPIOK_RELEASE_RESET __HAL_RCC_GPIOK_RELEASE_RESET +#define __GPIOK_CLK_SLEEP_ENABLE __HAL_RCC_GPIOK_CLK_SLEEP_ENABLE +#define __GPIOK_CLK_SLEEP_DISABLE __HAL_RCC_GPIOK_CLK_SLEEP_DISABLE +#define __ETH_CLK_ENABLE __HAL_RCC_ETH_CLK_ENABLE +#define __ETH_CLK_DISABLE __HAL_RCC_ETH_CLK_DISABLE +#define __DCMI_CLK_ENABLE __HAL_RCC_DCMI_CLK_ENABLE +#define __DCMI_CLK_DISABLE __HAL_RCC_DCMI_CLK_DISABLE +#define __DCMI_FORCE_RESET __HAL_RCC_DCMI_FORCE_RESET +#define __DCMI_RELEASE_RESET __HAL_RCC_DCMI_RELEASE_RESET +#define __DCMI_CLK_SLEEP_ENABLE __HAL_RCC_DCMI_CLK_SLEEP_ENABLE +#define __DCMI_CLK_SLEEP_DISABLE __HAL_RCC_DCMI_CLK_SLEEP_DISABLE +#define __UART7_CLK_ENABLE __HAL_RCC_UART7_CLK_ENABLE +#define __UART7_CLK_DISABLE __HAL_RCC_UART7_CLK_DISABLE +#define __UART7_RELEASE_RESET __HAL_RCC_UART7_RELEASE_RESET +#define __UART7_FORCE_RESET __HAL_RCC_UART7_FORCE_RESET +#define __UART7_CLK_SLEEP_ENABLE __HAL_RCC_UART7_CLK_SLEEP_ENABLE +#define __UART7_CLK_SLEEP_DISABLE __HAL_RCC_UART7_CLK_SLEEP_DISABLE +#define __UART8_CLK_ENABLE __HAL_RCC_UART8_CLK_ENABLE +#define __UART8_CLK_DISABLE __HAL_RCC_UART8_CLK_DISABLE +#define __UART8_FORCE_RESET __HAL_RCC_UART8_FORCE_RESET +#define __UART8_RELEASE_RESET __HAL_RCC_UART8_RELEASE_RESET +#define __UART8_CLK_SLEEP_ENABLE __HAL_RCC_UART8_CLK_SLEEP_ENABLE +#define __UART8_CLK_SLEEP_DISABLE __HAL_RCC_UART8_CLK_SLEEP_DISABLE +#define __OTGHS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE +#define __OTGHS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE +#define __OTGHS_FORCE_RESET __HAL_RCC_USB_OTG_HS_FORCE_RESET +#define __OTGHS_RELEASE_RESET __HAL_RCC_USB_OTG_HS_RELEASE_RESET +#define __OTGHSULPI_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE +#define __OTGHSULPI_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE +#define __HAL_RCC_OTGHS_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE +#define __HAL_RCC_OTGHS_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE +#define __HAL_RCC_OTGHS_IS_CLK_SLEEP_ENABLED __HAL_RCC_USB_OTG_HS_IS_CLK_SLEEP_ENABLED +#define __HAL_RCC_OTGHS_IS_CLK_SLEEP_DISABLED __HAL_RCC_USB_OTG_HS_IS_CLK_SLEEP_DISABLED +#define __HAL_RCC_OTGHS_FORCE_RESET __HAL_RCC_USB_OTG_HS_FORCE_RESET +#define __HAL_RCC_OTGHS_RELEASE_RESET __HAL_RCC_USB_OTG_HS_RELEASE_RESET +#define __HAL_RCC_OTGHSULPI_CLK_SLEEP_ENABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE +#define __HAL_RCC_OTGHSULPI_CLK_SLEEP_DISABLE __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE +#define __HAL_RCC_OTGHSULPI_IS_CLK_SLEEP_ENABLED __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_SLEEP_ENABLED +#define __HAL_RCC_OTGHSULPI_IS_CLK_SLEEP_DISABLED __HAL_RCC_USB_OTG_HS_ULPI_IS_CLK_SLEEP_DISABLED +#define __SRAM3_CLK_SLEEP_ENABLE __HAL_RCC_SRAM3_CLK_SLEEP_ENABLE +#define __CAN2_CLK_SLEEP_ENABLE __HAL_RCC_CAN2_CLK_SLEEP_ENABLE +#define __CAN2_CLK_SLEEP_DISABLE __HAL_RCC_CAN2_CLK_SLEEP_DISABLE +#define __DAC_CLK_SLEEP_ENABLE __HAL_RCC_DAC_CLK_SLEEP_ENABLE +#define __DAC_CLK_SLEEP_DISABLE __HAL_RCC_DAC_CLK_SLEEP_DISABLE +#define __ADC2_CLK_SLEEP_ENABLE __HAL_RCC_ADC2_CLK_SLEEP_ENABLE +#define __ADC2_CLK_SLEEP_DISABLE __HAL_RCC_ADC2_CLK_SLEEP_DISABLE +#define __ADC3_CLK_SLEEP_ENABLE __HAL_RCC_ADC3_CLK_SLEEP_ENABLE +#define __ADC3_CLK_SLEEP_DISABLE __HAL_RCC_ADC3_CLK_SLEEP_DISABLE +#define __FSMC_FORCE_RESET __HAL_RCC_FSMC_FORCE_RESET +#define __FSMC_RELEASE_RESET __HAL_RCC_FSMC_RELEASE_RESET +#define __FSMC_CLK_SLEEP_ENABLE __HAL_RCC_FSMC_CLK_SLEEP_ENABLE +#define __FSMC_CLK_SLEEP_DISABLE __HAL_RCC_FSMC_CLK_SLEEP_DISABLE +#define __SDIO_FORCE_RESET __HAL_RCC_SDIO_FORCE_RESET +#define __SDIO_RELEASE_RESET __HAL_RCC_SDIO_RELEASE_RESET +#define __SDIO_CLK_SLEEP_DISABLE __HAL_RCC_SDIO_CLK_SLEEP_DISABLE +#define __SDIO_CLK_SLEEP_ENABLE __HAL_RCC_SDIO_CLK_SLEEP_ENABLE +#define __DMA2D_CLK_ENABLE __HAL_RCC_DMA2D_CLK_ENABLE +#define __DMA2D_CLK_DISABLE __HAL_RCC_DMA2D_CLK_DISABLE +#define __DMA2D_FORCE_RESET __HAL_RCC_DMA2D_FORCE_RESET +#define __DMA2D_RELEASE_RESET __HAL_RCC_DMA2D_RELEASE_RESET +#define __DMA2D_CLK_SLEEP_ENABLE __HAL_RCC_DMA2D_CLK_SLEEP_ENABLE +#define __DMA2D_CLK_SLEEP_DISABLE __HAL_RCC_DMA2D_CLK_SLEEP_DISABLE + +/* alias define maintained for legacy */ +#define __HAL_RCC_OTGFS_FORCE_RESET __HAL_RCC_USB_OTG_FS_FORCE_RESET +#define __HAL_RCC_OTGFS_RELEASE_RESET __HAL_RCC_USB_OTG_FS_RELEASE_RESET + +#define __ADC12_CLK_ENABLE __HAL_RCC_ADC12_CLK_ENABLE +#define __ADC12_CLK_DISABLE __HAL_RCC_ADC12_CLK_DISABLE +#define __ADC34_CLK_ENABLE __HAL_RCC_ADC34_CLK_ENABLE +#define __ADC34_CLK_DISABLE __HAL_RCC_ADC34_CLK_DISABLE +#define __DAC2_CLK_ENABLE __HAL_RCC_DAC2_CLK_ENABLE +#define __DAC2_CLK_DISABLE __HAL_RCC_DAC2_CLK_DISABLE +#define __TIM18_CLK_ENABLE __HAL_RCC_TIM18_CLK_ENABLE +#define __TIM18_CLK_DISABLE __HAL_RCC_TIM18_CLK_DISABLE +#define __TIM19_CLK_ENABLE __HAL_RCC_TIM19_CLK_ENABLE +#define __TIM19_CLK_DISABLE __HAL_RCC_TIM19_CLK_DISABLE +#define __TIM20_CLK_ENABLE __HAL_RCC_TIM20_CLK_ENABLE +#define __TIM20_CLK_DISABLE __HAL_RCC_TIM20_CLK_DISABLE +#define __HRTIM1_CLK_ENABLE __HAL_RCC_HRTIM1_CLK_ENABLE +#define __HRTIM1_CLK_DISABLE __HAL_RCC_HRTIM1_CLK_DISABLE +#define __SDADC1_CLK_ENABLE __HAL_RCC_SDADC1_CLK_ENABLE +#define __SDADC2_CLK_ENABLE __HAL_RCC_SDADC2_CLK_ENABLE +#define __SDADC3_CLK_ENABLE __HAL_RCC_SDADC3_CLK_ENABLE +#define __SDADC1_CLK_DISABLE __HAL_RCC_SDADC1_CLK_DISABLE +#define __SDADC2_CLK_DISABLE __HAL_RCC_SDADC2_CLK_DISABLE +#define __SDADC3_CLK_DISABLE __HAL_RCC_SDADC3_CLK_DISABLE + +#define __ADC12_FORCE_RESET __HAL_RCC_ADC12_FORCE_RESET +#define __ADC12_RELEASE_RESET __HAL_RCC_ADC12_RELEASE_RESET +#define __ADC34_FORCE_RESET __HAL_RCC_ADC34_FORCE_RESET +#define __ADC34_RELEASE_RESET __HAL_RCC_ADC34_RELEASE_RESET +#define __DAC2_FORCE_RESET __HAL_RCC_DAC2_FORCE_RESET +#define __DAC2_RELEASE_RESET __HAL_RCC_DAC2_RELEASE_RESET +#define __TIM18_FORCE_RESET __HAL_RCC_TIM18_FORCE_RESET +#define __TIM18_RELEASE_RESET __HAL_RCC_TIM18_RELEASE_RESET +#define __TIM19_FORCE_RESET __HAL_RCC_TIM19_FORCE_RESET +#define __TIM19_RELEASE_RESET __HAL_RCC_TIM19_RELEASE_RESET +#define __TIM20_FORCE_RESET __HAL_RCC_TIM20_FORCE_RESET +#define __TIM20_RELEASE_RESET __HAL_RCC_TIM20_RELEASE_RESET +#define __HRTIM1_FORCE_RESET __HAL_RCC_HRTIM1_FORCE_RESET +#define __HRTIM1_RELEASE_RESET __HAL_RCC_HRTIM1_RELEASE_RESET +#define __SDADC1_FORCE_RESET __HAL_RCC_SDADC1_FORCE_RESET +#define __SDADC2_FORCE_RESET __HAL_RCC_SDADC2_FORCE_RESET +#define __SDADC3_FORCE_RESET __HAL_RCC_SDADC3_FORCE_RESET +#define __SDADC1_RELEASE_RESET __HAL_RCC_SDADC1_RELEASE_RESET +#define __SDADC2_RELEASE_RESET __HAL_RCC_SDADC2_RELEASE_RESET +#define __SDADC3_RELEASE_RESET __HAL_RCC_SDADC3_RELEASE_RESET + +#define __ADC1_IS_CLK_ENABLED __HAL_RCC_ADC1_IS_CLK_ENABLED +#define __ADC1_IS_CLK_DISABLED __HAL_RCC_ADC1_IS_CLK_DISABLED +#define __ADC12_IS_CLK_ENABLED __HAL_RCC_ADC12_IS_CLK_ENABLED +#define __ADC12_IS_CLK_DISABLED __HAL_RCC_ADC12_IS_CLK_DISABLED +#define __ADC34_IS_CLK_ENABLED __HAL_RCC_ADC34_IS_CLK_ENABLED +#define __ADC34_IS_CLK_DISABLED __HAL_RCC_ADC34_IS_CLK_DISABLED +#define __CEC_IS_CLK_ENABLED __HAL_RCC_CEC_IS_CLK_ENABLED +#define __CEC_IS_CLK_DISABLED __HAL_RCC_CEC_IS_CLK_DISABLED +#define __CRC_IS_CLK_ENABLED __HAL_RCC_CRC_IS_CLK_ENABLED +#define __CRC_IS_CLK_DISABLED __HAL_RCC_CRC_IS_CLK_DISABLED +#define __DAC1_IS_CLK_ENABLED __HAL_RCC_DAC1_IS_CLK_ENABLED +#define __DAC1_IS_CLK_DISABLED __HAL_RCC_DAC1_IS_CLK_DISABLED +#define __DAC2_IS_CLK_ENABLED __HAL_RCC_DAC2_IS_CLK_ENABLED +#define __DAC2_IS_CLK_DISABLED __HAL_RCC_DAC2_IS_CLK_DISABLED +#define __DMA1_IS_CLK_ENABLED __HAL_RCC_DMA1_IS_CLK_ENABLED +#define __DMA1_IS_CLK_DISABLED __HAL_RCC_DMA1_IS_CLK_DISABLED +#define __DMA2_IS_CLK_ENABLED __HAL_RCC_DMA2_IS_CLK_ENABLED +#define __DMA2_IS_CLK_DISABLED __HAL_RCC_DMA2_IS_CLK_DISABLED +#define __FLITF_IS_CLK_ENABLED __HAL_RCC_FLITF_IS_CLK_ENABLED +#define __FLITF_IS_CLK_DISABLED __HAL_RCC_FLITF_IS_CLK_DISABLED +#define __FMC_IS_CLK_ENABLED __HAL_RCC_FMC_IS_CLK_ENABLED +#define __FMC_IS_CLK_DISABLED __HAL_RCC_FMC_IS_CLK_DISABLED +#define __GPIOA_IS_CLK_ENABLED __HAL_RCC_GPIOA_IS_CLK_ENABLED +#define __GPIOA_IS_CLK_DISABLED __HAL_RCC_GPIOA_IS_CLK_DISABLED +#define __GPIOB_IS_CLK_ENABLED __HAL_RCC_GPIOB_IS_CLK_ENABLED +#define __GPIOB_IS_CLK_DISABLED __HAL_RCC_GPIOB_IS_CLK_DISABLED +#define __GPIOC_IS_CLK_ENABLED __HAL_RCC_GPIOC_IS_CLK_ENABLED +#define __GPIOC_IS_CLK_DISABLED __HAL_RCC_GPIOC_IS_CLK_DISABLED +#define __GPIOD_IS_CLK_ENABLED __HAL_RCC_GPIOD_IS_CLK_ENABLED +#define __GPIOD_IS_CLK_DISABLED __HAL_RCC_GPIOD_IS_CLK_DISABLED +#define __GPIOE_IS_CLK_ENABLED __HAL_RCC_GPIOE_IS_CLK_ENABLED +#define __GPIOE_IS_CLK_DISABLED __HAL_RCC_GPIOE_IS_CLK_DISABLED +#define __GPIOF_IS_CLK_ENABLED __HAL_RCC_GPIOF_IS_CLK_ENABLED +#define __GPIOF_IS_CLK_DISABLED __HAL_RCC_GPIOF_IS_CLK_DISABLED +#define __GPIOG_IS_CLK_ENABLED __HAL_RCC_GPIOG_IS_CLK_ENABLED +#define __GPIOG_IS_CLK_DISABLED __HAL_RCC_GPIOG_IS_CLK_DISABLED +#define __GPIOH_IS_CLK_ENABLED __HAL_RCC_GPIOH_IS_CLK_ENABLED +#define __GPIOH_IS_CLK_DISABLED __HAL_RCC_GPIOH_IS_CLK_DISABLED +#define __HRTIM1_IS_CLK_ENABLED __HAL_RCC_HRTIM1_IS_CLK_ENABLED +#define __HRTIM1_IS_CLK_DISABLED __HAL_RCC_HRTIM1_IS_CLK_DISABLED +#define __I2C1_IS_CLK_ENABLED __HAL_RCC_I2C1_IS_CLK_ENABLED +#define __I2C1_IS_CLK_DISABLED __HAL_RCC_I2C1_IS_CLK_DISABLED +#define __I2C2_IS_CLK_ENABLED __HAL_RCC_I2C2_IS_CLK_ENABLED +#define __I2C2_IS_CLK_DISABLED __HAL_RCC_I2C2_IS_CLK_DISABLED +#define __I2C3_IS_CLK_ENABLED __HAL_RCC_I2C3_IS_CLK_ENABLED +#define __I2C3_IS_CLK_DISABLED __HAL_RCC_I2C3_IS_CLK_DISABLED +#define __PWR_IS_CLK_ENABLED __HAL_RCC_PWR_IS_CLK_ENABLED +#define __PWR_IS_CLK_DISABLED __HAL_RCC_PWR_IS_CLK_DISABLED +#define __SYSCFG_IS_CLK_ENABLED __HAL_RCC_SYSCFG_IS_CLK_ENABLED +#define __SYSCFG_IS_CLK_DISABLED __HAL_RCC_SYSCFG_IS_CLK_DISABLED +#define __SPI1_IS_CLK_ENABLED __HAL_RCC_SPI1_IS_CLK_ENABLED +#define __SPI1_IS_CLK_DISABLED __HAL_RCC_SPI1_IS_CLK_DISABLED +#define __SPI2_IS_CLK_ENABLED __HAL_RCC_SPI2_IS_CLK_ENABLED +#define __SPI2_IS_CLK_DISABLED __HAL_RCC_SPI2_IS_CLK_DISABLED +#define __SPI3_IS_CLK_ENABLED __HAL_RCC_SPI3_IS_CLK_ENABLED +#define __SPI3_IS_CLK_DISABLED __HAL_RCC_SPI3_IS_CLK_DISABLED +#define __SPI4_IS_CLK_ENABLED __HAL_RCC_SPI4_IS_CLK_ENABLED +#define __SPI4_IS_CLK_DISABLED __HAL_RCC_SPI4_IS_CLK_DISABLED +#define __SDADC1_IS_CLK_ENABLED __HAL_RCC_SDADC1_IS_CLK_ENABLED +#define __SDADC1_IS_CLK_DISABLED __HAL_RCC_SDADC1_IS_CLK_DISABLED +#define __SDADC2_IS_CLK_ENABLED __HAL_RCC_SDADC2_IS_CLK_ENABLED +#define __SDADC2_IS_CLK_DISABLED __HAL_RCC_SDADC2_IS_CLK_DISABLED +#define __SDADC3_IS_CLK_ENABLED __HAL_RCC_SDADC3_IS_CLK_ENABLED +#define __SDADC3_IS_CLK_DISABLED __HAL_RCC_SDADC3_IS_CLK_DISABLED +#define __SRAM_IS_CLK_ENABLED __HAL_RCC_SRAM_IS_CLK_ENABLED +#define __SRAM_IS_CLK_DISABLED __HAL_RCC_SRAM_IS_CLK_DISABLED +#define __TIM1_IS_CLK_ENABLED __HAL_RCC_TIM1_IS_CLK_ENABLED +#define __TIM1_IS_CLK_DISABLED __HAL_RCC_TIM1_IS_CLK_DISABLED +#define __TIM2_IS_CLK_ENABLED __HAL_RCC_TIM2_IS_CLK_ENABLED +#define __TIM2_IS_CLK_DISABLED __HAL_RCC_TIM2_IS_CLK_DISABLED +#define __TIM3_IS_CLK_ENABLED __HAL_RCC_TIM3_IS_CLK_ENABLED +#define __TIM3_IS_CLK_DISABLED __HAL_RCC_TIM3_IS_CLK_DISABLED +#define __TIM4_IS_CLK_ENABLED __HAL_RCC_TIM4_IS_CLK_ENABLED +#define __TIM4_IS_CLK_DISABLED __HAL_RCC_TIM4_IS_CLK_DISABLED +#define __TIM5_IS_CLK_ENABLED __HAL_RCC_TIM5_IS_CLK_ENABLED +#define __TIM5_IS_CLK_DISABLED __HAL_RCC_TIM5_IS_CLK_DISABLED +#define __TIM6_IS_CLK_ENABLED __HAL_RCC_TIM6_IS_CLK_ENABLED +#define __TIM6_IS_CLK_DISABLED __HAL_RCC_TIM6_IS_CLK_DISABLED +#define __TIM7_IS_CLK_ENABLED __HAL_RCC_TIM7_IS_CLK_ENABLED +#define __TIM7_IS_CLK_DISABLED __HAL_RCC_TIM7_IS_CLK_DISABLED +#define __TIM8_IS_CLK_ENABLED __HAL_RCC_TIM8_IS_CLK_ENABLED +#define __TIM8_IS_CLK_DISABLED __HAL_RCC_TIM8_IS_CLK_DISABLED +#define __TIM12_IS_CLK_ENABLED __HAL_RCC_TIM12_IS_CLK_ENABLED +#define __TIM12_IS_CLK_DISABLED __HAL_RCC_TIM12_IS_CLK_DISABLED +#define __TIM13_IS_CLK_ENABLED __HAL_RCC_TIM13_IS_CLK_ENABLED +#define __TIM13_IS_CLK_DISABLED __HAL_RCC_TIM13_IS_CLK_DISABLED +#define __TIM14_IS_CLK_ENABLED __HAL_RCC_TIM14_IS_CLK_ENABLED +#define __TIM14_IS_CLK_DISABLED __HAL_RCC_TIM14_IS_CLK_DISABLED +#define __TIM15_IS_CLK_ENABLED __HAL_RCC_TIM15_IS_CLK_ENABLED +#define __TIM15_IS_CLK_DISABLED __HAL_RCC_TIM15_IS_CLK_DISABLED +#define __TIM16_IS_CLK_ENABLED __HAL_RCC_TIM16_IS_CLK_ENABLED +#define __TIM16_IS_CLK_DISABLED __HAL_RCC_TIM16_IS_CLK_DISABLED +#define __TIM17_IS_CLK_ENABLED __HAL_RCC_TIM17_IS_CLK_ENABLED +#define __TIM17_IS_CLK_DISABLED __HAL_RCC_TIM17_IS_CLK_DISABLED +#define __TIM18_IS_CLK_ENABLED __HAL_RCC_TIM18_IS_CLK_ENABLED +#define __TIM18_IS_CLK_DISABLED __HAL_RCC_TIM18_IS_CLK_DISABLED +#define __TIM19_IS_CLK_ENABLED __HAL_RCC_TIM19_IS_CLK_ENABLED +#define __TIM19_IS_CLK_DISABLED __HAL_RCC_TIM19_IS_CLK_DISABLED +#define __TIM20_IS_CLK_ENABLED __HAL_RCC_TIM20_IS_CLK_ENABLED +#define __TIM20_IS_CLK_DISABLED __HAL_RCC_TIM20_IS_CLK_DISABLED +#define __TSC_IS_CLK_ENABLED __HAL_RCC_TSC_IS_CLK_ENABLED +#define __TSC_IS_CLK_DISABLED __HAL_RCC_TSC_IS_CLK_DISABLED +#define __UART4_IS_CLK_ENABLED __HAL_RCC_UART4_IS_CLK_ENABLED +#define __UART4_IS_CLK_DISABLED __HAL_RCC_UART4_IS_CLK_DISABLED +#define __UART5_IS_CLK_ENABLED __HAL_RCC_UART5_IS_CLK_ENABLED +#define __UART5_IS_CLK_DISABLED __HAL_RCC_UART5_IS_CLK_DISABLED +#define __USART1_IS_CLK_ENABLED __HAL_RCC_USART1_IS_CLK_ENABLED +#define __USART1_IS_CLK_DISABLED __HAL_RCC_USART1_IS_CLK_DISABLED +#define __USART2_IS_CLK_ENABLED __HAL_RCC_USART2_IS_CLK_ENABLED +#define __USART2_IS_CLK_DISABLED __HAL_RCC_USART2_IS_CLK_DISABLED +#define __USART3_IS_CLK_ENABLED __HAL_RCC_USART3_IS_CLK_ENABLED +#define __USART3_IS_CLK_DISABLED __HAL_RCC_USART3_IS_CLK_DISABLED +#define __USB_IS_CLK_ENABLED __HAL_RCC_USB_IS_CLK_ENABLED +#define __USB_IS_CLK_DISABLED __HAL_RCC_USB_IS_CLK_DISABLED +#define __WWDG_IS_CLK_ENABLED __HAL_RCC_WWDG_IS_CLK_ENABLED +#define __WWDG_IS_CLK_DISABLED __HAL_RCC_WWDG_IS_CLK_DISABLED + +#if defined(STM32L1) +#define __HAL_RCC_CRYP_CLK_DISABLE __HAL_RCC_AES_CLK_DISABLE +#define __HAL_RCC_CRYP_CLK_ENABLE __HAL_RCC_AES_CLK_ENABLE +#define __HAL_RCC_CRYP_CLK_SLEEP_DISABLE __HAL_RCC_AES_CLK_SLEEP_DISABLE +#define __HAL_RCC_CRYP_CLK_SLEEP_ENABLE __HAL_RCC_AES_CLK_SLEEP_ENABLE +#define __HAL_RCC_CRYP_FORCE_RESET __HAL_RCC_AES_FORCE_RESET +#define __HAL_RCC_CRYP_RELEASE_RESET __HAL_RCC_AES_RELEASE_RESET +#endif /* STM32L1 */ + +#if defined(STM32F4) +#define __HAL_RCC_SDMMC1_FORCE_RESET __HAL_RCC_SDIO_FORCE_RESET +#define __HAL_RCC_SDMMC1_RELEASE_RESET __HAL_RCC_SDIO_RELEASE_RESET +#define __HAL_RCC_SDMMC1_CLK_SLEEP_ENABLE __HAL_RCC_SDIO_CLK_SLEEP_ENABLE +#define __HAL_RCC_SDMMC1_CLK_SLEEP_DISABLE __HAL_RCC_SDIO_CLK_SLEEP_DISABLE +#define __HAL_RCC_SDMMC1_CLK_ENABLE __HAL_RCC_SDIO_CLK_ENABLE +#define __HAL_RCC_SDMMC1_CLK_DISABLE __HAL_RCC_SDIO_CLK_DISABLE +#define __HAL_RCC_SDMMC1_IS_CLK_ENABLED __HAL_RCC_SDIO_IS_CLK_ENABLED +#define __HAL_RCC_SDMMC1_IS_CLK_DISABLED __HAL_RCC_SDIO_IS_CLK_DISABLED +#define Sdmmc1ClockSelection SdioClockSelection +#define RCC_PERIPHCLK_SDMMC1 RCC_PERIPHCLK_SDIO +#define RCC_SDMMC1CLKSOURCE_CLK48 RCC_SDIOCLKSOURCE_CK48 +#define RCC_SDMMC1CLKSOURCE_SYSCLK RCC_SDIOCLKSOURCE_SYSCLK +#define __HAL_RCC_SDMMC1_CONFIG __HAL_RCC_SDIO_CONFIG +#define __HAL_RCC_GET_SDMMC1_SOURCE __HAL_RCC_GET_SDIO_SOURCE +#endif + +#if defined(STM32F7) || defined(STM32L4) +#define __HAL_RCC_SDIO_FORCE_RESET __HAL_RCC_SDMMC1_FORCE_RESET +#define __HAL_RCC_SDIO_RELEASE_RESET __HAL_RCC_SDMMC1_RELEASE_RESET +#define __HAL_RCC_SDIO_CLK_SLEEP_ENABLE __HAL_RCC_SDMMC1_CLK_SLEEP_ENABLE +#define __HAL_RCC_SDIO_CLK_SLEEP_DISABLE __HAL_RCC_SDMMC1_CLK_SLEEP_DISABLE +#define __HAL_RCC_SDIO_CLK_ENABLE __HAL_RCC_SDMMC1_CLK_ENABLE +#define __HAL_RCC_SDIO_CLK_DISABLE __HAL_RCC_SDMMC1_CLK_DISABLE +#define __HAL_RCC_SDIO_IS_CLK_ENABLED __HAL_RCC_SDMMC1_IS_CLK_ENABLED +#define __HAL_RCC_SDIO_IS_CLK_DISABLED __HAL_RCC_SDMMC1_IS_CLK_DISABLED +#define SdioClockSelection Sdmmc1ClockSelection +#define RCC_PERIPHCLK_SDIO RCC_PERIPHCLK_SDMMC1 +#define __HAL_RCC_SDIO_CONFIG __HAL_RCC_SDMMC1_CONFIG +#define __HAL_RCC_GET_SDIO_SOURCE __HAL_RCC_GET_SDMMC1_SOURCE +#endif + +#if defined(STM32F7) +#define RCC_SDIOCLKSOURCE_CLK48 RCC_SDMMC1CLKSOURCE_CLK48 +#define RCC_SDIOCLKSOURCE_SYSCLK RCC_SDMMC1CLKSOURCE_SYSCLK +#endif + +#if defined(STM32H7) +#define __HAL_RCC_USB_OTG_HS_CLK_ENABLE() __HAL_RCC_USB1_OTG_HS_CLK_ENABLE() +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_ENABLE() __HAL_RCC_USB1_OTG_HS_ULPI_CLK_ENABLE() +#define __HAL_RCC_USB_OTG_HS_CLK_DISABLE() __HAL_RCC_USB1_OTG_HS_CLK_DISABLE() +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_DISABLE() __HAL_RCC_USB1_OTG_HS_ULPI_CLK_DISABLE() +#define __HAL_RCC_USB_OTG_HS_FORCE_RESET() __HAL_RCC_USB1_OTG_HS_FORCE_RESET() +#define __HAL_RCC_USB_OTG_HS_RELEASE_RESET() __HAL_RCC_USB1_OTG_HS_RELEASE_RESET() +#define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_ENABLE() __HAL_RCC_USB1_OTG_HS_CLK_SLEEP_ENABLE() +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_ENABLE() __HAL_RCC_USB1_OTG_HS_ULPI_CLK_SLEEP_ENABLE() +#define __HAL_RCC_USB_OTG_HS_CLK_SLEEP_DISABLE() __HAL_RCC_USB1_OTG_HS_CLK_SLEEP_DISABLE() +#define __HAL_RCC_USB_OTG_HS_ULPI_CLK_SLEEP_DISABLE() __HAL_RCC_USB1_OTG_HS_ULPI_CLK_SLEEP_DISABLE() + +#define __HAL_RCC_USB_OTG_FS_CLK_ENABLE() __HAL_RCC_USB2_OTG_FS_CLK_ENABLE() +#define __HAL_RCC_USB_OTG_FS_ULPI_CLK_ENABLE() __HAL_RCC_USB2_OTG_FS_ULPI_CLK_ENABLE() +#define __HAL_RCC_USB_OTG_FS_CLK_DISABLE() __HAL_RCC_USB2_OTG_FS_CLK_DISABLE() +#define __HAL_RCC_USB_OTG_FS_ULPI_CLK_DISABLE() __HAL_RCC_USB2_OTG_FS_ULPI_CLK_DISABLE() +#define __HAL_RCC_USB_OTG_FS_FORCE_RESET() __HAL_RCC_USB2_OTG_FS_FORCE_RESET() +#define __HAL_RCC_USB_OTG_FS_RELEASE_RESET() __HAL_RCC_USB2_OTG_FS_RELEASE_RESET() +#define __HAL_RCC_USB_OTG_FS_CLK_SLEEP_ENABLE() __HAL_RCC_USB2_OTG_FS_CLK_SLEEP_ENABLE() +#define __HAL_RCC_USB_OTG_FS_ULPI_CLK_SLEEP_ENABLE() __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_ENABLE() +#define __HAL_RCC_USB_OTG_FS_CLK_SLEEP_DISABLE() __HAL_RCC_USB2_OTG_FS_CLK_SLEEP_DISABLE() +#define __HAL_RCC_USB_OTG_FS_ULPI_CLK_SLEEP_DISABLE() __HAL_RCC_USB2_OTG_FS_ULPI_CLK_SLEEP_DISABLE() +#endif + +#define __HAL_RCC_I2SCLK __HAL_RCC_I2S_CONFIG +#define __HAL_RCC_I2SCLK_CONFIG __HAL_RCC_I2S_CONFIG + +#define __RCC_PLLSRC RCC_GET_PLL_OSCSOURCE + +#define IS_RCC_MSIRANGE IS_RCC_MSI_CLOCK_RANGE +#define IS_RCC_RTCCLK_SOURCE IS_RCC_RTCCLKSOURCE +#define IS_RCC_SYSCLK_DIV IS_RCC_HCLK +#define IS_RCC_HCLK_DIV IS_RCC_PCLK +#define IS_RCC_PERIPHCLK IS_RCC_PERIPHCLOCK + +#define RCC_IT_HSI14 RCC_IT_HSI14RDY + +#define RCC_IT_CSSLSE RCC_IT_LSECSS +#define RCC_IT_CSSHSE RCC_IT_CSS + +#define RCC_PLLMUL_3 RCC_PLL_MUL3 +#define RCC_PLLMUL_4 RCC_PLL_MUL4 +#define RCC_PLLMUL_6 RCC_PLL_MUL6 +#define RCC_PLLMUL_8 RCC_PLL_MUL8 +#define RCC_PLLMUL_12 RCC_PLL_MUL12 +#define RCC_PLLMUL_16 RCC_PLL_MUL16 +#define RCC_PLLMUL_24 RCC_PLL_MUL24 +#define RCC_PLLMUL_32 RCC_PLL_MUL32 +#define RCC_PLLMUL_48 RCC_PLL_MUL48 + +#define RCC_PLLDIV_2 RCC_PLL_DIV2 +#define RCC_PLLDIV_3 RCC_PLL_DIV3 +#define RCC_PLLDIV_4 RCC_PLL_DIV4 + +#define IS_RCC_MCOSOURCE IS_RCC_MCO1SOURCE +#define __HAL_RCC_MCO_CONFIG __HAL_RCC_MCO1_CONFIG +#define RCC_MCO_NODIV RCC_MCODIV_1 +#define RCC_MCO_DIV1 RCC_MCODIV_1 +#define RCC_MCO_DIV2 RCC_MCODIV_2 +#define RCC_MCO_DIV4 RCC_MCODIV_4 +#define RCC_MCO_DIV8 RCC_MCODIV_8 +#define RCC_MCO_DIV16 RCC_MCODIV_16 +#define RCC_MCO_DIV32 RCC_MCODIV_32 +#define RCC_MCO_DIV64 RCC_MCODIV_64 +#define RCC_MCO_DIV128 RCC_MCODIV_128 +#define RCC_MCOSOURCE_NONE RCC_MCO1SOURCE_NOCLOCK +#define RCC_MCOSOURCE_LSI RCC_MCO1SOURCE_LSI +#define RCC_MCOSOURCE_LSE RCC_MCO1SOURCE_LSE +#define RCC_MCOSOURCE_SYSCLK RCC_MCO1SOURCE_SYSCLK +#define RCC_MCOSOURCE_HSI RCC_MCO1SOURCE_HSI +#define RCC_MCOSOURCE_HSI14 RCC_MCO1SOURCE_HSI14 +#define RCC_MCOSOURCE_HSI48 RCC_MCO1SOURCE_HSI48 +#define RCC_MCOSOURCE_HSE RCC_MCO1SOURCE_HSE +#define RCC_MCOSOURCE_PLLCLK_DIV1 RCC_MCO1SOURCE_PLLCLK +#define RCC_MCOSOURCE_PLLCLK_NODIV RCC_MCO1SOURCE_PLLCLK +#define RCC_MCOSOURCE_PLLCLK_DIV2 RCC_MCO1SOURCE_PLLCLK_DIV2 + +#if defined(STM32L4) || defined(STM32WB) || defined(STM32G0) || defined(STM32G4) || defined(STM32L5) || \ + defined(STM32WL) || defined(STM32C0) +#define RCC_RTCCLKSOURCE_NO_CLK RCC_RTCCLKSOURCE_NONE +#else +#define RCC_RTCCLKSOURCE_NONE RCC_RTCCLKSOURCE_NO_CLK +#endif + +#define RCC_USBCLK_PLLSAI1 RCC_USBCLKSOURCE_PLLSAI1 +#define RCC_USBCLK_PLL RCC_USBCLKSOURCE_PLL +#define RCC_USBCLK_MSI RCC_USBCLKSOURCE_MSI +#define RCC_USBCLKSOURCE_PLLCLK RCC_USBCLKSOURCE_PLL +#define RCC_USBPLLCLK_DIV1 RCC_USBCLKSOURCE_PLL +#define RCC_USBPLLCLK_DIV1_5 RCC_USBCLKSOURCE_PLL_DIV1_5 +#define RCC_USBPLLCLK_DIV2 RCC_USBCLKSOURCE_PLL_DIV2 +#define RCC_USBPLLCLK_DIV3 RCC_USBCLKSOURCE_PLL_DIV3 + +#define HSION_BitNumber RCC_HSION_BIT_NUMBER +#define HSION_BITNUMBER RCC_HSION_BIT_NUMBER +#define HSEON_BitNumber RCC_HSEON_BIT_NUMBER +#define HSEON_BITNUMBER RCC_HSEON_BIT_NUMBER +#define MSION_BITNUMBER RCC_MSION_BIT_NUMBER +#define CSSON_BitNumber RCC_CSSON_BIT_NUMBER +#define CSSON_BITNUMBER RCC_CSSON_BIT_NUMBER +#define PLLON_BitNumber RCC_PLLON_BIT_NUMBER +#define PLLON_BITNUMBER RCC_PLLON_BIT_NUMBER +#define PLLI2SON_BitNumber RCC_PLLI2SON_BIT_NUMBER +#define I2SSRC_BitNumber RCC_I2SSRC_BIT_NUMBER +#define RTCEN_BitNumber RCC_RTCEN_BIT_NUMBER +#define RTCEN_BITNUMBER RCC_RTCEN_BIT_NUMBER +#define BDRST_BitNumber RCC_BDRST_BIT_NUMBER +#define BDRST_BITNUMBER RCC_BDRST_BIT_NUMBER +#define RTCRST_BITNUMBER RCC_RTCRST_BIT_NUMBER +#define LSION_BitNumber RCC_LSION_BIT_NUMBER +#define LSION_BITNUMBER RCC_LSION_BIT_NUMBER +#define LSEON_BitNumber RCC_LSEON_BIT_NUMBER +#define LSEON_BITNUMBER RCC_LSEON_BIT_NUMBER +#define LSEBYP_BITNUMBER RCC_LSEBYP_BIT_NUMBER +#define PLLSAION_BitNumber RCC_PLLSAION_BIT_NUMBER +#define TIMPRE_BitNumber RCC_TIMPRE_BIT_NUMBER +#define RMVF_BitNumber RCC_RMVF_BIT_NUMBER +#define RMVF_BITNUMBER RCC_RMVF_BIT_NUMBER +#define RCC_CR2_HSI14TRIM_BitNumber RCC_HSI14TRIM_BIT_NUMBER +#define CR_BYTE2_ADDRESS RCC_CR_BYTE2_ADDRESS +#define CIR_BYTE1_ADDRESS RCC_CIR_BYTE1_ADDRESS +#define CIR_BYTE2_ADDRESS RCC_CIR_BYTE2_ADDRESS +#define BDCR_BYTE0_ADDRESS RCC_BDCR_BYTE0_ADDRESS +#define DBP_TIMEOUT_VALUE RCC_DBP_TIMEOUT_VALUE +#define LSE_TIMEOUT_VALUE RCC_LSE_TIMEOUT_VALUE + +#define CR_HSION_BB RCC_CR_HSION_BB +#define CR_CSSON_BB RCC_CR_CSSON_BB +#define CR_PLLON_BB RCC_CR_PLLON_BB +#define CR_PLLI2SON_BB RCC_CR_PLLI2SON_BB +#define CR_MSION_BB RCC_CR_MSION_BB +#define CSR_LSION_BB RCC_CSR_LSION_BB +#define CSR_LSEON_BB RCC_CSR_LSEON_BB +#define CSR_LSEBYP_BB RCC_CSR_LSEBYP_BB +#define CSR_RTCEN_BB RCC_CSR_RTCEN_BB +#define CSR_RTCRST_BB RCC_CSR_RTCRST_BB +#define CFGR_I2SSRC_BB RCC_CFGR_I2SSRC_BB +#define BDCR_RTCEN_BB RCC_BDCR_RTCEN_BB +#define BDCR_BDRST_BB RCC_BDCR_BDRST_BB +#define CR_HSEON_BB RCC_CR_HSEON_BB +#define CSR_RMVF_BB RCC_CSR_RMVF_BB +#define CR_PLLSAION_BB RCC_CR_PLLSAION_BB +#define DCKCFGR_TIMPRE_BB RCC_DCKCFGR_TIMPRE_BB + +#define __HAL_RCC_CRS_ENABLE_FREQ_ERROR_COUNTER __HAL_RCC_CRS_FREQ_ERROR_COUNTER_ENABLE +#define __HAL_RCC_CRS_DISABLE_FREQ_ERROR_COUNTER __HAL_RCC_CRS_FREQ_ERROR_COUNTER_DISABLE +#define __HAL_RCC_CRS_ENABLE_AUTOMATIC_CALIB __HAL_RCC_CRS_AUTOMATIC_CALIB_ENABLE +#define __HAL_RCC_CRS_DISABLE_AUTOMATIC_CALIB __HAL_RCC_CRS_AUTOMATIC_CALIB_DISABLE +#define __HAL_RCC_CRS_CALCULATE_RELOADVALUE __HAL_RCC_CRS_RELOADVALUE_CALCULATE + +#define __HAL_RCC_GET_IT_SOURCE __HAL_RCC_GET_IT + +#define RCC_CRS_SYNCWARM RCC_CRS_SYNCWARN +#define RCC_CRS_TRIMOV RCC_CRS_TRIMOVF + +#define RCC_PERIPHCLK_CK48 RCC_PERIPHCLK_CLK48 +#define RCC_CK48CLKSOURCE_PLLQ RCC_CLK48CLKSOURCE_PLLQ +#define RCC_CK48CLKSOURCE_PLLSAIP RCC_CLK48CLKSOURCE_PLLSAIP +#define RCC_CK48CLKSOURCE_PLLI2SQ RCC_CLK48CLKSOURCE_PLLI2SQ +#define IS_RCC_CK48CLKSOURCE IS_RCC_CLK48CLKSOURCE +#define RCC_SDIOCLKSOURCE_CK48 RCC_SDIOCLKSOURCE_CLK48 + +#define __HAL_RCC_DFSDM_CLK_ENABLE __HAL_RCC_DFSDM1_CLK_ENABLE +#define __HAL_RCC_DFSDM_CLK_DISABLE __HAL_RCC_DFSDM1_CLK_DISABLE +#define __HAL_RCC_DFSDM_IS_CLK_ENABLED __HAL_RCC_DFSDM1_IS_CLK_ENABLED +#define __HAL_RCC_DFSDM_IS_CLK_DISABLED __HAL_RCC_DFSDM1_IS_CLK_DISABLED +#define __HAL_RCC_DFSDM_FORCE_RESET __HAL_RCC_DFSDM1_FORCE_RESET +#define __HAL_RCC_DFSDM_RELEASE_RESET __HAL_RCC_DFSDM1_RELEASE_RESET +#define __HAL_RCC_DFSDM_CLK_SLEEP_ENABLE __HAL_RCC_DFSDM1_CLK_SLEEP_ENABLE +#define __HAL_RCC_DFSDM_CLK_SLEEP_DISABLE __HAL_RCC_DFSDM1_CLK_SLEEP_DISABLE +#define __HAL_RCC_DFSDM_IS_CLK_SLEEP_ENABLED __HAL_RCC_DFSDM1_IS_CLK_SLEEP_ENABLED +#define __HAL_RCC_DFSDM_IS_CLK_SLEEP_DISABLED __HAL_RCC_DFSDM1_IS_CLK_SLEEP_DISABLED +#define DfsdmClockSelection Dfsdm1ClockSelection +#define RCC_PERIPHCLK_DFSDM RCC_PERIPHCLK_DFSDM1 +#define RCC_DFSDMCLKSOURCE_PCLK RCC_DFSDM1CLKSOURCE_PCLK2 +#define RCC_DFSDMCLKSOURCE_SYSCLK RCC_DFSDM1CLKSOURCE_SYSCLK +#define __HAL_RCC_DFSDM_CONFIG __HAL_RCC_DFSDM1_CONFIG +#define __HAL_RCC_GET_DFSDM_SOURCE __HAL_RCC_GET_DFSDM1_SOURCE +#define RCC_DFSDM1CLKSOURCE_PCLK RCC_DFSDM1CLKSOURCE_PCLK2 +#define RCC_SWPMI1CLKSOURCE_PCLK RCC_SWPMI1CLKSOURCE_PCLK1 +#define RCC_LPTIM1CLKSOURCE_PCLK RCC_LPTIM1CLKSOURCE_PCLK1 +#define RCC_LPTIM2CLKSOURCE_PCLK RCC_LPTIM2CLKSOURCE_PCLK1 + +#define RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB1 RCC_DFSDM1AUDIOCLKSOURCE_I2S1 +#define RCC_DFSDM1AUDIOCLKSOURCE_I2SAPB2 RCC_DFSDM1AUDIOCLKSOURCE_I2S2 +#define RCC_DFSDM2AUDIOCLKSOURCE_I2SAPB1 RCC_DFSDM2AUDIOCLKSOURCE_I2S1 +#define RCC_DFSDM2AUDIOCLKSOURCE_I2SAPB2 RCC_DFSDM2AUDIOCLKSOURCE_I2S2 +#define RCC_DFSDM1CLKSOURCE_APB2 RCC_DFSDM1CLKSOURCE_PCLK2 +#define RCC_DFSDM2CLKSOURCE_APB2 RCC_DFSDM2CLKSOURCE_PCLK2 +#define RCC_FMPI2C1CLKSOURCE_APB RCC_FMPI2C1CLKSOURCE_PCLK1 +#if defined(STM32U5) +#define MSIKPLLModeSEL RCC_MSIKPLL_MODE_SEL +#define MSISPLLModeSEL RCC_MSISPLL_MODE_SEL +#define __HAL_RCC_AHB21_CLK_DISABLE __HAL_RCC_AHB2_1_CLK_DISABLE +#define __HAL_RCC_AHB22_CLK_DISABLE __HAL_RCC_AHB2_2_CLK_DISABLE +#define __HAL_RCC_AHB1_CLK_Disable_Clear __HAL_RCC_AHB1_CLK_ENABLE +#define __HAL_RCC_AHB21_CLK_Disable_Clear __HAL_RCC_AHB2_1_CLK_ENABLE +#define __HAL_RCC_AHB22_CLK_Disable_Clear __HAL_RCC_AHB2_2_CLK_ENABLE +#define __HAL_RCC_AHB3_CLK_Disable_Clear __HAL_RCC_AHB3_CLK_ENABLE +#define __HAL_RCC_APB1_CLK_Disable_Clear __HAL_RCC_APB1_CLK_ENABLE +#define __HAL_RCC_APB2_CLK_Disable_Clear __HAL_RCC_APB2_CLK_ENABLE +#define __HAL_RCC_APB3_CLK_Disable_Clear __HAL_RCC_APB3_CLK_ENABLE +#define IS_RCC_MSIPLLModeSelection IS_RCC_MSIPLLMODE_SELECT +#define RCC_PERIPHCLK_CLK48 RCC_PERIPHCLK_ICLK +#define RCC_CLK48CLKSOURCE_HSI48 RCC_ICLK_CLKSOURCE_HSI48 +#define RCC_CLK48CLKSOURCE_PLL2 RCC_ICLK_CLKSOURCE_PLL2 +#define RCC_CLK48CLKSOURCE_PLL1 RCC_ICLK_CLKSOURCE_PLL1 +#define RCC_CLK48CLKSOURCE_MSIK RCC_ICLK_CLKSOURCE_MSIK +#define __HAL_RCC_ADC1_CLK_ENABLE __HAL_RCC_ADC12_CLK_ENABLE +#define __HAL_RCC_ADC1_CLK_DISABLE __HAL_RCC_ADC12_CLK_DISABLE +#define __HAL_RCC_ADC1_IS_CLK_ENABLED __HAL_RCC_ADC12_IS_CLK_ENABLED +#define __HAL_RCC_ADC1_IS_CLK_DISABLED __HAL_RCC_ADC12_IS_CLK_DISABLED +#define __HAL_RCC_ADC1_FORCE_RESET __HAL_RCC_ADC12_FORCE_RESET +#define __HAL_RCC_ADC1_RELEASE_RESET __HAL_RCC_ADC12_RELEASE_RESET +#define __HAL_RCC_ADC1_CLK_SLEEP_ENABLE __HAL_RCC_ADC12_CLK_SLEEP_ENABLE +#define __HAL_RCC_ADC1_CLK_SLEEP_DISABLE __HAL_RCC_ADC12_CLK_SLEEP_DISABLE +#define __HAL_RCC_GET_CLK48_SOURCE __HAL_RCC_GET_ICLK_SOURCE +#define __HAL_RCC_PLLFRACN_ENABLE __HAL_RCC_PLL_FRACN_ENABLE +#define __HAL_RCC_PLLFRACN_DISABLE __HAL_RCC_PLL_FRACN_DISABLE +#define __HAL_RCC_PLLFRACN_CONFIG __HAL_RCC_PLL_FRACN_CONFIG +#define IS_RCC_PLLFRACN_VALUE IS_RCC_PLL_FRACN_VALUE +#endif /* STM32U5 */ + +#if defined(STM32H5) +#define __HAL_RCC_PLLFRACN_ENABLE __HAL_RCC_PLL_FRACN_ENABLE +#define __HAL_RCC_PLLFRACN_DISABLE __HAL_RCC_PLL_FRACN_DISABLE +#define __HAL_RCC_PLLFRACN_CONFIG __HAL_RCC_PLL_FRACN_CONFIG +#define IS_RCC_PLLFRACN_VALUE IS_RCC_PLL_FRACN_VALUE + +#define RCC_PLLSOURCE_NONE RCC_PLL1_SOURCE_NONE +#define RCC_PLLSOURCE_HSI RCC_PLL1_SOURCE_HSI +#define RCC_PLLSOURCE_CSI RCC_PLL1_SOURCE_CSI +#define RCC_PLLSOURCE_HSE RCC_PLL1_SOURCE_HSE +#define RCC_PLLVCIRANGE_0 RCC_PLL1_VCIRANGE_0 +#define RCC_PLLVCIRANGE_1 RCC_PLL1_VCIRANGE_1 +#define RCC_PLLVCIRANGE_2 RCC_PLL1_VCIRANGE_2 +#define RCC_PLLVCIRANGE_3 RCC_PLL1_VCIRANGE_3 +#define RCC_PLL1VCOWIDE RCC_PLL1_VCORANGE_WIDE +#define RCC_PLL1VCOMEDIUM RCC_PLL1_VCORANGE_MEDIUM + +#define IS_RCC_PLLSOURCE IS_RCC_PLL1_SOURCE +#define IS_RCC_PLLRGE_VALUE IS_RCC_PLL1_VCIRGE_VALUE +#define IS_RCC_PLLVCORGE_VALUE IS_RCC_PLL1_VCORGE_VALUE +#define IS_RCC_PLLCLOCKOUT_VALUE IS_RCC_PLL1_CLOCKOUT_VALUE +#define IS_RCC_PLL_FRACN_VALUE IS_RCC_PLL1_FRACN_VALUE +#define IS_RCC_PLLM_VALUE IS_RCC_PLL1_DIVM_VALUE +#define IS_RCC_PLLN_VALUE IS_RCC_PLL1_MULN_VALUE +#define IS_RCC_PLLP_VALUE IS_RCC_PLL1_DIVP_VALUE +#define IS_RCC_PLLQ_VALUE IS_RCC_PLL1_DIVQ_VALUE +#define IS_RCC_PLLR_VALUE IS_RCC_PLL1_DIVR_VALUE + +#define __HAL_RCC_PLL_ENABLE __HAL_RCC_PLL1_ENABLE +#define __HAL_RCC_PLL_DISABLE __HAL_RCC_PLL1_DISABLE +#define __HAL_RCC_PLL_FRACN_ENABLE __HAL_RCC_PLL1_FRACN_ENABLE +#define __HAL_RCC_PLL_FRACN_DISABLE __HAL_RCC_PLL1_FRACN_DISABLE +#define __HAL_RCC_PLL_CONFIG __HAL_RCC_PLL1_CONFIG +#define __HAL_RCC_PLL_PLLSOURCE_CONFIG __HAL_RCC_PLL1_PLLSOURCE_CONFIG +#define __HAL_RCC_PLL_DIVM_CONFIG __HAL_RCC_PLL1_DIVM_CONFIG +#define __HAL_RCC_PLL_FRACN_CONFIG __HAL_RCC_PLL1_FRACN_CONFIG +#define __HAL_RCC_PLL_VCIRANGE __HAL_RCC_PLL1_VCIRANGE +#define __HAL_RCC_PLL_VCORANGE __HAL_RCC_PLL1_VCORANGE +#define __HAL_RCC_GET_PLL_OSCSOURCE __HAL_RCC_GET_PLL1_OSCSOURCE +#define __HAL_RCC_PLLCLKOUT_ENABLE __HAL_RCC_PLL1_CLKOUT_ENABLE +#define __HAL_RCC_PLLCLKOUT_DISABLE __HAL_RCC_PLL1_CLKOUT_DISABLE +#define __HAL_RCC_GET_PLLCLKOUT_CONFIG __HAL_RCC_GET_PLL1_CLKOUT_CONFIG + +#define __HAL_RCC_PLL2FRACN_ENABLE __HAL_RCC_PLL2_FRACN_ENABLE +#define __HAL_RCC_PLL2FRACN_DISABLE __HAL_RCC_PLL2_FRACN_DISABLE +#define __HAL_RCC_PLL2CLKOUT_ENABLE __HAL_RCC_PLL2_CLKOUT_ENABLE +#define __HAL_RCC_PLL2CLKOUT_DISABLE __HAL_RCC_PLL2_CLKOUT_DISABLE +#define __HAL_RCC_PLL2FRACN_CONFIG __HAL_RCC_PLL2_FRACN_CONFIG +#define __HAL_RCC_GET_PLL2CLKOUT_CONFIG __HAL_RCC_GET_PLL2_CLKOUT_CONFIG + +#define __HAL_RCC_PLL3FRACN_ENABLE __HAL_RCC_PLL3_FRACN_ENABLE +#define __HAL_RCC_PLL3FRACN_DISABLE __HAL_RCC_PLL3_FRACN_DISABLE +#define __HAL_RCC_PLL3CLKOUT_ENABLE __HAL_RCC_PLL3_CLKOUT_ENABLE +#define __HAL_RCC_PLL3CLKOUT_DISABLE __HAL_RCC_PLL3_CLKOUT_DISABLE +#define __HAL_RCC_PLL3FRACN_CONFIG __HAL_RCC_PLL3_FRACN_CONFIG +#define __HAL_RCC_GET_PLL3CLKOUT_CONFIG __HAL_RCC_GET_PLL3_CLKOUT_CONFIG + +#define RCC_PLL2VCIRANGE_0 RCC_PLL2_VCIRANGE_0 +#define RCC_PLL2VCIRANGE_1 RCC_PLL2_VCIRANGE_1 +#define RCC_PLL2VCIRANGE_2 RCC_PLL2_VCIRANGE_2 +#define RCC_PLL2VCIRANGE_3 RCC_PLL2_VCIRANGE_3 + +#define RCC_PLL2VCOWIDE RCC_PLL2_VCORANGE_WIDE +#define RCC_PLL2VCOMEDIUM RCC_PLL2_VCORANGE_MEDIUM + +#define RCC_PLL2SOURCE_NONE RCC_PLL2_SOURCE_NONE +#define RCC_PLL2SOURCE_HSI RCC_PLL2_SOURCE_HSI +#define RCC_PLL2SOURCE_CSI RCC_PLL2_SOURCE_CSI +#define RCC_PLL2SOURCE_HSE RCC_PLL2_SOURCE_HSE + +#define RCC_PLL3VCIRANGE_0 RCC_PLL3_VCIRANGE_0 +#define RCC_PLL3VCIRANGE_1 RCC_PLL3_VCIRANGE_1 +#define RCC_PLL3VCIRANGE_2 RCC_PLL3_VCIRANGE_2 +#define RCC_PLL3VCIRANGE_3 RCC_PLL3_VCIRANGE_3 + +#define RCC_PLL3VCOWIDE RCC_PLL3_VCORANGE_WIDE +#define RCC_PLL3VCOMEDIUM RCC_PLL3_VCORANGE_MEDIUM + +#define RCC_PLL3SOURCE_NONE RCC_PLL3_SOURCE_NONE +#define RCC_PLL3SOURCE_HSI RCC_PLL3_SOURCE_HSI +#define RCC_PLL3SOURCE_CSI RCC_PLL3_SOURCE_CSI +#define RCC_PLL3SOURCE_HSE RCC_PLL3_SOURCE_HSE + + +#endif /* STM32H5 */ + +/** + * @} + */ + +/** @defgroup HAL_RNG_Aliased_Macros HAL RNG Aliased Macros maintained for legacy purpose + * @{ + */ +#define HAL_RNG_ReadyCallback(__HANDLE__) HAL_RNG_ReadyDataCallback((__HANDLE__), uint32_t random32bit) + +/** + * @} + */ + +/** @defgroup HAL_RTC_Aliased_Macros HAL RTC Aliased Macros maintained for legacy purpose + * @{ + */ +#if defined (STM32G0) || defined (STM32L5) || defined (STM32L412xx) || defined (STM32L422xx) || \ + defined (STM32L4P5xx)|| defined (STM32L4Q5xx) || defined (STM32G4) || defined (STM32WL) || defined (STM32U5) || \ + defined (STM32WBA) || defined (STM32H5) || defined (STM32C0) +#else +#define __HAL_RTC_CLEAR_FLAG __HAL_RTC_EXTI_CLEAR_FLAG +#endif +#define __HAL_RTC_DISABLE_IT __HAL_RTC_EXTI_DISABLE_IT +#define __HAL_RTC_ENABLE_IT __HAL_RTC_EXTI_ENABLE_IT + +#if defined (STM32F1) +#define __HAL_RTC_EXTI_CLEAR_FLAG(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() + +#define __HAL_RTC_EXTI_ENABLE_IT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_ENABLE_IT() + +#define __HAL_RTC_EXTI_DISABLE_IT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_DISABLE_IT() + +#define __HAL_RTC_EXTI_GET_FLAG(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_GET_FLAG() + +#define __HAL_RTC_EXTI_GENERATE_SWIT(RTC_EXTI_LINE_ALARM_EVENT) __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() +#else +#define __HAL_RTC_EXTI_CLEAR_FLAG(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_CLEAR_FLAG() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_CLEAR_FLAG())) +#define __HAL_RTC_EXTI_ENABLE_IT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_ENABLE_IT() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_ENABLE_IT())) +#define __HAL_RTC_EXTI_DISABLE_IT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_DISABLE_IT() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_DISABLE_IT())) +#define __HAL_RTC_EXTI_GET_FLAG(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_GET_FLAG() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GET_FLAG())) +#define __HAL_RTC_EXTI_GENERATE_SWIT(__EXTI_LINE__) (((__EXTI_LINE__) == RTC_EXTI_LINE_ALARM_EVENT) ? __HAL_RTC_ALARM_EXTI_GENERATE_SWIT() : \ + (((__EXTI_LINE__) == RTC_EXTI_LINE_WAKEUPTIMER_EVENT) ? __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() : \ + __HAL_RTC_TAMPER_TIMESTAMP_EXTI_GENERATE_SWIT())) +#endif /* STM32F1 */ + +#define IS_ALARM IS_RTC_ALARM +#define IS_ALARM_MASK IS_RTC_ALARM_MASK +#define IS_TAMPER IS_RTC_TAMPER +#define IS_TAMPER_ERASE_MODE IS_RTC_TAMPER_ERASE_MODE +#define IS_TAMPER_FILTER IS_RTC_TAMPER_FILTER +#define IS_TAMPER_INTERRUPT IS_RTC_TAMPER_INTERRUPT +#define IS_TAMPER_MASKFLAG_STATE IS_RTC_TAMPER_MASKFLAG_STATE +#define IS_TAMPER_PRECHARGE_DURATION IS_RTC_TAMPER_PRECHARGE_DURATION +#define IS_TAMPER_PULLUP_STATE IS_RTC_TAMPER_PULLUP_STATE +#define IS_TAMPER_SAMPLING_FREQ IS_RTC_TAMPER_SAMPLING_FREQ +#define IS_TAMPER_TIMESTAMPONTAMPER_DETECTION IS_RTC_TAMPER_TIMESTAMPONTAMPER_DETECTION +#define IS_TAMPER_TRIGGER IS_RTC_TAMPER_TRIGGER +#define IS_WAKEUP_CLOCK IS_RTC_WAKEUP_CLOCK +#define IS_WAKEUP_COUNTER IS_RTC_WAKEUP_COUNTER + +#define __RTC_WRITEPROTECTION_ENABLE __HAL_RTC_WRITEPROTECTION_ENABLE +#define __RTC_WRITEPROTECTION_DISABLE __HAL_RTC_WRITEPROTECTION_DISABLE + +#if defined (STM32H5) +#define __HAL_RCC_RTCAPB_CLK_ENABLE __HAL_RCC_RTC_CLK_ENABLE +#define __HAL_RCC_RTCAPB_CLK_DISABLE __HAL_RCC_RTC_CLK_DISABLE +#endif /* STM32H5 */ + +/** + * @} + */ + +/** @defgroup HAL_SD_Aliased_Macros HAL SD/MMC Aliased Macros maintained for legacy purpose + * @{ + */ + +#define SD_OCR_CID_CSD_OVERWRIETE SD_OCR_CID_CSD_OVERWRITE +#define SD_CMD_SD_APP_STAUS SD_CMD_SD_APP_STATUS + +#if !defined(STM32F1) && !defined(STM32F2) && !defined(STM32F4) && !defined(STM32L1) +#define eMMC_HIGH_VOLTAGE_RANGE EMMC_HIGH_VOLTAGE_RANGE +#define eMMC_DUAL_VOLTAGE_RANGE EMMC_DUAL_VOLTAGE_RANGE +#define eMMC_LOW_VOLTAGE_RANGE EMMC_LOW_VOLTAGE_RANGE + +#define SDMMC_NSpeed_CLK_DIV SDMMC_NSPEED_CLK_DIV +#define SDMMC_HSpeed_CLK_DIV SDMMC_HSPEED_CLK_DIV +#endif + +#if defined(STM32F4) || defined(STM32F2) +#define SD_SDMMC_DISABLED SD_SDIO_DISABLED +#define SD_SDMMC_FUNCTION_BUSY SD_SDIO_FUNCTION_BUSY +#define SD_SDMMC_FUNCTION_FAILED SD_SDIO_FUNCTION_FAILED +#define SD_SDMMC_UNKNOWN_FUNCTION SD_SDIO_UNKNOWN_FUNCTION +#define SD_CMD_SDMMC_SEN_OP_COND SD_CMD_SDIO_SEN_OP_COND +#define SD_CMD_SDMMC_RW_DIRECT SD_CMD_SDIO_RW_DIRECT +#define SD_CMD_SDMMC_RW_EXTENDED SD_CMD_SDIO_RW_EXTENDED +#define __HAL_SD_SDMMC_ENABLE __HAL_SD_SDIO_ENABLE +#define __HAL_SD_SDMMC_DISABLE __HAL_SD_SDIO_DISABLE +#define __HAL_SD_SDMMC_DMA_ENABLE __HAL_SD_SDIO_DMA_ENABLE +#define __HAL_SD_SDMMC_DMA_DISABLE __HAL_SD_SDIO_DMA_DISABL +#define __HAL_SD_SDMMC_ENABLE_IT __HAL_SD_SDIO_ENABLE_IT +#define __HAL_SD_SDMMC_DISABLE_IT __HAL_SD_SDIO_DISABLE_IT +#define __HAL_SD_SDMMC_GET_FLAG __HAL_SD_SDIO_GET_FLAG +#define __HAL_SD_SDMMC_CLEAR_FLAG __HAL_SD_SDIO_CLEAR_FLAG +#define __HAL_SD_SDMMC_GET_IT __HAL_SD_SDIO_GET_IT +#define __HAL_SD_SDMMC_CLEAR_IT __HAL_SD_SDIO_CLEAR_IT +#define SDMMC_STATIC_FLAGS SDIO_STATIC_FLAGS +#define SDMMC_CMD0TIMEOUT SDIO_CMD0TIMEOUT +#define SD_SDMMC_SEND_IF_COND SD_SDIO_SEND_IF_COND +/* alias CMSIS */ +#define SDMMC1_IRQn SDIO_IRQn +#define SDMMC1_IRQHandler SDIO_IRQHandler +#endif + +#if defined(STM32F7) || defined(STM32L4) +#define SD_SDIO_DISABLED SD_SDMMC_DISABLED +#define SD_SDIO_FUNCTION_BUSY SD_SDMMC_FUNCTION_BUSY +#define SD_SDIO_FUNCTION_FAILED SD_SDMMC_FUNCTION_FAILED +#define SD_SDIO_UNKNOWN_FUNCTION SD_SDMMC_UNKNOWN_FUNCTION +#define SD_CMD_SDIO_SEN_OP_COND SD_CMD_SDMMC_SEN_OP_COND +#define SD_CMD_SDIO_RW_DIRECT SD_CMD_SDMMC_RW_DIRECT +#define SD_CMD_SDIO_RW_EXTENDED SD_CMD_SDMMC_RW_EXTENDED +#define __HAL_SD_SDIO_ENABLE __HAL_SD_SDMMC_ENABLE +#define __HAL_SD_SDIO_DISABLE __HAL_SD_SDMMC_DISABLE +#define __HAL_SD_SDIO_DMA_ENABLE __HAL_SD_SDMMC_DMA_ENABLE +#define __HAL_SD_SDIO_DMA_DISABL __HAL_SD_SDMMC_DMA_DISABLE +#define __HAL_SD_SDIO_ENABLE_IT __HAL_SD_SDMMC_ENABLE_IT +#define __HAL_SD_SDIO_DISABLE_IT __HAL_SD_SDMMC_DISABLE_IT +#define __HAL_SD_SDIO_GET_FLAG __HAL_SD_SDMMC_GET_FLAG +#define __HAL_SD_SDIO_CLEAR_FLAG __HAL_SD_SDMMC_CLEAR_FLAG +#define __HAL_SD_SDIO_GET_IT __HAL_SD_SDMMC_GET_IT +#define __HAL_SD_SDIO_CLEAR_IT __HAL_SD_SDMMC_CLEAR_IT +#define SDIO_STATIC_FLAGS SDMMC_STATIC_FLAGS +#define SDIO_CMD0TIMEOUT SDMMC_CMD0TIMEOUT +#define SD_SDIO_SEND_IF_COND SD_SDMMC_SEND_IF_COND +/* alias CMSIS for compatibilities */ +#define SDIO_IRQn SDMMC1_IRQn +#define SDIO_IRQHandler SDMMC1_IRQHandler +#endif + +#if defined(STM32F7) || defined(STM32F4) || defined(STM32F2) || defined(STM32L4) || defined(STM32H7) +#define HAL_SD_CardCIDTypedef HAL_SD_CardCIDTypeDef +#define HAL_SD_CardCSDTypedef HAL_SD_CardCSDTypeDef +#define HAL_SD_CardStatusTypedef HAL_SD_CardStatusTypeDef +#define HAL_SD_CardStateTypedef HAL_SD_CardStateTypeDef +#endif + +#if defined(STM32H7) || defined(STM32L5) +#define HAL_MMCEx_Read_DMADoubleBuffer0CpltCallback HAL_MMCEx_Read_DMADoubleBuf0CpltCallback +#define HAL_MMCEx_Read_DMADoubleBuffer1CpltCallback HAL_MMCEx_Read_DMADoubleBuf1CpltCallback +#define HAL_MMCEx_Write_DMADoubleBuffer0CpltCallback HAL_MMCEx_Write_DMADoubleBuf0CpltCallback +#define HAL_MMCEx_Write_DMADoubleBuffer1CpltCallback HAL_MMCEx_Write_DMADoubleBuf1CpltCallback +#define HAL_SDEx_Read_DMADoubleBuffer0CpltCallback HAL_SDEx_Read_DMADoubleBuf0CpltCallback +#define HAL_SDEx_Read_DMADoubleBuffer1CpltCallback HAL_SDEx_Read_DMADoubleBuf1CpltCallback +#define HAL_SDEx_Write_DMADoubleBuffer0CpltCallback HAL_SDEx_Write_DMADoubleBuf0CpltCallback +#define HAL_SDEx_Write_DMADoubleBuffer1CpltCallback HAL_SDEx_Write_DMADoubleBuf1CpltCallback +#define HAL_SD_DriveTransciver_1_8V_Callback HAL_SD_DriveTransceiver_1_8V_Callback +#endif +/** + * @} + */ + +/** @defgroup HAL_SMARTCARD_Aliased_Macros HAL SMARTCARD Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __SMARTCARD_ENABLE_IT __HAL_SMARTCARD_ENABLE_IT +#define __SMARTCARD_DISABLE_IT __HAL_SMARTCARD_DISABLE_IT +#define __SMARTCARD_ENABLE __HAL_SMARTCARD_ENABLE +#define __SMARTCARD_DISABLE __HAL_SMARTCARD_DISABLE +#define __SMARTCARD_DMA_REQUEST_ENABLE __HAL_SMARTCARD_DMA_REQUEST_ENABLE +#define __SMARTCARD_DMA_REQUEST_DISABLE __HAL_SMARTCARD_DMA_REQUEST_DISABLE + +#define __HAL_SMARTCARD_GETCLOCKSOURCE SMARTCARD_GETCLOCKSOURCE +#define __SMARTCARD_GETCLOCKSOURCE SMARTCARD_GETCLOCKSOURCE + +#define IS_SMARTCARD_ONEBIT_SAMPLING IS_SMARTCARD_ONE_BIT_SAMPLE + +/** + * @} + */ + +/** @defgroup HAL_SMBUS_Aliased_Macros HAL SMBUS Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_SMBUS_RESET_CR1 SMBUS_RESET_CR1 +#define __HAL_SMBUS_RESET_CR2 SMBUS_RESET_CR2 +#define __HAL_SMBUS_GENERATE_START SMBUS_GENERATE_START +#define __HAL_SMBUS_GET_ADDR_MATCH SMBUS_GET_ADDR_MATCH +#define __HAL_SMBUS_GET_DIR SMBUS_GET_DIR +#define __HAL_SMBUS_GET_STOP_MODE SMBUS_GET_STOP_MODE +#define __HAL_SMBUS_GET_PEC_MODE SMBUS_GET_PEC_MODE +#define __HAL_SMBUS_GET_ALERT_ENABLED SMBUS_GET_ALERT_ENABLED +/** + * @} + */ + +/** @defgroup HAL_SPI_Aliased_Macros HAL SPI Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_SPI_1LINE_TX SPI_1LINE_TX +#define __HAL_SPI_1LINE_RX SPI_1LINE_RX +#define __HAL_SPI_RESET_CRC SPI_RESET_CRC + +/** + * @} + */ + +/** @defgroup HAL_UART_Aliased_Macros HAL UART Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_UART_GETCLOCKSOURCE UART_GETCLOCKSOURCE +#define __HAL_UART_MASK_COMPUTATION UART_MASK_COMPUTATION +#define __UART_GETCLOCKSOURCE UART_GETCLOCKSOURCE +#define __UART_MASK_COMPUTATION UART_MASK_COMPUTATION + +#define IS_UART_WAKEUPMETHODE IS_UART_WAKEUPMETHOD + +#define IS_UART_ONEBIT_SAMPLE IS_UART_ONE_BIT_SAMPLE +#define IS_UART_ONEBIT_SAMPLING IS_UART_ONE_BIT_SAMPLE + +/** + * @} + */ + + +/** @defgroup HAL_USART_Aliased_Macros HAL USART Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __USART_ENABLE_IT __HAL_USART_ENABLE_IT +#define __USART_DISABLE_IT __HAL_USART_DISABLE_IT +#define __USART_ENABLE __HAL_USART_ENABLE +#define __USART_DISABLE __HAL_USART_DISABLE + +#define __HAL_USART_GETCLOCKSOURCE USART_GETCLOCKSOURCE +#define __USART_GETCLOCKSOURCE USART_GETCLOCKSOURCE + +#if defined(STM32F0) || defined(STM32F3) || defined(STM32F7) +#define USART_OVERSAMPLING_16 0x00000000U +#define USART_OVERSAMPLING_8 USART_CR1_OVER8 + +#define IS_USART_OVERSAMPLING(__SAMPLING__) (((__SAMPLING__) == USART_OVERSAMPLING_16) || \ + ((__SAMPLING__) == USART_OVERSAMPLING_8)) +#endif /* STM32F0 || STM32F3 || STM32F7 */ +/** + * @} + */ + +/** @defgroup HAL_USB_Aliased_Macros HAL USB Aliased Macros maintained for legacy purpose + * @{ + */ +#define USB_EXTI_LINE_WAKEUP USB_WAKEUP_EXTI_LINE + +#define USB_FS_EXTI_TRIGGER_RISING_EDGE USB_OTG_FS_WAKEUP_EXTI_RISING_EDGE +#define USB_FS_EXTI_TRIGGER_FALLING_EDGE USB_OTG_FS_WAKEUP_EXTI_FALLING_EDGE +#define USB_FS_EXTI_TRIGGER_BOTH_EDGE USB_OTG_FS_WAKEUP_EXTI_RISING_FALLING_EDGE +#define USB_FS_EXTI_LINE_WAKEUP USB_OTG_FS_WAKEUP_EXTI_LINE + +#define USB_HS_EXTI_TRIGGER_RISING_EDGE USB_OTG_HS_WAKEUP_EXTI_RISING_EDGE +#define USB_HS_EXTI_TRIGGER_FALLING_EDGE USB_OTG_HS_WAKEUP_EXTI_FALLING_EDGE +#define USB_HS_EXTI_TRIGGER_BOTH_EDGE USB_OTG_HS_WAKEUP_EXTI_RISING_FALLING_EDGE +#define USB_HS_EXTI_LINE_WAKEUP USB_OTG_HS_WAKEUP_EXTI_LINE + +#define __HAL_USB_EXTI_ENABLE_IT __HAL_USB_WAKEUP_EXTI_ENABLE_IT +#define __HAL_USB_EXTI_DISABLE_IT __HAL_USB_WAKEUP_EXTI_DISABLE_IT +#define __HAL_USB_EXTI_GET_FLAG __HAL_USB_WAKEUP_EXTI_GET_FLAG +#define __HAL_USB_EXTI_CLEAR_FLAG __HAL_USB_WAKEUP_EXTI_CLEAR_FLAG +#define __HAL_USB_EXTI_SET_RISING_EDGE_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_EDGE +#define __HAL_USB_EXTI_SET_FALLING_EDGE_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_FALLING_EDGE +#define __HAL_USB_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE + +#define __HAL_USB_FS_EXTI_ENABLE_IT __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_IT +#define __HAL_USB_FS_EXTI_DISABLE_IT __HAL_USB_OTG_FS_WAKEUP_EXTI_DISABLE_IT +#define __HAL_USB_FS_EXTI_GET_FLAG __HAL_USB_OTG_FS_WAKEUP_EXTI_GET_FLAG +#define __HAL_USB_FS_EXTI_CLEAR_FLAG __HAL_USB_OTG_FS_WAKEUP_EXTI_CLEAR_FLAG +#define __HAL_USB_FS_EXTI_SET_RISING_EGDE_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_EDGE +#define __HAL_USB_FS_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_FALLING_EDGE +#define __HAL_USB_FS_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_OTG_FS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE +#define __HAL_USB_FS_EXTI_GENERATE_SWIT __HAL_USB_OTG_FS_WAKEUP_EXTI_GENERATE_SWIT + +#define __HAL_USB_HS_EXTI_ENABLE_IT __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_IT +#define __HAL_USB_HS_EXTI_DISABLE_IT __HAL_USB_OTG_HS_WAKEUP_EXTI_DISABLE_IT +#define __HAL_USB_HS_EXTI_GET_FLAG __HAL_USB_OTG_HS_WAKEUP_EXTI_GET_FLAG +#define __HAL_USB_HS_EXTI_CLEAR_FLAG __HAL_USB_OTG_HS_WAKEUP_EXTI_CLEAR_FLAG +#define __HAL_USB_HS_EXTI_SET_RISING_EGDE_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_EDGE +#define __HAL_USB_HS_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_FALLING_EDGE +#define __HAL_USB_HS_EXTI_SET_FALLINGRISING_TRIGGER __HAL_USB_OTG_HS_WAKEUP_EXTI_ENABLE_RISING_FALLING_EDGE +#define __HAL_USB_HS_EXTI_GENERATE_SWIT __HAL_USB_OTG_HS_WAKEUP_EXTI_GENERATE_SWIT + +#define HAL_PCD_ActiveRemoteWakeup HAL_PCD_ActivateRemoteWakeup +#define HAL_PCD_DeActiveRemoteWakeup HAL_PCD_DeActivateRemoteWakeup + +#define HAL_PCD_SetTxFiFo HAL_PCDEx_SetTxFiFo +#define HAL_PCD_SetRxFiFo HAL_PCDEx_SetRxFiFo +/** + * @} + */ + +/** @defgroup HAL_TIM_Aliased_Macros HAL TIM Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_TIM_SetICPrescalerValue TIM_SET_ICPRESCALERVALUE +#define __HAL_TIM_ResetICPrescalerValue TIM_RESET_ICPRESCALERVALUE + +#define TIM_GET_ITSTATUS __HAL_TIM_GET_IT_SOURCE +#define TIM_GET_CLEAR_IT __HAL_TIM_CLEAR_IT + +#define __HAL_TIM_GET_ITSTATUS __HAL_TIM_GET_IT_SOURCE + +#define __HAL_TIM_DIRECTION_STATUS __HAL_TIM_IS_TIM_COUNTING_DOWN +#define __HAL_TIM_PRESCALER __HAL_TIM_SET_PRESCALER +#define __HAL_TIM_SetCounter __HAL_TIM_SET_COUNTER +#define __HAL_TIM_GetCounter __HAL_TIM_GET_COUNTER +#define __HAL_TIM_SetAutoreload __HAL_TIM_SET_AUTORELOAD +#define __HAL_TIM_GetAutoreload __HAL_TIM_GET_AUTORELOAD +#define __HAL_TIM_SetClockDivision __HAL_TIM_SET_CLOCKDIVISION +#define __HAL_TIM_GetClockDivision __HAL_TIM_GET_CLOCKDIVISION +#define __HAL_TIM_SetICPrescaler __HAL_TIM_SET_ICPRESCALER +#define __HAL_TIM_GetICPrescaler __HAL_TIM_GET_ICPRESCALER +#define __HAL_TIM_SetCompare __HAL_TIM_SET_COMPARE +#define __HAL_TIM_GetCompare __HAL_TIM_GET_COMPARE + +#define TIM_BREAKINPUTSOURCE_DFSDM TIM_BREAKINPUTSOURCE_DFSDM1 +/** + * @} + */ + +/** @defgroup HAL_ETH_Aliased_Macros HAL ETH Aliased Macros maintained for legacy purpose + * @{ + */ + +#define __HAL_ETH_EXTI_ENABLE_IT __HAL_ETH_WAKEUP_EXTI_ENABLE_IT +#define __HAL_ETH_EXTI_DISABLE_IT __HAL_ETH_WAKEUP_EXTI_DISABLE_IT +#define __HAL_ETH_EXTI_GET_FLAG __HAL_ETH_WAKEUP_EXTI_GET_FLAG +#define __HAL_ETH_EXTI_CLEAR_FLAG __HAL_ETH_WAKEUP_EXTI_CLEAR_FLAG +#define __HAL_ETH_EXTI_SET_RISING_EGDE_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_RISING_EDGE_TRIGGER +#define __HAL_ETH_EXTI_SET_FALLING_EGDE_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLING_EDGE_TRIGGER +#define __HAL_ETH_EXTI_SET_FALLINGRISING_TRIGGER __HAL_ETH_WAKEUP_EXTI_ENABLE_FALLINGRISING_TRIGGER + +#define ETH_PROMISCIOUSMODE_ENABLE ETH_PROMISCUOUS_MODE_ENABLE +#define ETH_PROMISCIOUSMODE_DISABLE ETH_PROMISCUOUS_MODE_DISABLE +#define IS_ETH_PROMISCIOUS_MODE IS_ETH_PROMISCUOUS_MODE +/** + * @} + */ + +/** @defgroup HAL_LTDC_Aliased_Macros HAL LTDC Aliased Macros maintained for legacy purpose + * @{ + */ +#define __HAL_LTDC_LAYER LTDC_LAYER +#define __HAL_LTDC_RELOAD_CONFIG __HAL_LTDC_RELOAD_IMMEDIATE_CONFIG +/** + * @} + */ + +/** @defgroup HAL_SAI_Aliased_Macros HAL SAI Aliased Macros maintained for legacy purpose + * @{ + */ +#define SAI_OUTPUTDRIVE_DISABLED SAI_OUTPUTDRIVE_DISABLE +#define SAI_OUTPUTDRIVE_ENABLED SAI_OUTPUTDRIVE_ENABLE +#define SAI_MASTERDIVIDER_ENABLED SAI_MASTERDIVIDER_ENABLE +#define SAI_MASTERDIVIDER_DISABLED SAI_MASTERDIVIDER_DISABLE +#define SAI_STREOMODE SAI_STEREOMODE +#define SAI_FIFOStatus_Empty SAI_FIFOSTATUS_EMPTY +#define SAI_FIFOStatus_Less1QuarterFull SAI_FIFOSTATUS_LESS1QUARTERFULL +#define SAI_FIFOStatus_1QuarterFull SAI_FIFOSTATUS_1QUARTERFULL +#define SAI_FIFOStatus_HalfFull SAI_FIFOSTATUS_HALFFULL +#define SAI_FIFOStatus_3QuartersFull SAI_FIFOSTATUS_3QUARTERFULL +#define SAI_FIFOStatus_Full SAI_FIFOSTATUS_FULL +#define IS_SAI_BLOCK_MONO_STREO_MODE IS_SAI_BLOCK_MONO_STEREO_MODE +#define SAI_SYNCHRONOUS_EXT SAI_SYNCHRONOUS_EXT_SAI1 +#define SAI_SYNCEXT_IN_ENABLE SAI_SYNCEXT_OUTBLOCKA_ENABLE +/** + * @} + */ + +/** @defgroup HAL_SPDIFRX_Aliased_Macros HAL SPDIFRX Aliased Macros maintained for legacy purpose + * @{ + */ +#if defined(STM32H7) +#define HAL_SPDIFRX_ReceiveControlFlow HAL_SPDIFRX_ReceiveCtrlFlow +#define HAL_SPDIFRX_ReceiveControlFlow_IT HAL_SPDIFRX_ReceiveCtrlFlow_IT +#define HAL_SPDIFRX_ReceiveControlFlow_DMA HAL_SPDIFRX_ReceiveCtrlFlow_DMA +#endif +/** + * @} + */ + +/** @defgroup HAL_HRTIM_Aliased_Functions HAL HRTIM Aliased Functions maintained for legacy purpose + * @{ + */ +#if defined (STM32H7) || defined (STM32G4) || defined (STM32F3) +#define HAL_HRTIM_WaveformCounterStart_IT HAL_HRTIM_WaveformCountStart_IT +#define HAL_HRTIM_WaveformCounterStart_DMA HAL_HRTIM_WaveformCountStart_DMA +#define HAL_HRTIM_WaveformCounterStart HAL_HRTIM_WaveformCountStart +#define HAL_HRTIM_WaveformCounterStop_IT HAL_HRTIM_WaveformCountStop_IT +#define HAL_HRTIM_WaveformCounterStop_DMA HAL_HRTIM_WaveformCountStop_DMA +#define HAL_HRTIM_WaveformCounterStop HAL_HRTIM_WaveformCountStop +#endif +/** + * @} + */ + +/** @defgroup HAL_QSPI_Aliased_Macros HAL QSPI Aliased Macros maintained for legacy purpose + * @{ + */ +#if defined (STM32L4) || defined (STM32F4) || defined (STM32F7) || defined(STM32H7) +#define HAL_QPSI_TIMEOUT_DEFAULT_VALUE HAL_QSPI_TIMEOUT_DEFAULT_VALUE +#endif /* STM32L4 || STM32F4 || STM32F7 */ +/** + * @} + */ + +/** @defgroup HAL_Generic_Aliased_Macros HAL Generic Aliased Macros maintained for legacy purpose + * @{ + */ +#if defined (STM32F7) +#define ART_ACCLERATOR_ENABLE ART_ACCELERATOR_ENABLE +#endif /* STM32F7 */ +/** + * @} + */ + +/** @defgroup HAL_PPP_Aliased_Macros HAL PPP Aliased Macros maintained for legacy purpose + * @{ + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32_HAL_LEGACY */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h new file mode 100644 index 0000000..eaa2c3c --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h @@ -0,0 +1,944 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal.h + * @author MCD Application Team + * @brief This file contains all the functions prototypes for the HAL + * module driver. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_H +#define __STM32F3xx_HAL_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_conf.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup HAL + * @{ + */ + +/* Private macros ------------------------------------------------------------*/ +/** @addtogroup HAL_Private_Macros + * @{ + */ +#define IS_SYSCFG_FASTMODEPLUS(__PIN__) ((((__PIN__) & SYSCFG_FASTMODEPLUS_PB6) == SYSCFG_FASTMODEPLUS_PB6) || \ + (((__PIN__) & SYSCFG_FASTMODEPLUS_PB7) == SYSCFG_FASTMODEPLUS_PB7) || \ + (((__PIN__) & SYSCFG_FASTMODEPLUS_PB8) == SYSCFG_FASTMODEPLUS_PB8) || \ + (((__PIN__) & SYSCFG_FASTMODEPLUS_PB9) == SYSCFG_FASTMODEPLUS_PB9)) +/** + * @} + */ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup HAL_Exported_Constants HAL Exported Constants + * @{ + */ + +/** @defgroup HAL_TICK_FREQ Tick Frequency + * @{ + */ +typedef enum +{ + HAL_TICK_FREQ_10HZ = 100U, + HAL_TICK_FREQ_100HZ = 10U, + HAL_TICK_FREQ_1KHZ = 1U, + HAL_TICK_FREQ_DEFAULT = HAL_TICK_FREQ_1KHZ +} HAL_TickFreqTypeDef; +/** + * @} + */ + +/** + * @} + */ +/** @defgroup HAL_Exported_Constants HAL Exported Constants + * @{ + */ +/** @defgroup SYSCFG_BitAddress_AliasRegion SYSCFG registers bit address in the alias region + * @brief SYSCFG registers bit address in the alias region + * @{ + */ +/* ------------ SYSCFG registers bit address in the alias region -------------*/ +#define SYSCFG_OFFSET (SYSCFG_BASE - PERIPH_BASE) +/* --- CFGR2 Register ---*/ +/* Alias word address of BYP_ADDR_PAR bit */ +#define CFGR2_OFFSET (SYSCFG_OFFSET + 0x18U) +#define BYPADDRPAR_BitNumber 0x04U +#define CFGR2_BYPADDRPAR_BB (PERIPH_BB_BASE + (CFGR2_OFFSET * 32U) + (BYPADDRPAR_BitNumber * 4U)) +/** + * @} + */ + +#if defined(SYSCFG_CFGR1_DMA_RMP) +/** @defgroup HAL_DMA_Remapping HAL DMA Remapping + * Elements values convention: 0xXXYYYYYY + * - YYYYYY : Position in the register + * - XX : Register index + * - 00: CFGR1 register in SYSCFG + * - 01: CFGR3 register in SYSCFG (not available on STM32F373xC/STM32F378xx devices) + * @{ + */ +#define HAL_REMAPDMA_ADC24_DMA2_CH34 (0x00000100U) /*!< ADC24 DMA remap (STM32F303xB/C/E, STM32F358xx and STM32F398xx devices) + 1: Remap (ADC24 DMA requests mapped on DMA2 channels 3 and 4) */ +#define HAL_REMAPDMA_TIM16_DMA1_CH6 (0x00000800U) /*!< TIM16 DMA request remap + 1: Remap (TIM16_CH1 and TIM16_UP DMA requests mapped on DMA1 channel 6) */ +#define HAL_REMAPDMA_TIM17_DMA1_CH7 (0x00001000U) /*!< TIM17 DMA request remap + 1: Remap (TIM17_CH1 and TIM17_UP DMA requests mapped on DMA1 channel 7) */ +#define HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3 (0x00002000U) /*!< TIM6 and DAC channel1 DMA remap (STM32F303xB/C/E, STM32F358xx and STM32F398xx devices) + 1: Remap (TIM6_UP and DAC_CH1 DMA requests mapped on DMA1 channel 3) */ +#define HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4 (0x00004000U) /*!< TIM7 and DAC channel2 DMA remap (STM32F303xB/C/E, STM32F358xx and STM32F398xx devices) + 1: Remap (TIM7_UP and DAC_CH2 DMA requests mapped on DMA1 channel 4) */ +#define HAL_REMAPDMA_DAC2_CH1_DMA1_CH5 (0x00008000U) /*!< DAC2 channel1 DMA remap (STM32F303x4/6/8 devices only) + 1: Remap (DAC2_CH1 DMA requests mapped on DMA1 channel 5) */ +#define HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5 (0x00008000U) /*!< DAC2 channel1 DMA remap (STM32F303x4/6/8 devices only) + 1: Remap (DAC2_CH1 DMA requests mapped on DMA1 channel 5) */ +#if defined(SYSCFG_CFGR3_DMA_RMP) +#if !defined(HAL_REMAP_CFGR3_MASK) +#define HAL_REMAP_CFGR3_MASK (0x01000000U) +#endif + +#define HAL_REMAPDMA_SPI1_RX_DMA1_CH2 (0x01000003U) /*!< SPI1_RX DMA remap (STM32F303x4/6/8 devices only) + 11: Map on DMA1 channel 2 */ +#define HAL_REMAPDMA_SPI1_RX_DMA1_CH4 (0x01000001U) /*!< SPI1_RX DMA remap (STM32F303x4/6/8 devices only) + 01: Map on DMA1 channel 4 */ +#define HAL_REMAPDMA_SPI1_RX_DMA1_CH6 (0x01000002U) /*!< SPI1_RX DMA remap (STM32F303x4/6/8 devices only) + 10: Map on DMA1 channel 6 */ +#define HAL_REMAPDMA_SPI1_TX_DMA1_CH3 (0x0100000CU) /*!< SPI1_TX DMA remap (STM32F303x4/6/8 devices only) + 11: Map on DMA1 channel 3 */ +#define HAL_REMAPDMA_SPI1_TX_DMA1_CH5 (0x01000004U) /*!< SPI1_TX DMA remap (STM32F303x4/6/8 devices only) + 01: Map on DMA1 channel 5 */ +#define HAL_REMAPDMA_SPI1_TX_DMA1_CH7 (0x01000008U) /*!< SPI1_TX DMA remap (STM32F303x4/6/8 devices only) + 10: Map on DMA1 channel 7 */ +#define HAL_REMAPDMA_I2C1_RX_DMA1_CH7 (0x01000030U) /*!< I2C1_RX DMA remap (STM32F303x4/6/8 devices only) + 11: Map on DMA1 channel 7 */ +#define HAL_REMAPDMA_I2C1_RX_DMA1_CH3 (0x01000010U) /*!< I2C1_RX DMA remap (STM32F303x4/6/8 devices only) + 01: Map on DMA1 channel 3 */ +#define HAL_REMAPDMA_I2C1_RX_DMA1_CH5 (0x01000020U) /*!< I2C1_RX DMA remap (STM32F303x4/6/8 devices only) + 10: Map on DMA1 channel 5 */ +#define HAL_REMAPDMA_I2C1_TX_DMA1_CH6 (0x010000C0U) /*!< I2C1_TX DMA remap (STM32F303x4/6/8 devices only) + 11: Map on DMA1 channel 6 */ +#define HAL_REMAPDMA_I2C1_TX_DMA1_CH2 (0x01000040U) /*!< I2C1_TX DMA remap (STM32F303x4/6/8 devices only) + 01: Map on DMA1 channel 2 */ +#define HAL_REMAPDMA_I2C1_TX_DMA1_CH4 (0x01000080U) /*!< I2C1_TX DMA remap (STM32F303x4/6/8 devices only) + 10: Map on DMA1 channel 4 */ +#define HAL_REMAPDMA_ADC2_DMA1_CH2 (0x01000100U) /*!< ADC2 DMA remap + x0: No remap (ADC2 on DMA2) + 10: Map on DMA1 channel 2 */ +#define HAL_REMAPDMA_ADC2_DMA1_CH4 (0x01000300U) /*!< ADC2 DMA remap + 11: Map on DMA1 channel 4 */ +#endif /* SYSCFG_CFGR3_DMA_RMP */ + +#if defined(SYSCFG_CFGR3_DMA_RMP) +#define IS_DMA_REMAP(RMP) ((((RMP) & HAL_REMAPDMA_ADC24_DMA2_CH34) == HAL_REMAPDMA_ADC24_DMA2_CH34) || \ + (((RMP) & HAL_REMAPDMA_TIM16_DMA1_CH6) == HAL_REMAPDMA_TIM16_DMA1_CH6) || \ + (((RMP) & HAL_REMAPDMA_TIM17_DMA1_CH7) == HAL_REMAPDMA_TIM17_DMA1_CH7) || \ + (((RMP) & HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3) == HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3) || \ + (((RMP) & HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4) == HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4) || \ + (((RMP) & HAL_REMAPDMA_DAC2_CH1_DMA1_CH5) == HAL_REMAPDMA_DAC2_CH1_DMA1_CH5) || \ + (((RMP) & HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5) == HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5) || \ + (((RMP) & HAL_REMAPDMA_SPI1_RX_DMA1_CH2) == HAL_REMAPDMA_SPI1_RX_DMA1_CH2) || \ + (((RMP) & HAL_REMAPDMA_SPI1_RX_DMA1_CH4) == HAL_REMAPDMA_SPI1_RX_DMA1_CH4) || \ + (((RMP) & HAL_REMAPDMA_SPI1_RX_DMA1_CH6) == HAL_REMAPDMA_SPI1_RX_DMA1_CH6) || \ + (((RMP) & HAL_REMAPDMA_SPI1_TX_DMA1_CH3) == HAL_REMAPDMA_SPI1_TX_DMA1_CH3) || \ + (((RMP) & HAL_REMAPDMA_SPI1_TX_DMA1_CH5) == HAL_REMAPDMA_SPI1_TX_DMA1_CH5) || \ + (((RMP) & HAL_REMAPDMA_SPI1_TX_DMA1_CH7) == HAL_REMAPDMA_SPI1_TX_DMA1_CH7) || \ + (((RMP) & HAL_REMAPDMA_I2C1_RX_DMA1_CH7) == HAL_REMAPDMA_I2C1_RX_DMA1_CH7) || \ + (((RMP) & HAL_REMAPDMA_I2C1_RX_DMA1_CH3) == HAL_REMAPDMA_I2C1_RX_DMA1_CH3) || \ + (((RMP) & HAL_REMAPDMA_I2C1_RX_DMA1_CH5) == HAL_REMAPDMA_I2C1_RX_DMA1_CH5) || \ + (((RMP) & HAL_REMAPDMA_I2C1_TX_DMA1_CH6) == HAL_REMAPDMA_I2C1_TX_DMA1_CH6) || \ + (((RMP) & HAL_REMAPDMA_I2C1_TX_DMA1_CH2) == HAL_REMAPDMA_I2C1_TX_DMA1_CH2) || \ + (((RMP) & HAL_REMAPDMA_I2C1_TX_DMA1_CH4) == HAL_REMAPDMA_I2C1_TX_DMA1_CH4) || \ + (((RMP) & HAL_REMAPDMA_ADC2_DMA1_CH2) == HAL_REMAPDMA_ADC2_DMA1_CH2) || \ + (((RMP) & HAL_REMAPDMA_ADC2_DMA1_CH4) == HAL_REMAPDMA_ADC2_DMA1_CH4)) +#else +#define IS_DMA_REMAP(RMP) ((((RMP) & HAL_REMAPDMA_ADC24_DMA2_CH34) == HAL_REMAPDMA_ADC24_DMA2_CH34) || \ + (((RMP) & HAL_REMAPDMA_TIM16_DMA1_CH6) == HAL_REMAPDMA_TIM16_DMA1_CH6) || \ + (((RMP) & HAL_REMAPDMA_TIM17_DMA1_CH7) == HAL_REMAPDMA_TIM17_DMA1_CH7) || \ + (((RMP) & HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3) == HAL_REMAPDMA_TIM6_DAC1_CH1_DMA1_CH3) || \ + (((RMP) & HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4) == HAL_REMAPDMA_TIM7_DAC1_CH2_DMA1_CH4) || \ + (((RMP) & HAL_REMAPDMA_DAC2_CH1_DMA1_CH5) == HAL_REMAPDMA_DAC2_CH1_DMA1_CH5) || \ + (((RMP) & HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5) == HAL_REMAPDMA_TIM18_DAC2_CH1_DMA1_CH5)) +#endif /* SYSCFG_CFGR3_DMA_RMP && SYSCFG_CFGR1_DMA_RMP*/ +/** + * @} + */ +#endif /* SYSCFG_CFGR1_DMA_RMP */ + +/** @defgroup HAL_Trigger_Remapping HAL Trigger Remapping + * Elements values convention: 0xXXYYYYYY + * - YYYYYY : Position in the register + * - XX : Register index + * - 00: CFGR1 register in SYSCFG + * - 01: CFGR3 register in SYSCFG + * @{ + */ +#define HAL_REMAPTRIGGER_DAC1_TRIG (0x00000080U) /*!< DAC trigger remap (when TSEL = 001 on STM32F303xB/C and STM32F358xx devices) + 0: No remap (DAC trigger is TIM8_TRGO) + 1: Remap (DAC trigger is TIM3_TRGO) */ +#define HAL_REMAPTRIGGER_TIM1_ITR3 (0x00000040U) /*!< TIM1 ITR3 trigger remap + 0: No remap + 1: Remap (TIM1_TRG3 = TIM17_OC) */ +#if defined(SYSCFG_CFGR3_TRIGGER_RMP) +#if !defined(HAL_REMAP_CFGR3_MASK) +#define HAL_REMAP_CFGR3_MASK (0x01000000U) +#endif +#define HAL_REMAPTRIGGER_DAC1_TRIG3 (0x01010000U) /*!< DAC1_CH1 / DAC1_CH2 Trigger remap + 0: Remap (DAC trigger is TIM15_TRGO) + 1: Remap (DAC trigger is HRTIM1_DAC1_TRIG1) */ +#define HAL_REMAPTRIGGER_DAC1_TRIG5 (0x01020000U) /*!< DAC1_CH1 / DAC1_CH2 Trigger remap + 0: No remap + 1: Remap (DAC trigger is HRTIM1_DAC1_TRIG2) */ +#define IS_HAL_REMAPTRIGGER(RMP) ((((RMP) & HAL_REMAPTRIGGER_DAC1) == HAL_REMAPTRIGGER_DAC1) || \ + (((RMP) & HAL_REMAPTRIGGER_TIM1_ITR3) == HAL_REMAPTRIGGER_TIM1_ITR3) || \ + (((RMP) & HAL_REMAPTRIGGER_DAC1_TRIG3) == HAL_REMAPTRIGGER_DAC1_TRIG3) || \ + (((RMP) & HAL_REMAPTRIGGER_DAC1_TRIG5) == HAL_REMAPTRIGGER_DAC1_TRIG5)) +#else +#define IS_HAL_REMAPTRIGGER(RMP) ((((RMP) & HAL_REMAPTRIGGER_DAC1) == HAL_REMAPTRIGGER_DAC1) || \ + (((RMP) & HAL_REMAPTRIGGER_TIM1_ITR3) == HAL_REMAPTRIGGER_TIM1_ITR3)) +#endif /* SYSCFG_CFGR3_TRIGGER_RMP */ +/** + * @} + */ + +#if defined (STM32F302xE) +/** @defgroup HAL_ADC_Trigger_Remapping HAL ADC Trigger Remapping + * @{ + */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT2 SYSCFG_CFGR4_ADC12_EXT2_RMP /*!< Input trigger of ADC12 regular channel EXT2 + 0: No remap (TIM1_CC3) + 1: Remap (TIM20_TRGO) */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT3 SYSCFG_CFGR4_ADC12_EXT3_RMP /*!< Input trigger of ADC12 regular channel EXT3 + 0: No remap (TIM2_CC2) + 1: Remap (TIM20_TRGO2) */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT5 SYSCFG_CFGR4_ADC12_EXT5_RMP /*!< Input trigger of ADC12 regular channel EXT5 + 0: No remap (TIM4_CC4) + 1: Remap (TIM20_CC1) */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT13 SYSCFG_CFGR4_ADC12_EXT13_RMP /*!< Input trigger of ADC12 regular channel EXT13 + 0: No remap (TIM6_TRGO) + 1: Remap (TIM20_CC2) */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT15 SYSCFG_CFGR4_ADC12_EXT15_RMP /*!< Input trigger of ADC12 regular channel EXT15 + 0: No remap (TIM3_CC4) + 1: Remap (TIM20_CC3) */ +#define HAL_REMAPADCTRIGGER_ADC12_JEXT3 SYSCFG_CFGR4_ADC12_JEXT3_RMP /*!< Input trigger of ADC12 injected channel JEXT3 + 0: No remap (TIM2_CC1) + 1: Remap (TIM20_TRGO) */ +#define HAL_REMAPADCTRIGGER_ADC12_JEXT6 SYSCFG_CFGR4_ADC12_JEXT6_RMP /*!< Input trigger of ADC12 injected channel JEXT6 + 0: No remap (EXTI line 15) + 1: Remap (TIM20_TRGO2) */ +#define HAL_REMAPADCTRIGGER_ADC12_JEXT13 SYSCFG_CFGR4_ADC12_JEXT13_RMP /*!< Input trigger of ADC12 injected channel JEXT13 + 0: No remap (TIM3_CC1) + 1: Remap (TIM20_CC4) */ + +#define IS_HAL_REMAPADCTRIGGER(RMP) ((((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT2) == HAL_REMAPADCTRIGGER_ADC12_EXT2) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT3) == HAL_REMAPADCTRIGGER_ADC12_EXT3) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT5) == HAL_REMAPADCTRIGGER_ADC12_EXT5) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT13) == HAL_REMAPADCTRIGGER_ADC12_EXT13) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT15) == HAL_REMAPADCTRIGGER_ADC12_EXT15) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT3) == HAL_REMAPADCTRIGGER_ADC12_JEXT3) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT6) == HAL_REMAPADCTRIGGER_ADC12_JEXT6) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT13) == HAL_REMAPADCTRIGGER_ADC12_JEXT13)) +/** + * @} + */ +#endif /* STM32F302xE */ + +#if defined (STM32F303xE) || defined (STM32F398xx) +/** @defgroup HAL_ADC_Trigger_Remapping HAL ADC Trigger Remapping + * @{ + */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT2 SYSCFG_CFGR4_ADC12_EXT2_RMP /*!< Input trigger of ADC12 regular channel EXT2 + 0: No remap (TIM1_CC3) + 1: Remap (TIM20_TRGO) */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT3 SYSCFG_CFGR4_ADC12_EXT3_RMP /*!< Input trigger of ADC12 regular channel EXT3 + 0: No remap (TIM2_CC2) + 1: Remap (TIM20_TRGO2) */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT5 SYSCFG_CFGR4_ADC12_EXT5_RMP /*!< Input trigger of ADC12 regular channel EXT5 + 0: No remap (TIM4_CC4) + 1: Remap (TIM20_CC1) */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT13 SYSCFG_CFGR4_ADC12_EXT13_RMP /*!< Input trigger of ADC12 regular channel EXT13 + 0: No remap (TIM6_TRGO) + 1: Remap (TIM20_CC2) */ +#define HAL_REMAPADCTRIGGER_ADC12_EXT15 SYSCFG_CFGR4_ADC12_EXT15_RMP /*!< Input trigger of ADC12 regular channel EXT15 + 0: No remap (TIM3_CC4) + 1: Remap (TIM20_CC3) */ +#define HAL_REMAPADCTRIGGER_ADC12_JEXT3 SYSCFG_CFGR4_ADC12_JEXT3_RMP /*!< Input trigger of ADC12 injected channel JEXT3 + 0: No remap (TIM2_CC1) + 1: Remap (TIM20_TRGO) */ +#define HAL_REMAPADCTRIGGER_ADC12_JEXT6 SYSCFG_CFGR4_ADC12_JEXT6_RMP /*!< Input trigger of ADC12 injected channel JEXT6 + 0: No remap (EXTI line 15) + 1: Remap (TIM20_TRGO2) */ +#define HAL_REMAPADCTRIGGER_ADC12_JEXT13 SYSCFG_CFGR4_ADC12_JEXT13_RMP /*!< Input trigger of ADC12 injected channel JEXT13 + 0: No remap (TIM3_CC1) + 1: Remap (TIM20_CC4) */ +#define HAL_REMAPADCTRIGGER_ADC34_EXT5 SYSCFG_CFGR4_ADC34_EXT5_RMP /*!< Input trigger of ADC34 regular channel EXT5 + 0: No remap (EXTI line 2) + 1: Remap (TIM20_TRGO) */ +#define HAL_REMAPADCTRIGGER_ADC34_EXT6 SYSCFG_CFGR4_ADC34_EXT6_RMP /*!< Input trigger of ADC34 regular channel EXT6 + 0: No remap (TIM4_CC1) + 1: Remap (TIM20_TRGO2) */ +#define HAL_REMAPADCTRIGGER_ADC34_EXT15 SYSCFG_CFGR4_ADC34_EXT15_RMP /*!< Input trigger of ADC34 regular channel EXT15 + 0: No remap (TIM2_CC1) + 1: Remap (TIM20_CC1) */ +#define HAL_REMAPADCTRIGGER_ADC34_JEXT5 SYSCFG_CFGR4_ADC34_JEXT5_RMP /*!< Input trigger of ADC34 injected channel JEXT5 + 0: No remap (TIM4_CC3) + 1: Remap (TIM20_TRGO) */ +#define HAL_REMAPADCTRIGGER_ADC34_JEXT11 SYSCFG_CFGR4_ADC34_JEXT11_RMP /*!< Input trigger of ADC34 injected channel JEXT11 + 0: No remap (TIM1_CC3) + 1: Remap (TIM20_TRGO2) */ +#define HAL_REMAPADCTRIGGER_ADC34_JEXT14 SYSCFG_CFGR4_ADC34_JEXT14_RMP /*!< Input trigger of ADC34 injected channel JEXT14 + 0: No remap (TIM7_TRGO) + 1: Remap (TIM20_CC2) */ + +#define IS_HAL_REMAPADCTRIGGER(RMP) ((((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT2) == HAL_REMAPADCTRIGGER_ADC12_EXT2) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT3) == HAL_REMAPADCTRIGGER_ADC12_EXT3) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT5) == HAL_REMAPADCTRIGGER_ADC12_EXT5) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT13) == HAL_REMAPADCTRIGGER_ADC12_EXT13) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_EXT15) == HAL_REMAPADCTRIGGER_ADC12_EXT15) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT3) == HAL_REMAPADCTRIGGER_ADC12_JEXT3) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT6) == HAL_REMAPADCTRIGGER_ADC12_JEXT6) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC12_JEXT13) == HAL_REMAPADCTRIGGER_ADC12_JEXT13) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC34_EXT5) == HAL_REMAPADCTRIGGER_ADC34_EXT5) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC34_EXT6) == HAL_REMAPADCTRIGGER_ADC34_EXT6) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC34_EXT15) == HAL_REMAPADCTRIGGER_ADC34_EXT15) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC34_JEXT5) == HAL_REMAPADCTRIGGER_ADC34_JEXT5) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC34_JEXT11) == HAL_REMAPADCTRIGGER_ADC34_JEXT11) || \ + (((RMP) & HAL_REMAPADCTRIGGER_ADC34_JEXT14) == HAL_REMAPADCTRIGGER_ADC34_JEXT14)) +/** + * @} + */ +#endif /* STM32F303xE || STM32F398xx */ + +/** @defgroup SYSCFG_FastModePlus_GPIO Fast-mode Plus on GPIO + * @{ + */ + +/** @brief Fast-mode Plus driving capability on a specific GPIO + */ +#if defined(SYSCFG_CFGR1_I2C_PB6_FMP) +#define SYSCFG_FASTMODEPLUS_PB6 ((uint32_t)SYSCFG_CFGR1_I2C_PB6_FMP) /*!< Enable Fast-mode Plus on PB6 */ +#endif /* SYSCFG_CFGR1_I2C_PB6_FMP */ + +#if defined(SYSCFG_CFGR1_I2C_PB7_FMP) +#define SYSCFG_FASTMODEPLUS_PB7 ((uint32_t)SYSCFG_CFGR1_I2C_PB7_FMP) /*!< Enable Fast-mode Plus on PB7 */ +#endif /* SYSCFG_CFGR1_I2C_PB7_FMP */ + +#if defined(SYSCFG_CFGR1_I2C_PB8_FMP) +#define SYSCFG_FASTMODEPLUS_PB8 ((uint32_t)SYSCFG_CFGR1_I2C_PB8_FMP) /*!< Enable Fast-mode Plus on PB8 */ +#endif /* SYSCFG_CFGR1_I2C_PB8_FMP */ + +#if defined(SYSCFG_CFGR1_I2C_PB9_FMP) +#define SYSCFG_FASTMODEPLUS_PB9 ((uint32_t)SYSCFG_CFGR1_I2C_PB9_FMP) /*!< Enable Fast-mode Plus on PB9 */ +#endif /* SYSCFG_CFGR1_I2C_PB9_FMP */ +/** + * @} + */ + +#if defined(SYSCFG_RCR_PAGE0) +/* CCM-SRAM defined */ +/** @defgroup HAL_Page_Write_Protection HAL CCM RAM page write protection + * @{ + */ +#define HAL_SYSCFG_WP_PAGE0 (SYSCFG_RCR_PAGE0) /*!< ICODE SRAM Write protection page 0 */ +#define HAL_SYSCFG_WP_PAGE1 (SYSCFG_RCR_PAGE1) /*!< ICODE SRAM Write protection page 1 */ +#define HAL_SYSCFG_WP_PAGE2 (SYSCFG_RCR_PAGE2) /*!< ICODE SRAM Write protection page 2 */ +#define HAL_SYSCFG_WP_PAGE3 (SYSCFG_RCR_PAGE3) /*!< ICODE SRAM Write protection page 3 */ +#if defined(SYSCFG_RCR_PAGE4) +/* More than 4KB CCM-SRAM defined */ +#define HAL_SYSCFG_WP_PAGE4 (SYSCFG_RCR_PAGE4) /*!< ICODE SRAM Write protection page 4 */ +#define HAL_SYSCFG_WP_PAGE5 (SYSCFG_RCR_PAGE5) /*!< ICODE SRAM Write protection page 5 */ +#define HAL_SYSCFG_WP_PAGE6 (SYSCFG_RCR_PAGE6) /*!< ICODE SRAM Write protection page 6 */ +#define HAL_SYSCFG_WP_PAGE7 (SYSCFG_RCR_PAGE7) /*!< ICODE SRAM Write protection page 7 */ +#endif /* SYSCFG_RCR_PAGE4 */ +#if defined(SYSCFG_RCR_PAGE8) +#define HAL_SYSCFG_WP_PAGE8 (SYSCFG_RCR_PAGE8) /*!< ICODE SRAM Write protection page 8 */ +#define HAL_SYSCFG_WP_PAGE9 (SYSCFG_RCR_PAGE9) /*!< ICODE SRAM Write protection page 9 */ +#define HAL_SYSCFG_WP_PAGE10 (SYSCFG_RCR_PAGE10) /*!< ICODE SRAM Write protection page 10 */ +#define HAL_SYSCFG_WP_PAGE11 (SYSCFG_RCR_PAGE11) /*!< ICODE SRAM Write protection page 11 */ +#define HAL_SYSCFG_WP_PAGE12 (SYSCFG_RCR_PAGE12) /*!< ICODE SRAM Write protection page 12 */ +#define HAL_SYSCFG_WP_PAGE13 (SYSCFG_RCR_PAGE13) /*!< ICODE SRAM Write protection page 13 */ +#define HAL_SYSCFG_WP_PAGE14 (SYSCFG_RCR_PAGE14) /*!< ICODE SRAM Write protection page 14 */ +#define HAL_SYSCFG_WP_PAGE15 (SYSCFG_RCR_PAGE15) /*!< ICODE SRAM Write protection page 15 */ +#endif /* SYSCFG_RCR_PAGE8 */ + +#if defined(SYSCFG_RCR_PAGE8) +#define IS_HAL_SYSCFG_WP_PAGE(__PAGE__) (((__PAGE__) > 0U) && ((__PAGE__) <= 0xFFFFU)) +#elif defined(SYSCFG_RCR_PAGE4) +#define IS_HAL_SYSCFG_WP_PAGE(__PAGE__) (((__PAGE__) > 0U) && ((__PAGE__) <= 0x00FFU)) +#else +#define IS_HAL_SYSCFG_WP_PAGE(__PAGE__) (((__PAGE__) > 0U) && ((__PAGE__) <= 0x000FU)) +#endif /* SYSCFG_RCR_PAGE8 */ +/** + * @} + */ +#endif /* SYSCFG_RCR_PAGE0 */ + +/** @defgroup HAL_SYSCFG_Interrupts HAL SYSCFG Interrupts + * @{ + */ +#define HAL_SYSCFG_IT_FPU_IOC (SYSCFG_CFGR1_FPU_IE_0) /*!< Floating Point Unit Invalid operation Interrupt */ +#define HAL_SYSCFG_IT_FPU_DZC (SYSCFG_CFGR1_FPU_IE_1) /*!< Floating Point Unit Divide-by-zero Interrupt */ +#define HAL_SYSCFG_IT_FPU_UFC (SYSCFG_CFGR1_FPU_IE_2) /*!< Floating Point Unit Underflow Interrupt */ +#define HAL_SYSCFG_IT_FPU_OFC (SYSCFG_CFGR1_FPU_IE_3) /*!< Floating Point Unit Overflow Interrupt */ +#define HAL_SYSCFG_IT_FPU_IDC (SYSCFG_CFGR1_FPU_IE_4) /*!< Floating Point Unit Input denormal Interrupt */ +#define HAL_SYSCFG_IT_FPU_IXC (SYSCFG_CFGR1_FPU_IE_5) /*!< Floating Point Unit Inexact Interrupt */ + +#define IS_HAL_SYSCFG_INTERRUPT(__INTERRUPT__) ((((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_0) == SYSCFG_CFGR1_FPU_IE_0) || \ + (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_1) == SYSCFG_CFGR1_FPU_IE_1) || \ + (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_2) == SYSCFG_CFGR1_FPU_IE_2) || \ + (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_3) == SYSCFG_CFGR1_FPU_IE_3) || \ + (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_4) == SYSCFG_CFGR1_FPU_IE_4) || \ + (((__INTERRUPT__) & SYSCFG_CFGR1_FPU_IE_5) == SYSCFG_CFGR1_FPU_IE_5)) + +/** + * @} + */ + +/** + * @} + */ + +/* Exported macros -----------------------------------------------------------*/ +/** @defgroup HAL_Exported_Macros HAL Exported Macros + * @{ + */ + +/** @defgroup Debug_MCU_APB1_Freeze Freeze/Unfreeze APB1 Peripherals in Debug mode + * @{ + */ +#if defined(DBGMCU_APB1_FZ_DBG_TIM2_STOP) +#define __HAL_DBGMCU_FREEZE_TIM2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM2_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM2_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM2_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM3_STOP) +#define __HAL_DBGMCU_FREEZE_TIM3() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM3_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM3() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM3_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM3_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM4_STOP) +#define __HAL_DBGMCU_FREEZE_TIM4() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM4_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM4() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM4_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM4_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM5_STOP) +#define __HAL_DBGMCU_FREEZE_TIM5() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM5_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM5() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM5_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM5_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM6_STOP) +#define __HAL_DBGMCU_FREEZE_TIM6() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM6_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM6() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM6_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM6_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM7_STOP) +#define __HAL_DBGMCU_FREEZE_TIM7() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM7_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM7() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM7_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM7_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM12_STOP) +#define __HAL_DBGMCU_FREEZE_TIM12() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM12_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM12() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM12_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM12_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM13_STOP) +#define __HAL_DBGMCU_FREEZE_TIM13() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM13_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM13() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM13_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM13_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM14_STOP) +#define __HAL_DBGMCU_FREEZE_TIM14() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM14_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM14() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM14_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM14_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_TIM18_STOP) +#define __HAL_FREEZE_TIM18_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM18_STOP)) +#define __HAL_UNFREEZE_TIM18_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM18_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_TIM14_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_RTC_STOP) +#define __HAL_DBGMCU_FREEZE_RTC() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_RTC_STOP)) +#define __HAL_DBGMCU_UNFREEZE_RTC() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_RTC_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_RTC_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_WWDG_STOP) +#define __HAL_DBGMCU_FREEZE_WWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_WWDG_STOP)) +#define __HAL_DBGMCU_UNFREEZE_WWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_WWDG_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_WWDG_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_IWDG_STOP) +#define __HAL_DBGMCU_FREEZE_IWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_IWDG_STOP)) +#define __HAL_DBGMCU_UNFREEZE_IWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_IWDG_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_IWDG_STOP */ + +#if defined(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT) +#define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)) +#endif /* DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT */ + +#if defined(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT) +#define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)) +#endif /* DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT */ + +#if defined(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT) +#define __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)) +#define __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)) +#endif /* DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT */ + +#if defined(DBGMCU_APB1_FZ_DBG_CAN_STOP) +#define __HAL_FREEZE_CAN_DBGMCU() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN_STOP)) +#define __HAL_UNFREEZE_CAN_DBGMCU() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN_STOP)) +#endif /* DBGMCU_APB1_FZ_DBG_CAN_STOP */ +/** + * @} + */ + +/** @defgroup Debug_MCU_APB2_Freeze Freeze/Unfreeze APB2 Peripherals in Debug mode + * @{ + */ +#if defined(DBGMCU_APB2_FZ_DBG_TIM1_STOP) +#define __HAL_DBGMCU_FREEZE_TIM1() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM1_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM1() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM1_STOP)) +#endif /* DBGMCU_APB2_FZ_DBG_TIM1_STOP */ + +#if defined(DBGMCU_APB2_FZ_DBG_TIM8_STOP) +#define __HAL_DBGMCU_FREEZE_TIM8() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM8_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM8() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM8_STOP)) +#endif /* DBGMCU_APB2_FZ_DBG_TIM8_STOP */ + +#if defined(DBGMCU_APB2_FZ_DBG_TIM15_STOP) +#define __HAL_DBGMCU_FREEZE_TIM15() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM15_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM15() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM15_STOP)) +#endif /* DBGMCU_APB2_FZ_DBG_TIM15_STOP */ + +#if defined(DBGMCU_APB2_FZ_DBG_TIM16_STOP) +#define __HAL_DBGMCU_FREEZE_TIM16() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM16_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM16() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM16_STOP)) +#endif /* DBGMCU_APB2_FZ_DBG_TIM16_STOP */ + +#if defined(DBGMCU_APB2_FZ_DBG_TIM17_STOP) +#define __HAL_DBGMCU_FREEZE_TIM17() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM17_STOP)) +#define __HAL_DBGMCU_UNFREEZE_TIM17() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM17_STOP)) +#endif /* DBGMCU_APB2_FZ_DBG_TIM17_STOP */ + +#if defined(DBGMCU_APB2_FZ_DBG_TIM19_STOP) +#define __HAL_FREEZE_TIM19_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM19_STOP)) +#define __HAL_UNFREEZE_TIM19_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM19_STOP)) +#endif /* DBGMCU_APB2_FZ_DBG_TIM19_STOP */ + +#if defined(DBGMCU_APB2_FZ_DBG_TIM20_STOP) +#define __HAL_FREEZE_TIM20_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM20_STOP)) +#define __HAL_UNFREEZE_TIM20_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM20_STOP)) +#endif /* DBGMCU_APB2_FZ_DBG_TIM20_STOP */ + +#if defined(DBGMCU_APB2_FZ_DBG_HRTIM1_STOP) +#define __HAL_FREEZE_HRTIM1_DBGMCU() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_HRTIM1_STOP)) +#define __HAL_UNFREEZE_HRTIM1_DBGMCU() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_HRTIM1_STOP)) +#endif /* DBGMCU_APB2_FZ_DBG_HRTIM1_STOP */ +/** + * @} + */ + +/** @defgroup Memory_Mapping_Selection Memory Mapping Selection + * @{ + */ +#if defined(SYSCFG_CFGR1_MEM_MODE) +/** @brief Main Flash memory mapped at 0x00000000 + */ +#define __HAL_SYSCFG_REMAPMEMORY_FLASH() (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE)) +#endif /* SYSCFG_CFGR1_MEM_MODE */ + +#if defined(SYSCFG_CFGR1_MEM_MODE_0) +/** @brief System Flash memory mapped at 0x00000000 + */ +#define __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH() do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE); \ + SYSCFG->CFGR1 |= SYSCFG_CFGR1_MEM_MODE_0; \ + }while(0U) +#endif /* SYSCFG_CFGR1_MEM_MODE_0 */ + +#if defined(SYSCFG_CFGR1_MEM_MODE_0) && defined(SYSCFG_CFGR1_MEM_MODE_1) +/** @brief Embedded SRAM mapped at 0x00000000 + */ +#define __HAL_SYSCFG_REMAPMEMORY_SRAM() do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE); \ + SYSCFG->CFGR1 |= (SYSCFG_CFGR1_MEM_MODE_0 | SYSCFG_CFGR1_MEM_MODE_1); \ + }while(0U) +#endif /* SYSCFG_CFGR1_MEM_MODE_0 && SYSCFG_CFGR1_MEM_MODE_1 */ + +#if defined(SYSCFG_CFGR1_MEM_MODE_2) +#define __HAL_SYSCFG_FMC_BANK() do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_MEM_MODE); \ + SYSCFG->CFGR1 |= (SYSCFG_CFGR1_MEM_MODE_2); \ + }while(0U) +#endif /* SYSCFG_CFGR1_MEM_MODE_2 */ +/** + * @} + */ + +/** @defgroup Encoder_Mode Encoder Mode + * @{ + */ +#if defined(SYSCFG_CFGR1_ENCODER_MODE) +/** @brief No Encoder mode + */ +#define __HAL_REMAPENCODER_NONE() (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_ENCODER_MODE)) +#endif /* SYSCFG_CFGR1_ENCODER_MODE */ + +#if defined(SYSCFG_CFGR1_ENCODER_MODE_0) +/** @brief Encoder mode : TIM2 IC1 and TIM2 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively + */ +#define __HAL_REMAPENCODER_TIM2() do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_ENCODER_MODE); \ + SYSCFG->CFGR1 |= SYSCFG_CFGR1_ENCODER_MODE_0; \ + }while(0U) +#endif /* SYSCFG_CFGR1_ENCODER_MODE_0 */ + +#if defined(SYSCFG_CFGR1_ENCODER_MODE_1) +/** @brief Encoder mode : TIM3 IC1 and TIM3 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively + */ +#define __HAL_REMAPENCODER_TIM3() do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_ENCODER_MODE); \ + SYSCFG->CFGR1 |= SYSCFG_CFGR1_ENCODER_MODE_1; \ + }while(0U) +#endif /* SYSCFG_CFGR1_ENCODER_MODE_1 */ + +#if defined(SYSCFG_CFGR1_ENCODER_MODE_0) && defined(SYSCFG_CFGR1_ENCODER_MODE_1) +/** @brief Encoder mode : TIM4 IC1 and TIM4 IC2 are connected to TIM15 IC1 and TIM15 IC2 (STM32F303xB/C and STM32F358xx devices) + */ +#define __HAL_REMAPENCODER_TIM4() do {SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_ENCODER_MODE); \ + SYSCFG->CFGR1 |= (SYSCFG_CFGR1_ENCODER_MODE_0 | SYSCFG_CFGR1_ENCODER_MODE_1); \ + }while(0U) +#endif /* SYSCFG_CFGR1_ENCODER_MODE_0 && SYSCFG_CFGR1_ENCODER_MODE_1 */ +/** + * @} + */ + +/** @defgroup DMA_Remap_Enable DMA Remap Enable + * @{ + */ +#if defined(SYSCFG_CFGR3_DMA_RMP) && defined(SYSCFG_CFGR1_DMA_RMP) +/** @brief DMA remapping enable/disable macros + * @param __DMA_REMAP__ This parameter can be a value of @ref HAL_DMA_Remapping + */ +#define __HAL_DMA_REMAP_CHANNEL_ENABLE(__DMA_REMAP__) do {assert_param(IS_DMA_REMAP((__DMA_REMAP__))); \ + (((__DMA_REMAP__) & HAL_REMAP_CFGR3_MASK) ? \ + (SYSCFG->CFGR3 |= ((__DMA_REMAP__) & ~HAL_REMAP_CFGR3_MASK)) : \ + (SYSCFG->CFGR1 |= (__DMA_REMAP__))); \ + }while(0U) +#define __HAL_DMA_REMAP_CHANNEL_DISABLE(__DMA_REMAP__) do {assert_param(IS_DMA_REMAP((__DMA_REMAP__))); \ + (((__DMA_REMAP__) & HAL_REMAP_CFGR3_MASK) ? \ + (SYSCFG->CFGR3 &= (~(__DMA_REMAP__) | HAL_REMAP_CFGR3_MASK)) : \ + (SYSCFG->CFGR1 &= ~(__DMA_REMAP__))); \ + }while(0U) +#elif defined(SYSCFG_CFGR1_DMA_RMP) +/** @brief DMA remapping enable/disable macros + * @param __DMA_REMAP__ This parameter can be a value of @ref HAL_DMA_Remapping + */ +#define __HAL_DMA_REMAP_CHANNEL_ENABLE(__DMA_REMAP__) do {assert_param(IS_DMA_REMAP((__DMA_REMAP__))); \ + SYSCFG->CFGR1 |= (__DMA_REMAP__); \ + }while(0U) +#define __HAL_DMA_REMAP_CHANNEL_DISABLE(__DMA_REMAP__) do {assert_param(IS_DMA_REMAP((__DMA_REMAP__))); \ + SYSCFG->CFGR1 &= ~(__DMA_REMAP__); \ + }while(0U) +#endif /* SYSCFG_CFGR3_DMA_RMP || SYSCFG_CFGR1_DMA_RMP */ +/** + * @} + */ + +/** @defgroup FastModePlus_GPIO Fast-mode Plus on GPIO + * @{ + */ +/** @brief Fast-mode Plus driving capability enable/disable macros + * @param __FASTMODEPLUS__ This parameter can be a value of @ref SYSCFG_FastModePlus_GPIO values. + * That you can find above these macros. + */ +#define __HAL_SYSCFG_FASTMODEPLUS_ENABLE(__FASTMODEPLUS__) do {assert_param(IS_SYSCFG_FASTMODEPLUS((__FASTMODEPLUS__)));\ + SET_BIT(SYSCFG->CFGR1, (__FASTMODEPLUS__));\ + }while(0U) + +#define __HAL_SYSCFG_FASTMODEPLUS_DISABLE(__FASTMODEPLUS__) do {assert_param(IS_SYSCFG_FASTMODEPLUS((__FASTMODEPLUS__)));\ + CLEAR_BIT(SYSCFG->CFGR1, (__FASTMODEPLUS__));\ + }while(0U) +/** + * @} + */ + +/** @defgroup Floating_Point_Unit_Interrupts_Enable Floating Point Unit Interrupts Enable + * @{ + */ +/** @brief SYSCFG interrupt enable/disable macros + * @param __INTERRUPT__ This parameter can be a value of @ref HAL_SYSCFG_Interrupts + */ +#define __HAL_SYSCFG_INTERRUPT_ENABLE(__INTERRUPT__) do {assert_param(IS_HAL_SYSCFG_INTERRUPT((__INTERRUPT__))); \ + SYSCFG->CFGR1 |= (__INTERRUPT__); \ + }while(0U) + +#define __HAL_SYSCFG_INTERRUPT_DISABLE(__INTERRUPT__) do {assert_param(IS_HAL_SYSCFG_INTERRUPT((__INTERRUPT__))); \ + SYSCFG->CFGR1 &= ~(__INTERRUPT__); \ + }while(0U) +/** + * @} + */ + +#if defined(SYSCFG_CFGR1_USB_IT_RMP) +/** @defgroup USB_Interrupt_Remap USB Interrupt Remap + * @{ + */ +/** @brief USB interrupt remapping enable/disable macros + */ +#define __HAL_REMAPINTERRUPT_USB_ENABLE() (SYSCFG->CFGR1 |= (SYSCFG_CFGR1_USB_IT_RMP)) +#define __HAL_REMAPINTERRUPT_USB_DISABLE() (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_USB_IT_RMP)) +/** + * @} + */ +#endif /* SYSCFG_CFGR1_USB_IT_RMP */ + +#if defined(SYSCFG_CFGR1_VBAT) +/** @defgroup VBAT_Monitoring_Enable VBAT Monitoring Enable + * @{ + */ +/** @brief SYSCFG interrupt enable/disable macros + */ +#define __HAL_SYSCFG_VBAT_MONITORING_ENABLE() (SYSCFG->CFGR1 |= (SYSCFG_CFGR1_VBAT)) +#define __HAL_SYSCFG_VBAT_MONITORING_DISABLE() (SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_VBAT)) +/** + * @} + */ +#endif /* SYSCFG_CFGR1_VBAT */ + +#if defined(SYSCFG_CFGR2_LOCKUP_LOCK) +/** @defgroup Cortex_Lockup_Enable Cortex Lockup Enable + * @{ + */ +/** @brief SYSCFG Break Lockup lock + * Enables and locks the connection of Cortex-M4 LOCKUP (Hardfault) output to TIM1/15/16/17 Break input + * @note The selected configuration is locked and can be unlocked by system reset + */ +#define __HAL_SYSCFG_BREAK_LOCKUP_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_LOCKUP_LOCK); \ + SYSCFG->CFGR2 |= SYSCFG_CFGR2_LOCKUP_LOCK; \ + }while(0U) +/** + * @} + */ +#endif /* SYSCFG_CFGR2_LOCKUP_LOCK */ + +#if defined(SYSCFG_CFGR2_PVD_LOCK) +/** @defgroup PVD_Lock_Enable PVD Lock + * @{ + */ +/** @brief SYSCFG Break PVD lock + * Enables and locks the PVD connection with Timer1/8/15/16/17 Break Input, , as well as the PVDE and PLS[2:0] in the PWR_CR register + * @note The selected configuration is locked and can be unlocked by system reset + */ +#define __HAL_SYSCFG_BREAK_PVD_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_PVD_LOCK); \ + SYSCFG->CFGR2 |= SYSCFG_CFGR2_PVD_LOCK; \ + }while(0U) +/** + * @} + */ +#endif /* SYSCFG_CFGR2_PVD_LOCK */ + +#if defined(SYSCFG_CFGR2_SRAM_PARITY_LOCK) +/** @defgroup SRAM_Parity_Lock SRAM Parity Lock + * @{ + */ +/** @brief SYSCFG Break SRAM PARITY lock + * Enables and locks the SRAM_PARITY error signal with Break Input of TIMER1/8/15/16/17 + * @note The selected configuration is locked and can be unlocked by system reset + */ +#define __HAL_SYSCFG_BREAK_SRAMPARITY_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_SRAM_PARITY_LOCK); \ + SYSCFG->CFGR2 |= SYSCFG_CFGR2_SRAM_PARITY_LOCK; \ + }while(0U) +/** + * @} + */ +#endif /* SYSCFG_CFGR2_SRAM_PARITY_LOCK */ + +/** @defgroup Trigger_Remapping_Enable Trigger Remapping Enable + * @{ + */ +#if defined(SYSCFG_CFGR3_TRIGGER_RMP) +/** @brief Trigger remapping enable/disable macros + * @param __TRIGGER_REMAP__ This parameter can be a value of @ref HAL_Trigger_Remapping + */ +#define __HAL_REMAPTRIGGER_ENABLE(__TRIGGER_REMAP__) do {assert_param(IS_HAL_REMAPTRIGGER((__TRIGGER_REMAP__))); \ + (((__TRIGGER_REMAP__) & HAL_REMAP_CFGR3_MASK) ? \ + (SYSCFG->CFGR3 |= ((__TRIGGER_REMAP__) & ~HAL_REMAP_CFGR3_MASK)) : \ + (SYSCFG->CFGR1 |= (__TRIGGER_REMAP__))); \ + }while(0U) +#define __HAL_REMAPTRIGGER_DISABLE(__TRIGGER_REMAP__) do {assert_param(IS_HAL_REMAPTRIGGER((__TRIGGER_REMAP__))); \ + (((__TRIGGER_REMAP__) & HAL_REMAP_CFGR3_MASK) ? \ + (SYSCFG->CFGR3 &= (~(__TRIGGER_REMAP__) | HAL_REMAP_CFGR3_MASK)) : \ + (SYSCFG->CFGR1 &= ~(__TRIGGER_REMAP__))); \ + }while(0U) +#else +/** @brief Trigger remapping enable/disable macros + * @param __TRIGGER_REMAP__ This parameter can be a value of @ref HAL_Trigger_Remapping + */ +#define __HAL_REMAPTRIGGER_ENABLE(__TRIGGER_REMAP__) do {assert_param(IS_HAL_REMAPTRIGGER((__TRIGGER_REMAP__))); \ + (SYSCFG->CFGR1 |= (__TRIGGER_REMAP__)); \ + }while(0U) +#define __HAL_REMAPTRIGGER_DISABLE(__TRIGGER_REMAP__) do {assert_param(IS_HAL_REMAPTRIGGER((__TRIGGER_REMAP__))); \ + (SYSCFG->CFGR1 &= ~(__TRIGGER_REMAP__)); \ + }while(0U) +#endif /* SYSCFG_CFGR3_TRIGGER_RMP */ +/** + * @} + */ + +#if defined (STM32F302xE) || defined (STM32F303xE) || defined (STM32F398xx) +/** @defgroup ADC_Trigger_Remapping_Enable ADC Trigger Remapping Enable + * @{ + */ +/** @brief ADC trigger remapping enable/disable macros + * @param __ADCTRIGGER_REMAP__ This parameter can be a value of @ref HAL_ADC_Trigger_Remapping + */ +#define __HAL_REMAPADCTRIGGER_ENABLE(__ADCTRIGGER_REMAP__) do {assert_param(IS_HAL_REMAPADCTRIGGER((__ADCTRIGGER_REMAP__))); \ + (SYSCFG->CFGR4 |= (__ADCTRIGGER_REMAP__)); \ + }while(0U) +#define __HAL_REMAPADCTRIGGER_DISABLE(__ADCTRIGGER_REMAP__) do {assert_param(IS_HAL_REMAPADCTRIGGER((__ADCTRIGGER_REMAP__))); \ + (SYSCFG->CFGR4 &= ~(__ADCTRIGGER_REMAP__)); \ + }while(0U) +/** + * @} + */ +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(SYSCFG_CFGR2_BYP_ADDR_PAR) +/** @defgroup RAM_Parity_Check_Disable RAM Parity Check Disable + * @{ + */ +/** + * @brief Parity check on RAM disable macro + * @note Disabling the parity check on RAM locks the configuration bit. + * To re-enable the parity check on RAM perform a system reset. + */ +#define __HAL_SYSCFG_RAM_PARITYCHECK_DISABLE() (*(__IO uint32_t *) CFGR2_BYPADDRPAR_BB = 0x00000001U) +/** + * @} + */ +#endif /* SYSCFG_CFGR2_BYP_ADDR_PAR */ + +#if defined(SYSCFG_RCR_PAGE0) +/** @defgroup CCM_RAM_Page_Write_Protection_Enable CCM RAM page write protection enable + * @{ + */ +/** @brief CCM RAM page write protection enable macro + * @param __PAGE_WP__ This parameter can be a value of @ref HAL_Page_Write_Protection + * @note write protection can only be disabled by a system reset + */ +#define __HAL_SYSCFG_SRAM_WRP_ENABLE(__PAGE_WP__) do {assert_param(IS_HAL_SYSCFG_WP_PAGE((__PAGE_WP__))); \ + SYSCFG->RCR |= (__PAGE_WP__); \ + }while(0U) +/** + * @} + */ +#endif /* SYSCFG_RCR_PAGE0 */ + +/** + * @} + */ +/* Private macro -------------------------------------------------------------*/ +/** @defgroup HAL_Private_Macros HAL Private Macros + * @{ + */ +#define IS_TICKFREQ(FREQ) (((FREQ) == HAL_TICK_FREQ_10HZ) || \ + ((FREQ) == HAL_TICK_FREQ_100HZ) || \ + ((FREQ) == HAL_TICK_FREQ_1KHZ)) +/** + * @} + */ +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup HAL_Exported_Functions HAL Exported Functions + * @{ + */ + +/** @addtogroup HAL_Exported_Functions_Group1 Initialization and de-initialization Functions + * @brief Initialization and de-initialization functions + * @{ + */ +/* Initialization and de-initialization functions ******************************/ +HAL_StatusTypeDef HAL_Init(void); +HAL_StatusTypeDef HAL_DeInit(void); +void HAL_MspInit(void); +void HAL_MspDeInit(void); +HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority); +/** + * @} + */ + +/* Exported variables ---------------------------------------------------------*/ +/** @addtogroup HAL_Exported_Variables + * @{ + */ +extern __IO uint32_t uwTick; +extern uint32_t uwTickPrio; +extern HAL_TickFreqTypeDef uwTickFreq; +/** + * @} + */ + +/** @addtogroup HAL_Exported_Functions_Group2 HAL Control functions + * @brief HAL Control functions + * @{ + */ +/* Peripheral Control functions ************************************************/ +void HAL_IncTick(void); +void HAL_Delay(uint32_t Delay); +void HAL_SuspendTick(void); +void HAL_ResumeTick(void); +uint32_t HAL_GetTick(void); +uint32_t HAL_GetTickPrio(void); +HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq); +HAL_TickFreqTypeDef HAL_GetTickFreq(void); +uint32_t HAL_GetHalVersion(void); +uint32_t HAL_GetREVID(void); +uint32_t HAL_GetDEVID(void); +uint32_t HAL_GetUIDw0(void); +uint32_t HAL_GetUIDw1(void); +uint32_t HAL_GetUIDw2(void); +void HAL_DBGMCU_EnableDBGSleepMode(void); +void HAL_DBGMCU_DisableDBGSleepMode(void); +void HAL_DBGMCU_EnableDBGStopMode(void); +void HAL_DBGMCU_DisableDBGStopMode(void); +void HAL_DBGMCU_EnableDBGStandbyMode(void); +void HAL_DBGMCU_DisableDBGStandbyMode(void); +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_H */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_adc.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_adc.h new file mode 100644 index 0000000..e151e3b --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_adc.h @@ -0,0 +1,270 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_adc.h + * @author MCD Application Team + * @brief Header file containing functions prototypes of ADC HAL library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_ADC_H +#define __STM32F3xx_ADC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/* Include ADC HAL Extended module */ +/* (include on top of file since ADC structures are defined in extended file) */ +#include "stm32f3xx_hal_adc_ex.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup ADC + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup ADC_Exported_Types ADC Exported Types + * @{ + */ +/** + * @brief HAL ADC state machine: ADC states definition (bitfields) + * @note ADC state machine is managed by bitfields, state must be compared + * with bit by bit. + * For example: + * " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_REG_BUSY)) " + * " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_AWD1) ) " + */ +/* States of ADC global scope */ +#define HAL_ADC_STATE_RESET (0x00000000U) /*!< ADC not yet initialized or disabled */ +#define HAL_ADC_STATE_READY (0x00000001U) /*!< ADC peripheral ready for use */ +#define HAL_ADC_STATE_BUSY_INTERNAL (0x00000002U) /*!< ADC is busy to internal process (initialization, calibration) */ +#define HAL_ADC_STATE_TIMEOUT (0x00000004U) /*!< TimeOut occurrence */ + +/* States of ADC errors */ +#define HAL_ADC_STATE_ERROR_INTERNAL (0x00000010U) /*!< Internal error occurrence */ +#define HAL_ADC_STATE_ERROR_CONFIG (0x00000020U) /*!< Configuration error occurrence */ +#define HAL_ADC_STATE_ERROR_DMA (0x00000040U) /*!< DMA error occurrence */ + +/* States of ADC group regular */ +#define HAL_ADC_STATE_REG_BUSY (0x00000100U) /*!< A conversion on group regular is ongoing or can occur (either by continuous mode, + external trigger, low power auto power-on, multimode ADC master control) */ +#define HAL_ADC_STATE_REG_EOC (0x00000200U) /*!< Conversion data available on group regular */ +#define HAL_ADC_STATE_REG_OVR (0x00000400U) /*!< Overrun occurrence */ +#define HAL_ADC_STATE_REG_EOSMP (0x00000800U) /*!< End Of Sampling flag raised */ + +/* States of ADC group injected */ +#define HAL_ADC_STATE_INJ_BUSY (0x00001000U) /*!< A conversion on group injected is ongoing or can occur (either by auto-injection mode, + external trigger, low power auto power-on, multimode ADC master control) */ +#define HAL_ADC_STATE_INJ_EOC (0x00002000U) /*!< Conversion data available on group injected */ +#define HAL_ADC_STATE_INJ_JQOVF (0x00004000U) /*!< Injected queue overflow occurrence */ + +/* States of ADC analog watchdogs */ +#define HAL_ADC_STATE_AWD1 (0x00010000U) /*!< Out-of-window occurrence of analog watchdog 1 */ +#define HAL_ADC_STATE_AWD2 (0x00020000U) /*!< Out-of-window occurrence of analog watchdog 2 */ +#define HAL_ADC_STATE_AWD3 (0x00040000U) /*!< Out-of-window occurrence of analog watchdog 3 */ + +/* States of ADC multi-mode */ +#define HAL_ADC_STATE_MULTIMODE_SLAVE (0x00100000U) /*!< ADC in multimode slave state, controlled by another ADC master ( */ + + +/** + * @brief ADC handle Structure definition + */ +typedef struct __ADC_HandleTypeDef +{ + ADC_TypeDef *Instance; /*!< Register base address */ + + ADC_InitTypeDef Init; /*!< ADC required parameters */ + + DMA_HandleTypeDef *DMA_Handle; /*!< Pointer DMA Handler */ + + HAL_LockTypeDef Lock; /*!< ADC locking object */ + + __IO uint32_t State; /*!< ADC communication state (bitmap of ADC states) */ + + __IO uint32_t ErrorCode; /*!< ADC Error code */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + ADC_InjectionConfigTypeDef InjectionConfig ; /*!< ADC injected channel configuration build-up structure */ +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + void (* ConvCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC conversion complete callback */ + void (* ConvHalfCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC conversion DMA half-transfer callback */ + void (* LevelOutOfWindowCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC analog watchdog 1 callback */ + void (* ErrorCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC error callback */ + void (* InjectedConvCpltCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC group injected conversion complete callback */ /*!< ADC end of sampling callback */ + void (* MspInitCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC Msp Init callback */ + void (* MspDeInitCallback)(struct __ADC_HandleTypeDef *hadc); /*!< ADC Msp DeInit callback */ +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ +}ADC_HandleTypeDef; + +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) +/** + * @brief HAL ADC Callback ID enumeration definition + */ +typedef enum +{ + HAL_ADC_CONVERSION_COMPLETE_CB_ID = 0x00U, /*!< ADC conversion complete callback ID */ + HAL_ADC_CONVERSION_HALF_CB_ID = 0x01U, /*!< ADC conversion DMA half-transfer callback ID */ + HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID = 0x02U, /*!< ADC analog watchdog 1 callback ID */ + HAL_ADC_ERROR_CB_ID = 0x03U, /*!< ADC error callback ID */ + HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID = 0x04U, /*!< ADC group injected conversion complete callback ID */ + HAL_ADC_MSPINIT_CB_ID = 0x09U, /*!< ADC Msp Init callback ID */ + HAL_ADC_MSPDEINIT_CB_ID = 0x0AU /*!< ADC Msp DeInit callback ID */ +} HAL_ADC_CallbackIDTypeDef; + +/** + * @brief HAL ADC Callback pointer definition + */ +typedef void (*pADC_CallbackTypeDef)(ADC_HandleTypeDef *hadc); /*!< pointer to a ADC callback function */ + +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/* Exported macros -----------------------------------------------------------*/ + +/** @defgroup ADC_Exported_Macro ADC Exported Macros + * @{ + */ +/** @brief Reset ADC handle state + * @param __HANDLE__ ADC handle + * @retval None + */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) +#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) \ + do{ \ + (__HANDLE__)->State = HAL_ADC_STATE_RESET; \ + (__HANDLE__)->MspInitCallback = NULL; \ + (__HANDLE__)->MspDeInitCallback = NULL; \ + } while(0) +#else +#define __HAL_ADC_RESET_HANDLE_STATE(__HANDLE__) \ + ((__HANDLE__)->State = HAL_ADC_STATE_RESET) +#endif + +/** + * @} + */ + + + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup ADC_Exported_Functions ADC Exported Functions + * @{ + */ + +/** @addtogroup ADC_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ +/* Initialization and de-initialization functions **********************************/ +HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef *hadc); +void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc); +void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc); + +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) +/* Callbacks Register/UnRegister functions ***********************************/ +HAL_StatusTypeDef HAL_ADC_RegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID, pADC_CallbackTypeDef pCallback); +HAL_StatusTypeDef HAL_ADC_UnRegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ +/** + * @} + */ + +/** @addtogroup ADC_Exported_Functions_Group2 Input and Output operation functions + * @{ + */ +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout); +HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout); + +/* Non-blocking mode: Interruption */ +HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc); + +/* Non-blocking mode: DMA */ +HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length); +HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc); + +/* ADC retrieve conversion value intended to be used with polling or interruption */ +uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc); + +/* ADC IRQHandler and Callbacks used in non-blocking modes (Interruption and DMA) */ +void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc); +void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc); +void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc); +void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc); +void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc); +/** + * @} + */ + +/** @addtogroup ADC_Exported_Functions_Group3 Peripheral Control functions + * @{ + */ +/* Peripheral Control functions ***********************************************/ +HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig); +HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig); +/** + * @} + */ + +/** @defgroup ADC_Exported_Functions_Group4 Peripheral State functions + * @brief ADC Peripheral State functions + * @{ + */ +/* Peripheral State functions *************************************************/ +uint32_t HAL_ADC_GetState(ADC_HandleTypeDef* hadc); +uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc); +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F3xx_ADC_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_adc_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_adc_ex.h new file mode 100644 index 0000000..3a0e62d --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_adc_ex.h @@ -0,0 +1,3965 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_adc_ex.h + * @author MCD Application Team + * @brief Header file containing functions prototypes of ADC HAL library. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_ADC_EX_H +#define __STM32F3xx_ADC_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup ADCEx ADCEx + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup ADCEx_Exported_Types ADCEx Exported Types + * @{ + */ +struct __ADC_HandleTypeDef; + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Structure definition of ADC initialization and regular group + * @note Parameters of this structure are shared within 2 scopes: + * - Scope entire ADC (affects regular and injected groups): ClockPrescaler, Resolution, DataAlign, + * ScanConvMode, EOCSelection, LowPowerAutoWait. + * - Scope regular group: ContinuousConvMode, NbrOfConversion, DiscontinuousConvMode, NbrOfDiscConversion, ExternalTrigConvEdge, ExternalTrigConv, DMAContinuousRequests, Overrun. + * @note The setting of these parameters with function HAL_ADC_Init() is conditioned to ADC state. + * ADC state can be either: + * - For all parameters: ADC disabled + * - For all parameters except 'LowPowerAutoWait' and 'DMAContinuousRequests': ADC enabled without conversion on going on regular group. + * - For parameters 'LowPowerAutoWait' and 'DMAContinuousRequests': ADC enabled without conversion on going on regular and injected groups. + * If ADC is not in the appropriate state to modify some parameters, these parameters setting is bypassed + * without error reporting (as it can be the expected behaviour in case of intended action to update another parameter (which fulfills the ADC state condition) on the fly). + */ +typedef struct +{ + uint32_t ClockPrescaler; /*!< Select ADC clock source (synchronous clock derived from AHB clock or asynchronous clock derived from ADC dedicated PLL 72MHz) and clock prescaler. + The clock is common for all the ADCs. + This parameter can be a value of @ref ADCEx_ClockPrescaler + Note: In case of usage of channels on injected group, ADC frequency should be lower than AHB clock frequency /4 for resolution 12 or 10 bits, + AHB clock frequency /3 for resolution 8 bits, AHB clock frequency /2 for resolution 6 bits. + Note: In case of usage of the ADC dedicated PLL clock, this clock must be preliminarily enabled and prescaler set at RCC top level. + Note: This parameter can be modified only if all ADCs of the common ADC group are disabled (for products with several ADCs) */ + uint32_t Resolution; /*!< Configures the ADC resolution. + This parameter can be a value of @ref ADCEx_Resolution */ + uint32_t DataAlign; /*!< Specifies ADC data alignment to right (for resolution 12 bits: MSB on register bit 11 and LSB on register bit 0U) (default setting) + or to left (for resolution 12 bits, if offset disabled: MSB on register bit 15 and LSB on register bit 4U, if offset enabled: MSB on register bit 14 and LSB on register bit 3U). + See reference manual for alignments with other resolutions. + This parameter can be a value of @ref ADCEx_Data_align */ + uint32_t ScanConvMode; /*!< Configures the sequencer of regular and injected groups. + This parameter can be associated to parameter 'DiscontinuousConvMode' to have main sequence subdivided in successive parts. + If disabled: Conversion is performed in single mode (one channel converted, the one defined in rank 1U). + Parameters 'NbrOfConversion' and 'InjectedNbrOfConversion' are discarded (equivalent to set to 1U). + If enabled: Conversions are performed in sequence mode (multiple ranks defined by 'NbrOfConversion'/'InjectedNbrOfConversion' and each channel rank). + Scan direction is upward: from rank1 to rank 'n'. + This parameter can be a value of @ref ADCEx_Scan_mode */ + uint32_t EOCSelection; /*!< Specifies what EOC (End Of Conversion) flag is used for conversion by polling and interruption: end of conversion of each rank or complete sequence. + This parameter can be a value of @ref ADCEx_EOCSelection. */ + FunctionalState LowPowerAutoWait; /*!< Selects the dynamic low power Auto Delay: ADC conversions are performed only when necessary. + New conversion starts only when the previous conversion (for regular group) or previous sequence (for injected group) has been treated by user software. + This feature automatically adapts the speed of ADC to the speed of the system that reads the data. Moreover, this avoids risk of overrun for low frequency applications. + This parameter can be set to ENABLE or DISABLE. + Note: It is not recommended to use with interruption or DMA (HAL_ADC_Start_IT(), HAL_ADC_Start_DMA()) since these modes have to clear immediately the EOC flag (by CPU to free the IRQ pending event or by DMA). + Auto wait will work but fort a very short time, discarding its intended benefit (except specific case of high load of CPU or DMA transfers which can justify usage of auto wait). + Do use with polling: 1. Start conversion with HAL_ADC_Start(), 2. Later on, when ADC conversion data is needed: + and use HAL_ADC_GetValue() to retrieve conversion result and trig another conversion (in case of usage of injected group, use the equivalent functions HAL_ADCExInjected_Start(), HAL_ADCEx_InjectedGetValue(), ...). */ + FunctionalState ContinuousConvMode; /*!< Specifies whether the conversion is performed in single mode (one conversion) or continuous mode for regular group, + after the selected trigger occurred (software start or external trigger). + This parameter can be set to ENABLE or DISABLE. */ + uint32_t NbrOfConversion; /*!< Specifies the number of ranks that will be converted within the regular group sequencer. + To use the regular group sequencer and convert several ranks, parameter 'ScanConvMode' must be enabled. + This parameter must be a number between Min_Data = 1 and Max_Data = 16. + Note: This parameter must be modified when no conversion is on going on regular group (ADC disabled, or ADC enabled without continuous mode or external trigger that could launch a conversion). */ + FunctionalState DiscontinuousConvMode; /*!< Specifies whether the conversions sequence of regular group is performed in Complete-sequence/Discontinuous-sequence (main sequence subdivided in successive parts). + Discontinuous mode is used only if sequencer is enabled (parameter 'ScanConvMode'). If sequencer is disabled, this parameter is discarded. + Discontinuous mode can be enabled only if continuous mode is disabled. If continuous mode is enabled, this parameter setting is discarded. + This parameter can be set to ENABLE or DISABLE. */ + uint32_t NbrOfDiscConversion; /*!< Specifies the number of discontinuous conversions in which the main sequence of regular group (parameter NbrOfConversion) will be subdivided. + If parameter 'DiscontinuousConvMode' is disabled, this parameter is discarded. + This parameter must be a number between Min_Data = 1 and Max_Data = 8. */ + uint32_t ExternalTrigConv; /*!< Selects the external event used to trigger the conversion start of regular group. + If set to ADC_SOFTWARE_START, external triggers are disabled. + This parameter can be a value of @ref ADCEx_External_trigger_source_Regular + Caution: For devices with several ADCs, external trigger source is common to ADC common group (for example: ADC1&ADC2, ADC3&ADC4, if available) */ + uint32_t ExternalTrigConvEdge; /*!< Selects the external trigger edge of regular group. + If trigger is set to ADC_SOFTWARE_START, this parameter is discarded. + This parameter can be a value of @ref ADCEx_External_trigger_edge_Regular */ + FunctionalState DMAContinuousRequests; /*!< Specifies whether the DMA requests are performed in one shot mode (DMA transfer stop when number of conversions is reached) + or in Continuous mode (DMA transfer unlimited, whatever number of conversions). + Note: In continuous mode, DMA must be configured in circular mode. Otherwise an overrun will be triggered when DMA buffer maximum pointer is reached. + This parameter can be set to ENABLE or DISABLE. + Note: This parameter must be modified when no conversion is on going on both regular and injected groups (ADC disabled, or ADC enabled without continuous mode or external trigger that could launch a conversion). */ + uint32_t Overrun; /*!< Select the behaviour in case of overrun: data overwritten (default) or preserved. + This parameter is for regular group only. + This parameter can be a value of @ref ADCEx_Overrun + Note: Case of overrun set to data preserved and usage with end on conversion interruption (HAL_Start_IT()): ADC IRQ handler has to clear end of conversion flags, this induces the release of the preserved data. If needed, this data can be saved into function HAL_ADC_ConvCpltCallback() (called before end of conversion flags clear). + Note: Error reporting in function of conversion mode: + - Usage with ADC conversion by polling for event or interruption: Error is reported only if overrun is set to data preserved. If overrun is set to data overwritten, user can willingly not read the conversion data each time, this is not considered as an erroneous case. + - Usage with ADC conversion by DMA: Error is reported whatever overrun setting (DMA is expected to process all data from data register, any data missed would be abnormal). */ +}ADC_InitTypeDef; + +/** + * @brief Structure definition of ADC channel for regular group + * @note The setting of these parameters with function HAL_ADC_ConfigChannel() is conditioned to ADC state. + * ADC state can be either: + * - For all parameters: ADC disabled (this is the only possible ADC state to modify parameter 'SingleDiff') + * - For all except parameters 'SamplingTime', 'Offset', 'OffsetNumber': ADC enabled without conversion on going on regular group. + * - For parameters 'SamplingTime', 'Offset', 'OffsetNumber': ADC enabled without conversion on going on regular and injected groups. + * If ADC is not in the appropriate state to modify some parameters, these parameters setting is bypassed + * without error reporting (as it can be the expected behaviour in case of intended action to update another parameter (which fulfills the ADC state condition) on the fly). + */ +typedef struct +{ + uint32_t Channel; /*!< Specifies the channel to configure into ADC regular group. + This parameter can be a value of @ref ADCEx_channels + Note: Depending on devices, some channels may not be available on package pins. Refer to device datasheet for channels availability. */ + uint32_t Rank; /*!< Specifies the rank in the regular group sequencer. + This parameter can be a value of @ref ADCEx_regular_rank + Note: In case of need to disable a channel or change order of conversion sequencer, rank containing a previous channel setting can be overwritten by the new channel setting (or parameter number of conversions can be adjusted) */ + uint32_t SamplingTime; /*!< Sampling time value to be set for the selected channel. + Unit: ADC clock cycles + Conversion time is the addition of sampling time and processing time (12.5 ADC clock cycles at ADC resolution 12 bits, 10.5 cycles at 10 bits, 8.5 cycles at 8 bits, 6.5 cycles at 6 bits). + This parameter can be a value of @ref ADCEx_sampling_times + Caution: This parameter updates the parameter property of the channel, that can be used into regular and/or injected groups. + If this same channel has been previously configured in the other group (regular/injected), it will be updated to last setting. + Note: In case of usage of internal measurement channels (VrefInt/Vbat/TempSensor), + sampling time constraints must be respected (sampling time can be adjusted in function of ADC clock frequency and sampling time setting) + Refer to device datasheet for timings values, parameters TS_vrefint, TS_vbat, TS_temp (values rough order: 2.2us min). */ + uint32_t SingleDiff; /*!< Selection of single-ended or differential input. + In differential mode: Differential measurement is between the selected channel 'i' (positive input) and channel 'i+1' (negative input). + Only channel 'i' has to be configured, channel 'i+1' is configured automatically. + This parameter must be a value of @ref ADCEx_SingleDifferential + Caution: This parameter updates the parameter property of the channel, that can be used into regular and/or injected groups. + If this same channel has been previously configured in the other group (regular/injected), it will be updated to last setting. + Note: Channels 1 to 14 are available in differential mode. Channels 15U, 16U, 17U, 18 can be used only in single-ended mode. + Note: When configuring a channel 'i' in differential mode, the channel 'i+1' is not usable separately. + Note: This parameter must be modified when ADC is disabled (before ADC start conversion or after ADC stop conversion). + If ADC is enabled, this parameter setting is bypassed without error reporting (as it can be the expected behaviour in case of another parameter update on the fly) */ + uint32_t OffsetNumber; /*!< Selects the offset number + This parameter can be a value of @ref ADCEx_OffsetNumber + Caution: Only one channel is allowed per channel. If another channel was on this offset number, the offset will be changed to the new channel */ + uint32_t Offset; /*!< Defines the offset to be subtracted from the raw converted data when convert channels. + Offset value must be a positive number. + Depending of ADC resolution selected (12U, 10U, 8 or 6 bits), this parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFFU, 0x3FFU, 0xFF or 0x3F respectively. + Note: This parameter must be modified when no conversion is on going on both regular and injected groups (ADC disabled, or ADC enabled without continuous mode or external trigger that could launch a conversion). */ +}ADC_ChannelConfTypeDef; + +/** + * @brief Structure definition of ADC injected group and ADC channel for injected group + * @note Parameters of this structure are shared within 2 scopes: + * - Scope channel: InjectedChannel, InjectedRank, InjectedSamplingTime , InjectedSingleDiff, InjectedOffsetNumber, InjectedOffset + * - Scope injected group (affects all channels of injected group): InjectedNbrOfConversion, InjectedDiscontinuousConvMode, + * AutoInjectedConv, QueueInjectedContext, ExternalTrigInjecConvEdge, ExternalTrigInjecConv. + * @note The setting of these parameters with function HAL_ADCEx_InjectedConfigChannel() is conditioned to ADC state. + * ADC state can be either: + * - For all parameters: ADC disabled (this is the only possible ADC state to modify parameter 'InjectedSingleDiff') + * - For parameters 'InjectedDiscontinuousConvMode', 'QueueInjectedContext': ADC enabled without conversion on going on injected group. + * - For parameters 'InjectedSamplingTime', 'InjectedOffset', 'InjectedOffsetNumber', 'AutoInjectedConv': ADC enabled without conversion on going on regular and injected groups. + * - For parameters 'InjectedChannel', 'InjectedRank', 'InjectedNbrOfConversion', 'ExternalTrigInjecConv', 'ExternalTrigInjecConvEdge': ADC enabled and while conversion on going on regular and injected groups. + * If ADC is not in the appropriate state to modify some parameters, these parameters setting is bypassed + * without error reporting (as it can be the expected behaviour in case of intended action to update another parameter (which fulfills the ADC state condition) on the fly). + */ +typedef struct +{ + uint32_t InjectedChannel; /*!< Configure the ADC injected channel + This parameter can be a value of @ref ADCEx_channels + Note: Depending on devices, some channels may not be available on package pins. Refer to device datasheet for channels availability. */ + uint32_t InjectedRank; /*!< The rank in the regular group sequencer + This parameter must be a value of @ref ADCEx_injected_rank + Note: In case of need to disable a channel or change order of conversion sequencer, rank containing a previous channel setting can be overwritten by the new channel setting (or parameter number of conversions can be adjusted) */ + uint32_t InjectedSamplingTime; /*!< Sampling time value to be set for the selected channel. + Unit: ADC clock cycles + Conversion time is the addition of sampling time and processing time (12.5 ADC clock cycles at ADC resolution 12 bits, 10.5 cycles at 10 bits, 8.5 cycles at 8 bits, 6.5 cycles at 6 bits). + This parameter can be a value of @ref ADCEx_sampling_times + Caution: This parameter updates the parameter property of the channel, that can be used into regular and/or injected groups. + If this same channel has been previously configured in the other group (regular/injected), it will be updated to last setting. + Note: In case of usage of internal measurement channels (VrefInt/Vbat/TempSensor), + sampling time constraints must be respected (sampling time can be adjusted in function of ADC clock frequency and sampling time setting) + Refer to device datasheet for timings values, parameters TS_vrefint, TS_vbat, TS_temp (values rough order: 2.2us min). */ + uint32_t InjectedSingleDiff; /*!< Selection of single-ended or differential input. + In differential mode: Differential measurement is between the selected channel 'i' (positive input) and channel 'i+1' (negative input). + Only channel 'i' has to be configured, channel 'i+1' is configured automatically. + This parameter must be a value of @ref ADCEx_SingleDifferential + Caution: This parameter updates the parameter property of the channel, that can be used into regular and/or injected groups. + If this same channel has been previously configured in the other group (regular/injected), it will be updated to last setting. + Note: Channels 1 to 14 are available in differential mode. Channels 15U, 16U, 17U, 18 can be used only in single-ended mode. + Note: When configuring a channel 'i' in differential mode, the channel 'i-1' is not usable separately. + Note: This parameter must be modified when ADC is disabled (before ADC start conversion or after ADC stop conversion). + If ADC is enabled, this parameter setting is bypassed without error reporting (as it can be the expected behaviour in case of another parameter update on the fly) */ + uint32_t InjectedOffsetNumber; /*!< Selects the offset number + This parameter can be a value of @ref ADCEx_OffsetNumber + Caution: Only one channel is allowed per offset number. If another channel was on this offset number, the offset will be changed to the new channel. */ + uint32_t InjectedOffset; /*!< Defines the offset to be subtracted from the raw converted data. + Offset value must be a positive number. + Depending of ADC resolution selected (12U, 10U, 8 or 6 bits), + this parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFFU, 0x3FFU, 0xFF or 0x3F respectively. */ + uint32_t InjectedNbrOfConversion; /*!< Specifies the number of ranks that will be converted within the injected group sequencer. + To use the injected group sequencer and convert several ranks, parameter 'ScanConvMode' must be enabled. + This parameter must be a number between Min_Data = 1 and Max_Data = 4. + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ + FunctionalState InjectedDiscontinuousConvMode; /*!< Specifies whether the conversions sequence of injected group is performed in Complete-sequence/Discontinuous-sequence (main sequence subdivided in successive parts). + Discontinuous mode is used only if sequencer is enabled (parameter 'ScanConvMode'). If sequencer is disabled, this parameter is discarded. + Discontinuous mode can be enabled only if continuous mode is disabled. If continuous mode is enabled, this parameter setting is discarded. + This parameter can be set to ENABLE or DISABLE. + Note: This parameter must be modified when ADC is disabled (before ADC start conversion or after ADC stop conversion). + Note: For injected group, number of discontinuous ranks increment is fixed to one-by-one. + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ + FunctionalState AutoInjectedConv; /*!< Enables or disables the selected ADC automatic injected group conversion after regular one + This parameter can be set to ENABLE or DISABLE. + Note: To use Automatic injected conversion, discontinuous mode must be disabled ('DiscontinuousConvMode' and 'InjectedDiscontinuousConvMode' set to DISABLE) + Note: To use Automatic injected conversion, injected group external triggers must be disabled ('ExternalTrigInjecConv' set to ADC_SOFTWARE_START) + Note: In case of DMA used with regular group: if DMA configured in normal mode (single shot) JAUTO will be stopped upon DMA transfer complete. + To maintain JAUTO always enabled, DMA must be configured in circular mode. + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ + FunctionalState QueueInjectedContext; /*!< Specifies whether the context queue feature is enabled. + This parameter can be set to ENABLE or DISABLE. + If context queue is enabled, injected sequencer&channels configurations are queued on up to 2 contexts. If a + new injected context is set when queue is full, error is triggered by interruption and through function 'HAL_ADCEx_InjectedQueueOverflowCallback'. + Caution: This feature request that the sequence is fully configured before injected conversion start. + Therefore, configure channels with HAL_ADCEx_InjectedConfigChannel() as many times as value of 'InjectedNbrOfConversion' parameter. + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. + Note: This parameter must be modified when ADC is disabled (before ADC start conversion or after ADC stop conversion). */ + uint32_t ExternalTrigInjecConv; /*!< Selects the external event used to trigger the conversion start of injected group. + If set to ADC_INJECTED_SOFTWARE_START, external triggers are disabled. + This parameter can be a value of @ref ADCEx_External_trigger_source_Injected + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ + uint32_t ExternalTrigInjecConvEdge; /*!< Selects the external trigger edge of injected group. + This parameter can be a value of @ref ADCEx_External_trigger_edge_Injected. + If trigger is set to ADC_INJECTED_SOFTWARE_START, this parameter is discarded. + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ +}ADC_InjectionConfTypeDef; + +/** + * @brief ADC Injection Configuration + */ +typedef struct +{ + uint32_t ContextQueue; /*!< Injected channel configuration context: build-up over each + HAL_ADCEx_InjectedConfigChannel() call to finally initialize + JSQR register at HAL_ADCEx_InjectedConfigChannel() last call */ + + uint32_t ChannelCount; /*!< Number of channels in the injected sequence */ +}ADC_InjectionConfigTypeDef; + +/** + * @brief Structure definition of ADC analog watchdog + * @note The setting of these parameters with function HAL_ADC_AnalogWDGConfig() is conditioned to ADC state. + * ADC state can be either: ADC disabled or ADC enabled without conversion on going on regular and injected groups. + */ +typedef struct +{ + uint32_t WatchdogNumber; /*!< Selects which ADC analog watchdog to apply to the selected channel. + For Analog Watchdog 1: Only 1 channel can be monitored (or overall group of channels by setting parameter 'WatchdogMode') + For Analog Watchdog 2 and 3: Several channels can be monitored (by successive calls of 'HAL_ADC_AnalogWDGConfig()' for each channel) + This parameter can be a value of @ref ADCEx_analog_watchdog_number. */ + uint32_t WatchdogMode; /*!< For Analog Watchdog 1: Configures the ADC analog watchdog mode: single channel/overall group of channels, regular/injected group. + For Analog Watchdog 2 and 3: There is no configuration for overall group of channels as AWD1. Set value 'ADC_ANALOGWATCHDOG_NONE' to reset channels group programmed with parameter 'Channel', set any other value to not use this parameter. + This parameter can be a value of @ref ADCEx_analog_watchdog_mode. */ + uint32_t Channel; /*!< Selects which ADC channel to monitor by analog watchdog. + For Analog Watchdog 1: this parameter has an effect only if parameter 'WatchdogMode' is configured on single channel. Only 1 channel can be monitored. + For Analog Watchdog 2 and 3: Several channels can be monitored (successive calls of HAL_ADC_AnalogWDGConfig() must be done, one for each channel. + Channels group reset can be done by setting WatchdogMode to 'ADC_ANALOGWATCHDOG_NONE'). + This parameter can be a value of @ref ADCEx_channels. */ + FunctionalState ITMode; /*!< Specifies whether the analog watchdog is configured in interrupt or polling mode. + This parameter can be set to ENABLE or DISABLE */ + uint32_t HighThreshold; /*!< Configures the ADC analog watchdog High threshold value. + Depending of ADC resolution selected (12U, 10U, 8 or 6 bits), this parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFFU, 0x3FFU, 0xFF or 0x3F respectively. + Note: Analog watchdog 2 and 3 are limited to a resolution of 8 bits: if ADC resolution is 12 bits + the 4 LSB are ignored, if ADC resolution is 10 bits the 2 LSB are ignored. */ + uint32_t LowThreshold; /*!< Configures the ADC analog watchdog High threshold value. + Depending of ADC resolution selected (12U, 10U, 8 or 6 bits), this parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFFU, 0x3FFU, 0xFF or 0x3F respectively. + Note: Analog watchdog 2 and 3 are limited to a resolution of 8 bits: if ADC resolution is 12 bits + the 4 LSB are ignored, if ADC resolution is 10 bits the 2 LSB are ignored. */ +}ADC_AnalogWDGConfTypeDef; + +/** + * @brief Structure definition of ADC multimode + * @note The setting of these parameters with function HAL_ADCEx_MultiModeConfigChannel() is conditioned to ADCs state (both ADCs of the common group). + * ADC state can be either: + * - For all parameters: ADC disabled (this is the only possible ADC state to modify parameter 'DMAAccessMode') + * - For parameter 'DMAAccessMode': ADC enabled without conversion on going on regular group. + * If ADC is not in the appropriate state to modify some parameters, these parameters setting is bypassed + * without error reporting (as it can be the expected behaviour in case of intended action to update another parameter (which fulfills the ADC state condition) on the fly). + */ +typedef struct +{ + uint32_t Mode; /*!< Configures the ADC to operate in independent or multi mode. + This parameter can be a value of @ref ADCEx_Common_mode */ + uint32_t DMAAccessMode; /*!< Configures the DMA mode for multi ADC mode: + selection whether 2 DMA channels (each ADC use its own DMA channel) or 1 DMA channel (one DMA channel for both ADC, DMA of ADC master) + This parameter can be a value of @ref ADCEx_Direct_memory_access_mode_for_multimode + Caution: Limitations with multimode DMA access enabled (1 DMA channel used): In case of dual mode in high speed (more than 5Msps) or high activity of DMA by other peripherals, there is a risk of DMA overrun. + Therefore, it is recommended to disable multimode DMA access: each ADC uses its own DMA channel. + Refer to device errata sheet for more details. */ + uint32_t TwoSamplingDelay; /*!< Configures the Delay between 2 sampling phases. + This parameter can be a value of @ref ADCEx_delay_between_2_sampling_phases + Delay range depends on selected resolution: from 1 to 12 clock cycles for 12 bits, from 1 to 10 clock cycles for 10 bits + from 1 to 8 clock cycles for 8 bits, from 1 to 6 clock cycles for 6 bits */ +}ADC_MultiModeTypeDef; +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Structure definition of ADC and regular group initialization + * @note Parameters of this structure are shared within 2 scopes: + * - Scope entire ADC (affects regular and injected groups): DataAlign, ScanConvMode. + * - Scope regular group: ContinuousConvMode, NbrOfConversion, DiscontinuousConvMode, NbrOfDiscConversion, ExternalTrigConvEdge, ExternalTrigConv. + * @note The setting of these parameters with function HAL_ADC_Init() is conditioned to ADC state. + * ADC can be either disabled or enabled without conversion on going on regular group. + */ +typedef struct +{ + uint32_t DataAlign; /*!< Specifies ADC data alignment to right (MSB on register bit 11 and LSB on register bit 0U) (default setting) + or to left (if regular group: MSB on register bit 15 and LSB on register bit 4U, if injected group (MSB kept as signed value due to potential negative value after offset application): MSB on register bit 14 and LSB on register bit 3U). + This parameter can be a value of @ref ADCEx_Data_align */ + uint32_t ScanConvMode; /*!< Configures the sequencer of regular and injected groups. + This parameter can be associated to parameter 'DiscontinuousConvMode' to have main sequence subdivided in successive parts. + If disabled: Conversion is performed in single mode (one channel converted, the one defined in rank 1U). + Parameters 'NbrOfConversion' and 'InjectedNbrOfConversion' are discarded (equivalent to set to 1U). + If enabled: Conversions are performed in sequence mode (multiple ranks defined by 'NbrOfConversion'/'InjectedNbrOfConversion' and each channel rank). + Scan direction is upward: from rank1 to rank 'n'. + This parameter can be a value of @ref ADCEx_Scan_mode + Note: For regular group, this parameter should be enabled in conversion either by polling (HAL_ADC_Start with Discontinuous mode and NbrOfDiscConversion=1U) + or by DMA (HAL_ADC_Start_DMA), but not by interruption (HAL_ADC_Start_IT): in scan mode, interruption is triggered only on the + the last conversion of the sequence. All previous conversions would be overwritten by the last one. + Injected group used with scan mode has not this constraint: each rank has its own result register, no data is overwritten. */ + FunctionalState ContinuousConvMode; /*!< Specifies whether the conversion is performed in single mode (one conversion) or continuous mode for regular group, + after the selected trigger occurred (software start or external trigger). + This parameter can be set to ENABLE or DISABLE. */ + uint32_t NbrOfConversion; /*!< Specifies the number of ranks that will be converted within the regular group sequencer. + To use regular group sequencer and convert several ranks, parameter 'ScanConvMode' must be enabled. + This parameter must be a number between Min_Data = 1 and Max_Data = 16. */ + FunctionalState DiscontinuousConvMode; /*!< Specifies whether the conversions sequence of regular group is performed in Complete-sequence/Discontinuous-sequence (main sequence subdivided in successive parts). + Discontinuous mode is used only if sequencer is enabled (parameter 'ScanConvMode'). If sequencer is disabled, this parameter is discarded. + Discontinuous mode can be enabled only if continuous mode is disabled. If continuous mode is enabled, this parameter setting is discarded. + This parameter can be set to ENABLE or DISABLE. */ + uint32_t NbrOfDiscConversion; /*!< Specifies the number of discontinuous conversions in which the main sequence of regular group (parameter NbrOfConversion) will be subdivided. + If parameter 'DiscontinuousConvMode' is disabled, this parameter is discarded. + This parameter must be a number between Min_Data = 1 and Max_Data = 8. */ + uint32_t ExternalTrigConv; /*!< Selects the external event used to trigger the conversion start of regular group. + If set to ADC_SOFTWARE_START, external triggers are disabled. + If set to external trigger source, triggering is on event rising edge. + This parameter can be a value of @ref ADCEx_External_trigger_source_Regular */ +}ADC_InitTypeDef; + +/** + * @brief Structure definition of ADC channel for regular group + * @note The setting of these parameters with function HAL_ADC_ConfigChannel() is conditioned to ADC state. + * ADC can be either disabled or enabled without conversion on going on regular group. + */ +typedef struct +{ + uint32_t Channel; /*!< Specifies the channel to configure into ADC regular group. + This parameter can be a value of @ref ADCEx_channels + Note: Depending on devices, some channels may not be available on package pins. Refer to device datasheet for channels availability. */ + uint32_t Rank; /*!< Specifies the rank in the regular group sequencer + This parameter can be a value of @ref ADCEx_regular_rank + Note: In case of need to disable a channel or change order of conversion sequencer, rank containing a previous channel setting can be overwritten by the new channel setting (or parameter number of conversions can be adjusted) */ + uint32_t SamplingTime; /*!< Sampling time value to be set for the selected channel. + Unit: ADC clock cycles + Conversion time is the addition of sampling time and processing time (12.5 ADC clock cycles at ADC resolution 12 bits). + This parameter can be a value of @ref ADCEx_sampling_times + Caution: This parameter updates the parameter property of the channel, that can be used into regular and/or injected groups. + If this same channel has been previously configured in the other group (regular/injected), it will be updated to last setting. + Note: In case of usage of internal measurement channels (VrefInt/Vbat/TempSensor), + sampling time constraints must be respected (sampling time can be adjusted in function of ADC clock frequency and sampling time setting) + Refer to device datasheet for timings values, parameters TS_vrefint, TS_vbat, TS_temp (values rough order: 5us to 17.1us min). */ +}ADC_ChannelConfTypeDef; + +/** + * @brief ADC Configuration injected Channel structure definition + * @note Parameters of this structure are shared within 2 scopes: + * - Scope channel: InjectedChannel, InjectedRank, InjectedSamplingTime, InjectedOffset + * - Scope injected group (affects all channels of injected group): InjectedNbrOfConversion, InjectedDiscontinuousConvMode, + * AutoInjectedConv, ExternalTrigInjecConvEdge, ExternalTrigInjecConv. + * @note The setting of these parameters with function HAL_ADCEx_InjectedConfigChannel() is conditioned to ADC state. + * ADC state can be either: + * - For all parameters: ADC disabled (this is the only possible ADC state to modify parameter 'ExternalTrigInjecConv') + * - For all except parameters 'ExternalTrigInjecConv': ADC enabled without conversion on going on injected group. + */ +typedef struct +{ + uint32_t InjectedChannel; /*!< Selection of ADC channel to configure + This parameter can be a value of @ref ADCEx_channels + Note: Depending on devices, some channels may not be available on package pins. Refer to device datasheet for channels availability. */ + uint32_t InjectedRank; /*!< Rank in the injected group sequencer + This parameter must be a value of @ref ADCEx_injected_rank + Note: In case of need to disable a channel or change order of conversion sequencer, rank containing a previous channel setting can be overwritten by the new channel setting (or parameter number of conversions can be adjusted) */ + uint32_t InjectedSamplingTime; /*!< Sampling time value to be set for the selected channel. + Unit: ADC clock cycles + Conversion time is the addition of sampling time and processing time (12.5 ADC clock cycles at ADC resolution 12 bits). + This parameter can be a value of @ref ADCEx_sampling_times + Caution: This parameter updates the parameter property of the channel, that can be used into regular and/or injected groups. + If this same channel has been previously configured in the other group (regular/injected), it will be updated to last setting. + Note: In case of usage of internal measurement channels (VrefInt/Vbat/TempSensor), + sampling time constraints must be respected (sampling time can be adjusted in function of ADC clock frequency and sampling time setting) + Refer to device datasheet for timings values, parameters TS_vrefint, TS_vbat, TS_temp (values rough order: 5us to 17.1us min). */ + uint32_t InjectedOffset; /*!< Defines the offset to be subtracted from the raw converted data (for channels set on injected group only). + Offset value must be a positive number. + Depending of ADC resolution selected (12U, 10U, 8 or 6 bits), + this parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFFU, 0x3FFU, 0xFF or 0x3F respectively. */ + uint32_t InjectedNbrOfConversion; /*!< Specifies the number of ranks that will be converted within the injected group sequencer. + To use the injected group sequencer and convert several ranks, parameter 'ScanConvMode' must be enabled. + This parameter must be a number between Min_Data = 1 and Max_Data = 4. + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ + FunctionalState InjectedDiscontinuousConvMode; /*!< Specifies whether the conversions sequence of injected group is performed in Complete-sequence/Discontinuous-sequence (main sequence subdivided in successive parts). + Discontinuous mode is used only if sequencer is enabled (parameter 'ScanConvMode'). If sequencer is disabled, this parameter is discarded. + Discontinuous mode can be enabled only if continuous mode is disabled. If continuous mode is enabled, this parameter setting is discarded. + This parameter can be set to ENABLE or DISABLE. + Note: For injected group, number of discontinuous ranks increment is fixed to one-by-one. + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ + FunctionalState AutoInjectedConv; /*!< Enables or disables the selected ADC automatic injected group conversion after regular one + This parameter can be set to ENABLE or DISABLE. + Note: To use Automatic injected conversion, discontinuous mode must be disabled ('DiscontinuousConvMode' and 'InjectedDiscontinuousConvMode' set to DISABLE) + Note: To use Automatic injected conversion, injected group external triggers must be disabled ('ExternalTrigInjecConv' set to ADC_SOFTWARE_START) + Note: In case of DMA used with regular group: if DMA configured in normal mode (single shot) JAUTO will be stopped upon DMA transfer complete. + To maintain JAUTO always enabled, DMA must be configured in circular mode. + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ + uint32_t ExternalTrigInjecConv; /*!< Selects the external event used to trigger the conversion start of injected group. + If set to ADC_INJECTED_SOFTWARE_START, external triggers are disabled. + If set to external trigger source, triggering is on event rising edge. + This parameter can be a value of @ref ADCEx_External_trigger_source_Injected + Note: This parameter must be modified when ADC is disabled (before ADC start conversion or after ADC stop conversion). + If ADC is enabled, this parameter setting is bypassed without error reporting (as it can be the expected behaviour in case of another parameter update on the fly) + Caution: this setting impacts the entire injected group. Therefore, call of HAL_ADCEx_InjectedConfigChannel() to + configure a channel on injected group can impact the configuration of other channels previously set. */ +}ADC_InjectionConfTypeDef; + +/** + * @brief ADC Configuration analog watchdog definition + * @note The setting of these parameters with function is conditioned to ADC state. + * ADC state can be either disabled or enabled without conversion on going on regular and injected groups. + */ +typedef struct +{ + uint32_t WatchdogMode; /*!< Configures the ADC analog watchdog mode: single/all channels, regular/injected group. + This parameter can be a value of @ref ADCEx_analog_watchdog_mode. */ + uint32_t Channel; /*!< Selects which ADC channel to monitor by analog watchdog. + This parameter has an effect only if watchdog mode is configured on single channel (parameter WatchdogMode) + This parameter can be a value of @ref ADCEx_channels. */ + FunctionalState ITMode; /*!< Specifies whether the analog watchdog is configured in interrupt or polling mode. + This parameter can be set to ENABLE or DISABLE */ + uint32_t HighThreshold; /*!< Configures the ADC analog watchdog High threshold value. + This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ + uint32_t LowThreshold; /*!< Configures the ADC analog watchdog High threshold value. + This parameter must be a number between Min_Data = 0x000 and Max_Data = 0xFFF. */ + uint32_t WatchdogNumber; /*!< Reserved for future use, can be set to 0U */ +}ADC_AnalogWDGConfTypeDef; +#endif /* STM32F373xC || STM32F378xx */ +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ + +/** @defgroup ADCEx_Exported_Constants ADCEx Exported Constants + * @{ + */ + +/** @defgroup ADCEx_Error_Code ADC Extended Error Code + * @{ + */ +#define HAL_ADC_ERROR_NONE (0x00U) /*!< No error */ +#define HAL_ADC_ERROR_INTERNAL (0x01U) /*!< ADC IP internal error: if problem of clocking, + enable/disable, erroneous state */ +#define HAL_ADC_ERROR_OVR (0x02U) /*!< Overrun error */ +#define HAL_ADC_ERROR_DMA (0x04U) /*!< DMA transfer error */ +#define HAL_ADC_ERROR_JQOVF (0x08U) /*!< Injected context queue overflow error */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) +#define HAL_ADC_ERROR_INVALID_CALLBACK (0x10U) /*!< Invalid Callback error */ +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ +/** + * @} + */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** @defgroup ADCEx_ClockPrescaler ADC Extended Clock Prescaler + * @{ + */ +#define ADC_CLOCK_ASYNC_DIV1 (0x00000000U) /*!< ADC asynchronous clock derived from ADC dedicated PLL */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_CLOCK_SYNC_PCLK_DIV1 ((uint32_t)ADC12_CCR_CKMODE_0) /*!< ADC synchronous clock derived from AHB clock without prescaler */ +#define ADC_CLOCK_SYNC_PCLK_DIV2 ((uint32_t)ADC12_CCR_CKMODE_1) /*!< ADC synchronous clock derived from AHB clock divided by a prescaler of 2U */ +#define ADC_CLOCK_SYNC_PCLK_DIV4 ((uint32_t)ADC12_CCR_CKMODE) /*!< ADC synchronous clock derived from AHB clock divided by a prescaler of 4U */ +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define ADC_CLOCK_SYNC_PCLK_DIV1 ((uint32_t)ADC1_CCR_CKMODE_0) /*!< ADC synchronous clock derived from AHB clock without prescaler */ +#define ADC_CLOCK_SYNC_PCLK_DIV2 ((uint32_t)ADC1_CCR_CKMODE_1) /*!< ADC synchronous clock derived from AHB clock divided by a prescaler of 2U */ +#define ADC_CLOCK_SYNC_PCLK_DIV4 ((uint32_t)ADC1_CCR_CKMODE) /*!< ADC synchronous clock derived from AHB clock divided by a prescaler of 4U */ +#endif /* STM32F301x8 || STM32F318xx || STM32F302x8 */ + +#define IS_ADC_CLOCKPRESCALER(ADC_CLOCK) (((ADC_CLOCK) == ADC_CLOCK_ASYNC_DIV1) || \ + ((ADC_CLOCK) == ADC_CLOCK_SYNC_PCLK_DIV1) || \ + ((ADC_CLOCK) == ADC_CLOCK_SYNC_PCLK_DIV2) || \ + ((ADC_CLOCK) == ADC_CLOCK_SYNC_PCLK_DIV4) ) +/** + * @} + */ + +/** @defgroup ADCEx_Resolution ADC Extended Resolution + * @{ + */ +#define ADC_RESOLUTION_12B (0x00000000U) /*!< ADC 12-bit resolution */ +#define ADC_RESOLUTION_10B ((uint32_t)ADC_CFGR_RES_0) /*!< ADC 10-bit resolution */ +#define ADC_RESOLUTION_8B ((uint32_t)ADC_CFGR_RES_1) /*!< ADC 8-bit resolution */ +#define ADC_RESOLUTION_6B ((uint32_t)ADC_CFGR_RES) /*!< ADC 6-bit resolution */ +/** + * @} + */ + +/** @defgroup ADCEx_Data_align ADC Extended Data Alignment + * @{ + */ +#define ADC_DATAALIGN_RIGHT (0x00000000U) +#define ADC_DATAALIGN_LEFT ((uint32_t)ADC_CFGR_ALIGN) +/** + * @} + */ + +/** @defgroup ADCEx_Scan_mode ADC Extended Scan Mode + * @{ + */ +#define ADC_SCAN_DISABLE (0x00000000U) +#define ADC_SCAN_ENABLE (0x00000001U) +/** + * @} + */ + +/** @defgroup ADCEx_External_trigger_edge_Regular ADC Extended External trigger enable and polarity selection for regular group + * @{ + */ +#define ADC_EXTERNALTRIGCONVEDGE_NONE (0x00000000U) +#define ADC_EXTERNALTRIGCONVEDGE_RISING ((uint32_t)ADC_CFGR_EXTEN_0) +#define ADC_EXTERNALTRIGCONVEDGE_FALLING ((uint32_t)ADC_CFGR_EXTEN_1) +#define ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING ((uint32_t)ADC_CFGR_EXTEN) +/** + * @} + */ + +/** @defgroup ADCEx_External_trigger_source_Regular ADC Extended External trigger selection for regular group + * @{ + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +/*!< List of external triggers with generic trigger name, independently of */ +/* ADC target (caution: applies to other ADCs sharing the same common group), */ +/* sorted by trigger name: */ + +/*!< External triggers of regular group for ADC1&ADC2 only */ +#define ADC_EXTERNALTRIGCONV_T1_CC1 ADC1_2_EXTERNALTRIG_T1_CC1 +#define ADC_EXTERNALTRIGCONV_T1_CC2 ADC1_2_EXTERNALTRIG_T1_CC2 +#define ADC_EXTERNALTRIGCONV_T2_CC2 ADC1_2_EXTERNALTRIG_T2_CC2 +#define ADC_EXTERNALTRIGCONV_T3_CC4 ADC1_2_EXTERNALTRIG_T3_CC4 +#define ADC_EXTERNALTRIGCONV_T4_CC4 ADC1_2_EXTERNALTRIG_T4_CC4 +#define ADC_EXTERNALTRIGCONV_T6_TRGO ADC1_2_EXTERNALTRIG_T6_TRGO +#define ADC_EXTERNALTRIGCONV_EXT_IT11 ADC1_2_EXTERNALTRIG_EXT_IT11 + +/*!< External triggers of regular group for ADC3&ADC4 only */ +#define ADC_EXTERNALTRIGCONV_T2_CC1 ADC3_4_EXTERNALTRIG_T2_CC1 +#define ADC_EXTERNALTRIGCONV_T2_CC3 ADC3_4_EXTERNALTRIG_T2_CC3 +#define ADC_EXTERNALTRIGCONV_T3_CC1 ADC3_4_EXTERNALTRIG_T3_CC1 +#define ADC_EXTERNALTRIGCONV_T4_CC1 ADC3_4_EXTERNALTRIG_T4_CC1 +#define ADC_EXTERNALTRIGCONV_T7_TRGO ADC3_4_EXTERNALTRIG_T7_TRGO +#define ADC_EXTERNALTRIGCONV_T8_CC1 ADC3_4_EXTERNALTRIG_T8_CC1 +#define ADC_EXTERNALTRIGCONV_EXT_IT2 ADC3_4_EXTERNALTRIG_EXT_IT2 + +/*!< External triggers of regular group for ADC1&ADC2, ADC3&ADC4 */ +/* Note: Triggers affected to group ADC1_2 by default, redirected to group */ +/* ADC3_4 by driver when needed. */ +#define ADC_EXTERNALTRIGCONV_T1_CC3 ADC1_2_EXTERNALTRIG_T1_CC3 +#define ADC_EXTERNALTRIGCONV_T1_TRGO ADC1_2_EXTERNALTRIG_T1_TRGO +#define ADC_EXTERNALTRIGCONV_T1_TRGO2 ADC1_2_EXTERNALTRIG_T1_TRGO2 +#define ADC_EXTERNALTRIGCONV_T2_TRGO ADC1_2_EXTERNALTRIG_T2_TRGO +#define ADC_EXTERNALTRIGCONV_T3_TRGO ADC1_2_EXTERNALTRIG_T3_TRGO +#define ADC_EXTERNALTRIGCONV_T4_TRGO ADC1_2_EXTERNALTRIG_T4_TRGO +#define ADC_EXTERNALTRIGCONV_T8_TRGO ADC1_2_EXTERNALTRIG_T8_TRGO +#define ADC_EXTERNALTRIGCONV_T8_TRGO2 ADC1_2_EXTERNALTRIG_T8_TRGO2 +#define ADC_EXTERNALTRIGCONV_T15_TRGO ADC1_2_EXTERNALTRIG_T15_TRGO + +#define ADC_SOFTWARE_START (0x00000001U) + +#if defined(STM32F303xE) || defined(STM32F398xx) +/* ADC external triggers specific to device STM303xE: mask to differentiate */ +/* standard triggers from specific timer 20U, needed for reallocation of */ +/* triggers common to ADC1&2U/ADC3&4 and to avoid mixing with standard */ +/* triggers without remap. */ +#define ADC_EXTERNALTRIGCONV_T20_MASK 0x1000 + +/*!< List of external triggers specific to device STM303xE: using Timer20 */ +/* with ADC trigger input remap. */ +/* To remap ADC trigger from other timers/ExtLine to timer20: use macro */ +/* " __HAL_REMAPADCTRIGGER_ENABLE(...) " with parameters described below: */ + +/*!< External triggers of regular group for ADC1&ADC2 only, specific to */ +/* device STM303xE: : using Timer20 with ADC trigger input remap */ +#define ADC_EXTERNALTRIGCONV_T20_CC2 ADC_EXTERNALTRIGCONV_T6_TRGO /*!< Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_EXT13U) */ +#define ADC_EXTERNALTRIGCONV_T20_CC3 ADC_EXTERNALTRIGCONV_T3_CC4 /*!< Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_EXT15U) */ + +/*!< External triggers of regular group for ADC3&ADC4 only, specific to */ +/* device STM303xE: : using Timer20 with ADC trigger input remap */ +/* None */ + +/*!< External triggers of regular group for ADC1&ADC2, ADC3&ADC4, specific to */ +/* device STM303xE: : using Timer20 with ADC trigger input remap */ +/* Note: Triggers affected to group ADC1_2 by default, redirected to group */ +/* ADC3_4 by driver when needed. */ +#define ADC_EXTERNALTRIGCONV_T20_CC1 (ADC_EXTERNALTRIGCONV_T4_CC4 | ADC_EXTERNALTRIGCONV_T20_MASK) /*!< For ADC1&ADC2: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_EXT5) */ + /*!< For ADC3&ADC4: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC34_EXT15U) */ +#define ADC_EXTERNALTRIGCONV_T20_TRGO (ADC_EXTERNALTRIGCONV_T1_CC3 | ADC_EXTERNALTRIGCONV_T20_MASK) /*!< For ADC1&ADC2: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_EXT2) */ + /*!< For ADC3&ADC4: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC34_EXT5) */ +#define ADC_EXTERNALTRIGCONV_T20_TRGO2 (ADC_EXTERNALTRIGCONV_T2_CC2 | ADC_EXTERNALTRIGCONV_T20_MASK) /*!< For ADC1&ADC2: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_EXT3) */ + /*!< For ADC3&ADC4: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC34_EXT6) */ +#endif /* STM32F303xE || STM32F398xx */ + +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) +/*!< List of external triggers with generic trigger name, independently of */ +/* ADC target (caution: applies to other ADCs sharing the same common group), */ +/* sorted by trigger name: */ + +/*!< External triggers of regular group for ADC1&ADC2 */ +#define ADC_EXTERNALTRIGCONV_T1_CC1 ADC1_2_EXTERNALTRIG_T1_CC1 +#define ADC_EXTERNALTRIGCONV_T1_CC2 ADC1_2_EXTERNALTRIG_T1_CC2 +#define ADC_EXTERNALTRIGCONV_T1_CC3 ADC1_2_EXTERNALTRIG_T1_CC3 +#define ADC_EXTERNALTRIGCONV_T1_TRGO ADC1_2_EXTERNALTRIG_T1_TRGO +#define ADC_EXTERNALTRIGCONV_T1_TRGO2 ADC1_2_EXTERNALTRIG_T1_TRGO2 +#define ADC_EXTERNALTRIGCONV_T2_CC2 ADC1_2_EXTERNALTRIG_T2_CC2 +#define ADC_EXTERNALTRIGCONV_T2_TRGO ADC1_2_EXTERNALTRIG_T2_TRGO +#define ADC_EXTERNALTRIGCONV_T3_CC4 ADC1_2_EXTERNALTRIG_T3_CC4 +#define ADC_EXTERNALTRIGCONV_T3_TRGO ADC1_2_EXTERNALTRIG_T3_TRGO +#define ADC_EXTERNALTRIGCONV_T4_CC4 ADC1_2_EXTERNALTRIG_T4_CC4 +#define ADC_EXTERNALTRIGCONV_T4_TRGO ADC1_2_EXTERNALTRIG_T4_TRGO +#define ADC_EXTERNALTRIGCONV_T6_TRGO ADC1_2_EXTERNALTRIG_T6_TRGO +#define ADC_EXTERNALTRIGCONV_T15_TRGO ADC1_2_EXTERNALTRIG_T15_TRGO +#define ADC_EXTERNALTRIGCONV_EXT_IT11 ADC1_2_EXTERNALTRIG_EXT_IT11 +#define ADC_SOFTWARE_START (0x00000001U) + +#if defined(STM32F302xE) +/* ADC external triggers specific to device STM302xE: mask to differentiate */ +/* standard triggers from specific timer 20U, needed for reallocation of */ +/* triggers common to ADC1&2 and to avoid mixing with standard */ +/* triggers without remap. */ +#define ADC_EXTERNALTRIGCONV_T20_MASK 0x1000 + +/*!< List of external triggers specific to device STM302xE: using Timer20 */ +/* with ADC trigger input remap. */ +/* To remap ADC trigger from other timers/ExtLine to timer20: use macro */ +/* " __HAL_REMAPADCTRIGGER_ENABLE(...) " with parameters described below: */ + +/*!< External triggers of regular group for ADC1&ADC2 only, specific to */ +/* device STM302xE: : using Timer20 with ADC trigger input remap */ +#define ADC_EXTERNALTRIGCONV_T20_CC2 ADC_EXTERNALTRIGCONV_T6_TRGO /*!< Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_EXT13U) */ +#define ADC_EXTERNALTRIGCONV_T20_CC3 ADC_EXTERNALTRIGCONV_T3_CC4 /*!< Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_EXT15U) */ +#endif /* STM32F302xE */ + +#endif /* STM32F302xE || */ + /* STM32F302xC */ + +#if defined(STM32F303x8) || defined(STM32F328xx) +/*!< List of external triggers with generic trigger name, independently of */ +/* ADC target (caution: applies to other ADCs sharing the same common group), */ +/* sorted by trigger name: */ + +/*!< External triggers of regular group for ADC1&ADC2 */ +#define ADC_EXTERNALTRIGCONV_T1_CC1 ADC1_2_EXTERNALTRIG_T1_CC1 +#define ADC_EXTERNALTRIGCONV_T1_CC2 ADC1_2_EXTERNALTRIG_T1_CC2 +#define ADC_EXTERNALTRIGCONV_T1_CC3 ADC1_2_EXTERNALTRIG_T1_CC3 +#define ADC_EXTERNALTRIGCONV_T1_TRGO ADC1_2_EXTERNALTRIG_T1_TRGO +#define ADC_EXTERNALTRIGCONV_T1_TRGO2 ADC1_2_EXTERNALTRIG_T1_TRGO2 +#define ADC_EXTERNALTRIGCONV_T2_CC2 ADC1_2_EXTERNALTRIG_T2_CC2 +#define ADC_EXTERNALTRIGCONV_T2_TRGO ADC1_2_EXTERNALTRIG_T2_TRGO +#define ADC_EXTERNALTRIGCONV_T3_CC4 ADC1_2_EXTERNALTRIG_T3_CC4 +#define ADC_EXTERNALTRIGCONV_T3_TRGO ADC1_2_EXTERNALTRIG_T3_TRGO +#define ADC_EXTERNALTRIGCONV_T4_CC4 ADC1_2_EXTERNALTRIG_T4_CC4 +#define ADC_EXTERNALTRIGCONV_T4_TRGO ADC1_2_EXTERNALTRIG_T4_TRGO +#define ADC_EXTERNALTRIGCONV_T8_TRGO ADC1_2_EXTERNALTRIG_T8_TRGO +#define ADC_EXTERNALTRIGCONV_T8_TRGO2 ADC1_2_EXTERNALTRIG_T8_TRGO2 +#define ADC_EXTERNALTRIGCONV_T6_TRGO ADC1_2_EXTERNALTRIG_T6_TRGO +#define ADC_EXTERNALTRIGCONV_T15_TRGO ADC1_2_EXTERNALTRIG_T15_TRGO +#define ADC_EXTERNALTRIGCONV_EXT_IT11 ADC1_2_EXTERNALTRIG_EXT_IT11 +#define ADC_SOFTWARE_START (0x00000001U) + +#endif /* STM32F303x8 || STM32F328xx */ + +#if defined(STM32F334x8) +/*!< List of external triggers with generic trigger name, independently of */ +/* ADC target (caution: applies to other ADCs sharing the same common group), */ +/* sorted by trigger name: */ + +/*!< External triggers of regular group for ADC1&ADC2 */ +#define ADC_EXTERNALTRIGCONV_T1_CC1 ADC1_2_EXTERNALTRIG_T1_CC1 +#define ADC_EXTERNALTRIGCONV_T1_CC2 ADC1_2_EXTERNALTRIG_T1_CC2 +#define ADC_EXTERNALTRIGCONV_T1_CC3 ADC1_2_EXTERNALTRIG_T1_CC3 +#define ADC_EXTERNALTRIGCONV_T1_TRGO ADC1_2_EXTERNALTRIG_T1_TRGO +#define ADC_EXTERNALTRIGCONV_T1_TRGO2 ADC1_2_EXTERNALTRIG_T1_TRGO2 +#define ADC_EXTERNALTRIGCONV_T2_CC2 ADC1_2_EXTERNALTRIG_T2_CC2 +#define ADC_EXTERNALTRIGCONV_T2_TRGO ADC1_2_EXTERNALTRIG_T2_TRGO +#define ADC_EXTERNALTRIGCONV_T3_CC4 ADC1_2_EXTERNALTRIG_T3_CC4 +#define ADC_EXTERNALTRIGCONV_T3_TRGO ADC1_2_EXTERNALTRIG_T3_TRGO +#define ADC_EXTERNALTRIGCONV_T6_TRGO ADC1_2_EXTERNALTRIG_T6_TRGO +#define ADC_EXTERNALTRIGCONV_T15_TRGO ADC1_2_EXTERNALTRIG_T15_TRGO +#define ADC_EXTERNALTRIGCONVHRTIM_TRG1 ADC1_2_EXTERNALTRIG_HRTIM_TRG1 +#define ADC_EXTERNALTRIGCONVHRTIM_TRG3 ADC1_2_EXTERNALTRIG_HRTIM_TRG3 +#define ADC_EXTERNALTRIGCONV_EXT_IT11 ADC1_2_EXTERNALTRIG_EXT_IT11 +#define ADC_SOFTWARE_START (0x00000001U) +#endif /* STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/* List of external triggers with generic trigger name, sorted by trigger */ +/* name: */ + +/* External triggers of regular group for ADC1 */ +#define ADC_EXTERNALTRIGCONV_T1_CC1 ADC1_EXTERNALTRIG_T1_CC1 +#define ADC_EXTERNALTRIGCONV_T1_CC2 ADC1_EXTERNALTRIG_T1_CC2 +#define ADC_EXTERNALTRIGCONV_T1_CC3 ADC1_EXTERNALTRIG_T1_CC3 +#define ADC_EXTERNALTRIGCONV_T2_CC2 ADC1_EXTERNALTRIG_T2_CC2 +#define ADC_EXTERNALTRIGCONV_EXT_IT11 ADC1_EXTERNALTRIG_EXT_IT11 +#define ADC_EXTERNALTRIGCONV_T1_TRGO ADC1_EXTERNALTRIG_T1_TRGO +#define ADC_EXTERNALTRIGCONV_T1_TRGO2 ADC1_EXTERNALTRIG_T1_TRGO2 +#define ADC_EXTERNALTRIGCONV_T2_TRGO ADC1_EXTERNALTRIG_T2_TRGO +#define ADC_EXTERNALTRIGCONV_T6_TRGO ADC1_EXTERNALTRIG_T6_TRGO +#define ADC_EXTERNALTRIGCONV_T15_TRGO ADC1_EXTERNALTRIG_T15_TRGO +#define ADC_SOFTWARE_START (0x00000001U) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ +/** + * @} + */ + +/** @defgroup ADCEx_EOCSelection ADC Extended End of Regular Sequence/Conversion + * @{ + */ +#define ADC_EOC_SINGLE_CONV ((uint32_t) ADC_ISR_EOC) +#define ADC_EOC_SEQ_CONV ((uint32_t) ADC_ISR_EOS) +/** + * @} + */ + +/** @defgroup ADCEx_Overrun ADC Extended overrun + * @{ + */ +#define ADC_OVR_DATA_OVERWRITTEN (0x00000000U) /*!< Default setting, to be used for compatibility with other STM32 devices */ +#define ADC_OVR_DATA_PRESERVED (0x00000001U) +/** + * @} + */ + +/** @defgroup ADCEx_channels ADC Extended Channels + * @{ + */ +/* Note: Depending on devices, some channels may not be available on package */ +/* pins. Refer to device datasheet for channels availability. */ +#define ADC_CHANNEL_1 ((uint32_t)(ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_2 ((uint32_t)(ADC_SQR3_SQ10_1)) +#define ADC_CHANNEL_3 ((uint32_t)(ADC_SQR3_SQ10_1 | ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_4 ((uint32_t)(ADC_SQR3_SQ10_2)) +#define ADC_CHANNEL_5 ((uint32_t)(ADC_SQR3_SQ10_2 | ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_6 ((uint32_t)(ADC_SQR3_SQ10_2 | ADC_SQR3_SQ10_1)) +#define ADC_CHANNEL_7 ((uint32_t)(ADC_SQR3_SQ10_2 | ADC_SQR3_SQ10_1 | ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_8 ((uint32_t)(ADC_SQR3_SQ10_3)) +#define ADC_CHANNEL_9 ((uint32_t)(ADC_SQR3_SQ10_3 | ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_10 ((uint32_t)(ADC_SQR3_SQ10_3 | ADC_SQR3_SQ10_1)) +#define ADC_CHANNEL_11 ((uint32_t)(ADC_SQR3_SQ10_3 | ADC_SQR3_SQ10_1 | ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_12 ((uint32_t)(ADC_SQR3_SQ10_3 | ADC_SQR3_SQ10_2)) +#define ADC_CHANNEL_13 ((uint32_t)(ADC_SQR3_SQ10_3 | ADC_SQR3_SQ10_2 | ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_14 ((uint32_t)(ADC_SQR3_SQ10_3 | ADC_SQR3_SQ10_2 | ADC_SQR3_SQ10_1)) +#define ADC_CHANNEL_15 ((uint32_t)(ADC_SQR3_SQ10_3 | ADC_SQR3_SQ10_2 | ADC_SQR3_SQ10_1 | ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_16 ((uint32_t)(ADC_SQR3_SQ10_4)) +#define ADC_CHANNEL_17 ((uint32_t)(ADC_SQR3_SQ10_4 | ADC_SQR3_SQ10_0)) +#define ADC_CHANNEL_18 ((uint32_t)(ADC_SQR3_SQ10_4 | ADC_SQR3_SQ10_1)) + +/* Note: Vopamp1, TempSensor and Vbat internal channels available on ADC1 only */ +#define ADC_CHANNEL_VOPAMP1 ADC_CHANNEL_15 +#define ADC_CHANNEL_TEMPSENSOR ADC_CHANNEL_16 +#define ADC_CHANNEL_VBAT ADC_CHANNEL_17 + +/* Note: Vopamp2/3U/4 internal channels available on ADC2/3U/4 respectively */ +#define ADC_CHANNEL_VOPAMP2 ADC_CHANNEL_17 +#define ADC_CHANNEL_VOPAMP3 ADC_CHANNEL_17 +#define ADC_CHANNEL_VOPAMP4 ADC_CHANNEL_17 + +/* Note: VrefInt internal channels available on all ADCs, but only */ +/* one ADC is allowed to be connected to VrefInt at the same time. */ +#define ADC_CHANNEL_VREFINT ((uint32_t)ADC_CHANNEL_18) +/** + * @} + */ + +/** @defgroup ADCEx_sampling_times ADC Extended Sampling Times + * @{ + */ +#define ADC_SAMPLETIME_1CYCLE_5 (0x00000000U) /*!< Sampling time 1.5 ADC clock cycle */ +#define ADC_SAMPLETIME_2CYCLES_5 ((uint32_t)ADC_SMPR2_SMP10_0) /*!< Sampling time 2.5 ADC clock cycles */ +#define ADC_SAMPLETIME_4CYCLES_5 ((uint32_t)ADC_SMPR2_SMP10_1) /*!< Sampling time 4.5 ADC clock cycles */ +#define ADC_SAMPLETIME_7CYCLES_5 ((uint32_t)(ADC_SMPR2_SMP10_1 | ADC_SMPR2_SMP10_0)) /*!< Sampling time 7.5 ADC clock cycles */ +#define ADC_SAMPLETIME_19CYCLES_5 ((uint32_t)ADC_SMPR2_SMP10_2) /*!< Sampling time 19.5 ADC clock cycles */ +#define ADC_SAMPLETIME_61CYCLES_5 ((uint32_t)(ADC_SMPR2_SMP10_2 | ADC_SMPR2_SMP10_0)) /*!< Sampling time 61.5 ADC clock cycles */ +#define ADC_SAMPLETIME_181CYCLES_5 ((uint32_t)(ADC_SMPR2_SMP10_2 | ADC_SMPR2_SMP10_1)) /*!< Sampling time 181.5 ADC clock cycles */ +#define ADC_SAMPLETIME_601CYCLES_5 ((uint32_t)ADC_SMPR2_SMP10) /*!< Sampling time 601.5 ADC clock cycles */ +/** + * @} + */ + +/** @defgroup ADCEx_SingleDifferential ADC Extended Single-ended/Differential input mode + * @{ + */ +#define ADC_SINGLE_ENDED (0x00000000U) +#define ADC_DIFFERENTIAL_ENDED (0x00000001U) +/** + * @} + */ + +/** @defgroup ADCEx_OffsetNumber ADC Extended Offset Number + * @{ + */ +#define ADC_OFFSET_NONE (0x00U) +#define ADC_OFFSET_1 (0x01U) +#define ADC_OFFSET_2 (0x02U) +#define ADC_OFFSET_3 (0x03U) +#define ADC_OFFSET_4 (0x04U) +/** + * @} + */ + +/** @defgroup ADCEx_regular_rank ADC Extended rank into regular group + * @{ + */ +#define ADC_REGULAR_RANK_1 (0x00000001U) +#define ADC_REGULAR_RANK_2 (0x00000002U) +#define ADC_REGULAR_RANK_3 (0x00000003U) +#define ADC_REGULAR_RANK_4 (0x00000004U) +#define ADC_REGULAR_RANK_5 (0x00000005U) +#define ADC_REGULAR_RANK_6 (0x00000006U) +#define ADC_REGULAR_RANK_7 (0x00000007U) +#define ADC_REGULAR_RANK_8 (0x00000008U) +#define ADC_REGULAR_RANK_9 (0x00000009U) +#define ADC_REGULAR_RANK_10 (0x0000000AU) +#define ADC_REGULAR_RANK_11 (0x0000000BU) +#define ADC_REGULAR_RANK_12 (0x0000000CU) +#define ADC_REGULAR_RANK_13 (0x0000000DU) +#define ADC_REGULAR_RANK_14 (0x0000000EU) +#define ADC_REGULAR_RANK_15 (0x0000000FU) +#define ADC_REGULAR_RANK_16 (0x00000010U) +/** + * @} + */ + +/** @defgroup ADCEx_injected_rank ADC Extended Injected Channel Rank + * @{ + */ +#define ADC_INJECTED_RANK_1 (0x00000001U) +#define ADC_INJECTED_RANK_2 (0x00000002U) +#define ADC_INJECTED_RANK_3 (0x00000003U) +#define ADC_INJECTED_RANK_4 (0x00000004U) +/** + * @} + */ + +/** @defgroup ADCEx_External_trigger_edge_Injected External Trigger Edge of Injected Group + * @{ + */ +#define ADC_EXTERNALTRIGINJECCONV_EDGE_NONE (0x00000000U) +#define ADC_EXTERNALTRIGINJECCONV_EDGE_RISING ((uint32_t)ADC_JSQR_JEXTEN_0) +#define ADC_EXTERNALTRIGINJECCONV_EDGE_FALLING ((uint32_t)ADC_JSQR_JEXTEN_1) +#define ADC_EXTERNALTRIGINJECCONV_EDGE_RISINGFALLING ((uint32_t)ADC_JSQR_JEXTEN) +/** + * @} + */ + +/** @defgroup ADCEx_External_trigger_source_Injected External Trigger Source of Injected Group + * @{ + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +/* List of external triggers with generic trigger name, independently of ADC */ +/* target (caution: applies to other ADCs sharing the same common group), */ +/* sorted by trigger name: */ + +/* External triggers of injected group for ADC1&ADC2 only */ +#define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ADC1_2_EXTERNALTRIGINJEC_T2_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC1 ADC1_2_EXTERNALTRIGINJEC_T3_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC3 ADC1_2_EXTERNALTRIGINJEC_T3_CC3 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ADC1_2_EXTERNALTRIGINJEC_T3_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T6_TRGO ADC1_2_EXTERNALTRIGINJEC_T6_TRGO +#define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ADC1_2_EXTERNALTRIGINJEC_EXT_IT15 + +/* External triggers of injected group for ADC3&ADC4 only */ +#define ADC_EXTERNALTRIGINJECCONV_T1_CC3 ADC3_4_EXTERNALTRIGINJEC_T1_CC3 +#define ADC_EXTERNALTRIGINJECCONV_T4_CC3 ADC3_4_EXTERNALTRIGINJEC_T4_CC3 +#define ADC_EXTERNALTRIGINJECCONV_T4_CC4 ADC3_4_EXTERNALTRIGINJEC_T4_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T7_TRGO ADC3_4_EXTERNALTRIGINJEC_T7_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T8_CC2 ADC3_4_EXTERNALTRIGINJEC_T8_CC2 + +/* External triggers of injected group for ADC1&ADC2, ADC3&ADC4 */ +/* Note: Triggers affected to group ADC1_2 by default, redirected to group */ +/* ADC3_4 by driver when needed. */ +#define ADC_EXTERNALTRIGINJECCONV_T1_CC4 ADC1_2_EXTERNALTRIGINJEC_T1_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO ADC1_2_EXTERNALTRIGINJEC_T1_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO2 ADC1_2_EXTERNALTRIGINJEC_T1_TRGO2 +#define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ADC1_2_EXTERNALTRIGINJEC_T2_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T3_TRGO ADC1_2_EXTERNALTRIGINJEC_T3_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T4_TRGO ADC1_2_EXTERNALTRIGINJEC_T4_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T8_CC4 ADC1_2_EXTERNALTRIGINJEC_T8_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T8_TRGO ADC1_2_EXTERNALTRIGINJEC_T8_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T8_TRGO2 ADC1_2_EXTERNALTRIGINJEC_T8_TRGO2 +#define ADC_EXTERNALTRIGINJECCONV_T15_TRGO ADC1_2_EXTERNALTRIGINJEC_T15_TRGO + +#define ADC_INJECTED_SOFTWARE_START (0x00000001U) + +#if defined(STM32F303xE) || defined(STM32F398xx) +/*!< List of external triggers specific to device STM303xE: using Timer20 */ +/* with ADC trigger input remap. */ +/* To remap ADC trigger from other timers/ExtLine to timer20: use macro */ +/* " __HAL_REMAPADCTRIGGER_ENABLE(...) " with parameters described below: */ + +/*!< External triggers of injected group for ADC1&ADC2 only, specific to */ +/* device STM303xE: : using Timer20 with ADC trigger input remap */ +#define ADC_EXTERNALTRIGINJECCONV_T20_CC4 ADC_EXTERNALTRIGINJECCONV_T3_CC1 /*!< Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_JEXT13U) */ + +/*!< External triggers of injected group for ADC3&ADC4 only, specific to */ +/* device STM303xE: : using Timer20 with ADC trigger input remap */ +#define ADC_EXTERNALTRIGINJECCONV_T20_CC2 ADC_EXTERNALTRIGINJECCONV_T7_TRGO /*!< Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC34_JEXT14U) */ + +/*!< External triggers of regular group for ADC1&ADC2, ADC3&ADC4, specific to */ +/* device STM303xE: : using Timer20 with ADC trigger input remap */ +/* Note: Triggers affected to group ADC1_2 by default, redirected to group */ +/* ADC3_4 by driver when needed. */ +#define ADC_EXTERNALTRIGINJECCONV_T20_TRGO (ADC_EXTERNALTRIGINJECCONV_T2_CC1 | ADC_EXTERNALTRIGCONV_T20_MASK) /*!< For ADC1&ADC2: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_JEXT3) */ + /*!< For ADC3&ADC4: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC34_JEXT5) */ +#define ADC_EXTERNALTRIGINJECCONV_T20_TRGO2 (ADC_EXTERNALTRIGINJECCONV_EXT_IT15 | ADC_EXTERNALTRIGCONV_T20_MASK) /*!< For ADC1&ADC2: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_JEXT6) */ + /*!< For ADC3&ADC4: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC34_JEXT11U) */ +#endif /* STM32F303xE || STM32F398xx */ + +#if defined(STM32F303xC) || defined(STM32F358xx) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T7_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T7_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_CC2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_TRGO2) || \ + \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F303xE || STM32F398xx */ + +#endif /* STM32F303xC || STM32F303xE || STM32F398xx || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) +/*!< List of external triggers with generic trigger name, independently of */ +/* ADC target (caution: applies to other ADCs sharing the same common group), */ +/* sorted by trigger name: */ + +/* External triggers of injected group for ADC1&ADC2 */ +#define ADC_EXTERNALTRIGINJECCONV_T1_CC4 ADC1_2_EXTERNALTRIGINJEC_T1_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO ADC1_2_EXTERNALTRIGINJEC_T1_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO2 ADC1_2_EXTERNALTRIGINJEC_T1_TRGO2 +#define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ADC1_2_EXTERNALTRIGINJEC_T2_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ADC1_2_EXTERNALTRIGINJEC_T2_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T3_CC1 ADC1_2_EXTERNALTRIGINJEC_T3_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC3 ADC1_2_EXTERNALTRIGINJEC_T3_CC3 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ADC1_2_EXTERNALTRIGINJEC_T3_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T3_TRGO ADC1_2_EXTERNALTRIGINJEC_T3_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T4_TRGO ADC1_2_EXTERNALTRIGINJEC_T4_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T6_TRGO ADC1_2_EXTERNALTRIGINJEC_T6_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T15_TRGO ADC1_2_EXTERNALTRIGINJEC_T15_TRGO +#define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ADC1_2_EXTERNALTRIGINJEC_EXT_IT15 + +#define ADC_INJECTED_SOFTWARE_START (0x00000001U) + +#if defined(STM32F302xE) +/*!< List of external triggers specific to device STM302xE: using Timer20 */ +/* with ADC trigger input remap. */ +/* To remap ADC trigger from other timers/ExtLine to timer20: use macro */ +/* " __HAL_REMAPADCTRIGGER_ENABLE(...) " with parameters described below: */ + +/*!< External triggers of injected group for ADC1&ADC2 only, specific to */ +/* device STM302xE: : using Timer20 with ADC trigger input remap */ +#define ADC_EXTERNALTRIGINJECCONV_T20_CC4 ADC_EXTERNALTRIGINJECCONV_T3_CC1 /*!< Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_JEXT13U) */ +#define ADC_EXTERNALTRIGINJECCONV_T20_TRGO (ADC_EXTERNALTRIGINJECCONV_T2_CC1 | ADC_EXTERNALTRIGCONV_T20_MASK) /*!< For ADC1&ADC2: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_JEXT3) */ +#define ADC_EXTERNALTRIGINJECCONV_T20_TRGO2 (ADC_EXTERNALTRIGINJECCONV_EXT_IT15 | ADC_EXTERNALTRIGCONV_T20_MASK) /*!< For ADC1&ADC2: Remap trigger using macro __HAL_REMAPADCTRIGGER_ENABLE(HAL_REMAPADCTRIGGER_ADC12_JEXT6) */ +#endif /* STM32F302xE */ + +#endif /* STM32F302xE || */ + /* STM32F302xC */ + +#if defined(STM32F303x8) || defined(STM32F328xx) +/*!< List of external triggers with generic trigger name, independently of */ +/* ADC target (caution: applies to other ADCs sharing the same common group), */ +/* sorted by trigger name: */ + +/* External triggers of injected group for ADC1&ADC2 */ +#define ADC_EXTERNALTRIGINJECCONV_T1_CC4 ADC1_2_EXTERNALTRIGINJEC_T1_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO ADC1_2_EXTERNALTRIGINJEC_T1_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO2 ADC1_2_EXTERNALTRIGINJEC_T1_TRGO2 +#define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ADC1_2_EXTERNALTRIGINJEC_T2_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ADC1_2_EXTERNALTRIGINJEC_T2_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T3_CC1 ADC1_2_EXTERNALTRIGINJEC_T3_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC3 ADC1_2_EXTERNALTRIGINJEC_T3_CC3 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ADC1_2_EXTERNALTRIGINJEC_T3_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T3_TRGO ADC1_2_EXTERNALTRIGINJEC_T3_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T4_TRGO ADC1_2_EXTERNALTRIGINJEC_T4_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T6_TRGO ADC1_2_EXTERNALTRIGINJEC_T6_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T8_CC4 ADC1_2_EXTERNALTRIGINJEC_T8_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T8_TRGO ADC1_2_EXTERNALTRIGINJEC_T8_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T8_TRGO2 ADC1_2_EXTERNALTRIGINJEC_T8_TRGO2 +#define ADC_EXTERNALTRIGINJECCONV_T15_TRGO ADC1_2_EXTERNALTRIGINJEC_T15_TRGO +#define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ADC1_2_EXTERNALTRIGINJEC_EXT_IT15 + +#define ADC_INJECTED_SOFTWARE_START (0x00000001U) +#endif /* STM32F303x8 || STM32F328xx */ + +#if defined(STM32F334x8) +/*!< List of external triggers with generic trigger name, independently of */ +/* ADC target (caution: applies to other ADCs sharing the same common group), */ +/* sorted by trigger name: */ + +/* External triggers of injected group for ADC1&ADC2 */ +#define ADC_EXTERNALTRIGINJECCONV_T1_CC4 ADC1_2_EXTERNALTRIGINJEC_T1_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO ADC1_2_EXTERNALTRIGINJEC_T1_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO2 ADC1_2_EXTERNALTRIGINJEC_T1_TRGO2 +#define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ADC1_2_EXTERNALTRIGINJEC_T2_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ADC1_2_EXTERNALTRIGINJEC_T2_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T3_CC1 ADC1_2_EXTERNALTRIGINJEC_T3_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC3 ADC1_2_EXTERNALTRIGINJEC_T3_CC3 +#define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ADC1_2_EXTERNALTRIGINJEC_T3_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T3_TRGO ADC1_2_EXTERNALTRIGINJEC_T3_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T6_TRGO ADC1_2_EXTERNALTRIGINJEC_T6_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T15_TRGO ADC1_2_EXTERNALTRIGINJEC_T15_TRGO +#define ADC_EXTERNALTRIGINJECCONV_HRTIM_TRG2 ADC1_2_EXTERNALTRIGINJEC_HRTIM_TRG2 +#define ADC_EXTERNALTRIGINJECCONV_HRTIM_TRG4 ADC1_2_EXTERNALTRIGINJEC_HRTIM_TRG4 +#define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ADC1_2_EXTERNALTRIGINJEC_EXT_IT15 + +#define ADC_INJECTED_SOFTWARE_START (0x00000001U) +#endif /* STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/* List of external triggers with generic trigger name, sorted by trigger */ +/* name: */ + +/* External triggers of injected group for ADC1 */ +#define ADC_EXTERNALTRIGINJECCONV_T1_CC4 ADC1_EXTERNALTRIGINJEC_T1_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO ADC1_EXTERNALTRIGINJEC_T1_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T1_TRGO2 ADC1_EXTERNALTRIGINJEC_T1_TRGO2 +#define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ADC1_EXTERNALTRIGINJEC_T2_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ADC1_EXTERNALTRIGINJEC_T2_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T6_TRGO ADC1_EXTERNALTRIGINJEC_T6_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T15_TRGO ADC1_EXTERNALTRIGINJEC_T15_TRGO +#define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ADC1_EXTERNALTRIGINJEC_EXT_IT15 + +#define ADC_INJECTED_SOFTWARE_START (0x00000001U) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ +/** + * @} + */ + + +/** @defgroup ADCEx_Common_mode ADC Extended Dual ADC Mode + * @{ + */ +#define ADC_MODE_INDEPENDENT ((uint32_t)(0x00000000U)) +#define ADC_DUALMODE_REGSIMULT_INJECSIMULT ((uint32_t)(ADC12_CCR_MULTI_0)) +#define ADC_DUALMODE_REGSIMULT_ALTERTRIG ((uint32_t)(ADC12_CCR_MULTI_1)) +#define ADC_DUALMODE_REGINTERL_INJECSIMULT ((uint32_t)(ADC12_CCR_MULTI_1 | ADC12_CCR_MULTI_0)) +#define ADC_DUALMODE_INJECSIMULT ((uint32_t)(ADC12_CCR_MULTI_2 | ADC12_CCR_MULTI_0)) +#define ADC_DUALMODE_REGSIMULT ((uint32_t)(ADC12_CCR_MULTI_2 | ADC12_CCR_MULTI_1)) +#define ADC_DUALMODE_INTERL ((uint32_t)(ADC12_CCR_MULTI_2 | ADC12_CCR_MULTI_1 | ADC12_CCR_MULTI_0)) +#define ADC_DUALMODE_ALTERTRIG ((uint32_t)(ADC12_CCR_MULTI_3 | ADC12_CCR_MULTI_0)) +/** + * @} + */ + + +/** @defgroup ADCEx_Direct_memory_access_mode_for_multimode ADC Extended DMA Mode for Dual ADC Mode + * @{ + */ +#define ADC_DMAACCESSMODE_DISABLED (0x00000000U) /*!< DMA multimode disabled: each ADC will use its own DMA channel */ +#define ADC_DMAACCESSMODE_12_10_BITS ((uint32_t)ADC12_CCR_MDMA_1) /*!< DMA multimode enabled (one DMA channel for both ADC, DMA of ADC master) for 12 and 10 bits resolution */ +#define ADC_DMAACCESSMODE_8_6_BITS ((uint32_t)ADC12_CCR_MDMA) /*!< DMA multimode enabled (one DMA channel for both ADC, DMA of ADC master) for 8 and 6 bits resolution */ +/** + * @} + */ + +/** @defgroup ADCEx_delay_between_2_sampling_phases ADC Extended Delay Between 2 Sampling Phases + * @{ + */ +#define ADC_TWOSAMPLINGDELAY_1CYCLE ((uint32_t)(0x00000000U)) +#define ADC_TWOSAMPLINGDELAY_2CYCLES ((uint32_t)(ADC12_CCR_DELAY_0)) +#define ADC_TWOSAMPLINGDELAY_3CYCLES ((uint32_t)(ADC12_CCR_DELAY_1)) +#define ADC_TWOSAMPLINGDELAY_4CYCLES ((uint32_t)(ADC12_CCR_DELAY_1 | ADC12_CCR_DELAY_0)) +#define ADC_TWOSAMPLINGDELAY_5CYCLES ((uint32_t)(ADC12_CCR_DELAY_2)) +#define ADC_TWOSAMPLINGDELAY_6CYCLES ((uint32_t)(ADC12_CCR_DELAY_2 | ADC12_CCR_DELAY_0)) +#define ADC_TWOSAMPLINGDELAY_7CYCLES ((uint32_t)(ADC12_CCR_DELAY_2 | ADC12_CCR_DELAY_1)) +#define ADC_TWOSAMPLINGDELAY_8CYCLES ((uint32_t)(ADC12_CCR_DELAY_2 | ADC12_CCR_DELAY_1 | ADC12_CCR_DELAY_0)) +#define ADC_TWOSAMPLINGDELAY_9CYCLES ((uint32_t)(ADC12_CCR_DELAY_3)) +#define ADC_TWOSAMPLINGDELAY_10CYCLES ((uint32_t)(ADC12_CCR_DELAY_3 | ADC12_CCR_DELAY_0)) +#define ADC_TWOSAMPLINGDELAY_11CYCLES ((uint32_t)(ADC12_CCR_DELAY_3 | ADC12_CCR_DELAY_1)) +#define ADC_TWOSAMPLINGDELAY_12CYCLES ((uint32_t)(ADC12_CCR_DELAY_3 | ADC12_CCR_DELAY_1 | ADC12_CCR_DELAY_0)) +/** + * @} + */ + +/** @defgroup ADCEx_analog_watchdog_number ADC Extended Analog Watchdog Selection + * @{ + */ +#define ADC_ANALOGWATCHDOG_1 (0x00000001U) +#define ADC_ANALOGWATCHDOG_2 (0x00000002U) +#define ADC_ANALOGWATCHDOG_3 (0x00000003U) +/** + * @} + */ + +/** @defgroup ADCEx_analog_watchdog_mode ADC Extended Analog Watchdog Mode + * @{ + */ +#define ADC_ANALOGWATCHDOG_NONE ( 0x00000000U) +#define ADC_ANALOGWATCHDOG_SINGLE_REG ((uint32_t)(ADC_CFGR_AWD1SGL | ADC_CFGR_AWD1EN)) +#define ADC_ANALOGWATCHDOG_SINGLE_INJEC ((uint32_t)(ADC_CFGR_AWD1SGL | ADC_CFGR_JAWD1EN)) +#define ADC_ANALOGWATCHDOG_SINGLE_REGINJEC ((uint32_t)(ADC_CFGR_AWD1SGL | ADC_CFGR_AWD1EN | ADC_CFGR_JAWD1EN)) +#define ADC_ANALOGWATCHDOG_ALL_REG ((uint32_t) ADC_CFGR_AWD1EN) +#define ADC_ANALOGWATCHDOG_ALL_INJEC ((uint32_t) ADC_CFGR_JAWD1EN) +#define ADC_ANALOGWATCHDOG_ALL_REGINJEC ((uint32_t)(ADC_CFGR_AWD1EN | ADC_CFGR_JAWD1EN)) +/** + * @} + */ + +/** @defgroup ADC_conversion_group ADC Conversion Group + * @{ + */ +#define ADC_REGULAR_GROUP ((uint32_t)(ADC_FLAG_EOC | ADC_FLAG_EOS)) +#define ADC_INJECTED_GROUP ((uint32_t)(ADC_FLAG_JEOC | ADC_FLAG_JEOS)) +#define ADC_REGULAR_INJECTED_GROUP ((uint32_t)(ADC_FLAG_EOC | ADC_FLAG_EOS | ADC_FLAG_JEOC | ADC_FLAG_JEOS)) + +/** + * @} + */ + +/** @defgroup ADCEx_Event_type ADC Extended Event Type + * @{ + */ +#define ADC_AWD1_EVENT ((uint32_t)ADC_FLAG_AWD1) /*!< ADC Analog watchdog 1 event (main analog watchdog, present on all STM32 devices) */ +#define ADC_AWD2_EVENT ((uint32_t)ADC_FLAG_AWD2) /*!< ADC Analog watchdog 2 event (additional analog watchdog, not present on all STM32 families) */ +#define ADC_AWD3_EVENT ((uint32_t)ADC_FLAG_AWD3) /*!< ADC Analog watchdog 3 event (additional analog watchdog, not present on all STM32 families) */ +#define ADC_OVR_EVENT ((uint32_t)ADC_FLAG_OVR) /*!< ADC overrun event */ +#define ADC_JQOVF_EVENT ((uint32_t)ADC_FLAG_JQOVF) /*!< ADC Injected Context Queue Overflow event */ + +#define ADC_AWD_EVENT ADC_AWD1_EVENT /* ADC Analog watchdog 1 event: Alternate naming for compatibility with other STM32 devices having only 1 analog watchdog */ +/** + * @} + */ + +/** @defgroup ADCEx_interrupts_definition ADC Extended Interrupts Definition + * @{ + */ +#define ADC_IT_RDY ADC_IER_RDY /*!< ADC Ready (ADRDY) interrupt source */ +#define ADC_IT_EOSMP ADC_IER_EOSMP /*!< ADC End of Sampling interrupt source */ +#define ADC_IT_EOC ADC_IER_EOC /*!< ADC End of Regular Conversion interrupt source */ +#define ADC_IT_EOS ADC_IER_EOS /*!< ADC End of Regular sequence of Conversions interrupt source */ +#define ADC_IT_OVR ADC_IER_OVR /*!< ADC overrun interrupt source */ +#define ADC_IT_JEOC ADC_IER_JEOC /*!< ADC End of Injected Conversion interrupt source */ +#define ADC_IT_JEOS ADC_IER_JEOS /*!< ADC End of Injected sequence of Conversions interrupt source */ +#define ADC_IT_AWD1 ADC_IER_AWD1 /*!< ADC Analog watchdog 1 interrupt source (main analog watchdog, present on all STM32 devices) */ +#define ADC_IT_AWD2 ADC_IER_AWD2 /*!< ADC Analog watchdog 2 interrupt source (additional analog watchdog, present only on STM32F3 devices) */ +#define ADC_IT_AWD3 ADC_IER_AWD3 /*!< ADC Analog watchdog 3 interrupt source (additional analog watchdog, present only on STM32F3 devices) */ +#define ADC_IT_JQOVF ADC_IER_JQOVF /*!< ADC Injected Context Queue Overflow interrupt source */ + +#define ADC_IT_AWD ADC_IT_AWD1 /* ADC Analog watchdog 1 interrupt source: Alternate naming for compatibility with other STM32 devices having only 1 analog watchdog */ +/** + * @} + */ + +/** @defgroup ADCEx_flags_definition ADC Extended Flags Definition + * @{ + */ +#define ADC_FLAG_RDY ADC_ISR_ADRD /*!< ADC Ready (ADRDY) flag */ +#define ADC_FLAG_EOSMP ADC_ISR_EOSMP /*!< ADC End of Sampling flag */ +#define ADC_FLAG_EOC ADC_ISR_EOC /*!< ADC End of Regular Conversion flag */ +#define ADC_FLAG_EOS ADC_ISR_EOS /*!< ADC End of Regular sequence of Conversions flag */ +#define ADC_FLAG_OVR ADC_ISR_OVR /*!< ADC overrun flag */ +#define ADC_FLAG_JEOC ADC_ISR_JEOC /*!< ADC End of Injected Conversion flag */ +#define ADC_FLAG_JEOS ADC_ISR_JEOS /*!< ADC End of Injected sequence of Conversions flag */ +#define ADC_FLAG_AWD1 ADC_ISR_AWD1 /*!< ADC Analog watchdog 1 flag (main analog watchdog, present on all STM32 devices) */ +#define ADC_FLAG_AWD2 ADC_ISR_AWD2 /*!< ADC Analog watchdog 2 flag (additional analog watchdog, present only on STM32F3 devices) */ +#define ADC_FLAG_AWD3 ADC_ISR_AWD3 /*!< ADC Analog watchdog 3 flag (additional analog watchdog, present only on STM32F3 devices) */ +#define ADC_FLAG_JQOVF ADC_ISR_JQOVF /*!< ADC Injected Context Queue Overflow flag */ + +#define ADC_FLAG_AWD ADC_FLAG_AWD1 /* ADC Analog watchdog 1 flag: Alternate naming for compatibility with other STM32 devices having only 1 analog watchdog */ +/** + * @} + */ + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** @defgroup ADCEx_Data_align ADC Extended Data Alignment + * @{ + */ +#define ADC_DATAALIGN_RIGHT (0x00000000U) +#define ADC_DATAALIGN_LEFT ((uint32_t)ADC_CR2_ALIGN) +/** + * @} + */ + +/** @defgroup ADCEx_Scan_mode ADC Extended Scan Mode + * @{ + */ +#define ADC_SCAN_DISABLE (0x00000000U) +#define ADC_SCAN_ENABLE ((uint32_t)ADC_CR1_SCAN) +/** + * @} + */ + +/** @defgroup ADCEx_External_trigger_edge_Regular ADC Extended External trigger enable for regular group + * @{ + */ +#define ADC_EXTERNALTRIGCONVEDGE_NONE (0x00000000U) +#define ADC_EXTERNALTRIGCONVEDGE_RISING ((uint32_t)ADC_CR2_EXTTRIG) +/** + * @} + */ + +/** @defgroup ADCEx_External_trigger_source_Regular ADC Extended External trigger selection for regular group + * @{ + */ +/* List of external triggers with generic trigger name, sorted by trigger */ +/* name: */ + +/* External triggers of regular group for ADC1 */ +#define ADC_EXTERNALTRIGCONV_T2_CC2 ADC_EXTERNALTRIG_T2_CC2 +#define ADC_EXTERNALTRIGCONV_T3_TRGO ADC_EXTERNALTRIG_T3_TRGO +#define ADC_EXTERNALTRIGCONV_T4_CC4 ADC_EXTERNALTRIG_T4_CC4 +#define ADC_EXTERNALTRIGCONV_T19_TRGO ADC_EXTERNALTRIG_T19_TRGO +#define ADC_EXTERNALTRIGCONV_T19_CC3 ADC_EXTERNALTRIG_T19_CC3 +#define ADC_EXTERNALTRIGCONV_T19_CC4 ADC_EXTERNALTRIG_T19_CC4 +#define ADC_EXTERNALTRIGCONV_EXT_IT11 ADC_EXTERNALTRIG_EXT_IT11 +#define ADC_SOFTWARE_START ADC_SWSTART +/** + * @} + */ + +/** @defgroup ADCEx_channels ADC Extended Channels + * @{ + */ +/* Note: Depending on devices, some channels may not be available on package */ +/* pins. Refer to device datasheet for channels availability. */ +#define ADC_CHANNEL_0 (0x00000000U) +#define ADC_CHANNEL_1 ((uint32_t)(ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_2 ((uint32_t)(ADC_SQR3_SQ1_1)) +#define ADC_CHANNEL_3 ((uint32_t)(ADC_SQR3_SQ1_1 | ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_4 ((uint32_t)(ADC_SQR3_SQ1_2)) +#define ADC_CHANNEL_5 ((uint32_t)(ADC_SQR3_SQ1_2 | ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_6 ((uint32_t)(ADC_SQR3_SQ1_2 | ADC_SQR3_SQ1_1)) +#define ADC_CHANNEL_7 ((uint32_t)(ADC_SQR3_SQ1_2 | ADC_SQR3_SQ1_1 | ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_8 ((uint32_t)(ADC_SQR3_SQ1_3)) +#define ADC_CHANNEL_9 ((uint32_t)(ADC_SQR3_SQ1_3 | ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_10 ((uint32_t)(ADC_SQR3_SQ1_3 | ADC_SQR3_SQ1_1)) +#define ADC_CHANNEL_11 ((uint32_t)(ADC_SQR3_SQ1_3 | ADC_SQR3_SQ1_1 | ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_12 ((uint32_t)(ADC_SQR3_SQ1_3 | ADC_SQR3_SQ1_2)) +#define ADC_CHANNEL_13 ((uint32_t)(ADC_SQR3_SQ1_3 | ADC_SQR3_SQ1_2 | ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_14 ((uint32_t)(ADC_SQR3_SQ1_3 | ADC_SQR3_SQ1_2 | ADC_SQR3_SQ1_1)) +#define ADC_CHANNEL_15 ((uint32_t)(ADC_SQR3_SQ1_3 | ADC_SQR3_SQ1_2 | ADC_SQR3_SQ1_1 | ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_16 ((uint32_t)(ADC_SQR3_SQ1_4)) +#define ADC_CHANNEL_17 ((uint32_t)(ADC_SQR3_SQ1_4 | ADC_SQR3_SQ1_0)) +#define ADC_CHANNEL_18 ((uint32_t)(ADC_SQR3_SQ1_4 | ADC_SQR3_SQ1_1)) + +#define ADC_CHANNEL_TEMPSENSOR ADC_CHANNEL_16 +#define ADC_CHANNEL_VREFINT ADC_CHANNEL_17 +#define ADC_CHANNEL_VBAT ADC_CHANNEL_18 +/** + * @} + */ + +/** @defgroup ADCEx_sampling_times ADC Extended Sampling Times + * @{ + */ +#define ADC_SAMPLETIME_1CYCLE_5 (0x00000000U) /*!< Sampling time 1.5 ADC clock cycle */ +#define ADC_SAMPLETIME_7CYCLES_5 ((uint32_t) ADC_SMPR2_SMP0_0) /*!< Sampling time 7.5 ADC clock cycles */ +#define ADC_SAMPLETIME_13CYCLES_5 ((uint32_t) ADC_SMPR2_SMP0_1) /*!< Sampling time 13.5 ADC clock cycles */ +#define ADC_SAMPLETIME_28CYCLES_5 ((uint32_t)(ADC_SMPR2_SMP0_1 | ADC_SMPR2_SMP0_0)) /*!< Sampling time 28.5 ADC clock cycles */ +#define ADC_SAMPLETIME_41CYCLES_5 ((uint32_t) ADC_SMPR2_SMP0_2) /*!< Sampling time 41.5 ADC clock cycles */ +#define ADC_SAMPLETIME_55CYCLES_5 ((uint32_t)(ADC_SMPR2_SMP0_2 | ADC_SMPR2_SMP0_0)) /*!< Sampling time 55.5 ADC clock cycles */ +#define ADC_SAMPLETIME_71CYCLES_5 ((uint32_t)(ADC_SMPR2_SMP0_2 | ADC_SMPR2_SMP0_1)) /*!< Sampling time 71.5 ADC clock cycles */ +#define ADC_SAMPLETIME_239CYCLES_5 ((uint32_t) ADC_SMPR2_SMP0) /*!< Sampling time 239.5 ADC clock cycles */ +/** + * @} + */ + +/** @defgroup ADCEx_regular_rank ADC Extended rank into regular group + * @{ + */ +#define ADC_REGULAR_RANK_1 (0x00000001U) +#define ADC_REGULAR_RANK_2 (0x00000002U) +#define ADC_REGULAR_RANK_3 (0x00000003U) +#define ADC_REGULAR_RANK_4 (0x00000004U) +#define ADC_REGULAR_RANK_5 (0x00000005U) +#define ADC_REGULAR_RANK_6 (0x00000006U) +#define ADC_REGULAR_RANK_7 (0x00000007U) +#define ADC_REGULAR_RANK_8 (0x00000008U) +#define ADC_REGULAR_RANK_9 (0x00000009U) +#define ADC_REGULAR_RANK_10 (0x0000000AU) +#define ADC_REGULAR_RANK_11 (0x0000000BU) +#define ADC_REGULAR_RANK_12 (0x0000000CU) +#define ADC_REGULAR_RANK_13 (0x0000000DU) +#define ADC_REGULAR_RANK_14 (0x0000000EU) +#define ADC_REGULAR_RANK_15 (0x0000000FU) +#define ADC_REGULAR_RANK_16 (0x00000010U) +/** + * @} + */ + +/** @defgroup ADCEx_injected_rank ADC Extended Injected Channel Rank + * @{ + */ +#define ADC_INJECTED_RANK_1 (0x00000001U) +#define ADC_INJECTED_RANK_2 (0x00000002U) +#define ADC_INJECTED_RANK_3 (0x00000003U) +#define ADC_INJECTED_RANK_4 (0x00000004U) +/** + * @} + */ + +/** @defgroup ADCEx_External_trigger_edge_Injected External Trigger Edge of Injected Group + * @{ + */ +#define ADC_EXTERNALTRIGINJECCONV_EDGE_NONE (0x00000000U) +#define ADC_EXTERNALTRIGINJECCONV_EDGE_RISING ((uint32_t)ADC_CR2_JEXTTRIG) +/** + * @} + */ + +/** @defgroup ADCEx_External_trigger_source_Injected External Trigger Source of Injected Group + * @{ + */ +/* External triggers for injected groups of ADC1 */ +#define ADC_EXTERNALTRIGINJECCONV_T2_CC1 ADC_EXTERNALTRIGINJEC_T2_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T2_TRGO ADC_EXTERNALTRIGINJEC_T2_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T3_CC4 ADC_EXTERNALTRIGINJEC_T3_CC4 +#define ADC_EXTERNALTRIGINJECCONV_T4_TRGO ADC_EXTERNALTRIGINJEC_T4_TRGO +#define ADC_EXTERNALTRIGINJECCONV_T19_CC1 ADC_EXTERNALTRIGINJEC_T19_CC1 +#define ADC_EXTERNALTRIGINJECCONV_T19_CC2 ADC_EXTERNALTRIGINJEC_T19_CC2 +#define ADC_EXTERNALTRIGINJECCONV_EXT_IT15 ADC_EXTERNALTRIGINJEC_EXT_IT15 +#define ADC_INJECTED_SOFTWARE_START ADC_JSWSTART +/** + * @} + */ + + +/** @defgroup ADCEx_analog_watchdog_mode ADC Extended analog watchdog mode + * @{ + */ +#define ADC_ANALOGWATCHDOG_NONE (0x00000000U) +#define ADC_ANALOGWATCHDOG_SINGLE_REG ((uint32_t)(ADC_CR1_AWDSGL | ADC_CR1_AWDEN)) +#define ADC_ANALOGWATCHDOG_SINGLE_INJEC ((uint32_t)(ADC_CR1_AWDSGL | ADC_CR1_JAWDEN)) +#define ADC_ANALOGWATCHDOG_SINGLE_REGINJEC ((uint32_t)(ADC_CR1_AWDSGL | ADC_CR1_AWDEN | ADC_CR1_JAWDEN)) +#define ADC_ANALOGWATCHDOG_ALL_REG ((uint32_t) ADC_CR1_AWDEN) +#define ADC_ANALOGWATCHDOG_ALL_INJEC ((uint32_t) ADC_CR1_JAWDEN) +#define ADC_ANALOGWATCHDOG_ALL_REGINJEC ((uint32_t)(ADC_CR1_AWDEN | ADC_CR1_JAWDEN)) +/** + * @} + */ + +/** @defgroup ADC_conversion_group ADC Conversion Group + * @{ + */ +#define ADC_REGULAR_GROUP ((uint32_t)(ADC_FLAG_EOC)) +#define ADC_INJECTED_GROUP ((uint32_t)(ADC_FLAG_JEOC)) +#define ADC_REGULAR_INJECTED_GROUP ((uint32_t)(ADC_FLAG_EOC | ADC_FLAG_JEOC)) +/** + * @} + */ + +/** @defgroup ADCEx_Event_type ADC Extended Event Type + * @{ + */ +#define ADC_AWD_EVENT ((uint32_t)ADC_FLAG_AWD) /*!< ADC Analog watchdog event */ +/** + * @} + */ + +/** @defgroup ADCEx_interrupts_definition ADC Extended Interrupts Definition + * @{ + */ +#define ADC_IT_EOC ADC_CR1_EOCIE /*!< ADC End of Regular Conversion interrupt source */ +#define ADC_IT_JEOC ADC_CR1_JEOCIE /*!< ADC End of Injected Conversion interrupt source */ +#define ADC_IT_AWD ADC_CR1_AWDIE /*!< ADC Analog watchdog interrupt source */ +/** + * @} + */ + +/** @defgroup ADCEx_flags_definition ADC Extended Flags Definition + * @{ + */ +#define ADC_FLAG_AWD ADC_SR_AWD /*!< ADC Analog watchdog flag */ +#define ADC_FLAG_EOC ADC_SR_EOC /*!< ADC End of Regular conversion flag */ +#define ADC_FLAG_JEOC ADC_SR_JEOC /*!< ADC End of Injected conversion flag */ +#define ADC_FLAG_JSTRT ADC_SR_JSTRT /*!< ADC Injected group start flag */ +#define ADC_FLAG_STRT ADC_SR_STRT /*!< ADC Regular group start flag */ + +/** + * @} + */ +#endif /* STM32F373xC || STM32F378xx */ + +/** + * @} + */ + + + +/* Private constants ---------------------------------------------------------*/ + +/** @addtogroup ADCEx_Private_Constants ADCEx Private Constants + * @{ + */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + +/** @defgroup ADCEx_Internal_HAL_driver_Ext_trig_src_Regular ADC Extended Internal HAL driver trigger selection for regular group + * @{ + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +/* List of external triggers for common groups ADC1&ADC2 and/or ADC3&ADC4: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ + +/* External triggers of regular group for ADC1 & ADC2 */ +#define ADC1_2_EXTERNALTRIG_T1_CC1 (0x00000000U) +#define ADC1_2_EXTERNALTRIG_T1_CC2 ((uint32_t)ADC_CFGR_EXTSEL_0) +#define ADC1_2_EXTERNALTRIG_T1_CC3 ((uint32_t)ADC_CFGR_EXTSEL_1) +#define ADC1_2_EXTERNALTRIG_T2_CC2 ((uint32_t)(ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T3_TRGO ((uint32_t)ADC_CFGR_EXTSEL_2) +#define ADC1_2_EXTERNALTRIG_T4_CC4 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_EXT_IT11 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T8_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T8_TRGO2 ((uint32_t) ADC_CFGR_EXTSEL_3) +#define ADC1_2_EXTERNALTRIG_T1_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T1_TRGO2 ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T2_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T4_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2)) +#define ADC1_2_EXTERNALTRIG_T6_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T15_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T3_CC4 ((uint32_t)ADC_CFGR_EXTSEL) + +/* External triggers of regular group for ADC3 & ADC4 */ +#define ADC3_4_EXTERNALTRIG_T3_CC1 (0x00000000U) +#define ADC3_4_EXTERNALTRIG_T2_CC3 ((uint32_t)ADC_CFGR_EXTSEL_0) +#define ADC3_4_EXTERNALTRIG_T1_CC3 ((uint32_t)ADC_CFGR_EXTSEL_1) +#define ADC3_4_EXTERNALTRIG_T8_CC1 ((uint32_t)(ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC3_4_EXTERNALTRIG_T8_TRGO ((uint32_t)ADC_CFGR_EXTSEL_2) +#define ADC3_4_EXTERNALTRIG_EXT_IT2 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC3_4_EXTERNALTRIG_T4_CC1 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC3_4_EXTERNALTRIG_T2_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC3_4_EXTERNALTRIG_T8_TRGO2 ((uint32_t)ADC_CFGR_EXTSEL_3) +#define ADC3_4_EXTERNALTRIG_T1_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0)) +#define ADC3_4_EXTERNALTRIG_T1_TRGO2 ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1)) +#define ADC3_4_EXTERNALTRIG_T3_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC3_4_EXTERNALTRIG_T4_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2)) +#define ADC3_4_EXTERNALTRIG_T7_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC3_4_EXTERNALTRIG_T15_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC3_4_EXTERNALTRIG_T2_CC1 ((uint32_t)ADC_CFGR_EXTSEL) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) +/* List of external triggers of common group ADC1&ADC2: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ +#define ADC1_2_EXTERNALTRIG_T1_CC1 (0x00000000U) +#define ADC1_2_EXTERNALTRIG_T1_CC2 ((uint32_t)ADC_CFGR_EXTSEL_0) +#define ADC1_2_EXTERNALTRIG_T1_CC3 ((uint32_t)ADC_CFGR_EXTSEL_1) +#define ADC1_2_EXTERNALTRIG_T1_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T1_TRGO2 ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T2_CC2 ((uint32_t)(ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T2_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T3_CC4 ((uint32_t)ADC_CFGR_EXTSEL) +#define ADC1_2_EXTERNALTRIG_T3_TRGO ((uint32_t)ADC_CFGR_EXTSEL_2) +#define ADC1_2_EXTERNALTRIG_T4_CC4 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T4_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2)) +#define ADC1_2_EXTERNALTRIG_T6_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T15_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_EXT_IT11 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#endif /* STM32F302xE || */ + /* STM32F302xC */ + +#if defined(STM32F303x8) || defined(STM32F328xx) +/* List of external triggers of common group ADC1&ADC2: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ +#define ADC1_2_EXTERNALTRIG_T1_CC1 (0x00000000U) +#define ADC1_2_EXTERNALTRIG_T1_CC2 ((uint32_t)ADC_CFGR_EXTSEL_0) +#define ADC1_2_EXTERNALTRIG_T1_CC3 ((uint32_t)ADC_CFGR_EXTSEL_1) +#define ADC1_2_EXTERNALTRIG_T2_CC2 ((uint32_t)(ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T3_TRGO ((uint32_t)ADC_CFGR_EXTSEL_2) +#define ADC1_2_EXTERNALTRIG_T4_CC4 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_EXT_IT11 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T8_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T8_TRGO2 ((uint32_t) ADC_CFGR_EXTSEL_3) +#define ADC1_2_EXTERNALTRIG_T1_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T1_TRGO2 ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T2_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T4_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2)) +#define ADC1_2_EXTERNALTRIG_T6_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T15_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T3_CC4 ((uint32_t)ADC_CFGR_EXTSEL) +#endif /* STM32F303x8 || STM32F328xx */ + +#if defined(STM32F334x8) +/* List of external triggers of common group ADC1&ADC2: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ +#define ADC1_2_EXTERNALTRIG_T1_CC1 (0x00000000U) +#define ADC1_2_EXTERNALTRIG_T1_CC2 ((uint32_t)ADC_CFGR_EXTSEL_0) +#define ADC1_2_EXTERNALTRIG_T1_CC3 ((uint32_t)ADC_CFGR_EXTSEL_1) +#define ADC1_2_EXTERNALTRIG_T2_CC2 ((uint32_t)(ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T3_TRGO ((uint32_t)ADC_CFGR_EXTSEL_2) +#define ADC1_2_EXTERNALTRIG_EXT_IT11 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_HRTIM_TRG1 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_HRTIM_TRG3 ((uint32_t) ADC_CFGR_EXTSEL_3) +#define ADC1_2_EXTERNALTRIG_T1_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T1_TRGO2 ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T2_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T6_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC1_2_EXTERNALTRIG_T15_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC1_2_EXTERNALTRIG_T3_CC4 ((uint32_t)ADC_CFGR_EXTSEL) +#endif /* STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/* List of external triggers of regular group for ADC1: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ +#define ADC1_EXTERNALTRIG_T1_CC1 (0x00000000U) +#define ADC1_EXTERNALTRIG_T1_CC2 ((uint32_t)ADC_CFGR_EXTSEL_0) +#define ADC1_EXTERNALTRIG_T1_CC3 ((uint32_t)ADC_CFGR_EXTSEL_1) +#define ADC1_EXTERNALTRIG_T2_CC2 ((uint32_t)(ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_EXTERNALTRIG_EXT_IT11 ((uint32_t)(ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC1_EXTERNALTRIG_T1_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0)) +#define ADC1_EXTERNALTRIG_T1_TRGO2 ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1)) +#define ADC1_EXTERNALTRIG_T2_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0)) +#define ADC1_EXTERNALTRIG_T6_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0)) +#define ADC1_EXTERNALTRIG_T15_TRGO ((uint32_t)(ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1)) +#define ADC_SOFTWARE_START (0x00000001U) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ +/** + * @} + */ + + +/** @defgroup ADCEx_Internal_HAL_driver_Ext_trig_src_Injected ADC Extended Internal HAL driver trigger selection for injected group + * @{ + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +/* List of external triggers sorted of groups ADC1&ADC2 and/or ADC3&ADC4: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ + +/* External triggers for injected groups of ADC1 & ADC2 */ +#define ADC1_2_EXTERNALTRIGINJEC_T1_TRGO (0x00000000U) +#define ADC1_2_EXTERNALTRIGINJEC_T1_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_0) +#define ADC1_2_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t)ADC_JSQR_JEXTSEL_1) +#define ADC1_2_EXTERNALTRIGINJEC_T2_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_2) +#define ADC1_2_EXTERNALTRIGINJEC_T4_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_EXT_IT15 ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T8_CC4 ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T1_TRGO2 ((uint32_t)ADC_JSQR_JEXTSEL_3) +#define ADC1_2_EXTERNALTRIGINJEC_T8_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T8_TRGO2 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC3 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T6_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T15_TRGO ((uint32_t)ADC_JSQR_JEXTSEL) + +/* External triggers for injected groups of ADC3 & ADC4 */ +/* Note: External triggers JEXT2 and JEXT5 are the same (TIM4_CC3 event). */ +/* JEXT2 is the main trigger, JEXT5 could be redirected to another */ +/* in future devices. */ +/* However, this channel is implemented with a SW offset of 0x10000 for */ +/* differentiation between similar triggers of common groups ADC1&ADC2, */ +/* ADC3&ADC4 (Differentiation processed into macro */ +/* ADC_JSQR_JEXTSEL_SET) */ +#define ADC3_4_EXTERNALTRIGINJEC_T1_TRGO (0x00000000U) +#define ADC3_4_EXTERNALTRIGINJEC_T1_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_0) +#define ADC3_4_EXTERNALTRIGINJEC_T4_CC3 ((uint32_t)ADC_JSQR_JEXTSEL_1 | 0x10000U) +#define ADC3_4_EXTERNALTRIGINJEC_T8_CC2 ((uint32_t)(ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC3_4_EXTERNALTRIGINJEC_T8_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_2) + +#if defined(STM32F303xE) || defined(STM32F398xx) +#define ADC3_4_EXTERNALTRIGINJEC_T20_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#endif /* STM32F303xE || STM32F398xx */ + +#define ADC3_4_EXTERNALTRIGINJEC_T4_CC4 ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC3_4_EXTERNALTRIGINJEC_T4_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC3_4_EXTERNALTRIGINJEC_T1_TRGO2 ((uint32_t)ADC_JSQR_JEXTSEL_3) +#define ADC3_4_EXTERNALTRIGINJEC_T8_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_0)) +#define ADC3_4_EXTERNALTRIGINJEC_T8_TRGO2 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1)) +#define ADC3_4_EXTERNALTRIGINJEC_T1_CC3 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC3_4_EXTERNALTRIGINJEC_T3_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2)) +#define ADC3_4_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#define ADC3_4_EXTERNALTRIGINJEC_T7_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC3_4_EXTERNALTRIGINJEC_T15_TRGO ((uint32_t)ADC_JSQR_JEXTSEL) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) +/* List of external triggers of group ADC1&ADC2: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ +#define ADC1_2_EXTERNALTRIGINJEC_T1_TRGO (0x00000000U) +#define ADC1_2_EXTERNALTRIGINJEC_T1_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_0) +#define ADC1_2_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t)ADC_JSQR_JEXTSEL_1) +#define ADC1_2_EXTERNALTRIGINJEC_T2_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_2) +#define ADC1_2_EXTERNALTRIGINJEC_T4_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_EXT_IT15 ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T1_TRGO2 ((uint32_t)ADC_JSQR_JEXTSEL_3) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC3 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T6_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T15_TRGO ((uint32_t)ADC_JSQR_JEXTSEL) +#endif /* STM32F302xE || */ + /* STM32F302xC */ + +#if defined(STM32F303x8) || defined(STM32F328xx) +/* List of external triggers of group ADC1&ADC2: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ +#define ADC1_2_EXTERNALTRIGINJEC_T1_TRGO (0x00000000U) +#define ADC1_2_EXTERNALTRIGINJEC_T1_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_0) +#define ADC1_2_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t)ADC_JSQR_JEXTSEL_1) +#define ADC1_2_EXTERNALTRIGINJEC_T2_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_2) +#define ADC1_2_EXTERNALTRIGINJEC_T4_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_EXT_IT15 ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T8_CC4 ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T1_TRGO2 ((uint32_t)ADC_JSQR_JEXTSEL_3) +#define ADC1_2_EXTERNALTRIGINJEC_T8_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T8_TRGO2 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC3 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T6_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T15_TRGO ((uint32_t)ADC_JSQR_JEXTSEL) +#endif /* STM32F303x8 || STM32F328xx */ + +#if defined(STM32F334x8) +/* List of external triggers of group ADC1&ADC2: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ +#define ADC1_2_EXTERNALTRIGINJEC_T1_TRGO (0x00000000U) +#define ADC1_2_EXTERNALTRIGINJEC_T1_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_0) +#define ADC1_2_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t)ADC_JSQR_JEXTSEL_1) +#define ADC1_2_EXTERNALTRIGINJEC_T2_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_2) +#define ADC1_2_EXTERNALTRIGINJEC_EXT_IT15 ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T1_TRGO2 ((uint32_t)ADC_JSQR_JEXTSEL_3) +#define ADC1_2_EXTERNALTRIGINJEC_HRTIM_TRG2 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_HRTIM_TRG4 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC3 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2)) +#define ADC1_2_EXTERNALTRIGINJEC_T3_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_2_EXTERNALTRIGINJEC_T6_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_2_EXTERNALTRIGINJEC_T15_TRGO ((uint32_t)ADC_JSQR_JEXTSEL) +#endif /* STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/* List of external triggers of injected group for ADC1: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ +#define ADC1_EXTERNALTRIGINJEC_T1_TRGO (0x00000000U) +#define ADC1_EXTERNALTRIGINJEC_T1_CC4 ((uint32_t)ADC_JSQR_JEXTSEL_0) +#define ADC1_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t)ADC_JSQR_JEXTSEL_1) +#define ADC1_EXTERNALTRIGINJEC_T2_CC1 ((uint32_t)(ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0)) +#define ADC1_EXTERNALTRIGINJEC_EXT_IT15 ((uint32_t)(ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_EXTERNALTRIGINJEC_T1_TRGO2 ((uint32_t)ADC_JSQR_JEXTSEL_3) +#define ADC1_EXTERNALTRIGINJEC_T6_TRGO ((uint32_t)(ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1)) +#define ADC1_EXTERNALTRIGINJEC_T15_TRGO ((uint32_t)ADC_JSQR_JEXTSEL) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ +/** + * @} + */ + +#define ADC_FLAG_ALL (ADC_FLAG_RDY | ADC_FLAG_EOSMP | ADC_FLAG_EOC | ADC_FLAG_EOS | \ + ADC_FLAG_JEOC | ADC_FLAG_JEOS | ADC_FLAG_OVR | ADC_FLAG_AWD1 | \ + ADC_FLAG_AWD2 | ADC_FLAG_AWD3 | ADC_FLAG_JQOVF) + +/* Combination of all post-conversion flags bits: EOC/EOS, JEOC/JEOS, OVR, AWDx */ +#define ADC_FLAG_POSTCONV_ALL (ADC_FLAG_EOC | ADC_FLAG_EOS | ADC_FLAG_JEOC | ADC_FLAG_JEOS | \ + ADC_FLAG_OVR | ADC_FLAG_AWD1 | ADC_FLAG_AWD2 | ADC_FLAG_AWD3 | \ + ADC_FLAG_JQOVF) + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + + +#if defined(STM32F373xC) || defined(STM32F378xx) + +/** @defgroup ADCEx_Internal_HAL_driver_Ext_trig_src_Regular ADC Extended Internal HAL driver trigger selection for regular group + * @{ + */ +/* List of external triggers of regular group for ADC1: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ + +/* External triggers of regular group for ADC1 */ +#define ADC_EXTERNALTRIG_T19_TRGO (0x00000000U) +#define ADC_EXTERNALTRIG_T19_CC3 ((uint32_t)ADC_CR2_EXTSEL_0) +#define ADC_EXTERNALTRIG_T19_CC4 ((uint32_t)ADC_CR2_EXTSEL_1) +#define ADC_EXTERNALTRIG_T2_CC2 ((uint32_t)(ADC_CR2_EXTSEL_1 | ADC_CR2_EXTSEL_0)) +#define ADC_EXTERNALTRIG_T3_TRGO ((uint32_t)ADC_CR2_EXTSEL_2) +#define ADC_EXTERNALTRIG_T4_CC4 ((uint32_t)(ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_0)) +#define ADC_EXTERNALTRIG_EXT_IT11 ((uint32_t)(ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_1)) +#define ADC_SWSTART ((uint32_t)(ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_1 | ADC_CR2_EXTSEL_0)) +/** + * @} + */ + +/** @defgroup ADCEx_Internal_HAL_driver_Ext_trig_src_Injected ADC Extended Internal HAL driver trigger selection for injected group + * @{ + */ +/* List of external triggers of injected group for ADC1: */ +/* (used internally by HAL driver. To not use into HAL structure parameters) */ + +/* External triggers of injected group for ADC1 */ +#define ADC_EXTERNALTRIGINJEC_T19_CC1 ( 0x00000000U) +#define ADC_EXTERNALTRIGINJEC_T19_CC2 ((uint32_t) ADC_CR2_JEXTSEL_0) +#define ADC_EXTERNALTRIGINJEC_T2_TRGO ((uint32_t) ADC_CR2_JEXTSEL_1) +#define ADC_EXTERNALTRIGINJEC_T2_CC1 ((uint32_t)(ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0)) +#define ADC_EXTERNALTRIGINJEC_T3_CC4 ((uint32_t) ADC_CR2_JEXTSEL_2) +#define ADC_EXTERNALTRIGINJEC_T4_TRGO ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0)) +#define ADC_EXTERNALTRIGINJEC_EXT_IT15 ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1)) +#define ADC_JSWSTART ((uint32_t)(ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0)) +/** + * @} + */ + +/** @defgroup ADCEx_sampling_times_all_channels ADC Extended Sampling Times All Channels + * @{ + */ +#define ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT2 \ + (ADC_SMPR2_SMP9_2 | ADC_SMPR2_SMP8_2 | ADC_SMPR2_SMP7_2 | ADC_SMPR2_SMP6_2 | \ + ADC_SMPR2_SMP5_2 | ADC_SMPR2_SMP4_2 | ADC_SMPR2_SMP3_2 | ADC_SMPR2_SMP2_2 | \ + ADC_SMPR2_SMP1_2 | ADC_SMPR2_SMP0_2) +#define ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT2 \ + (ADC_SMPR1_SMP17_2 | ADC_SMPR1_SMP16_2 | ADC_SMPR1_SMP15_2 | ADC_SMPR1_SMP14_2 | \ + ADC_SMPR1_SMP13_2 | ADC_SMPR1_SMP12_2 | ADC_SMPR1_SMP11_2 | ADC_SMPR1_SMP10_2 ) + +#define ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT1 \ + (ADC_SMPR2_SMP9_1 | ADC_SMPR2_SMP8_1 | ADC_SMPR2_SMP7_1 | ADC_SMPR2_SMP6_1 | \ + ADC_SMPR2_SMP5_1 | ADC_SMPR2_SMP4_1 | ADC_SMPR2_SMP3_1 | ADC_SMPR2_SMP2_1 | \ + ADC_SMPR2_SMP1_1 | ADC_SMPR2_SMP0_1) +#define ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT1 \ + (ADC_SMPR1_SMP17_1 | ADC_SMPR1_SMP16_1 | ADC_SMPR1_SMP15_1 | ADC_SMPR1_SMP14_1 | \ + ADC_SMPR1_SMP13_1 | ADC_SMPR1_SMP12_1 | ADC_SMPR1_SMP11_1 | ADC_SMPR1_SMP10_1 ) + +#define ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT0 \ + (ADC_SMPR2_SMP9_0 | ADC_SMPR2_SMP8_0 | ADC_SMPR2_SMP7_0 | ADC_SMPR2_SMP6_0 | \ + ADC_SMPR2_SMP5_0 | ADC_SMPR2_SMP4_0 | ADC_SMPR2_SMP3_0 | ADC_SMPR2_SMP2_0 | \ + ADC_SMPR2_SMP1_0 | ADC_SMPR2_SMP0_0) +#define ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT0 \ + (ADC_SMPR1_SMP17_0 | ADC_SMPR1_SMP16_0 | ADC_SMPR1_SMP15_0 | ADC_SMPR1_SMP14_0 | \ + ADC_SMPR1_SMP13_0 | ADC_SMPR1_SMP12_0 | ADC_SMPR1_SMP11_0 | ADC_SMPR1_SMP10_0 ) + +#define ADC_SAMPLETIME_1CYCLE5_SMPR2ALLCHANNELS (0x00000000U) +#define ADC_SAMPLETIME_7CYCLES5_SMPR2ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT0) +#define ADC_SAMPLETIME_13CYCLES5_SMPR2ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT1) +#define ADC_SAMPLETIME_28CYCLES5_SMPR2ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT1 | ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT0) +#define ADC_SAMPLETIME_41CYCLES5_SMPR2ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT2) +#define ADC_SAMPLETIME_55CYCLES5_SMPR2ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT2 | ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT0) +#define ADC_SAMPLETIME_71CYCLES5_SMPR2ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT2 | ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT1) +#define ADC_SAMPLETIME_239CYCLES5_SMPR2ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT2 | ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT1 | ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT0) + +#define ADC_SAMPLETIME_1CYCLE5_SMPR1ALLCHANNELS (0x00000000U) +#define ADC_SAMPLETIME_7CYCLES5_SMPR1ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT0) +#define ADC_SAMPLETIME_13CYCLES5_SMPR1ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT1) +#define ADC_SAMPLETIME_28CYCLES5_SMPR1ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT1 | ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT0) +#define ADC_SAMPLETIME_41CYCLES5_SMPR1ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT2) +#define ADC_SAMPLETIME_55CYCLES5_SMPR1ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT2 | ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT0) +#define ADC_SAMPLETIME_71CYCLES5_SMPR1ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT2 | ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT1) +#define ADC_SAMPLETIME_239CYCLES5_SMPR1ALLCHANNELS (ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT2 | ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT1 | ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT0) + +/* Combination of all post-conversion flags bits: EOC/EOS, JEOC/JEOS, OVR, AWDx */ +#define ADC_FLAG_POSTCONV_ALL (ADC_FLAG_EOC | ADC_FLAG_JEOC | ADC_FLAG_AWD ) +/** + * @} + */ + +#endif /* STM32F373xC || STM32F378xx */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ + +/** @defgroup ADCEx_Exported_Macros ADCEx Exported Macros + * @{ + */ +/* Macro for internal HAL driver usage, and possibly can be used into code of */ +/* final user. */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + +/** + * @brief Enable the ADC peripheral + * @param __HANDLE__ ADC handle + * @note ADC enable requires a delay for ADC stabilization time + * (refer to device datasheet, parameter tSTAB) + * @note On STM32F3 devices, some hardware constraints must be strictly + * respected before using this macro: + * - ADC internal voltage regulator must be preliminarily enabled. + * This is performed by function HAL_ADC_Init(). + * - ADC state requirements: ADC must be disabled, no conversion on + * going, no calibration on going. + * These checks are performed by functions HAL_ADC_start_xxx(). + * @retval None + */ +#define __HAL_ADC_ENABLE(__HANDLE__) \ + (SET_BIT((__HANDLE__)->Instance->CR, ADC_CR_ADEN)) + +/** + * @brief Disable the ADC peripheral + * @param __HANDLE__ ADC handle + * @note On STM32F3 devices, some hardware constraints must be strictly + * respected before using this macro: + * - ADC state requirements: ADC must be enabled, no conversion on + * going. + * These checks are performed by functions HAL_ADC_start_xxx(). + * @retval None + */ +#define __HAL_ADC_DISABLE(__HANDLE__) \ + do{ \ + SET_BIT((__HANDLE__)->Instance->CR, ADC_CR_ADDIS); \ + __HAL_ADC_CLEAR_FLAG((__HANDLE__), (ADC_FLAG_EOSMP | ADC_FLAG_RDY)); \ + } while(0U) + +/** + * @brief Enable the ADC end of conversion interrupt. + * @param __HANDLE__ ADC handle + * @param __INTERRUPT__ ADC Interrupt + * This parameter can be any combination of the following values: + * @arg ADC_IT_RDY: ADC Ready (ADRDY) interrupt source + * @arg ADC_IT_EOSMP: ADC End of Sampling interrupt source + * @arg ADC_IT_EOC: ADC End of Regular Conversion interrupt source + * @arg ADC_IT_EOS: ADC End of Regular sequence of Conversions interrupt source + * @arg ADC_IT_OVR: ADC overrun interrupt source + * @arg ADC_IT_JEOC: ADC End of Injected Conversion interrupt source + * @arg ADC_IT_JEOS: ADC End of Injected sequence of Conversions interrupt source + * @arg ADC_IT_AWD1: ADC Analog watchdog 1 interrupt source (main analog watchdog, present on all STM32 devices) + * @arg ADC_IT_AWD2: ADC Analog watchdog 2 interrupt source (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_IT_AWD3: ADC Analog watchdog 3 interrupt source (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_IT_JQOVF: ADC Injected Context Queue Overflow interrupt source + * @retval None + */ +#define __HAL_ADC_ENABLE_IT(__HANDLE__, __INTERRUPT__) \ + (SET_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__))) + +/** + * @brief Disable the ADC end of conversion interrupt. + * @param __HANDLE__ ADC handle + * @param __INTERRUPT__ ADC Interrupt + * This parameter can be any combination of the following values: + * @arg ADC_IT_RDY: ADC Ready (ADRDY) interrupt source + * @arg ADC_IT_EOSMP: ADC End of Sampling interrupt source + * @arg ADC_IT_EOC: ADC End of Regular Conversion interrupt source + * @arg ADC_IT_EOS: ADC End of Regular sequence of Conversions interrupt source + * @arg ADC_IT_OVR: ADC overrun interrupt source + * @arg ADC_IT_JEOC: ADC End of Injected Conversion interrupt source + * @arg ADC_IT_JEOS: ADC End of Injected sequence of Conversions interrupt source + * @arg ADC_IT_AWD1: ADC Analog watchdog 1 interrupt source (main analog watchdog, present on all STM32 devices) + * @arg ADC_IT_AWD2: ADC Analog watchdog 2 interrupt source (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_IT_AWD3: ADC Analog watchdog 3 interrupt source (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_IT_JQOVF: ADC Injected Context Queue Overflow interrupt source + * @retval None + */ +#define __HAL_ADC_DISABLE_IT(__HANDLE__, __INTERRUPT__) \ + (CLEAR_BIT((__HANDLE__)->Instance->IER, (__INTERRUPT__))) + +/** @brief Checks if the specified ADC interrupt source is enabled or disabled. + * @param __HANDLE__ ADC handle + * @param __INTERRUPT__ ADC interrupt source to check + * This parameter can be any combination of the following values: + * @arg ADC_IT_RDY: ADC Ready (ADRDY) interrupt source + * @arg ADC_IT_EOSMP: ADC End of Sampling interrupt source + * @arg ADC_IT_EOC: ADC End of Regular Conversion interrupt source + * @arg ADC_IT_EOS: ADC End of Regular sequence of Conversions interrupt source + * @arg ADC_IT_OVR: ADC overrun interrupt source + * @arg ADC_IT_JEOC: ADC End of Injected Conversion interrupt source + * @arg ADC_IT_JEOS: ADC End of Injected sequence of Conversions interrupt source + * @arg ADC_IT_AWD1: ADC Analog watchdog 1 interrupt source (main analog watchdog, present on all STM32 devices) + * @arg ADC_IT_AWD2: ADC Analog watchdog 2 interrupt source (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_IT_AWD3: ADC Analog watchdog 3 interrupt source (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_IT_JQOVF: ADC Injected Context Queue Overflow interrupt source + * @retval State of interruption (SET or RESET) + */ +#define __HAL_ADC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) \ + (((__HANDLE__)->Instance->IER & (__INTERRUPT__)) == (__INTERRUPT__)) + +/** + * @brief Get the selected ADC's flag status. + * @param __HANDLE__ ADC handle + * @param __FLAG__ ADC flag + * This parameter can be any combination of the following values: + * @arg ADC_FLAG_RDY: ADC Ready (ADRDY) flag + * @arg ADC_FLAG_EOSMP: ADC End of Sampling flag + * @arg ADC_FLAG_EOC: ADC End of Regular Conversion flag + * @arg ADC_FLAG_EOS: ADC End of Regular sequence of Conversions flag + * @arg ADC_FLAG_OVR: ADC overrun flag + * @arg ADC_FLAG_JEOC: ADC End of Injected Conversion flag + * @arg ADC_FLAG_JEOS: ADC End of Injected sequence of Conversions flag + * @arg ADC_FLAG_AWD1: ADC Analog watchdog 1 flag (main analog watchdog, present on all STM32 devices) + * @arg ADC_FLAG_AWD2: ADC Analog watchdog 2 flag (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_FLAG_AWD3: ADC Analog watchdog 3 flag (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_FLAG_JQOVF: ADC Injected Context Queue Overflow flag + * @retval None + */ +#define __HAL_ADC_GET_FLAG(__HANDLE__, __FLAG__) \ + ((((__HANDLE__)->Instance->ISR) & (__FLAG__)) == (__FLAG__)) + +/** + * @brief Clear the ADC's pending flags + * @param __HANDLE__ ADC handle + * @param __FLAG__ ADC flag + * This parameter can be any combination of the following values: + * @arg ADC_FLAG_RDY: ADC Ready (ADRDY) flag + * @arg ADC_FLAG_EOSMP: ADC End of Sampling flag + * @arg ADC_FLAG_EOC: ADC End of Regular Conversion flag + * @arg ADC_FLAG_EOS: ADC End of Regular sequence of Conversions flag + * @arg ADC_FLAG_OVR: ADC overrun flag + * @arg ADC_FLAG_JEOC: ADC End of Injected Conversion flag + * @arg ADC_FLAG_JEOS: ADC End of Injected sequence of Conversions flag + * @arg ADC_FLAG_AWD1: ADC Analog watchdog 1 flag (main analog watchdog, present on all STM32 devices) + * @arg ADC_FLAG_AWD2: ADC Analog watchdog 2 flag (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_FLAG_AWD3: ADC Analog watchdog 3 flag (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_FLAG_JQOVF: ADC Injected Context Queue Overflow flag + * @retval None + */ +/* Note: bit cleared bit by writing 1 (writing 0 has no effect on any bit of */ +/* register ISR). */ +#define __HAL_ADC_CLEAR_FLAG(__HANDLE__, __FLAG__) \ + (WRITE_REG((__HANDLE__)->Instance->ISR, (__FLAG__))) + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + + +#if defined(STM32F373xC) || defined(STM32F378xx) + +/** + * @brief Enable the ADC peripheral + * @note ADC enable requires a delay for ADC stabilization time + * (refer to device datasheet, parameter tSTAB) + * @note On STM32F37x devices, if ADC is already enabled this macro trigs + * a conversion SW start on regular group. + * @param __HANDLE__ ADC handle + * @retval None + */ +#define __HAL_ADC_ENABLE(__HANDLE__) \ + (SET_BIT((__HANDLE__)->Instance->CR2, (ADC_CR2_ADON))) + +/** + * @brief Disable the ADC peripheral + * @param __HANDLE__ ADC handle + * @retval None + */ +#define __HAL_ADC_DISABLE(__HANDLE__) \ + (CLEAR_BIT((__HANDLE__)->Instance->CR2, (ADC_CR2_ADON))) + +/** @brief Enable the ADC end of conversion interrupt. + * @param __HANDLE__ ADC handle + * @param __INTERRUPT__ ADC Interrupt + * This parameter can be any combination of the following values: + * @arg ADC_IT_EOC: ADC End of Regular Conversion interrupt source + * @arg ADC_IT_JEOC: ADC End of Injected Conversion interrupt source + * @arg ADC_IT_AWD: ADC Analog watchdog interrupt source + * @retval None + */ +#define __HAL_ADC_ENABLE_IT(__HANDLE__, __INTERRUPT__) \ + (SET_BIT((__HANDLE__)->Instance->CR1, (__INTERRUPT__))) + +/** @brief Disable the ADC end of conversion interrupt. + * @param __HANDLE__ ADC handle + * @param __INTERRUPT__ ADC Interrupt + * This parameter can be any combination of the following values: + * @arg ADC_IT_EOC: ADC End of Regular Conversion interrupt source + * @arg ADC_IT_JEOC: ADC End of Injected Conversion interrupt source + * @arg ADC_IT_AWD: ADC Analog watchdog interrupt source + * @retval None + */ +#define __HAL_ADC_DISABLE_IT(__HANDLE__, __INTERRUPT__) \ + (CLEAR_BIT((__HANDLE__)->Instance->CR1, (__INTERRUPT__))) + +/** @brief Checks if the specified ADC interrupt source is enabled or disabled. + * @param __HANDLE__ ADC handle + * @param __INTERRUPT__ ADC interrupt source to check + * This parameter can be any combination of the following values: + * @arg ADC_IT_EOC: ADC End of Regular Conversion interrupt source + * @arg ADC_IT_JEOC: ADC End of Injected Conversion interrupt source + * @arg ADC_IT_AWD: ADC Analog watchdog interrupt source + * @retval State of interruption (SET or RESET) + */ +#define __HAL_ADC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) \ + (((__HANDLE__)->Instance->CR1 & (__INTERRUPT__)) == (__INTERRUPT__)) + +/** @brief Get the selected ADC's flag status. + * @param __HANDLE__ ADC handle + * @param __FLAG__ ADC flag + * This parameter can be any combination of the following values: + * @arg ADC_FLAG_STRT: ADC Regular group start flag + * @arg ADC_FLAG_JSTRT: ADC Injected group start flag + * @arg ADC_FLAG_EOC: ADC End of Regular conversion flag + * @arg ADC_FLAG_JEOC: ADC End of Injected conversion flag + * @arg ADC_FLAG_AWD: ADC Analog watchdog flag + * @retval None + */ +#define __HAL_ADC_GET_FLAG(__HANDLE__, __FLAG__) \ + ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) + +/** @brief Clear the ADC's pending flags + * @param __HANDLE__ ADC handle + * @param __FLAG__ ADC flag + * This parameter can be any combination of the following values: + * @arg ADC_FLAG_STRT: ADC Regular group start flag + * @arg ADC_FLAG_JSTRT: ADC Injected group start flag + * @arg ADC_FLAG_EOC: ADC End of Regular conversion flag + * @arg ADC_FLAG_JEOC: ADC End of Injected conversion flag + * @arg ADC_FLAG_AWD: ADC Analog watchdog flag + * @retval None + */ +#define __HAL_ADC_CLEAR_FLAG(__HANDLE__, __FLAG__) \ + (WRITE_REG((__HANDLE__)->Instance->SR, ~(__FLAG__))) + +#endif /* STM32F373xC || STM32F378xx */ + +/** + * @} + */ + +/* Private macro ------------------------------------------------------------*/ + +/** @addtogroup ADCEx_Private_Macro ADCEx Private Macros + * @{ + */ +/* Macro reserved for internal HAL driver usage, not intended to be used in */ +/* code of final user. */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + +/** + * @brief Verification of hardware constraints before ADC can be enabled + * @param __HANDLE__ ADC handle + * @retval SET (ADC can be enabled) or RESET (ADC cannot be enabled) + */ +#define ADC_ENABLING_CONDITIONS(__HANDLE__) \ + (( HAL_IS_BIT_CLR((__HANDLE__)->Instance->CR , \ + (ADC_CR_ADCAL | ADC_CR_JADSTP | ADC_CR_ADSTP | \ + ADC_CR_JADSTART |ADC_CR_ADSTART | ADC_CR_ADDIS | \ + ADC_CR_ADEN ) ) \ + ) ? SET : RESET) + +/** + * @brief Verification of ADC state: enabled or disabled + * @param __HANDLE__ ADC handle + * @retval SET (ADC enabled) or RESET (ADC disabled) + */ +#define ADC_IS_ENABLE(__HANDLE__) \ + (( ((((__HANDLE__)->Instance->CR) & (ADC_CR_ADEN | ADC_CR_ADDIS)) == ADC_CR_ADEN) && \ + ((((__HANDLE__)->Instance->ISR) & ADC_FLAG_RDY) == ADC_FLAG_RDY) \ + ) ? SET : RESET) + +/** + * @brief Test if conversion trigger of regular group is software start + * or external trigger. + * @param __HANDLE__ ADC handle + * @retval SET (software start) or RESET (external trigger) + */ +#define ADC_IS_SOFTWARE_START_REGULAR(__HANDLE__) \ + (((__HANDLE__)->Instance->CFGR & ADC_CFGR_EXTEN) == RESET) + +/** + * @brief Test if conversion trigger of injected group is software start + * or external trigger. + * @param __HANDLE__ ADC handle + * @retval SET (software start) or RESET (external trigger) + */ +#define ADC_IS_SOFTWARE_START_INJECTED(__HANDLE__) \ + (((__HANDLE__)->Instance->JSQR & ADC_JSQR_JEXTEN) == RESET) + +/** + * @brief Check if no conversion on going on regular and/or injected groups + * @param __HANDLE__ ADC handle + * @retval SET (conversion is on going) or RESET (no conversion is on going) + */ +#define ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED(__HANDLE__) \ + (( (((__HANDLE__)->Instance->CR) & (ADC_CR_ADSTART | ADC_CR_JADSTART)) == RESET \ + ) ? RESET : SET) + +/** + * @brief Check if no conversion on going on regular group + * @param __HANDLE__ ADC handle + * @retval SET (conversion is on going) or RESET (no conversion is on going) + */ +#define ADC_IS_CONVERSION_ONGOING_REGULAR(__HANDLE__) \ + (( (((__HANDLE__)->Instance->CR) & ADC_CR_ADSTART) == RESET \ + ) ? RESET : SET) + +/** + * @brief Check if no conversion on going on injected group + * @param __HANDLE__ ADC handle + * @retval SET (conversion is on going) or RESET (no conversion is on going) + */ +#define ADC_IS_CONVERSION_ONGOING_INJECTED(__HANDLE__) \ + (( (((__HANDLE__)->Instance->CR) & ADC_CR_JADSTART) == RESET \ + ) ? RESET : SET) + +/** + * @brief Returns resolution bits in CFGR1 register: RES[1:0]. + * Returned value is among parameters to @ref ADCEx_Resolution. + * @param __HANDLE__ ADC handle + * @retval None + */ +#define ADC_GET_RESOLUTION(__HANDLE__) (((__HANDLE__)->Instance->CFGR) & ADC_CFGR_RES) + +/** + * @brief Simultaneously clears and sets specific bits of the handle State + * @note: ADC_STATE_CLR_SET() macro is merely aliased to generic macro MODIFY_REG(), + * the first parameter is the ADC handle State, the second parameter is the + * bit field to clear, the third and last parameter is the bit field to set. + * @retval None + */ +#define ADC_STATE_CLR_SET MODIFY_REG + +/** + * @brief Clear ADC error code (set it to error code: "no error") + * @param __HANDLE__ ADC handle + * @retval None + */ +#define ADC_CLEAR_ERRORCODE(__HANDLE__) ((__HANDLE__)->ErrorCode = HAL_ADC_ERROR_NONE) + +/** + * @brief Set the ADC's sample time for Channels numbers between 0 and 9. + * @param _SAMPLETIME_ Sample time parameter. + * @param _CHANNELNB_ Channel number. + * @retval None + */ +#define ADC_SMPR1(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3U * (_CHANNELNB_))) + +/** + * @brief Set the ADC's sample time for Channels numbers between 10 and 18. + * @param _SAMPLETIME_ Sample time parameter. + * @param _CHANNELNB_ Channel number. + * @retval None + */ +#define ADC_SMPR2(_SAMPLETIME_, _CHANNELNB_) ((_SAMPLETIME_) << (3U * ((_CHANNELNB_) - 10U))) + +/** + * @brief Set the selected regular Channel rank for rank between 1 and 4. + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @retval None + */ +#define ADC_SQR1_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (6U * (_RANKNB_))) + +/** + * @brief Set the selected regular Channel rank for rank between 5 and 9. + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @retval None + */ +#define ADC_SQR2_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (6U * ((_RANKNB_) - 5U))) + +/** + * @brief Set the selected regular Channel rank for rank between 10 and 14. + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @retval None + */ +#define ADC_SQR3_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (6U * ((_RANKNB_) - 10U))) + +/** + * @brief Set the selected regular Channel rank for rank between 15 and 16. + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @retval None + */ +#define ADC_SQR4_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (6U * ((_RANKNB_) - 15U))) + +/** + * @brief Set the selected injected Channel rank. + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @retval None + */ +#define ADC_JSQR_RK(_CHANNELNB_, _RANKNB_) ((_CHANNELNB_) << (6U * (_RANKNB_) +2U)) + + +/** + * @brief Set the Analog Watchdog 1 channel. + * @param _CHANNEL_ channel to be monitored by Analog Watchdog 1. + * @retval None + */ +#define ADC_CFGR_AWD1CH_SHIFT(_CHANNEL_) ((_CHANNEL_) << 26U) + +/** + * @brief Configure the channel number into Analog Watchdog 2 or 3. + * @param _CHANNEL_ ADC Channel + * @retval None + */ +#define ADC_CFGR_AWD23CR(_CHANNEL_) (1U << (_CHANNEL_)) + +/** + * @brief Enable automatic conversion of injected group + * @param _INJECT_AUTO_CONVERSION_ Injected automatic conversion. + * @retval None + */ +#define ADC_CFGR_INJECT_AUTO_CONVERSION(_INJECT_AUTO_CONVERSION_) ((_INJECT_AUTO_CONVERSION_) << 25U) + +/** + * @brief Enable ADC injected context queue + * @param _INJECT_CONTEXT_QUEUE_MODE_ Injected context queue mode. + * @retval None + */ +#define ADC_CFGR_INJECT_CONTEXT_QUEUE(_INJECT_CONTEXT_QUEUE_MODE_) ((_INJECT_CONTEXT_QUEUE_MODE_) << 21U) + +/** + * @brief Enable ADC discontinuous conversion mode for injected group + * @param _INJECT_DISCONTINUOUS_MODE_ Injected discontinuous mode. + * @retval None + */ +#define ADC_CFGR_INJECT_DISCCONTINUOUS(_INJECT_DISCONTINUOUS_MODE_) ((_INJECT_DISCONTINUOUS_MODE_) << 20U) + +/** + * @brief Enable ADC discontinuous conversion mode for regular group + * @param _REG_DISCONTINUOUS_MODE_ Regular discontinuous mode. + * @retval None + */ +#define ADC_CFGR_REG_DISCCONTINUOUS(_REG_DISCONTINUOUS_MODE_) ((_REG_DISCONTINUOUS_MODE_) << 16U) + +/** + * @brief Configures the number of discontinuous conversions for regular group. + * @param _NBR_DISCONTINUOUS_CONV_ Number of discontinuous conversions. + * @retval None + */ +#define ADC_CFGR_DISCONTINUOUS_NUM(_NBR_DISCONTINUOUS_CONV_) (((_NBR_DISCONTINUOUS_CONV_) - 1U) << 17U) + +/** + * @brief Enable the ADC auto delay mode. + * @param _AUTOWAIT_ Auto delay bit enable or disable. + * @retval None + */ +#define ADC_CFGR_AUTOWAIT(_AUTOWAIT_) ((_AUTOWAIT_) << 14U) + +/** + * @brief Enable ADC continuous conversion mode. + * @param _CONTINUOUS_MODE_ Continuous mode. + * @retval None + */ +#define ADC_CFGR_CONTINUOUS(_CONTINUOUS_MODE_) ((_CONTINUOUS_MODE_) << 13U) + +/** + * @brief Enable ADC overrun mode. + * @param _OVERRUN_MODE_ Overrun mode. + * @retval Overrun bit setting to be programmed into CFGR register + */ +/* Note: Bit ADC_CFGR_OVRMOD not used directly in constant */ +/* "ADC_OVR_DATA_OVERWRITTEN" to have this case defined to 0x00U, to set it */ +/* as the default case to be compliant with other STM32 devices. */ +#define ADC_CFGR_OVERRUN(_OVERRUN_MODE_) \ + ( ( (_OVERRUN_MODE_) != (ADC_OVR_DATA_PRESERVED) \ + )? (ADC_CFGR_OVRMOD) : (0x00000000U) \ + ) + +/** + * @brief Enable the ADC DMA continuous request. + * @param _DMACONTREQ_MODE_ DMA continuous request mode. + * @retval None + */ +#define ADC_CFGR_DMACONTREQ(_DMACONTREQ_MODE_) ((_DMACONTREQ_MODE_) << 1U) + +/** + * @brief For devices with 3 ADCs or more: Defines the external trigger source + * for regular group according to ADC into common group ADC1&ADC2 or + * ADC3&ADC4 (some triggers with same source have different value to + * be programmed into ADC EXTSEL bits of CFGR register). + * Note: No risk of trigger bits value of common group ADC1&ADC2 + * misleading to another trigger at same bits value, because the 3 + * exceptions below are circular and do not point to any other trigger + * with direct treatment. + * For devices with 2 ADCs or less: this macro makes no change. + * @param __HANDLE__ ADC handle + * @param __EXT_TRIG_CONV__ External trigger selected for regular group. + * @retval External trigger to be programmed into EXTSEL bits of CFGR register + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) + +#if defined(STM32F303xC) || defined(STM32F358xx) +#define ADC_CFGR_EXTSEL_SET(__HANDLE__, __EXT_TRIG_CONV__) \ + (( ((((__HANDLE__)->Instance) == ADC3) || (((__HANDLE__)->Instance) == ADC4)) \ + )? \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T2_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIG_T2_TRGO) \ + : \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T3_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIG_T3_TRGO) \ + : \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T8_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIG_T8_TRGO) \ + : \ + (__EXT_TRIG_CONV__) \ + ) \ + ) \ + ) \ + : \ + (__EXT_TRIG_CONV__) \ + ) +#endif /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +/* Note: Macro including external triggers specific to device STM303xE: using */ +/* Timer20 with ADC trigger input remap. */ +#define ADC_CFGR_EXTSEL_SET(__HANDLE__, __EXT_TRIG_CONV__) \ + (( ((((__HANDLE__)->Instance) == ADC3) || (((__HANDLE__)->Instance) == ADC4)) \ + )? \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T2_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIG_T2_TRGO) \ + : \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T3_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIG_T3_TRGO) \ + : \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T8_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIG_T8_TRGO) \ + : \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T20_CC1 \ + )? \ + (ADC3_4_EXTERNALTRIG_T2_CC1) \ + : \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T20_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIG_EXT_IT2) \ + : \ + ( ( (__EXT_TRIG_CONV__) == ADC_EXTERNALTRIGCONV_T20_TRGO2 \ + )? \ + (ADC3_4_EXTERNALTRIG_T4_CC1) \ + : \ + (__EXT_TRIG_CONV__) \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) \ + : \ + (__EXT_TRIG_CONV__ & (~ADC_EXTERNALTRIGCONV_T20_MASK)) \ + ) +#endif /* STM32F303xE || STM32F398xx */ +#else +#define ADC_CFGR_EXTSEL_SET(__HANDLE__, __EXT_TRIG_CONV__) \ + (__EXT_TRIG_CONV__) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +/** + * @brief For devices with 3 ADCs or more: Defines the external trigger source + * for injected group according to ADC into common group ADC1&ADC2 or + * ADC3&ADC4 (some triggers with same source have different value to + * be programmed into ADC JEXTSEL bits of JSQR register). + * Note: No risk of trigger bits value of common group ADC1&ADC2 + * misleading to another trigger at same bits value, because the 3 + * exceptions below are circular and do not point to any other trigger + * with direct treatment, except trigger + * ADC_EXTERNALTRIGINJECCONV_T4_CC3 differentiated with SW offset. + * For devices with 2 ADCs or less: this macro makes no change. + * @param __HANDLE__ ADC handle + * @param __EXT_TRIG_INJECTCONV__ External trigger selected for injected group + * @retval External trigger to be programmed into JEXTSEL bits of JSQR register + */ +#if defined(STM32F303xC) || defined(STM32F303xE) || defined(STM32F398xx) || defined(STM32F358xx) +#if defined(STM32F303xC) || defined(STM32F358xx) +#define ADC_JSQR_JEXTSEL_SET(__HANDLE__, __EXT_TRIG_INJECTCONV__) \ + (( ((((__HANDLE__)->Instance) == ADC3) || (((__HANDLE__)->Instance) == ADC4)) \ + )? \ + ( ( (__EXT_TRIG_INJECTCONV__) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T2_TRGO) \ + : \ + ( ( (__EXT_TRIG_INJECTCONV__) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T4_TRGO) \ + : \ + ( ( (__EXT_TRIG_INJECTCONV__) == ADC_EXTERNALTRIGINJECCONV_T8_CC4 \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T8_CC4) \ + : \ + ( ( (__EXT_TRIG_INJECTCONV__) == ADC_EXTERNALTRIGINJECCONV_T4_CC3 \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T4_CC3) \ + : \ + (__EXT_TRIG_INJECTCONV__) \ + ) \ + ) \ + ) \ + ) \ + : \ + (__EXT_TRIG_INJECTCONV__) \ + ) +#endif /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +/* Note: Macro including external triggers specific to device STM303xE: using */ +/* Timer20 with ADC trigger input remap. */ +#define ADC_JSQR_JEXTSEL_SET(__HANDLE__, __EXT_TRIG_INJECTCONV__) \ + (( ((((__HANDLE__)->Instance) == ADC3) || (((__HANDLE__)->Instance) == ADC4)) \ + )? \ + ( ( (__EXT_TRIG_INJECTCONV__) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T2_TRGO) \ + : \ + ( ( (__EXT_TRIG_INJECTCONV__) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T4_TRGO) \ + : \ + ( ( (__EXT_TRIG_INJECTCONV__) == ADC_EXTERNALTRIGINJECCONV_T8_CC4 \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T8_CC4) \ + : \ + ( ( (__EXT_TRIG_INJECTCONV__) == ADC_EXTERNALTRIGINJECCONV_T4_CC3 \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T4_CC3) \ + : \ + ( ( (__EXT_TRIG_INJECTCONV__) \ + == ADC_EXTERNALTRIGINJECCONV_T20_TRGO \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T20_TRGO) \ + : \ + ( ( (__EXT_TRIG_INJECTCONV__) \ + == ADC_EXTERNALTRIGINJECCONV_T20_TRGO2 \ + )? \ + (ADC3_4_EXTERNALTRIGINJEC_T1_CC3) \ + : \ + (__EXT_TRIG_INJECTCONV__) \ + ) \ + ) \ + ) \ + ) \ + ) \ + ) \ + : \ + (__EXT_TRIG_INJECTCONV__ & (~ADC_EXTERNALTRIGCONV_T20_MASK)) \ + ) +#endif /* STM32F303xE || STM32F398xx */ +#else +#define ADC_JSQR_JEXTSEL_SET(__HANDLE__, __EXT_TRIG_INJECTCONV__) \ + (__EXT_TRIG_INJECTCONV__) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +/** + * @brief Configure the channel number into offset OFRx register + * @param _CHANNEL_ ADC Channel + * @retval None + */ +#define ADC_OFR_CHANNEL(_CHANNEL_) ((_CHANNEL_) << 26U) + +/** + * @brief Configure the channel number into differential mode selection register + * @param _CHANNEL_ ADC Channel + * @retval None + */ +#define ADC_DIFSEL_CHANNEL(_CHANNEL_) (1U << (_CHANNEL_)) + +/** + * @brief Calibration factor in differential mode to be set into calibration register + * @param _Calibration_Factor_ Calibration factor value + * @retval None + */ +#define ADC_CALFACT_DIFF_SET(_Calibration_Factor_) ((_Calibration_Factor_) << 16U) + +/** + * @brief Calibration factor in differential mode to be retrieved from calibration register + * @param _Calibration_Factor_ Calibration factor value + * @retval None + */ +#define ADC_CALFACT_DIFF_GET(_Calibration_Factor_) ((_Calibration_Factor_) >> 16U) + +/** + * @brief Configure the analog watchdog high threshold into registers TR1, TR2 or TR3. + * @param _Threshold_ Threshold value + * @retval None + */ +#define ADC_TRX_HIGHTHRESHOLD(_Threshold_) ((_Threshold_) << 16U) + +/** + * @brief Enable the ADC DMA continuous request for ADC multimode. + * @param _DMAContReq_MODE_ DMA continuous request mode. + * @retval None + */ +#define ADC_CCR_MULTI_DMACONTREQ(_DMAContReq_MODE_) ((_DMAContReq_MODE_) << 13U) + +/** + * @brief Verification of hardware constraints before ADC can be disabled + * @param __HANDLE__ ADC handle + * @retval SET (ADC can be disabled) or RESET (ADC cannot be disabled) + */ +#define ADC_DISABLING_CONDITIONS(__HANDLE__) \ + (( ( ((__HANDLE__)->Instance->CR) & \ + (ADC_CR_JADSTART | ADC_CR_ADSTART | ADC_CR_ADEN)) == ADC_CR_ADEN \ + ) ? SET : RESET) + + +/** + * @brief Shift the offset in function of the selected ADC resolution. + * Offset has to be left-aligned on bit 11, the LSB (right bits) are set to 0 + * If resolution 12 bits, no shift. + * If resolution 10 bits, shift of 2 ranks on the left. + * If resolution 8 bits, shift of 4 ranks on the left. + * If resolution 6 bits, shift of 6 ranks on the left. + * therefore, shift = (12 - resolution) = 12 - (12- (((RES[1:0]) >> 3)*2)) + * @param __HANDLE__ ADC handle + * @param _Offset_ Value to be shifted + * @retval None + */ +#define ADC_OFFSET_SHIFT_RESOLUTION(__HANDLE__, _Offset_) \ + ((_Offset_) << ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3U)*2U)) + +/** + * @brief Shift the AWD1 threshold in function of the selected ADC resolution. + * Thresholds have to be left-aligned on bit 11, the LSB (right bits) are set to 0. + * If resolution 12 bits, no shift. + * If resolution 10 bits, shift of 2 ranks on the left. + * If resolution 8 bits, shift of 4 ranks on the left. + * If resolution 6 bits, shift of 6 ranks on the left. + * therefore, shift = (12 - resolution) = 12 - (12- (((RES[1:0]) >> 3)*2)) + * @param __HANDLE__ ADC handle + * @param _Threshold_ Value to be shifted + * @retval None + */ +#define ADC_AWD1THRESHOLD_SHIFT_RESOLUTION(__HANDLE__, _Threshold_) \ + ((_Threshold_) << ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3U)*2U)) + +/** + * @brief Shift the AWD2 and AWD3 threshold in function of the selected ADC resolution. + * Thresholds have to be left-aligned on bit 7. + * If resolution 12 bits, shift of 4 ranks on the right (the 4 LSB are discarded) + * If resolution 10 bits, shift of 2 ranks on the right (the 2 LSB are discarded) + * If resolution 8 bits, no shift. + * If resolution 6 bits, shift of 2 ranks on the left (the 2 LSB are set to 0) + * @param __HANDLE__ ADC handle + * @param _Threshold_ Value to be shifted + * @retval None + */ +#define ADC_AWD23THRESHOLD_SHIFT_RESOLUTION(__HANDLE__, _Threshold_) \ + ( ((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) != (ADC_CFGR_RES_1 | ADC_CFGR_RES_0) ? \ + ((_Threshold_) >> (4U- ((((__HANDLE__)->Instance->CFGR & ADC_CFGR_RES) >> 3U)*2U))) : \ + (_Threshold_) << 2U ) + +/** + * @brief Defines if the selected ADC is within ADC common register ADC1_2 or ADC3_4 + * if available (ADC2, ADC3, ADC4 availability depends on STM32 product) + * @param __HANDLE__ ADC handle + * @retval Common control register ADC1_2 or ADC3_4 + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +#define ADC_MASTER_INSTANCE(__HANDLE__) \ + ( ( ((((__HANDLE__)->Instance) == ADC1) || (((__HANDLE__)->Instance) == ADC2)) \ + )? (ADC1) : (ADC3) \ + ) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_MASTER_INSTANCE(__HANDLE__) \ + (ADC1) +#endif /* STM32F302xE || */ + /* STM32F302xC || */ + /* STM32F303x8 || STM32F328xx || STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define ADC_MASTER_INSTANCE(__HANDLE__) \ + (ADC1) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @brief Defines if the selected ADC is within ADC common register ADC1_2 or ADC3_4 + * if available (ADC2, ADC3, ADC4 availability depends on STM32 product) + * @param __HANDLE__ ADC handle + * @retval Common control register ADC1_2 or ADC3_4 + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +#define ADC_COMMON_REGISTER(__HANDLE__) \ + ( ( ((((__HANDLE__)->Instance) == ADC1) || (((__HANDLE__)->Instance) == ADC2)) \ + )? (ADC1_2_COMMON) : (ADC3_4_COMMON) \ + ) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_COMMON_REGISTER(__HANDLE__) \ + (ADC1_2_COMMON) +#endif /* STM32F302xE || */ + /* STM32F302xC || */ + /* STM32F303x8 || STM32F328xx || STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define ADC_COMMON_REGISTER(__HANDLE__) \ + (ADC1_COMMON) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @brief Selection of ADC common register CCR bits MULTI[4:0]corresponding to the selected ADC (applicable for devices with several ADCs) + * @param __HANDLE__ ADC handle + * @retval None + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +#define ADC_COMMON_CCR_MULTI(__HANDLE__) \ + ( ( ((((__HANDLE__)->Instance) == ADC1) || (((__HANDLE__)->Instance) == ADC2)) \ + )? \ + (ADC1_2_COMMON->CCR & ADC12_CCR_MULTI) \ + : \ + (ADC3_4_COMMON->CCR & ADC34_CCR_MULTI) \ + ) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_COMMON_CCR_MULTI(__HANDLE__) \ + (ADC1_2_COMMON->CCR & ADC12_CCR_MULTI) +#endif /* STM32F302xE || */ + /* STM32F302xC || */ + /* STM32F303x8 || STM32F328xx || STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define ADC_COMMON_CCR_MULTI(__HANDLE__) \ + (RESET) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @brief Verification of condition for ADC start conversion: ADC must be in non-multimode, or multimode with handle of ADC master (applicable for devices with several ADCs) + * @param __HANDLE__ ADC handle + * @retval None + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_NONMULTIMODE_OR_MULTIMODEMASTER(__HANDLE__) \ + ((ADC_COMMON_CCR_MULTI(__HANDLE__) == ADC_MODE_INDEPENDENT) || \ + (IS_ADC_MULTIMODE_MASTER_INSTANCE((__HANDLE__)->Instance)) ) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define ADC_NONMULTIMODE_OR_MULTIMODEMASTER(__HANDLE__) \ + (!RESET) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @brief Verification of condition for ADC group regular start conversion: ADC must be in non-multimode or multimode on group injected only, or multimode with handle of ADC master (applicable for devices with several ADCs) + * @param __HANDLE__ ADC handle. + * @retval None + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_NONMULTIMODE_REG_OR_MULTIMODEMASTER(__HANDLE__) \ + ((ADC_COMMON_CCR_MULTI(__HANDLE__) == ADC_MODE_INDEPENDENT) || \ + (ADC_COMMON_CCR_MULTI(__HANDLE__) == ADC_DUALMODE_INJECSIMULT) || \ + (ADC_COMMON_CCR_MULTI(__HANDLE__) == ADC_DUALMODE_ALTERTRIG) || \ + (IS_ADC_MULTIMODE_MASTER_INSTANCE((__HANDLE__)->Instance)) ) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define ADC_NONMULTIMODE_REG_OR_MULTIMODEMASTER(__HANDLE__) \ + (!RESET) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @brief Verification of condition for ADC group injected start conversion: ADC must be in non-multimode or multimode on group regular only, or multimode with handle of ADC master (applicable for devices with several ADCs) + * @param __HANDLE__ ADC handle. + * @retval None + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_NONMULTIMODE_INJ_OR_MULTIMODEMASTER(__HANDLE__) \ + ((ADC_COMMON_CCR_MULTI(__HANDLE__) == ADC_MODE_INDEPENDENT) || \ + (ADC_COMMON_CCR_MULTI(__HANDLE__) == ADC_DUALMODE_REGSIMULT) || \ + (ADC_COMMON_CCR_MULTI(__HANDLE__) == ADC_DUALMODE_INTERL) || \ + (IS_ADC_MULTIMODE_MASTER_INSTANCE((__HANDLE__)->Instance)) ) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define ADC_NONMULTIMODE_INJ_OR_MULTIMODEMASTER(__HANDLE__) \ + (!RESET) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @brief Check ADC multimode setting: In case of multimode, check whether ADC master of the selected ADC has feature auto-injection enabled (applicable for devices with several ADCs) + * @param __HANDLE__ ADC handle + * @retval None + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +#define ADC_MULTIMODE_AUTO_INJECTED(__HANDLE__) \ + (( (((__HANDLE__)->Instance) == ADC1) || (((__HANDLE__)->Instance) == ADC2) \ + )? \ + (ADC1->CFGR & ADC_CFGR_JAUTO) \ + : \ + (ADC3->CFGR & ADC_CFGR_JAUTO) \ + ) +#elif defined(STM32F302xE) || \ + defined(STM32F302xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_MULTIMODE_AUTO_INJECTED(__HANDLE__) \ + (( (((__HANDLE__)->Instance) == ADC1) || (((__HANDLE__)->Instance) == ADC2) \ + )? \ + (ADC1->CFGR & ADC_CFGR_JAUTO) \ + : \ + (RESET) \ + ) +#else +#define ADC_MULTIMODE_AUTO_INJECTED(__HANDLE__) \ + (RESET) +#endif + +/** + * @brief Set handle of the other ADC sharing the same common register ADC1_2 or ADC3_4 + * if available (ADC2, ADC3, ADC4 availability depends on STM32 product) + * @param __HANDLE__ ADC handle + * @param __HANDLE_OTHER_ADC__ other ADC handle + * @retval None + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +#define ADC_COMMON_ADC_OTHER(__HANDLE__, __HANDLE_OTHER_ADC__) \ + ( ( ((__HANDLE__)->Instance == ADC1) \ + )? \ + ((__HANDLE_OTHER_ADC__)->Instance = ADC2) \ + : \ + ( ( ((__HANDLE__)->Instance == ADC2) \ + )? \ + ((__HANDLE_OTHER_ADC__)->Instance = ADC1) \ + : \ + ( ( ((__HANDLE__)->Instance == ADC3) \ + )? \ + ((__HANDLE_OTHER_ADC__)->Instance = ADC4) \ + : \ + ( ( ((__HANDLE__)->Instance == ADC4) \ + )? \ + ((__HANDLE_OTHER_ADC__)->Instance = ADC3) \ + : \ + ((__HANDLE_OTHER_ADC__)->Instance = NULL) \ + ) \ + ) \ + ) \ + ) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_COMMON_ADC_OTHER(__HANDLE__, __HANDLE_OTHER_ADC__) \ + ( ( ((__HANDLE__)->Instance == ADC1) \ + )? \ + ((__HANDLE_OTHER_ADC__)->Instance = ADC2) \ + : \ + ((__HANDLE_OTHER_ADC__)->Instance = ADC1) \ + ) +#endif /* STM32F302xE || */ + /* STM32F302xC || */ + /* STM32F303x8 || STM32F328xx || STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define ADC_COMMON_ADC_OTHER(__HANDLE__, __HANDLE_OTHER_ADC__) \ + ((__HANDLE_OTHER_ADC__)->Instance = NULL) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @brief Set handle of the ADC slave associated to the ADC master + * if available (ADC2, ADC3, ADC4 availability depends on STM32 product) + * @param __HANDLE_MASTER__ ADC master handle + * @param __HANDLE_SLAVE__ ADC slave handle + * @retval None + */ +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) +#define ADC_MULTI_SLAVE(__HANDLE_MASTER__, __HANDLE_SLAVE__) \ + ( ( ((__HANDLE_MASTER__)->Instance == ADC1) \ + )? \ + ((__HANDLE_SLAVE__)->Instance = ADC2) \ + : \ + ( ( ((__HANDLE_MASTER__)->Instance == ADC3) \ + )? \ + ((__HANDLE_SLAVE__)->Instance = ADC4) \ + : \ + ((__HANDLE_SLAVE__)->Instance = NULL) \ + ) \ + ) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define ADC_MULTI_SLAVE(__HANDLE_MASTER__, __HANDLE_SLAVE__) \ + ( ( ((__HANDLE_MASTER__)->Instance == ADC1) \ + )? \ + ((__HANDLE_SLAVE__)->Instance = ADC2) \ + : \ + ( NULL ) \ + ) +#endif /* STM32F302xE || */ + /* STM32F302xC || */ + /* STM32F303x8 || STM32F328xx || STM32F334x8 */ + + +#define IS_ADC_RESOLUTION(RESOLUTION) (((RESOLUTION) == ADC_RESOLUTION_12B) || \ + ((RESOLUTION) == ADC_RESOLUTION_10B) || \ + ((RESOLUTION) == ADC_RESOLUTION_8B) || \ + ((RESOLUTION) == ADC_RESOLUTION_6B) ) + +#define IS_ADC_RESOLUTION_8_6_BITS(RESOLUTION) (((RESOLUTION) == ADC_RESOLUTION_8B) || \ + ((RESOLUTION) == ADC_RESOLUTION_6B) ) + + +#define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DATAALIGN_RIGHT) || \ + ((ALIGN) == ADC_DATAALIGN_LEFT) ) + +#define IS_ADC_SCAN_MODE(SCAN_MODE) (((SCAN_MODE) == ADC_SCAN_DISABLE) || \ + ((SCAN_MODE) == ADC_SCAN_ENABLE) ) + +#define IS_ADC_EOC_SELECTION(EOC_SELECTION) (((EOC_SELECTION) == ADC_EOC_SINGLE_CONV) || \ + ((EOC_SELECTION) == ADC_EOC_SEQ_CONV) ) + +#define IS_ADC_OVERRUN(OVR) (((OVR) == ADC_OVR_DATA_PRESERVED) || \ + ((OVR) == ADC_OVR_DATA_OVERWRITTEN) ) + +#define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) == ADC_CHANNEL_1) || \ + ((CHANNEL) == ADC_CHANNEL_2) || \ + ((CHANNEL) == ADC_CHANNEL_3) || \ + ((CHANNEL) == ADC_CHANNEL_4) || \ + ((CHANNEL) == ADC_CHANNEL_5) || \ + ((CHANNEL) == ADC_CHANNEL_6) || \ + ((CHANNEL) == ADC_CHANNEL_7) || \ + ((CHANNEL) == ADC_CHANNEL_8) || \ + ((CHANNEL) == ADC_CHANNEL_9) || \ + ((CHANNEL) == ADC_CHANNEL_10) || \ + ((CHANNEL) == ADC_CHANNEL_11) || \ + ((CHANNEL) == ADC_CHANNEL_12) || \ + ((CHANNEL) == ADC_CHANNEL_13) || \ + ((CHANNEL) == ADC_CHANNEL_14) || \ + ((CHANNEL) == ADC_CHANNEL_15) || \ + ((CHANNEL) == ADC_CHANNEL_TEMPSENSOR) || \ + ((CHANNEL) == ADC_CHANNEL_VBAT) || \ + ((CHANNEL) == ADC_CHANNEL_VREFINT) || \ + ((CHANNEL) == ADC_CHANNEL_VOPAMP1) || \ + ((CHANNEL) == ADC_CHANNEL_VOPAMP2) || \ + ((CHANNEL) == ADC_CHANNEL_VOPAMP3) || \ + ((CHANNEL) == ADC_CHANNEL_VOPAMP4) ) + +#define IS_ADC_DIFF_CHANNEL(CHANNEL) (((CHANNEL) == ADC_CHANNEL_1) || \ + ((CHANNEL) == ADC_CHANNEL_2) || \ + ((CHANNEL) == ADC_CHANNEL_3) || \ + ((CHANNEL) == ADC_CHANNEL_4) || \ + ((CHANNEL) == ADC_CHANNEL_5) || \ + ((CHANNEL) == ADC_CHANNEL_6) || \ + ((CHANNEL) == ADC_CHANNEL_7) || \ + ((CHANNEL) == ADC_CHANNEL_8) || \ + ((CHANNEL) == ADC_CHANNEL_9) || \ + ((CHANNEL) == ADC_CHANNEL_10) || \ + ((CHANNEL) == ADC_CHANNEL_11) || \ + ((CHANNEL) == ADC_CHANNEL_12) || \ + ((CHANNEL) == ADC_CHANNEL_13) || \ + ((CHANNEL) == ADC_CHANNEL_14) ) + +#define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SAMPLETIME_1CYCLE_5) || \ + ((TIME) == ADC_SAMPLETIME_2CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_4CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_7CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_19CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_61CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_181CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_601CYCLES_5) ) + +#define IS_ADC_SINGLE_DIFFERENTIAL(SING_DIFF) (((SING_DIFF) == ADC_SINGLE_ENDED) || \ + ((SING_DIFF) == ADC_DIFFERENTIAL_ENDED) ) + +#define IS_ADC_OFFSET_NUMBER(OFFSET_NUMBER) (((OFFSET_NUMBER) == ADC_OFFSET_NONE) || \ + ((OFFSET_NUMBER) == ADC_OFFSET_1) || \ + ((OFFSET_NUMBER) == ADC_OFFSET_2) || \ + ((OFFSET_NUMBER) == ADC_OFFSET_3) || \ + ((OFFSET_NUMBER) == ADC_OFFSET_4) ) + +#define IS_ADC_REGULAR_RANK(CHANNEL) (((CHANNEL) == ADC_REGULAR_RANK_1 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_2 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_3 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_4 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_5 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_6 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_7 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_8 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_9 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_10) || \ + ((CHANNEL) == ADC_REGULAR_RANK_11) || \ + ((CHANNEL) == ADC_REGULAR_RANK_12) || \ + ((CHANNEL) == ADC_REGULAR_RANK_13) || \ + ((CHANNEL) == ADC_REGULAR_RANK_14) || \ + ((CHANNEL) == ADC_REGULAR_RANK_15) || \ + ((CHANNEL) == ADC_REGULAR_RANK_16) ) + +#define IS_ADC_EXTTRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGCONVEDGE_NONE) || \ + ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISING) || \ + ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_FALLING) || \ + ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISINGFALLING) ) + +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) + +#if defined(STM32F303xC) || defined(STM32F358xx) +#define IS_ADC_EXTTRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T6_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT11) || \ + \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T7_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT2) || \ + \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T15_TRGO) || \ + \ + ((REGTRIG) == ADC_SOFTWARE_START) ) +#endif /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +#define IS_ADC_EXTTRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T6_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT11) || \ + \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T7_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT2) || \ + \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T15_TRGO) || \ + \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T20_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T20_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T20_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T20_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T20_TRGO2) || \ + \ + ((REGTRIG) == ADC_SOFTWARE_START) ) +#endif /* STM32F303xE || STM32F398xx */ + +#endif /* STM32F303xC || STM32F303xE || STM32F398xx || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) + +#if defined(STM32F302xE) +#define IS_ADC_EXTTRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT11) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T6_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T15_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC4) || \ + \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T20_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T20_CC3) || \ + \ + ((REGTRIG) == ADC_SOFTWARE_START) ) +#endif /* STM32F302xE */ + +#if defined(STM32F302xC) +#define IS_ADC_EXTTRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT11) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T6_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T15_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC4) || \ + \ + ((REGTRIG) == ADC_SOFTWARE_START) ) +#endif /* STM32F302xC */ + +#endif /* STM32F302xE || */ + /* STM32F302xC */ + +#if defined(STM32F303x8) || defined(STM32F328xx) +#define IS_ADC_EXTTRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT11) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T8_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T6_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T15_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC4) || \ + \ + ((REGTRIG) == ADC_SOFTWARE_START) ) +#endif /* STM32F303x8 || STM32F328xx */ + +#if defined(STM32F334x8) +#define IS_ADC_EXTTRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT11) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONVHRTIM_TRG1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONVHRTIM_TRG3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T6_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T15_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_CC4) || \ + \ + ((REGTRIG) == ADC_SOFTWARE_START) ) +#endif /* STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define IS_ADC_EXTTRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC1) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT11) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T1_TRGO2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T6_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T15_TRGO) || \ + ((REGTRIG) == ADC_SOFTWARE_START) ) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#define IS_ADC_EXTTRIGINJEC_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_NONE) || \ + ((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISING) || \ + ((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_FALLING) || \ + ((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISINGFALLING) ) + + +#if defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F303xC) || defined(STM32F358xx) + +#if defined(STM32F303xC) || defined(STM32F358xx) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T7_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T7_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC2) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_CC2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_TRGO2) || \ + \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F303xE || STM32F398xx */ + +#endif /* STM32F303xC || STM32F303xE || STM32F398xx || STM32F358xx */ + +#if defined(STM32F302xE) || \ + defined(STM32F302xC) + +#if defined(STM32F302xE) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T20_TRGO2) || \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F302xE */ + +#if defined(STM32F302xC) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F302xC */ + +#endif /* STM32F302xE || */ + /* STM32F302xC */ + +#if defined(STM32F303x8) || defined(STM32F328xx) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T8_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F303x8 || STM32F328xx */ + +#if defined(STM32F334x8) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_HRTIM_TRG2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_HRTIM_TRG4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC3) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F334x8 */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T1_TRGO2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T6_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T15_TRGO) || \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#define IS_ADC_INJECTED_RANK(CHANNEL) (((CHANNEL) == ADC_INJECTED_RANK_1) || \ + ((CHANNEL) == ADC_INJECTED_RANK_2) || \ + ((CHANNEL) == ADC_INJECTED_RANK_3) || \ + ((CHANNEL) == ADC_INJECTED_RANK_4) ) + +#define IS_ADC_MODE(MODE) (((MODE) == ADC_MODE_INDEPENDENT) || \ + ((MODE) == ADC_DUALMODE_REGSIMULT_INJECSIMULT) || \ + ((MODE) == ADC_DUALMODE_REGSIMULT_ALTERTRIG) || \ + ((MODE) == ADC_DUALMODE_REGINTERL_INJECSIMULT) || \ + ((MODE) == ADC_DUALMODE_INJECSIMULT) || \ + ((MODE) == ADC_DUALMODE_REGSIMULT) || \ + ((MODE) == ADC_DUALMODE_INTERL) || \ + ((MODE) == ADC_DUALMODE_ALTERTRIG) ) + +#define IS_ADC_DMA_ACCESS_MODE(MODE) (((MODE) == ADC_DMAACCESSMODE_DISABLED) || \ + ((MODE) == ADC_DMAACCESSMODE_12_10_BITS) || \ + ((MODE) == ADC_DMAACCESSMODE_8_6_BITS) ) + +#define IS_ADC_SAMPLING_DELAY(DELAY) (((DELAY) == ADC_TWOSAMPLINGDELAY_1CYCLE) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_2CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_3CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_4CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_5CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_6CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_7CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_8CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_9CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_10CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_11CYCLES) || \ + ((DELAY) == ADC_TWOSAMPLINGDELAY_12CYCLES) ) + +#define IS_ADC_ANALOG_WATCHDOG_NUMBER(WATCHDOG) (((WATCHDOG) == ADC_ANALOGWATCHDOG_1) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_2) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_3) ) + +#define IS_ADC_ANALOG_WATCHDOG_MODE(WATCHDOG) (((WATCHDOG) == ADC_ANALOGWATCHDOG_NONE) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REG) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_INJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REGINJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REG) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_INJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REGINJEC) ) + +#define IS_ADC_CONVERSION_GROUP(CONVERSION) (((CONVERSION) == ADC_REGULAR_GROUP) || \ + ((CONVERSION) == ADC_INJECTED_GROUP) || \ + ((CONVERSION) == ADC_REGULAR_INJECTED_GROUP) ) + +#define IS_ADC_EVENT_TYPE(EVENT) (((EVENT) == ADC_AWD_EVENT) || \ + ((EVENT) == ADC_AWD2_EVENT) || \ + ((EVENT) == ADC_AWD3_EVENT) || \ + ((EVENT) == ADC_OVR_EVENT) || \ + ((EVENT) == ADC_JQOVF_EVENT) ) + +/** @defgroup ADCEx_range_verification ADC Extended Range Verification + * in function of ADC resolution selected (12, 10, 8 or 6 bits) + * @{ + */ +#define IS_ADC_RANGE(RESOLUTION, ADC_VALUE) \ + ((((RESOLUTION) == ADC_RESOLUTION_12B) && ((ADC_VALUE) <= (0x0FFFU))) || \ + (((RESOLUTION) == ADC_RESOLUTION_10B) && ((ADC_VALUE) <= (0x03FFU))) || \ + (((RESOLUTION) == ADC_RESOLUTION_8B) && ((ADC_VALUE) <= (0x00FFU))) || \ + (((RESOLUTION) == ADC_RESOLUTION_6B) && ((ADC_VALUE) <= (0x003FU))) ) +/** + * @} + */ + +/** @defgroup ADC_injected_nb_conv_verification ADC Injected Conversion Number Verification + * @{ + */ +#define IS_ADC_INJECTED_NB_CONV(LENGTH) (((LENGTH) >= (1U)) && ((LENGTH) <= (4U))) +/** + * @} + */ + +/** @defgroup ADC_regular_nb_conv_verification ADC Regular Conversion Number Verification + * @{ + */ +#define IS_ADC_REGULAR_NB_CONV(LENGTH) (((LENGTH) >= (1U)) && ((LENGTH) <= (16U))) +/** + * @} + */ + +/** @defgroup ADC_regular_discontinuous_mode_number_verification ADC Regular Discontinuous Mode NumberVerification + * @{ + */ +#define IS_ADC_REGULAR_DISCONT_NUMBER(NUMBER) (((NUMBER) >= (1U)) && ((NUMBER) <= (8U))) +/** + * @} + */ + +/** @defgroup ADC_calibration_factor_length_verification ADC Calibration Factor Length Verification + * @{ + */ +/** + * @brief Calibration factor length verification (7 bits maximum) + * @param _Calibration_Factor_ Calibration factor value + * @retval None + */ +#define IS_ADC_CALFACT(_Calibration_Factor_) ((_Calibration_Factor_) <= (0x7FU)) +/** + * @} + */ + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + + +#if defined(STM32F373xC) || defined(STM32F378xx) + +/** + * @brief Verification of ADC state: enabled or disabled + * @param __HANDLE__ ADC handle + * @retval SET (ADC enabled) or RESET (ADC disabled) + */ +#define ADC_IS_ENABLE(__HANDLE__) \ + ((( ((__HANDLE__)->Instance->CR2 & ADC_CR2_ADON) == ADC_CR2_ADON ) \ + ) ? SET : RESET) + +/** + * @brief Test if conversion trigger of regular group is software start + * or external trigger. + * @param __HANDLE__ ADC handle + * @retval SET (software start) or RESET (external trigger) + */ +#define ADC_IS_SOFTWARE_START_REGULAR(__HANDLE__) \ + (((__HANDLE__)->Instance->CR2 & ADC_CR2_EXTSEL) == ADC_SOFTWARE_START) + +/** + * @brief Test if conversion trigger of injected group is software start + * or external trigger. + * @param __HANDLE__ ADC handle + * @retval SET (software start) or RESET (external trigger) + */ +#define ADC_IS_SOFTWARE_START_INJECTED(__HANDLE__) \ + (((__HANDLE__)->Instance->CR2 & ADC_CR2_JEXTSEL) == ADC_INJECTED_SOFTWARE_START) + +/** + * @brief Simultaneously clears and sets specific bits of the handle State + * @note: ADC_STATE_CLR_SET() macro is merely aliased to generic macro MODIFY_REG(), + * the first parameter is the ADC handle State, the second parameter is the + * bit field to clear, the third and last parameter is the bit field to set. + * @retval None + */ +#define ADC_STATE_CLR_SET MODIFY_REG + +/** + * @brief Clear ADC error code (set it to error code: "no error") + * @param __HANDLE__ ADC handle + * @retval None + */ +#define ADC_CLEAR_ERRORCODE(__HANDLE__) \ + ((__HANDLE__)->ErrorCode = HAL_ADC_ERROR_NONE) + +/** + * @brief Set ADC number of conversions into regular channel sequence length. + * @param _NbrOfConversion_ Regular channel sequence length + * @retval None + */ +#define ADC_SQR1_L_SHIFT(_NbrOfConversion_) \ + (((_NbrOfConversion_) - (uint8_t)1U) << 20U) + +/** + * @brief Set the ADC's sample time for channel numbers between 10 and 18. + * @param _SAMPLETIME_ Sample time parameter. + * @param _CHANNELNB_ Channel number. + * @retval None + */ +#define ADC_SMPR1(_SAMPLETIME_, _CHANNELNB_) \ + ((_SAMPLETIME_) << (3U * ((_CHANNELNB_) - 10U))) + +/** + * @brief Set the ADC's sample time for channel numbers between 0 and 9. + * @param _SAMPLETIME_ Sample time parameter. + * @param _CHANNELNB_ Channel number. + * @retval None + */ +#define ADC_SMPR2(_SAMPLETIME_, _CHANNELNB_) \ + ((_SAMPLETIME_) << (3U * (_CHANNELNB_))) + +/** + * @brief Set the selected regular channel rank for rank between 1 and 6. + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @retval None + */ +#define ADC_SQR3_RK(_CHANNELNB_, _RANKNB_) \ + ((_CHANNELNB_) << (5U * ((_RANKNB_) - 1U))) + +/** + * @brief Set the selected regular channel rank for rank between 7 and 12. + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @retval None + */ +#define ADC_SQR2_RK(_CHANNELNB_, _RANKNB_) \ + ((_CHANNELNB_) << (5U * ((_RANKNB_) - 7U))) + +/** + * @brief Set the selected regular channel rank for rank between 13 and 16. + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @retval None + */ +#define ADC_SQR1_RK(_CHANNELNB_, _RANKNB_) \ + ((_CHANNELNB_) << (5U * ((_RANKNB_) - 13U))) + +/** + * @brief Set the injected sequence length. + * @param _JSQR_JL_ Sequence length. + * @retval None + */ +#define ADC_JSQR_JL_SHIFT(_JSQR_JL_) \ + (((_JSQR_JL_) -1U) << 20U) + +/** + * @brief Set the selected injected channel rank + * Note: on STM32F37x devices, channel rank position in JSQR register + * is depending on total number of ranks selected into + * injected sequencer (ranks sequence starting from 4-JL) + * @param _CHANNELNB_ Channel number. + * @param _RANKNB_ Rank number. + * @param _JSQR_JL_ Sequence length. + * @retval None + */ +#define ADC_JSQR_RK_JL(_CHANNELNB_, _RANKNB_, _JSQR_JL_) \ + ((_CHANNELNB_) << (5U * ((4U - ((_JSQR_JL_) - (_RANKNB_))) - 1U))) + +/** + * @brief Enable ADC continuous conversion mode. + * @param _CONTINUOUS_MODE_ Continuous mode. + * @retval None + */ +#define ADC_CR2_CONTINUOUS(_CONTINUOUS_MODE_) \ + ((_CONTINUOUS_MODE_) << 1U) + +/** + * @brief Configures the number of discontinuous conversions for the regular group channels. + * @param _NBR_DISCONTINUOUS_CONV_ Number of discontinuous conversions. + * @retval None + */ +#define ADC_CR1_DISCONTINUOUS_NUM(_NBR_DISCONTINUOUS_CONV_) \ + (((_NBR_DISCONTINUOUS_CONV_) - 1U) << 13U) + +/** + * @brief Enable ADC scan mode to convert multiple ranks with sequencer. + * @param _SCAN_MODE_ Scan conversion mode. + * @retval None + */ +/* Note: Scan mode is compared to ENABLE for legacy purpose, this parameter */ +/* is equivalent to ADC_SCAN_ENABLE. */ +#define ADC_CR1_SCAN_SET(_SCAN_MODE_) \ + (( ((_SCAN_MODE_) == ADC_SCAN_ENABLE) || ((_SCAN_MODE_) == ENABLE) \ + )? (ADC_SCAN_ENABLE) : (ADC_SCAN_DISABLE) \ + ) + +/** + * @brief Calibration factor in differential mode to be set into calibration register + * @param _Calibration_Factor_ Calibration factor value + * @retval None + */ +#define ADC_CALFACT_DIFF_SET(_Calibration_Factor_) \ + ((_Calibration_Factor_) << 16U) + +/** + * @brief Calibration factor in differential mode to be retrieved from calibration register + * @param _Calibration_Factor_ Calibration factor value + * @retval None + */ +#define ADC_CALFACT_DIFF_GET(_Calibration_Factor_) \ + ((_Calibration_Factor_) >> 16U) + + +/** + * @brief Get the maximum ADC conversion cycles on all channels. + * Returns the selected sampling time + conversion time (12.5 ADC clock cycles) + * Approximation of sampling time within 4 ranges, returns the highest value: + * below 7.5 cycles {1.5 cycle; 7.5 cycles}, + * between 13.5 cycles and 28.5 cycles {13.5 cycles; 28.5 cycles} + * between 41.5 cycles and 71.5 cycles {41.5 cycles; 55.5 cycles; 71.5cycles} + * equal to 239.5 cycles + * Unit: ADC clock cycles + * @param __HANDLE__ ADC handle + * @retval ADC conversion cycles on all channels + */ +#define ADC_CONVCYCLES_MAX_RANGE(__HANDLE__) \ + (( (((__HANDLE__)->Instance->SMPR2 & ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT2) == RESET) && \ + (((__HANDLE__)->Instance->SMPR1 & ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT2) == RESET) ) ? \ + \ + (( (((__HANDLE__)->Instance->SMPR2 & ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT1) == RESET) && \ + (((__HANDLE__)->Instance->SMPR1 & ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT1) == RESET) ) ? \ + ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_7CYCLES5 : ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_28CYCLES5) \ + : \ + ((((((__HANDLE__)->Instance->SMPR2 & ADC_SAMPLETIME_ALLCHANNELS_SMPR2BIT1) == RESET) && \ + (((__HANDLE__)->Instance->SMPR1 & ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT1) == RESET)) || \ + ((((__HANDLE__)->Instance->SMPR2 & ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT0) == RESET) && \ + (((__HANDLE__)->Instance->SMPR1 & ADC_SAMPLETIME_ALLCHANNELS_SMPR1BIT0) == RESET))) ? \ + ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_71CYCLES5 : ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_239CYCLES5) \ + ) + +/** + * @brief Get the total ADC clock prescaler (APB2 prescaler x ADC prescaler) + * from system clock configuration register. + * Approximation within 3 ranges, returns the higher value: + * total prescaler minimum: 2 (ADC presc 2, APB2 presc 0) + * total prescaler 32 (ADC presc 0 and APB2 presc all, or + * ADC presc {4, 6, 8} and APB2 presc {0, 2, 4}) + * total prescaler maximum: 128 (ADC presc {4, 6, 8} and APB2 presc {8, 16}) + * Unit: none (prescaler factor) + * @retval ADC and APB2 prescaler factor + */ +#define ADC_CLOCK_PRESCALER_RANGE() \ + (( (RCC->CFGR & (RCC_CFGR_ADCPRE_1 | RCC_CFGR_ADCPRE_0)) == RESET) ? \ + (( (RCC->CFGR & RCC_CFGR_PPRE2_2) == RESET) ? 2 : 32U ) \ + : \ + (( (RCC->CFGR & RCC_CFGR_PPRE2_1) == RESET) ? 32 : 128U ) \ + ) + +/** + * @brief Get the ADC clock prescaler from system clock configuration register. + * @retval None + */ +#define ADC_GET_CLOCK_PRESCALER() (((RCC->CFGR & RCC_CFGR_ADCPRE) >> 14U) +1U) + +#define IS_ADC_DATA_ALIGN(ALIGN) (((ALIGN) == ADC_DATAALIGN_RIGHT) || \ + ((ALIGN) == ADC_DATAALIGN_LEFT) ) + +#define IS_ADC_SCAN_MODE(SCAN_MODE) (((SCAN_MODE) == ADC_SCAN_DISABLE) || \ + ((SCAN_MODE) == ADC_SCAN_ENABLE) ) + +#define IS_ADC_CHANNEL(CHANNEL) (((CHANNEL) == ADC_CHANNEL_0) || \ + ((CHANNEL) == ADC_CHANNEL_1) || \ + ((CHANNEL) == ADC_CHANNEL_2) || \ + ((CHANNEL) == ADC_CHANNEL_3) || \ + ((CHANNEL) == ADC_CHANNEL_4) || \ + ((CHANNEL) == ADC_CHANNEL_5) || \ + ((CHANNEL) == ADC_CHANNEL_6) || \ + ((CHANNEL) == ADC_CHANNEL_7) || \ + ((CHANNEL) == ADC_CHANNEL_8) || \ + ((CHANNEL) == ADC_CHANNEL_9) || \ + ((CHANNEL) == ADC_CHANNEL_10) || \ + ((CHANNEL) == ADC_CHANNEL_11) || \ + ((CHANNEL) == ADC_CHANNEL_12) || \ + ((CHANNEL) == ADC_CHANNEL_13) || \ + ((CHANNEL) == ADC_CHANNEL_14) || \ + ((CHANNEL) == ADC_CHANNEL_15) || \ + ((CHANNEL) == ADC_CHANNEL_TEMPSENSOR) || \ + ((CHANNEL) == ADC_CHANNEL_VREFINT) || \ + ((CHANNEL) == ADC_CHANNEL_VBAT) ) + +#define IS_ADC_SAMPLE_TIME(TIME) (((TIME) == ADC_SAMPLETIME_1CYCLE_5) || \ + ((TIME) == ADC_SAMPLETIME_7CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_13CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_28CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_41CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_55CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_71CYCLES_5) || \ + ((TIME) == ADC_SAMPLETIME_239CYCLES_5) ) + +#define IS_ADC_REGULAR_RANK(CHANNEL) (((CHANNEL) == ADC_REGULAR_RANK_1 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_2 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_3 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_4 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_5 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_6 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_7 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_8 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_9 ) || \ + ((CHANNEL) == ADC_REGULAR_RANK_10) || \ + ((CHANNEL) == ADC_REGULAR_RANK_11) || \ + ((CHANNEL) == ADC_REGULAR_RANK_12) || \ + ((CHANNEL) == ADC_REGULAR_RANK_13) || \ + ((CHANNEL) == ADC_REGULAR_RANK_14) || \ + ((CHANNEL) == ADC_REGULAR_RANK_15) || \ + ((CHANNEL) == ADC_REGULAR_RANK_16) ) + +#define IS_ADC_EXTTRIG_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGCONVEDGE_NONE) || \ + ((EDGE) == ADC_EXTERNALTRIGCONVEDGE_RISING) ) + +#define IS_ADC_EXTTRIG(REGTRIG) (((REGTRIG) == ADC_EXTERNALTRIGCONV_T2_CC2) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T3_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T4_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T19_TRGO) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T19_CC3) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_T19_CC4) || \ + ((REGTRIG) == ADC_EXTERNALTRIGCONV_EXT_IT11) || \ + ((REGTRIG) == ADC_SOFTWARE_START) ) + +#define IS_ADC_EXTTRIGINJEC_EDGE(EDGE) (((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_NONE) || \ + ((EDGE) == ADC_EXTERNALTRIGINJECCONV_EDGE_RISING) ) + +#define IS_ADC_EXTTRIGINJEC(INJTRIG) (((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T2_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T3_CC4) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T4_TRGO) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T19_CC1) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_T19_CC2) || \ + ((INJTRIG) == ADC_EXTERNALTRIGINJECCONV_EXT_IT15) || \ + ((INJTRIG) == ADC_INJECTED_SOFTWARE_START) ) + +#define IS_ADC_INJECTED_RANK(CHANNEL) (((CHANNEL) == ADC_INJECTED_RANK_1) || \ + ((CHANNEL) == ADC_INJECTED_RANK_2) || \ + ((CHANNEL) == ADC_INJECTED_RANK_3) || \ + ((CHANNEL) == ADC_INJECTED_RANK_4) ) + +#define IS_ADC_ANALOG_WATCHDOG_MODE(WATCHDOG) (((WATCHDOG) == ADC_ANALOGWATCHDOG_NONE) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REG) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_INJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_SINGLE_REGINJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REG) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_INJEC) || \ + ((WATCHDOG) == ADC_ANALOGWATCHDOG_ALL_REGINJEC) ) + +#define IS_ADC_CONVERSION_GROUP(CONVERSION) (((CONVERSION) == ADC_REGULAR_GROUP) || \ + ((CONVERSION) == ADC_INJECTED_GROUP) || \ + ((CONVERSION) == ADC_REGULAR_INJECTED_GROUP) ) + +#define IS_ADC_EVENT_TYPE(EVENT) ((EVENT) == ADC_AWD_EVENT) + +/** @defgroup ADCEx_range_verification ADC Extended Range Verification + * For a unique ADC resolution: 12 bits + * @{ + */ +#define IS_ADC_RANGE(ADC_VALUE) ((ADC_VALUE) <= (0x0FFFU)) +/** + * @} + */ + +/** @defgroup ADC_injected_nb_conv_verification ADC Injected Conversion Number Verification + * @{ + */ +#define IS_ADC_INJECTED_NB_CONV(LENGTH) (((LENGTH) >= (1U)) && ((LENGTH) <= (4U))) +/** + * @} + */ + +/** @defgroup ADC_regular_nb_conv_verification ADC Regular Conversion Number Verification + * @{ + */ +#define IS_ADC_REGULAR_NB_CONV(LENGTH) (((LENGTH) >= (1U)) && ((LENGTH) <= (16U))) +/** + * @} + */ + +/** @defgroup ADC_regular_discontinuous_mode_number_verification ADC Regular Discontinuous Mode NumberVerification + * @{ + */ +#define IS_ADC_REGULAR_DISCONT_NUMBER(NUMBER) (((NUMBER) >= (1U)) && ((NUMBER) <= (8U))) +/** + * @} + */ + +#endif /* STM32F373xC || STM32F378xx */ +/** + * @} + */ + + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup ADCEx_Exported_Functions ADCEx Exported Functions + * @{ + */ + +/* Initialization/de-initialization functions *********************************/ + +/** @addtogroup ADCEx_Exported_Functions_Group2 ADCEx Input and Output operation functions + * @{ + */ +/* I/O operation functions ****************************************************/ + +/* ADC calibration */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(struct __ADC_HandleTypeDef* hadc, uint32_t SingleDiff); +uint32_t HAL_ADCEx_Calibration_GetValue(struct __ADC_HandleTypeDef *hadc, uint32_t SingleDiff); +HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(struct __ADC_HandleTypeDef *hadc, uint32_t SingleDiff, uint32_t CalibrationFactor); +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(struct __ADC_HandleTypeDef* hadc); +#endif /* STM32F373xC || STM32F378xx */ + +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStart(struct __ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADCEx_InjectedStop(struct __ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(struct __ADC_HandleTypeDef* hadc, uint32_t Timeout); + +/* Non-blocking mode: Interruption */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(struct __ADC_HandleTypeDef* hadc); +HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(struct __ADC_HandleTypeDef* hadc); + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/* ADC multimode */ +HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(struct __ADC_HandleTypeDef *hadc, uint32_t *pData, uint32_t Length); +HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(struct __ADC_HandleTypeDef *hadc); +uint32_t HAL_ADCEx_MultiModeGetValue(struct __ADC_HandleTypeDef *hadc); +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/* ADC group regular stop conversion without impacting group injected */ +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_ADCEx_RegularStop(struct __ADC_HandleTypeDef* hadc); +/* Non-blocking mode: Interruption */ +HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT(struct __ADC_HandleTypeDef* hadc); +/* Non-blocking mode: DMA */ +HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA(struct __ADC_HandleTypeDef* hadc); +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/* ADC multimode */ +HAL_StatusTypeDef HAL_ADCEx_RegularMultiModeStop_DMA(struct __ADC_HandleTypeDef *hadc); +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/* ADC retrieve conversion value intended to be used with polling or interruption */ +uint32_t HAL_ADCEx_InjectedGetValue(struct __ADC_HandleTypeDef* hadc, uint32_t InjectedRank); + +/* ADC IRQHandler and Callbacks used in non-blocking modes (Interruption) */ +void HAL_ADCEx_InjectedConvCpltCallback(struct __ADC_HandleTypeDef* hadc); + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +void HAL_ADCEx_InjectedQueueOverflowCallback(struct __ADC_HandleTypeDef* hadc); +void HAL_ADCEx_LevelOutOfWindow2Callback(struct __ADC_HandleTypeDef* hadc); +void HAL_ADCEx_LevelOutOfWindow3Callback(struct __ADC_HandleTypeDef* hadc); +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ +/** + * @} + */ + +/** @addtogroup ADCEx_Exported_Functions_Group3 ADCEx Peripheral Control functions + * @{ + */ +/* Peripheral Control functions ***********************************************/ +HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(struct __ADC_HandleTypeDef* hadc,ADC_InjectionConfTypeDef* sConfigInjected); + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(struct __ADC_HandleTypeDef *hadc, ADC_MultiModeTypeDef *multimode); +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32F3xx_ADC_H */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_can.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_can.h new file mode 100644 index 0000000..164d912 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_can.h @@ -0,0 +1,847 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_can.h + * @author MCD Application Team + * @brief Header file of CAN HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_HAL_CAN_H +#define STM32F3xx_HAL_CAN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +#if defined (CAN) +/** @addtogroup CAN + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup CAN_Exported_Types CAN Exported Types + * @{ + */ +/** + * @brief HAL State structures definition + */ +typedef enum +{ + HAL_CAN_STATE_RESET = 0x00U, /*!< CAN not yet initialized or disabled */ + HAL_CAN_STATE_READY = 0x01U, /*!< CAN initialized and ready for use */ + HAL_CAN_STATE_LISTENING = 0x02U, /*!< CAN receive process is ongoing */ + HAL_CAN_STATE_SLEEP_PENDING = 0x03U, /*!< CAN sleep request is pending */ + HAL_CAN_STATE_SLEEP_ACTIVE = 0x04U, /*!< CAN sleep mode is active */ + HAL_CAN_STATE_ERROR = 0x05U /*!< CAN error state */ + +} HAL_CAN_StateTypeDef; + +/** + * @brief CAN init structure definition + */ +typedef struct +{ + uint32_t Prescaler; /*!< Specifies the length of a time quantum. + This parameter must be a number between Min_Data = 1 and Max_Data = 1024. */ + + uint32_t Mode; /*!< Specifies the CAN operating mode. + This parameter can be a value of @ref CAN_operating_mode */ + + uint32_t SyncJumpWidth; /*!< Specifies the maximum number of time quanta the CAN hardware + is allowed to lengthen or shorten a bit to perform resynchronization. + This parameter can be a value of @ref CAN_synchronisation_jump_width */ + + uint32_t TimeSeg1; /*!< Specifies the number of time quanta in Bit Segment 1. + This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_1 */ + + uint32_t TimeSeg2; /*!< Specifies the number of time quanta in Bit Segment 2. + This parameter can be a value of @ref CAN_time_quantum_in_bit_segment_2 */ + + FunctionalState TimeTriggeredMode; /*!< Enable or disable the time triggered communication mode. + This parameter can be set to ENABLE or DISABLE. */ + + FunctionalState AutoBusOff; /*!< Enable or disable the automatic bus-off management. + This parameter can be set to ENABLE or DISABLE. */ + + FunctionalState AutoWakeUp; /*!< Enable or disable the automatic wake-up mode. + This parameter can be set to ENABLE or DISABLE. */ + + FunctionalState AutoRetransmission; /*!< Enable or disable the non-automatic retransmission mode. + This parameter can be set to ENABLE or DISABLE. */ + + FunctionalState ReceiveFifoLocked; /*!< Enable or disable the Receive FIFO Locked mode. + This parameter can be set to ENABLE or DISABLE. */ + + FunctionalState TransmitFifoPriority;/*!< Enable or disable the transmit FIFO priority. + This parameter can be set to ENABLE or DISABLE. */ + +} CAN_InitTypeDef; + +/** + * @brief CAN filter configuration structure definition + */ +typedef struct +{ + uint32_t FilterIdHigh; /*!< Specifies the filter identification number (MSBs for a 32-bit + configuration, first one for a 16-bit configuration). + This parameter must be a number between + Min_Data = 0x0000 and Max_Data = 0xFFFF. */ + + uint32_t FilterIdLow; /*!< Specifies the filter identification number (LSBs for a 32-bit + configuration, second one for a 16-bit configuration). + This parameter must be a number between + Min_Data = 0x0000 and Max_Data = 0xFFFF. */ + + uint32_t FilterMaskIdHigh; /*!< Specifies the filter mask number or identification number, + according to the mode (MSBs for a 32-bit configuration, + first one for a 16-bit configuration). + This parameter must be a number between + Min_Data = 0x0000 and Max_Data = 0xFFFF. */ + + uint32_t FilterMaskIdLow; /*!< Specifies the filter mask number or identification number, + according to the mode (LSBs for a 32-bit configuration, + second one for a 16-bit configuration). + This parameter must be a number between + Min_Data = 0x0000 and Max_Data = 0xFFFF. */ + + uint32_t FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1U) which will be assigned to the filter. + This parameter can be a value of @ref CAN_filter_FIFO */ + + uint32_t FilterBank; /*!< Specifies the filter bank which will be initialized. + This parameter mus be a number between Min_Data = 0 and Max_Data = 13. */ + + uint32_t FilterMode; /*!< Specifies the filter mode to be initialized. + This parameter can be a value of @ref CAN_filter_mode */ + + uint32_t FilterScale; /*!< Specifies the filter scale. + This parameter can be a value of @ref CAN_filter_scale */ + + uint32_t FilterActivation; /*!< Enable or disable the filter. + This parameter can be a value of @ref CAN_filter_activation */ + + uint32_t SlaveStartFilterBank; /*!< Select the start filter bank for the slave CAN instance. + STM32F3xx devices don't support slave CAN instance (dual CAN). Therefore + this parameter is meaningless but it has been kept for compatibility across + STM32 families. */ + +} CAN_FilterTypeDef; + +/** + * @brief CAN Tx message header structure definition + */ +typedef struct +{ + uint32_t StdId; /*!< Specifies the standard identifier. + This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */ + + uint32_t ExtId; /*!< Specifies the extended identifier. + This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */ + + uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted. + This parameter can be a value of @ref CAN_identifier_type */ + + uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted. + This parameter can be a value of @ref CAN_remote_transmission_request */ + + uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted. + This parameter must be a number between Min_Data = 0 and Max_Data = 8. */ + + FunctionalState TransmitGlobalTime; /*!< Specifies whether the timestamp counter value captured on start + of frame transmission, is sent in DATA6 and DATA7 replacing pData[6] and pData[7]. + @note: Time Triggered Communication Mode must be enabled. + @note: DLC must be programmed as 8 bytes, in order these 2 bytes are sent. + This parameter can be set to ENABLE or DISABLE. */ + +} CAN_TxHeaderTypeDef; + +/** + * @brief CAN Rx message header structure definition + */ +typedef struct +{ + uint32_t StdId; /*!< Specifies the standard identifier. + This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF. */ + + uint32_t ExtId; /*!< Specifies the extended identifier. + This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF. */ + + uint32_t IDE; /*!< Specifies the type of identifier for the message that will be transmitted. + This parameter can be a value of @ref CAN_identifier_type */ + + uint32_t RTR; /*!< Specifies the type of frame for the message that will be transmitted. + This parameter can be a value of @ref CAN_remote_transmission_request */ + + uint32_t DLC; /*!< Specifies the length of the frame that will be transmitted. + This parameter must be a number between Min_Data = 0 and Max_Data = 8. */ + + uint32_t Timestamp; /*!< Specifies the timestamp counter value captured on start of frame reception. + @note: Time Triggered Communication Mode must be enabled. + This parameter must be a number between Min_Data = 0 and Max_Data = 0xFFFF. */ + + uint32_t FilterMatchIndex; /*!< Specifies the index of matching acceptance filter element. + This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF. */ + +} CAN_RxHeaderTypeDef; + +/** + * @brief CAN handle Structure definition + */ +typedef struct __CAN_HandleTypeDef +{ + CAN_TypeDef *Instance; /*!< Register base address */ + + CAN_InitTypeDef Init; /*!< CAN required parameters */ + + __IO HAL_CAN_StateTypeDef State; /*!< CAN communication state */ + + __IO uint32_t ErrorCode; /*!< CAN Error code. + This parameter can be a value of @ref CAN_Error_Code */ + +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + void (* TxMailbox0CompleteCallback)(struct __CAN_HandleTypeDef *hcan);/*!< CAN Tx Mailbox 0 complete callback */ + void (* TxMailbox1CompleteCallback)(struct __CAN_HandleTypeDef *hcan);/*!< CAN Tx Mailbox 1 complete callback */ + void (* TxMailbox2CompleteCallback)(struct __CAN_HandleTypeDef *hcan);/*!< CAN Tx Mailbox 2 complete callback */ + void (* TxMailbox0AbortCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Tx Mailbox 0 abort callback */ + void (* TxMailbox1AbortCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Tx Mailbox 1 abort callback */ + void (* TxMailbox2AbortCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Tx Mailbox 2 abort callback */ + void (* RxFifo0MsgPendingCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Rx FIFO 0 msg pending callback */ + void (* RxFifo0FullCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Rx FIFO 0 full callback */ + void (* RxFifo1MsgPendingCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Rx FIFO 1 msg pending callback */ + void (* RxFifo1FullCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Rx FIFO 1 full callback */ + void (* SleepCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Sleep callback */ + void (* WakeUpFromRxMsgCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Wake Up from Rx msg callback */ + void (* ErrorCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Error callback */ + + void (* MspInitCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Msp Init callback */ + void (* MspDeInitCallback)(struct __CAN_HandleTypeDef *hcan); /*!< CAN Msp DeInit callback */ + +#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */ +} CAN_HandleTypeDef; + +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 +/** + * @brief HAL CAN common Callback ID enumeration definition + */ +typedef enum +{ + HAL_CAN_TX_MAILBOX0_COMPLETE_CB_ID = 0x00U, /*!< CAN Tx Mailbox 0 complete callback ID */ + HAL_CAN_TX_MAILBOX1_COMPLETE_CB_ID = 0x01U, /*!< CAN Tx Mailbox 1 complete callback ID */ + HAL_CAN_TX_MAILBOX2_COMPLETE_CB_ID = 0x02U, /*!< CAN Tx Mailbox 2 complete callback ID */ + HAL_CAN_TX_MAILBOX0_ABORT_CB_ID = 0x03U, /*!< CAN Tx Mailbox 0 abort callback ID */ + HAL_CAN_TX_MAILBOX1_ABORT_CB_ID = 0x04U, /*!< CAN Tx Mailbox 1 abort callback ID */ + HAL_CAN_TX_MAILBOX2_ABORT_CB_ID = 0x05U, /*!< CAN Tx Mailbox 2 abort callback ID */ + HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID = 0x06U, /*!< CAN Rx FIFO 0 message pending callback ID */ + HAL_CAN_RX_FIFO0_FULL_CB_ID = 0x07U, /*!< CAN Rx FIFO 0 full callback ID */ + HAL_CAN_RX_FIFO1_MSG_PENDING_CB_ID = 0x08U, /*!< CAN Rx FIFO 1 message pending callback ID */ + HAL_CAN_RX_FIFO1_FULL_CB_ID = 0x09U, /*!< CAN Rx FIFO 1 full callback ID */ + HAL_CAN_SLEEP_CB_ID = 0x0AU, /*!< CAN Sleep callback ID */ + HAL_CAN_WAKEUP_FROM_RX_MSG_CB_ID = 0x0BU, /*!< CAN Wake Up from Rx msg callback ID */ + HAL_CAN_ERROR_CB_ID = 0x0CU, /*!< CAN Error callback ID */ + + HAL_CAN_MSPINIT_CB_ID = 0x0DU, /*!< CAN MspInit callback ID */ + HAL_CAN_MSPDEINIT_CB_ID = 0x0EU, /*!< CAN MspDeInit callback ID */ + +} HAL_CAN_CallbackIDTypeDef; + +/** + * @brief HAL CAN Callback pointer definition + */ +typedef void (*pCAN_CallbackTypeDef)(CAN_HandleTypeDef *hcan); /*!< pointer to a CAN callback function */ + +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ + +/** @defgroup CAN_Exported_Constants CAN Exported Constants + * @{ + */ + +/** @defgroup CAN_Error_Code CAN Error Code + * @{ + */ +#define HAL_CAN_ERROR_NONE (0x00000000U) /*!< No error */ +#define HAL_CAN_ERROR_EWG (0x00000001U) /*!< Protocol Error Warning */ +#define HAL_CAN_ERROR_EPV (0x00000002U) /*!< Error Passive */ +#define HAL_CAN_ERROR_BOF (0x00000004U) /*!< Bus-off error */ +#define HAL_CAN_ERROR_STF (0x00000008U) /*!< Stuff error */ +#define HAL_CAN_ERROR_FOR (0x00000010U) /*!< Form error */ +#define HAL_CAN_ERROR_ACK (0x00000020U) /*!< Acknowledgment error */ +#define HAL_CAN_ERROR_BR (0x00000040U) /*!< Bit recessive error */ +#define HAL_CAN_ERROR_BD (0x00000080U) /*!< Bit dominant error */ +#define HAL_CAN_ERROR_CRC (0x00000100U) /*!< CRC error */ +#define HAL_CAN_ERROR_RX_FOV0 (0x00000200U) /*!< Rx FIFO0 overrun error */ +#define HAL_CAN_ERROR_RX_FOV1 (0x00000400U) /*!< Rx FIFO1 overrun error */ +#define HAL_CAN_ERROR_TX_ALST0 (0x00000800U) /*!< TxMailbox 0 transmit failure due to arbitration lost */ +#define HAL_CAN_ERROR_TX_TERR0 (0x00001000U) /*!< TxMailbox 0 transmit failure due to transmit error */ +#define HAL_CAN_ERROR_TX_ALST1 (0x00002000U) /*!< TxMailbox 1 transmit failure due to arbitration lost */ +#define HAL_CAN_ERROR_TX_TERR1 (0x00004000U) /*!< TxMailbox 1 transmit failure due to transmit error */ +#define HAL_CAN_ERROR_TX_ALST2 (0x00008000U) /*!< TxMailbox 2 transmit failure due to arbitration lost */ +#define HAL_CAN_ERROR_TX_TERR2 (0x00010000U) /*!< TxMailbox 2 transmit failure due to transmit error */ +#define HAL_CAN_ERROR_TIMEOUT (0x00020000U) /*!< Timeout error */ +#define HAL_CAN_ERROR_NOT_INITIALIZED (0x00040000U) /*!< Peripheral not initialized */ +#define HAL_CAN_ERROR_NOT_READY (0x00080000U) /*!< Peripheral not ready */ +#define HAL_CAN_ERROR_NOT_STARTED (0x00100000U) /*!< Peripheral not started */ +#define HAL_CAN_ERROR_PARAM (0x00200000U) /*!< Parameter error */ + +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 +#define HAL_CAN_ERROR_INVALID_CALLBACK (0x00400000U) /*!< Invalid Callback error */ +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ +#define HAL_CAN_ERROR_INTERNAL (0x00800000U) /*!< Internal error */ + +/** + * @} + */ + +/** @defgroup CAN_InitStatus CAN InitStatus + * @{ + */ +#define CAN_INITSTATUS_FAILED (0x00000000U) /*!< CAN initialization failed */ +#define CAN_INITSTATUS_SUCCESS (0x00000001U) /*!< CAN initialization OK */ +/** + * @} + */ + +/** @defgroup CAN_operating_mode CAN Operating Mode + * @{ + */ +#define CAN_MODE_NORMAL (0x00000000U) /*!< Normal mode */ +#define CAN_MODE_LOOPBACK ((uint32_t)CAN_BTR_LBKM) /*!< Loopback mode */ +#define CAN_MODE_SILENT ((uint32_t)CAN_BTR_SILM) /*!< Silent mode */ +#define CAN_MODE_SILENT_LOOPBACK ((uint32_t)(CAN_BTR_LBKM | CAN_BTR_SILM)) /*!< Loopback combined with + silent mode */ +/** + * @} + */ + + +/** @defgroup CAN_synchronisation_jump_width CAN Synchronization Jump Width + * @{ + */ +#define CAN_SJW_1TQ (0x00000000U) /*!< 1 time quantum */ +#define CAN_SJW_2TQ ((uint32_t)CAN_BTR_SJW_0) /*!< 2 time quantum */ +#define CAN_SJW_3TQ ((uint32_t)CAN_BTR_SJW_1) /*!< 3 time quantum */ +#define CAN_SJW_4TQ ((uint32_t)CAN_BTR_SJW) /*!< 4 time quantum */ +/** + * @} + */ + +/** @defgroup CAN_time_quantum_in_bit_segment_1 CAN Time Quantum in Bit Segment 1 + * @{ + */ +#define CAN_BS1_1TQ (0x00000000U) /*!< 1 time quantum */ +#define CAN_BS1_2TQ ((uint32_t)CAN_BTR_TS1_0) /*!< 2 time quantum */ +#define CAN_BS1_3TQ ((uint32_t)CAN_BTR_TS1_1) /*!< 3 time quantum */ +#define CAN_BS1_4TQ ((uint32_t)(CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 4 time quantum */ +#define CAN_BS1_5TQ ((uint32_t)CAN_BTR_TS1_2) /*!< 5 time quantum */ +#define CAN_BS1_6TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 6 time quantum */ +#define CAN_BS1_7TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 7 time quantum */ +#define CAN_BS1_8TQ ((uint32_t)(CAN_BTR_TS1_2 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 8 time quantum */ +#define CAN_BS1_9TQ ((uint32_t)CAN_BTR_TS1_3) /*!< 9 time quantum */ +#define CAN_BS1_10TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_0)) /*!< 10 time quantum */ +#define CAN_BS1_11TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1)) /*!< 11 time quantum */ +#define CAN_BS1_12TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_1 | CAN_BTR_TS1_0)) /*!< 12 time quantum */ +#define CAN_BS1_13TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2)) /*!< 13 time quantum */ +#define CAN_BS1_14TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_0)) /*!< 14 time quantum */ +#define CAN_BS1_15TQ ((uint32_t)(CAN_BTR_TS1_3 | CAN_BTR_TS1_2 | CAN_BTR_TS1_1)) /*!< 15 time quantum */ +#define CAN_BS1_16TQ ((uint32_t)CAN_BTR_TS1) /*!< 16 time quantum */ +/** + * @} + */ + +/** @defgroup CAN_time_quantum_in_bit_segment_2 CAN Time Quantum in Bit Segment 2 + * @{ + */ +#define CAN_BS2_1TQ (0x00000000U) /*!< 1 time quantum */ +#define CAN_BS2_2TQ ((uint32_t)CAN_BTR_TS2_0) /*!< 2 time quantum */ +#define CAN_BS2_3TQ ((uint32_t)CAN_BTR_TS2_1) /*!< 3 time quantum */ +#define CAN_BS2_4TQ ((uint32_t)(CAN_BTR_TS2_1 | CAN_BTR_TS2_0)) /*!< 4 time quantum */ +#define CAN_BS2_5TQ ((uint32_t)CAN_BTR_TS2_2) /*!< 5 time quantum */ +#define CAN_BS2_6TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_0)) /*!< 6 time quantum */ +#define CAN_BS2_7TQ ((uint32_t)(CAN_BTR_TS2_2 | CAN_BTR_TS2_1)) /*!< 7 time quantum */ +#define CAN_BS2_8TQ ((uint32_t)CAN_BTR_TS2) /*!< 8 time quantum */ +/** + * @} + */ + +/** @defgroup CAN_filter_mode CAN Filter Mode + * @{ + */ +#define CAN_FILTERMODE_IDMASK (0x00000000U) /*!< Identifier mask mode */ +#define CAN_FILTERMODE_IDLIST (0x00000001U) /*!< Identifier list mode */ +/** + * @} + */ + +/** @defgroup CAN_filter_scale CAN Filter Scale + * @{ + */ +#define CAN_FILTERSCALE_16BIT (0x00000000U) /*!< Two 16-bit filters */ +#define CAN_FILTERSCALE_32BIT (0x00000001U) /*!< One 32-bit filter */ +/** + * @} + */ + +/** @defgroup CAN_filter_activation CAN Filter Activation + * @{ + */ +#define CAN_FILTER_DISABLE (0x00000000U) /*!< Disable filter */ +#define CAN_FILTER_ENABLE (0x00000001U) /*!< Enable filter */ +/** + * @} + */ + +/** @defgroup CAN_filter_FIFO CAN Filter FIFO + * @{ + */ +#define CAN_FILTER_FIFO0 (0x00000000U) /*!< Filter FIFO 0 assignment for filter x */ +#define CAN_FILTER_FIFO1 (0x00000001U) /*!< Filter FIFO 1 assignment for filter x */ +/** + * @} + */ + +/** @defgroup CAN_identifier_type CAN Identifier Type + * @{ + */ +#define CAN_ID_STD (0x00000000U) /*!< Standard Id */ +#define CAN_ID_EXT (0x00000004U) /*!< Extended Id */ +/** + * @} + */ + +/** @defgroup CAN_remote_transmission_request CAN Remote Transmission Request + * @{ + */ +#define CAN_RTR_DATA (0x00000000U) /*!< Data frame */ +#define CAN_RTR_REMOTE (0x00000002U) /*!< Remote frame */ +/** + * @} + */ + +/** @defgroup CAN_receive_FIFO_number CAN Receive FIFO Number + * @{ + */ +#define CAN_RX_FIFO0 (0x00000000U) /*!< CAN receive FIFO 0 */ +#define CAN_RX_FIFO1 (0x00000001U) /*!< CAN receive FIFO 1 */ +/** + * @} + */ + +/** @defgroup CAN_Tx_Mailboxes CAN Tx Mailboxes + * @{ + */ +#define CAN_TX_MAILBOX0 (0x00000001U) /*!< Tx Mailbox 0 */ +#define CAN_TX_MAILBOX1 (0x00000002U) /*!< Tx Mailbox 1 */ +#define CAN_TX_MAILBOX2 (0x00000004U) /*!< Tx Mailbox 2 */ +/** + * @} + */ + +/** @defgroup CAN_flags CAN Flags + * @{ + */ +/* Transmit Flags */ +#define CAN_FLAG_RQCP0 (0x00000500U) /*!< Request complete MailBox 0 flag */ +#define CAN_FLAG_TXOK0 (0x00000501U) /*!< Transmission OK MailBox 0 flag */ +#define CAN_FLAG_ALST0 (0x00000502U) /*!< Arbitration Lost MailBox 0 flag */ +#define CAN_FLAG_TERR0 (0x00000503U) /*!< Transmission error MailBox 0 flag */ +#define CAN_FLAG_RQCP1 (0x00000508U) /*!< Request complete MailBox1 flag */ +#define CAN_FLAG_TXOK1 (0x00000509U) /*!< Transmission OK MailBox 1 flag */ +#define CAN_FLAG_ALST1 (0x0000050AU) /*!< Arbitration Lost MailBox 1 flag */ +#define CAN_FLAG_TERR1 (0x0000050BU) /*!< Transmission error MailBox 1 flag */ +#define CAN_FLAG_RQCP2 (0x00000510U) /*!< Request complete MailBox2 flag */ +#define CAN_FLAG_TXOK2 (0x00000511U) /*!< Transmission OK MailBox 2 flag */ +#define CAN_FLAG_ALST2 (0x00000512U) /*!< Arbitration Lost MailBox 2 flag */ +#define CAN_FLAG_TERR2 (0x00000513U) /*!< Transmission error MailBox 2 flag */ +#define CAN_FLAG_TME0 (0x0000051AU) /*!< Transmit mailbox 0 empty flag */ +#define CAN_FLAG_TME1 (0x0000051BU) /*!< Transmit mailbox 1 empty flag */ +#define CAN_FLAG_TME2 (0x0000051CU) /*!< Transmit mailbox 2 empty flag */ +#define CAN_FLAG_LOW0 (0x0000051DU) /*!< Lowest priority mailbox 0 flag */ +#define CAN_FLAG_LOW1 (0x0000051EU) /*!< Lowest priority mailbox 1 flag */ +#define CAN_FLAG_LOW2 (0x0000051FU) /*!< Lowest priority mailbox 2 flag */ + +/* Receive Flags */ +#define CAN_FLAG_FF0 (0x00000203U) /*!< RX FIFO 0 Full flag */ +#define CAN_FLAG_FOV0 (0x00000204U) /*!< RX FIFO 0 Overrun flag */ +#define CAN_FLAG_FF1 (0x00000403U) /*!< RX FIFO 1 Full flag */ +#define CAN_FLAG_FOV1 (0x00000404U) /*!< RX FIFO 1 Overrun flag */ + +/* Operating Mode Flags */ +#define CAN_FLAG_INAK (0x00000100U) /*!< Initialization acknowledge flag */ +#define CAN_FLAG_SLAK (0x00000101U) /*!< Sleep acknowledge flag */ +#define CAN_FLAG_ERRI (0x00000102U) /*!< Error flag */ +#define CAN_FLAG_WKU (0x00000103U) /*!< Wake up interrupt flag */ +#define CAN_FLAG_SLAKI (0x00000104U) /*!< Sleep acknowledge interrupt flag */ + +/* Error Flags */ +#define CAN_FLAG_EWG (0x00000300U) /*!< Error warning flag */ +#define CAN_FLAG_EPV (0x00000301U) /*!< Error passive flag */ +#define CAN_FLAG_BOF (0x00000302U) /*!< Bus-Off flag */ +/** + * @} + */ + + +/** @defgroup CAN_Interrupts CAN Interrupts + * @{ + */ +/* Transmit Interrupt */ +#define CAN_IT_TX_MAILBOX_EMPTY ((uint32_t)CAN_IER_TMEIE) /*!< Transmit mailbox empty interrupt */ + +/* Receive Interrupts */ +#define CAN_IT_RX_FIFO0_MSG_PENDING ((uint32_t)CAN_IER_FMPIE0) /*!< FIFO 0 message pending interrupt */ +#define CAN_IT_RX_FIFO0_FULL ((uint32_t)CAN_IER_FFIE0) /*!< FIFO 0 full interrupt */ +#define CAN_IT_RX_FIFO0_OVERRUN ((uint32_t)CAN_IER_FOVIE0) /*!< FIFO 0 overrun interrupt */ +#define CAN_IT_RX_FIFO1_MSG_PENDING ((uint32_t)CAN_IER_FMPIE1) /*!< FIFO 1 message pending interrupt */ +#define CAN_IT_RX_FIFO1_FULL ((uint32_t)CAN_IER_FFIE1) /*!< FIFO 1 full interrupt */ +#define CAN_IT_RX_FIFO1_OVERRUN ((uint32_t)CAN_IER_FOVIE1) /*!< FIFO 1 overrun interrupt */ + +/* Operating Mode Interrupts */ +#define CAN_IT_WAKEUP ((uint32_t)CAN_IER_WKUIE) /*!< Wake-up interrupt */ +#define CAN_IT_SLEEP_ACK ((uint32_t)CAN_IER_SLKIE) /*!< Sleep acknowledge interrupt */ + +/* Error Interrupts */ +#define CAN_IT_ERROR_WARNING ((uint32_t)CAN_IER_EWGIE) /*!< Error warning interrupt */ +#define CAN_IT_ERROR_PASSIVE ((uint32_t)CAN_IER_EPVIE) /*!< Error passive interrupt */ +#define CAN_IT_BUSOFF ((uint32_t)CAN_IER_BOFIE) /*!< Bus-off interrupt */ +#define CAN_IT_LAST_ERROR_CODE ((uint32_t)CAN_IER_LECIE) /*!< Last error code interrupt */ +#define CAN_IT_ERROR ((uint32_t)CAN_IER_ERRIE) /*!< Error Interrupt */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macros -----------------------------------------------------------*/ +/** @defgroup CAN_Exported_Macros CAN Exported Macros + * @{ + */ + +/** @brief Reset CAN handle state + * @param __HANDLE__ CAN handle. + * @retval None + */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 +#define __HAL_CAN_RESET_HANDLE_STATE(__HANDLE__) do{ \ + (__HANDLE__)->State = HAL_CAN_STATE_RESET; \ + (__HANDLE__)->MspInitCallback = NULL; \ + (__HANDLE__)->MspDeInitCallback = NULL; \ + } while(0) +#else +#define __HAL_CAN_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CAN_STATE_RESET) +#endif /*USE_HAL_CAN_REGISTER_CALLBACKS */ + +/** + * @brief Enable the specified CAN interrupts. + * @param __HANDLE__ CAN handle. + * @param __INTERRUPT__ CAN Interrupt sources to enable. + * This parameter can be any combination of @arg CAN_Interrupts + * @retval None + */ +#define __HAL_CAN_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) |= (__INTERRUPT__)) + +/** + * @brief Disable the specified CAN interrupts. + * @param __HANDLE__ CAN handle. + * @param __INTERRUPT__ CAN Interrupt sources to disable. + * This parameter can be any combination of @arg CAN_Interrupts + * @retval None + */ +#define __HAL_CAN_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) &= ~(__INTERRUPT__)) + +/** @brief Check if the specified CAN interrupt source is enabled or disabled. + * @param __HANDLE__ specifies the CAN Handle. + * @param __INTERRUPT__ specifies the CAN interrupt source to check. + * This parameter can be a value of @arg CAN_Interrupts + * @retval The state of __IT__ (TRUE or FALSE). + */ +#define __HAL_CAN_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->IER) & (__INTERRUPT__)) + +/** @brief Check whether the specified CAN flag is set or not. + * @param __HANDLE__ specifies the CAN Handle. + * @param __FLAG__ specifies the flag to check. + * This parameter can be one of @arg CAN_flags + * @retval The state of __FLAG__ (TRUE or FALSE). + */ +#define __HAL_CAN_GET_FLAG(__HANDLE__, __FLAG__) \ + ((((__FLAG__) >> 8U) == 5U)? ((((__HANDLE__)->Instance->TSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ + (((__FLAG__) >> 8U) == 2U)? ((((__HANDLE__)->Instance->RF0R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ + (((__FLAG__) >> 8U) == 4U)? ((((__HANDLE__)->Instance->RF1R) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ + (((__FLAG__) >> 8U) == 1U)? ((((__HANDLE__)->Instance->MSR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ + (((__FLAG__) >> 8U) == 3U)? ((((__HANDLE__)->Instance->ESR) & (1U << ((__FLAG__) & CAN_FLAG_MASK))) == (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U) + +/** @brief Clear the specified CAN pending flag. + * @param __HANDLE__ specifies the CAN Handle. + * @param __FLAG__ specifies the flag to check. + * This parameter can be one of the following values: + * @arg CAN_FLAG_RQCP0: Request complete MailBox 0 Flag + * @arg CAN_FLAG_TXOK0: Transmission OK MailBox 0 Flag + * @arg CAN_FLAG_ALST0: Arbitration Lost MailBox 0 Flag + * @arg CAN_FLAG_TERR0: Transmission error MailBox 0 Flag + * @arg CAN_FLAG_RQCP1: Request complete MailBox 1 Flag + * @arg CAN_FLAG_TXOK1: Transmission OK MailBox 1 Flag + * @arg CAN_FLAG_ALST1: Arbitration Lost MailBox 1 Flag + * @arg CAN_FLAG_TERR1: Transmission error MailBox 1 Flag + * @arg CAN_FLAG_RQCP2: Request complete MailBox 2 Flag + * @arg CAN_FLAG_TXOK2: Transmission OK MailBox 2 Flag + * @arg CAN_FLAG_ALST2: Arbitration Lost MailBox 2 Flag + * @arg CAN_FLAG_TERR2: Transmission error MailBox 2 Flag + * @arg CAN_FLAG_FF0: RX FIFO 0 Full Flag + * @arg CAN_FLAG_FOV0: RX FIFO 0 Overrun Flag + * @arg CAN_FLAG_FF1: RX FIFO 1 Full Flag + * @arg CAN_FLAG_FOV1: RX FIFO 1 Overrun Flag + * @arg CAN_FLAG_WKUI: Wake up Interrupt Flag + * @arg CAN_FLAG_SLAKI: Sleep acknowledge Interrupt Flag + * @retval None + */ +#define __HAL_CAN_CLEAR_FLAG(__HANDLE__, __FLAG__) \ + ((((__FLAG__) >> 8U) == 5U)? (((__HANDLE__)->Instance->TSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ + (((__FLAG__) >> 8U) == 2U)? (((__HANDLE__)->Instance->RF0R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ + (((__FLAG__) >> 8U) == 4U)? (((__HANDLE__)->Instance->RF1R) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): \ + (((__FLAG__) >> 8U) == 1U)? (((__HANDLE__)->Instance->MSR) = (1U << ((__FLAG__) & CAN_FLAG_MASK))): 0U) + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup CAN_Exported_Functions CAN Exported Functions + * @{ + */ + +/** @addtogroup CAN_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * @{ + */ + +/* Initialization and de-initialization functions *****************************/ +HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef *hcan); +HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef *hcan); +void HAL_CAN_MspInit(CAN_HandleTypeDef *hcan); +void HAL_CAN_MspDeInit(CAN_HandleTypeDef *hcan); + +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 +/* Callbacks Register/UnRegister functions ***********************************/ +HAL_StatusTypeDef HAL_CAN_RegisterCallback(CAN_HandleTypeDef *hcan, HAL_CAN_CallbackIDTypeDef CallbackID, + void (* pCallback)(CAN_HandleTypeDef *_hcan)); +HAL_StatusTypeDef HAL_CAN_UnRegisterCallback(CAN_HandleTypeDef *hcan, HAL_CAN_CallbackIDTypeDef CallbackID); + +#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */ +/** + * @} + */ + +/** @addtogroup CAN_Exported_Functions_Group2 Configuration functions + * @brief Configuration functions + * @{ + */ + +/* Configuration functions ****************************************************/ +HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef *hcan, const CAN_FilterTypeDef *sFilterConfig); + +/** + * @} + */ + +/** @addtogroup CAN_Exported_Functions_Group3 Control functions + * @brief Control functions + * @{ + */ + +/* Control functions **********************************************************/ +HAL_StatusTypeDef HAL_CAN_Start(CAN_HandleTypeDef *hcan); +HAL_StatusTypeDef HAL_CAN_Stop(CAN_HandleTypeDef *hcan); +HAL_StatusTypeDef HAL_CAN_RequestSleep(CAN_HandleTypeDef *hcan); +HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan); +uint32_t HAL_CAN_IsSleepActive(const CAN_HandleTypeDef *hcan); +HAL_StatusTypeDef HAL_CAN_AddTxMessage(CAN_HandleTypeDef *hcan, const CAN_TxHeaderTypeDef *pHeader, + const uint8_t aData[], uint32_t *pTxMailbox); +HAL_StatusTypeDef HAL_CAN_AbortTxRequest(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes); +uint32_t HAL_CAN_GetTxMailboxesFreeLevel(const CAN_HandleTypeDef *hcan); +uint32_t HAL_CAN_IsTxMessagePending(const CAN_HandleTypeDef *hcan, uint32_t TxMailboxes); +uint32_t HAL_CAN_GetTxTimestamp(const CAN_HandleTypeDef *hcan, uint32_t TxMailbox); +HAL_StatusTypeDef HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo, + CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]); +uint32_t HAL_CAN_GetRxFifoFillLevel(const CAN_HandleTypeDef *hcan, uint32_t RxFifo); + +/** + * @} + */ + +/** @addtogroup CAN_Exported_Functions_Group4 Interrupts management + * @brief Interrupts management + * @{ + */ +/* Interrupts management ******************************************************/ +HAL_StatusTypeDef HAL_CAN_ActivateNotification(CAN_HandleTypeDef *hcan, uint32_t ActiveITs); +HAL_StatusTypeDef HAL_CAN_DeactivateNotification(CAN_HandleTypeDef *hcan, uint32_t InactiveITs); +void HAL_CAN_IRQHandler(CAN_HandleTypeDef *hcan); + +/** + * @} + */ + +/** @addtogroup CAN_Exported_Functions_Group5 Callback functions + * @brief Callback functions + * @{ + */ +/* Callbacks functions ********************************************************/ + +void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_TxMailbox0AbortCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_TxMailbox1AbortCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_TxMailbox2AbortCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_RxFifo0FullCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_SleepCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_WakeUpFromRxMsgCallback(CAN_HandleTypeDef *hcan); +void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan); + +/** + * @} + */ + +/** @addtogroup CAN_Exported_Functions_Group6 Peripheral State and Error functions + * @brief CAN Peripheral State functions + * @{ + */ +/* Peripheral State and Error functions ***************************************/ +HAL_CAN_StateTypeDef HAL_CAN_GetState(const CAN_HandleTypeDef *hcan); +uint32_t HAL_CAN_GetError(const CAN_HandleTypeDef *hcan); +HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan); + +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/** @defgroup CAN_Private_Types CAN Private Types + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup CAN_Private_Variables CAN Private Variables + * @{ + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup CAN_Private_Constants CAN Private Constants + * @{ + */ +#define CAN_FLAG_MASK (0x000000FFU) +/** + * @} + */ + +/* Private Macros -----------------------------------------------------------*/ +/** @defgroup CAN_Private_Macros CAN Private Macros + * @{ + */ + +#define IS_CAN_MODE(MODE) (((MODE) == CAN_MODE_NORMAL) || \ + ((MODE) == CAN_MODE_LOOPBACK)|| \ + ((MODE) == CAN_MODE_SILENT) || \ + ((MODE) == CAN_MODE_SILENT_LOOPBACK)) +#define IS_CAN_SJW(SJW) (((SJW) == CAN_SJW_1TQ) || ((SJW) == CAN_SJW_2TQ) || \ + ((SJW) == CAN_SJW_3TQ) || ((SJW) == CAN_SJW_4TQ)) +#define IS_CAN_BS1(BS1) (((BS1) == CAN_BS1_1TQ) || ((BS1) == CAN_BS1_2TQ) || \ + ((BS1) == CAN_BS1_3TQ) || ((BS1) == CAN_BS1_4TQ) || \ + ((BS1) == CAN_BS1_5TQ) || ((BS1) == CAN_BS1_6TQ) || \ + ((BS1) == CAN_BS1_7TQ) || ((BS1) == CAN_BS1_8TQ) || \ + ((BS1) == CAN_BS1_9TQ) || ((BS1) == CAN_BS1_10TQ)|| \ + ((BS1) == CAN_BS1_11TQ)|| ((BS1) == CAN_BS1_12TQ)|| \ + ((BS1) == CAN_BS1_13TQ)|| ((BS1) == CAN_BS1_14TQ)|| \ + ((BS1) == CAN_BS1_15TQ)|| ((BS1) == CAN_BS1_16TQ)) +#define IS_CAN_BS2(BS2) (((BS2) == CAN_BS2_1TQ) || ((BS2) == CAN_BS2_2TQ) || \ + ((BS2) == CAN_BS2_3TQ) || ((BS2) == CAN_BS2_4TQ) || \ + ((BS2) == CAN_BS2_5TQ) || ((BS2) == CAN_BS2_6TQ) || \ + ((BS2) == CAN_BS2_7TQ) || ((BS2) == CAN_BS2_8TQ)) +#define IS_CAN_PRESCALER(PRESCALER) (((PRESCALER) >= 1U) && ((PRESCALER) <= 1024U)) +#define IS_CAN_FILTER_ID_HALFWORD(HALFWORD) ((HALFWORD) <= 0xFFFFU) +#define IS_CAN_FILTER_BANK_SINGLE(BANK) ((BANK) <= 13U) +#define IS_CAN_FILTER_MODE(MODE) (((MODE) == CAN_FILTERMODE_IDMASK) || \ + ((MODE) == CAN_FILTERMODE_IDLIST)) +#define IS_CAN_FILTER_SCALE(SCALE) (((SCALE) == CAN_FILTERSCALE_16BIT) || \ + ((SCALE) == CAN_FILTERSCALE_32BIT)) +#define IS_CAN_FILTER_ACTIVATION(ACTIVATION) (((ACTIVATION) == CAN_FILTER_DISABLE) || \ + ((ACTIVATION) == CAN_FILTER_ENABLE)) +#define IS_CAN_FILTER_FIFO(FIFO) (((FIFO) == CAN_FILTER_FIFO0) || \ + ((FIFO) == CAN_FILTER_FIFO1)) +#define IS_CAN_TX_MAILBOX(TRANSMITMAILBOX) (((TRANSMITMAILBOX) == CAN_TX_MAILBOX0 ) || \ + ((TRANSMITMAILBOX) == CAN_TX_MAILBOX1 ) || \ + ((TRANSMITMAILBOX) == CAN_TX_MAILBOX2 )) +#define IS_CAN_TX_MAILBOX_LIST(TRANSMITMAILBOX) ((TRANSMITMAILBOX) <= (CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | \ + CAN_TX_MAILBOX2)) +#define IS_CAN_STDID(STDID) ((STDID) <= 0x7FFU) +#define IS_CAN_EXTID(EXTID) ((EXTID) <= 0x1FFFFFFFU) +#define IS_CAN_DLC(DLC) ((DLC) <= 8U) +#define IS_CAN_IDTYPE(IDTYPE) (((IDTYPE) == CAN_ID_STD) || \ + ((IDTYPE) == CAN_ID_EXT)) +#define IS_CAN_RTR(RTR) (((RTR) == CAN_RTR_DATA) || ((RTR) == CAN_RTR_REMOTE)) +#define IS_CAN_RX_FIFO(FIFO) (((FIFO) == CAN_RX_FIFO0) || ((FIFO) == CAN_RX_FIFO1)) +#define IS_CAN_IT(IT) ((IT) <= (CAN_IT_TX_MAILBOX_EMPTY | CAN_IT_RX_FIFO0_MSG_PENDING | \ + CAN_IT_RX_FIFO0_FULL | CAN_IT_RX_FIFO0_OVERRUN | \ + CAN_IT_RX_FIFO1_MSG_PENDING | CAN_IT_RX_FIFO1_FULL | \ + CAN_IT_RX_FIFO1_OVERRUN | CAN_IT_WAKEUP | \ + CAN_IT_SLEEP_ACK | CAN_IT_ERROR_WARNING | \ + CAN_IT_ERROR_PASSIVE | CAN_IT_BUSOFF | \ + CAN_IT_LAST_ERROR_CODE | CAN_IT_ERROR)) + +/** + * @} + */ +/* End of private macros -----------------------------------------------------*/ + +/** + * @} + */ + + +#endif /* CAN */ +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32F3xx_HAL_CAN_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h new file mode 100644 index 0000000..1350620 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h @@ -0,0 +1,424 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_cortex.h + * @author MCD Application Team + * @brief Header file of CORTEX HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_CORTEX_H +#define __STM32F3xx_HAL_CORTEX_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup CORTEX + * @{ + */ +/* Exported types ------------------------------------------------------------*/ +/** @defgroup CORTEX_Exported_Types CORTEX Exported Types + * @{ + */ + +#if (__MPU_PRESENT == 1U) +/** @defgroup CORTEX_MPU_Region_Initialization_Structure_definition MPU Region Initialization Structure Definition + * @brief MPU Region initialization structure + * @{ + */ +typedef struct +{ + uint8_t Enable; /*!< Specifies the status of the region. + This parameter can be a value of @ref CORTEX_MPU_Region_Enable */ + uint8_t Number; /*!< Specifies the number of the region to protect. + This parameter can be a value of @ref CORTEX_MPU_Region_Number */ + uint32_t BaseAddress; /*!< Specifies the base address of the region to protect. */ + uint8_t Size; /*!< Specifies the size of the region to protect. + This parameter can be a value of @ref CORTEX_MPU_Region_Size */ + uint8_t SubRegionDisable; /*!< Specifies the number of the subregion protection to disable. + This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF */ + uint8_t TypeExtField; /*!< Specifies the TEX field level. + This parameter can be a value of @ref CORTEX_MPU_TEX_Levels */ + uint8_t AccessPermission; /*!< Specifies the region access permission type. + This parameter can be a value of @ref CORTEX_MPU_Region_Permission_Attributes */ + uint8_t DisableExec; /*!< Specifies the instruction access status. + This parameter can be a value of @ref CORTEX_MPU_Instruction_Access */ + uint8_t IsShareable; /*!< Specifies the shareability status of the protected region. + This parameter can be a value of @ref CORTEX_MPU_Access_Shareable */ + uint8_t IsCacheable; /*!< Specifies the cacheable status of the region protected. + This parameter can be a value of @ref CORTEX_MPU_Access_Cacheable */ + uint8_t IsBufferable; /*!< Specifies the bufferable status of the protected region. + This parameter can be a value of @ref CORTEX_MPU_Access_Bufferable */ +}MPU_Region_InitTypeDef; +/** + * @} + */ +#endif /* __MPU_PRESENT */ + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ + +/** @defgroup CORTEX_Exported_Constants CORTEX Exported Constants + * @{ + */ + +/** @defgroup CORTEX_Preemption_Priority_Group CORTEX Preemption Priority Group + * @{ + */ +#define NVIC_PRIORITYGROUP_0 (0x00000007U) /*!< 0 bits for pre-emption priority + 4 bits for subpriority */ +#define NVIC_PRIORITYGROUP_1 (0x00000006U) /*!< 1 bits for pre-emption priority + 3 bits for subpriority */ +#define NVIC_PRIORITYGROUP_2 (0x00000005U) /*!< 2 bits for pre-emption priority + 2 bits for subpriority */ +#define NVIC_PRIORITYGROUP_3 (0x00000004U) /*!< 3 bits for pre-emption priority + 1 bits for subpriority */ +#define NVIC_PRIORITYGROUP_4 (0x00000003U) /*!< 4 bits for pre-emption priority + 0 bits for subpriority */ +/** + * @} + */ + +/** @defgroup CORTEX_SysTick_clock_source CORTEX SysTick clock source + * @{ + */ +#define SYSTICK_CLKSOURCE_HCLK_DIV8 (0x00000000U) +#define SYSTICK_CLKSOURCE_HCLK (0x00000004U) +/** + * @} + */ + +#if (__MPU_PRESENT == 1U) +/** @defgroup CORTEX_MPU_HFNMI_PRIVDEF_Control MPU HFNMI and PRIVILEGED Access control + * @{ + */ +#define MPU_HFNMI_PRIVDEF_NONE (0x00000000U) +#define MPU_HARDFAULT_NMI (0x00000002U) +#define MPU_PRIVILEGED_DEFAULT (0x00000004U) +#define MPU_HFNMI_PRIVDEF (0x00000006U) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_Region_Enable CORTEX MPU Region Enable + * @{ + */ +#define MPU_REGION_ENABLE ((uint8_t)0x01U) +#define MPU_REGION_DISABLE ((uint8_t)0x00U) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_Instruction_Access CORTEX MPU Instruction Access + * @{ + */ +#define MPU_INSTRUCTION_ACCESS_ENABLE ((uint8_t)0x00U) +#define MPU_INSTRUCTION_ACCESS_DISABLE ((uint8_t)0x01U) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_Access_Shareable CORTEX MPU Instruction Access Shareable + * @{ + */ +#define MPU_ACCESS_SHAREABLE ((uint8_t)0x01U) +#define MPU_ACCESS_NOT_SHAREABLE ((uint8_t)0x00U) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_Access_Cacheable CORTEX MPU Instruction Access Cacheable + * @{ + */ +#define MPU_ACCESS_CACHEABLE ((uint8_t)0x01U) +#define MPU_ACCESS_NOT_CACHEABLE ((uint8_t)0x00U) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_Access_Bufferable CORTEX MPU Instruction Access Bufferable + * @{ + */ +#define MPU_ACCESS_BUFFERABLE ((uint8_t)0x01U) +#define MPU_ACCESS_NOT_BUFFERABLE ((uint8_t)0x00U) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_TEX_Levels MPU TEX Levels + * @{ + */ +#define MPU_TEX_LEVEL0 ((uint8_t)0x00U) +#define MPU_TEX_LEVEL1 ((uint8_t)0x01U) +#define MPU_TEX_LEVEL2 ((uint8_t)0x02U) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_Region_Size CORTEX MPU Region Size + * @{ + */ +#define MPU_REGION_SIZE_32B ((uint8_t)0x04U) +#define MPU_REGION_SIZE_64B ((uint8_t)0x05U) +#define MPU_REGION_SIZE_128B ((uint8_t)0x06U) +#define MPU_REGION_SIZE_256B ((uint8_t)0x07U) +#define MPU_REGION_SIZE_512B ((uint8_t)0x08U) +#define MPU_REGION_SIZE_1KB ((uint8_t)0x09U) +#define MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) +#define MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) +#define MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) +#define MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) +#define MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) +#define MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) +#define MPU_REGION_SIZE_128KB ((uint8_t)0x10U) +#define MPU_REGION_SIZE_256KB ((uint8_t)0x11U) +#define MPU_REGION_SIZE_512KB ((uint8_t)0x12U) +#define MPU_REGION_SIZE_1MB ((uint8_t)0x13U) +#define MPU_REGION_SIZE_2MB ((uint8_t)0x14U) +#define MPU_REGION_SIZE_4MB ((uint8_t)0x15U) +#define MPU_REGION_SIZE_8MB ((uint8_t)0x16U) +#define MPU_REGION_SIZE_16MB ((uint8_t)0x17U) +#define MPU_REGION_SIZE_32MB ((uint8_t)0x18U) +#define MPU_REGION_SIZE_64MB ((uint8_t)0x19U) +#define MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) +#define MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) +#define MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) +#define MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) +#define MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) +#define MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_Region_Permission_Attributes CORTEX MPU Region Permission Attributes + * @{ + */ +#define MPU_REGION_NO_ACCESS ((uint8_t)0x00U) +#define MPU_REGION_PRIV_RW ((uint8_t)0x01U) +#define MPU_REGION_PRIV_RW_URO ((uint8_t)0x02U) +#define MPU_REGION_FULL_ACCESS ((uint8_t)0x03U) +#define MPU_REGION_PRIV_RO ((uint8_t)0x05U) +#define MPU_REGION_PRIV_RO_URO ((uint8_t)0x06U) +/** + * @} + */ + +/** @defgroup CORTEX_MPU_Region_Number CORTEX MPU Region Number + * @{ + */ +#define MPU_REGION_NUMBER0 ((uint8_t)0x00U) +#define MPU_REGION_NUMBER1 ((uint8_t)0x01U) +#define MPU_REGION_NUMBER2 ((uint8_t)0x02U) +#define MPU_REGION_NUMBER3 ((uint8_t)0x03U) +#define MPU_REGION_NUMBER4 ((uint8_t)0x04U) +#define MPU_REGION_NUMBER5 ((uint8_t)0x05U) +#define MPU_REGION_NUMBER6 ((uint8_t)0x06U) +#define MPU_REGION_NUMBER7 ((uint8_t)0x07U) +/** + * @} + */ +#endif /* __MPU_PRESENT */ + +/** + * @} + */ + +/* Exported Macros -----------------------------------------------------------*/ + + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup CORTEX_Exported_Functions + * @{ + */ + +/** @addtogroup CORTEX_Exported_Functions_Group1 + * @{ + */ +/* Initialization and de-initialization functions *****************************/ +void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup); +void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority); +void HAL_NVIC_EnableIRQ(IRQn_Type IRQn); +void HAL_NVIC_DisableIRQ(IRQn_Type IRQn); +void HAL_NVIC_SystemReset(void); +uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb); +/** + * @} + */ + +/** @addtogroup CORTEX_Exported_Functions_Group2 + * @{ + */ +/* Peripheral Control functions ***********************************************/ +#if (__MPU_PRESENT == 1U) +void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init); +#endif /* __MPU_PRESENT */ +uint32_t HAL_NVIC_GetPriorityGrouping(void); +void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority); +uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn); +void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn); +void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn); +uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn); +void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource); +void HAL_SYSTICK_IRQHandler(void); +void HAL_SYSTICK_Callback(void); +/** + * @} + */ + +/** + * @} + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup CORTEX_Private_Macros CORTEX Private Macros + * @{ + */ +#define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \ + ((GROUP) == NVIC_PRIORITYGROUP_1) || \ + ((GROUP) == NVIC_PRIORITYGROUP_2) || \ + ((GROUP) == NVIC_PRIORITYGROUP_3) || \ + ((GROUP) == NVIC_PRIORITYGROUP_4)) + +#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10U) + +#define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10U) + +#define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= 0x00) + +/** @defgroup CORTEX_SysTick_clock_source_Macro_Private CORTEX SysTick clock source + * @{ + */ +#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \ + ((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8)) +/** + * @} + */ + +#if (__MPU_PRESENT == 1U) +#define IS_MPU_REGION_ENABLE(STATE) (((STATE) == MPU_REGION_ENABLE) || \ + ((STATE) == MPU_REGION_DISABLE)) + +#define IS_MPU_INSTRUCTION_ACCESS(STATE) (((STATE) == MPU_INSTRUCTION_ACCESS_ENABLE) || \ + ((STATE) == MPU_INSTRUCTION_ACCESS_DISABLE)) + +#define IS_MPU_ACCESS_SHAREABLE(STATE) (((STATE) == MPU_ACCESS_SHAREABLE) || \ + ((STATE) == MPU_ACCESS_NOT_SHAREABLE)) + +#define IS_MPU_ACCESS_CACHEABLE(STATE) (((STATE) == MPU_ACCESS_CACHEABLE) || \ + ((STATE) == MPU_ACCESS_NOT_CACHEABLE)) + +#define IS_MPU_ACCESS_BUFFERABLE(STATE) (((STATE) == MPU_ACCESS_BUFFERABLE) || \ + ((STATE) == MPU_ACCESS_NOT_BUFFERABLE)) + +#define IS_MPU_TEX_LEVEL(TYPE) (((TYPE) == MPU_TEX_LEVEL0) || \ + ((TYPE) == MPU_TEX_LEVEL1) || \ + ((TYPE) == MPU_TEX_LEVEL2)) + +#define IS_MPU_REGION_PERMISSION_ATTRIBUTE(TYPE) (((TYPE) == MPU_REGION_NO_ACCESS) || \ + ((TYPE) == MPU_REGION_PRIV_RW) || \ + ((TYPE) == MPU_REGION_PRIV_RW_URO) || \ + ((TYPE) == MPU_REGION_FULL_ACCESS) || \ + ((TYPE) == MPU_REGION_PRIV_RO) || \ + ((TYPE) == MPU_REGION_PRIV_RO_URO)) + +#define IS_MPU_REGION_NUMBER(NUMBER) (((NUMBER) == MPU_REGION_NUMBER0) || \ + ((NUMBER) == MPU_REGION_NUMBER1) || \ + ((NUMBER) == MPU_REGION_NUMBER2) || \ + ((NUMBER) == MPU_REGION_NUMBER3) || \ + ((NUMBER) == MPU_REGION_NUMBER4) || \ + ((NUMBER) == MPU_REGION_NUMBER5) || \ + ((NUMBER) == MPU_REGION_NUMBER6) || \ + ((NUMBER) == MPU_REGION_NUMBER7)) + +#define IS_MPU_REGION_SIZE(SIZE) (((SIZE) == MPU_REGION_SIZE_32B) || \ + ((SIZE) == MPU_REGION_SIZE_64B) || \ + ((SIZE) == MPU_REGION_SIZE_128B) || \ + ((SIZE) == MPU_REGION_SIZE_256B) || \ + ((SIZE) == MPU_REGION_SIZE_512B) || \ + ((SIZE) == MPU_REGION_SIZE_1KB) || \ + ((SIZE) == MPU_REGION_SIZE_2KB) || \ + ((SIZE) == MPU_REGION_SIZE_4KB) || \ + ((SIZE) == MPU_REGION_SIZE_8KB) || \ + ((SIZE) == MPU_REGION_SIZE_16KB) || \ + ((SIZE) == MPU_REGION_SIZE_32KB) || \ + ((SIZE) == MPU_REGION_SIZE_64KB) || \ + ((SIZE) == MPU_REGION_SIZE_128KB) || \ + ((SIZE) == MPU_REGION_SIZE_256KB) || \ + ((SIZE) == MPU_REGION_SIZE_512KB) || \ + ((SIZE) == MPU_REGION_SIZE_1MB) || \ + ((SIZE) == MPU_REGION_SIZE_2MB) || \ + ((SIZE) == MPU_REGION_SIZE_4MB) || \ + ((SIZE) == MPU_REGION_SIZE_8MB) || \ + ((SIZE) == MPU_REGION_SIZE_16MB) || \ + ((SIZE) == MPU_REGION_SIZE_32MB) || \ + ((SIZE) == MPU_REGION_SIZE_64MB) || \ + ((SIZE) == MPU_REGION_SIZE_128MB) || \ + ((SIZE) == MPU_REGION_SIZE_256MB) || \ + ((SIZE) == MPU_REGION_SIZE_512MB) || \ + ((SIZE) == MPU_REGION_SIZE_1GB) || \ + ((SIZE) == MPU_REGION_SIZE_2GB) || \ + ((SIZE) == MPU_REGION_SIZE_4GB)) + +#define IS_MPU_SUB_REGION_DISABLE(SUBREGION) ((SUBREGION) < (uint16_t)0x00FFU) +#endif /* __MPU_PRESENT */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup CORTEX_Private_Functions CORTEX Private Functions + * @brief CORTEX private functions + * @{ + */ + +#if (__MPU_PRESENT == 1U) + +void HAL_MPU_Disable(void); +void HAL_MPU_Enable(uint32_t MPU_Control); + +#endif /* __MPU_PRESENT */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_CORTEX_H */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h new file mode 100644 index 0000000..df8418b --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h @@ -0,0 +1,178 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_def.h + * @author MCD Application Team + * @brief This file contains HAL common defines, enumeration, macros and + * structures definitions. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_DEF +#define __STM32F3xx_HAL_DEF + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" +#include "Legacy/stm32_hal_legacy.h" +#include + +/* Exported types ------------------------------------------------------------*/ + +/** + * @brief HAL Status structures definition + */ +typedef enum +{ + HAL_OK = 0x00U, + HAL_ERROR = 0x01U, + HAL_BUSY = 0x02U, + HAL_TIMEOUT = 0x03 +} HAL_StatusTypeDef; + +/** + * @brief HAL Lock structures definition + */ +typedef enum +{ + HAL_UNLOCKED = 0x00U, + HAL_LOCKED = 0x01 +} HAL_LockTypeDef; + +/* Exported macro ------------------------------------------------------------*/ + +#if !defined(UNUSED) +#define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */ +#endif /* UNUSED */ + +#define HAL_MAX_DELAY 0xFFFFFFFFU + +#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == BIT) +#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U) + +#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_) \ + do{ \ + (__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_); \ + (__DMA_HANDLE_).Parent = (__HANDLE__); \ + } while(0U) + +/** @brief Reset the Handle's State field. + * @param __HANDLE__ specifies the Peripheral Handle. + * @note This macro can be used for the following purpose: + * - When the Handle is declared as local variable; before passing it as parameter + * to HAL_PPP_Init() for the first time, it is mandatory to use this macro + * to set to 0 the Handle's "State" field. + * Otherwise, "State" field may have any random value and the first time the function + * HAL_PPP_Init() is called, the low level hardware initialization will be missed + * (i.e. HAL_PPP_MspInit() will not be executed). + * - When there is a need to reconfigure the low level hardware: instead of calling + * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init(). + * In this later function, when the Handle's "State" field is set to 0, it will execute the function + * HAL_PPP_MspInit() which will reconfigure the low level hardware. + * @retval None + */ +#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U) + +#if (USE_RTOS == 1U) + #error " USE_RTOS should be 0 in the current HAL release " +#else + #define __HAL_LOCK(__HANDLE__) \ + do{ \ + if((__HANDLE__)->Lock == HAL_LOCKED) \ + { \ + return HAL_BUSY; \ + } \ + else \ + { \ + (__HANDLE__)->Lock = HAL_LOCKED; \ + } \ + }while (0U) + + #define __HAL_UNLOCK(__HANDLE__) \ + do{ \ + (__HANDLE__)->Lock = HAL_UNLOCKED; \ + }while (0U) +#endif /* USE_RTOS */ + +#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */ + #ifndef __weak + #define __weak __attribute__((weak)) + #endif + #ifndef __packed + #define __packed __attribute__((packed)) + #endif +#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ + #ifndef __weak + #define __weak __attribute__((weak)) + #endif /* __weak */ + #ifndef __packed + #define __packed __attribute__((__packed__)) + #endif /* __packed */ +#endif /* __GNUC__ */ + + +/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */ +#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */ + #ifndef __ALIGN_BEGIN + #define __ALIGN_BEGIN + #endif + #ifndef __ALIGN_END + #define __ALIGN_END __attribute__ ((aligned (4))) + #endif +#elif defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ + #ifndef __ALIGN_END + #define __ALIGN_END __attribute__ ((aligned (4))) + #endif /* __ALIGN_END */ + #ifndef __ALIGN_BEGIN + #define __ALIGN_BEGIN + #endif /* __ALIGN_BEGIN */ +#else + #ifndef __ALIGN_END + #define __ALIGN_END + #endif /* __ALIGN_END */ + #ifndef __ALIGN_BEGIN + #if defined (__CC_ARM) /* ARM Compiler V5*/ + #define __ALIGN_BEGIN __align(4) + #elif defined (__ICCARM__) /* IAR Compiler */ + #define __ALIGN_BEGIN + #endif /* __CC_ARM */ + #endif /* __ALIGN_BEGIN */ +#endif /* __GNUC__ */ + +/** + * @brief __NOINLINE definition + */ +#if defined ( __CC_ARM ) || (defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) || defined ( __GNUC__ ) +/* ARM V4/V5 and V6 & GNU Compiler + ------------------------------- +*/ +#define __NOINLINE __attribute__ ( (noinline) ) + +#elif defined ( __ICCARM__ ) +/* ICCARM Compiler + --------------- +*/ +#define __NOINLINE _Pragma("optimize = no_inline") + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* ___STM32F3xx_HAL_DEF */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h new file mode 100644 index 0000000..afd10eb --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h @@ -0,0 +1,452 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_dma.h + * @author MCD Application Team + * @brief Header file of DMA HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_DMA_H +#define __STM32F3xx_HAL_DMA_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup DMA + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ + +/** @defgroup DMA_Exported_Types DMA Exported Types + * @{ + */ + +/** + * @brief DMA Configuration Structure definition + */ +typedef struct +{ + uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral, + from memory to memory or from peripheral to memory. + This parameter can be a value of @ref DMA_Data_transfer_direction */ + + uint32_t PeriphInc; /*!< Specifies whether the Peripheral address register should be incremented or not. + This parameter can be a value of @ref DMA_Peripheral_incremented_mode */ + + uint32_t MemInc; /*!< Specifies whether the memory address register should be incremented or not. + This parameter can be a value of @ref DMA_Memory_incremented_mode */ + + uint32_t PeriphDataAlignment; /*!< Specifies the Peripheral data width. + This parameter can be a value of @ref DMA_Peripheral_data_size */ + + uint32_t MemDataAlignment; /*!< Specifies the Memory data width. + This parameter can be a value of @ref DMA_Memory_data_size */ + + uint32_t Mode; /*!< Specifies the operation mode of the DMAy Channelx. + This parameter can be a value of @ref DMA_mode + @note The circular buffer mode cannot be used if the memory-to-memory + data transfer is configured on the selected Channel */ + + uint32_t Priority; /*!< Specifies the software priority for the DMAy Channelx. + This parameter can be a value of @ref DMA_Priority_level */ +} DMA_InitTypeDef; + +/** + * @brief HAL DMA State structures definition + */ +typedef enum +{ + HAL_DMA_STATE_RESET = 0x00U, /*!< DMA not yet initialized or disabled */ + HAL_DMA_STATE_READY = 0x01U, /*!< DMA initialized and ready for use */ + HAL_DMA_STATE_BUSY = 0x02U, /*!< DMA process is ongoing */ + HAL_DMA_STATE_TIMEOUT = 0x03 /*!< DMA timeout state */ +}HAL_DMA_StateTypeDef; + +/** + * @brief HAL DMA Error Code structure definition + */ +typedef enum +{ + HAL_DMA_FULL_TRANSFER = 0x00U, /*!< Full transfer */ + HAL_DMA_HALF_TRANSFER = 0x01 /*!< Half Transfer */ +}HAL_DMA_LevelCompleteTypeDef; + +/** + * @brief HAL DMA Callback ID structure definition + */ +typedef enum +{ + HAL_DMA_XFER_CPLT_CB_ID = 0x00U, /*!< Full transfer */ + HAL_DMA_XFER_HALFCPLT_CB_ID = 0x01U, /*!< Half transfer */ + HAL_DMA_XFER_ERROR_CB_ID = 0x02U, /*!< Error */ + HAL_DMA_XFER_ABORT_CB_ID = 0x03U, /*!< Abort */ + HAL_DMA_XFER_ALL_CB_ID = 0x04 /*!< All */ +}HAL_DMA_CallbackIDTypeDef; + +/** + * @brief DMA handle Structure definition + */ +typedef struct __DMA_HandleTypeDef +{ + DMA_Channel_TypeDef *Instance; /*!< Register base address */ + + DMA_InitTypeDef Init; /*!< DMA communication parameters */ + + HAL_LockTypeDef Lock; /*!< DMA locking object */ + + HAL_DMA_StateTypeDef State; /*!< DMA transfer state */ + + void *Parent; /*!< Parent object state */ + + void (* XferCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete callback */ + + void (* XferHalfCpltCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback */ + + void (* XferErrorCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer error callback */ + + void (* XferAbortCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer abort callback */ + + __IO uint32_t ErrorCode; /*!< DMA Error code */ + + DMA_TypeDef *DmaBaseAddress; /*!< DMA Channel Base Address */ + + uint32_t ChannelIndex; /*!< DMA Channel Index */ +} DMA_HandleTypeDef; +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ + +/** @defgroup DMA_Exported_Constants DMA Exported Constants + * @{ + */ + +/** @defgroup DMA_Error_Code DMA Error Code + * @{ + */ +#define HAL_DMA_ERROR_NONE (0x00000000U) /*!< No error */ +#define HAL_DMA_ERROR_TE (0x00000001U) /*!< Transfer error */ +#define HAL_DMA_ERROR_NO_XFER (0x00000004U) /*!< no ongoin transfer */ +#define HAL_DMA_ERROR_TIMEOUT (0x00000020U) /*!< Timeout error */ +#define HAL_DMA_ERROR_NOT_SUPPORTED (0x00000100U) /*!< Not supported mode */ +/** + * @} + */ + +/** @defgroup DMA_Data_transfer_direction DMA Data transfer direction + * @{ + */ +#define DMA_PERIPH_TO_MEMORY (0x00000000U) /*!< Peripheral to memory direction */ +#define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_CCR_DIR) /*!< Memory to peripheral direction */ +#define DMA_MEMORY_TO_MEMORY ((uint32_t)DMA_CCR_MEM2MEM) /*!< Memory to memory direction */ + +/** + * @} + */ + +/** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode + * @{ + */ +#define DMA_PINC_ENABLE ((uint32_t)DMA_CCR_PINC) /*!< Peripheral increment mode Enable */ +#define DMA_PINC_DISABLE (0x00000000U) /*!< Peripheral increment mode Disable */ +/** + * @} + */ + +/** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode + * @{ + */ +#define DMA_MINC_ENABLE ((uint32_t)DMA_CCR_MINC) /*!< Memory increment mode Enable */ +#define DMA_MINC_DISABLE (0x00000000U) /*!< Memory increment mode Disable */ +/** + * @} + */ + +/** @defgroup DMA_Peripheral_data_size DMA Peripheral data size + * @{ + */ +#define DMA_PDATAALIGN_BYTE (0x00000000U) /*!< Peripheral data alignment : Byte */ +#define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_CCR_PSIZE_0) /*!< Peripheral data alignment : HalfWord */ +#define DMA_PDATAALIGN_WORD ((uint32_t)DMA_CCR_PSIZE_1) /*!< Peripheral data alignment : Word */ +/** + * @} + */ + +/** @defgroup DMA_Memory_data_size DMA Memory data size + * @{ + */ +#define DMA_MDATAALIGN_BYTE (0x00000000U) /*!< Memory data alignment : Byte */ +#define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_CCR_MSIZE_0) /*!< Memory data alignment : HalfWord */ +#define DMA_MDATAALIGN_WORD ((uint32_t)DMA_CCR_MSIZE_1) /*!< Memory data alignment : Word */ +/** + * @} + */ + +/** @defgroup DMA_mode DMA mode + * @{ + */ +#define DMA_NORMAL (0x00000000U) /*!< Normal Mode */ +#define DMA_CIRCULAR ((uint32_t)DMA_CCR_CIRC) /*!< Circular Mode */ +/** + * @} + */ + +/** @defgroup DMA_Priority_level DMA Priority level + * @{ + */ +#define DMA_PRIORITY_LOW (0x00000000U) /*!< Priority level : Low */ +#define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_CCR_PL_0) /*!< Priority level : Medium */ +#define DMA_PRIORITY_HIGH ((uint32_t)DMA_CCR_PL_1) /*!< Priority level : High */ +#define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_CCR_PL) /*!< Priority level : Very_High */ +/** + * @} + */ + + +/** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions + * @{ + */ +#define DMA_IT_TC ((uint32_t)DMA_CCR_TCIE) +#define DMA_IT_HT ((uint32_t)DMA_CCR_HTIE) +#define DMA_IT_TE ((uint32_t)DMA_CCR_TEIE) +/** + * @} + */ + +/** @defgroup DMA_flag_definitions DMA flag definitions + * @{ + */ +#define DMA_FLAG_GL1 (0x00000001U) +#define DMA_FLAG_TC1 (0x00000002U) +#define DMA_FLAG_HT1 (0x00000004U) +#define DMA_FLAG_TE1 (0x00000008U) +#define DMA_FLAG_GL2 (0x00000010U) +#define DMA_FLAG_TC2 (0x00000020U) +#define DMA_FLAG_HT2 (0x00000040U) +#define DMA_FLAG_TE2 (0x00000080U) +#define DMA_FLAG_GL3 (0x00000100U) +#define DMA_FLAG_TC3 (0x00000200U) +#define DMA_FLAG_HT3 (0x00000400U) +#define DMA_FLAG_TE3 (0x00000800U) +#define DMA_FLAG_GL4 (0x00001000U) +#define DMA_FLAG_TC4 (0x00002000U) +#define DMA_FLAG_HT4 (0x00004000U) +#define DMA_FLAG_TE4 (0x00008000U) +#define DMA_FLAG_GL5 (0x00010000U) +#define DMA_FLAG_TC5 (0x00020000U) +#define DMA_FLAG_HT5 (0x00040000U) +#define DMA_FLAG_TE5 (0x00080000U) +#define DMA_FLAG_GL6 (0x00100000U) +#define DMA_FLAG_TC6 (0x00200000U) +#define DMA_FLAG_HT6 (0x00400000U) +#define DMA_FLAG_TE6 (0x00800000U) +#define DMA_FLAG_GL7 (0x01000000U) +#define DMA_FLAG_TC7 (0x02000000U) +#define DMA_FLAG_HT7 (0x04000000U) +#define DMA_FLAG_TE7 (0x08000000U) +/** + * @} + */ + +/** + * @} + */ + + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup DMA_Exported_Macros DMA Exported Macros + * @{ + */ + +/** @brief Reset DMA handle state + * @param __HANDLE__ DMA handle. + * @retval None + */ +#define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET) + +/** + * @brief Enable the specified DMA Channel. + * @param __HANDLE__ DMA handle + * @retval None + */ +#define __HAL_DMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CCR |= DMA_CCR_EN) + +/** + * @brief Disable the specified DMA Channel. + * @param __HANDLE__ DMA handle + * @retval None + */ +#define __HAL_DMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CCR &= ~DMA_CCR_EN) + + +/* Interrupt & Flag management */ + +/** + * @brief Enables the specified DMA Channel interrupts. + * @param __HANDLE__ DMA handle + * @param __INTERRUPT__ specifies the DMA interrupt sources to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg DMA_IT_TC: Transfer complete interrupt mask + * @arg DMA_IT_HT: Half transfer complete interrupt mask + * @arg DMA_IT_TE: Transfer error interrupt mask + * @retval None + */ +#define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CCR |= (__INTERRUPT__)) + +/** + * @brief Disables the specified DMA Channel interrupts. + * @param __HANDLE__ DMA handle + * @param __INTERRUPT__ specifies the DMA interrupt sources to be enabled or disabled. + * This parameter can be any combination of the following values: + * @arg DMA_IT_TC: Transfer complete interrupt mask + * @arg DMA_IT_HT: Half transfer complete interrupt mask + * @arg DMA_IT_TE: Transfer error interrupt mask + * @retval None + */ +#define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CCR &= ~(__INTERRUPT__)) + +/** + * @brief Checks whether the specified DMA Channel interrupt is enabled or disabled. + * @param __HANDLE__ DMA handle + * @param __INTERRUPT__ specifies the DMA interrupt source to check. + * This parameter can be one of the following values: + * @arg DMA_IT_TC: Transfer complete interrupt mask + * @arg DMA_IT_HT: Half transfer complete interrupt mask + * @arg DMA_IT_TE: Transfer error interrupt mask + * @retval The state of DMA_IT (SET or RESET). + */ +#define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CCR & (__INTERRUPT__))) + +/** + * @brief Returns the number of remaining data units in the current DMAy Channelx transfer. + * @param __HANDLE__ DMA handle + * + * @retval The number of remaining data units in the current DMA Channel transfer. + */ +#define __HAL_DMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNDTR) + +/** + * @} + */ + +/* Include DMA HAL Extended module */ +#include "stm32f3xx_hal_dma_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup DMA_Exported_Functions + * @{ + */ + +/** @addtogroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ +/* Initialization and de-initialization functions *****************************/ +HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma); +HAL_StatusTypeDef HAL_DMA_DeInit (DMA_HandleTypeDef *hdma); +/** + * @} + */ + +/** @addtogroup DMA_Exported_Functions_Group2 Input and Output operation functions + * @{ + */ +/* Input and Output operation functions *****************************************************/ +HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); +HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); +HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma); +HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma); +HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, uint32_t CompleteLevel, uint32_t Timeout); +void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma); +HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void (* pCallback)( DMA_HandleTypeDef * _hdma)); +HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID); +/** + * @} + */ + +/** @addtogroup DMA_Exported_Functions_Group3 Peripheral State functions + * @{ + */ +/* Peripheral State and Error functions ***************************************/ +HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma); +uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma); +/** + * @} + */ + +/** + * @} + */ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup DMA_Private_Macros DMA Private Macros + * @brief DMA private macros + * @{ + */ + +#define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1U) && ((SIZE) < 0x10000U)) + +#define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \ + ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \ + ((DIRECTION) == DMA_MEMORY_TO_MEMORY)) + +#define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \ + ((STATE) == DMA_PINC_DISABLE)) + +#define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \ + ((STATE) == DMA_MINC_DISABLE)) + +#define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \ + ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \ + ((SIZE) == DMA_PDATAALIGN_WORD)) + +#define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \ + ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \ + ((SIZE) == DMA_MDATAALIGN_WORD )) + +#define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \ + ((MODE) == DMA_CIRCULAR)) + +#define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \ + ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \ + ((PRIORITY) == DMA_PRIORITY_HIGH) || \ + ((PRIORITY) == DMA_PRIORITY_VERY_HIGH)) + +/** + * @} + */ + + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_DMA_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h new file mode 100644 index 0000000..691d12b --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h @@ -0,0 +1,272 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_dma_ex.h + * @author MCD Application Team + * @brief Header file of DMA HAL extension module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_DMA_EX_H +#define __STM32F3xx_HAL_DMA_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup DMAEx + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup DMAEx_Exported_Macros DMA Extended Exported Macros + * @{ + */ +/* Interrupt & Flag management */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Returns the current DMA Channel transfer complete flag. + * @param __HANDLE__ DMA handle + * @retval The specified transfer complete flag index. + */ +#define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \ +(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TC1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TC2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TC3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TC4 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TC5 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TC6 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_TC7 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_TC1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_TC2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_TC3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_TC4 :\ + DMA_FLAG_TC5) + +/** + * @brief Returns the current DMA Channel half transfer complete flag. + * @param __HANDLE__ DMA handle + * @retval The specified half transfer complete flag index. + */ +#define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\ +(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_HT1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_HT2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_HT3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_HT4 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_HT5 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_HT6 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_HT7 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_HT1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_HT2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_HT3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_HT4 :\ + DMA_FLAG_HT5) + +/** + * @brief Returns the current DMA Channel transfer error flag. + * @param __HANDLE__ DMA handle + * @retval The specified transfer error flag index. + */ +#define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\ +(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TE1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TE2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TE3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TE4 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TE5 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TE6 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_TE7 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_TE1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_TE2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_TE3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_TE4 :\ + DMA_FLAG_TE5) + +/** + * @brief Return the current DMA Channel Global interrupt flag. + * @param __HANDLE__ DMA handle + * @retval The specified transfer error flag index. + */ +#define __HAL_DMA_GET_GI_FLAG_INDEX(__HANDLE__)\ +(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_GL1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_GL2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_GL3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_GL4 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_GL5 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_GL6 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel7))? DMA_FLAG_GL7 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel1))? DMA_FLAG_GL1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel2))? DMA_FLAG_GL2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel3))? DMA_FLAG_GL3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Channel4))? DMA_FLAG_GL4 :\ + DMA_FLAG_GL5) + +/** + * @brief Get the DMA Channel pending flags. + * @param __HANDLE__ DMA handle + * @param __FLAG__ Get the specified flag. + * This parameter can be any combination of the following values: + * @arg DMA_FLAG_TCx: Transfer complete flag + * @arg DMA_FLAG_HTx: Half transfer complete flag + * @arg DMA_FLAG_TEx: Transfer error flag + * Where x can be 1_7 or 1_5 (depending on DMA1 or DMA2) to select the DMA Channel flag. + * @retval The state of FLAG (SET or RESET). + */ +#define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)\ +(((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Channel7)? (DMA2->ISR & (__FLAG__)) :\ + (DMA1->ISR & (__FLAG__))) + +/** + * @brief Clears the DMA Channel pending flags. + * @param __HANDLE__ DMA handle + * @param __FLAG__ specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg DMA_FLAG_TCx: Transfer complete flag + * @arg DMA_FLAG_HTx: Half transfer complete flag + * @arg DMA_FLAG_TEx: Transfer error flag + * Where x can be 1_7 or 1_5 (depending on DMA1 or DMA2) to select the DMA Channel flag. + * @retval None + */ +#define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) \ +(((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Channel7)? (DMA2->IFCR = (__FLAG__)) :\ + (DMA1->IFCR = (__FLAG__))) + +/** + * @} + */ + +#else /* STM32F301x8_STM32F302x8_STM32F318xx_STM32F303x8_STM32F334x8_STM32F328xx Product devices */ +/** @defgroup DMA_Low_density_Medium_density_Product_devices DMA Low density and Medium density product devices + * @{ + */ + +/** + * @brief Returns the current DMA Channel transfer complete flag. + * @param __HANDLE__ DMA handle + * @retval The specified transfer complete flag index. + */ +#define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \ +(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TC1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TC2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TC3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TC4 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TC5 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TC6 :\ + DMA_FLAG_TC7) + +/** + * @brief Returns the current DMA Channel half transfer complete flag. + * @param __HANDLE__ DMA handle + * @retval The specified half transfer complete flag index. + */ +#define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\ +(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_HT1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_HT2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_HT3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_HT4 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_HT5 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_HT6 :\ + DMA_FLAG_HT7) + +/** + * @brief Returns the current DMA Channel transfer error flag. + * @param __HANDLE__ DMA handle + * @retval The specified transfer error flag index. + */ +#define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\ +(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TE1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TE2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TE3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TE4 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TE5 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TE6 :\ + DMA_FLAG_TE7) + +/** + * @brief Return the current DMA Channel Global interrupt flag. + * @param __HANDLE__ DMA handle + * @retval The specified transfer error flag index. + */ +#define __HAL_DMA_GET_GI_FLAG_INDEX(__HANDLE__)\ +(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_GL1 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_GL2 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_GL3 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_GL4 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_GL5 :\ + ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_GL6 :\ + DMA_FLAG_GL7) + +/** + * @brief Get the DMA Channel pending flags. + * @param __HANDLE__ DMA handle + * @param __FLAG__ Get the specified flag. + * This parameter can be any combination of the following values: + * @arg DMA_FLAG_TCx: Transfer complete flag + * @arg DMA_FLAG_HTx: Half transfer complete flag + * @arg DMA_FLAG_TEx: Transfer error flag + * Where x can be 1_7 to select the DMA Channel flag. + * @retval The state of FLAG (SET or RESET). + */ + +#define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__) (DMA1->ISR & (__FLAG__)) + +/** + * @brief Clears the DMA Channel pending flags. + * @param __HANDLE__ DMA handle + * @param __FLAG__ specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg DMA_FLAG_TCx: Transfer complete flag + * @arg DMA_FLAG_HTx: Half transfer complete flag + * @arg DMA_FLAG_TEx: Transfer error flag + * Where x can be 1_7 to select the DMA Channel flag. + * @retval None + */ +#define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) (DMA1->IFCR = (__FLAG__)) + +/** + * @} + */ + +#endif + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F373xC || STM32F378xx */ + +#endif /* __STM32F3xx_HAL_DMA_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_exti.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_exti.h new file mode 100644 index 0000000..2e25ca3 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_exti.h @@ -0,0 +1,402 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_exti.h + * @author MCD Application Team + * @brief Header file of EXTI HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_HAL_EXTI_H +#define STM32F3xx_HAL_EXTI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup EXTI EXTI + * @brief EXTI HAL module driver + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ + +/** @defgroup EXTI_Exported_Types EXTI Exported Types + * @{ + */ + +/** + * @brief HAL EXTI common Callback ID enumeration definition + */ +typedef enum +{ + HAL_EXTI_COMMON_CB_ID = 0x00U +} EXTI_CallbackIDTypeDef; + +/** + * @brief EXTI Handle structure definition + */ +typedef struct +{ + uint32_t Line; /*!< Exti line number */ + void (* PendingCallback)(void); /*!< Exti pending callback */ +} EXTI_HandleTypeDef; + +/** + * @brief EXTI Configuration structure definition + */ +typedef struct +{ + uint32_t Line; /*!< The Exti line to be configured. This parameter + can be a value of @ref EXTI_Line */ + uint32_t Mode; /*!< The Exit Mode to be configured for a core. + This parameter can be a combination of @ref EXTI_Mode */ + uint32_t Trigger; /*!< The Exti Trigger to be configured. This parameter + can be a value of @ref EXTI_Trigger */ + uint32_t GPIOSel; /*!< The Exti GPIO multiplexer selection to be configured. + This parameter is only possible for line 0 to 15. It + can be a value of @ref EXTI_GPIOSel */ +} EXTI_ConfigTypeDef; + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup EXTI_Exported_Constants EXTI Exported Constants + * @{ + */ + +/** @defgroup EXTI_Line EXTI Line + * @{ + */ +#define EXTI_LINE_0 (EXTI_GPIO | EXTI_REG1 | 0x00u) /*!< External interrupt line 0 */ +#define EXTI_LINE_1 (EXTI_GPIO | EXTI_REG1 | 0x01u) /*!< External interrupt line 1 */ +#define EXTI_LINE_2 (EXTI_GPIO | EXTI_REG1 | 0x02u) /*!< External interrupt line 2 */ +#define EXTI_LINE_3 (EXTI_GPIO | EXTI_REG1 | 0x03u) /*!< External interrupt line 3 */ +#define EXTI_LINE_4 (EXTI_GPIO | EXTI_REG1 | 0x04u) /*!< External interrupt line 4 */ +#define EXTI_LINE_5 (EXTI_GPIO | EXTI_REG1 | 0x05u) /*!< External interrupt line 5 */ +#define EXTI_LINE_6 (EXTI_GPIO | EXTI_REG1 | 0x06u) /*!< External interrupt line 6 */ +#define EXTI_LINE_7 (EXTI_GPIO | EXTI_REG1 | 0x07u) /*!< External interrupt line 7 */ +#define EXTI_LINE_8 (EXTI_GPIO | EXTI_REG1 | 0x08u) /*!< External interrupt line 8 */ +#define EXTI_LINE_9 (EXTI_GPIO | EXTI_REG1 | 0x09u) /*!< External interrupt line 9 */ +#define EXTI_LINE_10 (EXTI_GPIO | EXTI_REG1 | 0x0Au) /*!< External interrupt line 10 */ +#define EXTI_LINE_11 (EXTI_GPIO | EXTI_REG1 | 0x0Bu) /*!< External interrupt line 11 */ +#define EXTI_LINE_12 (EXTI_GPIO | EXTI_REG1 | 0x0Cu) /*!< External interrupt line 12 */ +#define EXTI_LINE_13 (EXTI_GPIO | EXTI_REG1 | 0x0Du) /*!< External interrupt line 13 */ +#define EXTI_LINE_14 (EXTI_GPIO | EXTI_REG1 | 0x0Eu) /*!< External interrupt line 14 */ +#define EXTI_LINE_15 (EXTI_GPIO | EXTI_REG1 | 0x0Fu) /*!< External interrupt line 15 */ +#define EXTI_LINE_16 (EXTI_CONFIG | EXTI_REG1 | 0x10u) /*!< External interrupt line 16 Connected to the PVD Output */ +#define EXTI_LINE_17 (EXTI_CONFIG | EXTI_REG1 | 0x11u) /*!< External interrupt line 17 Connected to the RTC Alarm event */ + +#if defined(EXTI_IMR_MR18) +#define EXTI_LINE_18 (EXTI_CONFIG | EXTI_REG1 | 0x12u) /*!< External interrupt line 18 Connected to the USB OTG FS Wakeup from suspend event */ +#else +#define EXTI_LINE_18 (EXTI_RESERVED | EXTI_REG1 | 0x12u) +#endif /* EXTI_IMR_MR18 */ + +#define EXTI_LINE_19 (EXTI_CONFIG | EXTI_REG1 | 0x13u) /*!< External interrupt line 19 Connected to the RTC tamper and Timestamps */ +#define EXTI_LINE_20 (EXTI_CONFIG | EXTI_REG1 | 0x14u) /*!< External interrupt line 20 Connected to the RTC wakeup timer */ + +#if defined(EXTI_IMR_MR21) +#define EXTI_LINE_21 (EXTI_CONFIG | EXTI_REG1 | 0x15u) /*!< External interrupt line 21 Connected to the Comparator 1 output */ +#else +#define EXTI_LINE_21 (EXTI_RESERVED | EXTI_REG1 | 0x15u) +#endif /* EXTI_IMR_MR21 */ + +#define EXTI_LINE_22 (EXTI_CONFIG | EXTI_REG1 | 0x16u) /*!< External interrupt line 22 Connected to the Comparator 2 output */ +#define EXTI_LINE_23 (EXTI_DIRECT | EXTI_REG1 | 0x17u) /*!< External interrupt line 23 Connected to the internal I2C1 wakeup event */ + +#if defined(EXTI_IMR_MR24) +#define EXTI_LINE_24 (EXTI_DIRECT | EXTI_REG1 | 0x18u) /*!< External interrupt line 24 Connected to the internal I2C2 wakeup event */ +#else +#define EXTI_LINE_24 (EXTI_RESERVED | EXTI_REG1 | 0x18u) +#endif /* EXTI_IMR_MR24 */ + +#define EXTI_LINE_25 (EXTI_DIRECT | EXTI_REG1 | 0x19u) /*!< External interrupt line 25 Connected to the internal USART1 wakeup event */ + +#if defined(EXTI_IMR_MR26) +#define EXTI_LINE_26 (EXTI_DIRECT | EXTI_REG1 | 0x1Au) /*!< External interrupt line 26 Connected to the internal USART2 wakeup event */ +#else +#define EXTI_LINE_26 (EXTI_RESERVED | EXTI_REG1 | 0x1Au) +#endif /* EXTI_IMR_MR26 */ + +#if defined(EXTI_IMR_MR27) +#define EXTI_LINE_27 (EXTI_DIRECT | EXTI_REG1 | 0x1Bu) /*!< External interrupt line 27 Connected to the internal I2C3 wakeup event */ +#else +#define EXTI_LINE_27 (EXTI_RESERVED | EXTI_REG1 | 0x1Bu) +#endif /* EXTI_IMR_MR27 */ + +#if defined(EXTI_IMR_MR28) +#define EXTI_LINE_28 (EXTI_DIRECT | EXTI_REG1 | 0x1Cu) /*!< External interrupt line 28 Connected to the internal USART3 wakeup event */ +#else +#define EXTI_LINE_28 (EXTI_RESERVED | EXTI_REG1 | 0x1Cu) +#endif /* EXTI_IMR_MR28 */ + +#if defined(EXTI_32_63_SUPPORT) + +#if defined(EXTI_IMR_MR29) +#define EXTI_LINE_29 (EXTI_CONFIG | EXTI_REG1 | 0x1Du) /*!< External interrupt line 29 Connected to the Comparator 3 output */ +#else +#define EXTI_LINE_29 (EXTI_RESERVED | EXTI_REG1 | 0x1Cu) +#endif /* EXTI_IMR_MR29 */ + +#if defined(EXTI_IMR_MR30) +#define EXTI_LINE_30 (EXTI_CONFIG | EXTI_REG1 | 0x1Eu) /*!< External interrupt line 30 Connected to the Comparator 4 output */ +#else +#define EXTI_LINE_30 (EXTI_RESERVED | EXTI_REG1 | 0x1Eu) +#endif /* EXTI_IMR_MR30 */ + +#if defined(EXTI_IMR_MR31) +#define EXTI_LINE_31 (EXTI_CONFIG | EXTI_REG1 | 0x1Fu) /*!< External interrupt line 31 Connected to the Comparator 5 output */ +#else +#define EXTI_LINE_31 (EXTI_RESERVED | EXTI_REG1 | 0x1Fu) +#endif /* EXTI_IMR_MR31 */ + +#define EXTI_LINE_32 (EXTI_CONFIG | EXTI_REG2 | 0x00u) /*!< External interrupt line 32 Connected to the Comparator 6 output */ + +#if defined(EXTI_IMR2_MR33) +#define EXTI_LINE_33 (EXTI_CONFIG | EXTI_REG2 | 0x01u) /*!< External interrupt line 33 Connected to the Comparator 7 output */ +#else +#define EXTI_LINE_33 (EXTI_RESERVED | EXTI_REG2 | 0x01u) +#endif /* EXTI_IMR2_MR33 */ + +#if defined(EXTI_IMR2_MR34) +#define EXTI_LINE_34 (EXTI_DIRECT | EXTI_REG2 | 0x02u) /*!< External interrupt line 34 Connected to the USART4 output */ +#else +#define EXTI_LINE_34 (EXTI_RESERVED | EXTI_REG2 | 0x02u) +#endif /* EXTI_IMR2_MR34 */ + +#if defined(EXTI_IMR2_MR35) +#define EXTI_LINE_35 (EXTI_DIRECT | EXTI_REG2 | 0x03u) /*!< External interrupt line 35 Connected to the USART5 output */ +#else +#define EXTI_LINE_35 (EXTI_RESERVED | EXTI_REG2 | 0x03u) +#endif /* EXTI_IMR2_MR35 */ + +#endif /* EXTI_32_63_SUPPORT */ +/** + * @} + */ + +/** @defgroup EXTI_Mode EXTI Mode + * @{ + */ +#define EXTI_MODE_NONE 0x00000000u +#define EXTI_MODE_INTERRUPT 0x00000001u +#define EXTI_MODE_EVENT 0x00000002u +/** + * @} + */ + +/** @defgroup EXTI_Trigger EXTI Trigger + * @{ + */ +#define EXTI_TRIGGER_NONE 0x00000000u +#define EXTI_TRIGGER_RISING 0x00000001u +#define EXTI_TRIGGER_FALLING 0x00000002u +#define EXTI_TRIGGER_RISING_FALLING (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING) +/** + * @} + */ + +/** @defgroup EXTI_GPIOSel EXTI GPIOSel + * @brief + * @{ + */ +#define EXTI_GPIOA 0x00000000u +#define EXTI_GPIOB 0x00000001u +#define EXTI_GPIOC 0x00000002u +#define EXTI_GPIOD 0x00000003u +#if defined(GPIOE) +#define EXTI_GPIOE 0x00000004u +#endif /* GPIOE */ +#define EXTI_GPIOF 0x00000005u +#if defined(GPIOG) +#define EXTI_GPIOG 0x00000006u +#endif /* GPIOG */ +#if defined(GPIOH) +#define EXTI_GPIOH 0x00000007u +#endif /* GPIOH */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup EXTI_Exported_Macros EXTI Exported Macros + * @{ + */ + +/** + * @} + */ + +/* Private constants --------------------------------------------------------*/ +/** @defgroup EXTI_Private_Constants EXTI Private Constants + * @{ + */ +/** + * @brief EXTI Line property definition + */ +#define EXTI_PROPERTY_SHIFT 24u +#define EXTI_DIRECT (0x01uL << EXTI_PROPERTY_SHIFT) +#define EXTI_CONFIG (0x02uL << EXTI_PROPERTY_SHIFT) +#define EXTI_GPIO ((0x04uL << EXTI_PROPERTY_SHIFT) | EXTI_CONFIG) +#define EXTI_RESERVED (0x08uL << EXTI_PROPERTY_SHIFT) +#define EXTI_PROPERTY_MASK (EXTI_DIRECT | EXTI_CONFIG | EXTI_GPIO) + +/** + * @brief EXTI Register and bit usage + */ +#define EXTI_REG_SHIFT 16u +#define EXTI_REG1 (0x00uL << EXTI_REG_SHIFT) +#define EXTI_REG2 (0x01uL << EXTI_REG_SHIFT) +#define EXTI_REG_MASK (EXTI_REG1 | EXTI_REG2) +#define EXTI_PIN_MASK 0x0000001Fu + +/** + * @brief EXTI Mask for interrupt & event mode + */ +#define EXTI_MODE_MASK (EXTI_MODE_EVENT | EXTI_MODE_INTERRUPT) + +/** + * @brief EXTI Mask for trigger possibilities + */ +#define EXTI_TRIGGER_MASK (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING) + +/** + * @brief EXTI Line number + */ +#if defined(EXTI_32_63_SUPPORT) +#define EXTI_LINE_NB 36uL +#else +#define EXTI_LINE_NB 29uL +#endif /* EXTI_32_63_SUPPORT */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup EXTI_Private_Macros EXTI Private Macros + * @{ + */ +#define IS_EXTI_LINE(__EXTI_LINE__) ((((__EXTI_LINE__) & ~(EXTI_PROPERTY_MASK | EXTI_REG_MASK | EXTI_PIN_MASK)) == 0x00u) && \ + ((((__EXTI_LINE__) & EXTI_PROPERTY_MASK) == EXTI_DIRECT) || \ + (((__EXTI_LINE__) & EXTI_PROPERTY_MASK) == EXTI_CONFIG) || \ + (((__EXTI_LINE__) & EXTI_PROPERTY_MASK) == EXTI_GPIO)) && \ + (((__EXTI_LINE__) & (EXTI_REG_MASK | EXTI_PIN_MASK)) < \ + (((EXTI_LINE_NB / 32u) << EXTI_REG_SHIFT) | (EXTI_LINE_NB % 32u)))) + +#define IS_EXTI_MODE(__EXTI_LINE__) ((((__EXTI_LINE__) & EXTI_MODE_MASK) != 0x00u) && \ + (((__EXTI_LINE__) & ~EXTI_MODE_MASK) == 0x00u)) + +#define IS_EXTI_TRIGGER(__EXTI_LINE__) (((__EXTI_LINE__) & ~EXTI_TRIGGER_MASK) == 0x00u) + +#define IS_EXTI_PENDING_EDGE(__EXTI_LINE__) ((__EXTI_LINE__) == EXTI_TRIGGER_RISING_FALLING) + +#define IS_EXTI_CONFIG_LINE(__EXTI_LINE__) (((__EXTI_LINE__) & EXTI_CONFIG) != 0x00u) + +#if defined(GPIOH) +#define IS_EXTI_GPIO_PORT(__PORT__) (((__PORT__) == EXTI_GPIOA) || \ + ((__PORT__) == EXTI_GPIOB) || \ + ((__PORT__) == EXTI_GPIOC) || \ + ((__PORT__) == EXTI_GPIOD) || \ + ((__PORT__) == EXTI_GPIOE) || \ + ((__PORT__) == EXTI_GPIOF) || \ + ((__PORT__) == EXTI_GPIOG) || \ + ((__PORT__) == EXTI_GPIOH)) +#elif defined(GPIOE) +#define IS_EXTI_GPIO_PORT(__PORT__) (((__PORT__) == EXTI_GPIOA) || \ + ((__PORT__) == EXTI_GPIOB) || \ + ((__PORT__) == EXTI_GPIOC) || \ + ((__PORT__) == EXTI_GPIOD) || \ + ((__PORT__) == EXTI_GPIOE) || \ + ((__PORT__) == EXTI_GPIOF)) +#else +#define IS_EXTI_GPIO_PORT(__PORT__) (((__PORT__) == EXTI_GPIOA) || \ + ((__PORT__) == EXTI_GPIOB) || \ + ((__PORT__) == EXTI_GPIOC) || \ + ((__PORT__) == EXTI_GPIOD) || \ + ((__PORT__) == EXTI_GPIOF)) +#endif /* GPIOE */ + +#define IS_EXTI_GPIO_PIN(__PIN__) ((__PIN__) < 16u) + +/** + * @} + */ + + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup EXTI_Exported_Functions EXTI Exported Functions + * @brief EXTI Exported Functions + * @{ + */ + +/** @defgroup EXTI_Exported_Functions_Group1 Configuration functions + * @brief Configuration functions + * @{ + */ +/* Configuration functions ****************************************************/ +HAL_StatusTypeDef HAL_EXTI_SetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig); +HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig); +HAL_StatusTypeDef HAL_EXTI_ClearConfigLine(EXTI_HandleTypeDef *hexti); +HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void)); +HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine); +/** + * @} + */ + +/** @defgroup EXTI_Exported_Functions_Group2 IO operation functions + * @brief IO operation functions + * @{ + */ +/* IO operation functions *****************************************************/ +void HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti); +uint32_t HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge); +void HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge); +void HAL_EXTI_GenerateSWI(EXTI_HandleTypeDef *hexti); + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32F3xx_HAL_EXTI_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h new file mode 100644 index 0000000..08be962 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h @@ -0,0 +1,378 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_flash.h + * @author MCD Application Team + * @brief Header file of Flash HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_FLASH_H +#define __STM32F3xx_HAL_FLASH_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup FLASH + * @{ + */ + +/** @addtogroup FLASH_Private_Constants + * @{ + */ +#define FLASH_TIMEOUT_VALUE (50000U) /* 50 s */ +/** + * @} + */ + +/** @addtogroup FLASH_Private_Macros + * @{ + */ + +#define IS_FLASH_TYPEPROGRAM(VALUE) (((VALUE) == FLASH_TYPEPROGRAM_HALFWORD) || \ + ((VALUE) == FLASH_TYPEPROGRAM_WORD) || \ + ((VALUE) == FLASH_TYPEPROGRAM_DOUBLEWORD)) + +#define IS_FLASH_LATENCY(__LATENCY__) (((__LATENCY__) == FLASH_LATENCY_0) || \ + ((__LATENCY__) == FLASH_LATENCY_1) || \ + ((__LATENCY__) == FLASH_LATENCY_2)) + +/** + * @} + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup FLASH_Exported_Types FLASH Exported Types + * @{ + */ + +/** + * @brief FLASH Procedure structure definition + */ +typedef enum +{ + FLASH_PROC_NONE = 0U, + FLASH_PROC_PAGEERASE = 1U, + FLASH_PROC_MASSERASE = 2U, + FLASH_PROC_PROGRAMHALFWORD = 3U, + FLASH_PROC_PROGRAMWORD = 4U, + FLASH_PROC_PROGRAMDOUBLEWORD = 5U +} FLASH_ProcedureTypeDef; + +/** + * @brief FLASH handle Structure definition + */ +typedef struct +{ + __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*!< Internal variable to indicate which procedure is ongoing or not in IT context */ + + __IO uint32_t DataRemaining; /*!< Internal variable to save the remaining pages to erase or half-word to program in IT context */ + + __IO uint32_t Address; /*!< Internal variable to save address selected for program or erase */ + + __IO uint64_t Data; /*!< Internal variable to save data to be programmed */ + + HAL_LockTypeDef Lock; /*!< FLASH locking object */ + + __IO uint32_t ErrorCode; /*!< FLASH error code + This parameter can be a value of @ref FLASH_Error_Codes */ +} FLASH_ProcessTypeDef; + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup FLASH_Exported_Constants FLASH Exported Constants + * @{ + */ + +/** @defgroup FLASH_Error_Codes FLASH Error Codes + * @{ + */ + +#define HAL_FLASH_ERROR_NONE 0x00U /*!< No error */ +#define HAL_FLASH_ERROR_PROG 0x01U /*!< Programming error */ +#define HAL_FLASH_ERROR_WRP 0x02U /*!< Write protection error */ + +/** + * @} + */ + +/** @defgroup FLASH_Type_Program FLASH Type Program + * @{ + */ +#define FLASH_TYPEPROGRAM_HALFWORD (0x01U) /*!ACR |= FLASH_ACR_HLFCYA) + +/** + * @brief Disable the FLASH half cycle access. + * @retval None + */ +#define __HAL_FLASH_HALF_CYCLE_ACCESS_DISABLE() (FLASH->ACR &= (~FLASH_ACR_HLFCYA)) + +/** + * @} + */ + +/** @defgroup FLASH_EM_Latency FLASH Latency + * @brief macros to handle FLASH Latency + * @{ + */ + +/** + * @brief Set the FLASH Latency. + * @param __LATENCY__ FLASH Latency + * This parameter can be one of the following values: + * @arg @ref FLASH_LATENCY_0 FLASH Zero Latency cycle + * @arg @ref FLASH_LATENCY_1 FLASH One Latency cycle + * @arg @ref FLASH_LATENCY_2 FLASH Two Latency cycles + * @retval None + */ +#define __HAL_FLASH_SET_LATENCY(__LATENCY__) (FLASH->ACR = (FLASH->ACR&(~FLASH_ACR_LATENCY)) | (__LATENCY__)) + + +/** + * @brief Get the FLASH Latency. + * @retval FLASH Latency + * This parameter can be one of the following values: + * @arg @ref FLASH_LATENCY_0 FLASH Zero Latency cycle + * @arg @ref FLASH_LATENCY_1 FLASH One Latency cycle + * @arg @ref FLASH_LATENCY_2 FLASH Two Latency cycles + */ +#define __HAL_FLASH_GET_LATENCY() (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY)) + +/** + * @} + */ + +/** @defgroup FLASH_Prefetch FLASH Prefetch + * @brief macros to handle FLASH Prefetch buffer + * @{ + */ +/** + * @brief Enable the FLASH prefetch buffer. + * @retval None + */ +#define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRFTBE) + +/** + * @brief Disable the FLASH prefetch buffer. + * @retval None + */ +#define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRFTBE)) + +/** + * @} + */ + +/** @defgroup FLASH_Interrupt FLASH Interrupts + * @brief macros to handle FLASH interrupts + * @{ + */ + +/** + * @brief Enable the specified FLASH interrupt. + * @param __INTERRUPT__ FLASH interrupt + * This parameter can be any combination of the following values: + * @arg @ref FLASH_IT_EOP End of FLASH Operation Interrupt + * @arg @ref FLASH_IT_ERR Error Interrupt + * @retval none + */ +#define __HAL_FLASH_ENABLE_IT(__INTERRUPT__) SET_BIT((FLASH->CR), (__INTERRUPT__)) + +/** + * @brief Disable the specified FLASH interrupt. + * @param __INTERRUPT__ FLASH interrupt + * This parameter can be any combination of the following values: + * @arg @ref FLASH_IT_EOP End of FLASH Operation Interrupt + * @arg @ref FLASH_IT_ERR Error Interrupt + * @retval none + */ +#define __HAL_FLASH_DISABLE_IT(__INTERRUPT__) CLEAR_BIT((FLASH->CR), (uint32_t)(__INTERRUPT__)) + +/** + * @brief Get the specified FLASH flag status. + * @param __FLAG__ specifies the FLASH flag to check. + * This parameter can be one of the following values: + * @arg @ref FLASH_FLAG_BSY FLASH Busy flag + * @arg @ref FLASH_FLAG_EOP FLASH End of Operation flag + * @arg @ref FLASH_FLAG_WRPERR FLASH Write protected error flag + * @arg @ref FLASH_FLAG_PGERR FLASH Programming error flag + * @retval The new state of __FLAG__ (SET or RESET). + */ +#define __HAL_FLASH_GET_FLAG(__FLAG__) (((FLASH->SR) & (__FLAG__)) == (__FLAG__)) + +/** + * @brief Clear the specified FLASH flag. + * @param __FLAG__ specifies the FLASH flags to clear. + * This parameter can be any combination of the following values: + * @arg @ref FLASH_FLAG_EOP FLASH End of Operation flag + * @arg @ref FLASH_FLAG_WRPERR FLASH Write protected error flag + * @arg @ref FLASH_FLAG_PGERR FLASH Programming error flag + * @retval none + */ +#define __HAL_FLASH_CLEAR_FLAG(__FLAG__) ((FLASH->SR) = (__FLAG__)) + +/** + * @} + */ + +/** + * @} + */ + +/* Include FLASH HAL Extended module */ +#include "stm32f3xx_hal_flash_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup FLASH_Exported_Functions + * @{ + */ + +/** @addtogroup FLASH_Exported_Functions_Group1 + * @{ + */ +/* IO operation functions *****************************************************/ +HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data); +HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data); + +/* FLASH IRQ handler function */ +void HAL_FLASH_IRQHandler(void); +/* Callbacks in non blocking modes */ +void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue); +void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue); + +/** + * @} + */ + +/** @addtogroup FLASH_Exported_Functions_Group2 + * @{ + */ +/* Peripheral Control functions ***********************************************/ +HAL_StatusTypeDef HAL_FLASH_Unlock(void); +HAL_StatusTypeDef HAL_FLASH_Lock(void); +HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void); +HAL_StatusTypeDef HAL_FLASH_OB_Lock(void); +HAL_StatusTypeDef HAL_FLASH_OB_Launch(void); + +/** + * @} + */ + +/** @addtogroup FLASH_Exported_Functions_Group3 + * @{ + */ +/* Peripheral State and Error functions ***************************************/ +uint32_t HAL_FLASH_GetError(void); + +/** + * @} + */ + +/** + * @} + */ + +/* Private function -------------------------------------------------*/ +/** @addtogroup FLASH_Private_Functions + * @{ + */ +HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout); + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_FLASH_H */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h new file mode 100644 index 0000000..7e6b302 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h @@ -0,0 +1,472 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_flash_ex.h + * @author MCD Application Team + * @brief Header file of Flash HAL Extended module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_FLASH_EX_H +#define __STM32F3xx_HAL_FLASH_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup FLASHEx + * @{ + */ + +/** @addtogroup FLASHEx_Private_Constants + * @{ + */ + +#define FLASH_SIZE_DATA_REGISTER (0x1FFFF7CCU) + +/** + * @} + */ + +/** @addtogroup FLASHEx_Private_Macros + * @{ + */ +#define IS_FLASH_TYPEERASE(VALUE) (((VALUE) == FLASH_TYPEERASE_PAGES) || \ + ((VALUE) == FLASH_TYPEERASE_MASSERASE)) + +#define IS_OPTIONBYTE(VALUE) ((VALUE) <= (OPTIONBYTE_WRP | OPTIONBYTE_RDP | OPTIONBYTE_USER | OPTIONBYTE_DATA)) + +#define IS_WRPSTATE(VALUE) (((VALUE) == OB_WRPSTATE_DISABLE) || \ + ((VALUE) == OB_WRPSTATE_ENABLE)) + +#define IS_OB_DATA_ADDRESS(ADDRESS) (((ADDRESS) == OB_DATA_ADDRESS_DATA0) || ((ADDRESS) == OB_DATA_ADDRESS_DATA1)) + +#define IS_OB_RDP_LEVEL(LEVEL) (((LEVEL) == OB_RDP_LEVEL_0) ||\ + ((LEVEL) == OB_RDP_LEVEL_1))/*||\ + ((LEVEL) == OB_RDP_LEVEL_2))*/ + +#define IS_OB_IWDG_SOURCE(SOURCE) (((SOURCE) == OB_IWDG_SW) || ((SOURCE) == OB_IWDG_HW)) + +#define IS_OB_STOP_SOURCE(SOURCE) (((SOURCE) == OB_STOP_NO_RST) || ((SOURCE) == OB_STOP_RST)) + +#define IS_OB_STDBY_SOURCE(SOURCE) (((SOURCE) == OB_STDBY_NO_RST) || ((SOURCE) == OB_STDBY_RST)) + +#define IS_OB_BOOT1(BOOT1) (((BOOT1) == OB_BOOT1_RESET) || ((BOOT1) == OB_BOOT1_SET)) + +#define IS_OB_VDDA_ANALOG(ANALOG) (((ANALOG) == OB_VDDA_ANALOG_ON) || ((ANALOG) == OB_VDDA_ANALOG_OFF)) + +#define IS_OB_SRAM_PARITY(PARITY) (((PARITY) == OB_SRAM_PARITY_SET) || ((PARITY) == OB_SRAM_PARITY_RESET)) + + +#if defined(FLASH_OBR_SDADC12_VDD_MONITOR) +#define IS_OB_SDACD_VDD_MONITOR(VDD_MONITOR) (((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_SET) || \ + ((VDD_MONITOR) == OB_SDACD_VDD_MONITOR_RESET)) +#endif /* FLASH_OBR_SDADC12_VDD_MONITOR */ + +#define IS_OB_WRP(PAGE) (((PAGE) != 0x0000000U)) + +#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \ + || defined(STM32F373xC) || defined(STM32F378xx) +#define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100U) ? \ + ((ADDRESS) <= 0x0803FFFFU) : (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80U) ? \ + ((ADDRESS) <= 0x0801FFFFU) : ((ADDRESS) <= 0x0800FFFFU)))) +#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && ((ADDRESS) <= 0x0807FFFFU)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40U) ? \ + ((ADDRESS) <= 0x0800FFFFU) : (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20U) ? \ + ((ADDRESS) <= 0x08007FFFU) : ((ADDRESS) <= 0x08003FFFU)))) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) \ + || defined(STM32F373xC) || defined(STM32F378xx) +#define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x100U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0803FFFFU) : \ + (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x80U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0801FFFFU) : \ + ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0800FFFFU))) +#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0807FFFFU) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) \ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define IS_FLASH_NB_PAGES(ADDRESS,NBPAGES) (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x40U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x0800FFFFU) : \ + (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x20U) ? ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x08007FFFU) : \ + ((ADDRESS)+((NBPAGES)*FLASH_PAGE_SIZE)-1U <= 0x08003FFFU))) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +/** + * @} + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup FLASHEx_Exported_Types FLASHEx Exported Types + * @{ + */ +/** + * @brief FLASH Erase structure definition + */ +typedef struct +{ + uint32_t TypeErase; /*!< TypeErase: Mass erase or page erase. + This parameter can be a value of @ref FLASHEx_Type_Erase */ + + uint32_t PageAddress; /*!< PageAdress: Initial FLASH page address to erase when mass erase is disabled + This parameter must be a number between Min_Data = FLASH_BASE and Max_Data = FLASH_BANK1_END */ + + uint32_t NbPages; /*!< NbPages: Number of pagess to be erased. + This parameter must be a value between Min_Data = 1 and Max_Data = (max number of pages - value of initial page)*/ + +} FLASH_EraseInitTypeDef; + +/** + * @brief FLASH Options bytes program structure definition + */ +typedef struct +{ + uint32_t OptionType; /*!< OptionType: Option byte to be configured. + This parameter can be a value of @ref FLASHEx_OB_Type */ + + uint32_t WRPState; /*!< WRPState: Write protection activation or deactivation. + This parameter can be a value of @ref FLASHEx_OB_WRP_State */ + + uint32_t WRPPage; /*!< WRPPage: specifies the page(s) to be write protected + This parameter can be a value of @ref FLASHEx_OB_Write_Protection */ + + uint8_t RDPLevel; /*!< RDPLevel: Set the read protection level.. + This parameter can be a value of @ref FLASHEx_OB_Read_Protection */ + + uint8_t USERConfig; /*!< USERConfig: Program the FLASH User Option Byte: + IWDG / STOP / STDBY / BOOT1 / VDDA_ANALOG / SRAM_PARITY / SDADC12_VDD_MONITOR + This parameter can be a combination of @ref FLASHEx_OB_IWatchdog, @ref FLASHEx_OB_nRST_STOP, + @ref FLASHEx_OB_nRST_STDBY, @ref FLASHEx_OB_BOOT1, @ref FLASHEx_OB_VDDA_Analog_Monitoring, + @ref FLASHEx_OB_RAM_Parity_Check_Enable. + @if STM32F373xC + And @ref FLASHEx_OB_SDADC12_VDD_MONITOR (only for STM32F373xC & STM32F378xx devices) + @endif + @if STM32F378xx + And @ref FLASHEx_OB_SDADC12_VDD_MONITOR (only for STM32F373xC & STM32F378xx devices) + @endif + */ + + uint32_t DATAAddress; /*!< DATAAddress: Address of the option byte DATA to be programmed + This parameter can be a value of @ref FLASHEx_OB_Data_Address */ + + uint8_t DATAData; /*!< DATAData: Data to be stored in the option byte DATA + This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFFU */ +} FLASH_OBProgramInitTypeDef; +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup FLASHEx_Exported_Constants FLASHEx Exported Constants + * @{ + */ + +/** @defgroup FLASHEx_Page_Size FLASHEx Page Size + * @{ + */ +#define FLASH_PAGE_SIZE 0x800 +/** + * @} + */ + +/** @defgroup FLASHEx_Type_Erase FLASH Type Erase + * @{ + */ +#define FLASH_TYPEERASE_PAGES (0x00U) /*!PR & (__EXTI_LINE__)) + +/** + * @brief Clear the EXTI's line pending flags. + * @param __EXTI_LINE__ specifies the EXTI lines flags to clear. + * This parameter can be any combination of GPIO_PIN_x where x can be (0..15) + * @retval None + */ +#define __HAL_GPIO_EXTI_CLEAR_FLAG(__EXTI_LINE__) (EXTI->PR = (__EXTI_LINE__)) + +/** + * @brief Check whether the specified EXTI line is asserted or not. + * @param __EXTI_LINE__ specifies the EXTI line to check. + * This parameter can be GPIO_PIN_x where x can be(0..15) + * @retval The new state of __EXTI_LINE__ (SET or RESET). + */ +#define __HAL_GPIO_EXTI_GET_IT(__EXTI_LINE__) (EXTI->PR & (__EXTI_LINE__)) + +/** + * @brief Clear the EXTI's line pending bits. + * @param __EXTI_LINE__ specifies the EXTI lines to clear. + * This parameter can be any combination of GPIO_PIN_x where x can be (0..15) + * @retval None + */ +#define __HAL_GPIO_EXTI_CLEAR_IT(__EXTI_LINE__) (EXTI->PR = (__EXTI_LINE__)) + +/** + * @brief Generate a Software interrupt on selected EXTI line. + * @param __EXTI_LINE__ specifies the EXTI line to check. + * This parameter can be GPIO_PIN_x where x can be(0..15) + * @retval None + */ +#define __HAL_GPIO_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER |= (__EXTI_LINE__)) + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup GPIO_Private_Constants GPIO Private Constants + * @{ + */ +#define GPIO_MODE_Pos 0u +#define GPIO_MODE (0x3uL << GPIO_MODE_Pos) +#define MODE_INPUT (0x0uL << GPIO_MODE_Pos) +#define MODE_OUTPUT (0x1uL << GPIO_MODE_Pos) +#define MODE_AF (0x2uL << GPIO_MODE_Pos) +#define MODE_ANALOG (0x3uL << GPIO_MODE_Pos) +#define OUTPUT_TYPE_Pos 4u +#define OUTPUT_TYPE (0x1uL << OUTPUT_TYPE_Pos) +#define OUTPUT_PP (0x0uL << OUTPUT_TYPE_Pos) +#define OUTPUT_OD (0x1uL << OUTPUT_TYPE_Pos) +#define EXTI_MODE_Pos 16u +#define EXTI_MODE (0x3uL << EXTI_MODE_Pos) +#define EXTI_IT (0x1uL << EXTI_MODE_Pos) +#define EXTI_EVT (0x2uL << EXTI_MODE_Pos) +#define TRIGGER_MODE_Pos 20u +#define TRIGGER_MODE (0x7uL << TRIGGER_MODE_Pos) +#define TRIGGER_RISING (0x1uL << TRIGGER_MODE_Pos) +#define TRIGGER_FALLING (0x2uL << TRIGGER_MODE_Pos) +#define TRIGGER_LEVEL (0x4uL << TRIGGER_MODE_Pos) +/** + * @} + */ + +/** @addtogroup GPIO_Private_Macros GPIO Private Macros + * @{ + */ +#define IS_GPIO_PIN_ACTION(ACTION) (((ACTION) == GPIO_PIN_RESET) || ((ACTION) == GPIO_PIN_SET)) + +#define IS_GPIO_PIN(__PIN__) (((((uint32_t)__PIN__) & GPIO_PIN_MASK) != 0x00U) &&\ + ((((uint32_t)__PIN__) & ~GPIO_PIN_MASK) == 0x00U)) + +#define IS_GPIO_MODE(__MODE__) (((__MODE__) == GPIO_MODE_INPUT) ||\ + ((__MODE__) == GPIO_MODE_OUTPUT_PP) ||\ + ((__MODE__) == GPIO_MODE_OUTPUT_OD) ||\ + ((__MODE__) == GPIO_MODE_AF_PP) ||\ + ((__MODE__) == GPIO_MODE_AF_OD) ||\ + ((__MODE__) == GPIO_MODE_IT_RISING) ||\ + ((__MODE__) == GPIO_MODE_IT_FALLING) ||\ + ((__MODE__) == GPIO_MODE_IT_RISING_FALLING) ||\ + ((__MODE__) == GPIO_MODE_EVT_RISING) ||\ + ((__MODE__) == GPIO_MODE_EVT_FALLING) ||\ + ((__MODE__) == GPIO_MODE_EVT_RISING_FALLING) ||\ + ((__MODE__) == GPIO_MODE_ANALOG)) + +#define IS_GPIO_SPEED(__SPEED__) (((__SPEED__) == GPIO_SPEED_FREQ_LOW) ||\ + ((__SPEED__) == GPIO_SPEED_FREQ_MEDIUM) ||\ + ((__SPEED__) == GPIO_SPEED_FREQ_HIGH)) + +#define IS_GPIO_PULL(__PULL__) (((__PULL__) == GPIO_NOPULL) ||\ + ((__PULL__) == GPIO_PULLUP) || \ + ((__PULL__) == GPIO_PULLDOWN)) +/** + * @} + */ + +/* Include GPIO HAL Extended module */ +#include "stm32f3xx_hal_gpio_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup GPIO_Exported_Functions GPIO Exported Functions + * @{ + */ + +/** @addtogroup GPIO_Exported_Functions_Group1 Initialization/de-initialization functions + * @brief Initialization and Configuration functions + * @{ + */ + +/* Initialization and de-initialization functions *****************************/ +void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init); +void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin); + +/** + * @} + */ + +/** @addtogroup GPIO_Exported_Functions_Group2 IO operation functions + * @{ + */ + +/* IO operation functions *****************************************************/ +GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); +void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState); +void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); +HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin); +void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin); +void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin); + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_GPIO_H */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h new file mode 100644 index 0000000..8dd57aa --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h @@ -0,0 +1,1520 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_gpio_ex.h + * @author MCD Application Team + * @brief Header file of GPIO HAL Extended module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_GPIO_EX_H +#define __STM32F3xx_HAL_GPIO_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup GPIOEx GPIOEx + * @brief GPIO Extended HAL module driver + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants + * @{ + */ + +/** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection + * @{ + */ + +#if defined (STM32F302xC) +/*---------------------------------- STM32F302xC ------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM2 ((uint8_t)0x02U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_COMP1 ((uint8_t)0x02U) /* COMP1 Alternate Function mapping */ +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_TIM15 ((uint8_t)0x03U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF4_TIM16 ((uint8_t)0x04U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF4_TIM17 ((uint8_t)0x04U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1/I2S1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_I2S ((uint8_t)0x05U) /* I2S Alternate Function mapping */ +#define GPIO_AF5_I2S2ext ((uint8_t)0x05U) /* I2S2ext Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +#define GPIO_AF5_UART4 ((uint8_t)0x05U) /* UART4 Alternate Function mapping */ +#define GPIO_AF5_UART5 ((uint8_t)0x05U) /* UART5 Alternate Function mapping */ +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_I2S3ext ((uint8_t)0x06U) /* I2S3ext Alternate Function mapping */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_COMP6 ((uint8_t)0x07U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_COMP1 ((uint8_t)0x08U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF8_COMP2 ((uint8_t)0x08U) /* COMP2 Alternate Function mapping */ +#define GPIO_AF8_COMP4 ((uint8_t)0x08U) /* COMP4 Alternate Function mapping */ +#define GPIO_AF8_COMP6 ((uint8_t)0x08U) /* COMP6 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM4 ((uint8_t)0xAU) /* TIM4 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0xCU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 14 selection + */ + +#define GPIO_AF14_USB ((uint8_t)0x0EU) /* USB Alternate Function mapping */ +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0CU) || ((AF) == (uint8_t)0x0EU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F302xC */ + +#if defined (STM32F303xC) +/*---------------------------------- STM32F303xC ------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM2 ((uint8_t)0x02U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM8 ((uint8_t)0x02U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_COMP1 ((uint8_t)0x02U) /* COMP1 Alternate Function mapping */ +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_TIM8 ((uint8_t)0x03U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF3_COMP7 ((uint8_t)0x03U) /* COMP7 Alternate Function mapping */ +#define GPIO_AF3_TIM15 ((uint8_t)0x03U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF4_TIM8 ((uint8_t)0x04U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF4_TIM16 ((uint8_t)0x04U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF4_TIM17 ((uint8_t)0x04U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1/I2S1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_I2S ((uint8_t)0x05U) /* I2S Alternate Function mapping */ +#define GPIO_AF5_I2S2ext ((uint8_t)0x05U) /* I2S2ext Alternate Function mapping */ +#define GPIO_AF5_TIM8 ((uint8_t)0x05U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +#define GPIO_AF5_UART4 ((uint8_t)0x05U) /* UART4 Alternate Function mapping */ +#define GPIO_AF5_UART5 ((uint8_t)0x05U) /* UART5 Alternate Function mapping */ +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_I2S3ext ((uint8_t)0x06U) /* I2S3ext Alternate Function mapping */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_TIM8 ((uint8_t)0x06U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_COMP3 ((uint8_t)0x07U) /* COMP3 Alternate Function mapping */ +#define GPIO_AF7_COMP5 ((uint8_t)0x07U) /* COMP5 Alternate Function mapping */ +#define GPIO_AF7_COMP6 ((uint8_t)0x07U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_COMP1 ((uint8_t)0x08U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF8_COMP2 ((uint8_t)0x08U) /* COMP2 Alternate Function mapping */ +#define GPIO_AF8_COMP3 ((uint8_t)0x08U) /* COMP3 Alternate Function mapping */ +#define GPIO_AF8_COMP4 ((uint8_t)0x08U) /* COMP4 Alternate Function mapping */ +#define GPIO_AF8_COMP5 ((uint8_t)0x08U) /* COMP5 Alternate Function mapping */ +#define GPIO_AF8_COMP6 ((uint8_t)0x08U) /* COMP6 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM8 ((uint8_t)0x09U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM4 ((uint8_t)0xAU) /* TIM4 Alternate Function mapping */ +#define GPIO_AF10_TIM8 ((uint8_t)0xAU) /* TIM8 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ +#define GPIO_AF11_TIM8 ((uint8_t)0x0BU) /* TIM8 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0xCU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 14 selection + */ + +#define GPIO_AF14_USB ((uint8_t)0x0EU) /* USB Alternate Function mapping */ +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0CU) || ((AF) == (uint8_t)0x0EU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F303xC */ + +#if defined (STM32F303xE) +/*---------------------------------- STM32F303xE ------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ + +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM2 ((uint8_t)0x02U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM8 ((uint8_t)0x02U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_COMP1 ((uint8_t)0x02U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF2_I2C3 ((uint8_t)0x02U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF2_TIM20 ((uint8_t)0x02U) /* TIM20 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_TIM8 ((uint8_t)0x03U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF3_COMP7 ((uint8_t)0x03U) /* COMP7 Alternate Function mapping */ +#define GPIO_AF3_TIM15 ((uint8_t)0x03U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF3_I2C3 ((uint8_t)0x03U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF3_TIM20 ((uint8_t)0x03U) /* TIM20 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF4_TIM8 ((uint8_t)0x04U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF4_TIM16 ((uint8_t)0x04U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF4_TIM17 ((uint8_t)0x04U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_I2S ((uint8_t)0x05U) /* I2S Alternate Function mapping */ +#define GPIO_AF5_I2S2ext ((uint8_t)0x05U) /* I2S2ext Alternate Function mapping */ +#define GPIO_AF5_TIM8 ((uint8_t)0x05U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +#define GPIO_AF5_UART4 ((uint8_t)0x05U) /* UART4 Alternate Function mapping */ +#define GPIO_AF5_UART5 ((uint8_t)0x05U) /* UART5 Alternate Function mapping */ +#define GPIO_AF5_SPI4 ((uint8_t)0x05U) /* SPI4 Alternate Function mapping */ + +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_I2S3ext ((uint8_t)0x06U) /* I2S3ext Alternate Function mapping */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_TIM8 ((uint8_t)0x06U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ +#define GPIO_AF6_TIM20 ((uint8_t)0x06U) /* TIM20 Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_COMP3 ((uint8_t)0x07U) /* COMP3 Alternate Function mapping */ +#define GPIO_AF7_COMP5 ((uint8_t)0x07U) /* COMP5 Alternate Function mapping */ +#define GPIO_AF7_COMP6 ((uint8_t)0x07U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_COMP1 ((uint8_t)0x08U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF8_COMP2 ((uint8_t)0x08U) /* COMP2 Alternate Function mapping */ +#define GPIO_AF8_COMP3 ((uint8_t)0x08U) /* COMP3 Alternate Function mapping */ +#define GPIO_AF8_COMP4 ((uint8_t)0x08U) /* COMP4 Alternate Function mapping */ +#define GPIO_AF8_COMP5 ((uint8_t)0x08U) /* COMP5 Alternate Function mapping */ +#define GPIO_AF8_COMP6 ((uint8_t)0x08U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF8_I2C3 ((uint8_t)0x08U) /* I2C3 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM8 ((uint8_t)0x09U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM4 ((uint8_t)0xAU) /* TIM4 Alternate Function mapping */ +#define GPIO_AF10_TIM8 ((uint8_t)0xAU) /* TIM8 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ +#define GPIO_AF11_TIM8 ((uint8_t)0x0BU) /* TIM8 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0xCU) /* TIM1 Alternate Function mapping */ +#define GPIO_AF12_FMC ((uint8_t)0xCU) /* FMC Alternate Function mapping */ +#define GPIO_AF12_SDIO ((uint8_t)0xCU) /* SDIO Alternate Function mapping */ + +/** + * @brief AF 14 selection + */ +#define GPIO_AF14_USB ((uint8_t)0x0EU) /* USB Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0CU) || ((AF) == (uint8_t)0x0EU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F303xE */ + +#if defined (STM32F302xE) +/*---------------------------------- STM32F302xE ------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ + +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM2 ((uint8_t)0x02U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_COMP1 ((uint8_t)0x02U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF2_I2C3 ((uint8_t)0x02U) /* I2C3 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_TIM15 ((uint8_t)0x03U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF3_I2C3 ((uint8_t)0x03U) /* I2C3 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF4_TIM16 ((uint8_t)0x04U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF4_TIM17 ((uint8_t)0x04U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_I2S ((uint8_t)0x05U) /* I2S Alternate Function mapping */ +#define GPIO_AF5_I2S2ext ((uint8_t)0x05U) /* I2S2ext Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +#define GPIO_AF5_UART4 ((uint8_t)0x05U) /* UART4 Alternate Function mapping */ +#define GPIO_AF5_UART5 ((uint8_t)0x05U) /* UART5 Alternate Function mapping */ +#define GPIO_AF5_SPI4 ((uint8_t)0x05U) /* SPI4 Alternate Function mapping */ + +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_I2S3ext ((uint8_t)0x06U) /* I2S3ext Alternate Function mapping */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_COMP6 ((uint8_t)0x07U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_COMP1 ((uint8_t)0x08U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF8_COMP2 ((uint8_t)0x08U) /* COMP2 Alternate Function mapping */ +#define GPIO_AF8_COMP4 ((uint8_t)0x08U) /* COMP4 Alternate Function mapping */ +#define GPIO_AF8_COMP6 ((uint8_t)0x08U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF8_I2C3 ((uint8_t)0x08U) /* I2C3 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM4 ((uint8_t)0xAU) /* TIM4 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0xCU) /* TIM1 Alternate Function mapping */ +#define GPIO_AF12_FMC ((uint8_t)0xCU) /* FMC Alternate Function mapping */ +#define GPIO_AF12_SDIO ((uint8_t)0xCU) /* SDIO Alternate Function mapping */ + +/** + * @brief AF 14 selection + */ +#define GPIO_AF14_USB ((uint8_t)0x0EU) /* USB Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0CU) || ((AF) == (uint8_t)0x0EU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F302xE */ + +#if defined (STM32F398xx) +/*---------------------------------- STM32F398xx ------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ + +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM2 ((uint8_t)0x02U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM8 ((uint8_t)0x02U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_COMP1 ((uint8_t)0x02U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF2_I2C3 ((uint8_t)0x02U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF2_TIM20 ((uint8_t)0x02U) /* TIM20 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_TIM8 ((uint8_t)0x03U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF3_COMP7 ((uint8_t)0x03U) /* COMP7 Alternate Function mapping */ +#define GPIO_AF3_TIM15 ((uint8_t)0x03U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF3_I2C3 ((uint8_t)0x03U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF3_TIM20 ((uint8_t)0x03U) /* TIM20 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF4_TIM8 ((uint8_t)0x04U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF4_TIM16 ((uint8_t)0x04U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF4_TIM17 ((uint8_t)0x04U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_I2S ((uint8_t)0x05U) /* I2S Alternate Function mapping */ +#define GPIO_AF5_I2S2ext ((uint8_t)0x05U) /* I2S2ext Alternate Function mapping */ +#define GPIO_AF5_TIM8 ((uint8_t)0x05U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +#define GPIO_AF5_UART4 ((uint8_t)0x05U) /* UART4 Alternate Function mapping */ +#define GPIO_AF5_UART5 ((uint8_t)0x05U) /* UART5 Alternate Function mapping */ +#define GPIO_AF5_SPI4 ((uint8_t)0x05U) /* SPI4 Alternate Function mapping */ + +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_I2S3ext ((uint8_t)0x06U) /* I2S3ext Alternate Function mapping */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_TIM8 ((uint8_t)0x06U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ +#define GPIO_AF6_TIM20 ((uint8_t)0x06U) /* TIM20 Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_COMP3 ((uint8_t)0x07U) /* COMP3 Alternate Function mapping */ +#define GPIO_AF7_COMP5 ((uint8_t)0x07U) /* COMP5 Alternate Function mapping */ +#define GPIO_AF7_COMP6 ((uint8_t)0x07U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_COMP1 ((uint8_t)0x08U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF8_COMP2 ((uint8_t)0x08U) /* COMP2 Alternate Function mapping */ +#define GPIO_AF8_COMP3 ((uint8_t)0x08U) /* COMP3 Alternate Function mapping */ +#define GPIO_AF8_COMP4 ((uint8_t)0x08U) /* COMP4 Alternate Function mapping */ +#define GPIO_AF8_COMP5 ((uint8_t)0x08U) /* COMP5 Alternate Function mapping */ +#define GPIO_AF8_COMP6 ((uint8_t)0x08U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF8_I2C3 ((uint8_t)0x08U) /* I2C3 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM8 ((uint8_t)0x09U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM4 ((uint8_t)0xAU) /* TIM4 Alternate Function mapping */ +#define GPIO_AF10_TIM8 ((uint8_t)0xAU) /* TIM8 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ +#define GPIO_AF11_TIM8 ((uint8_t)0x0BU) /* TIM8 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0xCU) /* TIM1 Alternate Function mapping */ +#define GPIO_AF12_FMC ((uint8_t)0xCU) /* FMC Alternate Function mapping */ +#define GPIO_AF12_SDIO ((uint8_t)0xCU) /* SDIO Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0CU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F398xx */ + +#if defined (STM32F358xx) +/*---------------------------------- STM32F358xx -------------------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM2 ((uint8_t)0x02U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM8 ((uint8_t)0x02U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_COMP1 ((uint8_t)0x02U) /* COMP1 Alternate Function mapping */ +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_TIM8 ((uint8_t)0x03U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF3_COMP7 ((uint8_t)0x03U) /* COMP7 Alternate Function mapping */ +#define GPIO_AF3_TIM15 ((uint8_t)0x03U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF4_TIM8 ((uint8_t)0x04U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF4_TIM16 ((uint8_t)0x04U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF4_TIM17 ((uint8_t)0x04U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1/I2S1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_I2S ((uint8_t)0x05U) /* I2S Alternate Function mapping */ +#define GPIO_AF5_I2S2ext ((uint8_t)0x05U) /* I2S2ext Alternate Function mapping */ +#define GPIO_AF5_TIM8 ((uint8_t)0x05U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +#define GPIO_AF5_UART4 ((uint8_t)0x05U) /* UART4 Alternate Function mapping */ +#define GPIO_AF5_UART5 ((uint8_t)0x05U) /* UART5 Alternate Function mapping */ +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_I2S3ext ((uint8_t)0x06U) /* I2S3ext Alternate Function mapping */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_TIM8 ((uint8_t)0x06U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_COMP3 ((uint8_t)0x07U) /* COMP3 Alternate Function mapping */ +#define GPIO_AF7_COMP5 ((uint8_t)0x07U) /* COMP5 Alternate Function mapping */ +#define GPIO_AF7_COMP6 ((uint8_t)0x07U) /* COMP6 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_COMP1 ((uint8_t)0x08U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF8_COMP2 ((uint8_t)0x08U) /* COMP2 Alternate Function mapping */ +#define GPIO_AF8_COMP3 ((uint8_t)0x08U) /* COMP3 Alternate Function mapping */ +#define GPIO_AF8_COMP4 ((uint8_t)0x08U) /* COMP4 Alternate Function mapping */ +#define GPIO_AF8_COMP5 ((uint8_t)0x08U) /* COMP5 Alternate Function mapping */ +#define GPIO_AF8_COMP6 ((uint8_t)0x08U) /* COMP6 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM8 ((uint8_t)0x09U) /* TIM8 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM4 ((uint8_t)0xAU) /* TIM4 Alternate Function mapping */ +#define GPIO_AF10_TIM8 ((uint8_t)0xAU) /* TIM8 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ +#define GPIO_AF11_TIM8 ((uint8_t)0x0BU) /* TIM8 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0xCU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0CU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F358xx */ + +#if defined (STM32F373xC) +/*---------------------------------- STM32F373xC--------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM5 ((uint8_t)0x02U) /* TIM5 Alternate Function mapping */ +#define GPIO_AF2_TIM13 ((uint8_t)0x02U) /* TIM13 Alternate Function mapping */ +#define GPIO_AF2_TIM14 ((uint8_t)0x02U) /* TIM14 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_TIM19 ((uint8_t)0x02U) /* TIM19 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1/I2S1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI1 ((uint8_t)0x06U) /* SPI1/I2S1 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ +#define GPIO_AF6_CEC ((uint8_t)0x06U) /* CEC Alternate Function mapping */ +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ +#define GPIO_AF7_CEC ((uint8_t)0x07U) /* CEC Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_COMP1 ((uint8_t)0x08U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF8_COMP2 ((uint8_t)0x08U) /* COMP2 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM12 ((uint8_t)0x09U) /* TIM12 Alternate Function mapping */ +#define GPIO_AF9_TIM13 ((uint8_t)0x09U) /* TIM13 Alternate Function mapping */ +#define GPIO_AF9_TIM14 ((uint8_t)0x09U) /* TIM14 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM4 ((uint8_t)0xAU) /* TIM4 Alternate Function mapping */ +#define GPIO_AF10_TIM12 ((uint8_t)0xAU) /* TIM12 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM19 ((uint8_t)0x0BU) /* TIM19 Alternate Function mapping */ + + +/** + * @brief AF 14 selection + */ +#define GPIO_AF14_USB ((uint8_t)0x0EU) /* USB Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0BU) || ((AF) == (uint8_t)0x0EU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F373xC */ + + +#if defined (STM32F378xx) +/*---------------------------------------- STM32F378xx--------------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ +#define GPIO_AF2_TIM5 ((uint8_t)0x02U) /* TIM5 Alternate Function mapping */ +#define GPIO_AF2_TIM13 ((uint8_t)0x02U) /* TIM13 Alternate Function mapping */ +#define GPIO_AF2_TIM14 ((uint8_t)0x02U) /* TIM14 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_TIM19 ((uint8_t)0x02U) /* TIM19 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1/I2S1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ + +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_SPI1 ((uint8_t)0x06U) /* SPI1/I2S1 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ +#define GPIO_AF6_CEC ((uint8_t)0x06U) /* CEC Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ +#define GPIO_AF7_CEC ((uint8_t)0x07U) /* CEC Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_COMP1 ((uint8_t)0x08U) /* COMP1 Alternate Function mapping */ +#define GPIO_AF8_COMP2 ((uint8_t)0x08U) /* COMP2 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM12 ((uint8_t)0x09U) /* TIM12 Alternate Function mapping */ +#define GPIO_AF9_TIM13 ((uint8_t)0x09U) /* TIM13 Alternate Function mapping */ +#define GPIO_AF9_TIM14 ((uint8_t)0x09U) /* TIM14 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM4 ((uint8_t)0xAU) /* TIM4 Alternate Function mapping */ +#define GPIO_AF10_TIM12 ((uint8_t)0xAU) /* TIM12 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ + +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM19 ((uint8_t)0x0BU) /* TIM19 Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0BU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F378xx */ + +#if defined (STM32F303x8) +/*---------------------------------- STM32F303x8--------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_TIM16 ((uint8_t)0x02U) /* TIM16 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_GPCOMP6 ((uint8_t)0x07U) /* GPCOMP6 Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_GPCOMP2 ((uint8_t)0x08U) /* GPCOMP2 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP4 ((uint8_t)0x08U) /* GPCOMP4 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP6 ((uint8_t)0x08U) /* GPCOMP6 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ + +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0x0CU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 13 selection + */ +#define GPIO_AF13_OPAMP2 ((uint8_t)0x0DU) /* OPAMP2 Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0DU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F303x8 */ + +#if defined (STM32F334x8) || defined (STM32F328xx) +/*---------------------------------- STM32F334x8/STM32F328xx -------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_TIM16 ((uint8_t)0x02U) /* TIM16 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_HRTIM1 ((uint8_t)0x03U) /* HRTIM1 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_GPCOMP6 ((uint8_t)0x07U) /* GPCOMP6 Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_GPCOMP2 ((uint8_t)0x08U) /* GPCOMP2 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP4 ((uint8_t)0x08U) /* GPCOMP4 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP6 ((uint8_t)0x08U) /* GPCOMP6 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM3 ((uint8_t)0xAU) /* TIM3 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ + +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0x0CU) /* TIM1 Alternate Function mapping */ +#define GPIO_AF12_HRTIM1 ((uint8_t)0x0CU) /* HRTIM1 Alternate Function mapping */ + +/** + * @brief AF 13 selection + */ +#define GPIO_AF13_OPAMP2 ((uint8_t)0x0DU) /* OPAMP2 Alternate Function mapping */ +#define GPIO_AF13_HRTIM1 ((uint8_t)0x0DU) /* HRTIM1 Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0DU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F334x8 || STM32F328xx */ + +#if defined (STM32F301x8) || defined (STM32F318xx) +/*---------------------------------- STM32F301x8 / STM32F318xx ------------------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_I2C3 ((uint8_t)0x02U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_TIM2 ((uint8_t)0x02U) /* TIM2 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_I2C3 ((uint8_t)0x03U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF3_TIM15 ((uint8_t)0x03U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF4_TIM16 ((uint8_t)0x04U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF4_TIM17 ((uint8_t)0x04U) /* TIM17 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_GPCOMP6 ((uint8_t)0x07U) /* GPCOMP6 Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_I2C3 ((uint8_t)0x08U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP2 ((uint8_t)0x08U) /* GPCOMP2 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP4 ((uint8_t)0x08U) /* GPCOMP4 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP6 ((uint8_t)0x08U) /* GPCOMP6 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ + +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0x0CU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0CU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F301x8 || STM32F318xx */ + +#if defined (STM32F302x8) +/*---------------------------------- STM32F302x8------------------------------------------*/ +/** + * @brief AF 0 selection + */ +#define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ +#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC Alternate Function mapping */ +#define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ +#define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ +#define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ + +/** + * @brief AF 1 selection + */ +#define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ +#define GPIO_AF1_TIM15 ((uint8_t)0x01U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF1_TIM16 ((uint8_t)0x01U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF1_TIM17 ((uint8_t)0x01U) /* TIM17 Alternate Function mapping */ +#define GPIO_AF1_EVENTOUT ((uint8_t)0x01U) /* EVENTOUT Alternate Function mapping */ +/** + * @brief AF 2 selection + */ +#define GPIO_AF2_I2C3 ((uint8_t)0x02U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF2_TIM1 ((uint8_t)0x02U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF2_TIM15 ((uint8_t)0x02U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF2_TIM2 ((uint8_t)0x02U) /* TIM2 Alternate Function mapping */ + +/** + * @brief AF 3 selection + */ +#define GPIO_AF3_TSC ((uint8_t)0x03U) /* TSC Alternate Function mapping */ +#define GPIO_AF3_I2C3 ((uint8_t)0x03U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF3_TIM15 ((uint8_t)0x03U) /* TIM15 Alternate Function mapping */ + +/** + * @brief AF 4 selection + */ +#define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ +#define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ +#define GPIO_AF4_TIM1 ((uint8_t)0x04U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF4_TIM16 ((uint8_t)0x04U) /* TIM16 Alternate Function mapping */ +#define GPIO_AF4_TIM17 ((uint8_t)0x04U) /* TIM17 Alternate Function mapping */ + +/** + * @brief AF 5 selection + */ +#define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1 Alternate Function mapping */ +#define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF5_SPI3 ((uint8_t)0x05U) /* SPI3/I2S3 Alternate Function mapping */ +#define GPIO_AF5_IR ((uint8_t)0x05U) /* IR Alternate Function mapping */ +/** + * @brief AF 6 selection + */ +#define GPIO_AF6_TIM1 ((uint8_t)0x06U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF6_IR ((uint8_t)0x06U) /* IR Alternate Function mapping */ +#define GPIO_AF6_SPI2 ((uint8_t)0x06U) /* SPI2/I2S2 Alternate Function mapping */ +#define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ + +/** + * @brief AF 7 selection + */ +#define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ +#define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ +#define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ +#define GPIO_AF7_GPCOMP6 ((uint8_t)0x07U) /* GPCOMP6 Alternate Function mapping */ +#define GPIO_AF7_CAN ((uint8_t)0x07U) /* CAN Alternate Function mapping */ + +/** + * @brief AF 8 selection + */ +#define GPIO_AF8_I2C3 ((uint8_t)0x08U) /* I2C3 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP2 ((uint8_t)0x08U) /* GPCOMP2 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP4 ((uint8_t)0x08U) /* GPCOMP4 Alternate Function mapping */ +#define GPIO_AF8_GPCOMP6 ((uint8_t)0x08U) /* GPCOMP6 Alternate Function mapping */ + +/** + * @brief AF 9 selection + */ +#define GPIO_AF9_TIM1 ((uint8_t)0x09U) /* TIM1 Alternate Function mapping */ +#define GPIO_AF9_TIM15 ((uint8_t)0x09U) /* TIM15 Alternate Function mapping */ +#define GPIO_AF9_CAN ((uint8_t)0x09U) /* CAN Alternate Function mapping */ + +/** + * @brief AF 10 selection + */ +#define GPIO_AF10_TIM2 ((uint8_t)0xAU) /* TIM2 Alternate Function mapping */ +#define GPIO_AF10_TIM17 ((uint8_t)0xAU) /* TIM17 Alternate Function mapping */ + +/** + * @brief AF 11 selection + */ +#define GPIO_AF11_TIM1 ((uint8_t)0x0BU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 12 selection + */ +#define GPIO_AF12_TIM1 ((uint8_t)0x0CU) /* TIM1 Alternate Function mapping */ + +/** + * @brief AF 15 selection + */ +#define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ + +#define IS_GPIO_AF(AF) (((AF) <= (uint8_t)0x0CU) || ((AF) == (uint8_t)0x0FU)) +/*------------------------------------------------------------------------------------------*/ +#endif /* STM32F302x8 */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros + * @{ + */ + +/** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index +* @{ + */ +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ + ((__GPIOx__) == (GPIOB))? 1U :\ + ((__GPIOx__) == (GPIOC))? 2U :\ + ((__GPIOx__) == (GPIOD))? 3U : 5U) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F373xC) || defined(STM32F378xx) +#define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ + ((__GPIOx__) == (GPIOB))? 1U :\ + ((__GPIOx__) == (GPIOC))? 2U :\ + ((__GPIOx__) == (GPIOD))? 3U :\ + ((__GPIOx__) == (GPIOE))? 4U : 5U) +#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ + ((__GPIOx__) == (GPIOB))? 1U :\ + ((__GPIOx__) == (GPIOC))? 2U :\ + ((__GPIOx__) == (GPIOD))? 3U :\ + ((__GPIOx__) == (GPIOE))? 4U :\ + ((__GPIOx__) == (GPIOF))? 5U :\ + ((__GPIOx__) == (GPIOG))? 6U : 7U) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +/** + * @} + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_GPIO_EX_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h new file mode 100644 index 0000000..814cb37 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h @@ -0,0 +1,840 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_i2c.h + * @author MCD Application Team + * @brief Header file of I2C HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_HAL_I2C_H +#define STM32F3xx_HAL_I2C_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup I2C + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup I2C_Exported_Types I2C Exported Types + * @{ + */ + +/** @defgroup I2C_Configuration_Structure_definition I2C Configuration Structure definition + * @brief I2C Configuration Structure definition + * @{ + */ +typedef struct +{ + uint32_t Timing; /*!< Specifies the I2C_TIMINGR_register value. + This parameter calculated by referring to I2C initialization section + in Reference manual */ + + uint32_t OwnAddress1; /*!< Specifies the first device own address. + This parameter can be a 7-bit or 10-bit address. */ + + uint32_t AddressingMode; /*!< Specifies if 7-bit or 10-bit addressing mode is selected. + This parameter can be a value of @ref I2C_ADDRESSING_MODE */ + + uint32_t DualAddressMode; /*!< Specifies if dual addressing mode is selected. + This parameter can be a value of @ref I2C_DUAL_ADDRESSING_MODE */ + + uint32_t OwnAddress2; /*!< Specifies the second device own address if dual addressing mode is selected + This parameter can be a 7-bit address. */ + + uint32_t OwnAddress2Masks; /*!< Specifies the acknowledge mask address second device own address if dual addressing + mode is selected. + This parameter can be a value of @ref I2C_OWN_ADDRESS2_MASKS */ + + uint32_t GeneralCallMode; /*!< Specifies if general call mode is selected. + This parameter can be a value of @ref I2C_GENERAL_CALL_ADDRESSING_MODE */ + + uint32_t NoStretchMode; /*!< Specifies if nostretch mode is selected. + This parameter can be a value of @ref I2C_NOSTRETCH_MODE */ + +} I2C_InitTypeDef; + +/** + * @} + */ + +/** @defgroup HAL_state_structure_definition HAL state structure definition + * @brief HAL State structure definition + * @note HAL I2C State value coding follow below described bitmap :\n + * b7-b6 Error information\n + * 00 : No Error\n + * 01 : Abort (Abort user request on going)\n + * 10 : Timeout\n + * 11 : Error\n + * b5 Peripheral initialization status\n + * 0 : Reset (peripheral not initialized)\n + * 1 : Init done (peripheral initialized and ready to use. HAL I2C Init function called)\n + * b4 (not used)\n + * x : Should be set to 0\n + * b3\n + * 0 : Ready or Busy (No Listen mode ongoing)\n + * 1 : Listen (peripheral in Address Listen Mode)\n + * b2 Intrinsic process state\n + * 0 : Ready\n + * 1 : Busy (peripheral busy with some configuration or internal operations)\n + * b1 Rx state\n + * 0 : Ready (no Rx operation ongoing)\n + * 1 : Busy (Rx operation ongoing)\n + * b0 Tx state\n + * 0 : Ready (no Tx operation ongoing)\n + * 1 : Busy (Tx operation ongoing) + * @{ + */ +typedef enum +{ + HAL_I2C_STATE_RESET = 0x00U, /*!< Peripheral is not yet Initialized */ + HAL_I2C_STATE_READY = 0x20U, /*!< Peripheral Initialized and ready for use */ + HAL_I2C_STATE_BUSY = 0x24U, /*!< An internal process is ongoing */ + HAL_I2C_STATE_BUSY_TX = 0x21U, /*!< Data Transmission process is ongoing */ + HAL_I2C_STATE_BUSY_RX = 0x22U, /*!< Data Reception process is ongoing */ + HAL_I2C_STATE_LISTEN = 0x28U, /*!< Address Listen Mode is ongoing */ + HAL_I2C_STATE_BUSY_TX_LISTEN = 0x29U, /*!< Address Listen Mode and Data Transmission + process is ongoing */ + HAL_I2C_STATE_BUSY_RX_LISTEN = 0x2AU, /*!< Address Listen Mode and Data Reception + process is ongoing */ + HAL_I2C_STATE_ABORT = 0x60U, /*!< Abort user request ongoing */ + HAL_I2C_STATE_TIMEOUT = 0xA0U, /*!< Timeout state */ + HAL_I2C_STATE_ERROR = 0xE0U /*!< Error */ + +} HAL_I2C_StateTypeDef; + +/** + * @} + */ + +/** @defgroup HAL_mode_structure_definition HAL mode structure definition + * @brief HAL Mode structure definition + * @note HAL I2C Mode value coding follow below described bitmap :\n + * b7 (not used)\n + * x : Should be set to 0\n + * b6\n + * 0 : None\n + * 1 : Memory (HAL I2C communication is in Memory Mode)\n + * b5\n + * 0 : None\n + * 1 : Slave (HAL I2C communication is in Slave Mode)\n + * b4\n + * 0 : None\n + * 1 : Master (HAL I2C communication is in Master Mode)\n + * b3-b2-b1-b0 (not used)\n + * xxxx : Should be set to 0000 + * @{ + */ +typedef enum +{ + HAL_I2C_MODE_NONE = 0x00U, /*!< No I2C communication on going */ + HAL_I2C_MODE_MASTER = 0x10U, /*!< I2C communication is in Master Mode */ + HAL_I2C_MODE_SLAVE = 0x20U, /*!< I2C communication is in Slave Mode */ + HAL_I2C_MODE_MEM = 0x40U /*!< I2C communication is in Memory Mode */ + +} HAL_I2C_ModeTypeDef; + +/** + * @} + */ + +/** @defgroup I2C_Error_Code_definition I2C Error Code definition + * @brief I2C Error Code definition + * @{ + */ +#define HAL_I2C_ERROR_NONE (0x00000000U) /*!< No error */ +#define HAL_I2C_ERROR_BERR (0x00000001U) /*!< BERR error */ +#define HAL_I2C_ERROR_ARLO (0x00000002U) /*!< ARLO error */ +#define HAL_I2C_ERROR_AF (0x00000004U) /*!< ACKF error */ +#define HAL_I2C_ERROR_OVR (0x00000008U) /*!< OVR error */ +#define HAL_I2C_ERROR_DMA (0x00000010U) /*!< DMA transfer error */ +#define HAL_I2C_ERROR_TIMEOUT (0x00000020U) /*!< Timeout error */ +#define HAL_I2C_ERROR_SIZE (0x00000040U) /*!< Size Management error */ +#define HAL_I2C_ERROR_DMA_PARAM (0x00000080U) /*!< DMA Parameter Error */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) +#define HAL_I2C_ERROR_INVALID_CALLBACK (0x00000100U) /*!< Invalid Callback error */ +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ +#define HAL_I2C_ERROR_INVALID_PARAM (0x00000200U) /*!< Invalid Parameters error */ +/** + * @} + */ + +/** @defgroup I2C_handle_Structure_definition I2C handle Structure definition + * @brief I2C handle Structure definition + * @{ + */ +typedef struct __I2C_HandleTypeDef +{ + I2C_TypeDef *Instance; /*!< I2C registers base address */ + + I2C_InitTypeDef Init; /*!< I2C communication parameters */ + + uint8_t *pBuffPtr; /*!< Pointer to I2C transfer buffer */ + + uint16_t XferSize; /*!< I2C transfer size */ + + __IO uint16_t XferCount; /*!< I2C transfer counter */ + + __IO uint32_t XferOptions; /*!< I2C sequantial transfer options, this parameter can + be a value of @ref I2C_XFEROPTIONS */ + + __IO uint32_t PreviousState; /*!< I2C communication Previous state */ + + HAL_StatusTypeDef(*XferISR)(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, uint32_t ITSources); + /*!< I2C transfer IRQ handler function pointer */ + + DMA_HandleTypeDef *hdmatx; /*!< I2C Tx DMA handle parameters */ + + DMA_HandleTypeDef *hdmarx; /*!< I2C Rx DMA handle parameters */ + + + HAL_LockTypeDef Lock; /*!< I2C locking object */ + + __IO HAL_I2C_StateTypeDef State; /*!< I2C communication state */ + + __IO HAL_I2C_ModeTypeDef Mode; /*!< I2C communication mode */ + + __IO uint32_t ErrorCode; /*!< I2C Error code */ + + __IO uint32_t AddrEventCount; /*!< I2C Address Event counter */ + + __IO uint32_t Devaddress; /*!< I2C Target device address */ + + __IO uint32_t Memaddress; /*!< I2C Target memory address */ + +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + void (* MasterTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Master Tx Transfer completed callback */ + void (* MasterRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Master Rx Transfer completed callback */ + void (* SlaveTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Slave Tx Transfer completed callback */ + void (* SlaveRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Slave Rx Transfer completed callback */ + void (* ListenCpltCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Listen Complete callback */ + void (* MemTxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Memory Tx Transfer completed callback */ + void (* MemRxCpltCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Memory Rx Transfer completed callback */ + void (* ErrorCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Error callback */ + void (* AbortCpltCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Abort callback */ + + void (* AddrCallback)(struct __I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode); + /*!< I2C Slave Address Match callback */ + + void (* MspInitCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Msp Init callback */ + void (* MspDeInitCallback)(struct __I2C_HandleTypeDef *hi2c); + /*!< I2C Msp DeInit callback */ + +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ +} I2C_HandleTypeDef; + +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) +/** + * @brief HAL I2C Callback ID enumeration definition + */ +typedef enum +{ + HAL_I2C_MASTER_TX_COMPLETE_CB_ID = 0x00U, /*!< I2C Master Tx Transfer completed callback ID */ + HAL_I2C_MASTER_RX_COMPLETE_CB_ID = 0x01U, /*!< I2C Master Rx Transfer completed callback ID */ + HAL_I2C_SLAVE_TX_COMPLETE_CB_ID = 0x02U, /*!< I2C Slave Tx Transfer completed callback ID */ + HAL_I2C_SLAVE_RX_COMPLETE_CB_ID = 0x03U, /*!< I2C Slave Rx Transfer completed callback ID */ + HAL_I2C_LISTEN_COMPLETE_CB_ID = 0x04U, /*!< I2C Listen Complete callback ID */ + HAL_I2C_MEM_TX_COMPLETE_CB_ID = 0x05U, /*!< I2C Memory Tx Transfer callback ID */ + HAL_I2C_MEM_RX_COMPLETE_CB_ID = 0x06U, /*!< I2C Memory Rx Transfer completed callback ID */ + HAL_I2C_ERROR_CB_ID = 0x07U, /*!< I2C Error callback ID */ + HAL_I2C_ABORT_CB_ID = 0x08U, /*!< I2C Abort callback ID */ + + HAL_I2C_MSPINIT_CB_ID = 0x09U, /*!< I2C Msp Init callback ID */ + HAL_I2C_MSPDEINIT_CB_ID = 0x0AU /*!< I2C Msp DeInit callback ID */ + +} HAL_I2C_CallbackIDTypeDef; + +/** + * @brief HAL I2C Callback pointer definition + */ +typedef void (*pI2C_CallbackTypeDef)(I2C_HandleTypeDef *hi2c); +/*!< pointer to an I2C callback function */ +typedef void (*pI2C_AddrCallbackTypeDef)(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, + uint16_t AddrMatchCode); +/*!< pointer to an I2C Address Match callback function */ + +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ +/** + * @} + */ + +/** + * @} + */ +/* Exported constants --------------------------------------------------------*/ + +/** @defgroup I2C_Exported_Constants I2C Exported Constants + * @{ + */ + +/** @defgroup I2C_XFEROPTIONS I2C Sequential Transfer Options + * @{ + */ +#define I2C_FIRST_FRAME ((uint32_t)I2C_SOFTEND_MODE) +#define I2C_FIRST_AND_NEXT_FRAME ((uint32_t)(I2C_RELOAD_MODE | I2C_SOFTEND_MODE)) +#define I2C_NEXT_FRAME ((uint32_t)(I2C_RELOAD_MODE | I2C_SOFTEND_MODE)) +#define I2C_FIRST_AND_LAST_FRAME ((uint32_t)I2C_AUTOEND_MODE) +#define I2C_LAST_FRAME ((uint32_t)I2C_AUTOEND_MODE) +#define I2C_LAST_FRAME_NO_STOP ((uint32_t)I2C_SOFTEND_MODE) + +/* List of XferOptions in usage of : + * 1- Restart condition in all use cases (direction change or not) + */ +#define I2C_OTHER_FRAME (0x000000AAU) +#define I2C_OTHER_AND_LAST_FRAME (0x0000AA00U) +/** + * @} + */ + +/** @defgroup I2C_ADDRESSING_MODE I2C Addressing Mode + * @{ + */ +#define I2C_ADDRESSINGMODE_7BIT (0x00000001U) +#define I2C_ADDRESSINGMODE_10BIT (0x00000002U) +/** + * @} + */ + +/** @defgroup I2C_DUAL_ADDRESSING_MODE I2C Dual Addressing Mode + * @{ + */ +#define I2C_DUALADDRESS_DISABLE (0x00000000U) +#define I2C_DUALADDRESS_ENABLE I2C_OAR2_OA2EN +/** + * @} + */ + +/** @defgroup I2C_OWN_ADDRESS2_MASKS I2C Own Address2 Masks + * @{ + */ +#define I2C_OA2_NOMASK ((uint8_t)0x00U) +#define I2C_OA2_MASK01 ((uint8_t)0x01U) +#define I2C_OA2_MASK02 ((uint8_t)0x02U) +#define I2C_OA2_MASK03 ((uint8_t)0x03U) +#define I2C_OA2_MASK04 ((uint8_t)0x04U) +#define I2C_OA2_MASK05 ((uint8_t)0x05U) +#define I2C_OA2_MASK06 ((uint8_t)0x06U) +#define I2C_OA2_MASK07 ((uint8_t)0x07U) +/** + * @} + */ + +/** @defgroup I2C_GENERAL_CALL_ADDRESSING_MODE I2C General Call Addressing Mode + * @{ + */ +#define I2C_GENERALCALL_DISABLE (0x00000000U) +#define I2C_GENERALCALL_ENABLE I2C_CR1_GCEN +/** + * @} + */ + +/** @defgroup I2C_NOSTRETCH_MODE I2C No-Stretch Mode + * @{ + */ +#define I2C_NOSTRETCH_DISABLE (0x00000000U) +#define I2C_NOSTRETCH_ENABLE I2C_CR1_NOSTRETCH +/** + * @} + */ + +/** @defgroup I2C_MEMORY_ADDRESS_SIZE I2C Memory Address Size + * @{ + */ +#define I2C_MEMADD_SIZE_8BIT (0x00000001U) +#define I2C_MEMADD_SIZE_16BIT (0x00000002U) +/** + * @} + */ + +/** @defgroup I2C_XFERDIRECTION I2C Transfer Direction Master Point of View + * @{ + */ +#define I2C_DIRECTION_TRANSMIT (0x00000000U) +#define I2C_DIRECTION_RECEIVE (0x00000001U) +/** + * @} + */ + +/** @defgroup I2C_RELOAD_END_MODE I2C Reload End Mode + * @{ + */ +#define I2C_RELOAD_MODE I2C_CR2_RELOAD +#define I2C_AUTOEND_MODE I2C_CR2_AUTOEND +#define I2C_SOFTEND_MODE (0x00000000U) +/** + * @} + */ + +/** @defgroup I2C_START_STOP_MODE I2C Start or Stop Mode + * @{ + */ +#define I2C_NO_STARTSTOP (0x00000000U) +#define I2C_GENERATE_STOP (uint32_t)(0x80000000U | I2C_CR2_STOP) +#define I2C_GENERATE_START_READ (uint32_t)(0x80000000U | I2C_CR2_START | I2C_CR2_RD_WRN) +#define I2C_GENERATE_START_WRITE (uint32_t)(0x80000000U | I2C_CR2_START) +/** + * @} + */ + +/** @defgroup I2C_Interrupt_configuration_definition I2C Interrupt configuration definition + * @brief I2C Interrupt definition + * Elements values convention: 0xXXXXXXXX + * - XXXXXXXX : Interrupt control mask + * @{ + */ +#define I2C_IT_ERRI I2C_CR1_ERRIE +#define I2C_IT_TCI I2C_CR1_TCIE +#define I2C_IT_STOPI I2C_CR1_STOPIE +#define I2C_IT_NACKI I2C_CR1_NACKIE +#define I2C_IT_ADDRI I2C_CR1_ADDRIE +#define I2C_IT_RXI I2C_CR1_RXIE +#define I2C_IT_TXI I2C_CR1_TXIE +/** + * @} + */ + +/** @defgroup I2C_Flag_definition I2C Flag definition + * @{ + */ +#define I2C_FLAG_TXE I2C_ISR_TXE +#define I2C_FLAG_TXIS I2C_ISR_TXIS +#define I2C_FLAG_RXNE I2C_ISR_RXNE +#define I2C_FLAG_ADDR I2C_ISR_ADDR +#define I2C_FLAG_AF I2C_ISR_NACKF +#define I2C_FLAG_STOPF I2C_ISR_STOPF +#define I2C_FLAG_TC I2C_ISR_TC +#define I2C_FLAG_TCR I2C_ISR_TCR +#define I2C_FLAG_BERR I2C_ISR_BERR +#define I2C_FLAG_ARLO I2C_ISR_ARLO +#define I2C_FLAG_OVR I2C_ISR_OVR +#define I2C_FLAG_PECERR I2C_ISR_PECERR +#define I2C_FLAG_TIMEOUT I2C_ISR_TIMEOUT +#define I2C_FLAG_ALERT I2C_ISR_ALERT +#define I2C_FLAG_BUSY I2C_ISR_BUSY +#define I2C_FLAG_DIR I2C_ISR_DIR +/** + * @} + */ + +/** + * @} + */ + +/* Exported macros -----------------------------------------------------------*/ + +/** @defgroup I2C_Exported_Macros I2C Exported Macros + * @{ + */ + +/** @brief Reset I2C handle state. + * @param __HANDLE__ specifies the I2C Handle. + * @retval None + */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) +#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) do{ \ + (__HANDLE__)->State = HAL_I2C_STATE_RESET; \ + (__HANDLE__)->MspInitCallback = NULL; \ + (__HANDLE__)->MspDeInitCallback = NULL; \ + } while(0) +#else +#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_I2C_STATE_RESET) +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + +/** @brief Enable the specified I2C interrupt. + * @param __HANDLE__ specifies the I2C Handle. + * @param __INTERRUPT__ specifies the interrupt source to enable. + * This parameter can be one of the following values: + * @arg @ref I2C_IT_ERRI Errors interrupt enable + * @arg @ref I2C_IT_TCI Transfer complete interrupt enable + * @arg @ref I2C_IT_STOPI STOP detection interrupt enable + * @arg @ref I2C_IT_NACKI NACK received interrupt enable + * @arg @ref I2C_IT_ADDRI Address match interrupt enable + * @arg @ref I2C_IT_RXI RX interrupt enable + * @arg @ref I2C_IT_TXI TX interrupt enable + * + * @retval None + */ +#define __HAL_I2C_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 |= (__INTERRUPT__)) + +/** @brief Disable the specified I2C interrupt. + * @param __HANDLE__ specifies the I2C Handle. + * @param __INTERRUPT__ specifies the interrupt source to disable. + * This parameter can be one of the following values: + * @arg @ref I2C_IT_ERRI Errors interrupt enable + * @arg @ref I2C_IT_TCI Transfer complete interrupt enable + * @arg @ref I2C_IT_STOPI STOP detection interrupt enable + * @arg @ref I2C_IT_NACKI NACK received interrupt enable + * @arg @ref I2C_IT_ADDRI Address match interrupt enable + * @arg @ref I2C_IT_RXI RX interrupt enable + * @arg @ref I2C_IT_TXI TX interrupt enable + * + * @retval None + */ +#define __HAL_I2C_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR1 &= (~(__INTERRUPT__))) + +/** @brief Check whether the specified I2C interrupt source is enabled or not. + * @param __HANDLE__ specifies the I2C Handle. + * @param __INTERRUPT__ specifies the I2C interrupt source to check. + * This parameter can be one of the following values: + * @arg @ref I2C_IT_ERRI Errors interrupt enable + * @arg @ref I2C_IT_TCI Transfer complete interrupt enable + * @arg @ref I2C_IT_STOPI STOP detection interrupt enable + * @arg @ref I2C_IT_NACKI NACK received interrupt enable + * @arg @ref I2C_IT_ADDRI Address match interrupt enable + * @arg @ref I2C_IT_RXI RX interrupt enable + * @arg @ref I2C_IT_TXI TX interrupt enable + * + * @retval The new state of __INTERRUPT__ (SET or RESET). + */ +#define __HAL_I2C_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR1 & \ + (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET) + +/** @brief Check whether the specified I2C flag is set or not. + * @param __HANDLE__ specifies the I2C Handle. + * @param __FLAG__ specifies the flag to check. + * This parameter can be one of the following values: + * @arg @ref I2C_FLAG_TXE Transmit data register empty + * @arg @ref I2C_FLAG_TXIS Transmit interrupt status + * @arg @ref I2C_FLAG_RXNE Receive data register not empty + * @arg @ref I2C_FLAG_ADDR Address matched (slave mode) + * @arg @ref I2C_FLAG_AF Acknowledge failure received flag + * @arg @ref I2C_FLAG_STOPF STOP detection flag + * @arg @ref I2C_FLAG_TC Transfer complete (master mode) + * @arg @ref I2C_FLAG_TCR Transfer complete reload + * @arg @ref I2C_FLAG_BERR Bus error + * @arg @ref I2C_FLAG_ARLO Arbitration lost + * @arg @ref I2C_FLAG_OVR Overrun/Underrun + * @arg @ref I2C_FLAG_PECERR PEC error in reception + * @arg @ref I2C_FLAG_TIMEOUT Timeout or Tlow detection flag + * @arg @ref I2C_FLAG_ALERT SMBus alert + * @arg @ref I2C_FLAG_BUSY Bus busy + * @arg @ref I2C_FLAG_DIR Transfer direction (slave mode) + * + * @retval The new state of __FLAG__ (SET or RESET). + */ +#define I2C_FLAG_MASK (0x0001FFFFU) +#define __HAL_I2C_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & \ + (__FLAG__)) == (__FLAG__)) ? SET : RESET) + +/** @brief Clear the I2C pending flags which are cleared by writing 1 in a specific bit. + * @param __HANDLE__ specifies the I2C Handle. + * @param __FLAG__ specifies the flag to clear. + * This parameter can be any combination of the following values: + * @arg @ref I2C_FLAG_TXE Transmit data register empty + * @arg @ref I2C_FLAG_ADDR Address matched (slave mode) + * @arg @ref I2C_FLAG_AF Acknowledge failure received flag + * @arg @ref I2C_FLAG_STOPF STOP detection flag + * @arg @ref I2C_FLAG_BERR Bus error + * @arg @ref I2C_FLAG_ARLO Arbitration lost + * @arg @ref I2C_FLAG_OVR Overrun/Underrun + * @arg @ref I2C_FLAG_PECERR PEC error in reception + * @arg @ref I2C_FLAG_TIMEOUT Timeout or Tlow detection flag + * @arg @ref I2C_FLAG_ALERT SMBus alert + * + * @retval None + */ +#define __HAL_I2C_CLEAR_FLAG(__HANDLE__, __FLAG__) (((__FLAG__) == I2C_FLAG_TXE) ? \ + ((__HANDLE__)->Instance->ISR |= (__FLAG__)) : \ + ((__HANDLE__)->Instance->ICR = (__FLAG__))) + +/** @brief Enable the specified I2C peripheral. + * @param __HANDLE__ specifies the I2C Handle. + * @retval None + */ +#define __HAL_I2C_ENABLE(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE)) + +/** @brief Disable the specified I2C peripheral. + * @param __HANDLE__ specifies the I2C Handle. + * @retval None + */ +#define __HAL_I2C_DISABLE(__HANDLE__) (CLEAR_BIT((__HANDLE__)->Instance->CR1, I2C_CR1_PE)) + +/** @brief Generate a Non-Acknowledge I2C peripheral in Slave mode. + * @param __HANDLE__ specifies the I2C Handle. + * @retval None + */ +#define __HAL_I2C_GENERATE_NACK(__HANDLE__) (SET_BIT((__HANDLE__)->Instance->CR2, I2C_CR2_NACK)) +/** + * @} + */ + +/* Include I2C HAL Extended module */ +#include "stm32f3xx_hal_i2c_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup I2C_Exported_Functions + * @{ + */ + +/** @addtogroup I2C_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ +/* Initialization and de-initialization functions******************************/ +HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c); +HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c); +void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c); +void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c); + +/* Callbacks Register/UnRegister functions ***********************************/ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) +HAL_StatusTypeDef HAL_I2C_RegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID, + pI2C_CallbackTypeDef pCallback); +HAL_StatusTypeDef HAL_I2C_UnRegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID); + +HAL_StatusTypeDef HAL_I2C_RegisterAddrCallback(I2C_HandleTypeDef *hi2c, pI2C_AddrCallbackTypeDef pCallback); +HAL_StatusTypeDef HAL_I2C_UnRegisterAddrCallback(I2C_HandleTypeDef *hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ +/** + * @} + */ + +/** @addtogroup I2C_Exported_Functions_Group2 Input and Output operation functions + * @{ + */ +/* IO operation functions ****************************************************/ +/******* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t Timeout); +HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t Timeout); +HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, + uint32_t Timeout); + +/******* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Slave_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Slave_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size); + +HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t XferOptions); +HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t XferOptions); +HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t XferOptions); +HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t XferOptions); +HAL_StatusTypeDef HAL_I2C_EnableListen_IT(I2C_HandleTypeDef *hi2c); +HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c); +HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress); + +/******* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size); + +HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t XferOptions); +HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t XferOptions); +HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t XferOptions); +HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t XferOptions); +/** + * @} + */ + +/** @addtogroup I2C_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks + * @{ + */ +/******* I2C IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */ +void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c); +void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c); +void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c); +void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c); +void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c); +void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c); +void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode); +void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *hi2c); +void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c); +void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c); +void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c); +void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c); +/** + * @} + */ + +/** @addtogroup I2C_Exported_Functions_Group3 Peripheral State, Mode and Error functions + * @{ + */ +/* Peripheral State, Mode and Error functions *********************************/ +HAL_I2C_StateTypeDef HAL_I2C_GetState(const I2C_HandleTypeDef *hi2c); +HAL_I2C_ModeTypeDef HAL_I2C_GetMode(const I2C_HandleTypeDef *hi2c); +uint32_t HAL_I2C_GetError(const I2C_HandleTypeDef *hi2c); + +/** + * @} + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup I2C_Private_Constants I2C Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup I2C_Private_Macro I2C Private Macros + * @{ + */ + +#define IS_I2C_ADDRESSING_MODE(MODE) (((MODE) == I2C_ADDRESSINGMODE_7BIT) || \ + ((MODE) == I2C_ADDRESSINGMODE_10BIT)) + +#define IS_I2C_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == I2C_DUALADDRESS_DISABLE) || \ + ((ADDRESS) == I2C_DUALADDRESS_ENABLE)) + +#define IS_I2C_OWN_ADDRESS2_MASK(MASK) (((MASK) == I2C_OA2_NOMASK) || \ + ((MASK) == I2C_OA2_MASK01) || \ + ((MASK) == I2C_OA2_MASK02) || \ + ((MASK) == I2C_OA2_MASK03) || \ + ((MASK) == I2C_OA2_MASK04) || \ + ((MASK) == I2C_OA2_MASK05) || \ + ((MASK) == I2C_OA2_MASK06) || \ + ((MASK) == I2C_OA2_MASK07)) + +#define IS_I2C_GENERAL_CALL(CALL) (((CALL) == I2C_GENERALCALL_DISABLE) || \ + ((CALL) == I2C_GENERALCALL_ENABLE)) + +#define IS_I2C_NO_STRETCH(STRETCH) (((STRETCH) == I2C_NOSTRETCH_DISABLE) || \ + ((STRETCH) == I2C_NOSTRETCH_ENABLE)) + +#define IS_I2C_MEMADD_SIZE(SIZE) (((SIZE) == I2C_MEMADD_SIZE_8BIT) || \ + ((SIZE) == I2C_MEMADD_SIZE_16BIT)) + +#define IS_TRANSFER_MODE(MODE) (((MODE) == I2C_RELOAD_MODE) || \ + ((MODE) == I2C_AUTOEND_MODE) || \ + ((MODE) == I2C_SOFTEND_MODE)) + +#define IS_TRANSFER_REQUEST(REQUEST) (((REQUEST) == I2C_GENERATE_STOP) || \ + ((REQUEST) == I2C_GENERATE_START_READ) || \ + ((REQUEST) == I2C_GENERATE_START_WRITE) || \ + ((REQUEST) == I2C_NO_STARTSTOP)) + +#define IS_I2C_TRANSFER_OPTIONS_REQUEST(REQUEST) (((REQUEST) == I2C_FIRST_FRAME) || \ + ((REQUEST) == I2C_FIRST_AND_NEXT_FRAME) || \ + ((REQUEST) == I2C_NEXT_FRAME) || \ + ((REQUEST) == I2C_FIRST_AND_LAST_FRAME) || \ + ((REQUEST) == I2C_LAST_FRAME) || \ + ((REQUEST) == I2C_LAST_FRAME_NO_STOP) || \ + IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST)) + +#define IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(REQUEST) (((REQUEST) == I2C_OTHER_FRAME) || \ + ((REQUEST) == I2C_OTHER_AND_LAST_FRAME)) + +#define I2C_RESET_CR2(__HANDLE__) ((__HANDLE__)->Instance->CR2 &= \ + (uint32_t)~((uint32_t)(I2C_CR2_SADD | I2C_CR2_HEAD10R | \ + I2C_CR2_NBYTES | I2C_CR2_RELOAD | \ + I2C_CR2_RD_WRN))) + +#define I2C_GET_ADDR_MATCH(__HANDLE__) ((uint16_t)(((__HANDLE__)->Instance->ISR & I2C_ISR_ADDCODE) \ + >> 16U)) +#define I2C_GET_DIR(__HANDLE__) ((uint8_t)(((__HANDLE__)->Instance->ISR & I2C_ISR_DIR) \ + >> 16U)) +#define I2C_GET_STOP_MODE(__HANDLE__) ((__HANDLE__)->Instance->CR2 & I2C_CR2_AUTOEND) +#define I2C_GET_OWN_ADDRESS1(__HANDLE__) ((uint16_t)((__HANDLE__)->Instance->OAR1 & I2C_OAR1_OA1)) +#define I2C_GET_OWN_ADDRESS2(__HANDLE__) ((uint16_t)((__HANDLE__)->Instance->OAR2 & I2C_OAR2_OA2)) + +#define IS_I2C_OWN_ADDRESS1(ADDRESS1) ((ADDRESS1) <= 0x000003FFU) +#define IS_I2C_OWN_ADDRESS2(ADDRESS2) ((ADDRESS2) <= (uint16_t)0x00FFU) + +#define I2C_MEM_ADD_MSB(__ADDRESS__) ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & \ + (uint16_t)(0xFF00U))) >> 8U))) +#define I2C_MEM_ADD_LSB(__ADDRESS__) ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FFU)))) + +#define I2C_GENERATE_START(__ADDMODE__,__ADDRESS__) (((__ADDMODE__) == I2C_ADDRESSINGMODE_7BIT) ? \ + (uint32_t)((((uint32_t)(__ADDRESS__) & (I2C_CR2_SADD)) | \ + (I2C_CR2_START) | (I2C_CR2_AUTOEND)) & \ + (~I2C_CR2_RD_WRN)) : \ + (uint32_t)((((uint32_t)(__ADDRESS__) & (I2C_CR2_SADD)) | \ + (I2C_CR2_ADD10) | (I2C_CR2_START) | \ + (I2C_CR2_AUTOEND)) & (~I2C_CR2_RD_WRN))) + +#define I2C_CHECK_FLAG(__ISR__, __FLAG__) ((((__ISR__) & ((__FLAG__) & I2C_FLAG_MASK)) == \ + ((__FLAG__) & I2C_FLAG_MASK)) ? SET : RESET) +#define I2C_CHECK_IT_SOURCE(__CR1__, __IT__) ((((__CR1__) & (__IT__)) == (__IT__)) ? SET : RESET) +/** + * @} + */ + +/* Private Functions ---------------------------------------------------------*/ +/** @defgroup I2C_Private_Functions I2C Private Functions + * @{ + */ +/* Private functions are defined in stm32f3xx_hal_i2c.c file */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif /* STM32F3xx_HAL_I2C_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h new file mode 100644 index 0000000..262f481 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h @@ -0,0 +1,177 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_i2c_ex.h + * @author MCD Application Team + * @brief Header file of I2C HAL Extended module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_HAL_I2C_EX_H +#define STM32F3xx_HAL_I2C_EX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup I2CEx + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup I2CEx_Exported_Constants I2C Extended Exported Constants + * @{ + */ + +/** @defgroup I2CEx_Analog_Filter I2C Extended Analog Filter + * @{ + */ +#define I2C_ANALOGFILTER_ENABLE 0x00000000U +#define I2C_ANALOGFILTER_DISABLE I2C_CR1_ANFOFF +/** + * @} + */ + +/** @defgroup I2CEx_FastModePlus I2C Extended Fast Mode Plus + * @{ + */ +#define I2C_FMP_NOT_SUPPORTED 0xAAAA0000U /*!< Fast Mode Plus not supported */ +#define I2C_FASTMODEPLUS_PB6 SYSCFG_CFGR1_I2C_PB6_FMP /*!< Enable Fast Mode Plus on PB6 */ +#define I2C_FASTMODEPLUS_PB7 SYSCFG_CFGR1_I2C_PB7_FMP /*!< Enable Fast Mode Plus on PB7 */ +#define I2C_FASTMODEPLUS_PB8 SYSCFG_CFGR1_I2C_PB8_FMP /*!< Enable Fast Mode Plus on PB8 */ +#define I2C_FASTMODEPLUS_PB9 SYSCFG_CFGR1_I2C_PB9_FMP /*!< Enable Fast Mode Plus on PB9 */ +#define I2C_FASTMODEPLUS_I2C1 SYSCFG_CFGR1_I2C1_FMP /*!< Enable Fast Mode Plus on I2C1 pins */ +#if defined(SYSCFG_CFGR1_I2C2_FMP) +#define I2C_FASTMODEPLUS_I2C2 SYSCFG_CFGR1_I2C2_FMP /*!< Enable Fast Mode Plus on I2C2 pins */ +#else +#define I2C_FASTMODEPLUS_I2C2 (uint32_t)(0x00000200U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C2 not supported */ +#endif /* SYSCFG_CFGR1_I2C2_FMP */ +#if defined(SYSCFG_CFGR1_I2C3_FMP) +#define I2C_FASTMODEPLUS_I2C3 SYSCFG_CFGR1_I2C3_FMP /*!< Enable Fast Mode Plus on I2C3 pins */ +#else +#define I2C_FASTMODEPLUS_I2C3 (uint32_t)(0x00000400U | I2C_FMP_NOT_SUPPORTED) /*!< Fast Mode Plus I2C3 not supported */ +#endif /* SYSCFG_CFGR1_I2C3_FMP */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup I2CEx_Exported_Macros I2C Extended Exported Macros + * @{ + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup I2CEx_Exported_Functions I2C Extended Exported Functions + * @{ + */ + +/** @addtogroup I2CEx_Exported_Functions_Group1 Filter Mode Functions + * @{ + */ +/* Peripheral Control functions ************************************************/ +HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter); +HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter); +/** + * @} + */ + +/** @addtogroup I2CEx_Exported_Functions_Group2 WakeUp Mode Functions + * @{ + */ +HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c); +HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c); +/** + * @} + */ + +/** @addtogroup I2CEx_Exported_Functions_Group3 Fast Mode Plus Functions + * @{ + */ +void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus); +void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus); +/** + * @} + */ + +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup I2CEx_Private_Constants I2C Extended Private Constants + * @{ + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup I2CEx_Private_Macro I2C Extended Private Macros + * @{ + */ +#define IS_I2C_ANALOG_FILTER(FILTER) (((FILTER) == I2C_ANALOGFILTER_ENABLE) || \ + ((FILTER) == I2C_ANALOGFILTER_DISABLE)) + +#define IS_I2C_DIGITAL_FILTER(FILTER) ((FILTER) <= 0x0000000FU) + +#define IS_I2C_FASTMODEPLUS(__CONFIG__) ((((__CONFIG__) & I2C_FMP_NOT_SUPPORTED) != I2C_FMP_NOT_SUPPORTED) && \ + ((((__CONFIG__) & (I2C_FASTMODEPLUS_PB6)) == I2C_FASTMODEPLUS_PB6) || \ + (((__CONFIG__) & (I2C_FASTMODEPLUS_PB7)) == I2C_FASTMODEPLUS_PB7) || \ + (((__CONFIG__) & (I2C_FASTMODEPLUS_PB8)) == I2C_FASTMODEPLUS_PB8) || \ + (((__CONFIG__) & (I2C_FASTMODEPLUS_PB9)) == I2C_FASTMODEPLUS_PB9) || \ + (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C1)) == I2C_FASTMODEPLUS_I2C1) || \ + (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C2)) == I2C_FASTMODEPLUS_I2C2) || \ + (((__CONFIG__) & (I2C_FASTMODEPLUS_I2C3)) == I2C_FASTMODEPLUS_I2C3))) +/** + * @} + */ + +/* Private Functions ---------------------------------------------------------*/ +/** @defgroup I2CEx_Private_Functions I2C Extended Private Functions + * @{ + */ +/* Private functions are defined in stm32f3xx_hal_i2c_ex.c file */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32F3xx_HAL_I2C_EX_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h new file mode 100644 index 0000000..4eef2a8 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h @@ -0,0 +1,216 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_pwr.h + * @author MCD Application Team + * @brief Header file of PWR HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_PWR_H +#define __STM32F3xx_HAL_PWR_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup PWR PWR + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup PWR_Exported_Constants PWR Exported Constants + * @{ + */ + +/** @defgroup PWR_WakeUp_Pins PWR WakeUp Pins + * @{ + */ + +#define PWR_WAKEUP_PIN1 ((uint32_t)PWR_CSR_EWUP1) /*!< Wakeup pin 1U */ +#define PWR_WAKEUP_PIN2 ((uint32_t)PWR_CSR_EWUP2) /*!< Wakeup pin 2U */ +#define PWR_WAKEUP_PIN3 ((uint32_t)PWR_CSR_EWUP3) /*!< Wakeup pin 3U */ +/** + * @} + */ + +/** @defgroup PWR_Regulator_state_in_STOP_mode PWR Regulator state in STOP mode + * @{ + */ +#define PWR_MAINREGULATOR_ON (0x00000000U) /*!< Voltage regulator on during STOP mode */ +#define PWR_LOWPOWERREGULATOR_ON PWR_CR_LPDS /*!< Voltage regulator in low-power mode during STOP mode */ +/** + * @} + */ + +/** @defgroup PWR_SLEEP_mode_entry PWR SLEEP mode entry + * @{ + */ +#define PWR_SLEEPENTRY_WFI ((uint8_t)0x01U) /*!< Wait For Interruption instruction to enter SLEEP mode */ +#define PWR_SLEEPENTRY_WFE ((uint8_t)0x02U) /*!< Wait For Event instruction to enter SLEEP mode */ +/** + * @} + */ + +/** @defgroup PWR_STOP_mode_entry PWR STOP mode entry + * @{ + */ +#define PWR_STOPENTRY_WFI ((uint8_t)0x01U) /*!< Wait For Interruption instruction to enter STOP mode */ +#define PWR_STOPENTRY_WFE ((uint8_t)0x02U) /*!< Wait For Event instruction to enter STOP mode */ +/** + * @} + */ + +/** @defgroup PWR_Flag PWR Flag + * @{ + */ +#define PWR_FLAG_WU PWR_CSR_WUF /*!< Wakeup event from wakeup pin or RTC alarm */ +#define PWR_FLAG_SB PWR_CSR_SBF /*!< Standby flag */ +#define PWR_FLAG_PVDO PWR_CSR_PVDO /*!< Power Voltage Detector output flag */ +#define PWR_FLAG_VREFINTRDY PWR_CSR_VREFINTRDYF /*!< VREFINT reference voltage ready */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup PWR_Exported_Macro PWR Exported Macro + * @{ + */ + +/** @brief Check PWR flag is set or not. + * @param __FLAG__ specifies the flag to check. + * This parameter can be one of the following values: + * @arg PWR_FLAG_WU: Wake Up flag. This flag indicates that a wakeup event + * was received from the WKUP pin or from the RTC alarm (Alarm A + * or Alarm B), RTC Tamper event, RTC TimeStamp event or RTC Wakeup. + * An additional wakeup event is detected if the WKUP pin is enabled + * (by setting the EWUP bit) when the WKUP pin level is already high. + * @arg PWR_FLAG_SB: StandBy flag. This flag indicates that the system was + * resumed from StandBy mode. + * @arg PWR_FLAG_PVDO: PVD Output. This flag is valid only if PVD is enabled + * by the HAL_PWR_EnablePVD() function. The PVD is stopped by Standby mode + * For this reason, this bit is equal to 0 after Standby or reset + * until the PVDE bit is set. + * @arg PWR_FLAG_VREFINTRDY: This flag indicates that the internal reference + * voltage VREFINT is ready. + * @retval The new state of __FLAG__ (TRUE or FALSE). + */ +#define __HAL_PWR_GET_FLAG(__FLAG__) ((PWR->CSR & (__FLAG__)) == (__FLAG__)) + +/** @brief Clear the PWR's pending flags. + * @param __FLAG__ specifies the flag to clear. + * This parameter can be one of the following values: + * @arg PWR_FLAG_WU: Wake Up flag + * @arg PWR_FLAG_SB: StandBy flag + */ +#define __HAL_PWR_CLEAR_FLAG(__FLAG__) (PWR->CR |= (__FLAG__) << 2U) + +/** + * @} + */ + +/* Private macros --------------------------------------------------------*/ +/** @addtogroup PWR_Private_Macros PWR Private Macros + * @{ + */ + +#define IS_PWR_WAKEUP_PIN(PIN) (((PIN) == PWR_WAKEUP_PIN1) || \ + ((PIN) == PWR_WAKEUP_PIN2) || \ + ((PIN) == PWR_WAKEUP_PIN3)) + +#define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_MAINREGULATOR_ON) || \ + ((REGULATOR) == PWR_LOWPOWERREGULATOR_ON)) + +#define IS_PWR_SLEEP_ENTRY(ENTRY) (((ENTRY) == PWR_SLEEPENTRY_WFI) || ((ENTRY) == PWR_SLEEPENTRY_WFE)) + +#define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPENTRY_WFI) || ((ENTRY) == PWR_STOPENTRY_WFE)) + +/** + * @} + */ + +/* Include PWR HAL Extended module */ +#include "stm32f3xx_hal_pwr_ex.h" + +/* Exported functions --------------------------------------------------------*/ + +/** @addtogroup PWR_Exported_Functions PWR Exported Functions + * @{ + */ + +/** @addtogroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ + +/* Initialization and de-initialization functions *****************************/ +void HAL_PWR_DeInit(void); + +/** + * @} + */ + +/** @addtogroup PWR_Exported_Functions_Group2 Peripheral Control functions + * @{ + */ + +/* Peripheral Control functions **********************************************/ +void HAL_PWR_EnableBkUpAccess(void); +void HAL_PWR_DisableBkUpAccess(void); + +/* WakeUp pins configuration functions ****************************************/ +void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinx); +void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx); + +/* Low Power modes configuration functions ************************************/ +void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry); +void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry); +void HAL_PWR_EnterSTANDBYMode(void); + +void HAL_PWR_EnableSleepOnExit(void); +void HAL_PWR_DisableSleepOnExit(void); +void HAL_PWR_EnableSEVOnPend(void); +void HAL_PWR_DisableSEVOnPend(void); +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif /* __STM32F3xx_HAL_PWR_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h new file mode 100644 index 0000000..715abc4 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h @@ -0,0 +1,319 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_pwr_ex.h + * @author MCD Application Team + * @brief Header file of PWR HAL Extended module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_PWR_EX_H +#define __STM32F3xx_HAL_PWR_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup PWREx + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ + +/** @defgroup PWREx_Exported_Types PWR Extended Exported Types + * @{ + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || \ + defined(STM32F302xC) || defined(STM32F303xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || \ + defined(STM32F301x8) || defined(STM32F302x8) || \ + defined(STM32F373xC) +/** + * @brief PWR PVD configuration structure definition + */ +typedef struct +{ + uint32_t PVDLevel; /*!< PVDLevel: Specifies the PVD detection level + This parameter can be a value of @ref PWREx_PVD_detection_level */ + + uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins. + This parameter can be a value of @ref PWREx_PVD_Mode */ +}PWR_PVDTypeDef; +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F303x8 || STM32F334x8 || */ + /* STM32F301x8 || STM32F302x8 || */ + /* STM32F373xC */ + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup PWREx_Exported_Constants PWR Extended Exported Constants + * @{ + */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || \ + defined(STM32F302xC) || defined(STM32F303xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || \ + defined(STM32F301x8) || defined(STM32F302x8) || \ + defined(STM32F373xC) + +/** @defgroup PWREx_PVD_detection_level PWR Extended PVD detection level + * @{ + */ +#define PWR_PVDLEVEL_0 PWR_CR_PLS_LEV0 /*!< PVD threshold around 2.2 V */ +#define PWR_PVDLEVEL_1 PWR_CR_PLS_LEV1 /*!< PVD threshold around 2.3 V */ +#define PWR_PVDLEVEL_2 PWR_CR_PLS_LEV2 /*!< PVD threshold around 2.4 V */ +#define PWR_PVDLEVEL_3 PWR_CR_PLS_LEV3 /*!< PVD threshold around 2.5 V */ +#define PWR_PVDLEVEL_4 PWR_CR_PLS_LEV4 /*!< PVD threshold around 2.6 V */ +#define PWR_PVDLEVEL_5 PWR_CR_PLS_LEV5 /*!< PVD threshold around 2.7 V */ +#define PWR_PVDLEVEL_6 PWR_CR_PLS_LEV6 /*!< PVD threshold around 2.8 V */ +#define PWR_PVDLEVEL_7 PWR_CR_PLS_LEV7 /*!< PVD threshold around 2.9 V */ +/** + * @} + */ + +/** @defgroup PWREx_PVD_Mode PWR Extended PVD Mode + * @{ + */ +#define PWR_PVD_MODE_NORMAL (0x00000000U) /*!< Basic mode is used */ +#define PWR_PVD_MODE_IT_RISING (0x00010001U) /*!< External Interrupt Mode with Rising edge trigger detection */ +#define PWR_PVD_MODE_IT_FALLING (0x00010002U) /*!< External Interrupt Mode with Falling edge trigger detection */ +#define PWR_PVD_MODE_IT_RISING_FALLING (0x00010003U) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */ +#define PWR_PVD_MODE_EVENT_RISING (0x00020001U) /*!< Event Mode with Rising edge trigger detection */ +#define PWR_PVD_MODE_EVENT_FALLING (0x00020002U) /*!< Event Mode with Falling edge trigger detection */ +#define PWR_PVD_MODE_EVENT_RISING_FALLING (0x00020003U) /*!< Event Mode with Rising/Falling edge trigger detection */ +/** + * @} + */ + +#define PWR_EXTI_LINE_PVD EXTI_IMR_MR16 /*!< External interrupt line 16 Connected to the PVD EXTI Line */ + +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F303x8 || STM32F334x8 || */ + /* STM32F301x8 || STM32F302x8 || */ + /* STM32F373xC */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** @defgroup PWREx_SDADC_ANALOGx PWR Extended SDADC ANALOGx + * @{ + */ +#define PWR_SDADC_ANALOG1 ((uint32_t)PWR_CR_ENSD1) /*!< Enable SDADC1 */ +#define PWR_SDADC_ANALOG2 ((uint32_t)PWR_CR_ENSD2) /*!< Enable SDADC2 */ +#define PWR_SDADC_ANALOG3 ((uint32_t)PWR_CR_ENSD3) /*!< Enable SDADC3 */ +/** + * @} + */ +#endif /* STM32F373xC || STM32F378xx */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup PWREx_Exported_Macros PWR Extended Exported Macros + * @{ + */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || \ + defined(STM32F302xC) || defined(STM32F303xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || \ + defined(STM32F301x8) || defined(STM32F302x8) || \ + defined(STM32F373xC) + +/** + * @brief Enable interrupt on PVD Exti Line 16. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_IT() (EXTI->IMR |= (PWR_EXTI_LINE_PVD)) + +/** + * @brief Disable interrupt on PVD Exti Line 16. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_DISABLE_IT() (EXTI->IMR &= ~(PWR_EXTI_LINE_PVD)) + +/** + * @brief Generate a Software interrupt on selected EXTI line. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_GENERATE_SWIT() (EXTI->SWIER |= (PWR_EXTI_LINE_PVD)) + +/** + * @brief Enable event on PVD Exti Line 16. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_EVENT() (EXTI->EMR |= (PWR_EXTI_LINE_PVD)) + +/** + * @brief Disable event on PVD Exti Line 16. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(PWR_EXTI_LINE_PVD)) + +/** + * @brief Disable the PVD Extended Interrupt Rising Trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, PWR_EXTI_LINE_PVD) + +/** + * @brief Disable the PVD Extended Interrupt Falling Trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, PWR_EXTI_LINE_PVD) + +/** + * @brief Disable the PVD Extended Interrupt Rising & Falling Trigger. + * @retval None + */ +#define __HAL_PWR_PVD_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); + +/** + * @brief PVD EXTI line configuration: set falling edge trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE() EXTI->FTSR |= (PWR_EXTI_LINE_PVD) + +/** + * @brief PVD EXTI line configuration: set rising edge trigger. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE() EXTI->RTSR |= (PWR_EXTI_LINE_PVD) + +/** + * @brief Enable the PVD Extended Interrupt Rising & Falling Trigger. + * @retval None + */ +#define __HAL_PWR_PVD_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE(); + +/** + * @brief Check whether the specified PVD EXTI interrupt flag is set or not. + * @retval EXTI PVD Line Status. + */ +#define __HAL_PWR_PVD_EXTI_GET_FLAG() (EXTI->PR & (PWR_EXTI_LINE_PVD)) + +/** + * @brief Clear the PVD EXTI flag. + * @retval None. + */ +#define __HAL_PWR_PVD_EXTI_CLEAR_FLAG() (EXTI->PR = (PWR_EXTI_LINE_PVD)) + +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F303x8 || STM32F334x8 || */ + /* STM32F301x8 || STM32F302x8 || */ + /* STM32F373xC */ + +/** + * @} + */ + +/* Private macros --------------------------------------------------------*/ +/** @addtogroup PWREx_Private_Macros PWR Extended Private Macros + * @{ + */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || \ + defined(STM32F302xC) || defined(STM32F303xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || \ + defined(STM32F301x8) || defined(STM32F302x8) || \ + defined(STM32F373xC) +#define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLEVEL_0) || ((LEVEL) == PWR_PVDLEVEL_1)|| \ + ((LEVEL) == PWR_PVDLEVEL_2) || ((LEVEL) == PWR_PVDLEVEL_3)|| \ + ((LEVEL) == PWR_PVDLEVEL_4) || ((LEVEL) == PWR_PVDLEVEL_5)|| \ + ((LEVEL) == PWR_PVDLEVEL_6) || ((LEVEL) == PWR_PVDLEVEL_7)) + +#define IS_PWR_PVD_MODE(MODE) (((MODE) == PWR_PVD_MODE_IT_RISING)|| ((MODE) == PWR_PVD_MODE_IT_FALLING) || \ + ((MODE) == PWR_PVD_MODE_IT_RISING_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING) || \ + ((MODE) == PWR_PVD_MODE_EVENT_FALLING) || ((MODE) == PWR_PVD_MODE_EVENT_RISING_FALLING) || \ + ((MODE) == PWR_PVD_MODE_NORMAL)) +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F303x8 || STM32F334x8 || */ + /* STM32F301x8 || STM32F302x8 || */ + /* STM32F373xC */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define IS_PWR_SDADC_ANALOG(SDADC) (((SDADC) == PWR_SDADC_ANALOG1) || \ + ((SDADC) == PWR_SDADC_ANALOG2) || \ + ((SDADC) == PWR_SDADC_ANALOG3)) +#endif /* STM32F373xC || STM32F378xx */ + + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ + +/** @addtogroup PWREx_Exported_Functions PWR Extended Exported Functions + * @{ + */ + +/** @addtogroup PWREx_Exported_Functions_Group1 Peripheral Extended Control Functions + * @{ + */ +/* Peripheral Extended control functions **************************************/ +#if defined(STM32F302xE) || defined(STM32F303xE) || \ + defined(STM32F302xC) || defined(STM32F303xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || \ + defined(STM32F301x8) || defined(STM32F302x8) || \ + defined(STM32F373xC) +void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD); +void HAL_PWR_EnablePVD(void); +void HAL_PWR_DisablePVD(void); +void HAL_PWR_PVD_IRQHandler(void); +void HAL_PWR_PVDCallback(void); +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F303x8 || STM32F334x8 || */ + /* STM32F301x8 || STM32F302x8 || */ + /* STM32F373xC */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +void HAL_PWREx_EnableSDADC(uint32_t Analogx); +void HAL_PWREx_DisableSDADC(uint32_t Analogx); +#endif /* STM32F373xC || STM32F378xx */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_PWR_EX_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h new file mode 100644 index 0000000..f083587 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h @@ -0,0 +1,1737 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_rcc.h + * @author MCD Application Team + * @brief Header file of RCC HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_RCC_H +#define __STM32F3xx_HAL_RCC_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup RCC + * @{ + */ + +/** @addtogroup RCC_Private_Constants + * @{ + */ + +/** @defgroup RCC_Timeout RCC Timeout + * @{ + */ + +/* Disable Backup domain write protection state change timeout */ +#define RCC_DBP_TIMEOUT_VALUE (100U) /* 100 ms */ +/* LSE state change timeout */ +#define RCC_LSE_TIMEOUT_VALUE LSE_STARTUP_TIMEOUT +#define CLOCKSWITCH_TIMEOUT_VALUE (5000U) /* 5 s */ +#define HSE_TIMEOUT_VALUE HSE_STARTUP_TIMEOUT +#define HSI_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1U) */ +#define LSI_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1U) */ +#define PLL_TIMEOUT_VALUE (2U) /* 2 ms (minimum Tick + 1U) */ +/** + * @} + */ + +/** @defgroup RCC_Register_Offset Register offsets + * @{ + */ +#define RCC_OFFSET (RCC_BASE - PERIPH_BASE) +#define RCC_CR_OFFSET 0x00 +#define RCC_CFGR_OFFSET 0x04 +#define RCC_CIR_OFFSET 0x08 +#define RCC_BDCR_OFFSET 0x20 +#define RCC_CSR_OFFSET 0x24 + +/** + * @} + */ + +/** @defgroup RCC_BitAddress_AliasRegion BitAddress AliasRegion + * @brief RCC registers bit address in the alias region + * @{ + */ +#define RCC_CR_OFFSET_BB (RCC_OFFSET + RCC_CR_OFFSET) +#define RCC_CFGR_OFFSET_BB (RCC_OFFSET + RCC_CFGR_OFFSET) +#define RCC_CIR_OFFSET_BB (RCC_OFFSET + RCC_CIR_OFFSET) +#define RCC_BDCR_OFFSET_BB (RCC_OFFSET + RCC_BDCR_OFFSET) +#define RCC_CSR_OFFSET_BB (RCC_OFFSET + RCC_CSR_OFFSET) + +/* --- CR Register ---*/ +/* Alias word address of HSION bit */ +#define RCC_HSION_BIT_NUMBER POSITION_VAL(RCC_CR_HSION) +#define RCC_CR_HSION_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CR_OFFSET_BB * 32U) + (RCC_HSION_BIT_NUMBER * 4U))) +/* Alias word address of HSEON bit */ +#define RCC_HSEON_BIT_NUMBER POSITION_VAL(RCC_CR_HSEON) +#define RCC_CR_HSEON_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CR_OFFSET_BB * 32U) + (RCC_HSEON_BIT_NUMBER * 4U))) +/* Alias word address of CSSON bit */ +#define RCC_CSSON_BIT_NUMBER POSITION_VAL(RCC_CR_CSSON) +#define RCC_CR_CSSON_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CR_OFFSET_BB * 32U) + (RCC_CSSON_BIT_NUMBER * 4U))) +/* Alias word address of PLLON bit */ +#define RCC_PLLON_BIT_NUMBER POSITION_VAL(RCC_CR_PLLON) +#define RCC_CR_PLLON_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CR_OFFSET_BB * 32U) + (RCC_PLLON_BIT_NUMBER * 4U))) + +/* --- CSR Register ---*/ +/* Alias word address of LSION bit */ +#define RCC_LSION_BIT_NUMBER POSITION_VAL(RCC_CSR_LSION) +#define RCC_CSR_LSION_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CSR_OFFSET_BB * 32U) + (RCC_LSION_BIT_NUMBER * 4U))) + +/* Alias word address of RMVF bit */ +#define RCC_RMVF_BIT_NUMBER POSITION_VAL(RCC_CSR_RMVF) +#define RCC_CSR_RMVF_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_CSR_OFFSET_BB * 32U) + (RCC_RMVF_BIT_NUMBER * 4U))) + +/* --- BDCR Registers ---*/ +/* Alias word address of LSEON bit */ +#define RCC_LSEON_BIT_NUMBER POSITION_VAL(RCC_BDCR_LSEON) +#define RCC_BDCR_LSEON_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_BDCR_OFFSET_BB * 32U) + (RCC_LSEON_BIT_NUMBER * 4U))) + +/* Alias word address of LSEON bit */ +#define RCC_LSEBYP_BIT_NUMBER POSITION_VAL(RCC_BDCR_LSEBYP) +#define RCC_BDCR_LSEBYP_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_BDCR_OFFSET_BB * 32U) + (RCC_LSEBYP_BIT_NUMBER * 4U))) + +/* Alias word address of RTCEN bit */ +#define RCC_RTCEN_BIT_NUMBER POSITION_VAL(RCC_BDCR_RTCEN) +#define RCC_BDCR_RTCEN_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_BDCR_OFFSET_BB * 32U) + (RCC_RTCEN_BIT_NUMBER * 4U))) + +/* Alias word address of BDRST bit */ +#define RCC_BDRST_BIT_NUMBER POSITION_VAL(RCC_BDCR_BDRST) +#define RCC_BDCR_BDRST_BB ((uint32_t)(PERIPH_BB_BASE + (RCC_BDCR_OFFSET_BB * 32U) + (RCC_BDRST_BIT_NUMBER * 4U))) + +/** + * @} + */ + +/* CR register byte 2 (Bits[23:16]) base address */ +#define RCC_CR_BYTE2_ADDRESS ((uint32_t)(RCC_BASE + RCC_CR_OFFSET + 0x02U)) + +/* CIR register byte 1 (Bits[15:8]) base address */ +#define RCC_CIR_BYTE1_ADDRESS ((uint32_t)(RCC_BASE + RCC_CIR_OFFSET + 0x01U)) + +/* CIR register byte 2 (Bits[23:16]) base address */ +#define RCC_CIR_BYTE2_ADDRESS ((uint32_t)(RCC_BASE + RCC_CIR_OFFSET + 0x02U)) + +/* Defines used for Flags */ +#define CR_REG_INDEX ((uint8_t)1U) +#define BDCR_REG_INDEX ((uint8_t)2U) +#define CSR_REG_INDEX ((uint8_t)3U) +#define CFGR_REG_INDEX ((uint8_t)4U) + +#define RCC_FLAG_MASK ((uint8_t)0x1FU) + +/** + * @} + */ + +/** @addtogroup RCC_Private_Macros + * @{ + */ +#define IS_RCC_PLLSOURCE(__SOURCE__) (((__SOURCE__) == RCC_PLLSOURCE_HSI) || \ + ((__SOURCE__) == RCC_PLLSOURCE_HSE)) +#define IS_RCC_OSCILLATORTYPE(__OSCILLATOR__) (((__OSCILLATOR__) == RCC_OSCILLATORTYPE_NONE) || \ + (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) || \ + (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) || \ + (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) || \ + (((__OSCILLATOR__) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE)) +#define IS_RCC_HSE(__HSE__) (((__HSE__) == RCC_HSE_OFF) || ((__HSE__) == RCC_HSE_ON) || \ + ((__HSE__) == RCC_HSE_BYPASS)) +#define IS_RCC_LSE(__LSE__) (((__LSE__) == RCC_LSE_OFF) || ((__LSE__) == RCC_LSE_ON) || \ + ((__LSE__) == RCC_LSE_BYPASS)) +#define IS_RCC_HSI(__HSI__) (((__HSI__) == RCC_HSI_OFF) || ((__HSI__) == RCC_HSI_ON)) +#define IS_RCC_CALIBRATION_VALUE(__VALUE__) ((__VALUE__) <= 0x1FU) +#define IS_RCC_LSI(__LSI__) (((__LSI__) == RCC_LSI_OFF) || ((__LSI__) == RCC_LSI_ON)) +#define IS_RCC_PLL(__PLL__) (((__PLL__) == RCC_PLL_NONE) || ((__PLL__) == RCC_PLL_OFF) || \ + ((__PLL__) == RCC_PLL_ON)) +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) +#define IS_RCC_PREDIV(__PREDIV__) (((__PREDIV__) == RCC_PREDIV_DIV1) || ((__PREDIV__) == RCC_PREDIV_DIV2) || \ + ((__PREDIV__) == RCC_PREDIV_DIV3) || ((__PREDIV__) == RCC_PREDIV_DIV4) || \ + ((__PREDIV__) == RCC_PREDIV_DIV5) || ((__PREDIV__) == RCC_PREDIV_DIV6) || \ + ((__PREDIV__) == RCC_PREDIV_DIV7) || ((__PREDIV__) == RCC_PREDIV_DIV8) || \ + ((__PREDIV__) == RCC_PREDIV_DIV9) || ((__PREDIV__) == RCC_PREDIV_DIV10) || \ + ((__PREDIV__) == RCC_PREDIV_DIV11) || ((__PREDIV__) == RCC_PREDIV_DIV12) || \ + ((__PREDIV__) == RCC_PREDIV_DIV13) || ((__PREDIV__) == RCC_PREDIV_DIV14) || \ + ((__PREDIV__) == RCC_PREDIV_DIV15) || ((__PREDIV__) == RCC_PREDIV_DIV16)) +#else +#define IS_RCC_PLL_DIV(__DIV__) (((__DIV__) == RCC_PLL_DIV2) || \ + ((__DIV__) == RCC_PLL_DIV3) || ((__DIV__) == RCC_PLL_DIV4)) +#endif +#if defined(RCC_CFGR_PLLSRC_HSI_DIV2) +#define IS_RCC_HSE_PREDIV(DIV) (((DIV) == RCC_HSE_PREDIV_DIV1) || ((DIV) == RCC_HSE_PREDIV_DIV2) || \ + ((DIV) == RCC_HSE_PREDIV_DIV3) || ((DIV) == RCC_HSE_PREDIV_DIV4) || \ + ((DIV) == RCC_HSE_PREDIV_DIV5) || ((DIV) == RCC_HSE_PREDIV_DIV6) || \ + ((DIV) == RCC_HSE_PREDIV_DIV7) || ((DIV) == RCC_HSE_PREDIV_DIV8) || \ + ((DIV) == RCC_HSE_PREDIV_DIV9) || ((DIV) == RCC_HSE_PREDIV_DIV10) || \ + ((DIV) == RCC_HSE_PREDIV_DIV11) || ((DIV) == RCC_HSE_PREDIV_DIV12) || \ + ((DIV) == RCC_HSE_PREDIV_DIV13) || ((DIV) == RCC_HSE_PREDIV_DIV14) || \ + ((DIV) == RCC_HSE_PREDIV_DIV15) || ((DIV) == RCC_HSE_PREDIV_DIV16)) +#endif /* RCC_CFGR_PLLSRC_HSI_DIV2 */ + +#define IS_RCC_PLL_MUL(__MUL__) (((__MUL__) == RCC_PLL_MUL2) || ((__MUL__) == RCC_PLL_MUL3) || \ + ((__MUL__) == RCC_PLL_MUL4) || ((__MUL__) == RCC_PLL_MUL5) || \ + ((__MUL__) == RCC_PLL_MUL6) || ((__MUL__) == RCC_PLL_MUL7) || \ + ((__MUL__) == RCC_PLL_MUL8) || ((__MUL__) == RCC_PLL_MUL9) || \ + ((__MUL__) == RCC_PLL_MUL10) || ((__MUL__) == RCC_PLL_MUL11) || \ + ((__MUL__) == RCC_PLL_MUL12) || ((__MUL__) == RCC_PLL_MUL13) || \ + ((__MUL__) == RCC_PLL_MUL14) || ((__MUL__) == RCC_PLL_MUL15) || \ + ((__MUL__) == RCC_PLL_MUL16)) +#define IS_RCC_CLOCKTYPE(CLK) ((((CLK) & RCC_CLOCKTYPE_SYSCLK) == RCC_CLOCKTYPE_SYSCLK) || \ + (((CLK) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK) || \ + (((CLK) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1) || \ + (((CLK) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2)) +#define IS_RCC_SYSCLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_SYSCLKSOURCE_HSI) || \ + ((__SOURCE__) == RCC_SYSCLKSOURCE_HSE) || \ + ((__SOURCE__) == RCC_SYSCLKSOURCE_PLLCLK)) +#define IS_RCC_SYSCLKSOURCE_STATUS(__SOURCE__) (((__SOURCE__) == RCC_SYSCLKSOURCE_STATUS_HSI) || \ + ((__SOURCE__) == RCC_SYSCLKSOURCE_STATUS_HSE) || \ + ((__SOURCE__) == RCC_SYSCLKSOURCE_STATUS_PLLCLK)) +#define IS_RCC_HCLK(__HCLK__) (((__HCLK__) == RCC_SYSCLK_DIV1) || ((__HCLK__) == RCC_SYSCLK_DIV2) || \ + ((__HCLK__) == RCC_SYSCLK_DIV4) || ((__HCLK__) == RCC_SYSCLK_DIV8) || \ + ((__HCLK__) == RCC_SYSCLK_DIV16) || ((__HCLK__) == RCC_SYSCLK_DIV64) || \ + ((__HCLK__) == RCC_SYSCLK_DIV128) || ((__HCLK__) == RCC_SYSCLK_DIV256) || \ + ((__HCLK__) == RCC_SYSCLK_DIV512)) +#define IS_RCC_PCLK(__PCLK__) (((__PCLK__) == RCC_HCLK_DIV1) || ((__PCLK__) == RCC_HCLK_DIV2) || \ + ((__PCLK__) == RCC_HCLK_DIV4) || ((__PCLK__) == RCC_HCLK_DIV8) || \ + ((__PCLK__) == RCC_HCLK_DIV16)) +#define IS_RCC_MCO(__MCO__) ((__MCO__) == RCC_MCO) +#define IS_RCC_RTCCLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_RTCCLKSOURCE_NO_CLK) || \ + ((__SOURCE__) == RCC_RTCCLKSOURCE_LSE) || \ + ((__SOURCE__) == RCC_RTCCLKSOURCE_LSI) || \ + ((__SOURCE__) == RCC_RTCCLKSOURCE_HSE_DIV32)) +#if defined(RCC_CFGR3_USART2SW) +#define IS_RCC_USART2CLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_USART2CLKSOURCE_PCLK1) || \ + ((__SOURCE__) == RCC_USART2CLKSOURCE_SYSCLK) || \ + ((__SOURCE__) == RCC_USART2CLKSOURCE_LSE) || \ + ((__SOURCE__) == RCC_USART2CLKSOURCE_HSI)) +#endif /* RCC_CFGR3_USART2SW */ +#if defined(RCC_CFGR3_USART3SW) +#define IS_RCC_USART3CLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_USART3CLKSOURCE_PCLK1) || \ + ((__SOURCE__) == RCC_USART3CLKSOURCE_SYSCLK) || \ + ((__SOURCE__) == RCC_USART3CLKSOURCE_LSE) || \ + ((__SOURCE__) == RCC_USART3CLKSOURCE_HSI)) +#endif /* RCC_CFGR3_USART3SW */ +#define IS_RCC_I2C1CLKSOURCE(__SOURCE__) (((__SOURCE__) == RCC_I2C1CLKSOURCE_HSI) || \ + ((__SOURCE__) == RCC_I2C1CLKSOURCE_SYSCLK)) + +/** + * @} + */ + +/* Exported types ------------------------------------------------------------*/ + +/** @defgroup RCC_Exported_Types RCC Exported Types + * @{ + */ + +/** + * @brief RCC PLL configuration structure definition + */ +typedef struct +{ + uint32_t PLLState; /*!< PLLState: The new state of the PLL. + This parameter can be a value of @ref RCC_PLL_Config */ + + uint32_t PLLSource; /*!< PLLSource: PLL entry clock source. + This parameter must be a value of @ref RCC_PLL_Clock_Source */ + + uint32_t PLLMUL; /*!< PLLMUL: Multiplication factor for PLL VCO input clock + This parameter must be a value of @ref RCC_PLL_Multiplication_Factor*/ + +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) + uint32_t PREDIV; /*!< PREDIV: Predivision factor for PLL VCO input clock + This parameter must be a value of @ref RCC_PLL_Prediv_Factor */ + +#endif +} RCC_PLLInitTypeDef; + +/** + * @brief RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition + */ +typedef struct +{ + uint32_t OscillatorType; /*!< The oscillators to be configured. + This parameter can be a value of @ref RCC_Oscillator_Type */ + + uint32_t HSEState; /*!< The new state of the HSE. + This parameter can be a value of @ref RCC_HSE_Config */ + +#if defined(RCC_CFGR_PLLSRC_HSI_DIV2) + uint32_t HSEPredivValue; /*!< The HSE predivision factor value. + This parameter can be a value of @ref RCC_PLL_HSE_Prediv_Factor */ + +#endif /* RCC_CFGR_PLLSRC_HSI_DIV2 */ + uint32_t LSEState; /*!< The new state of the LSE. + This parameter can be a value of @ref RCC_LSE_Config */ + + uint32_t HSIState; /*!< The new state of the HSI. + This parameter can be a value of @ref RCC_HSI_Config */ + + uint32_t HSICalibrationValue; /*!< The HSI calibration trimming value (default is RCC_HSICALIBRATION_DEFAULT). + This parameter must be a number between Min_Data = 0x00 and Max_Data = 0x1FU */ + + uint32_t LSIState; /*!< The new state of the LSI. + This parameter can be a value of @ref RCC_LSI_Config */ + + RCC_PLLInitTypeDef PLL; /*!< PLL structure parameters */ + +} RCC_OscInitTypeDef; + +/** + * @brief RCC System, AHB and APB busses clock configuration structure definition + */ +typedef struct +{ + uint32_t ClockType; /*!< The clock to be configured. + This parameter can be a value of @ref RCC_System_Clock_Type */ + + uint32_t SYSCLKSource; /*!< The clock source (SYSCLKS) used as system clock. + This parameter can be a value of @ref RCC_System_Clock_Source */ + + uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK). + This parameter can be a value of @ref RCC_AHB_Clock_Source */ + + uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK). + This parameter can be a value of @ref RCC_APB1_APB2_Clock_Source */ + + uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK). + This parameter can be a value of @ref RCC_APB1_APB2_Clock_Source */ +} RCC_ClkInitTypeDef; + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup RCC_Exported_Constants RCC Exported Constants + * @{ + */ + +/** @defgroup RCC_PLL_Clock_Source PLL Clock Source + * @{ + */ + +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) +#define RCC_PLLSOURCE_HSI RCC_CFGR_PLLSRC_HSI_PREDIV /*!< HSI clock selected as PLL entry clock source */ +#endif /* RCC_CFGR_PLLSRC_HSI_PREDIV */ +#if defined(RCC_CFGR_PLLSRC_HSI_DIV2) +#define RCC_PLLSOURCE_HSI RCC_CFGR_PLLSRC_HSI_DIV2 /*!< HSI clock divided by 2 selected as PLL entry clock source */ +#endif /* RCC_CFGR_PLLSRC_HSI_DIV2 */ +#define RCC_PLLSOURCE_HSE RCC_CFGR_PLLSRC_HSE_PREDIV /*!< HSE clock selected as PLL entry clock source */ + +/** + * @} + */ + +/** @defgroup RCC_Oscillator_Type Oscillator Type + * @{ + */ +#define RCC_OSCILLATORTYPE_NONE (0x00000000U) +#define RCC_OSCILLATORTYPE_HSE (0x00000001U) +#define RCC_OSCILLATORTYPE_HSI (0x00000002U) +#define RCC_OSCILLATORTYPE_LSE (0x00000004U) +#define RCC_OSCILLATORTYPE_LSI (0x00000008U) +/** + * @} + */ + +/** @defgroup RCC_HSE_Config HSE Config + * @{ + */ +#define RCC_HSE_OFF (0x00000000U) /*!< HSE clock deactivation */ +#define RCC_HSE_ON RCC_CR_HSEON /*!< HSE clock activation */ +#define RCC_HSE_BYPASS ((uint32_t)(RCC_CR_HSEBYP | RCC_CR_HSEON)) /*!< External clock source for HSE clock */ +/** + * @} + */ + +/** @defgroup RCC_LSE_Config LSE Config + * @{ + */ +#define RCC_LSE_OFF (0x00000000U) /*!< LSE clock deactivation */ +#define RCC_LSE_ON RCC_BDCR_LSEON /*!< LSE clock activation */ +#define RCC_LSE_BYPASS ((uint32_t)(RCC_BDCR_LSEBYP | RCC_BDCR_LSEON)) /*!< External clock source for LSE clock */ + +/** + * @} + */ + +/** @defgroup RCC_HSI_Config HSI Config + * @{ + */ +#define RCC_HSI_OFF (0x00000000U) /*!< HSI clock deactivation */ +#define RCC_HSI_ON RCC_CR_HSION /*!< HSI clock activation */ + +#define RCC_HSICALIBRATION_DEFAULT (0x10U) /* Default HSI calibration trimming value */ + +/** + * @} + */ + +/** @defgroup RCC_LSI_Config LSI Config + * @{ + */ +#define RCC_LSI_OFF (0x00000000U) /*!< LSI clock deactivation */ +#define RCC_LSI_ON RCC_CSR_LSION /*!< LSI clock activation */ + +/** + * @} + */ + +/** @defgroup RCC_PLL_Config PLL Config + * @{ + */ +#define RCC_PLL_NONE (0x00000000U) /*!< PLL is not configured */ +#define RCC_PLL_OFF (0x00000001U) /*!< PLL deactivation */ +#define RCC_PLL_ON (0x00000002U) /*!< PLL activation */ + +/** + * @} + */ + +/** @defgroup RCC_System_Clock_Type System Clock Type + * @{ + */ +#define RCC_CLOCKTYPE_SYSCLK (0x00000001U) /*!< SYSCLK to configure */ +#define RCC_CLOCKTYPE_HCLK (0x00000002U) /*!< HCLK to configure */ +#define RCC_CLOCKTYPE_PCLK1 (0x00000004U) /*!< PCLK1 to configure */ +#define RCC_CLOCKTYPE_PCLK2 (0x00000008U) /*!< PCLK2 to configure */ + +/** + * @} + */ + +/** @defgroup RCC_System_Clock_Source System Clock Source + * @{ + */ +#define RCC_SYSCLKSOURCE_HSI RCC_CFGR_SW_HSI /*!< HSI selected as system clock */ +#define RCC_SYSCLKSOURCE_HSE RCC_CFGR_SW_HSE /*!< HSE selected as system clock */ +#define RCC_SYSCLKSOURCE_PLLCLK RCC_CFGR_SW_PLL /*!< PLL selected as system clock */ + +/** + * @} + */ + +/** @defgroup RCC_System_Clock_Source_Status System Clock Source Status + * @{ + */ +#define RCC_SYSCLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */ +#define RCC_SYSCLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */ +#define RCC_SYSCLKSOURCE_STATUS_PLLCLK RCC_CFGR_SWS_PLL /*!< PLL used as system clock */ + +/** + * @} + */ + +/** @defgroup RCC_AHB_Clock_Source AHB Clock Source + * @{ + */ +#define RCC_SYSCLK_DIV1 RCC_CFGR_HPRE_DIV1 /*!< SYSCLK not divided */ +#define RCC_SYSCLK_DIV2 RCC_CFGR_HPRE_DIV2 /*!< SYSCLK divided by 2 */ +#define RCC_SYSCLK_DIV4 RCC_CFGR_HPRE_DIV4 /*!< SYSCLK divided by 4 */ +#define RCC_SYSCLK_DIV8 RCC_CFGR_HPRE_DIV8 /*!< SYSCLK divided by 8 */ +#define RCC_SYSCLK_DIV16 RCC_CFGR_HPRE_DIV16 /*!< SYSCLK divided by 16 */ +#define RCC_SYSCLK_DIV64 RCC_CFGR_HPRE_DIV64 /*!< SYSCLK divided by 64 */ +#define RCC_SYSCLK_DIV128 RCC_CFGR_HPRE_DIV128 /*!< SYSCLK divided by 128 */ +#define RCC_SYSCLK_DIV256 RCC_CFGR_HPRE_DIV256 /*!< SYSCLK divided by 256 */ +#define RCC_SYSCLK_DIV512 RCC_CFGR_HPRE_DIV512 /*!< SYSCLK divided by 512 */ + +/** + * @} + */ + +/** @defgroup RCC_APB1_APB2_Clock_Source APB1 APB2 Clock Source + * @{ + */ +#define RCC_HCLK_DIV1 RCC_CFGR_PPRE1_DIV1 /*!< HCLK not divided */ +#define RCC_HCLK_DIV2 RCC_CFGR_PPRE1_DIV2 /*!< HCLK divided by 2 */ +#define RCC_HCLK_DIV4 RCC_CFGR_PPRE1_DIV4 /*!< HCLK divided by 4 */ +#define RCC_HCLK_DIV8 RCC_CFGR_PPRE1_DIV8 /*!< HCLK divided by 8 */ +#define RCC_HCLK_DIV16 RCC_CFGR_PPRE1_DIV16 /*!< HCLK divided by 16 */ + +/** + * @} + */ + +/** @defgroup RCC_RTC_Clock_Source RTC Clock Source + * @{ + */ +#define RCC_RTCCLKSOURCE_NO_CLK RCC_BDCR_RTCSEL_NOCLOCK /*!< No clock */ +#define RCC_RTCCLKSOURCE_LSE RCC_BDCR_RTCSEL_LSE /*!< LSE oscillator clock used as RTC clock */ +#define RCC_RTCCLKSOURCE_LSI RCC_BDCR_RTCSEL_LSI /*!< LSI oscillator clock used as RTC clock */ +#define RCC_RTCCLKSOURCE_HSE_DIV32 RCC_BDCR_RTCSEL_HSE /*!< HSE oscillator clock divided by 32 used as RTC clock */ +/** + * @} + */ + +/** @defgroup RCC_PLL_Multiplication_Factor RCC PLL Multiplication Factor + * @{ + */ +#define RCC_PLL_MUL2 RCC_CFGR_PLLMUL2 +#define RCC_PLL_MUL3 RCC_CFGR_PLLMUL3 +#define RCC_PLL_MUL4 RCC_CFGR_PLLMUL4 +#define RCC_PLL_MUL5 RCC_CFGR_PLLMUL5 +#define RCC_PLL_MUL6 RCC_CFGR_PLLMUL6 +#define RCC_PLL_MUL7 RCC_CFGR_PLLMUL7 +#define RCC_PLL_MUL8 RCC_CFGR_PLLMUL8 +#define RCC_PLL_MUL9 RCC_CFGR_PLLMUL9 +#define RCC_PLL_MUL10 RCC_CFGR_PLLMUL10 +#define RCC_PLL_MUL11 RCC_CFGR_PLLMUL11 +#define RCC_PLL_MUL12 RCC_CFGR_PLLMUL12 +#define RCC_PLL_MUL13 RCC_CFGR_PLLMUL13 +#define RCC_PLL_MUL14 RCC_CFGR_PLLMUL14 +#define RCC_PLL_MUL15 RCC_CFGR_PLLMUL15 +#define RCC_PLL_MUL16 RCC_CFGR_PLLMUL16 + +/** + * @} + */ + +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) +/** @defgroup RCC_PLL_Prediv_Factor RCC PLL Prediv Factor + * @{ + */ + +#define RCC_PREDIV_DIV1 RCC_CFGR2_PREDIV_DIV1 +#define RCC_PREDIV_DIV2 RCC_CFGR2_PREDIV_DIV2 +#define RCC_PREDIV_DIV3 RCC_CFGR2_PREDIV_DIV3 +#define RCC_PREDIV_DIV4 RCC_CFGR2_PREDIV_DIV4 +#define RCC_PREDIV_DIV5 RCC_CFGR2_PREDIV_DIV5 +#define RCC_PREDIV_DIV6 RCC_CFGR2_PREDIV_DIV6 +#define RCC_PREDIV_DIV7 RCC_CFGR2_PREDIV_DIV7 +#define RCC_PREDIV_DIV8 RCC_CFGR2_PREDIV_DIV8 +#define RCC_PREDIV_DIV9 RCC_CFGR2_PREDIV_DIV9 +#define RCC_PREDIV_DIV10 RCC_CFGR2_PREDIV_DIV10 +#define RCC_PREDIV_DIV11 RCC_CFGR2_PREDIV_DIV11 +#define RCC_PREDIV_DIV12 RCC_CFGR2_PREDIV_DIV12 +#define RCC_PREDIV_DIV13 RCC_CFGR2_PREDIV_DIV13 +#define RCC_PREDIV_DIV14 RCC_CFGR2_PREDIV_DIV14 +#define RCC_PREDIV_DIV15 RCC_CFGR2_PREDIV_DIV15 +#define RCC_PREDIV_DIV16 RCC_CFGR2_PREDIV_DIV16 + +/** + * @} + */ + +#endif +#if defined(RCC_CFGR_PLLSRC_HSI_DIV2) +/** @defgroup RCC_PLL_HSE_Prediv_Factor RCC PLL HSE Prediv Factor + * @{ + */ + +#define RCC_HSE_PREDIV_DIV1 RCC_CFGR2_PREDIV_DIV1 +#define RCC_HSE_PREDIV_DIV2 RCC_CFGR2_PREDIV_DIV2 +#define RCC_HSE_PREDIV_DIV3 RCC_CFGR2_PREDIV_DIV3 +#define RCC_HSE_PREDIV_DIV4 RCC_CFGR2_PREDIV_DIV4 +#define RCC_HSE_PREDIV_DIV5 RCC_CFGR2_PREDIV_DIV5 +#define RCC_HSE_PREDIV_DIV6 RCC_CFGR2_PREDIV_DIV6 +#define RCC_HSE_PREDIV_DIV7 RCC_CFGR2_PREDIV_DIV7 +#define RCC_HSE_PREDIV_DIV8 RCC_CFGR2_PREDIV_DIV8 +#define RCC_HSE_PREDIV_DIV9 RCC_CFGR2_PREDIV_DIV9 +#define RCC_HSE_PREDIV_DIV10 RCC_CFGR2_PREDIV_DIV10 +#define RCC_HSE_PREDIV_DIV11 RCC_CFGR2_PREDIV_DIV11 +#define RCC_HSE_PREDIV_DIV12 RCC_CFGR2_PREDIV_DIV12 +#define RCC_HSE_PREDIV_DIV13 RCC_CFGR2_PREDIV_DIV13 +#define RCC_HSE_PREDIV_DIV14 RCC_CFGR2_PREDIV_DIV14 +#define RCC_HSE_PREDIV_DIV15 RCC_CFGR2_PREDIV_DIV15 +#define RCC_HSE_PREDIV_DIV16 RCC_CFGR2_PREDIV_DIV16 + +/** + * @} + */ +#endif /* RCC_CFGR_PLLSRC_HSI_DIV2 */ + +#if defined(RCC_CFGR3_USART2SW) +/** @defgroup RCC_USART2_Clock_Source RCC USART2 Clock Source + * @{ + */ +#define RCC_USART2CLKSOURCE_PCLK1 RCC_CFGR3_USART2SW_PCLK +#define RCC_USART2CLKSOURCE_SYSCLK RCC_CFGR3_USART2SW_SYSCLK +#define RCC_USART2CLKSOURCE_LSE RCC_CFGR3_USART2SW_LSE +#define RCC_USART2CLKSOURCE_HSI RCC_CFGR3_USART2SW_HSI + +/** + * @} + */ +#endif /* RCC_CFGR3_USART2SW */ + +#if defined(RCC_CFGR3_USART3SW) +/** @defgroup RCC_USART3_Clock_Source RCC USART3 Clock Source + * @{ + */ +#define RCC_USART3CLKSOURCE_PCLK1 RCC_CFGR3_USART3SW_PCLK +#define RCC_USART3CLKSOURCE_SYSCLK RCC_CFGR3_USART3SW_SYSCLK +#define RCC_USART3CLKSOURCE_LSE RCC_CFGR3_USART3SW_LSE +#define RCC_USART3CLKSOURCE_HSI RCC_CFGR3_USART3SW_HSI + +/** + * @} + */ +#endif /* RCC_CFGR3_USART3SW */ + +/** @defgroup RCC_I2C1_Clock_Source RCC I2C1 Clock Source + * @{ + */ +#define RCC_I2C1CLKSOURCE_HSI RCC_CFGR3_I2C1SW_HSI +#define RCC_I2C1CLKSOURCE_SYSCLK RCC_CFGR3_I2C1SW_SYSCLK + +/** + * @} + */ +/** @defgroup RCC_MCO_Index MCO Index + * @{ + */ +#define RCC_MCO1 (0x00000000U) +#define RCC_MCO RCC_MCO1 /*!< MCO1 to be compliant with other families with 2 MCOs*/ + +/** + * @} + */ + +/** @defgroup RCC_Interrupt Interrupts + * @{ + */ +#define RCC_IT_LSIRDY ((uint8_t)RCC_CIR_LSIRDYF) /*!< LSI Ready Interrupt flag */ +#define RCC_IT_LSERDY ((uint8_t)RCC_CIR_LSERDYF) /*!< LSE Ready Interrupt flag */ +#define RCC_IT_HSIRDY ((uint8_t)RCC_CIR_HSIRDYF) /*!< HSI Ready Interrupt flag */ +#define RCC_IT_HSERDY ((uint8_t)RCC_CIR_HSERDYF) /*!< HSE Ready Interrupt flag */ +#define RCC_IT_PLLRDY ((uint8_t)RCC_CIR_PLLRDYF) /*!< PLL Ready Interrupt flag */ +#define RCC_IT_CSS ((uint8_t)RCC_CIR_CSSF) /*!< Clock Security System Interrupt flag */ +/** + * @} + */ + +/** @defgroup RCC_Flag Flags + * Elements values convention: XXXYYYYYb + * - YYYYY : Flag position in the register + * - XXX : Register index + * - 001: CR register + * - 010: BDCR register + * - 011: CSR register + * - 100: CFGR register + * @{ + */ +/* Flags in the CR register */ +#define RCC_FLAG_HSIRDY ((uint8_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_HSIRDY))) /*!< Internal High Speed clock ready flag */ +#define RCC_FLAG_HSERDY ((uint8_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_HSERDY))) /*!< External High Speed clock ready flag */ +#define RCC_FLAG_PLLRDY ((uint8_t)((CR_REG_INDEX << 5U) | POSITION_VAL(RCC_CR_PLLRDY))) /*!< PLL clock ready flag */ + +/* Flags in the CSR register */ +#define RCC_FLAG_LSIRDY ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_LSIRDY))) /*!< Internal Low Speed oscillator Ready */ +#if defined(RCC_CSR_V18PWRRSTF) +#define RCC_FLAG_V18PWRRST ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_V18PWRRSTF))) +#endif +#define RCC_FLAG_OBLRST ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_OBLRSTF))) /*!< Options bytes loading reset flag */ +#define RCC_FLAG_PINRST ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_PINRSTF))) /*!< PIN reset flag */ +#define RCC_FLAG_PORRST ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_PORRSTF))) /*!< POR/PDR reset flag */ +#define RCC_FLAG_SFTRST ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_SFTRSTF))) /*!< Software Reset flag */ +#define RCC_FLAG_IWDGRST ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_IWDGRSTF))) /*!< Independent Watchdog reset flag */ +#define RCC_FLAG_WWDGRST ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_WWDGRSTF))) /*!< Window watchdog reset flag */ +#define RCC_FLAG_LPWRRST ((uint8_t)((CSR_REG_INDEX << 5U) | POSITION_VAL(RCC_CSR_LPWRRSTF))) /*!< Low-Power reset flag */ + +/* Flags in the BDCR register */ +#define RCC_FLAG_LSERDY ((uint8_t)((BDCR_REG_INDEX << 5U) | POSITION_VAL(RCC_BDCR_LSERDY))) /*!< External Low Speed oscillator Ready */ + +/* Flags in the CFGR register */ +#if defined(RCC_CFGR_MCOF) +#define RCC_FLAG_MCO ((uint8_t)((CFGR_REG_INDEX << 5U) | POSITION_VAL(RCC_CFGR_MCOF))) /*!< Microcontroller Clock Output Flag */ +#endif /* RCC_CFGR_MCOF */ + +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ + +/** @defgroup RCC_Exported_Macros RCC Exported Macros + * @{ + */ + +/** @defgroup RCC_AHB_Clock_Enable_Disable RCC AHB Clock Enable Disable + * @brief Enable or disable the AHB peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#define __HAL_RCC_GPIOA_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOAEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOAEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_GPIOB_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOBEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOBEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_GPIOC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOCEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_GPIOD_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIODEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIODEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_GPIOF_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOFEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOFEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_CRC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_CRCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_CRCEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_DMA1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_DMA1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_DMA1EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SRAM_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_SRAMEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_SRAMEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_FLITF_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_FLITFEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FLITFEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TSC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_TSCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_TSCEN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_GPIOA_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOAEN)) +#define __HAL_RCC_GPIOB_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOBEN)) +#define __HAL_RCC_GPIOC_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOCEN)) +#define __HAL_RCC_GPIOD_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIODEN)) +#define __HAL_RCC_GPIOF_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOFEN)) +#define __HAL_RCC_CRC_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_CRCEN)) +#define __HAL_RCC_DMA1_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_DMA1EN)) +#define __HAL_RCC_SRAM_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_SRAMEN)) +#define __HAL_RCC_FLITF_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_FLITFEN)) +#define __HAL_RCC_TSC_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_TSCEN)) +/** + * @} + */ + +/** @defgroup RCC_APB1_Clock_Enable_Disable RCC APB1 Clock Enable Disable + * @brief Enable or disable the Low Speed APB (APB1) peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#define __HAL_RCC_TIM2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM6_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM6EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_WWDG_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_WWDGEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_WWDGEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_USART2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_USART3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USART3EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_I2C1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C1EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_PWR_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_PWREN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_PWREN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_DAC1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DAC1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DAC1EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_TIM2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM2EN)) +#define __HAL_RCC_TIM6_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM6EN)) +#define __HAL_RCC_WWDG_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_WWDGEN)) +#define __HAL_RCC_USART2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART2EN)) +#define __HAL_RCC_USART3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USART3EN)) +#define __HAL_RCC_I2C1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C1EN)) +#define __HAL_RCC_PWR_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_PWREN)) +#define __HAL_RCC_DAC1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DAC1EN)) +/** + * @} + */ + +/** @defgroup RCC_APB2_Clock_Enable_Disable RCC APB2 Clock Enable Disable + * @brief Enable or disable the High Speed APB (APB2) peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#define __HAL_RCC_SYSCFG_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SYSCFGEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM15_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM15EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM16_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM16EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM17_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM17EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_USART1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_USART1EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_SYSCFG_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SYSCFGEN)) +#define __HAL_RCC_TIM15_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM15EN)) +#define __HAL_RCC_TIM16_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM16EN)) +#define __HAL_RCC_TIM17_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM17EN)) +#define __HAL_RCC_USART1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_USART1EN)) +/** + * @} + */ + +/** @defgroup RCC_AHB_Peripheral_Clock_Enable_Disable_Status AHB Peripheral Clock Enable Disable Status + * @brief Get the enable or disable status of the AHB peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#define __HAL_RCC_GPIOA_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOAEN)) != RESET) +#define __HAL_RCC_GPIOB_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOBEN)) != RESET) +#define __HAL_RCC_GPIOC_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOCEN)) != RESET) +#define __HAL_RCC_GPIOD_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIODEN)) != RESET) +#define __HAL_RCC_GPIOF_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOFEN)) != RESET) +#define __HAL_RCC_CRC_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_CRCEN)) != RESET) +#define __HAL_RCC_DMA1_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA1EN)) != RESET) +#define __HAL_RCC_SRAM_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_SRAMEN)) != RESET) +#define __HAL_RCC_FLITF_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_FLITFEN)) != RESET) +#define __HAL_RCC_TSC_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_TSCEN)) != RESET) + +#define __HAL_RCC_GPIOA_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOAEN)) == RESET) +#define __HAL_RCC_GPIOB_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOBEN)) == RESET) +#define __HAL_RCC_GPIOC_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOCEN)) == RESET) +#define __HAL_RCC_GPIOD_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIODEN)) == RESET) +#define __HAL_RCC_GPIOF_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOFEN)) == RESET) +#define __HAL_RCC_CRC_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_CRCEN)) == RESET) +#define __HAL_RCC_DMA1_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA1EN)) == RESET) +#define __HAL_RCC_SRAM_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_SRAMEN)) == RESET) +#define __HAL_RCC_FLITF_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_FLITFEN)) == RESET) +#define __HAL_RCC_TSC_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_TSCEN)) == RESET) +/** + * @} + */ + +/** @defgroup RCC_APB1_Clock_Enable_Disable_Status APB1 Peripheral Clock Enable Disable Status + * @brief Get the enable or disable status of the APB1 peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#define __HAL_RCC_TIM2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM2EN)) != RESET) +#define __HAL_RCC_TIM6_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM6EN)) != RESET) +#define __HAL_RCC_WWDG_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_WWDGEN)) != RESET) +#define __HAL_RCC_USART2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USART2EN)) != RESET) +#define __HAL_RCC_USART3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USART3EN)) != RESET) +#define __HAL_RCC_I2C1_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C1EN)) != RESET) +#define __HAL_RCC_PWR_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_PWREN)) != RESET) +#define __HAL_RCC_DAC1_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DAC1EN)) != RESET) + +#define __HAL_RCC_TIM2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM2EN)) == RESET) +#define __HAL_RCC_TIM6_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM6EN)) == RESET) +#define __HAL_RCC_WWDG_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_WWDGEN)) == RESET) +#define __HAL_RCC_USART2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USART2EN)) == RESET) +#define __HAL_RCC_USART3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USART3EN)) == RESET) +#define __HAL_RCC_I2C1_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C1EN)) == RESET) +#define __HAL_RCC_PWR_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_PWREN)) == RESET) +#define __HAL_RCC_DAC1_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DAC1EN)) == RESET) +/** + * @} + */ + +/** @defgroup RCC_APB2_Clock_Enable_Disable_Status APB2 Peripheral Clock Enable Disable Status + * @brief EGet the enable or disable status of the APB2 peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#define __HAL_RCC_SYSCFG_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SYSCFGEN)) != RESET) +#define __HAL_RCC_TIM15_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM15EN)) != RESET) +#define __HAL_RCC_TIM16_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM16EN)) != RESET) +#define __HAL_RCC_TIM17_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM17EN)) != RESET) +#define __HAL_RCC_USART1_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_USART1EN)) != RESET) + +#define __HAL_RCC_SYSCFG_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SYSCFGEN)) == RESET) +#define __HAL_RCC_TIM15_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM15EN)) == RESET) +#define __HAL_RCC_TIM16_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM16EN)) == RESET) +#define __HAL_RCC_TIM17_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM17EN)) == RESET) +#define __HAL_RCC_USART1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_USART1EN)) == RESET) +/** + * @} + */ + +/** @defgroup RCC_AHB_Force_Release_Reset RCC AHB Force Release Reset + * @brief Force or release AHB peripheral reset. + * @{ + */ +#define __HAL_RCC_AHB_FORCE_RESET() (RCC->AHBRSTR = 0xFFFFFFFFU) +#define __HAL_RCC_GPIOA_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOARST)) +#define __HAL_RCC_GPIOB_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOBRST)) +#define __HAL_RCC_GPIOC_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOCRST)) +#define __HAL_RCC_GPIOD_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIODRST)) +#define __HAL_RCC_GPIOF_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOFRST)) +#define __HAL_RCC_TSC_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_TSCRST)) + +#define __HAL_RCC_AHB_RELEASE_RESET() (RCC->AHBRSTR = 0x00000000U) +#define __HAL_RCC_GPIOA_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOARST)) +#define __HAL_RCC_GPIOB_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOBRST)) +#define __HAL_RCC_GPIOC_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOCRST)) +#define __HAL_RCC_GPIOD_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIODRST)) +#define __HAL_RCC_GPIOF_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOFRST)) +#define __HAL_RCC_TSC_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_TSCRST)) +/** + * @} + */ + +/** @defgroup RCC_APB1_Force_Release_Reset RCC APB1 Force Release Reset + * @brief Force or release APB1 peripheral reset. + * @{ + */ +#define __HAL_RCC_APB1_FORCE_RESET() (RCC->APB1RSTR = 0xFFFFFFFFU) +#define __HAL_RCC_TIM2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM2RST)) +#define __HAL_RCC_TIM6_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM6RST)) +#define __HAL_RCC_WWDG_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_WWDGRST)) +#define __HAL_RCC_USART2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART2RST)) +#define __HAL_RCC_USART3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USART3RST)) +#define __HAL_RCC_I2C1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C1RST)) +#define __HAL_RCC_PWR_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_PWRRST)) +#define __HAL_RCC_DAC1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DAC1RST)) + +#define __HAL_RCC_APB1_RELEASE_RESET() (RCC->APB1RSTR = 0x00000000U) +#define __HAL_RCC_TIM2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM2RST)) +#define __HAL_RCC_TIM6_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM6RST)) +#define __HAL_RCC_WWDG_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_WWDGRST)) +#define __HAL_RCC_USART2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART2RST)) +#define __HAL_RCC_USART3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USART3RST)) +#define __HAL_RCC_I2C1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C1RST)) +#define __HAL_RCC_PWR_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_PWRRST)) +#define __HAL_RCC_DAC1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DAC1RST)) +/** + * @} + */ + +/** @defgroup RCC_APB2_Force_Release_Reset RCC APB2 Force Release Reset + * @brief Force or release APB2 peripheral reset. + * @{ + */ +#define __HAL_RCC_APB2_FORCE_RESET() (RCC->APB2RSTR = 0xFFFFFFFFU) +#define __HAL_RCC_SYSCFG_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SYSCFGRST)) +#define __HAL_RCC_TIM15_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM15RST)) +#define __HAL_RCC_TIM16_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM16RST)) +#define __HAL_RCC_TIM17_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM17RST)) +#define __HAL_RCC_USART1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_USART1RST)) + +#define __HAL_RCC_APB2_RELEASE_RESET() (RCC->APB2RSTR = 0x00000000U) +#define __HAL_RCC_SYSCFG_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SYSCFGRST)) +#define __HAL_RCC_TIM15_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM15RST)) +#define __HAL_RCC_TIM16_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM16RST)) +#define __HAL_RCC_TIM17_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM17RST)) +#define __HAL_RCC_USART1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_USART1RST)) +/** + * @} + */ + +/** @defgroup RCC_HSI_Configuration HSI Configuration + * @{ + */ + +/** @brief Macros to enable or disable the Internal High Speed oscillator (HSI). + * @note The HSI is stopped by hardware when entering STOP and STANDBY modes. + * It is used (enabled by hardware) as system clock source after startup + * from Reset, wakeup from STOP and STANDBY mode, or in case of failure + * of the HSE used directly or indirectly as system clock (if the Clock + * Security System CSS is enabled). + * @note HSI can not be stopped if it is used as system clock source. In this case, + * you have to select another source of the system clock then stop the HSI. + * @note After enabling the HSI, the application software should wait on HSIRDY + * flag to be set indicating that HSI clock is stable and can be used as + * system clock source. + * @note When the HSI is stopped, HSIRDY flag goes low after 6 HSI oscillator + * clock cycles. + */ +#define __HAL_RCC_HSI_ENABLE() (*(__IO uint32_t *) RCC_CR_HSION_BB = ENABLE) +#define __HAL_RCC_HSI_DISABLE() (*(__IO uint32_t *) RCC_CR_HSION_BB = DISABLE) + +/** @brief Macro to adjust the Internal High Speed oscillator (HSI) calibration value. + * @note The calibration is used to compensate for the variations in voltage + * and temperature that influence the frequency of the internal HSI RC. + * @param _HSICALIBRATIONVALUE_ specifies the calibration trimming value. + * (default is RCC_HSICALIBRATION_DEFAULT). + * This parameter must be a number between 0 and 0x1F. + */ +#define __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(_HSICALIBRATIONVALUE_) \ + (MODIFY_REG(RCC->CR, RCC_CR_HSITRIM, (uint32_t)(_HSICALIBRATIONVALUE_) << POSITION_VAL(RCC_CR_HSITRIM))) + +/** + * @} + */ + +/** @defgroup RCC_LSI_Configuration LSI Configuration + * @{ + */ + +/** @brief Macro to enable the Internal Low Speed oscillator (LSI). + * @note After enabling the LSI, the application software should wait on + * LSIRDY flag to be set indicating that LSI clock is stable and can + * be used to clock the IWDG and/or the RTC. + */ +#define __HAL_RCC_LSI_ENABLE() (*(__IO uint32_t *) RCC_CSR_LSION_BB = ENABLE) + +/** @brief Macro to disable the Internal Low Speed oscillator (LSI). + * @note LSI can not be disabled if the IWDG is running. + * @note When the LSI is stopped, LSIRDY flag goes low after 6 LSI oscillator + * clock cycles. + */ +#define __HAL_RCC_LSI_DISABLE() (*(__IO uint32_t *) RCC_CSR_LSION_BB = DISABLE) + +/** + * @} + */ + +/** @defgroup RCC_HSE_Configuration HSE Configuration + * @{ + */ + +/** + * @brief Macro to configure the External High Speed oscillator (HSE). + * @note Transition HSE Bypass to HSE On and HSE On to HSE Bypass are not + * supported by this macro. User should request a transition to HSE Off + * first and then HSE On or HSE Bypass. + * @note After enabling the HSE (RCC_HSE_ON or RCC_HSE_Bypass), the application + * software should wait on HSERDY flag to be set indicating that HSE clock + * is stable and can be used to clock the PLL and/or system clock. + * @note HSE state can not be changed if it is used directly or through the + * PLL as system clock. In this case, you have to select another source + * of the system clock then change the HSE state (ex. disable it). + * @note The HSE is stopped by hardware when entering STOP and STANDBY modes. + * @note This function reset the CSSON bit, so if the clock security system(CSS) + * was previously enabled you have to enable it again after calling this + * function. + * @param __STATE__ specifies the new state of the HSE. + * This parameter can be one of the following values: + * @arg @ref RCC_HSE_OFF turn OFF the HSE oscillator, HSERDY flag goes low after + * 6 HSE oscillator clock cycles. + * @arg @ref RCC_HSE_ON turn ON the HSE oscillator + * @arg @ref RCC_HSE_BYPASS HSE oscillator bypassed with external clock + */ +#define __HAL_RCC_HSE_CONFIG(__STATE__) \ + do{ \ + if ((__STATE__) == RCC_HSE_ON) \ + { \ + SET_BIT(RCC->CR, RCC_CR_HSEON); \ + } \ + else if ((__STATE__) == RCC_HSE_OFF) \ + { \ + CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \ + CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \ + } \ + else if ((__STATE__) == RCC_HSE_BYPASS) \ + { \ + SET_BIT(RCC->CR, RCC_CR_HSEBYP); \ + SET_BIT(RCC->CR, RCC_CR_HSEON); \ + } \ + else \ + { \ + CLEAR_BIT(RCC->CR, RCC_CR_HSEON); \ + CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); \ + } \ + }while(0U) + +/** + * @} + */ + +/** @defgroup RCC_LSE_Configuration LSE Configuration + * @{ + */ + +/** + * @brief Macro to configure the External Low Speed oscillator (LSE). + * @note Transitions LSE Bypass to LSE On and LSE On to LSE Bypass are not supported by this macro. + * @note As the LSE is in the Backup domain and write access is denied to + * this domain after reset, you have to enable write access using + * @ref HAL_PWR_EnableBkUpAccess() function before to configure the LSE + * (to be done once after reset). + * @note After enabling the LSE (RCC_LSE_ON or RCC_LSE_BYPASS), the application + * software should wait on LSERDY flag to be set indicating that LSE clock + * is stable and can be used to clock the RTC. + * @param __STATE__ specifies the new state of the LSE. + * This parameter can be one of the following values: + * @arg @ref RCC_LSE_OFF turn OFF the LSE oscillator, LSERDY flag goes low after + * 6 LSE oscillator clock cycles. + * @arg @ref RCC_LSE_ON turn ON the LSE oscillator. + * @arg @ref RCC_LSE_BYPASS LSE oscillator bypassed with external clock. + */ +#define __HAL_RCC_LSE_CONFIG(__STATE__) \ + do{ \ + if ((__STATE__) == RCC_LSE_ON) \ + { \ + SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \ + } \ + else if ((__STATE__) == RCC_LSE_OFF) \ + { \ + CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \ + CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \ + } \ + else if ((__STATE__) == RCC_LSE_BYPASS) \ + { \ + SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \ + SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); \ + } \ + else \ + { \ + CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); \ + CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); \ + } \ + }while(0U) + +/** + * @} + */ + +/** @defgroup RCC_USARTx_Clock_Config RCC USARTx Clock Config + * @{ + */ + +/** @brief Macro to configure the USART1 clock (USART1CLK). + * @param __USART1CLKSOURCE__ specifies the USART1 clock source. + * This parameter can be one of the following values: + @if STM32F302xC + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F303xC + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F358xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F302xE + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F303xE + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F398xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F373xC + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F378xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F301x8 + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F302x8 + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F318xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F303x8 + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F334x8 + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F328xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + * @arg @ref RCC_USART1CLKSOURCE_HSI HSI selected as USART1 clock + * @arg @ref RCC_USART1CLKSOURCE_SYSCLK System Clock selected as USART1 clock + * @arg @ref RCC_USART1CLKSOURCE_LSE LSE selected as USART1 clock + */ +#define __HAL_RCC_USART1_CONFIG(__USART1CLKSOURCE__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_USART1SW, (uint32_t)(__USART1CLKSOURCE__)) + +/** @brief Macro to get the USART1 clock source. + * @retval The clock source can be one of the following values: + @if STM32F302xC + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F303xC + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F358xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F302xE + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F303xE + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F398xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F373xC + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F378xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK2 PCLK2 selected as USART1 clock + @endif + @if STM32F301x8 + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F302x8 + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F318xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F303x8 + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F334x8 + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + @if STM32F328xx + * @arg @ref RCC_USART1CLKSOURCE_PCLK1 PCLK1 selected as USART1 clock + @endif + * @arg @ref RCC_USART1CLKSOURCE_HSI HSI selected as USART1 clock + * @arg @ref RCC_USART1CLKSOURCE_SYSCLK System Clock selected as USART1 clock + * @arg @ref RCC_USART1CLKSOURCE_LSE LSE selected as USART1 clock + */ +#define __HAL_RCC_GET_USART1_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_USART1SW))) + +#if defined(RCC_CFGR3_USART2SW) +/** @brief Macro to configure the USART2 clock (USART2CLK). + * @param __USART2CLKSOURCE__ specifies the USART2 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_USART2CLKSOURCE_PCLK1 PCLK1 selected as USART2 clock + * @arg @ref RCC_USART2CLKSOURCE_HSI HSI selected as USART2 clock + * @arg @ref RCC_USART2CLKSOURCE_SYSCLK System Clock selected as USART2 clock + * @arg @ref RCC_USART2CLKSOURCE_LSE LSE selected as USART2 clock + */ +#define __HAL_RCC_USART2_CONFIG(__USART2CLKSOURCE__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_USART2SW, (uint32_t)(__USART2CLKSOURCE__)) + +/** @brief Macro to get the USART2 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_USART2CLKSOURCE_PCLK1 PCLK1 selected as USART2 clock + * @arg @ref RCC_USART2CLKSOURCE_HSI HSI selected as USART2 clock + * @arg @ref RCC_USART2CLKSOURCE_SYSCLK System Clock selected as USART2 clock + * @arg @ref RCC_USART2CLKSOURCE_LSE LSE selected as USART2 clock + */ +#define __HAL_RCC_GET_USART2_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_USART2SW))) +#endif /* RCC_CFGR3_USART2SW */ + +#if defined(RCC_CFGR3_USART3SW) +/** @brief Macro to configure the USART3 clock (USART3CLK). + * @param __USART3CLKSOURCE__ specifies the USART3 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_USART3CLKSOURCE_PCLK1 PCLK1 selected as USART3 clock + * @arg @ref RCC_USART3CLKSOURCE_HSI HSI selected as USART3 clock + * @arg @ref RCC_USART3CLKSOURCE_SYSCLK System Clock selected as USART3 clock + * @arg @ref RCC_USART3CLKSOURCE_LSE LSE selected as USART3 clock + */ +#define __HAL_RCC_USART3_CONFIG(__USART3CLKSOURCE__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_USART3SW, (uint32_t)(__USART3CLKSOURCE__)) + +/** @brief Macro to get the USART3 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_USART3CLKSOURCE_PCLK1 PCLK1 selected as USART3 clock + * @arg @ref RCC_USART3CLKSOURCE_HSI HSI selected as USART3 clock + * @arg @ref RCC_USART3CLKSOURCE_SYSCLK System Clock selected as USART3 clock + * @arg @ref RCC_USART3CLKSOURCE_LSE LSE selected as USART3 clock + */ +#define __HAL_RCC_GET_USART3_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_USART3SW))) +#endif /* RCC_CFGR3_USART2SW */ +/** + * @} + */ + +/** @defgroup RCC_I2Cx_Clock_Config RCC I2Cx Clock Config + * @{ + */ + +/** @brief Macro to configure the I2C1 clock (I2C1CLK). + * @param __I2C1CLKSOURCE__ specifies the I2C1 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_I2C1CLKSOURCE_HSI HSI selected as I2C1 clock + * @arg @ref RCC_I2C1CLKSOURCE_SYSCLK System Clock selected as I2C1 clock + */ +#define __HAL_RCC_I2C1_CONFIG(__I2C1CLKSOURCE__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_I2C1SW, (uint32_t)(__I2C1CLKSOURCE__)) + +/** @brief Macro to get the I2C1 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_I2C1CLKSOURCE_HSI HSI selected as I2C1 clock + * @arg @ref RCC_I2C1CLKSOURCE_SYSCLK System Clock selected as I2C1 clock + */ +#define __HAL_RCC_GET_I2C1_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_I2C1SW))) +/** + * @} + */ + +/** @defgroup RCC_PLL_Configuration PLL Configuration + * @{ + */ + +/** @brief Macro to enable the main PLL. + * @note After enabling the main PLL, the application software should wait on + * PLLRDY flag to be set indicating that PLL clock is stable and can + * be used as system clock source. + * @note The main PLL is disabled by hardware when entering STOP and STANDBY modes. + */ +#define __HAL_RCC_PLL_ENABLE() (*(__IO uint32_t *) RCC_CR_PLLON_BB = ENABLE) + +/** @brief Macro to disable the main PLL. + * @note The main PLL can not be disabled if it is used as system clock source + */ +#define __HAL_RCC_PLL_DISABLE() (*(__IO uint32_t *) RCC_CR_PLLON_BB = DISABLE) + + +/** @brief Get oscillator clock selected as PLL input clock + * @retval The clock source used for PLL entry. The returned value can be one + * of the following: + * @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL input clock + * @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL input clock + */ +#define __HAL_RCC_GET_PLL_OSCSOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLSRC))) + +/** + * @} + */ + +/** @defgroup RCC_Get_Clock_source Get Clock source + * @{ + */ + +/** + * @brief Macro to configure the system clock source. + * @param __SYSCLKSOURCE__ specifies the system clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_SYSCLKSOURCE_HSI HSI oscillator is used as system clock source. + * @arg @ref RCC_SYSCLKSOURCE_HSE HSE oscillator is used as system clock source. + * @arg @ref RCC_SYSCLKSOURCE_PLLCLK PLL output is used as system clock source. + */ +#define __HAL_RCC_SYSCLK_CONFIG(__SYSCLKSOURCE__) \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, (__SYSCLKSOURCE__)) + +/** @brief Macro to get the clock source used as system clock. + * @retval The clock source used as system clock. The returned value can be one + * of the following: + * @arg @ref RCC_SYSCLKSOURCE_STATUS_HSI HSI used as system clock + * @arg @ref RCC_SYSCLKSOURCE_STATUS_HSE HSE used as system clock + * @arg @ref RCC_SYSCLKSOURCE_STATUS_PLLCLK PLL used as system clock + */ +#define __HAL_RCC_GET_SYSCLK_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR,RCC_CFGR_SWS))) + +/** + * @} + */ + +/** @defgroup RCCEx_MCOx_Clock_Config RCC Extended MCOx Clock Config + * @{ + */ + +#if defined(RCC_CFGR_MCOPRE) +/** @brief Macro to configure the MCO clock. + * @param __MCOCLKSOURCE__ specifies the MCO clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_MCO1SOURCE_NOCLOCK No clock selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_SYSCLK System Clock selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_HSI HSI oscillator clock selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_HSE HSE selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_LSI LSI selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_LSE LSE selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_PLLCLK_DIV2 PLLCLK Divided by 2 selected as MCO clock + * @param __MCODIV__ specifies the MCO clock prescaler. + * This parameter can be one of the following values: + * @arg @ref RCC_MCODIV_1 MCO clock source is divided by 1 + * @arg @ref RCC_MCODIV_2 MCO clock source is divided by 2 + * @arg @ref RCC_MCODIV_4 MCO clock source is divided by 4 + * @arg @ref RCC_MCODIV_8 MCO clock source is divided by 8 + * @arg @ref RCC_MCODIV_16 MCO clock source is divided by 16 + * @arg @ref RCC_MCODIV_32 MCO clock source is divided by 32 + * @arg @ref RCC_MCODIV_64 MCO clock source is divided by 64 + * @arg @ref RCC_MCODIV_128 MCO clock source is divided by 128 + */ +#else +/** @brief Macro to configure the MCO clock. + * @param __MCOCLKSOURCE__ specifies the MCO clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_MCO1SOURCE_NOCLOCK No clock selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_SYSCLK System Clock selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_HSI HSI selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_HSE HSE selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_LSI LSI selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_LSE LSE selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_PLLCLK_DIV2 PLLCLK Divided by 2 selected as MCO clock + * @param __MCODIV__ specifies the MCO clock prescaler. + * This parameter can be one of the following values: + * @arg @ref RCC_MCODIV_1 No division applied on MCO clock source + */ +#endif +#if defined(RCC_CFGR_MCOPRE) +#define __HAL_RCC_MCO1_CONFIG(__MCOCLKSOURCE__, __MCODIV__) \ + MODIFY_REG(RCC->CFGR, (RCC_CFGR_MCO | RCC_CFGR_MCOPRE), ((__MCOCLKSOURCE__) | (__MCODIV__))) +#else + +#define __HAL_RCC_MCO1_CONFIG(__MCOCLKSOURCE__, __MCODIV__) \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_MCO, (__MCOCLKSOURCE__)) + +#endif + +/** + * @} + */ + + /** @defgroup RCC_RTC_Clock_Configuration RCC RTC Clock Configuration + * @{ + */ + +/** @brief Macro to configure the RTC clock (RTCCLK). + * @note As the RTC clock configuration bits are in the Backup domain and write + * access is denied to this domain after reset, you have to enable write + * access using the Power Backup Access macro before to configure + * the RTC clock source (to be done once after reset). + * @note Once the RTC clock is configured it cannot be changed unless the + * Backup domain is reset using @ref __HAL_RCC_BACKUPRESET_FORCE() macro, or by + * a Power On Reset (POR). + * + * @param __RTC_CLKSOURCE__ specifies the RTC clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_RTCCLKSOURCE_NO_CLK No clock selected as RTC clock + * @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as RTC clock + * @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as RTC clock + * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV32 HSE clock divided by 32 + * @note If the LSE or LSI is used as RTC clock source, the RTC continues to + * work in STOP and STANDBY modes, and can be used as wakeup source. + * However, when the LSI clock and HSE clock divided by 32 is used as RTC clock source, + * the RTC cannot be used in STOP and STANDBY modes. + * @note The system must always be configured so as to get a PCLK frequency greater than or + * equal to the RTCCLK frequency for a proper operation of the RTC. + */ +#define __HAL_RCC_RTC_CONFIG(__RTC_CLKSOURCE__) MODIFY_REG(RCC->BDCR, RCC_BDCR_RTCSEL, (__RTC_CLKSOURCE__)) + +/** @brief Macro to get the RTC clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_RTCCLKSOURCE_NO_CLK No clock selected as RTC clock + * @arg @ref RCC_RTCCLKSOURCE_LSE LSE selected as RTC clock + * @arg @ref RCC_RTCCLKSOURCE_LSI LSI selected as RTC clock + * @arg @ref RCC_RTCCLKSOURCE_HSE_DIV32 HSE clock divided by 32 + */ +#define __HAL_RCC_GET_RTC_SOURCE() (READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL)) + +/** @brief Macro to enable the the RTC clock. + * @note These macros must be used only after the RTC clock source was selected. + */ +#define __HAL_RCC_RTC_ENABLE() (*(__IO uint32_t *) RCC_BDCR_RTCEN_BB = ENABLE) + +/** @brief Macro to disable the the RTC clock. + * @note These macros must be used only after the RTC clock source was selected. + */ +#define __HAL_RCC_RTC_DISABLE() (*(__IO uint32_t *) RCC_BDCR_RTCEN_BB = DISABLE) + +/** @brief Macro to force the Backup domain reset. + * @note This function resets the RTC peripheral (including the backup registers) + * and the RTC clock source selection in RCC_BDCR register. + */ +#define __HAL_RCC_BACKUPRESET_FORCE() (*(__IO uint32_t *) RCC_BDCR_BDRST_BB = ENABLE) + +/** @brief Macros to release the Backup domain reset. + */ +#define __HAL_RCC_BACKUPRESET_RELEASE() (*(__IO uint32_t *) RCC_BDCR_BDRST_BB = DISABLE) + +/** + * @} + */ + +/** @defgroup RCC_Flags_Interrupts_Management Flags Interrupts Management + * @brief macros to manage the specified RCC Flags and interrupts. + * @{ + */ + +/** @brief Enable RCC interrupt. + * @param __INTERRUPT__ specifies the RCC interrupt sources to be enabled. + * This parameter can be any combination of the following values: + * @arg @ref RCC_IT_LSIRDY LSI ready interrupt + * @arg @ref RCC_IT_LSERDY LSE ready interrupt + * @arg @ref RCC_IT_HSIRDY HSI ready interrupt + * @arg @ref RCC_IT_HSERDY HSE ready interrupt + * @arg @ref RCC_IT_PLLRDY main PLL ready interrupt + */ +#define __HAL_RCC_ENABLE_IT(__INTERRUPT__) (*(__IO uint8_t *) RCC_CIR_BYTE1_ADDRESS |= (__INTERRUPT__)) + +/** @brief Disable RCC interrupt. + * @param __INTERRUPT__ specifies the RCC interrupt sources to be disabled. + * This parameter can be any combination of the following values: + * @arg @ref RCC_IT_LSIRDY LSI ready interrupt + * @arg @ref RCC_IT_LSERDY LSE ready interrupt + * @arg @ref RCC_IT_HSIRDY HSI ready interrupt + * @arg @ref RCC_IT_HSERDY HSE ready interrupt + * @arg @ref RCC_IT_PLLRDY main PLL ready interrupt + */ +#define __HAL_RCC_DISABLE_IT(__INTERRUPT__) (*(__IO uint8_t *) RCC_CIR_BYTE1_ADDRESS &= (uint8_t)(~(__INTERRUPT__))) + +/** @brief Clear the RCC's interrupt pending bits. + * @param __INTERRUPT__ specifies the interrupt pending bit to clear. + * This parameter can be any combination of the following values: + * @arg @ref RCC_IT_LSIRDY LSI ready interrupt. + * @arg @ref RCC_IT_LSERDY LSE ready interrupt. + * @arg @ref RCC_IT_HSIRDY HSI ready interrupt. + * @arg @ref RCC_IT_HSERDY HSE ready interrupt. + * @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt. + * @arg @ref RCC_IT_CSS Clock Security System interrupt + */ +#define __HAL_RCC_CLEAR_IT(__INTERRUPT__) (*(__IO uint8_t *) RCC_CIR_BYTE2_ADDRESS = (__INTERRUPT__)) + +/** @brief Check the RCC's interrupt has occurred or not. + * @param __INTERRUPT__ specifies the RCC interrupt source to check. + * This parameter can be one of the following values: + * @arg @ref RCC_IT_LSIRDY LSI ready interrupt. + * @arg @ref RCC_IT_LSERDY LSE ready interrupt. + * @arg @ref RCC_IT_HSIRDY HSI ready interrupt. + * @arg @ref RCC_IT_HSERDY HSE ready interrupt. + * @arg @ref RCC_IT_PLLRDY Main PLL ready interrupt. + * @arg @ref RCC_IT_CSS Clock Security System interrupt + * @retval The new state of __INTERRUPT__ (TRUE or FALSE). + */ +#define __HAL_RCC_GET_IT(__INTERRUPT__) ((RCC->CIR & (__INTERRUPT__)) == (__INTERRUPT__)) + +/** @brief Set RMVF bit to clear the reset flags. + * The reset flags are RCC_FLAG_PINRST, RCC_FLAG_PORRST, RCC_FLAG_SFTRST, + * RCC_FLAG_OBLRST, RCC_FLAG_IWDGRST, RCC_FLAG_WWDGRST, RCC_FLAG_LPWRRST + */ +#define __HAL_RCC_CLEAR_RESET_FLAGS() (*(__IO uint32_t *)RCC_CSR_RMVF_BB = ENABLE) + +/** @brief Check RCC flag is set or not. + * @param __FLAG__ specifies the flag to check. + * This parameter can be one of the following values: + * @arg @ref RCC_FLAG_HSIRDY HSI oscillator clock ready. + * @arg @ref RCC_FLAG_HSERDY HSE oscillator clock ready. + * @arg @ref RCC_FLAG_PLLRDY Main PLL clock ready. + * @arg @ref RCC_FLAG_LSERDY LSE oscillator clock ready. + * @arg @ref RCC_FLAG_LSIRDY LSI oscillator clock ready. + * @arg @ref RCC_FLAG_OBLRST Option Byte Load reset + * @arg @ref RCC_FLAG_PINRST Pin reset. + * @arg @ref RCC_FLAG_PORRST POR/PDR reset. + * @arg @ref RCC_FLAG_SFTRST Software reset. + * @arg @ref RCC_FLAG_IWDGRST Independent Watchdog reset. + * @arg @ref RCC_FLAG_WWDGRST Window Watchdog reset. + * @arg @ref RCC_FLAG_LPWRRST Low Power reset. + @if defined(STM32F301x8) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + @endif + @if defined(STM32F302x8) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + @endif + @if defined(STM32F302xC) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + * @arg @ref RCC_FLAG_MCO Microcontroller Clock Output + @endif + @if defined(STM32F302xE) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + @endif + @if defined(STM32F303x8) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + @endif + @if defined(STM32F303xC) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + * @arg @ref RCC_FLAG_MCO Microcontroller Clock Output + @endif + @if defined(STM32F303xE) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + @endif + @if defined(STM32F334x8) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + @endif + @if defined(STM32F358xx) + * @arg @ref RCC_FLAG_MCO Microcontroller Clock Output + @endif + @if defined(STM32F373xC) + * @arg @ref RCC_FLAG_V18PWRRST Reset flag of the 1.8 V domain + @endif + * @retval The new state of __FLAG__ (TRUE or FALSE). + */ +#define __HAL_RCC_GET_FLAG(__FLAG__) (((((__FLAG__) >> 5U) == CR_REG_INDEX) ? RCC->CR : \ + (((__FLAG__) >> 5U) == BDCR_REG_INDEX)? RCC->BDCR : \ + (((__FLAG__) >> 5U) == CFGR_REG_INDEX)? RCC->CFGR : \ + RCC->CSR) & (1U << ((__FLAG__) & RCC_FLAG_MASK))) + +/** + * @} + */ + +/** + * @} + */ + +/* Include RCC HAL Extension module */ +#include "stm32f3xx_hal_rcc_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup RCC_Exported_Functions + * @{ + */ + +/** @addtogroup RCC_Exported_Functions_Group1 + * @{ + */ + +/* Initialization and de-initialization functions ******************************/ +HAL_StatusTypeDef HAL_RCC_DeInit(void); +HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct); +HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency); + +/** + * @} + */ + +/** @addtogroup RCC_Exported_Functions_Group2 + * @{ + */ + +/* Peripheral Control functions ************************************************/ +void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv); +void HAL_RCC_EnableCSS(void); +/* CSS NMI IRQ handler */ +void HAL_RCC_NMI_IRQHandler(void); +/* User Callbacks in non blocking mode (IT mode) */ +void HAL_RCC_CSSCallback(void); +void HAL_RCC_DisableCSS(void); +uint32_t HAL_RCC_GetSysClockFreq(void); +uint32_t HAL_RCC_GetHCLKFreq(void); +uint32_t HAL_RCC_GetPCLK1Freq(void); +uint32_t HAL_RCC_GetPCLK2Freq(void); +void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct); +void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency); + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_RCC_H */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h new file mode 100644 index 0000000..ca56527 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h @@ -0,0 +1,3824 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_rcc_ex.h + * @author MCD Application Team + * @brief Header file of RCC HAL Extension module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_HAL_RCC_EX_H +#define __STM32F3xx_HAL_RCC_EX_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup RCCEx + * @{ + */ + +/** @addtogroup RCCEx_Private_Macros + * @{ + */ + +#if defined(RCC_CFGR_PLLNODIV) +#define IS_RCC_MCO1SOURCE(SOURCE) (((SOURCE) == RCC_MCO1SOURCE_NOCLOCK) || \ + ((SOURCE) == RCC_MCO1SOURCE_LSI) || \ + ((SOURCE) == RCC_MCO1SOURCE_LSE) || \ + ((SOURCE) == RCC_MCO1SOURCE_SYSCLK) || \ + ((SOURCE) == RCC_MCO1SOURCE_HSI) || \ + ((SOURCE) == RCC_MCO1SOURCE_HSE) || \ + ((SOURCE) == RCC_MCO1SOURCE_PLLCLK) || \ + ((SOURCE) == RCC_MCO1SOURCE_PLLCLK_DIV2)) +#else +#define IS_RCC_MCO1SOURCE(SOURCE) (((SOURCE) == RCC_MCO1SOURCE_NOCLOCK) || \ + ((SOURCE) == RCC_MCO1SOURCE_LSI) || \ + ((SOURCE) == RCC_MCO1SOURCE_LSE) || \ + ((SOURCE) == RCC_MCO1SOURCE_SYSCLK) || \ + ((SOURCE) == RCC_MCO1SOURCE_HSI) || \ + ((SOURCE) == RCC_MCO1SOURCE_HSE) || \ + ((SOURCE) == RCC_MCO1SOURCE_PLLCLK_DIV2)) +#endif /* RCC_CFGR_PLLNODIV */ + +#if defined(STM32F301x8) || defined(STM32F318xx) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC1 | RCC_PERIPHCLK_I2S | \ + RCC_PERIPHCLK_I2C3 | RCC_PERIPHCLK_TIM1 | \ + RCC_PERIPHCLK_TIM15 | RCC_PERIPHCLK_TIM16 | \ + RCC_PERIPHCLK_TIM17 | RCC_PERIPHCLK_RTC)) +#endif /* STM32F301x8 || STM32F318xx */ +#if defined(STM32F302x8) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC1 | RCC_PERIPHCLK_I2S | \ + RCC_PERIPHCLK_I2C3 | RCC_PERIPHCLK_TIM1 | \ + RCC_PERIPHCLK_RTC | RCC_PERIPHCLK_USB | \ + RCC_PERIPHCLK_TIM15 | RCC_PERIPHCLK_TIM16 | \ + RCC_PERIPHCLK_TIM17)) +#endif /* STM32F302x8 */ +#if defined(STM32F302xC) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC12 | RCC_PERIPHCLK_I2S | \ + RCC_PERIPHCLK_TIM1 | RCC_PERIPHCLK_RTC | \ + RCC_PERIPHCLK_USB)) +#endif /* STM32F302xC */ +#if defined(STM32F303xC) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC12 | RCC_PERIPHCLK_ADC34 | \ + RCC_PERIPHCLK_I2S | RCC_PERIPHCLK_TIM1 | \ + RCC_PERIPHCLK_TIM8 | RCC_PERIPHCLK_RTC | \ + RCC_PERIPHCLK_USB)) +#endif /* STM32F303xC */ +#if defined(STM32F302xE) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC12 | RCC_PERIPHCLK_I2S | \ + RCC_PERIPHCLK_TIM1 | RCC_PERIPHCLK_RTC | \ + RCC_PERIPHCLK_USB | RCC_PERIPHCLK_I2C3 | \ + RCC_PERIPHCLK_TIM2 | RCC_PERIPHCLK_TIM34 | \ + RCC_PERIPHCLK_TIM15 | RCC_PERIPHCLK_TIM16 | \ + RCC_PERIPHCLK_TIM17)) +#endif /* STM32F302xE */ +#if defined(STM32F303xE) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC12 | RCC_PERIPHCLK_ADC34 | \ + RCC_PERIPHCLK_I2S | RCC_PERIPHCLK_TIM1 | \ + RCC_PERIPHCLK_TIM8 | RCC_PERIPHCLK_RTC | \ + RCC_PERIPHCLK_USB | RCC_PERIPHCLK_I2C3 | \ + RCC_PERIPHCLK_TIM2 | RCC_PERIPHCLK_TIM34 | \ + RCC_PERIPHCLK_TIM15 | RCC_PERIPHCLK_TIM16 | \ + RCC_PERIPHCLK_TIM17 | RCC_PERIPHCLK_TIM20)) +#endif /* STM32F303xE */ +#if defined(STM32F398xx) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC12 | RCC_PERIPHCLK_ADC34 | \ + RCC_PERIPHCLK_I2S | RCC_PERIPHCLK_TIM1 | \ + RCC_PERIPHCLK_TIM8 | RCC_PERIPHCLK_RTC | \ + RCC_PERIPHCLK_I2C3 | RCC_PERIPHCLK_TIM2 | \ + RCC_PERIPHCLK_TIM34 | RCC_PERIPHCLK_TIM15 | \ + RCC_PERIPHCLK_TIM16 | RCC_PERIPHCLK_TIM17 | \ + RCC_PERIPHCLK_TIM20)) +#endif /* STM32F398xx */ +#if defined(STM32F358xx) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC12 | RCC_PERIPHCLK_ADC34 | \ + RCC_PERIPHCLK_I2S | RCC_PERIPHCLK_TIM1 | \ + RCC_PERIPHCLK_TIM8 | RCC_PERIPHCLK_RTC)) +#endif /* STM32F358xx */ +#if defined(STM32F303x8) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_ADC12 | \ + RCC_PERIPHCLK_TIM1 | RCC_PERIPHCLK_RTC)) +#endif /* STM32F303x8 */ +#if defined(STM32F334x8) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_ADC12 | \ + RCC_PERIPHCLK_TIM1 | RCC_PERIPHCLK_HRTIM1 | \ + RCC_PERIPHCLK_RTC)) +#endif /* STM32F334x8 */ +#if defined(STM32F328xx) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_ADC12 | \ + RCC_PERIPHCLK_TIM1 | RCC_PERIPHCLK_RTC)) +#endif /* STM32F328xx */ +#if defined(STM32F373xC) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC1 | RCC_PERIPHCLK_SDADC | \ + RCC_PERIPHCLK_CEC | RCC_PERIPHCLK_RTC | \ + RCC_PERIPHCLK_USB)) +#endif /* STM32F373xC */ +#if defined(STM32F378xx) +#define IS_RCC_PERIPHCLOCK(SELECTION) ((SELECTION) <= (RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_I2C2 | \ + RCC_PERIPHCLK_ADC1 | RCC_PERIPHCLK_SDADC | \ + RCC_PERIPHCLK_CEC | RCC_PERIPHCLK_RTC)) +#endif /* STM32F378xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define IS_RCC_USART1CLKSOURCE(SOURCE) (((SOURCE) == RCC_USART1CLKSOURCE_PCLK1) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_HSI)) +#define IS_RCC_I2C2CLKSOURCE(SOURCE) (((SOURCE) == RCC_I2C2CLKSOURCE_HSI) || \ + ((SOURCE) == RCC_I2C2CLKSOURCE_SYSCLK)) +#define IS_RCC_I2C3CLKSOURCE(SOURCE) (((SOURCE) == RCC_I2C3CLKSOURCE_HSI) || \ + ((SOURCE) == RCC_I2C3CLKSOURCE_SYSCLK)) +#define IS_RCC_ADC1PLLCLK_DIV(ADCCLK) (((ADCCLK) == RCC_ADC1PLLCLK_OFF) || ((ADCCLK) == RCC_ADC1PLLCLK_DIV1) || \ + ((ADCCLK) == RCC_ADC1PLLCLK_DIV2) || ((ADCCLK) == RCC_ADC1PLLCLK_DIV4) || \ + ((ADCCLK) == RCC_ADC1PLLCLK_DIV6) || ((ADCCLK) == RCC_ADC1PLLCLK_DIV8) || \ + ((ADCCLK) == RCC_ADC1PLLCLK_DIV10) || ((ADCCLK) == RCC_ADC1PLLCLK_DIV12) || \ + ((ADCCLK) == RCC_ADC1PLLCLK_DIV16) || ((ADCCLK) == RCC_ADC1PLLCLK_DIV32) || \ + ((ADCCLK) == RCC_ADC1PLLCLK_DIV64) || ((ADCCLK) == RCC_ADC1PLLCLK_DIV128) || \ + ((ADCCLK) == RCC_ADC1PLLCLK_DIV256)) +#define IS_RCC_I2SCLKSOURCE(SOURCE) (((SOURCE) == RCC_I2SCLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_I2SCLKSOURCE_EXT)) +#define IS_RCC_TIM1CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM1CLK_HCLK) || \ + ((SOURCE) == RCC_TIM1CLK_PLLCLK)) +#define IS_RCC_TIM15CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM15CLK_HCLK) || \ + ((SOURCE) == RCC_TIM15CLK_PLLCLK)) +#define IS_RCC_TIM16CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM16CLK_HCLK) || \ + ((SOURCE) == RCC_TIM16CLK_PLLCLK)) +#define IS_RCC_TIM17CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM17CLK_HCLK) || \ + ((SOURCE) == RCC_TIM17CLK_PLLCLK)) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ +#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define IS_RCC_USART1CLKSOURCE(SOURCE) (((SOURCE) == RCC_USART1CLKSOURCE_PCLK2) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_HSI)) +#define IS_RCC_I2C2CLKSOURCE(SOURCE) (((SOURCE) == RCC_I2C2CLKSOURCE_HSI) || \ + ((SOURCE) == RCC_I2C2CLKSOURCE_SYSCLK)) +#define IS_RCC_ADC12PLLCLK_DIV(ADCCLK) (((ADCCLK) == RCC_ADC12PLLCLK_OFF) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV1) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV2) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV4) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV6) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV8) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV10) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV12) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV16) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV32) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV64) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV128) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV256)) +#define IS_RCC_I2SCLKSOURCE(SOURCE) (((SOURCE) == RCC_I2SCLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_I2SCLKSOURCE_EXT)) +#define IS_RCC_TIM1CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM1CLK_HCLK) || \ + ((SOURCE) == RCC_TIM1CLK_PLLCLK)) +#define IS_RCC_UART4CLKSOURCE(SOURCE) (((SOURCE) == RCC_UART4CLKSOURCE_PCLK1) || \ + ((SOURCE) == RCC_UART4CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_UART4CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_UART4CLKSOURCE_HSI)) +#define IS_RCC_UART5CLKSOURCE(SOURCE) (((SOURCE) == RCC_UART5CLKSOURCE_PCLK1) || \ + ((SOURCE) == RCC_UART5CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_UART5CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_UART5CLKSOURCE_HSI)) +#endif /* STM32F302xC || STM32F303xC || STM32F358xx */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define IS_RCC_USART1CLKSOURCE(SOURCE) (((SOURCE) == RCC_USART1CLKSOURCE_PCLK2) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_HSI)) +#define IS_RCC_I2C2CLKSOURCE(SOURCE) (((SOURCE) == RCC_I2C2CLKSOURCE_HSI) || \ + ((SOURCE) == RCC_I2C2CLKSOURCE_SYSCLK)) +#define IS_RCC_I2C3CLKSOURCE(SOURCE) (((SOURCE) == RCC_I2C3CLKSOURCE_HSI) || \ + ((SOURCE) == RCC_I2C3CLKSOURCE_SYSCLK)) +#define IS_RCC_ADC12PLLCLK_DIV(ADCCLK) (((ADCCLK) == RCC_ADC12PLLCLK_OFF) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV1) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV2) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV4) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV6) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV8) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV10) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV12) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV16) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV32) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV64) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV128) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV256)) +#define IS_RCC_I2SCLKSOURCE(SOURCE) (((SOURCE) == RCC_I2SCLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_I2SCLKSOURCE_EXT)) +#define IS_RCC_TIM1CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM1CLK_HCLK) || \ + ((SOURCE) == RCC_TIM1CLK_PLLCLK)) +#define IS_RCC_TIM2CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM2CLK_HCLK) || \ + ((SOURCE) == RCC_TIM2CLK_PLLCLK)) +#define IS_RCC_TIM3CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM34CLK_HCLK) || \ + ((SOURCE) == RCC_TIM34CLK_PLLCLK)) +#define IS_RCC_TIM15CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM15CLK_HCLK) || \ + ((SOURCE) == RCC_TIM15CLK_PLLCLK)) +#define IS_RCC_TIM16CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM16CLK_HCLK) || \ + ((SOURCE) == RCC_TIM16CLK_PLLCLK)) +#define IS_RCC_TIM17CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM17CLK_HCLK) || \ + ((SOURCE) == RCC_TIM17CLK_PLLCLK)) +#define IS_RCC_UART4CLKSOURCE(SOURCE) (((SOURCE) == RCC_UART4CLKSOURCE_PCLK1) || \ + ((SOURCE) == RCC_UART4CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_UART4CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_UART4CLKSOURCE_HSI)) +#define IS_RCC_UART5CLKSOURCE(SOURCE) (((SOURCE) == RCC_UART5CLKSOURCE_PCLK1) || \ + ((SOURCE) == RCC_UART5CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_UART5CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_UART5CLKSOURCE_HSI)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ +#if defined(STM32F303xE) || defined(STM32F398xx) +#define IS_RCC_TIM20CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM20CLK_HCLK) || \ + ((SOURCE) == RCC_TIM20CLK_PLLCLK)) +#endif /* STM32F303xE || STM32F398xx */ +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) +#define IS_RCC_ADC34PLLCLK_DIV(ADCCLK) (((ADCCLK) == RCC_ADC34PLLCLK_OFF) || ((ADCCLK) == RCC_ADC34PLLCLK_DIV1) || \ + ((ADCCLK) == RCC_ADC34PLLCLK_DIV2) || ((ADCCLK) == RCC_ADC34PLLCLK_DIV4) || \ + ((ADCCLK) == RCC_ADC34PLLCLK_DIV6) || ((ADCCLK) == RCC_ADC34PLLCLK_DIV8) || \ + ((ADCCLK) == RCC_ADC34PLLCLK_DIV10) || ((ADCCLK) == RCC_ADC34PLLCLK_DIV12) || \ + ((ADCCLK) == RCC_ADC34PLLCLK_DIV16) || ((ADCCLK) == RCC_ADC34PLLCLK_DIV32) || \ + ((ADCCLK) == RCC_ADC34PLLCLK_DIV64) || ((ADCCLK) == RCC_ADC34PLLCLK_DIV128) || \ + ((ADCCLK) == RCC_ADC34PLLCLK_DIV256)) +#define IS_RCC_TIM8CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM8CLK_HCLK) || \ + ((SOURCE) == RCC_TIM8CLK_PLLCLK)) +#endif /* STM32F303xC || STM32F303xE || STM32F398xx || STM32F358xx */ +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define IS_RCC_USART1CLKSOURCE(SOURCE) (((SOURCE) == RCC_USART1CLKSOURCE_PCLK1) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_HSI)) +#define IS_RCC_ADC12PLLCLK_DIV(ADCCLK) (((ADCCLK) == RCC_ADC12PLLCLK_OFF) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV1) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV2) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV4) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV6) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV8) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV10) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV12) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV16) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV32) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV64) || ((ADCCLK) == RCC_ADC12PLLCLK_DIV128) || \ + ((ADCCLK) == RCC_ADC12PLLCLK_DIV256)) +#define IS_RCC_TIM1CLKSOURCE(SOURCE) (((SOURCE) == RCC_TIM1CLK_HCLK) || \ + ((SOURCE) == RCC_TIM1CLK_PLLCLK)) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ +#if defined(STM32F334x8) +#define IS_RCC_HRTIM1CLKSOURCE(SOURCE) (((SOURCE) == RCC_HRTIM1CLK_HCLK) || \ + ((SOURCE) == RCC_HRTIM1CLK_PLLCLK)) +#endif /* STM32F334x8 */ +#if defined(STM32F373xC) || defined(STM32F378xx) +#define IS_RCC_USART1CLKSOURCE(SOURCE) (((SOURCE) == RCC_USART1CLKSOURCE_PCLK2) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_SYSCLK) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_LSE) || \ + ((SOURCE) == RCC_USART1CLKSOURCE_HSI)) +#define IS_RCC_I2C2CLKSOURCE(SOURCE) (((SOURCE) == RCC_I2C2CLKSOURCE_HSI) || \ + ((SOURCE) == RCC_I2C2CLKSOURCE_SYSCLK)) +#define IS_RCC_ADC1PCLK2_DIV(ADCCLK) (((ADCCLK) == RCC_ADC1PCLK2_DIV2) || ((ADCCLK) == RCC_ADC1PCLK2_DIV4) || \ + ((ADCCLK) == RCC_ADC1PCLK2_DIV6) || ((ADCCLK) == RCC_ADC1PCLK2_DIV8)) +#define IS_RCC_CECCLKSOURCE(SOURCE) (((SOURCE) == RCC_CECCLKSOURCE_HSI) || \ + ((SOURCE) == RCC_CECCLKSOURCE_LSE)) +#define IS_RCC_SDADCSYSCLK_DIV(DIV) (((DIV) == RCC_SDADCSYSCLK_DIV1) || ((DIV) == RCC_SDADCSYSCLK_DIV2) || \ + ((DIV) == RCC_SDADCSYSCLK_DIV4) || ((DIV) == RCC_SDADCSYSCLK_DIV6) || \ + ((DIV) == RCC_SDADCSYSCLK_DIV8) || ((DIV) == RCC_SDADCSYSCLK_DIV10) || \ + ((DIV) == RCC_SDADCSYSCLK_DIV12) || ((DIV) == RCC_SDADCSYSCLK_DIV14) || \ + ((DIV) == RCC_SDADCSYSCLK_DIV16) || ((DIV) == RCC_SDADCSYSCLK_DIV20) || \ + ((DIV) == RCC_SDADCSYSCLK_DIV24) || ((DIV) == RCC_SDADCSYSCLK_DIV28) || \ + ((DIV) == RCC_SDADCSYSCLK_DIV32) || ((DIV) == RCC_SDADCSYSCLK_DIV36) || \ + ((DIV) == RCC_SDADCSYSCLK_DIV40) || ((DIV) == RCC_SDADCSYSCLK_DIV44) || \ + ((DIV) == RCC_SDADCSYSCLK_DIV48)) +#endif /* STM32F373xC || STM32F378xx */ +#if defined(STM32F302xE) || defined(STM32F303xE)\ + || defined(STM32F302xC) || defined(STM32F303xC)\ + || defined(STM32F302x8) \ + || defined(STM32F373xC) +#define IS_RCC_USBCLKSOURCE(SOURCE) (((SOURCE) == RCC_USBCLKSOURCE_PLL) || \ + ((SOURCE) == RCC_USBCLKSOURCE_PLL_DIV1_5)) +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F302x8 || */ + /* STM32F373xC */ +#if defined(RCC_CFGR_MCOPRE) +#define IS_RCC_MCODIV(DIV) (((DIV) == RCC_MCODIV_1) || ((DIV) == RCC_MCODIV_2) || \ + ((DIV) == RCC_MCODIV_4) || ((DIV) == RCC_MCODIV_8) || \ + ((DIV) == RCC_MCODIV_16) || ((DIV) == RCC_MCODIV_32) || \ + ((DIV) == RCC_MCODIV_64) || ((DIV) == RCC_MCODIV_128)) +#else +#define IS_RCC_MCODIV(DIV) (((DIV) == RCC_MCODIV_1)) +#endif /* RCC_CFGR_MCOPRE */ + +#define IS_RCC_LSE_DRIVE(__DRIVE__) (((__DRIVE__) == RCC_LSEDRIVE_LOW) || \ + ((__DRIVE__) == RCC_LSEDRIVE_MEDIUMLOW) || \ + ((__DRIVE__) == RCC_LSEDRIVE_MEDIUMHIGH) || \ + ((__DRIVE__) == RCC_LSEDRIVE_HIGH)) + +/** + * @} + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup RCCEx_Exported_Types RCCEx Exported Types + * @{ + */ + +/** + * @brief RCC extended clocks structure definition + */ +#if defined(STM32F301x8) || defined(STM32F318xx) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t I2c3ClockSelection; /*!< I2C3 clock source + This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */ + + uint32_t Adc1ClockSelection; /*!< ADC1 clock source + This parameter can be a value of @ref RCCEx_ADC1_Clock_Source */ + + uint32_t I2sClockSelection; /*!< I2S clock source + This parameter can be a value of @ref RCCEx_I2S_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t Tim15ClockSelection; /*!< TIM15 clock source + This parameter can be a value of @ref RCCEx_TIM15_Clock_Source */ + + uint32_t Tim16ClockSelection; /*!< TIM16 clock source + This parameter can be a value of @ref RCCEx_TIM16_Clock_Source */ + + uint32_t Tim17ClockSelection; /*!< TIM17 clock source + This parameter can be a value of @ref RCCEx_TIM17_Clock_Source */ +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F301x8 || STM32F318xx */ + +#if defined(STM32F302x8) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t I2c3ClockSelection; /*!< I2C3 clock source + This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */ + + uint32_t Adc1ClockSelection; /*!< ADC1 clock source + This parameter can be a value of @ref RCCEx_ADC1_Clock_Source */ + + uint32_t I2sClockSelection; /*!< I2S clock source + This parameter can be a value of @ref RCCEx_I2S_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t Tim15ClockSelection; /*!< TIM15 clock source + This parameter can be a value of @ref RCCEx_TIM15_Clock_Source */ + + uint32_t Tim16ClockSelection; /*!< TIM16 clock source + This parameter can be a value of @ref RCCEx_TIM16_Clock_Source */ + + uint32_t Tim17ClockSelection; /*!< TIM17 clock source + This parameter can be a value of @ref RCCEx_TIM17_Clock_Source */ + + uint32_t USBClockSelection; /*!< USB clock source + This parameter can be a value of @ref RCCEx_USB_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F302x8 */ + +#if defined(STM32F302xC) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t Usart2ClockSelection; /*!< USART2 clock source + This parameter can be a value of @ref RCC_USART2_Clock_Source */ + + uint32_t Usart3ClockSelection; /*!< USART3 clock source + This parameter can be a value of @ref RCC_USART3_Clock_Source */ + + uint32_t Uart4ClockSelection; /*!< UART4 clock source + This parameter can be a value of @ref RCCEx_UART4_Clock_Source */ + + uint32_t Uart5ClockSelection; /*!< UART5 clock source + This parameter can be a value of @ref RCCEx_UART5_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t I2sClockSelection; /*!< I2S clock source + This parameter can be a value of @ref RCCEx_I2S_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t USBClockSelection; /*!< USB clock source + This parameter can be a value of @ref RCCEx_USB_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F302xC */ + +#if defined(STM32F303xC) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t Usart2ClockSelection; /*!< USART2 clock source + This parameter can be a value of @ref RCC_USART2_Clock_Source */ + + uint32_t Usart3ClockSelection; /*!< USART3 clock source + This parameter can be a value of @ref RCC_USART3_Clock_Source */ + + uint32_t Uart4ClockSelection; /*!< UART4 clock source + This parameter can be a value of @ref RCCEx_UART4_Clock_Source */ + + uint32_t Uart5ClockSelection; /*!< UART5 clock source + This parameter can be a value of @ref RCCEx_UART5_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t Adc34ClockSelection; /*!< ADC3 & ADC4 clock source + This parameter can be a value of @ref RCCEx_ADC34_Clock_Source */ + + uint32_t I2sClockSelection; /*!< I2S clock source + This parameter can be a value of @ref RCCEx_I2S_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t Tim8ClockSelection; /*!< TIM8 clock source + This parameter can be a value of @ref RCCEx_TIM8_Clock_Source */ + + uint32_t USBClockSelection; /*!< USB clock source + This parameter can be a value of @ref RCCEx_USB_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F303xC */ + +#if defined(STM32F302xE) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t Usart2ClockSelection; /*!< USART2 clock source + This parameter can be a value of @ref RCC_USART2_Clock_Source */ + + uint32_t Usart3ClockSelection; /*!< USART3 clock source + This parameter can be a value of @ref RCC_USART3_Clock_Source */ + + uint32_t Uart4ClockSelection; /*!< UART4 clock source + This parameter can be a value of @ref RCCEx_UART4_Clock_Source */ + + uint32_t Uart5ClockSelection; /*!< UART5 clock source + This parameter can be a value of @ref RCCEx_UART5_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t I2c3ClockSelection; /*!< I2C3 clock source + This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t I2sClockSelection; /*!< I2S clock source + This parameter can be a value of @ref RCCEx_I2S_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t Tim2ClockSelection; /*!< TIM2 clock source + This parameter can be a value of @ref RCCEx_TIM2_Clock_Source */ + + uint32_t Tim34ClockSelection; /*!< TIM3 & TIM4 clock source + This parameter can be a value of @ref RCCEx_TIM34_Clock_Source */ + + uint32_t Tim15ClockSelection; /*!< TIM15 clock source + This parameter can be a value of @ref RCCEx_TIM15_Clock_Source */ + + uint32_t Tim16ClockSelection; /*!< TIM16 clock source + This parameter can be a value of @ref RCCEx_TIM16_Clock_Source */ + + uint32_t Tim17ClockSelection; /*!< TIM17 clock source + This parameter can be a value of @ref RCCEx_TIM17_Clock_Source */ + + uint32_t USBClockSelection; /*!< USB clock source + This parameter can be a value of @ref RCCEx_USB_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F302xE */ + +#if defined(STM32F303xE) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t Usart2ClockSelection; /*!< USART2 clock source + This parameter can be a value of @ref RCC_USART2_Clock_Source */ + + uint32_t Usart3ClockSelection; /*!< USART3 clock source + This parameter can be a value of @ref RCC_USART3_Clock_Source */ + + uint32_t Uart4ClockSelection; /*!< UART4 clock source + This parameter can be a value of @ref RCCEx_UART4_Clock_Source */ + + uint32_t Uart5ClockSelection; /*!< UART5 clock source + This parameter can be a value of @ref RCCEx_UART5_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t I2c3ClockSelection; /*!< I2C3 clock source + This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t Adc34ClockSelection; /*!< ADC3 & ADC4 clock source + This parameter can be a value of @ref RCCEx_ADC34_Clock_Source */ + + uint32_t I2sClockSelection; /*!< I2S clock source + This parameter can be a value of @ref RCCEx_I2S_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t Tim2ClockSelection; /*!< TIM2 clock source + This parameter can be a value of @ref RCCEx_TIM2_Clock_Source */ + + uint32_t Tim34ClockSelection; /*!< TIM3 & TIM4 clock source + This parameter can be a value of @ref RCCEx_TIM34_Clock_Source */ + + uint32_t Tim8ClockSelection; /*!< TIM8 clock source + This parameter can be a value of @ref RCCEx_TIM8_Clock_Source */ + + uint32_t Tim15ClockSelection; /*!< TIM15 clock source + This parameter can be a value of @ref RCCEx_TIM15_Clock_Source */ + + uint32_t Tim16ClockSelection; /*!< TIM16 clock source + This parameter can be a value of @ref RCCEx_TIM16_Clock_Source */ + + uint32_t Tim17ClockSelection; /*!< TIM17 clock source + This parameter can be a value of @ref RCCEx_TIM17_Clock_Source */ + + uint32_t Tim20ClockSelection; /*!< TIM20 clock source + This parameter can be a value of @ref RCCEx_TIM20_Clock_Source */ + + uint32_t USBClockSelection; /*!< USB clock source + This parameter can be a value of @ref RCCEx_USB_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F303xE */ + +#if defined(STM32F398xx) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t Usart2ClockSelection; /*!< USART2 clock source + This parameter can be a value of @ref RCC_USART2_Clock_Source */ + + uint32_t Usart3ClockSelection; /*!< USART3 clock source + This parameter can be a value of @ref RCC_USART3_Clock_Source */ + + uint32_t Uart4ClockSelection; /*!< UART4 clock source + This parameter can be a value of @ref RCCEx_UART4_Clock_Source */ + + uint32_t Uart5ClockSelection; /*!< UART5 clock source + This parameter can be a value of @ref RCCEx_UART5_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t I2c3ClockSelection; /*!< I2C3 clock source + This parameter can be a value of @ref RCCEx_I2C3_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t Adc34ClockSelection; /*!< ADC3 & ADC4 clock source + This parameter can be a value of @ref RCCEx_ADC34_Clock_Source */ + + uint32_t I2sClockSelection; /*!< I2S clock source + This parameter can be a value of @ref RCCEx_I2S_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t Tim2ClockSelection; /*!< TIM2 clock source + This parameter can be a value of @ref RCCEx_TIM2_Clock_Source */ + + uint32_t Tim34ClockSelection; /*!< TIM3 & TIM4 clock source + This parameter can be a value of @ref RCCEx_TIM34_Clock_Source */ + + uint32_t Tim8ClockSelection; /*!< TIM8 clock source + This parameter can be a value of @ref RCCEx_TIM8_Clock_Source */ + + uint32_t Tim15ClockSelection; /*!< TIM15 clock source + This parameter can be a value of @ref RCCEx_TIM15_Clock_Source */ + + uint32_t Tim16ClockSelection; /*!< TIM16 clock source + This parameter can be a value of @ref RCCEx_TIM16_Clock_Source */ + + uint32_t Tim17ClockSelection; /*!< TIM17 clock source + This parameter can be a value of @ref RCCEx_TIM17_Clock_Source */ + + uint32_t Tim20ClockSelection; /*!< TIM20 clock source + This parameter can be a value of @ref RCCEx_TIM20_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F398xx */ + +#if defined(STM32F358xx) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t Usart2ClockSelection; /*!< USART2 clock source + This parameter can be a value of @ref RCC_USART2_Clock_Source */ + + uint32_t Usart3ClockSelection; /*!< USART3 clock source + This parameter can be a value of @ref RCC_USART3_Clock_Source */ + + uint32_t Uart4ClockSelection; /*!< UART4 clock source + This parameter can be a value of @ref RCCEx_UART4_Clock_Source */ + + uint32_t Uart5ClockSelection; /*!< UART5 clock source + This parameter can be a value of @ref RCCEx_UART5_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t Adc34ClockSelection; /*!< ADC3 & ADC4 clock source + This parameter can be a value of @ref RCCEx_ADC34_Clock_Source */ + + uint32_t I2sClockSelection; /*!< I2S clock source + This parameter can be a value of @ref RCCEx_I2S_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t Tim8ClockSelection; /*!< TIM8 clock source + This parameter can be a value of @ref RCCEx_TIM8_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F358xx */ + +#if defined(STM32F303x8) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F303x8 */ + +#if defined(STM32F334x8) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + + uint32_t Hrtim1ClockSelection; /*!< HRTIM1 clock source + This parameter can be a value of @ref RCCEx_HRTIM1_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F334x8 */ + +#if defined(STM32F328xx) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t Adc12ClockSelection; /*!< ADC1 & ADC2 clock source + This parameter can be a value of @ref RCCEx_ADC12_Clock_Source */ + + uint32_t Tim1ClockSelection; /*!< TIM1 clock source + This parameter can be a value of @ref RCCEx_TIM1_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F328xx */ + +#if defined(STM32F373xC) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t Usart2ClockSelection; /*!< USART2 clock source + This parameter can be a value of @ref RCC_USART2_Clock_Source */ + + uint32_t Usart3ClockSelection; /*!< USART3 clock source + This parameter can be a value of @ref RCC_USART3_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t Adc1ClockSelection; /*!< ADC1 clock source + This parameter can be a value of @ref RCCEx_ADC1_Clock_Source */ + + uint32_t SdadcClockSelection; /*!< SDADC clock prescaler + This parameter can be a value of @ref RCCEx_SDADC_Clock_Prescaler */ + + uint32_t CecClockSelection; /*!< HDMI CEC clock source + This parameter can be a value of @ref RCCEx_CEC_Clock_Source */ + + uint32_t USBClockSelection; /*!< USB clock source + This parameter can be a value of @ref RCCEx_USB_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F373xC */ + +#if defined(STM32F378xx) +typedef struct +{ + uint32_t PeriphClockSelection; /*!< The Extended Clock to be configured. + This parameter can be a value of @ref RCCEx_Periph_Clock_Selection */ + + uint32_t RTCClockSelection; /*!< Specifies RTC Clock Prescalers Selection + This parameter can be a value of @ref RCC_RTC_Clock_Source */ + + uint32_t Usart1ClockSelection; /*!< USART1 clock source + This parameter can be a value of @ref RCCEx_USART1_Clock_Source */ + + uint32_t Usart2ClockSelection; /*!< USART2 clock source + This parameter can be a value of @ref RCC_USART2_Clock_Source */ + + uint32_t Usart3ClockSelection; /*!< USART3 clock source + This parameter can be a value of @ref RCC_USART3_Clock_Source */ + + uint32_t I2c1ClockSelection; /*!< I2C1 clock source + This parameter can be a value of @ref RCC_I2C1_Clock_Source */ + + uint32_t I2c2ClockSelection; /*!< I2C2 clock source + This parameter can be a value of @ref RCCEx_I2C2_Clock_Source */ + + uint32_t Adc1ClockSelection; /*!< ADC1 clock source + This parameter can be a value of @ref RCCEx_ADC1_Clock_Source */ + + uint32_t SdadcClockSelection; /*!< SDADC clock prescaler + This parameter can be a value of @ref RCCEx_SDADC_Clock_Prescaler */ + + uint32_t CecClockSelection; /*!< HDMI CEC clock source + This parameter can be a value of @ref RCCEx_CEC_Clock_Source */ + +}RCC_PeriphCLKInitTypeDef; +#endif /* STM32F378xx */ + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup RCCEx_Exported_Constants RCC Extended Exported Constants + * @{ + */ +/** @defgroup RCCEx_MCO_Clock_Source RCC Extended MCO Clock Source + * @{ + */ +#define RCC_MCO1SOURCE_NOCLOCK RCC_CFGR_MCO_NOCLOCK +#define RCC_MCO1SOURCE_LSI RCC_CFGR_MCO_LSI +#define RCC_MCO1SOURCE_LSE RCC_CFGR_MCO_LSE +#define RCC_MCO1SOURCE_SYSCLK RCC_CFGR_MCO_SYSCLK +#define RCC_MCO1SOURCE_HSI RCC_CFGR_MCO_HSI +#define RCC_MCO1SOURCE_HSE RCC_CFGR_MCO_HSE +#if defined(RCC_CFGR_PLLNODIV) +#define RCC_MCO1SOURCE_PLLCLK (RCC_CFGR_PLLNODIV | RCC_CFGR_MCO_PLL) +#endif /* RCC_CFGR_PLLNODIV */ +#define RCC_MCO1SOURCE_PLLCLK_DIV2 RCC_CFGR_MCO_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_Periph_Clock_Selection RCC Extended Periph Clock Selection + * @{ + */ +#if defined(STM32F301x8) || defined(STM32F318xx) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC1 (0x00000080U) +#define RCC_PERIPHCLK_I2S (0x00000200U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_I2C3 (0x00008000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) +#define RCC_PERIPHCLK_TIM15 (0x00040000U) +#define RCC_PERIPHCLK_TIM16 (0x00080000U) +#define RCC_PERIPHCLK_TIM17 (0x00100000U) + +#endif /* STM32F301x8 || STM32F318xx */ + +#if defined(STM32F302x8) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC1 (0x00000080U) +#define RCC_PERIPHCLK_I2S (0x00000200U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_I2C3 (0x00008000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) +#define RCC_PERIPHCLK_USB (0x00020000U) +#define RCC_PERIPHCLK_TIM15 (0x00040000U) +#define RCC_PERIPHCLK_TIM16 (0x00080000U) +#define RCC_PERIPHCLK_TIM17 (0x00100000U) + + +#endif /* STM32F302x8 */ + +#if defined(STM32F302xC) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_USART2 (0x00000002U) +#define RCC_PERIPHCLK_USART3 (0x00000004U) +#define RCC_PERIPHCLK_UART4 (0x00000008U) +#define RCC_PERIPHCLK_UART5 (0x00000010U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_I2S (0x00000200U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) +#define RCC_PERIPHCLK_USB (0x00020000U) + +#endif /* STM32F302xC */ + +#if defined(STM32F303xC) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_USART2 (0x00000002U) +#define RCC_PERIPHCLK_USART3 (0x00000004U) +#define RCC_PERIPHCLK_UART4 (0x00000008U) +#define RCC_PERIPHCLK_UART5 (0x00000010U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_ADC34 (0x00000100U) +#define RCC_PERIPHCLK_I2S (0x00000200U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_TIM8 (0x00002000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) +#define RCC_PERIPHCLK_USB (0x00020000U) + +#endif /* STM32F303xC */ + +#if defined(STM32F302xE) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_USART2 (0x00000002U) +#define RCC_PERIPHCLK_USART3 (0x00000004U) +#define RCC_PERIPHCLK_UART4 (0x00000008U) +#define RCC_PERIPHCLK_UART5 (0x00000010U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_I2S (0x00000200U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) +#define RCC_PERIPHCLK_USB (0x00020000U) +#define RCC_PERIPHCLK_I2C3 (0x00040000U) +#define RCC_PERIPHCLK_TIM2 (0x00100000U) +#define RCC_PERIPHCLK_TIM34 (0x00200000U) +#define RCC_PERIPHCLK_TIM15 (0x00400000U) +#define RCC_PERIPHCLK_TIM16 (0x00800000U) +#define RCC_PERIPHCLK_TIM17 (0x01000000U) + +#endif /* STM32F302xE */ + +#if defined(STM32F303xE) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_USART2 (0x00000002U) +#define RCC_PERIPHCLK_USART3 (0x00000004U) +#define RCC_PERIPHCLK_UART4 (0x00000008U) +#define RCC_PERIPHCLK_UART5 (0x00000010U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_ADC34 (0x00000100U) +#define RCC_PERIPHCLK_I2S (0x00000200U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_TIM8 (0x00002000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) +#define RCC_PERIPHCLK_USB (0x00020000U) +#define RCC_PERIPHCLK_I2C3 (0x00040000U) +#define RCC_PERIPHCLK_TIM2 (0x00100000U) +#define RCC_PERIPHCLK_TIM34 (0x00200000U) +#define RCC_PERIPHCLK_TIM15 (0x00400000U) +#define RCC_PERIPHCLK_TIM16 (0x00800000U) +#define RCC_PERIPHCLK_TIM17 (0x01000000U) +#define RCC_PERIPHCLK_TIM20 (0x02000000U) + +#endif /* STM32F303xE */ + +#if defined(STM32F398xx) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_USART2 (0x00000002U) +#define RCC_PERIPHCLK_USART3 (0x00000004U) +#define RCC_PERIPHCLK_UART4 (0x00000008U) +#define RCC_PERIPHCLK_UART5 (0x00000010U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_ADC34 (0x00000100U) +#define RCC_PERIPHCLK_I2S (0x00000200U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_TIM8 (0x00002000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) +#define RCC_PERIPHCLK_I2C3 (0x00040000U) +#define RCC_PERIPHCLK_TIM2 (0x00100000U) +#define RCC_PERIPHCLK_TIM34 (0x00200000U) +#define RCC_PERIPHCLK_TIM15 (0x00400000U) +#define RCC_PERIPHCLK_TIM16 (0x00800000U) +#define RCC_PERIPHCLK_TIM17 (0x01000000U) +#define RCC_PERIPHCLK_TIM20 (0x02000000U) + + +#endif /* STM32F398xx */ + +#if defined(STM32F358xx) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_USART2 (0x00000002U) +#define RCC_PERIPHCLK_USART3 (0x00000004U) +#define RCC_PERIPHCLK_UART4 (0x00000008U) +#define RCC_PERIPHCLK_UART5 (0x00000010U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_ADC34 (0x00000100U) +#define RCC_PERIPHCLK_I2S (0x00000200U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_TIM8 (0x00002000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) + +#endif /* STM32F358xx */ + +#if defined(STM32F303x8) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) + +#endif /* STM32F303x8 */ + +#if defined(STM32F334x8) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_HRTIM1 (0x00004000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) + + +#endif /* STM32F334x8 */ + +#if defined(STM32F328xx) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_ADC12 (0x00000080U) +#define RCC_PERIPHCLK_TIM1 (0x00001000U) +#define RCC_PERIPHCLK_RTC (0x00010000U) + +#endif /* STM32F328xx */ + +#if defined(STM32F373xC) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_USART2 (0x00000002U) +#define RCC_PERIPHCLK_USART3 (0x00000004U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC1 (0x00000080U) +#define RCC_PERIPHCLK_CEC (0x00000400U) +#define RCC_PERIPHCLK_SDADC (0x00000800U) +#define RCC_PERIPHCLK_RTC (0x00010000U) +#define RCC_PERIPHCLK_USB (0x00020000U) + +#endif /* STM32F373xC */ + +#if defined(STM32F378xx) +#define RCC_PERIPHCLK_USART1 (0x00000001U) +#define RCC_PERIPHCLK_USART2 (0x00000002U) +#define RCC_PERIPHCLK_USART3 (0x00000004U) +#define RCC_PERIPHCLK_I2C1 (0x00000020U) +#define RCC_PERIPHCLK_I2C2 (0x00000040U) +#define RCC_PERIPHCLK_ADC1 (0x00000080U) +#define RCC_PERIPHCLK_CEC (0x00000400U) +#define RCC_PERIPHCLK_SDADC (0x00000800U) +#define RCC_PERIPHCLK_RTC (0x00010000U) + +#endif /* STM32F378xx */ +/** + * @} + */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + +/** @defgroup RCCEx_USART1_Clock_Source RCC Extended USART1 Clock Source + * @{ + */ +#define RCC_USART1CLKSOURCE_PCLK1 RCC_CFGR3_USART1SW_PCLK1 +#define RCC_USART1CLKSOURCE_SYSCLK RCC_CFGR3_USART1SW_SYSCLK +#define RCC_USART1CLKSOURCE_LSE RCC_CFGR3_USART1SW_LSE +#define RCC_USART1CLKSOURCE_HSI RCC_CFGR3_USART1SW_HSI + +/** + * @} + */ + +/** @defgroup RCCEx_I2C2_Clock_Source RCC Extended I2C2 Clock Source + * @{ + */ +#define RCC_I2C2CLKSOURCE_HSI RCC_CFGR3_I2C2SW_HSI +#define RCC_I2C2CLKSOURCE_SYSCLK RCC_CFGR3_I2C2SW_SYSCLK + +/** + * @} + */ + +/** @defgroup RCCEx_I2C3_Clock_Source RCC Extended I2C3 Clock Source + * @{ + */ +#define RCC_I2C3CLKSOURCE_HSI RCC_CFGR3_I2C3SW_HSI +#define RCC_I2C3CLKSOURCE_SYSCLK RCC_CFGR3_I2C3SW_SYSCLK + +/** + * @} + */ + +/** @defgroup RCCEx_ADC1_Clock_Source RCC Extended ADC1 Clock Source + * @{ + */ +#define RCC_ADC1PLLCLK_OFF RCC_CFGR2_ADC1PRES_NO +#define RCC_ADC1PLLCLK_DIV1 RCC_CFGR2_ADC1PRES_DIV1 +#define RCC_ADC1PLLCLK_DIV2 RCC_CFGR2_ADC1PRES_DIV2 +#define RCC_ADC1PLLCLK_DIV4 RCC_CFGR2_ADC1PRES_DIV4 +#define RCC_ADC1PLLCLK_DIV6 RCC_CFGR2_ADC1PRES_DIV6 +#define RCC_ADC1PLLCLK_DIV8 RCC_CFGR2_ADC1PRES_DIV8 +#define RCC_ADC1PLLCLK_DIV10 RCC_CFGR2_ADC1PRES_DIV10 +#define RCC_ADC1PLLCLK_DIV12 RCC_CFGR2_ADC1PRES_DIV12 +#define RCC_ADC1PLLCLK_DIV16 RCC_CFGR2_ADC1PRES_DIV16 +#define RCC_ADC1PLLCLK_DIV32 RCC_CFGR2_ADC1PRES_DIV32 +#define RCC_ADC1PLLCLK_DIV64 RCC_CFGR2_ADC1PRES_DIV64 +#define RCC_ADC1PLLCLK_DIV128 RCC_CFGR2_ADC1PRES_DIV128 +#define RCC_ADC1PLLCLK_DIV256 RCC_CFGR2_ADC1PRES_DIV256 + +/** + * @} + */ + +/** @defgroup RCCEx_I2S_Clock_Source RCC Extended I2S Clock Source + * @{ + */ +#define RCC_I2SCLKSOURCE_SYSCLK RCC_CFGR_I2SSRC_SYSCLK +#define RCC_I2SCLKSOURCE_EXT RCC_CFGR_I2SSRC_EXT + +/** + * @} + */ + +/** @defgroup RCCEx_TIM1_Clock_Source RCC Extended TIM1 Clock Source + * @{ + */ +#define RCC_TIM1CLK_HCLK RCC_CFGR3_TIM1SW_HCLK +#define RCC_TIM1CLK_PLLCLK RCC_CFGR3_TIM1SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_TIM15_Clock_Source RCC Extended TIM15 Clock Source + * @{ + */ +#define RCC_TIM15CLK_HCLK RCC_CFGR3_TIM15SW_HCLK +#define RCC_TIM15CLK_PLLCLK RCC_CFGR3_TIM15SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_TIM16_Clock_Source RCC Extended TIM16 Clock Source + * @{ + */ +#define RCC_TIM16CLK_HCLK RCC_CFGR3_TIM16SW_HCLK +#define RCC_TIM16CLK_PLLCLK RCC_CFGR3_TIM16SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_TIM17_Clock_Source RCC Extended TIM17 Clock Source + * @{ + */ +#define RCC_TIM17CLK_HCLK RCC_CFGR3_TIM17SW_HCLK +#define RCC_TIM17CLK_PLLCLK RCC_CFGR3_TIM17SW_PLL + +/** + * @} + */ + +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) + +/** @defgroup RCCEx_USART1_Clock_Source RCC Extended USART1 Clock Source + * @{ + */ +#define RCC_USART1CLKSOURCE_PCLK2 RCC_CFGR3_USART1SW_PCLK2 +#define RCC_USART1CLKSOURCE_SYSCLK RCC_CFGR3_USART1SW_SYSCLK +#define RCC_USART1CLKSOURCE_LSE RCC_CFGR3_USART1SW_LSE +#define RCC_USART1CLKSOURCE_HSI RCC_CFGR3_USART1SW_HSI + +/** + * @} + */ + +/** @defgroup RCCEx_I2C2_Clock_Source RCC Extended I2C2 Clock Source + * @{ + */ +#define RCC_I2C2CLKSOURCE_HSI RCC_CFGR3_I2C2SW_HSI +#define RCC_I2C2CLKSOURCE_SYSCLK RCC_CFGR3_I2C2SW_SYSCLK + +/** + * @} + */ + +/** @defgroup RCCEx_ADC12_Clock_Source RCC Extended ADC12 Clock Source + * @{ + */ + +/* ADC1 & ADC2 */ +#define RCC_ADC12PLLCLK_OFF RCC_CFGR2_ADCPRE12_NO +#define RCC_ADC12PLLCLK_DIV1 RCC_CFGR2_ADCPRE12_DIV1 +#define RCC_ADC12PLLCLK_DIV2 RCC_CFGR2_ADCPRE12_DIV2 +#define RCC_ADC12PLLCLK_DIV4 RCC_CFGR2_ADCPRE12_DIV4 +#define RCC_ADC12PLLCLK_DIV6 RCC_CFGR2_ADCPRE12_DIV6 +#define RCC_ADC12PLLCLK_DIV8 RCC_CFGR2_ADCPRE12_DIV8 +#define RCC_ADC12PLLCLK_DIV10 RCC_CFGR2_ADCPRE12_DIV10 +#define RCC_ADC12PLLCLK_DIV12 RCC_CFGR2_ADCPRE12_DIV12 +#define RCC_ADC12PLLCLK_DIV16 RCC_CFGR2_ADCPRE12_DIV16 +#define RCC_ADC12PLLCLK_DIV32 RCC_CFGR2_ADCPRE12_DIV32 +#define RCC_ADC12PLLCLK_DIV64 RCC_CFGR2_ADCPRE12_DIV64 +#define RCC_ADC12PLLCLK_DIV128 RCC_CFGR2_ADCPRE12_DIV128 +#define RCC_ADC12PLLCLK_DIV256 RCC_CFGR2_ADCPRE12_DIV256 + +/** + * @} + */ + +/** @defgroup RCCEx_I2S_Clock_Source RCC Extended I2S Clock Source + * @{ + */ +#define RCC_I2SCLKSOURCE_SYSCLK RCC_CFGR_I2SSRC_SYSCLK +#define RCC_I2SCLKSOURCE_EXT RCC_CFGR_I2SSRC_EXT + +/** + * @} + */ +/** @defgroup RCCEx_TIM1_Clock_Source RCC Extended TIM1 Clock Source + * @{ + */ +#define RCC_TIM1CLK_HCLK RCC_CFGR3_TIM1SW_HCLK +#define RCC_TIM1CLK_PLLCLK RCC_CFGR3_TIM1SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_UART4_Clock_Source RCC Extended UART4 Clock Source + * @{ + */ +#define RCC_UART4CLKSOURCE_PCLK1 RCC_CFGR3_UART4SW_PCLK +#define RCC_UART4CLKSOURCE_SYSCLK RCC_CFGR3_UART4SW_SYSCLK +#define RCC_UART4CLKSOURCE_LSE RCC_CFGR3_UART4SW_LSE +#define RCC_UART4CLKSOURCE_HSI RCC_CFGR3_UART4SW_HSI + +/** + * @} + */ + +/** @defgroup RCCEx_UART5_Clock_Source RCC Extended UART5 Clock Source + * @{ + */ +#define RCC_UART5CLKSOURCE_PCLK1 RCC_CFGR3_UART5SW_PCLK +#define RCC_UART5CLKSOURCE_SYSCLK RCC_CFGR3_UART5SW_SYSCLK +#define RCC_UART5CLKSOURCE_LSE RCC_CFGR3_UART5SW_LSE +#define RCC_UART5CLKSOURCE_HSI RCC_CFGR3_UART5SW_HSI + +/** + * @} + */ + +#endif /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) + +/** @defgroup RCCEx_USART1_Clock_Source RCC Extended USART1 Clock Source + * @{ + */ +#define RCC_USART1CLKSOURCE_PCLK2 RCC_CFGR3_USART1SW_PCLK2 +#define RCC_USART1CLKSOURCE_SYSCLK RCC_CFGR3_USART1SW_SYSCLK +#define RCC_USART1CLKSOURCE_LSE RCC_CFGR3_USART1SW_LSE +#define RCC_USART1CLKSOURCE_HSI RCC_CFGR3_USART1SW_HSI + +/** + * @} + */ + +/** @defgroup RCCEx_I2C2_Clock_Source RCC Extended I2C2 Clock Source + * @{ + */ +#define RCC_I2C2CLKSOURCE_HSI RCC_CFGR3_I2C2SW_HSI +#define RCC_I2C2CLKSOURCE_SYSCLK RCC_CFGR3_I2C2SW_SYSCLK + +/** + * @} + */ + +/** @defgroup RCCEx_I2C3_Clock_Source RCC Extended I2C3 Clock Source + * @{ + */ +#define RCC_I2C3CLKSOURCE_HSI RCC_CFGR3_I2C3SW_HSI +#define RCC_I2C3CLKSOURCE_SYSCLK RCC_CFGR3_I2C3SW_SYSCLK + +/** + * @} + */ + +/** @defgroup RCCEx_ADC12_Clock_Source RCC Extended ADC12 Clock Source + * @{ + */ + +/* ADC1 & ADC2 */ +#define RCC_ADC12PLLCLK_OFF RCC_CFGR2_ADCPRE12_NO +#define RCC_ADC12PLLCLK_DIV1 RCC_CFGR2_ADCPRE12_DIV1 +#define RCC_ADC12PLLCLK_DIV2 RCC_CFGR2_ADCPRE12_DIV2 +#define RCC_ADC12PLLCLK_DIV4 RCC_CFGR2_ADCPRE12_DIV4 +#define RCC_ADC12PLLCLK_DIV6 RCC_CFGR2_ADCPRE12_DIV6 +#define RCC_ADC12PLLCLK_DIV8 RCC_CFGR2_ADCPRE12_DIV8 +#define RCC_ADC12PLLCLK_DIV10 RCC_CFGR2_ADCPRE12_DIV10 +#define RCC_ADC12PLLCLK_DIV12 RCC_CFGR2_ADCPRE12_DIV12 +#define RCC_ADC12PLLCLK_DIV16 RCC_CFGR2_ADCPRE12_DIV16 +#define RCC_ADC12PLLCLK_DIV32 RCC_CFGR2_ADCPRE12_DIV32 +#define RCC_ADC12PLLCLK_DIV64 RCC_CFGR2_ADCPRE12_DIV64 +#define RCC_ADC12PLLCLK_DIV128 RCC_CFGR2_ADCPRE12_DIV128 +#define RCC_ADC12PLLCLK_DIV256 RCC_CFGR2_ADCPRE12_DIV256 + +/** + * @} + */ + +/** @defgroup RCCEx_I2S_Clock_Source RCC Extended I2S Clock Source + * @{ + */ +#define RCC_I2SCLKSOURCE_SYSCLK RCC_CFGR_I2SSRC_SYSCLK +#define RCC_I2SCLKSOURCE_EXT RCC_CFGR_I2SSRC_EXT + +/** + * @} + */ + +/** @defgroup RCCEx_TIM1_Clock_Source RCC Extended TIM1 Clock Source + * @{ + */ +#define RCC_TIM1CLK_HCLK RCC_CFGR3_TIM1SW_HCLK +#define RCC_TIM1CLK_PLLCLK RCC_CFGR3_TIM1SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_TIM2_Clock_Source RCC Extended TIM2 Clock Source + * @{ + */ +#define RCC_TIM2CLK_HCLK RCC_CFGR3_TIM2SW_HCLK +#define RCC_TIM2CLK_PLLCLK RCC_CFGR3_TIM2SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_TIM34_Clock_Source RCC Extended TIM3 & TIM4 Clock Source + * @{ + */ +#define RCC_TIM34CLK_HCLK RCC_CFGR3_TIM34SW_HCLK +#define RCC_TIM34CLK_PLLCLK RCC_CFGR3_TIM34SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_TIM15_Clock_Source RCC Extended TIM15 Clock Source + * @{ + */ +#define RCC_TIM15CLK_HCLK RCC_CFGR3_TIM15SW_HCLK +#define RCC_TIM15CLK_PLLCLK RCC_CFGR3_TIM15SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_TIM16_Clock_Source RCC Extended TIM16 Clock Source + * @{ + */ +#define RCC_TIM16CLK_HCLK RCC_CFGR3_TIM16SW_HCLK +#define RCC_TIM16CLK_PLLCLK RCC_CFGR3_TIM16SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_TIM17_Clock_Source RCC Extended TIM17 Clock Source + * @{ + */ +#define RCC_TIM17CLK_HCLK RCC_CFGR3_TIM17SW_HCLK +#define RCC_TIM17CLK_PLLCLK RCC_CFGR3_TIM17SW_PLL + +/** + * @} + */ + +/** @defgroup RCCEx_UART4_Clock_Source RCC Extended UART4 Clock Source + * @{ + */ +#define RCC_UART4CLKSOURCE_PCLK1 RCC_CFGR3_UART4SW_PCLK +#define RCC_UART4CLKSOURCE_SYSCLK RCC_CFGR3_UART4SW_SYSCLK +#define RCC_UART4CLKSOURCE_LSE RCC_CFGR3_UART4SW_LSE +#define RCC_UART4CLKSOURCE_HSI RCC_CFGR3_UART4SW_HSI + +/** + * @} + */ + +/** @defgroup RCCEx_UART5_Clock_Source RCC Extended UART5 Clock Source + * @{ + */ +#define RCC_UART5CLKSOURCE_PCLK1 RCC_CFGR3_UART5SW_PCLK +#define RCC_UART5CLKSOURCE_SYSCLK RCC_CFGR3_UART5SW_SYSCLK +#define RCC_UART5CLKSOURCE_LSE RCC_CFGR3_UART5SW_LSE +#define RCC_UART5CLKSOURCE_HSI RCC_CFGR3_UART5SW_HSI + +/** + * @} + */ + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +/** @defgroup RCCEx_TIM20_Clock_Source RCC Extended TIM20 Clock Source + * @{ + */ +#define RCC_TIM20CLK_HCLK RCC_CFGR3_TIM20SW_HCLK +#define RCC_TIM20CLK_PLLCLK RCC_CFGR3_TIM20SW_PLL + +/** + * @} + */ +#endif /* STM32F303xE || STM32F398xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) + +/** @defgroup RCCEx_ADC34_Clock_Source RCC Extended ADC34 Clock Source + * @{ + */ + +/* ADC3 & ADC4 */ +#define RCC_ADC34PLLCLK_OFF RCC_CFGR2_ADCPRE34_NO +#define RCC_ADC34PLLCLK_DIV1 RCC_CFGR2_ADCPRE34_DIV1 +#define RCC_ADC34PLLCLK_DIV2 RCC_CFGR2_ADCPRE34_DIV2 +#define RCC_ADC34PLLCLK_DIV4 RCC_CFGR2_ADCPRE34_DIV4 +#define RCC_ADC34PLLCLK_DIV6 RCC_CFGR2_ADCPRE34_DIV6 +#define RCC_ADC34PLLCLK_DIV8 RCC_CFGR2_ADCPRE34_DIV8 +#define RCC_ADC34PLLCLK_DIV10 RCC_CFGR2_ADCPRE34_DIV10 +#define RCC_ADC34PLLCLK_DIV12 RCC_CFGR2_ADCPRE34_DIV12 +#define RCC_ADC34PLLCLK_DIV16 RCC_CFGR2_ADCPRE34_DIV16 +#define RCC_ADC34PLLCLK_DIV32 RCC_CFGR2_ADCPRE34_DIV32 +#define RCC_ADC34PLLCLK_DIV64 RCC_CFGR2_ADCPRE34_DIV64 +#define RCC_ADC34PLLCLK_DIV128 RCC_CFGR2_ADCPRE34_DIV128 +#define RCC_ADC34PLLCLK_DIV256 RCC_CFGR2_ADCPRE34_DIV256 + +/** + * @} + */ + +/** @defgroup RCCEx_TIM8_Clock_Source RCC Extended TIM8 Clock Source + * @{ + */ +#define RCC_TIM8CLK_HCLK RCC_CFGR3_TIM8SW_HCLK +#define RCC_TIM8CLK_PLLCLK RCC_CFGR3_TIM8SW_PLL + +/** + * @} + */ + +#endif /* STM32F303xC || STM32F303xE || STM32F398xx || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) + +/** @defgroup RCCEx_USART1_Clock_Source RCC Extended USART1 Clock Source + * @{ + */ +#define RCC_USART1CLKSOURCE_PCLK1 RCC_CFGR3_USART1SW_PCLK1 +#define RCC_USART1CLKSOURCE_SYSCLK RCC_CFGR3_USART1SW_SYSCLK +#define RCC_USART1CLKSOURCE_LSE RCC_CFGR3_USART1SW_LSE +#define RCC_USART1CLKSOURCE_HSI RCC_CFGR3_USART1SW_HSI + +/** + * @} + */ + +/** @defgroup RCCEx_ADC12_Clock_Source RCC Extended ADC12 Clock Source + * @{ + */ +/* ADC1 & ADC2 */ +#define RCC_ADC12PLLCLK_OFF RCC_CFGR2_ADCPRE12_NO +#define RCC_ADC12PLLCLK_DIV1 RCC_CFGR2_ADCPRE12_DIV1 +#define RCC_ADC12PLLCLK_DIV2 RCC_CFGR2_ADCPRE12_DIV2 +#define RCC_ADC12PLLCLK_DIV4 RCC_CFGR2_ADCPRE12_DIV4 +#define RCC_ADC12PLLCLK_DIV6 RCC_CFGR2_ADCPRE12_DIV6 +#define RCC_ADC12PLLCLK_DIV8 RCC_CFGR2_ADCPRE12_DIV8 +#define RCC_ADC12PLLCLK_DIV10 RCC_CFGR2_ADCPRE12_DIV10 +#define RCC_ADC12PLLCLK_DIV12 RCC_CFGR2_ADCPRE12_DIV12 +#define RCC_ADC12PLLCLK_DIV16 RCC_CFGR2_ADCPRE12_DIV16 +#define RCC_ADC12PLLCLK_DIV32 RCC_CFGR2_ADCPRE12_DIV32 +#define RCC_ADC12PLLCLK_DIV64 RCC_CFGR2_ADCPRE12_DIV64 +#define RCC_ADC12PLLCLK_DIV128 RCC_CFGR2_ADCPRE12_DIV128 +#define RCC_ADC12PLLCLK_DIV256 RCC_CFGR2_ADCPRE12_DIV256 + +/** + * @} + */ + +/** @defgroup RCCEx_TIM1_Clock_Source RCC Extended TIM1 Clock Source + * @{ + */ +#define RCC_TIM1CLK_HCLK RCC_CFGR3_TIM1SW_HCLK +#define RCC_TIM1CLK_PLLCLK RCC_CFGR3_TIM1SW_PLL + +/** + * @} + */ + +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F334x8) + +/** @defgroup RCCEx_HRTIM1_Clock_Source RCC Extended HRTIM1 Clock Source + * @{ + */ +#define RCC_HRTIM1CLK_HCLK RCC_CFGR3_HRTIM1SW_HCLK +#define RCC_HRTIM1CLK_PLLCLK RCC_CFGR3_HRTIM1SW_PLL + +/** + * @} + */ + +#endif /* STM32F334x8 */ + +#if defined(STM32F373xC) || defined(STM32F378xx) + +/** @defgroup RCCEx_USART1_Clock_Source RCC Extended USART1 Clock Source + * @{ + */ +#define RCC_USART1CLKSOURCE_PCLK2 RCC_CFGR3_USART1SW_PCLK2 +#define RCC_USART1CLKSOURCE_SYSCLK RCC_CFGR3_USART1SW_SYSCLK +#define RCC_USART1CLKSOURCE_LSE RCC_CFGR3_USART1SW_LSE +#define RCC_USART1CLKSOURCE_HSI RCC_CFGR3_USART1SW_HSI + +/** + * @} + */ + +/** @defgroup RCCEx_I2C2_Clock_Source RCC Extended I2C2 Clock Source + * @{ + */ +#define RCC_I2C2CLKSOURCE_HSI RCC_CFGR3_I2C2SW_HSI +#define RCC_I2C2CLKSOURCE_SYSCLK RCC_CFGR3_I2C2SW_SYSCLK + +/** + * @} + */ + +/** @defgroup RCCEx_ADC1_Clock_Source RCC Extended ADC1 Clock Source + * @{ + */ + +/* ADC1 */ +#define RCC_ADC1PCLK2_DIV2 RCC_CFGR_ADCPRE_DIV2 +#define RCC_ADC1PCLK2_DIV4 RCC_CFGR_ADCPRE_DIV4 +#define RCC_ADC1PCLK2_DIV6 RCC_CFGR_ADCPRE_DIV6 +#define RCC_ADC1PCLK2_DIV8 RCC_CFGR_ADCPRE_DIV8 + +/** + * @} + */ + +/** @defgroup RCCEx_CEC_Clock_Source RCC Extended CEC Clock Source + * @{ + */ +#define RCC_CECCLKSOURCE_HSI RCC_CFGR3_CECSW_HSI_DIV244 +#define RCC_CECCLKSOURCE_LSE RCC_CFGR3_CECSW_LSE + +/** + * @} + */ + +/** @defgroup RCCEx_SDADC_Clock_Prescaler RCC Extended SDADC Clock Prescaler + * @{ + */ +#define RCC_SDADCSYSCLK_DIV1 RCC_CFGR_SDPRE_DIV1 +#define RCC_SDADCSYSCLK_DIV2 RCC_CFGR_SDPRE_DIV2 +#define RCC_SDADCSYSCLK_DIV4 RCC_CFGR_SDPRE_DIV4 +#define RCC_SDADCSYSCLK_DIV6 RCC_CFGR_SDPRE_DIV6 +#define RCC_SDADCSYSCLK_DIV8 RCC_CFGR_SDPRE_DIV8 +#define RCC_SDADCSYSCLK_DIV10 RCC_CFGR_SDPRE_DIV10 +#define RCC_SDADCSYSCLK_DIV12 RCC_CFGR_SDPRE_DIV12 +#define RCC_SDADCSYSCLK_DIV14 RCC_CFGR_SDPRE_DIV14 +#define RCC_SDADCSYSCLK_DIV16 RCC_CFGR_SDPRE_DIV16 +#define RCC_SDADCSYSCLK_DIV20 RCC_CFGR_SDPRE_DIV20 +#define RCC_SDADCSYSCLK_DIV24 RCC_CFGR_SDPRE_DIV24 +#define RCC_SDADCSYSCLK_DIV28 RCC_CFGR_SDPRE_DIV28 +#define RCC_SDADCSYSCLK_DIV32 RCC_CFGR_SDPRE_DIV32 +#define RCC_SDADCSYSCLK_DIV36 RCC_CFGR_SDPRE_DIV36 +#define RCC_SDADCSYSCLK_DIV40 RCC_CFGR_SDPRE_DIV40 +#define RCC_SDADCSYSCLK_DIV44 RCC_CFGR_SDPRE_DIV44 +#define RCC_SDADCSYSCLK_DIV48 RCC_CFGR_SDPRE_DIV48 + +/** + * @} + */ + +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE)\ + || defined(STM32F302xC) || defined(STM32F303xC)\ + || defined(STM32F302x8) \ + || defined(STM32F373xC) +/** @defgroup RCCEx_USB_Clock_Source RCC Extended USB Clock Source + * @{ + */ + +#define RCC_USBCLKSOURCE_PLL RCC_CFGR_USBPRE_DIV1 +#define RCC_USBCLKSOURCE_PLL_DIV1_5 RCC_CFGR_USBPRE_DIV1_5 + +/** + * @} + */ + +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F302x8 || */ + /* STM32F373xC */ + + +/** @defgroup RCCEx_MCOx_Clock_Prescaler RCC Extended MCOx Clock Prescaler + * @{ + */ +#if defined(RCC_CFGR_MCOPRE) + +#define RCC_MCODIV_1 (0x00000000U) +#define RCC_MCODIV_2 (0x10000000U) +#define RCC_MCODIV_4 (0x20000000U) +#define RCC_MCODIV_8 (0x30000000U) +#define RCC_MCODIV_16 (0x40000000U) +#define RCC_MCODIV_32 (0x50000000U) +#define RCC_MCODIV_64 (0x60000000U) +#define RCC_MCODIV_128 (0x70000000U) + +#else + +#define RCC_MCODIV_1 (0x00000000U) + +#endif /* RCC_CFGR_MCOPRE */ + +/** + * @} + */ + +/** @defgroup RCCEx_LSEDrive_Configuration RCC LSE Drive Configuration + * @{ + */ + +#define RCC_LSEDRIVE_LOW (0x00000000U) /*!< Xtal mode lower driving capability */ +#define RCC_LSEDRIVE_MEDIUMLOW RCC_BDCR_LSEDRV_1 /*!< Xtal mode medium low driving capability */ +#define RCC_LSEDRIVE_MEDIUMHIGH RCC_BDCR_LSEDRV_0 /*!< Xtal mode medium high driving capability */ +#define RCC_LSEDRIVE_HIGH RCC_BDCR_LSEDRV /*!< Xtal mode higher driving capability */ + +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup RCCEx_Exported_Macros RCC Extended Exported Macros + * @{ + */ + +/** @defgroup RCCEx_PLL_Configuration RCC Extended PLL Configuration + * @{ + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +/** @brief Macro to configure the PLL clock source, multiplication and division factors. + * @note This macro must be used only when the PLL is disabled. + * + * @param __RCC_PLLSource__ specifies the PLL entry clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL clock entry + * @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL clock entry + * @param __PREDIV__ specifies the predivider factor for PLL VCO input clock + * This parameter must be a number between RCC_PREDIV_DIV1 and RCC_PREDIV_DIV16. + * @param __PLLMUL__ specifies the multiplication factor for PLL VCO input clock + * This parameter must be a number between RCC_PLL_MUL2 and RCC_PLL_MUL16. + * + */ +#define __HAL_RCC_PLL_CONFIG(__RCC_PLLSource__ , __PREDIV__, __PLLMUL__) \ + do { \ + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV, (__PREDIV__)); \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_PLLMUL | RCC_CFGR_PLLSRC, (uint32_t)((__PLLMUL__)|(__RCC_PLLSource__))); \ + } while(0U) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)\ + || defined(STM32F373xC) || defined(STM32F378xx) +/** @brief Macro to configure the PLL clock source and multiplication factor. + * @note This macro must be used only when the PLL is disabled. + * + * @param __RCC_PLLSource__ specifies the PLL entry clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_PLLSOURCE_HSI HSI oscillator clock selected as PLL clock entry + * @arg @ref RCC_PLLSOURCE_HSE HSE oscillator clock selected as PLL clock entry + * @param __PLLMUL__ specifies the multiplication factor for PLL VCO input clock + * This parameter must be a number between RCC_PLL_MUL2 and RCC_PLL_MUL16. + * + */ +#define __HAL_RCC_PLL_CONFIG(__RCC_PLLSource__ , __PLLMUL__) \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_PLLMUL | RCC_CFGR_PLLSRC, (uint32_t)((__PLLMUL__)|(__RCC_PLLSource__))) +#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + /* STM32F373xC || STM32F378xx */ +/** + * @} + */ + +#if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)\ + || defined(STM32F373xC) || defined(STM32F378xx) +/** @defgroup RCCEx_HSE_Configuration RCC Extended HSE Configuration + * @{ + */ + +/** + * @brief Macro to configure the External High Speed oscillator (HSE) Predivision factor for PLL. + * @note Predivision factor can not be changed if PLL is used as system clock + * In this case, you have to select another source of the system clock, disable the PLL and + * then change the HSE predivision factor. + * @param __HSE_PREDIV_VALUE__ specifies the division value applied to HSE. + * This parameter must be a number between RCC_HSE_PREDIV_DIV1 and RCC_HSE_PREDIV_DIV16. + */ +#define __HAL_RCC_HSE_PREDIV_CONFIG(__HSE_PREDIV_VALUE__) \ + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV, (uint32_t)(__HSE_PREDIV_VALUE__)) + +/** + * @brief Macro to get prediv1 factor for PLL. + */ +#define __HAL_RCC_HSE_GET_PREDIV() READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV) + +/** + * @} + */ +#endif /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + /* STM32F373xC || STM32F378xx */ + +/** @defgroup RCCEx_AHB_Clock_Enable_Disable RCC Extended AHB Clock Enable Disable + * @brief Enable or disable the AHB peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_ADC1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_ADC1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_ADC1EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_ADC1_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_ADC1EN)) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_DMA2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_DMA2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_DMA2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_GPIOE_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOEEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOEEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_ADC12_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_ADC12EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_ADC12EN);\ + UNUSED(tmpreg); \ + } while(0U) +/* Aliases for STM32 F3 compatibility */ +#define __HAL_RCC_ADC1_CLK_ENABLE() __HAL_RCC_ADC12_CLK_ENABLE() +#define __HAL_RCC_ADC2_CLK_ENABLE() __HAL_RCC_ADC12_CLK_ENABLE() + +#define __HAL_RCC_DMA2_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_DMA2EN)) +#define __HAL_RCC_GPIOE_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOEEN)) +#define __HAL_RCC_ADC12_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_ADC12EN)) +/* Aliases for STM32 F3 compatibility */ +#define __HAL_RCC_ADC1_CLK_DISABLE() __HAL_RCC_ADC12_CLK_DISABLE() +#define __HAL_RCC_ADC2_CLK_DISABLE() __HAL_RCC_ADC12_CLK_DISABLE() +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_ADC34_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_ADC34EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_ADC34EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_ADC34_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_ADC34EN)) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_ADC12_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_ADC12EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_ADC12EN);\ + UNUSED(tmpreg); \ + } while(0U) +/* Aliases for STM32 F3 compatibility */ +#define __HAL_RCC_ADC1_CLK_ENABLE() __HAL_RCC_ADC12_CLK_ENABLE() +#define __HAL_RCC_ADC2_CLK_ENABLE() __HAL_RCC_ADC12_CLK_ENABLE() + +#define __HAL_RCC_ADC12_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_ADC12EN)) +/* Aliases for STM32 F3 compatibility */ +#define __HAL_RCC_ADC1_CLK_DISABLE() __HAL_RCC_ADC12_CLK_DISABLE() +#define __HAL_RCC_ADC2_CLK_DISABLE() __HAL_RCC_ADC12_CLK_DISABLE() +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_DMA2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_DMA2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_DMA2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_GPIOE_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOEEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOEEN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_DMA2_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_DMA2EN)) +#define __HAL_RCC_GPIOE_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOEEN)) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_FMC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_FMCEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FMCEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_GPIOG_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOGEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOGEN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_GPIOH_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->AHBENR, RCC_AHBENR_GPIOHEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_GPIOHEN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_FMC_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_FMCEN)) +#define __HAL_RCC_GPIOG_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOGEN)) +#define __HAL_RCC_GPIOH_CLK_DISABLE() (RCC->AHBENR &= ~(RCC_AHBENR_GPIOHEN)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ +/** + * @} + */ + +/** @defgroup RCCEx_APB1_Clock_Enable_Disable RCC Extended APB1 Clock Enable Disable + * @brief Enable or disable the Low Speed APB (APB1) peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_SPI2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SPI3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_I2C2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_I2C3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C3EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_SPI2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI2EN)) +#define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN)) +#define __HAL_RCC_I2C2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C2EN)) +#define __HAL_RCC_I2C3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C3EN)) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_TIM3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SPI2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SPI3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_UART4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART4EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_UART5_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_UART5EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_I2C2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_TIM3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM3EN)) +#define __HAL_RCC_TIM4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM4EN)) +#define __HAL_RCC_SPI2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI2EN)) +#define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN)) +#define __HAL_RCC_UART4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART4EN)) +#define __HAL_RCC_UART5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_UART5EN)) +#define __HAL_RCC_I2C2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C2EN)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_TIM3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_DAC2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DAC2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DAC2EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_TIM3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM3EN)) +#define __HAL_RCC_DAC2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DAC2EN)) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_TIM3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM3EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM4EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM5_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM5EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM12_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM12EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM13_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM13EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM14_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM14EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM18_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM18EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM18EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SPI2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SPI3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_SPI3EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_I2C2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_DAC2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_DAC2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_DAC2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_CEC_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CECEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CECEN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_TIM3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM3EN)) +#define __HAL_RCC_TIM4_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM4EN)) +#define __HAL_RCC_TIM5_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM5EN)) +#define __HAL_RCC_TIM12_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM12EN)) +#define __HAL_RCC_TIM13_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM13EN)) +#define __HAL_RCC_TIM14_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM14EN)) +#define __HAL_RCC_TIM18_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM18EN)) +#define __HAL_RCC_SPI2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI2EN)) +#define __HAL_RCC_SPI3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_SPI3EN)) +#define __HAL_RCC_I2C2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C2EN)) +#define __HAL_RCC_DAC2_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_DAC2EN)) +#define __HAL_RCC_CEC_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CECEN)) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) \ + || defined(STM32F303xC) || defined(STM32F358xx) \ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_TIM7_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_TIM7EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_TIM7_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_TIM7EN)) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE)\ + || defined(STM32F302xC) || defined(STM32F303xC)\ + || defined(STM32F302x8) \ + || defined(STM32F373xC) +#define __HAL_RCC_USB_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_USBEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_USBEN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_USB_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_USBEN)) +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F302x8 || */ + /* STM32F373xC */ + +#if !defined(STM32F301x8) +#define __HAL_RCC_CAN1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_CANEN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_CANEN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_CAN1_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_CANEN)) +#endif /* STM32F301x8*/ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_I2C3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB1ENR, RCC_APB1ENR_I2C3EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_I2C3_CLK_DISABLE() (RCC->APB1ENR &= ~(RCC_APB1ENR_I2C3EN)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ +/** + * @} + */ + +/** @defgroup RCCEx_APB2_Clock_Enable_Disable RCC Extended APB2 Clock Enable Disable + * @brief Enable or disable the High Speed APB (APB2) peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_SPI1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_SPI1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI1EN)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_TIM8_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM8EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_TIM8_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM8EN)) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_SPI1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_SPI1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI1EN)) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F334x8) +#define __HAL_RCC_HRTIM1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_HRTIM1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_HRTIM1EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_HRTIM1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_HRTIM1EN)) +#endif /* STM32F334x8 */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_ADC1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_ADC1EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SPI1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI1EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM19_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM19EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM19EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SDADC1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SDADC1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDADC1EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SDADC2_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SDADC2EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDADC2EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_SDADC3_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SDADC3EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SDADC3EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_ADC1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_ADC1EN)) +#define __HAL_RCC_SPI1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI1EN)) +#define __HAL_RCC_TIM19_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM19EN)) +#define __HAL_RCC_SDADC1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SDADC1EN)) +#define __HAL_RCC_SDADC2_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SDADC2EN)) +#define __HAL_RCC_SDADC3_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SDADC3EN)) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_TIM1_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM1EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_TIM1_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM1EN)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_SPI4_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_SPI4EN);\ + UNUSED(tmpreg); \ + } while(0U) + +#define __HAL_RCC_SPI4_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_SPI4EN)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_TIM20_CLK_ENABLE() do { \ + __IO uint32_t tmpreg; \ + SET_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM20EN);\ + /* Delay after an RCC peripheral clock enabling */ \ + tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_TIM20EN);\ + UNUSED(tmpreg); \ + } while(0U) +#define __HAL_RCC_TIM20_CLK_DISABLE() (RCC->APB2ENR &= ~(RCC_APB2ENR_TIM20EN)) +#endif /* STM32F303xE || STM32F398xx */ + +/** + * @} + */ + +/** @defgroup RCCEx_AHB_Peripheral_Clock_Enable_Disable_Status RCC Extended AHB Peripheral Clock Enable Disable Status + * @brief Get the enable or disable status of the AHB peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_ADC1_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_ADC1EN)) != RESET) + +#define __HAL_RCC_ADC1_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_ADC1EN)) == RESET) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_DMA2_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA2EN)) != RESET) +#define __HAL_RCC_GPIOE_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOEEN)) != RESET) +#define __HAL_RCC_ADC12_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_ADC12EN)) != RESET) + +#define __HAL_RCC_DMA2_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA2EN)) == RESET) +#define __HAL_RCC_GPIOE_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOEEN)) == RESET) +#define __HAL_RCC_ADC12_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_ADC12EN)) == RESET) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_ADC34_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_ADC34EN)) != RESET) + +#define __HAL_RCC_ADC34_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_ADC34EN)) == RESET) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_ADC12_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_ADC12EN)) != RESET) + +#define __HAL_RCC_ADC12_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_ADC12EN)) == RESET) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_DMA2_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA2EN)) != RESET) +#define __HAL_RCC_GPIOE_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOEEN)) != RESET) + +#define __HAL_RCC_DMA2_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_DMA2EN)) == RESET) +#define __HAL_RCC_GPIOE_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOEEN)) == RESET) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_FMC_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_FMCEN)) != RESET) +#define __HAL_RCC_GPIOG_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOGEN)) != RESET) +#define __HAL_RCC_GPIOH_IS_CLK_ENABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOHEN)) != RESET) + +#define __HAL_RCC_FMC_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_FMCEN)) == RESET) +#define __HAL_RCC_GPIOG_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOGEN)) == RESET) +#define __HAL_RCC_GPIOH_IS_CLK_DISABLED() ((RCC->AHBENR & (RCC_AHBENR_GPIOHEN)) == RESET) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ +/** + * @} + */ + +/** @defgroup RCCEx_APB1_Clock_Enable_Disable_Status RCC Extended APB1 Peripheral Clock Enable Disable Status + * @brief Get the enable or disable status of the APB1 peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_SPI2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) != RESET) +#define __HAL_RCC_SPI3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) != RESET) +#define __HAL_RCC_I2C2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) != RESET) +#define __HAL_RCC_I2C3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C3EN)) != RESET) + +#define __HAL_RCC_SPI2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) == RESET) +#define __HAL_RCC_SPI3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) == RESET) +#define __HAL_RCC_I2C2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) == RESET) +#define __HAL_RCC_I2C3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C3EN)) == RESET) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_TIM3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM3EN)) != RESET) +#define __HAL_RCC_TIM4_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM4EN)) != RESET) +#define __HAL_RCC_SPI2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) != RESET) +#define __HAL_RCC_SPI3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) != RESET) +#define __HAL_RCC_UART4_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) != RESET) +#define __HAL_RCC_UART5_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) != RESET) +#define __HAL_RCC_I2C2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) != RESET) + +#define __HAL_RCC_TIM3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM3EN)) == RESET) +#define __HAL_RCC_TIM4_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM4EN)) == RESET) +#define __HAL_RCC_SPI2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) == RESET) +#define __HAL_RCC_SPI3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) == RESET) +#define __HAL_RCC_UART4_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART4EN)) == RESET) +#define __HAL_RCC_UART5_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_UART5EN)) == RESET) +#define __HAL_RCC_I2C2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) == RESET) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_TIM3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM3EN)) != RESET) +#define __HAL_RCC_DAC2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DAC2EN)) != RESET) + +#define __HAL_RCC_TIM3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM3EN)) == RESET) +#define __HAL_RCC_DAC2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DAC2EN)) == RESET) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_TIM3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM3EN)) != RESET) +#define __HAL_RCC_TIM4_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM4EN)) != RESET) +#define __HAL_RCC_TIM5_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) != RESET) +#define __HAL_RCC_TIM12_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM12EN)) != RESET) +#define __HAL_RCC_TIM13_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM13EN)) != RESET) +#define __HAL_RCC_TIM14_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM14EN)) != RESET) +#define __HAL_RCC_TIM18_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM18EN)) != RESET) +#define __HAL_RCC_SPI2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) != RESET) +#define __HAL_RCC_SPI3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) != RESET) +#define __HAL_RCC_I2C2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) != RESET) +#define __HAL_RCC_DAC2_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DAC2EN)) != RESET) +#define __HAL_RCC_CEC_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CECEN)) != RESET) + +#define __HAL_RCC_TIM3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM3EN)) == RESET) +#define __HAL_RCC_TIM4_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM4EN)) == RESET) +#define __HAL_RCC_TIM5_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM5EN)) == RESET) +#define __HAL_RCC_TIM12_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM12EN)) == RESET) +#define __HAL_RCC_TIM13_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM13EN)) == RESET) +#define __HAL_RCC_TIM14_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM14EN)) == RESET) +#define __HAL_RCC_TIM18_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM18EN)) == RESET) +#define __HAL_RCC_SPI2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI2EN)) == RESET) +#define __HAL_RCC_SPI3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_SPI3EN)) == RESET) +#define __HAL_RCC_I2C2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C2EN)) == RESET) +#define __HAL_RCC_DAC2_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_DAC2EN)) == RESET) +#define __HAL_RCC_CEC_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CECEN)) == RESET) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) \ + || defined(STM32F303xC) || defined(STM32F358xx) \ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_TIM7_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM7EN)) != RESET) + +#define __HAL_RCC_TIM7_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_TIM7EN)) == RESET) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE)\ + || defined(STM32F302xC) || defined(STM32F303xC)\ + || defined(STM32F302x8) \ + || defined(STM32F373xC) +#define __HAL_RCC_USB_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USBEN)) != RESET) + +#define __HAL_RCC_USB_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_USBEN)) == RESET) +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F302x8 || */ + /* STM32F373xC */ + +#if !defined(STM32F301x8) +#define __HAL_RCC_CAN1_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CANEN)) != RESET) + +#define __HAL_RCC_CAN1_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_CANEN)) == RESET) +#endif /* STM32F301x8*/ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_I2C3_IS_CLK_ENABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C3EN)) != RESET) + +#define __HAL_RCC_I2C3_IS_CLK_DISABLED() ((RCC->APB1ENR & (RCC_APB1ENR_I2C3EN)) == RESET) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ +/** + * @} + */ + +/** @defgroup RCCEx_APB2_Clock_Enable_Disable_Status RCC Extended APB2 Peripheral Clock Enable Disable Status + * @brief Get the enable or disable status of the APB2 peripheral clock. + * @note After reset, the peripheral clock (used for registers read/write access) + * is disabled and the application software has to enable this clock before + * using it. + * @{ + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_SPI1_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SPI1EN)) != RESET) + +#define __HAL_RCC_SPI1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SPI1EN)) == RESET) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_TIM8_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM8EN)) != RESET) + +#define __HAL_RCC_TIM8_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM8EN)) == RESET) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_SPI1_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SPI1EN)) != RESET) + +#define __HAL_RCC_SPI1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SPI1EN)) == RESET) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F334x8) +#define __HAL_RCC_HRTIM1_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_HRTIM1EN)) != RESET) + +#define __HAL_RCC_HRTIM1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_HRTIM1EN)) == RESET) +#endif /* STM32F334x8 */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_ADC1_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_ADC1EN)) != RESET) +#define __HAL_RCC_SPI1_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SPI1EN)) != RESET) +#define __HAL_RCC_TIM19_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM19EN)) != RESET) +#define __HAL_RCC_SDADC1_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDADC1EN)) != RESET) +#define __HAL_RCC_SDADC2_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDADC2EN)) != RESET) +#define __HAL_RCC_SDADC3_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDADC3EN)) != RESET) + +#define __HAL_RCC_ADC1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_ADC1EN)) == RESET) +#define __HAL_RCC_SPI1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SPI1EN)) == RESET) +#define __HAL_RCC_TIM19_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM19EN)) == RESET) +#define __HAL_RCC_SDADC1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDADC1EN)) == RESET) +#define __HAL_RCC_SDADC2_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDADC2EN)) == RESET) +#define __HAL_RCC_SDADC3_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SDADC3EN)) == RESET) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_TIM1_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM1EN)) != RESET) + +#define __HAL_RCC_TIM1_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM1EN)) == RESET) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_SPI4_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SPI4EN)) != RESET) + +#define __HAL_RCC_SPI4_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_SPI4EN)) == RESET) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_TIM20_IS_CLK_ENABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM20EN)) != RESET) + +#define __HAL_RCC_TIM20_IS_CLK_DISABLED() ((RCC->APB2ENR & (RCC_APB2ENR_TIM20EN)) == RESET) +#endif /* STM32F303xE || STM32F398xx */ +/** + * @} + */ + +/** @defgroup RCCEx_AHB_Force_Release_Reset RCC Extended AHB Force Release Reset + * @brief Force or release AHB peripheral reset. + * @{ + */ +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_ADC1_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_ADC1RST)) + +#define __HAL_RCC_ADC1_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_ADC1RST)) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_GPIOE_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOERST)) +#define __HAL_RCC_ADC12_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_ADC12RST)) +/* Aliases for STM32 F3 compatibility */ +#define __HAL_RCC_ADC1_FORCE_RESET() __HAL_RCC_ADC12_FORCE_RESET() +#define __HAL_RCC_ADC2_FORCE_RESET() __HAL_RCC_ADC12_FORCE_RESET() + +#define __HAL_RCC_GPIOE_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOERST)) +#define __HAL_RCC_ADC12_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_ADC12RST)) +/* Aliases for STM32 F3 compatibility */ +#define __HAL_RCC_ADC1_RELEASE_RESET() __HAL_RCC_ADC12_RELEASE_RESET() +#define __HAL_RCC_ADC2_RELEASE_RESET() __HAL_RCC_ADC12_RELEASE_RESET() +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_ADC34_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_ADC34RST)) + +#define __HAL_RCC_ADC34_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_ADC34RST)) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_ADC12_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_ADC12RST)) +/* Aliases for STM32 F3 compatibility */ +#define __HAL_RCC_ADC1_FORCE_RESET() __HAL_RCC_ADC12_FORCE_RESET() +#define __HAL_RCC_ADC2_FORCE_RESET() __HAL_RCC_ADC12_FORCE_RESET() + +#define __HAL_RCC_ADC12_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_ADC12RST)) +/* Aliases for STM32 F3 compatibility */ +#define __HAL_RCC_ADC1_RELEASE_RESET() __HAL_RCC_ADC12_RELEASE_RESET() +#define __HAL_RCC_ADC2_RELEASE_RESET() __HAL_RCC_ADC12_RELEASE_RESET() +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_GPIOE_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOERST)) + +#define __HAL_RCC_GPIOE_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOERST)) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_FMC_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_FMCRST)) +#define __HAL_RCC_GPIOG_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOGRST)) +#define __HAL_RCC_GPIOH_FORCE_RESET() (RCC->AHBRSTR |= (RCC_AHBRSTR_GPIOHRST)) + +#define __HAL_RCC_FMC_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_FMCRST)) +#define __HAL_RCC_GPIOG_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOGRST)) +#define __HAL_RCC_GPIOH_RELEASE_RESET() (RCC->AHBRSTR &= ~(RCC_AHBRSTR_GPIOHRST)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ +/** + * @} + */ + +/** @defgroup RCCEx_APB1_Force_Release_Reset RCC Extended APB1 Force Release Reset + * @brief Force or release APB1 peripheral reset. + * @{ + */ +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_SPI2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI2RST)) +#define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST)) +#define __HAL_RCC_I2C2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C2RST)) +#define __HAL_RCC_I2C3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C3RST)) + +#define __HAL_RCC_SPI2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI2RST)) +#define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST)) +#define __HAL_RCC_I2C2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C2RST)) +#define __HAL_RCC_I2C3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C3RST)) +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_TIM3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM3RST)) +#define __HAL_RCC_TIM4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM4RST)) +#define __HAL_RCC_SPI2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI2RST)) +#define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST)) +#define __HAL_RCC_UART4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART4RST)) +#define __HAL_RCC_UART5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_UART5RST)) +#define __HAL_RCC_I2C2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C2RST)) + +#define __HAL_RCC_TIM3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM3RST)) +#define __HAL_RCC_TIM4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM4RST)) +#define __HAL_RCC_SPI2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI2RST)) +#define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST)) +#define __HAL_RCC_UART4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART4RST)) +#define __HAL_RCC_UART5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_UART5RST)) +#define __HAL_RCC_I2C2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C2RST)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_TIM3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM3RST)) +#define __HAL_RCC_DAC2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DAC2RST)) + +#define __HAL_RCC_TIM3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM3RST)) +#define __HAL_RCC_DAC2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DAC2RST)) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_TIM3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM3RST)) +#define __HAL_RCC_TIM4_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM4RST)) +#define __HAL_RCC_TIM5_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM5RST)) +#define __HAL_RCC_TIM12_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM12RST)) +#define __HAL_RCC_TIM13_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM13RST)) +#define __HAL_RCC_TIM14_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM14RST)) +#define __HAL_RCC_TIM18_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM18RST)) +#define __HAL_RCC_SPI2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI2RST)) +#define __HAL_RCC_SPI3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_SPI3RST)) +#define __HAL_RCC_I2C2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C2RST)) +#define __HAL_RCC_DAC2_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_DAC2RST)) +#define __HAL_RCC_CEC_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CECRST)) + +#define __HAL_RCC_TIM3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM3RST)) +#define __HAL_RCC_TIM4_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM4RST)) +#define __HAL_RCC_TIM5_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM5RST)) +#define __HAL_RCC_TIM12_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM12RST)) +#define __HAL_RCC_TIM13_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM13RST)) +#define __HAL_RCC_TIM14_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM14RST)) +#define __HAL_RCC_TIM18_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM18RST)) +#define __HAL_RCC_SPI2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI2RST)) +#define __HAL_RCC_SPI3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_SPI3RST)) +#define __HAL_RCC_I2C2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C2RST)) +#define __HAL_RCC_DAC2_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_DAC2RST)) +#define __HAL_RCC_CEC_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CECRST)) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_TIM7_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_TIM7RST)) + +#define __HAL_RCC_TIM7_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_TIM7RST)) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE)\ + || defined(STM32F302xC) || defined(STM32F303xC)\ + || defined(STM32F302x8) \ + || defined(STM32F373xC) +#define __HAL_RCC_USB_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_USBRST)) + +#define __HAL_RCC_USB_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_USBRST)) +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F302x8 || */ + /* STM32F373xC */ + +#if !defined(STM32F301x8) +#define __HAL_RCC_CAN1_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_CANRST)) + +#define __HAL_RCC_CAN1_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_CANRST)) +#endif /* STM32F301x8*/ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_I2C3_FORCE_RESET() (RCC->APB1RSTR |= (RCC_APB1RSTR_I2C3RST)) + +#define __HAL_RCC_I2C3_RELEASE_RESET() (RCC->APB1RSTR &= ~(RCC_APB1RSTR_I2C3RST)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ +/** + * @} + */ + +/** @defgroup RCCEx_APB2_Force_Release_Reset RCC Extended APB2 Force Release Reset + * @brief Force or release APB2 peripheral reset. + * @{ + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_SPI1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI1RST)) + +#define __HAL_RCC_SPI1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI1RST)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) +#define __HAL_RCC_TIM8_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM8RST)) + +#define __HAL_RCC_TIM8_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM8RST)) +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +#define __HAL_RCC_SPI1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI1RST)) + +#define __HAL_RCC_SPI1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI1RST)) +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F334x8) +#define __HAL_RCC_HRTIM1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_HRTIM1RST)) + +#define __HAL_RCC_HRTIM1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_HRTIM1RST)) +#endif /* STM32F334x8 */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +#define __HAL_RCC_ADC1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_ADC1RST)) +#define __HAL_RCC_SPI1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI1RST)) +#define __HAL_RCC_TIM19_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM19RST)) +#define __HAL_RCC_SDADC1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SDADC1RST)) +#define __HAL_RCC_SDADC2_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SDADC2RST)) +#define __HAL_RCC_SDADC3_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SDADC3RST)) + +#define __HAL_RCC_ADC1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_ADC1RST)) +#define __HAL_RCC_SPI1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI1RST)) +#define __HAL_RCC_TIM19_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM19RST)) +#define __HAL_RCC_SDADC1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SDADC1RST)) +#define __HAL_RCC_SDADC2_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SDADC2RST)) +#define __HAL_RCC_SDADC3_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SDADC3RST)) +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define __HAL_RCC_TIM1_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM1RST)) + +#define __HAL_RCC_TIM1_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM1RST)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_SPI4_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_SPI4RST)) + +#define __HAL_RCC_SPI4_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_SPI4RST)) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +#define __HAL_RCC_TIM20_FORCE_RESET() (RCC->APB2RSTR |= (RCC_APB2RSTR_TIM20RST)) + +#define __HAL_RCC_TIM20_RELEASE_RESET() (RCC->APB2RSTR &= ~(RCC_APB2RSTR_TIM20RST)) +#endif /* STM32F303xE || STM32F398xx */ + +/** + * @} + */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** @defgroup RCCEx_I2Cx_Clock_Config RCC Extended I2Cx Clock Config + * @{ + */ + +/** @brief Macro to configure the I2C2 clock (I2C2CLK). + * @param __I2C2CLKSource__ specifies the I2C2 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_I2C2CLKSOURCE_HSI HSI selected as I2C2 clock + * @arg @ref RCC_I2C2CLKSOURCE_SYSCLK System Clock selected as I2C2 clock + */ +#define __HAL_RCC_I2C2_CONFIG(__I2C2CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_I2C2SW, (uint32_t)(__I2C2CLKSource__)) + +/** @brief Macro to get the I2C2 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_I2C2CLKSOURCE_HSI HSI selected as I2C2 clock + * @arg @ref RCC_I2C2CLKSOURCE_SYSCLK System Clock selected as I2C2 clock + */ +#define __HAL_RCC_GET_I2C2_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_I2C2SW))) + +/** @brief Macro to configure the I2C3 clock (I2C3CLK). + * @param __I2C3CLKSource__ specifies the I2C3 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_I2C3CLKSOURCE_HSI HSI selected as I2C3 clock + * @arg @ref RCC_I2C3CLKSOURCE_SYSCLK System Clock selected as I2C3 clock + */ +#define __HAL_RCC_I2C3_CONFIG(__I2C3CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_I2C3SW, (uint32_t)(__I2C3CLKSource__)) + +/** @brief Macro to get the I2C3 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_I2C3CLKSOURCE_HSI HSI selected as I2C3 clock + * @arg @ref RCC_I2C3CLKSOURCE_SYSCLK System Clock selected as I2C3 clock + */ +#define __HAL_RCC_GET_I2C3_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_I2C3SW))) + +/** + * @} + */ + +/** @defgroup RCCEx_TIMx_Clock_Config RCC Extended TIMx Clock Config + * @{ + */ +/** @brief Macro to configure the TIM1 clock (TIM1CLK). + * @param __TIM1CLKSource__ specifies the TIM1 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM1CLK_HCLK HCLK selected as TIM1 clock + * @arg @ref RCC_TIM1CLK_PLLCLK PLL Clock selected as TIM1 clock + */ +#define __HAL_RCC_TIM1_CONFIG(__TIM1CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM1SW, (uint32_t)(__TIM1CLKSource__)) + +/** @brief Macro to get the TIM1 clock (TIM1CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM1CLK_HCLK HCLK selected as TIM1 clock + * @arg @ref RCC_TIM1CLK_PLLCLK PLL Clock selected as TIM1 clock + */ +#define __HAL_RCC_GET_TIM1_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM1SW))) + +/** @brief Macro to configure the TIM15 clock (TIM15CLK). + * @param __TIM15CLKSource__ specifies the TIM15 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM15CLK_HCLK HCLK selected as TIM15 clock + * @arg @ref RCC_TIM15CLK_PLL PLL Clock selected as TIM15 clock + */ +#define __HAL_RCC_TIM15_CONFIG(__TIM15CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM15SW, (uint32_t)(__TIM15CLKSource__)) + +/** @brief Macro to get the TIM15 clock (TIM15CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM15CLK_HCLK HCLK selected as TIM15 clock + * @arg @ref RCC_TIM15CLK_PLL PLL Clock selected as TIM15 clock + */ +#define __HAL_RCC_GET_TIM15_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM15SW))) + +/** @brief Macro to configure the TIM16 clock (TIM16CLK). + * @param __TIM16CLKSource__ specifies the TIM16 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM16CLK_HCLK HCLK selected as TIM16 clock + * @arg @ref RCC_TIM16CLK_PLL PLL Clock selected as TIM16 clock + */ +#define __HAL_RCC_TIM16_CONFIG(__TIM16CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM16SW, (uint32_t)(__TIM16CLKSource__)) + +/** @brief Macro to get the TIM16 clock (TIM16CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM16CLK_HCLK HCLK selected as TIM16 clock + * @arg @ref RCC_TIM16CLK_PLL PLL Clock selected as TIM16 clock + */ +#define __HAL_RCC_GET_TIM16_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM16SW))) + +/** @brief Macro to configure the TIM17 clock (TIM17CLK). + * @param __TIM17CLKSource__ specifies the TIM17 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM17CLK_HCLK HCLK selected as TIM17 clock + * @arg @ref RCC_TIM17CLK_PLL PLL Clock selected as TIM17 clock + */ +#define __HAL_RCC_TIM17_CONFIG(__TIM17CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM17SW, (uint32_t)(__TIM17CLKSource__)) + +/** @brief Macro to get the TIM17 clock (TIM17CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM17CLK_HCLK HCLK selected as TIM17 clock + * @arg @ref RCC_TIM17CLK_PLL PLL Clock selected as TIM17 clock + */ +#define __HAL_RCC_GET_TIM17_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM17SW))) + +/** + * @} + */ + +/** @defgroup RCCEx_I2Sx_Clock_Config RCC Extended I2Sx Clock Config + * @{ + */ +/** @brief Macro to configure the I2S clock source (I2SCLK). + * @note This function must be called before enabling the I2S APB clock. + * @param __I2SCLKSource__ specifies the I2S clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_I2SCLKSOURCE_SYSCLK SYSCLK clock used as I2S clock source + * @arg @ref RCC_I2SCLKSOURCE_EXT External clock mapped on the I2S_CKIN pin + * used as I2S clock source + */ +#define __HAL_RCC_I2S_CONFIG(__I2SCLKSource__) \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_I2SSRC, (uint32_t)(__I2SCLKSource__)) + +/** @brief Macro to get the I2S clock source (I2SCLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_I2SCLKSOURCE_SYSCLK SYSCLK clock used as I2S clock source + * @arg @ref RCC_I2SCLKSOURCE_EXT External clock mapped on the I2S_CKIN pin + * used as I2S clock source + */ +#define __HAL_RCC_GET_I2S_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_I2SSRC))) +/** + * @} + */ + +/** @defgroup RCCEx_ADCx_Clock_Config RCC Extended ADCx Clock Config + * @{ + */ + +/** @brief Macro to configure the ADC1 clock (ADC1CLK). + * @param __ADC1CLKSource__ specifies the ADC1 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_ADC1PLLCLK_OFF ADC1 PLL clock disabled, ADC1 can use AHB clock + * @arg @ref RCC_ADC1PLLCLK_DIV1 PLL clock divided by 1 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV2 PLL clock divided by 2 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV4 PLL clock divided by 4 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV6 PLL clock divided by 6 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV8 PLL clock divided by 8 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV10 PLL clock divided by 10 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV12 PLL clock divided by 12 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV16 PLL clock divided by 16 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV32 PLL clock divided by 32 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV64 PLL clock divided by 64 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV128 PLL clock divided by 128 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV256 PLL clock divided by 256 selected as ADC1 clock + */ +#define __HAL_RCC_ADC1_CONFIG(__ADC1CLKSource__) \ + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_ADC1PRES, (uint32_t)(__ADC1CLKSource__)) + +/** @brief Macro to get the ADC1 clock + * @retval The clock source can be one of the following values: + * @arg @ref RCC_ADC1PLLCLK_OFF ADC1 PLL clock disabled, ADC1 can use AHB clock + * @arg @ref RCC_ADC1PLLCLK_DIV1 PLL clock divided by 1 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV2 PLL clock divided by 2 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV4 PLL clock divided by 4 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV6 PLL clock divided by 6 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV8 PLL clock divided by 8 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV10 PLL clock divided by 10 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV12 PLL clock divided by 12 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV16 PLL clock divided by 16 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV32 PLL clock divided by 32 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV64 PLL clock divided by 64 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV128 PLL clock divided by 128 selected as ADC1 clock + * @arg @ref RCC_ADC1PLLCLK_DIV256 PLL clock divided by 256 selected as ADC1 clock + */ +#define __HAL_RCC_GET_ADC1_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_ADC1PRES))) +/** + * @} + */ + +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) +/** @defgroup RCCEx_I2Cx_Clock_Config RCC Extended I2Cx Clock Config + * @{ + */ + +/** @brief Macro to configure the I2C2 clock (I2C2CLK). + * @param __I2C2CLKSource__ specifies the I2C2 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_I2C2CLKSOURCE_HSI HSI selected as I2C2 clock + * @arg @ref RCC_I2C2CLKSOURCE_SYSCLK System Clock selected as I2C2 clock + */ +#define __HAL_RCC_I2C2_CONFIG(__I2C2CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_I2C2SW, (uint32_t)(__I2C2CLKSource__)) + +/** @brief Macro to get the I2C2 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_I2C2CLKSOURCE_HSI HSI selected as I2C2 clock + * @arg @ref RCC_I2C2CLKSOURCE_SYSCLK System Clock selected as I2C2 clock + */ +#define __HAL_RCC_GET_I2C2_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_I2C2SW))) +/** + * @} + */ + +/** @defgroup RCCEx_ADCx_Clock_Config RCC Extended ADCx Clock Config + * @{ + */ + +/** @brief Macro to configure the ADC1 & ADC2 clock (ADC12CLK). + * @param __ADC12CLKSource__ specifies the ADC1 & ADC2 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_ADC12PLLCLK_OFF ADC1 & ADC2 PLL clock disabled, ADC1 & ADC2 can use AHB clock + * @arg @ref RCC_ADC12PLLCLK_DIV1 PLL clock divided by 1 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV2 PLL clock divided by 2 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV4 PLL clock divided by 4 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV6 PLL clock divided by 6 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV8 PLL clock divided by 8 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV10 PLL clock divided by 10 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV12 PLL clock divided by 12 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV16 PLL clock divided by 16 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV32 PLL clock divided by 32 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV64 PLL clock divided by 64 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV128 PLL clock divided by 128 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV256 PLL clock divided by 256 selected as ADC1 & ADC2 clock + */ +#define __HAL_RCC_ADC12_CONFIG(__ADC12CLKSource__) \ + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_ADCPRE12, (uint32_t)(__ADC12CLKSource__)) + +/** @brief Macro to get the ADC1 & ADC2 clock + * @retval The clock source can be one of the following values: + * @arg @ref RCC_ADC12PLLCLK_OFF ADC1 & ADC2 PLL clock disabled, ADC1 & ADC2 can use AHB clock + * @arg @ref RCC_ADC12PLLCLK_DIV1 PLL clock divided by 1 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV2 PLL clock divided by 2 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV4 PLL clock divided by 4 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV6 PLL clock divided by 6 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV8 PLL clock divided by 8 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV10 PLL clock divided by 10 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV12 PLL clock divided by 12 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV16 PLL clock divided by 16 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV32 PLL clock divided by 32 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV64 PLL clock divided by 64 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV128 PLL clock divided by 128 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV256 PLL clock divided by 256 selected as ADC1 & ADC2 clock + */ +#define __HAL_RCC_GET_ADC12_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_ADCPRE12))) +/** + * @} + */ + +/** @defgroup RCCEx_TIMx_Clock_Config RCC Extended TIMx Clock Config + * @{ + */ + +/** @brief Macro to configure the TIM1 clock (TIM1CLK). + * @param __TIM1CLKSource__ specifies the TIM1 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM1CLK_HCLK HCLK selected as TIM1 clock + * @arg @ref RCC_TIM1CLK_PLLCLK PLL Clock selected as TIM1 clock + */ +#define __HAL_RCC_TIM1_CONFIG(__TIM1CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM1SW, (uint32_t)(__TIM1CLKSource__)) + +/** @brief Macro to get the TIM1 clock (TIM1CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM1CLK_HCLK HCLK selected as TIM1 clock + * @arg @ref RCC_TIM1CLK_PLLCLK PLL Clock selected as TIM1 clock + */ +#define __HAL_RCC_GET_TIM1_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM1SW))) +/** + * @} + */ + +/** @defgroup RCCEx_I2Sx_Clock_Config RCC Extended I2Sx Clock Config + * @{ + */ + +/** @brief Macro to configure the I2S clock source (I2SCLK). + * @note This function must be called before enabling the I2S APB clock. + * @param __I2SCLKSource__ specifies the I2S clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_I2SCLKSOURCE_SYSCLK SYSCLK clock used as I2S clock source + * @arg @ref RCC_I2SCLKSOURCE_EXT External clock mapped on the I2S_CKIN pin + * used as I2S clock source + */ +#define __HAL_RCC_I2S_CONFIG(__I2SCLKSource__) \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_I2SSRC, (uint32_t)(__I2SCLKSource__)) + +/** @brief Macro to get the I2S clock source (I2SCLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_I2SCLKSOURCE_SYSCLK SYSCLK clock used as I2S clock source + * @arg @ref RCC_I2SCLKSOURCE_EXT External clock mapped on the I2S_CKIN pin + * used as I2S clock source + */ +#define __HAL_RCC_GET_I2S_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_I2SSRC))) +/** + * @} + */ + +/** @defgroup RCCEx_UARTx_Clock_Config RCC Extended UARTx Clock Config + * @{ + */ + +/** @brief Macro to configure the UART4 clock (UART4CLK). + * @param __UART4CLKSource__ specifies the UART4 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_UART4CLKSOURCE_PCLK1 PCLK1 selected as UART4 clock + * @arg @ref RCC_UART4CLKSOURCE_HSI HSI selected as UART4 clock + * @arg @ref RCC_UART4CLKSOURCE_SYSCLK System Clock selected as UART4 clock + * @arg @ref RCC_UART4CLKSOURCE_LSE LSE selected as UART4 clock + */ +#define __HAL_RCC_UART4_CONFIG(__UART4CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_UART4SW, (uint32_t)(__UART4CLKSource__)) + +/** @brief Macro to get the UART4 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_UART4CLKSOURCE_PCLK1 PCLK1 selected as UART4 clock + * @arg @ref RCC_UART4CLKSOURCE_HSI HSI selected as UART4 clock + * @arg @ref RCC_UART4CLKSOURCE_SYSCLK System Clock selected as UART4 clock + * @arg @ref RCC_UART4CLKSOURCE_LSE LSE selected as UART4 clock + */ +#define __HAL_RCC_GET_UART4_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_UART4SW))) + +/** @brief Macro to configure the UART5 clock (UART5CLK). + * @param __UART5CLKSource__ specifies the UART5 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_UART5CLKSOURCE_PCLK1 PCLK1 selected as UART5 clock + * @arg @ref RCC_UART5CLKSOURCE_HSI HSI selected as UART5 clock + * @arg @ref RCC_UART5CLKSOURCE_SYSCLK System Clock selected as UART5 clock + * @arg @ref RCC_UART5CLKSOURCE_LSE LSE selected as UART5 clock + */ +#define __HAL_RCC_UART5_CONFIG(__UART5CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_UART5SW, (uint32_t)(__UART5CLKSource__)) + +/** @brief Macro to get the UART5 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_UART5CLKSOURCE_PCLK1 PCLK1 selected as UART5 clock + * @arg @ref RCC_UART5CLKSOURCE_HSI HSI selected as UART5 clock + * @arg @ref RCC_UART5CLKSOURCE_SYSCLK System Clock selected as UART5 clock + * @arg @ref RCC_UART5CLKSOURCE_LSE LSE selected as UART5 clock + */ +#define __HAL_RCC_GET_UART5_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_UART5SW))) +/** + * @} + */ +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) +/** @defgroup RCCEx_ADCx_Clock_Config RCC Extended ADCx Clock Config + * @{ + */ + +/** @brief Macro to configure the ADC3 & ADC4 clock (ADC34CLK). + * @param __ADC34CLKSource__ specifies the ADC3 & ADC4 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_ADC34PLLCLK_OFF ADC3 & ADC4 PLL clock disabled, ADC3 & ADC4 can use AHB clock + * @arg @ref RCC_ADC34PLLCLK_DIV1 PLL clock divided by 1 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV2 PLL clock divided by 2 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV4 PLL clock divided by 4 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV6 PLL clock divided by 6 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV8 PLL clock divided by 8 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV10 PLL clock divided by 10 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV12 PLL clock divided by 12 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV16 PLL clock divided by 16 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV32 PLL clock divided by 32 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV64 PLL clock divided by 64 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV128 PLL clock divided by 128 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV256 PLL clock divided by 256 selected as ADC3 & ADC4 clock + */ +#define __HAL_RCC_ADC34_CONFIG(__ADC34CLKSource__) \ + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_ADCPRE34, (uint32_t)(__ADC34CLKSource__)) + +/** @brief Macro to get the ADC3 & ADC4 clock + * @retval The clock source can be one of the following values: + * @arg @ref RCC_ADC34PLLCLK_OFF ADC3 & ADC4 PLL clock disabled, ADC3 & ADC4 can use AHB clock + * @arg @ref RCC_ADC34PLLCLK_DIV1 PLL clock divided by 1 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV2 PLL clock divided by 2 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV4 PLL clock divided by 4 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV6 PLL clock divided by 6 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV8 PLL clock divided by 8 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV10 PLL clock divided by 10 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV12 PLL clock divided by 12 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV16 PLL clock divided by 16 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV32 PLL clock divided by 32 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV64 PLL clock divided by 64 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV128 PLL clock divided by 128 selected as ADC3 & ADC4 clock + * @arg @ref RCC_ADC34PLLCLK_DIV256 PLL clock divided by 256 selected as ADC3 & ADC4 clock + */ +#define __HAL_RCC_GET_ADC34_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_ADCPRE34))) +/** + * @} + */ + +/** @defgroup RCCEx_TIMx_Clock_Config RCC Extended TIMx Clock Config + * @{ + */ + +/** @brief Macro to configure the TIM8 clock (TIM8CLK). + * @param __TIM8CLKSource__ specifies the TIM8 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM8CLK_HCLK HCLK selected as TIM8 clock + * @arg @ref RCC_TIM8CLK_PLLCLK PLL Clock selected as TIM8 clock + */ +#define __HAL_RCC_TIM8_CONFIG(__TIM8CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM8SW, (uint32_t)(__TIM8CLKSource__)) + +/** @brief Macro to get the TIM8 clock (TIM8CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM8CLK_HCLK HCLK selected as TIM8 clock + * @arg @ref RCC_TIM8CLK_PLLCLK PLL Clock selected as TIM8 clock + */ +#define __HAL_RCC_GET_TIM8_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM8SW))) + +/** + * @} + */ +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +/** @defgroup RCCEx_ADCx_Clock_Config RCC Extended ADCx Clock Config + * @{ + */ + +/** @brief Macro to configure the ADC1 & ADC2 clock (ADC12CLK). + * @param __ADC12CLKSource__ specifies the ADC1 & ADC2 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_ADC12PLLCLK_OFF ADC1 & ADC2 PLL clock disabled, ADC1 & ADC2 can use AHB clock + * @arg @ref RCC_ADC12PLLCLK_DIV1 PLL clock divided by 1 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV2 PLL clock divided by 2 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV4 PLL clock divided by 4 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV6 PLL clock divided by 6 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV8 PLL clock divided by 8 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV10 PLL clock divided by 10 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV12 PLL clock divided by 12 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV16 PLL clock divided by 16 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV32 PLL clock divided by 32 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV64 PLL clock divided by 64 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV128 PLL clock divided by 128 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV256 PLL clock divided by 256 selected as ADC1 & ADC2 clock + */ +#define __HAL_RCC_ADC12_CONFIG(__ADC12CLKSource__) \ + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_ADCPRE12, (uint32_t)(__ADC12CLKSource__)) + +/** @brief Macro to get the ADC1 & ADC2 clock + * @retval The clock source can be one of the following values: + * @arg @ref RCC_ADC12PLLCLK_OFF ADC1 & ADC2 PLL clock disabled, ADC1 & ADC2 can use AHB clock + * @arg @ref RCC_ADC12PLLCLK_DIV1 PLL clock divided by 1 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV2 PLL clock divided by 2 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV4 PLL clock divided by 4 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV6 PLL clock divided by 6 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV8 PLL clock divided by 8 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV10 PLL clock divided by 10 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV12 PLL clock divided by 12 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV16 PLL clock divided by 16 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV32 PLL clock divided by 32 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV64 PLL clock divided by 64 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV128 PLL clock divided by 128 selected as ADC1 & ADC2 clock + * @arg @ref RCC_ADC12PLLCLK_DIV256 PLL clock divided by 256 selected as ADC1 & ADC2 clock + */ +#define __HAL_RCC_GET_ADC12_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_ADCPRE12))) +/** + * @} + */ + +/** @defgroup RCCEx_TIMx_Clock_Config RCC Extended TIMx Clock Config + * @{ + */ +/** @brief Macro to configure the TIM1 clock (TIM1CLK). + * @param __TIM1CLKSource__ specifies the TIM1 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM1CLK_HCLK HCLK selected as TIM1 clock + * @arg @ref RCC_TIM1CLK_PLLCLK PLL Clock selected as TIM1 clock + */ +#define __HAL_RCC_TIM1_CONFIG(__TIM1CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM1SW, (uint32_t)(__TIM1CLKSource__)) + +/** @brief Macro to get the TIM1 clock (TIM1CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM1CLK_HCLK HCLK selected as TIM1 clock + * @arg @ref RCC_TIM1CLK_PLLCLK PLL Clock selected as TIM1 clock + */ +#define __HAL_RCC_GET_TIM1_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM1SW))) +/** + * @} + */ +#endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F334x8) +/** @defgroup RCCEx_HRTIMx_Clock_Config RCC Extended HRTIMx Clock Config + * @{ + */ +/** @brief Macro to configure the HRTIM1 clock. + * @param __HRTIM1CLKSource__ specifies the HRTIM1 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_HRTIM1CLK_HCLK HCLK selected as HRTIM1 clock + * @arg @ref RCC_HRTIM1CLK_PLLCLK PLL Clock selected as HRTIM1 clock + */ +#define __HAL_RCC_HRTIM1_CONFIG(__HRTIM1CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_HRTIM1SW, (uint32_t)(__HRTIM1CLKSource__)) + +/** @brief Macro to get the HRTIM1 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_HRTIM1CLK_HCLK HCLK selected as HRTIM1 clock + * @arg @ref RCC_HRTIM1CLK_PLLCLK PLL Clock selected as HRTIM1 clock + */ +#define __HAL_RCC_GET_HRTIM1_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_HRTIM1SW))) +/** + * @} + */ +#endif /* STM32F334x8 */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** @defgroup RCCEx_I2Cx_Clock_Config RCC Extended I2Cx Clock Config + * @{ + */ +/** @brief Macro to configure the I2C2 clock (I2C2CLK). + * @param __I2C2CLKSource__ specifies the I2C2 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_I2C2CLKSOURCE_HSI HSI selected as I2C2 clock + * @arg @ref RCC_I2C2CLKSOURCE_SYSCLK System Clock selected as I2C2 clock + */ +#define __HAL_RCC_I2C2_CONFIG(__I2C2CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_I2C2SW, (uint32_t)(__I2C2CLKSource__)) + +/** @brief Macro to get the I2C2 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_I2C2CLKSOURCE_HSI HSI selected as I2C2 clock + * @arg @ref RCC_I2C2CLKSOURCE_SYSCLK System Clock selected as I2C2 clock + */ +#define __HAL_RCC_GET_I2C2_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_I2C2SW))) +/** + * @} + */ + +/** @defgroup RCCEx_ADCx_Clock_Config RCC Extended ADCx Clock Config + * @{ + */ +/** @brief Macro to configure the ADC1 clock (ADC1CLK). + * @param __ADC1CLKSource__ specifies the ADC1 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_ADC1PCLK2_DIV2 PCLK2 clock divided by 2 selected as ADC1 clock + * @arg @ref RCC_ADC1PCLK2_DIV4 PCLK2 clock divided by 4 selected as ADC1 clock + * @arg @ref RCC_ADC1PCLK2_DIV6 PCLK2 clock divided by 6 selected as ADC1 clock + * @arg @ref RCC_ADC1PCLK2_DIV8 PCLK2 clock divided by 8 selected as ADC1 clock + */ +#define __HAL_RCC_ADC1_CONFIG(__ADC1CLKSource__) \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_ADCPRE, (uint32_t)(__ADC1CLKSource__)) + +/** @brief Macro to get the ADC1 clock (ADC1CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_ADC1PCLK2_DIV2 PCLK2 clock divided by 2 selected as ADC1 clock + * @arg @ref RCC_ADC1PCLK2_DIV4 PCLK2 clock divided by 4 selected as ADC1 clock + * @arg @ref RCC_ADC1PCLK2_DIV6 PCLK2 clock divided by 6 selected as ADC1 clock + * @arg @ref RCC_ADC1PCLK2_DIV8 PCLK2 clock divided by 8 selected as ADC1 clock + */ +#define __HAL_RCC_GET_ADC1_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_ADCPRE))) +/** + * @} + */ + +/** @defgroup RCCEx_SDADCx_Clock_Config RCC Extended SDADCx Clock Config + * @{ + */ +/** @brief Macro to configure the SDADCx clock (SDADCxCLK). + * @param __SDADCPrescaler__ specifies the SDADCx system clock prescaler. + * This parameter can be one of the following values: + * @arg @ref RCC_SDADCSYSCLK_DIV1 SYSCLK clock selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV2 SYSCLK clock divided by 2 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV4 SYSCLK clock divided by 4 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV6 SYSCLK clock divided by 6 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV8 SYSCLK clock divided by 8 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV10 SYSCLK clock divided by 10 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV12 SYSCLK clock divided by 12 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV14 SYSCLK clock divided by 14 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV16 SYSCLK clock divided by 16 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV20 SYSCLK clock divided by 20 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV24 SYSCLK clock divided by 24 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV28 SYSCLK clock divided by 28 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV32 SYSCLK clock divided by 32 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV36 SYSCLK clock divided by 36 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV40 SYSCLK clock divided by 40 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV44 SYSCLK clock divided by 44 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV48 SYSCLK clock divided by 48 selected as SDADCx clock + */ +#define __HAL_RCC_SDADC_CONFIG(__SDADCPrescaler__) \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_SDPRE, (uint32_t)(__SDADCPrescaler__)) + +/** @brief Macro to get the SDADCx clock prescaler. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_SDADCSYSCLK_DIV1 SYSCLK clock selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV2 SYSCLK clock divided by 2 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV4 SYSCLK clock divided by 4 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV6 SYSCLK clock divided by 6 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV8 SYSCLK clock divided by 8 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV10 SYSCLK clock divided by 10 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV12 SYSCLK clock divided by 12 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV14 SYSCLK clock divided by 14 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV16 SYSCLK clock divided by 16 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV20 SYSCLK clock divided by 20 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV24 SYSCLK clock divided by 24 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV28 SYSCLK clock divided by 28 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV32 SYSCLK clock divided by 32 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV36 SYSCLK clock divided by 36 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV40 SYSCLK clock divided by 40 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV44 SYSCLK clock divided by 44 selected as SDADCx clock + * @arg @ref RCC_SDADCSYSCLK_DIV48 SYSCLK clock divided by 48 selected as SDADCx clock + */ +#define __HAL_RCC_GET_SDADC_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_SDPRE))) +/** + * @} + */ + +/** @defgroup RCCEx_CECx_Clock_Config RCC Extended CECx Clock Config + * @{ + */ +/** @brief Macro to configure the CEC clock. + * @param __CECCLKSource__ specifies the CEC clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_CECCLKSOURCE_HSI HSI selected as CEC clock + * @arg @ref RCC_CECCLKSOURCE_LSE LSE selected as CEC clock + */ +#define __HAL_RCC_CEC_CONFIG(__CECCLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_CECSW, (uint32_t)(__CECCLKSource__)) + +/** @brief Macro to get the HDMI CEC clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_CECCLKSOURCE_HSI HSI selected as CEC clock + * @arg @ref RCC_CECCLKSOURCE_LSE LSE selected as CEC clock + */ +#define __HAL_RCC_GET_CEC_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_CECSW))) +/** + * @} + */ + +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE)\ + || defined(STM32F302xC) || defined(STM32F303xC)\ + || defined(STM32F302x8) \ + || defined(STM32F373xC) + +/** @defgroup RCCEx_USBx_Clock_Config RCC Extended USBx Clock Config + * @{ + */ +/** @brief Macro to configure the USB clock (USBCLK). + * @param __USBCLKSource__ specifies the USB clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_USBCLKSOURCE_PLL PLL Clock divided by 1 selected as USB clock + * @arg @ref RCC_USBCLKSOURCE_PLL_DIV1_5 PLL Clock divided by 1.5 selected as USB clock + */ +#define __HAL_RCC_USB_CONFIG(__USBCLKSource__) \ + MODIFY_REG(RCC->CFGR, RCC_CFGR_USBPRE, (uint32_t)(__USBCLKSource__)) + +/** @brief Macro to get the USB clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_USBCLKSOURCE_PLL PLL Clock divided by 1 selected as USB clock + * @arg @ref RCC_USBCLKSOURCE_PLL_DIV1_5 PLL Clock divided by 1.5 selected as USB clock + */ +#define __HAL_RCC_GET_USB_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_USBPRE))) +/** + * @} + */ + +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F302x8 || */ + /* STM32F373xC */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) + +/** @defgroup RCCEx_I2Cx_Clock_Config RCC Extended I2Cx Clock Config + * @{ + */ +/** @brief Macro to configure the I2C3 clock (I2C3CLK). + * @param __I2C3CLKSource__ specifies the I2C3 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_I2C3CLKSOURCE_HSI HSI selected as I2C3 clock + * @arg @ref RCC_I2C3CLKSOURCE_SYSCLK System Clock selected as I2C3 clock + */ +#define __HAL_RCC_I2C3_CONFIG(__I2C3CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_I2C3SW, (uint32_t)(__I2C3CLKSource__)) + +/** @brief Macro to get the I2C3 clock source. + * @retval The clock source can be one of the following values: + * @arg @ref RCC_I2C3CLKSOURCE_HSI HSI selected as I2C3 clock + * @arg @ref RCC_I2C3CLKSOURCE_SYSCLK System Clock selected as I2C3 clock + */ +#define __HAL_RCC_GET_I2C3_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_I2C3SW))) +/** + * @} + */ + +/** @defgroup RCCEx_TIMx_Clock_Config RCC Extended TIMx Clock Config + * @{ + */ +/** @brief Macro to configure the TIM2 clock (TIM2CLK). + * @param __TIM2CLKSource__ specifies the TIM2 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM2CLK_HCLK HCLK selected as TIM2 clock + * @arg @ref RCC_TIM2CLK_PLL PLL Clock selected as TIM2 clock + */ +#define __HAL_RCC_TIM2_CONFIG(__TIM2CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM2SW, (uint32_t)(__TIM2CLKSource__)) + +/** @brief Macro to get the TIM2 clock (TIM2CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM2CLK_HCLK HCLK selected as TIM2 clock + * @arg @ref RCC_TIM2CLK_PLL PLL Clock selected as TIM2 clock + */ +#define __HAL_RCC_GET_TIM2_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM2SW))) + +/** @brief Macro to configure the TIM3 & TIM4 clock (TIM34CLK). + * @param __TIM34CLKSource__ specifies the TIM3 & TIM4 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM34CLK_HCLK HCLK selected as TIM3 & TIM4 clock + * @arg @ref RCC_TIM34CLK_PLL PLL Clock selected as TIM3 & TIM4 clock + */ +#define __HAL_RCC_TIM34_CONFIG(__TIM34CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM34SW, (uint32_t)(__TIM34CLKSource__)) + +/** @brief Macro to get the TIM3 & TIM4 clock (TIM34CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM34CLK_HCLK HCLK selected as TIM3 & TIM4 clock + * @arg @ref RCC_TIM34CLK_PLL PLL Clock selected as TIM3 & TIM4 clock + */ +#define __HAL_RCC_GET_TIM34_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM34SW))) + +/** @brief Macro to configure the TIM15 clock (TIM15CLK). + * @param __TIM15CLKSource__ specifies the TIM15 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM15CLK_HCLK HCLK selected as TIM15 clock + * @arg @ref RCC_TIM15CLK_PLL PLL Clock selected as TIM15 clock + */ +#define __HAL_RCC_TIM15_CONFIG(__TIM15CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM15SW, (uint32_t)(__TIM15CLKSource__)) + +/** @brief Macro to get the TIM15 clock (TIM15CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM15CLK_HCLK HCLK selected as TIM15 clock + * @arg @ref RCC_TIM15CLK_PLL PLL Clock selected as TIM15 clock + */ +#define __HAL_RCC_GET_TIM15_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM15SW))) + +/** @brief Macro to configure the TIM16 clock (TIM16CLK). + * @param __TIM16CLKSource__ specifies the TIM16 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM16CLK_HCLK HCLK selected as TIM16 clock + * @arg @ref RCC_TIM16CLK_PLL PLL Clock selected as TIM16 clock + */ +#define __HAL_RCC_TIM16_CONFIG(__TIM16CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM16SW, (uint32_t)(__TIM16CLKSource__)) + +/** @brief Macro to get the TIM16 clock (TIM16CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM16CLK_HCLK HCLK selected as TIM16 clock + * @arg @ref RCC_TIM16CLK_PLL PLL Clock selected as TIM16 clock + */ +#define __HAL_RCC_GET_TIM16_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM16SW))) + +/** @brief Macro to configure the TIM17 clock (TIM17CLK). + * @param __TIM17CLKSource__ specifies the TIM17 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM17CLK_HCLK HCLK selected as TIM17 clock + * @arg @ref RCC_TIM17CLK_PLL PLL Clock selected as TIM17 clock + */ +#define __HAL_RCC_TIM17_CONFIG(__TIM17CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM17SW, (uint32_t)(__TIM17CLKSource__)) + +/** @brief Macro to get the TIM17 clock (TIM17CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM17CLK_HCLK HCLK selected as TIM17 clock + * @arg @ref RCC_TIM17CLK_PLL PLL Clock selected as TIM17 clock + */ +#define __HAL_RCC_GET_TIM17_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM17SW))) + +/** + * @} + */ + +#endif /* STM32f302xE || STM32f303xE || STM32F398xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) +/** @addtogroup RCCEx_TIMx_Clock_Config RCC Extended TIMx Clock Config + * @{ + */ +/** @brief Macro to configure the TIM20 clock (TIM20CLK). + * @param __TIM20CLKSource__ specifies the TIM20 clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_TIM20CLK_HCLK HCLK selected as TIM20 clock + * @arg @ref RCC_TIM20CLK_PLL PLL Clock selected as TIM20 clock + */ +#define __HAL_RCC_TIM20_CONFIG(__TIM20CLKSource__) \ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_TIM20SW, (uint32_t)(__TIM20CLKSource__)) + +/** @brief Macro to get the TIM20 clock (TIM20CLK). + * @retval The clock source can be one of the following values: + * @arg @ref RCC_TIM20CLK_HCLK HCLK selected as TIM20 clock + * @arg @ref RCC_TIM20CLK_PLL PLL Clock selected as TIM20 clock + */ +#define __HAL_RCC_GET_TIM20_SOURCE() ((uint32_t)(READ_BIT(RCC->CFGR3, RCC_CFGR3_TIM20SW))) + +/** + * @} + */ +#endif /* STM32f303xE || STM32F398xx */ + +/** @defgroup RCCEx_LSE_Configuration LSE Drive Configuration + * @{ + */ + +/** + * @brief Macro to configure the External Low Speed oscillator (LSE) drive capability. + * @param __RCC_LSEDRIVE__ specifies the new state of the LSE drive capability. + * This parameter can be one of the following values: + * @arg @ref RCC_LSEDRIVE_LOW LSE oscillator low drive capability. + * @arg @ref RCC_LSEDRIVE_MEDIUMLOW LSE oscillator medium low drive capability. + * @arg @ref RCC_LSEDRIVE_MEDIUMHIGH LSE oscillator medium high drive capability. + * @arg @ref RCC_LSEDRIVE_HIGH LSE oscillator high drive capability. + * @retval None + */ +#define __HAL_RCC_LSEDRIVE_CONFIG(__RCC_LSEDRIVE__) (MODIFY_REG(RCC->BDCR,\ + RCC_BDCR_LSEDRV, (uint32_t)(__RCC_LSEDRIVE__) )) + +/** + * @} + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup RCCEx_Exported_Functions + * @{ + */ + +/** @addtogroup RCCEx_Exported_Functions_Group1 + * @{ + */ + +HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit); +void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit); +uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk); + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_HAL_RCC_EX_H */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h new file mode 100644 index 0000000..2a782c5 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h @@ -0,0 +1,2559 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_tim.h + * @author MCD Application Team + * @brief Header file of TIM HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_HAL_TIM_H +#define STM32F3xx_HAL_TIM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup TIM + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup TIM_Exported_Types TIM Exported Types + * @{ + */ + +/** + * @brief TIM Time base Configuration Structure definition + */ +typedef struct +{ + uint32_t Prescaler; /*!< Specifies the prescaler value used to divide the TIM clock. + This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ + + uint32_t CounterMode; /*!< Specifies the counter mode. + This parameter can be a value of @ref TIM_Counter_Mode */ + + uint32_t Period; /*!< Specifies the period value to be loaded into the active + Auto-Reload Register at the next update event. + This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. */ + + uint32_t ClockDivision; /*!< Specifies the clock division. + This parameter can be a value of @ref TIM_ClockDivision */ + + uint32_t RepetitionCounter; /*!< Specifies the repetition counter value. Each time the RCR downcounter + reaches zero, an update event is generated and counting restarts + from the RCR value (N). + This means in PWM mode that (N+1) corresponds to: + - the number of PWM periods in edge-aligned mode + - the number of half PWM period in center-aligned mode + GP timers: this parameter must be a number between Min_Data = 0x00 and + Max_Data = 0xFF. + Advanced timers: this parameter must be a number between Min_Data = 0x0000 and + Max_Data = 0xFFFF. */ + + uint32_t AutoReloadPreload; /*!< Specifies the auto-reload preload. + This parameter can be a value of @ref TIM_AutoReloadPreload */ +} TIM_Base_InitTypeDef; + +/** + * @brief TIM Output Compare Configuration Structure definition + */ +typedef struct +{ + uint32_t OCMode; /*!< Specifies the TIM mode. + This parameter can be a value of @ref TIM_Output_Compare_and_PWM_modes */ + + uint32_t Pulse; /*!< Specifies the pulse value to be loaded into the Capture Compare Register. + This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ + + uint32_t OCPolarity; /*!< Specifies the output polarity. + This parameter can be a value of @ref TIM_Output_Compare_Polarity */ + + uint32_t OCNPolarity; /*!< Specifies the complementary output polarity. + This parameter can be a value of @ref TIM_Output_Compare_N_Polarity + @note This parameter is valid only for timer instances supporting break feature. */ + + uint32_t OCFastMode; /*!< Specifies the Fast mode state. + This parameter can be a value of @ref TIM_Output_Fast_State + @note This parameter is valid only in PWM1 and PWM2 mode. */ + + + uint32_t OCIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state. + This parameter can be a value of @ref TIM_Output_Compare_Idle_State + @note This parameter is valid only for timer instances supporting break feature. */ + + uint32_t OCNIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state. + This parameter can be a value of @ref TIM_Output_Compare_N_Idle_State + @note This parameter is valid only for timer instances supporting break feature. */ +} TIM_OC_InitTypeDef; + +/** + * @brief TIM One Pulse Mode Configuration Structure definition + */ +typedef struct +{ + uint32_t OCMode; /*!< Specifies the TIM mode. + This parameter can be a value of @ref TIM_Output_Compare_and_PWM_modes */ + + uint32_t Pulse; /*!< Specifies the pulse value to be loaded into the Capture Compare Register. + This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ + + uint32_t OCPolarity; /*!< Specifies the output polarity. + This parameter can be a value of @ref TIM_Output_Compare_Polarity */ + + uint32_t OCNPolarity; /*!< Specifies the complementary output polarity. + This parameter can be a value of @ref TIM_Output_Compare_N_Polarity + @note This parameter is valid only for timer instances supporting break feature. */ + + uint32_t OCIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state. + This parameter can be a value of @ref TIM_Output_Compare_Idle_State + @note This parameter is valid only for timer instances supporting break feature. */ + + uint32_t OCNIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state. + This parameter can be a value of @ref TIM_Output_Compare_N_Idle_State + @note This parameter is valid only for timer instances supporting break feature. */ + + uint32_t ICPolarity; /*!< Specifies the active edge of the input signal. + This parameter can be a value of @ref TIM_Input_Capture_Polarity */ + + uint32_t ICSelection; /*!< Specifies the input. + This parameter can be a value of @ref TIM_Input_Capture_Selection */ + + uint32_t ICFilter; /*!< Specifies the input capture filter. + This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ +} TIM_OnePulse_InitTypeDef; + +/** + * @brief TIM Input Capture Configuration Structure definition + */ +typedef struct +{ + uint32_t ICPolarity; /*!< Specifies the active edge of the input signal. + This parameter can be a value of @ref TIM_Input_Capture_Polarity */ + + uint32_t ICSelection; /*!< Specifies the input. + This parameter can be a value of @ref TIM_Input_Capture_Selection */ + + uint32_t ICPrescaler; /*!< Specifies the Input Capture Prescaler. + This parameter can be a value of @ref TIM_Input_Capture_Prescaler */ + + uint32_t ICFilter; /*!< Specifies the input capture filter. + This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ +} TIM_IC_InitTypeDef; + +/** + * @brief TIM Encoder Configuration Structure definition + */ +typedef struct +{ + uint32_t EncoderMode; /*!< Specifies the active edge of the input signal. + This parameter can be a value of @ref TIM_Encoder_Mode */ + + uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal. + This parameter can be a value of @ref TIM_Encoder_Input_Polarity */ + + uint32_t IC1Selection; /*!< Specifies the input. + This parameter can be a value of @ref TIM_Input_Capture_Selection */ + + uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler. + This parameter can be a value of @ref TIM_Input_Capture_Prescaler */ + + uint32_t IC1Filter; /*!< Specifies the input capture filter. + This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ + + uint32_t IC2Polarity; /*!< Specifies the active edge of the input signal. + This parameter can be a value of @ref TIM_Encoder_Input_Polarity */ + + uint32_t IC2Selection; /*!< Specifies the input. + This parameter can be a value of @ref TIM_Input_Capture_Selection */ + + uint32_t IC2Prescaler; /*!< Specifies the Input Capture Prescaler. + This parameter can be a value of @ref TIM_Input_Capture_Prescaler */ + + uint32_t IC2Filter; /*!< Specifies the input capture filter. + This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ +} TIM_Encoder_InitTypeDef; + +/** + * @brief Clock Configuration Handle Structure definition + */ +typedef struct +{ + uint32_t ClockSource; /*!< TIM clock sources + This parameter can be a value of @ref TIM_Clock_Source */ + uint32_t ClockPolarity; /*!< TIM clock polarity + This parameter can be a value of @ref TIM_Clock_Polarity */ + uint32_t ClockPrescaler; /*!< TIM clock prescaler + This parameter can be a value of @ref TIM_Clock_Prescaler */ + uint32_t ClockFilter; /*!< TIM clock filter + This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ +} TIM_ClockConfigTypeDef; + +/** + * @brief TIM Clear Input Configuration Handle Structure definition + */ +typedef struct +{ + uint32_t ClearInputState; /*!< TIM clear Input state + This parameter can be ENABLE or DISABLE */ + uint32_t ClearInputSource; /*!< TIM clear Input sources + This parameter can be a value of @ref TIM_ClearInput_Source */ + uint32_t ClearInputPolarity; /*!< TIM Clear Input polarity + This parameter can be a value of @ref TIM_ClearInput_Polarity */ + uint32_t ClearInputPrescaler; /*!< TIM Clear Input prescaler + This parameter must be 0: When OCRef clear feature is used with ETR source, + ETR prescaler must be off */ + uint32_t ClearInputFilter; /*!< TIM Clear Input filter + This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ +} TIM_ClearInputConfigTypeDef; + +/** + * @brief TIM Master configuration Structure definition + * @note Advanced timers provide TRGO2 internal line which is redirected + * to the ADC + */ +typedef struct +{ + uint32_t MasterOutputTrigger; /*!< Trigger output (TRGO) selection + This parameter can be a value of @ref TIM_Master_Mode_Selection */ +#if defined(TIM_CR2_MMS2) + uint32_t MasterOutputTrigger2; /*!< Trigger output2 (TRGO2) selection + This parameter can be a value of @ref TIM_Master_Mode_Selection_2 */ +#endif /* TIM_CR2_MMS2 */ + uint32_t MasterSlaveMode; /*!< Master/slave mode selection + This parameter can be a value of @ref TIM_Master_Slave_Mode + @note When the Master/slave mode is enabled, the effect of + an event on the trigger input (TRGI) is delayed to allow a + perfect synchronization between the current timer and its + slaves (through TRGO). It is not mandatory in case of timer + synchronization mode. */ +} TIM_MasterConfigTypeDef; + +/** + * @brief TIM Slave configuration Structure definition + */ +typedef struct +{ + uint32_t SlaveMode; /*!< Slave mode selection + This parameter can be a value of @ref TIM_Slave_Mode */ + uint32_t InputTrigger; /*!< Input Trigger source + This parameter can be a value of @ref TIM_Trigger_Selection */ + uint32_t TriggerPolarity; /*!< Input Trigger polarity + This parameter can be a value of @ref TIM_Trigger_Polarity */ + uint32_t TriggerPrescaler; /*!< Input trigger prescaler + This parameter can be a value of @ref TIM_Trigger_Prescaler */ + uint32_t TriggerFilter; /*!< Input trigger filter + This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ + +} TIM_SlaveConfigTypeDef; + +/** + * @brief TIM Break input(s) and Dead time configuration Structure definition + * @note 2 break inputs can be configured (BKIN and BKIN2) with configurable + * filter and polarity. + */ +typedef struct +{ + uint32_t OffStateRunMode; /*!< TIM off state in run mode, This parameter can be a value of @ref TIM_OSSR_Off_State_Selection_for_Run_mode_state */ + + uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode, This parameter can be a value of @ref TIM_OSSI_Off_State_Selection_for_Idle_mode_state */ + + uint32_t LockLevel; /*!< TIM Lock level, This parameter can be a value of @ref TIM_Lock_level */ + + uint32_t DeadTime; /*!< TIM dead Time, This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF */ + + uint32_t BreakState; /*!< TIM Break State, This parameter can be a value of @ref TIM_Break_Input_enable_disable */ + + uint32_t BreakPolarity; /*!< TIM Break input polarity, This parameter can be a value of @ref TIM_Break_Polarity */ + + uint32_t BreakFilter; /*!< Specifies the break input filter.This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ + +#if defined(TIM_BDTR_BK2E) + uint32_t Break2State; /*!< TIM Break2 State, This parameter can be a value of @ref TIM_Break2_Input_enable_disable */ + + uint32_t Break2Polarity; /*!< TIM Break2 input polarity, This parameter can be a value of @ref TIM_Break2_Polarity */ + + uint32_t Break2Filter; /*!< TIM break2 input filter.This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ + +#endif /*TIM_BDTR_BK2E */ + uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state, This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */ + +} TIM_BreakDeadTimeConfigTypeDef; + +/** + * @brief HAL State structures definition + */ +typedef enum +{ + HAL_TIM_STATE_RESET = 0x00U, /*!< Peripheral not yet initialized or disabled */ + HAL_TIM_STATE_READY = 0x01U, /*!< Peripheral Initialized and ready for use */ + HAL_TIM_STATE_BUSY = 0x02U, /*!< An internal process is ongoing */ + HAL_TIM_STATE_TIMEOUT = 0x03U, /*!< Timeout state */ + HAL_TIM_STATE_ERROR = 0x04U /*!< Reception process is ongoing */ +} HAL_TIM_StateTypeDef; + +/** + * @brief TIM Channel States definition + */ +typedef enum +{ + HAL_TIM_CHANNEL_STATE_RESET = 0x00U, /*!< TIM Channel initial state */ + HAL_TIM_CHANNEL_STATE_READY = 0x01U, /*!< TIM Channel ready for use */ + HAL_TIM_CHANNEL_STATE_BUSY = 0x02U, /*!< An internal process is ongoing on the TIM channel */ +} HAL_TIM_ChannelStateTypeDef; + +/** + * @brief DMA Burst States definition + */ +typedef enum +{ + HAL_DMA_BURST_STATE_RESET = 0x00U, /*!< DMA Burst initial state */ + HAL_DMA_BURST_STATE_READY = 0x01U, /*!< DMA Burst ready for use */ + HAL_DMA_BURST_STATE_BUSY = 0x02U, /*!< Ongoing DMA Burst */ +} HAL_TIM_DMABurstStateTypeDef; + +/** + * @brief HAL Active channel structures definition + */ +typedef enum +{ + HAL_TIM_ACTIVE_CHANNEL_1 = 0x01U, /*!< The active channel is 1 */ + HAL_TIM_ACTIVE_CHANNEL_2 = 0x02U, /*!< The active channel is 2 */ + HAL_TIM_ACTIVE_CHANNEL_3 = 0x04U, /*!< The active channel is 3 */ + HAL_TIM_ACTIVE_CHANNEL_4 = 0x08U, /*!< The active channel is 4 */ +#if defined(TIM_CCER_CC5E) + HAL_TIM_ACTIVE_CHANNEL_5 = 0x10U, /*!< The active channel is 5 */ +#endif /* TIM_CCER_CC5E */ +#if defined(TIM_CCER_CC6E) + HAL_TIM_ACTIVE_CHANNEL_6 = 0x20U, /*!< The active channel is 6 */ +#endif /* TIM_CCER_CC6E */ + HAL_TIM_ACTIVE_CHANNEL_CLEARED = 0x00U /*!< All active channels cleared */ +} HAL_TIM_ActiveChannel; + +/** + * @brief TIM Time Base Handle Structure definition + */ +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) +typedef struct __TIM_HandleTypeDef +#else +typedef struct +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +{ + TIM_TypeDef *Instance; /*!< Register base address */ + TIM_Base_InitTypeDef Init; /*!< TIM Time Base required parameters */ + HAL_TIM_ActiveChannel Channel; /*!< Active channel */ + DMA_HandleTypeDef *hdma[7]; /*!< DMA Handlers array + This array is accessed by a @ref DMA_Handle_index */ + HAL_LockTypeDef Lock; /*!< Locking object */ + __IO HAL_TIM_StateTypeDef State; /*!< TIM operation state */ + __IO HAL_TIM_ChannelStateTypeDef ChannelState[6]; /*!< TIM channel operation state */ + __IO HAL_TIM_ChannelStateTypeDef ChannelNState[4]; /*!< TIM complementary channel operation state */ + __IO HAL_TIM_DMABurstStateTypeDef DMABurstState; /*!< DMA burst operation state */ + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + void (* Base_MspInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Base Msp Init Callback */ + void (* Base_MspDeInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Base Msp DeInit Callback */ + void (* IC_MspInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM IC Msp Init Callback */ + void (* IC_MspDeInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM IC Msp DeInit Callback */ + void (* OC_MspInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM OC Msp Init Callback */ + void (* OC_MspDeInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM OC Msp DeInit Callback */ + void (* PWM_MspInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM PWM Msp Init Callback */ + void (* PWM_MspDeInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM PWM Msp DeInit Callback */ + void (* OnePulse_MspInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM One Pulse Msp Init Callback */ + void (* OnePulse_MspDeInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM One Pulse Msp DeInit Callback */ + void (* Encoder_MspInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Encoder Msp Init Callback */ + void (* Encoder_MspDeInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Encoder Msp DeInit Callback */ + void (* HallSensor_MspInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Hall Sensor Msp Init Callback */ + void (* HallSensor_MspDeInitCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Hall Sensor Msp DeInit Callback */ + void (* PeriodElapsedCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Period Elapsed Callback */ + void (* PeriodElapsedHalfCpltCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Period Elapsed half complete Callback */ + void (* TriggerCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Trigger Callback */ + void (* TriggerHalfCpltCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Trigger half complete Callback */ + void (* IC_CaptureCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Input Capture Callback */ + void (* IC_CaptureHalfCpltCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Input Capture half complete Callback */ + void (* OC_DelayElapsedCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Output Compare Delay Elapsed Callback */ + void (* PWM_PulseFinishedCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM PWM Pulse Finished Callback */ + void (* PWM_PulseFinishedHalfCpltCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM PWM Pulse Finished half complete Callback */ + void (* ErrorCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Error Callback */ + void (* CommutationCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Commutation Callback */ + void (* CommutationHalfCpltCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Commutation half complete Callback */ + void (* BreakCallback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Break Callback */ +#if defined(TIM_BDTR_BK2E) + void (* Break2Callback)(struct __TIM_HandleTypeDef *htim); /*!< TIM Break2 Callback */ +#endif /* */ +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +} TIM_HandleTypeDef; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) +/** + * @brief HAL TIM Callback ID enumeration definition + */ +typedef enum +{ + HAL_TIM_BASE_MSPINIT_CB_ID = 0x00U /*!< TIM Base MspInit Callback ID */ + , HAL_TIM_BASE_MSPDEINIT_CB_ID = 0x01U /*!< TIM Base MspDeInit Callback ID */ + , HAL_TIM_IC_MSPINIT_CB_ID = 0x02U /*!< TIM IC MspInit Callback ID */ + , HAL_TIM_IC_MSPDEINIT_CB_ID = 0x03U /*!< TIM IC MspDeInit Callback ID */ + , HAL_TIM_OC_MSPINIT_CB_ID = 0x04U /*!< TIM OC MspInit Callback ID */ + , HAL_TIM_OC_MSPDEINIT_CB_ID = 0x05U /*!< TIM OC MspDeInit Callback ID */ + , HAL_TIM_PWM_MSPINIT_CB_ID = 0x06U /*!< TIM PWM MspInit Callback ID */ + , HAL_TIM_PWM_MSPDEINIT_CB_ID = 0x07U /*!< TIM PWM MspDeInit Callback ID */ + , HAL_TIM_ONE_PULSE_MSPINIT_CB_ID = 0x08U /*!< TIM One Pulse MspInit Callback ID */ + , HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID = 0x09U /*!< TIM One Pulse MspDeInit Callback ID */ + , HAL_TIM_ENCODER_MSPINIT_CB_ID = 0x0AU /*!< TIM Encoder MspInit Callback ID */ + , HAL_TIM_ENCODER_MSPDEINIT_CB_ID = 0x0BU /*!< TIM Encoder MspDeInit Callback ID */ + , HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID = 0x0CU /*!< TIM Hall Sensor MspDeInit Callback ID */ + , HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID = 0x0DU /*!< TIM Hall Sensor MspDeInit Callback ID */ + , HAL_TIM_PERIOD_ELAPSED_CB_ID = 0x0EU /*!< TIM Period Elapsed Callback ID */ + , HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID = 0x0FU /*!< TIM Period Elapsed half complete Callback ID */ + , HAL_TIM_TRIGGER_CB_ID = 0x10U /*!< TIM Trigger Callback ID */ + , HAL_TIM_TRIGGER_HALF_CB_ID = 0x11U /*!< TIM Trigger half complete Callback ID */ + + , HAL_TIM_IC_CAPTURE_CB_ID = 0x12U /*!< TIM Input Capture Callback ID */ + , HAL_TIM_IC_CAPTURE_HALF_CB_ID = 0x13U /*!< TIM Input Capture half complete Callback ID */ + , HAL_TIM_OC_DELAY_ELAPSED_CB_ID = 0x14U /*!< TIM Output Compare Delay Elapsed Callback ID */ + , HAL_TIM_PWM_PULSE_FINISHED_CB_ID = 0x15U /*!< TIM PWM Pulse Finished Callback ID */ + , HAL_TIM_PWM_PULSE_FINISHED_HALF_CB_ID = 0x16U /*!< TIM PWM Pulse Finished half complete Callback ID */ + , HAL_TIM_ERROR_CB_ID = 0x17U /*!< TIM Error Callback ID */ + , HAL_TIM_COMMUTATION_CB_ID = 0x18U /*!< TIM Commutation Callback ID */ + , HAL_TIM_COMMUTATION_HALF_CB_ID = 0x19U /*!< TIM Commutation half complete Callback ID */ + , HAL_TIM_BREAK_CB_ID = 0x1AU /*!< TIM Break Callback ID */ +#if defined(TIM_BDTR_BK2E) + , HAL_TIM_BREAK2_CB_ID = 0x1BU /*!< TIM Break2 Callback ID */ +#endif /* TIM_BDTR_BK2E */ +} HAL_TIM_CallbackIDTypeDef; + +/** + * @brief HAL TIM Callback pointer definition + */ +typedef void (*pTIM_CallbackTypeDef)(TIM_HandleTypeDef *htim); /*!< pointer to the TIM callback function */ + +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + +/** + * @} + */ +/* End of exported types -----------------------------------------------------*/ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup TIM_Exported_Constants TIM Exported Constants + * @{ + */ + +/** @defgroup TIM_ClearInput_Source TIM Clear Input Source + * @{ + */ +#define TIM_CLEARINPUTSOURCE_NONE 0x00000000U /*!< OCREF_CLR is disabled */ +#define TIM_CLEARINPUTSOURCE_ETR 0x00000001U /*!< OCREF_CLR is connected to ETRF input */ +#if defined(TIM_SMCR_OCCS) +#define TIM_CLEARINPUTSOURCE_OCREFCLR 0x00000002U /*!< OCREF_CLR is connected to OCREF_CLR_INT */ +#endif /* TIM_SMCR_OCCS */ +/** + * @} + */ + +/** @defgroup TIM_DMA_Base_address TIM DMA Base Address + * @{ + */ +#define TIM_DMABASE_CR1 0x00000000U +#define TIM_DMABASE_CR2 0x00000001U +#define TIM_DMABASE_SMCR 0x00000002U +#define TIM_DMABASE_DIER 0x00000003U +#define TIM_DMABASE_SR 0x00000004U +#define TIM_DMABASE_EGR 0x00000005U +#define TIM_DMABASE_CCMR1 0x00000006U +#define TIM_DMABASE_CCMR2 0x00000007U +#define TIM_DMABASE_CCER 0x00000008U +#define TIM_DMABASE_CNT 0x00000009U +#define TIM_DMABASE_PSC 0x0000000AU +#define TIM_DMABASE_ARR 0x0000000BU +#define TIM_DMABASE_RCR 0x0000000CU +#define TIM_DMABASE_CCR1 0x0000000DU +#define TIM_DMABASE_CCR2 0x0000000EU +#define TIM_DMABASE_CCR3 0x0000000FU +#define TIM_DMABASE_CCR4 0x00000010U +#define TIM_DMABASE_BDTR 0x00000011U +#define TIM_DMABASE_DCR 0x00000012U +#define TIM_DMABASE_DMAR 0x00000013U +#define TIM_DMABASE_OR 0x00000014U +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define TIM_DMABASE_CCMR3 0x00000015U +#define TIM_DMABASE_CCR5 0x00000016U +#define TIM_DMABASE_CCR6 0x00000017U +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ +/** + * @} + */ + +/** @defgroup TIM_Event_Source TIM Event Source + * @{ + */ +#define TIM_EVENTSOURCE_UPDATE TIM_EGR_UG /*!< Reinitialize the counter and generates an update of the registers */ +#define TIM_EVENTSOURCE_CC1 TIM_EGR_CC1G /*!< A capture/compare event is generated on channel 1 */ +#define TIM_EVENTSOURCE_CC2 TIM_EGR_CC2G /*!< A capture/compare event is generated on channel 2 */ +#define TIM_EVENTSOURCE_CC3 TIM_EGR_CC3G /*!< A capture/compare event is generated on channel 3 */ +#define TIM_EVENTSOURCE_CC4 TIM_EGR_CC4G /*!< A capture/compare event is generated on channel 4 */ +#define TIM_EVENTSOURCE_COM TIM_EGR_COMG /*!< A commutation event is generated */ +#define TIM_EVENTSOURCE_TRIGGER TIM_EGR_TG /*!< A trigger event is generated */ +#define TIM_EVENTSOURCE_BREAK TIM_EGR_BG /*!< A break event is generated */ +#if defined(TIM_EGR_B2G) +#define TIM_EVENTSOURCE_BREAK2 TIM_EGR_B2G /*!< A break 2 event is generated */ +#endif /* TIM_EGR_B2G */ +/** + * @} + */ + +/** @defgroup TIM_Input_Channel_Polarity TIM Input Channel polarity + * @{ + */ +#define TIM_INPUTCHANNELPOLARITY_RISING 0x00000000U /*!< Polarity for TIx source */ +#define TIM_INPUTCHANNELPOLARITY_FALLING TIM_CCER_CC1P /*!< Polarity for TIx source */ +#define TIM_INPUTCHANNELPOLARITY_BOTHEDGE (TIM_CCER_CC1P | TIM_CCER_CC1NP) /*!< Polarity for TIx source */ +/** + * @} + */ + +/** @defgroup TIM_ETR_Polarity TIM ETR Polarity + * @{ + */ +#define TIM_ETRPOLARITY_INVERTED TIM_SMCR_ETP /*!< Polarity for ETR source */ +#define TIM_ETRPOLARITY_NONINVERTED 0x00000000U /*!< Polarity for ETR source */ +/** + * @} + */ + +/** @defgroup TIM_ETR_Prescaler TIM ETR Prescaler + * @{ + */ +#define TIM_ETRPRESCALER_DIV1 0x00000000U /*!< No prescaler is used */ +#define TIM_ETRPRESCALER_DIV2 TIM_SMCR_ETPS_0 /*!< ETR input source is divided by 2 */ +#define TIM_ETRPRESCALER_DIV4 TIM_SMCR_ETPS_1 /*!< ETR input source is divided by 4 */ +#define TIM_ETRPRESCALER_DIV8 TIM_SMCR_ETPS /*!< ETR input source is divided by 8 */ +/** + * @} + */ + +/** @defgroup TIM_Counter_Mode TIM Counter Mode + * @{ + */ +#define TIM_COUNTERMODE_UP 0x00000000U /*!< Counter used as up-counter */ +#define TIM_COUNTERMODE_DOWN TIM_CR1_DIR /*!< Counter used as down-counter */ +#define TIM_COUNTERMODE_CENTERALIGNED1 TIM_CR1_CMS_0 /*!< Center-aligned mode 1 */ +#define TIM_COUNTERMODE_CENTERALIGNED2 TIM_CR1_CMS_1 /*!< Center-aligned mode 2 */ +#define TIM_COUNTERMODE_CENTERALIGNED3 TIM_CR1_CMS /*!< Center-aligned mode 3 */ +/** + * @} + */ + +#if defined(TIM_CR1_UIFREMAP) +/** @defgroup TIM_Update_Interrupt_Flag_Remap TIM Update Interrupt Flag Remap + * @{ + */ +#define TIM_UIFREMAP_DISABLE 0x00000000U /*!< Update interrupt flag remap disabled */ +#define TIM_UIFREMAP_ENABLE TIM_CR1_UIFREMAP /*!< Update interrupt flag remap enabled */ +/** + * @} + */ + +#endif /* TIM_CR1_UIFREMAP */ +/** @defgroup TIM_ClockDivision TIM Clock Division + * @{ + */ +#define TIM_CLOCKDIVISION_DIV1 0x00000000U /*!< Clock division: tDTS=tCK_INT */ +#define TIM_CLOCKDIVISION_DIV2 TIM_CR1_CKD_0 /*!< Clock division: tDTS=2*tCK_INT */ +#define TIM_CLOCKDIVISION_DIV4 TIM_CR1_CKD_1 /*!< Clock division: tDTS=4*tCK_INT */ +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_State TIM Output Compare State + * @{ + */ +#define TIM_OUTPUTSTATE_DISABLE 0x00000000U /*!< Capture/Compare 1 output disabled */ +#define TIM_OUTPUTSTATE_ENABLE TIM_CCER_CC1E /*!< Capture/Compare 1 output enabled */ +/** + * @} + */ + +/** @defgroup TIM_AutoReloadPreload TIM Auto-Reload Preload + * @{ + */ +#define TIM_AUTORELOAD_PRELOAD_DISABLE 0x00000000U /*!< TIMx_ARR register is not buffered */ +#define TIM_AUTORELOAD_PRELOAD_ENABLE TIM_CR1_ARPE /*!< TIMx_ARR register is buffered */ + +/** + * @} + */ + +/** @defgroup TIM_Output_Fast_State TIM Output Fast State + * @{ + */ +#define TIM_OCFAST_DISABLE 0x00000000U /*!< Output Compare fast disable */ +#define TIM_OCFAST_ENABLE TIM_CCMR1_OC1FE /*!< Output Compare fast enable */ +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_N_State TIM Complementary Output Compare State + * @{ + */ +#define TIM_OUTPUTNSTATE_DISABLE 0x00000000U /*!< OCxN is disabled */ +#define TIM_OUTPUTNSTATE_ENABLE TIM_CCER_CC1NE /*!< OCxN is enabled */ +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_Polarity TIM Output Compare Polarity + * @{ + */ +#define TIM_OCPOLARITY_HIGH 0x00000000U /*!< Capture/Compare output polarity */ +#define TIM_OCPOLARITY_LOW TIM_CCER_CC1P /*!< Capture/Compare output polarity */ +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_N_Polarity TIM Complementary Output Compare Polarity + * @{ + */ +#define TIM_OCNPOLARITY_HIGH 0x00000000U /*!< Capture/Compare complementary output polarity */ +#define TIM_OCNPOLARITY_LOW TIM_CCER_CC1NP /*!< Capture/Compare complementary output polarity */ +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_Idle_State TIM Output Compare Idle State + * @{ + */ +#define TIM_OCIDLESTATE_SET TIM_CR2_OIS1 /*!< Output Idle state: OCx=1 when MOE=0 */ +#define TIM_OCIDLESTATE_RESET 0x00000000U /*!< Output Idle state: OCx=0 when MOE=0 */ +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_N_Idle_State TIM Complementary Output Compare Idle State + * @{ + */ +#define TIM_OCNIDLESTATE_SET TIM_CR2_OIS1N /*!< Complementary output Idle state: OCxN=1 when MOE=0 */ +#define TIM_OCNIDLESTATE_RESET 0x00000000U /*!< Complementary output Idle state: OCxN=0 when MOE=0 */ +/** + * @} + */ + +/** @defgroup TIM_Input_Capture_Polarity TIM Input Capture Polarity + * @{ + */ +#define TIM_ICPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Capture triggered by rising edge on timer input */ +#define TIM_ICPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Capture triggered by falling edge on timer input */ +#define TIM_ICPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE /*!< Capture triggered by both rising and falling edges on timer input*/ +/** + * @} + */ + +/** @defgroup TIM_Encoder_Input_Polarity TIM Encoder Input Polarity + * @{ + */ +#define TIM_ENCODERINPUTPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Encoder input with rising edge polarity */ +#define TIM_ENCODERINPUTPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Encoder input with falling edge polarity */ +/** + * @} + */ + +/** @defgroup TIM_Input_Capture_Selection TIM Input Capture Selection + * @{ + */ +#define TIM_ICSELECTION_DIRECTTI TIM_CCMR1_CC1S_0 /*!< TIM Input 1, 2, 3 or 4 is selected to be connected to IC1, IC2, IC3 or IC4, respectively */ +#define TIM_ICSELECTION_INDIRECTTI TIM_CCMR1_CC1S_1 /*!< TIM Input 1, 2, 3 or 4 is selected to be connected to IC2, IC1, IC4 or IC3, respectively */ +#define TIM_ICSELECTION_TRC TIM_CCMR1_CC1S /*!< TIM Input 1, 2, 3 or 4 is selected to be connected to TRC */ +/** + * @} + */ + +/** @defgroup TIM_Input_Capture_Prescaler TIM Input Capture Prescaler + * @{ + */ +#define TIM_ICPSC_DIV1 0x00000000U /*!< Capture performed each time an edge is detected on the capture input */ +#define TIM_ICPSC_DIV2 TIM_CCMR1_IC1PSC_0 /*!< Capture performed once every 2 events */ +#define TIM_ICPSC_DIV4 TIM_CCMR1_IC1PSC_1 /*!< Capture performed once every 4 events */ +#define TIM_ICPSC_DIV8 TIM_CCMR1_IC1PSC /*!< Capture performed once every 8 events */ +/** + * @} + */ + +/** @defgroup TIM_One_Pulse_Mode TIM One Pulse Mode + * @{ + */ +#define TIM_OPMODE_SINGLE TIM_CR1_OPM /*!< Counter stops counting at the next update event */ +#define TIM_OPMODE_REPETITIVE 0x00000000U /*!< Counter is not stopped at update event */ +/** + * @} + */ + +/** @defgroup TIM_Encoder_Mode TIM Encoder Mode + * @{ + */ +#define TIM_ENCODERMODE_TI1 TIM_SMCR_SMS_0 /*!< Quadrature encoder mode 1, x2 mode, counts up/down on TI1FP1 edge depending on TI2FP2 level */ +#define TIM_ENCODERMODE_TI2 TIM_SMCR_SMS_1 /*!< Quadrature encoder mode 2, x2 mode, counts up/down on TI2FP2 edge depending on TI1FP1 level. */ +#define TIM_ENCODERMODE_TI12 (TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0) /*!< Quadrature encoder mode 3, x4 mode, counts up/down on both TI1FP1 and TI2FP2 edges depending on the level of the other input. */ +/** + * @} + */ + +/** @defgroup TIM_Interrupt_definition TIM interrupt Definition + * @{ + */ +#define TIM_IT_UPDATE TIM_DIER_UIE /*!< Update interrupt */ +#define TIM_IT_CC1 TIM_DIER_CC1IE /*!< Capture/Compare 1 interrupt */ +#define TIM_IT_CC2 TIM_DIER_CC2IE /*!< Capture/Compare 2 interrupt */ +#define TIM_IT_CC3 TIM_DIER_CC3IE /*!< Capture/Compare 3 interrupt */ +#define TIM_IT_CC4 TIM_DIER_CC4IE /*!< Capture/Compare 4 interrupt */ +#define TIM_IT_COM TIM_DIER_COMIE /*!< Commutation interrupt */ +#define TIM_IT_TRIGGER TIM_DIER_TIE /*!< Trigger interrupt */ +#define TIM_IT_BREAK TIM_DIER_BIE /*!< Break interrupt */ +/** + * @} + */ + +/** @defgroup TIM_Commutation_Source TIM Commutation Source + * @{ + */ +#define TIM_COMMUTATION_TRGI TIM_CR2_CCUS /*!< When Capture/compare control bits are preloaded, they are updated by setting the COMG bit or when an rising edge occurs on trigger input */ +#define TIM_COMMUTATION_SOFTWARE 0x00000000U /*!< When Capture/compare control bits are preloaded, they are updated by setting the COMG bit */ +/** + * @} + */ + +/** @defgroup TIM_DMA_sources TIM DMA Sources + * @{ + */ +#define TIM_DMA_UPDATE TIM_DIER_UDE /*!< DMA request is triggered by the update event */ +#define TIM_DMA_CC1 TIM_DIER_CC1DE /*!< DMA request is triggered by the capture/compare macth 1 event */ +#define TIM_DMA_CC2 TIM_DIER_CC2DE /*!< DMA request is triggered by the capture/compare macth 2 event event */ +#define TIM_DMA_CC3 TIM_DIER_CC3DE /*!< DMA request is triggered by the capture/compare macth 3 event event */ +#define TIM_DMA_CC4 TIM_DIER_CC4DE /*!< DMA request is triggered by the capture/compare macth 4 event event */ +#define TIM_DMA_COM TIM_DIER_COMDE /*!< DMA request is triggered by the commutation event */ +#define TIM_DMA_TRIGGER TIM_DIER_TDE /*!< DMA request is triggered by the trigger event */ +/** + * @} + */ + +/** @defgroup TIM_CC_DMA_Request CCx DMA request selection + * @{ + */ +#define TIM_CCDMAREQUEST_CC 0x00000000U /*!< CCx DMA request sent when capture or compare match event occurs */ +#define TIM_CCDMAREQUEST_UPDATE TIM_CR2_CCDS /*!< CCx DMA requests sent when update event occurs */ +/** + * @} + */ + +/** @defgroup TIM_Flag_definition TIM Flag Definition + * @{ + */ +#define TIM_FLAG_UPDATE TIM_SR_UIF /*!< Update interrupt flag */ +#define TIM_FLAG_CC1 TIM_SR_CC1IF /*!< Capture/Compare 1 interrupt flag */ +#define TIM_FLAG_CC2 TIM_SR_CC2IF /*!< Capture/Compare 2 interrupt flag */ +#define TIM_FLAG_CC3 TIM_SR_CC3IF /*!< Capture/Compare 3 interrupt flag */ +#define TIM_FLAG_CC4 TIM_SR_CC4IF /*!< Capture/Compare 4 interrupt flag */ +#if defined(TIM_SR_CC5IF) +#define TIM_FLAG_CC5 TIM_SR_CC5IF /*!< Capture/Compare 5 interrupt flag */ +#endif /* TIM_SR_CC5IF */ +#if defined(TIM_SR_CC6IF) +#define TIM_FLAG_CC6 TIM_SR_CC6IF /*!< Capture/Compare 6 interrupt flag */ +#endif /* TIM_SR_CC6IF */ +#define TIM_FLAG_COM TIM_SR_COMIF /*!< Commutation interrupt flag */ +#define TIM_FLAG_TRIGGER TIM_SR_TIF /*!< Trigger interrupt flag */ +#define TIM_FLAG_BREAK TIM_SR_BIF /*!< Break interrupt flag */ +#if defined(TIM_SR_B2IF) +#define TIM_FLAG_BREAK2 TIM_SR_B2IF /*!< Break 2 interrupt flag */ +#endif /* TIM_SR_B2IF */ +#define TIM_FLAG_CC1OF TIM_SR_CC1OF /*!< Capture 1 overcapture flag */ +#define TIM_FLAG_CC2OF TIM_SR_CC2OF /*!< Capture 2 overcapture flag */ +#define TIM_FLAG_CC3OF TIM_SR_CC3OF /*!< Capture 3 overcapture flag */ +#define TIM_FLAG_CC4OF TIM_SR_CC4OF /*!< Capture 4 overcapture flag */ +/** + * @} + */ + +/** @defgroup TIM_Channel TIM Channel + * @{ + */ +#define TIM_CHANNEL_1 0x00000000U /*!< Capture/compare channel 1 identifier */ +#define TIM_CHANNEL_2 0x00000004U /*!< Capture/compare channel 2 identifier */ +#define TIM_CHANNEL_3 0x00000008U /*!< Capture/compare channel 3 identifier */ +#define TIM_CHANNEL_4 0x0000000CU /*!< Capture/compare channel 4 identifier */ +#if defined(TIM_CCER_CC5E) +#define TIM_CHANNEL_5 0x00000010U /*!< Compare channel 5 identifier */ +#endif /* TIM_CCER_CC5E */ +#if defined(TIM_CCER_CC6E) +#define TIM_CHANNEL_6 0x00000014U /*!< Compare channel 6 identifier */ +#endif /* TIM_CCER_CC6E */ +#define TIM_CHANNEL_ALL 0x0000003CU /*!< Global Capture/compare channel identifier */ +/** + * @} + */ + +/** @defgroup TIM_Clock_Source TIM Clock Source + * @{ + */ +#define TIM_CLOCKSOURCE_INTERNAL TIM_SMCR_ETPS_0 /*!< Internal clock source */ +#define TIM_CLOCKSOURCE_ETRMODE1 TIM_TS_ETRF /*!< External clock source mode 1 (ETRF) */ +#define TIM_CLOCKSOURCE_ETRMODE2 TIM_SMCR_ETPS_1 /*!< External clock source mode 2 */ +#define TIM_CLOCKSOURCE_TI1ED TIM_TS_TI1F_ED /*!< External clock source mode 1 (TTI1FP1 + edge detect.) */ +#define TIM_CLOCKSOURCE_TI1 TIM_TS_TI1FP1 /*!< External clock source mode 1 (TTI1FP1) */ +#define TIM_CLOCKSOURCE_TI2 TIM_TS_TI2FP2 /*!< External clock source mode 1 (TTI2FP2) */ +#define TIM_CLOCKSOURCE_ITR0 TIM_TS_ITR0 /*!< External clock source mode 1 (ITR0) */ +#define TIM_CLOCKSOURCE_ITR1 TIM_TS_ITR1 /*!< External clock source mode 1 (ITR1) */ +#define TIM_CLOCKSOURCE_ITR2 TIM_TS_ITR2 /*!< External clock source mode 1 (ITR2) */ +#define TIM_CLOCKSOURCE_ITR3 TIM_TS_ITR3 /*!< External clock source mode 1 (ITR3) */ +/** + * @} + */ + +/** @defgroup TIM_Clock_Polarity TIM Clock Polarity + * @{ + */ +#define TIM_CLOCKPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx clock sources */ +#define TIM_CLOCKPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED /*!< Polarity for ETRx clock sources */ +#define TIM_CLOCKPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Polarity for TIx clock sources */ +#define TIM_CLOCKPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Polarity for TIx clock sources */ +#define TIM_CLOCKPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE /*!< Polarity for TIx clock sources */ +/** + * @} + */ + +/** @defgroup TIM_Clock_Prescaler TIM Clock Prescaler + * @{ + */ +#define TIM_CLOCKPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */ +#define TIM_CLOCKPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR Clock: Capture performed once every 2 events. */ +#define TIM_CLOCKPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR Clock: Capture performed once every 4 events. */ +#define TIM_CLOCKPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR Clock: Capture performed once every 8 events. */ +/** + * @} + */ + +/** @defgroup TIM_ClearInput_Polarity TIM Clear Input Polarity + * @{ + */ +#define TIM_CLEARINPUTPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx pin */ +#define TIM_CLEARINPUTPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED /*!< Polarity for ETRx pin */ +/** + * @} + */ + +/** @defgroup TIM_ClearInput_Prescaler TIM Clear Input Prescaler + * @{ + */ +#define TIM_CLEARINPUTPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */ +#define TIM_CLEARINPUTPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR pin: Capture performed once every 2 events. */ +#define TIM_CLEARINPUTPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR pin: Capture performed once every 4 events. */ +#define TIM_CLEARINPUTPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR pin: Capture performed once every 8 events. */ +/** + * @} + */ + +/** @defgroup TIM_OSSR_Off_State_Selection_for_Run_mode_state TIM OSSR OffState Selection for Run mode state + * @{ + */ +#define TIM_OSSR_ENABLE TIM_BDTR_OSSR /*!< When inactive, OC/OCN outputs are enabled (still controlled by the timer) */ +#define TIM_OSSR_DISABLE 0x00000000U /*!< When inactive, OC/OCN outputs are disabled (not controlled any longer by the timer) */ +/** + * @} + */ + +/** @defgroup TIM_OSSI_Off_State_Selection_for_Idle_mode_state TIM OSSI OffState Selection for Idle mode state + * @{ + */ +#define TIM_OSSI_ENABLE TIM_BDTR_OSSI /*!< When inactive, OC/OCN outputs are enabled (still controlled by the timer) */ +#define TIM_OSSI_DISABLE 0x00000000U /*!< When inactive, OC/OCN outputs are disabled (not controlled any longer by the timer) */ +/** + * @} + */ +/** @defgroup TIM_Lock_level TIM Lock level + * @{ + */ +#define TIM_LOCKLEVEL_OFF 0x00000000U /*!< LOCK OFF */ +#define TIM_LOCKLEVEL_1 TIM_BDTR_LOCK_0 /*!< LOCK Level 1 */ +#define TIM_LOCKLEVEL_2 TIM_BDTR_LOCK_1 /*!< LOCK Level 2 */ +#define TIM_LOCKLEVEL_3 TIM_BDTR_LOCK /*!< LOCK Level 3 */ +/** + * @} + */ + +/** @defgroup TIM_Break_Input_enable_disable TIM Break Input Enable + * @{ + */ +#define TIM_BREAK_ENABLE TIM_BDTR_BKE /*!< Break input BRK is enabled */ +#define TIM_BREAK_DISABLE 0x00000000U /*!< Break input BRK is disabled */ +/** + * @} + */ + +/** @defgroup TIM_Break_Polarity TIM Break Input Polarity + * @{ + */ +#define TIM_BREAKPOLARITY_LOW 0x00000000U /*!< Break input BRK is active low */ +#define TIM_BREAKPOLARITY_HIGH TIM_BDTR_BKP /*!< Break input BRK is active high */ +/** + * @} + */ + +#if defined(TIM_BDTR_BK2E) +/** @defgroup TIM_Break2_Input_enable_disable TIM Break input 2 Enable + * @{ + */ +#define TIM_BREAK2_DISABLE 0x00000000U /*!< Break input BRK2 is disabled */ +#define TIM_BREAK2_ENABLE TIM_BDTR_BK2E /*!< Break input BRK2 is enabled */ +/** + * @} + */ + +/** @defgroup TIM_Break2_Polarity TIM Break Input 2 Polarity + * @{ + */ +#define TIM_BREAK2POLARITY_LOW 0x00000000U /*!< Break input BRK2 is active low */ +#define TIM_BREAK2POLARITY_HIGH TIM_BDTR_BK2P /*!< Break input BRK2 is active high */ +/** + * @} + */ +#endif /* TIM_BDTR_BK2E */ + +/** @defgroup TIM_AOE_Bit_Set_Reset TIM Automatic Output Enable + * @{ + */ +#define TIM_AUTOMATICOUTPUT_DISABLE 0x00000000U /*!< MOE can be set only by software */ +#define TIM_AUTOMATICOUTPUT_ENABLE TIM_BDTR_AOE /*!< MOE can be set by software or automatically at the next update event (if none of the break inputs BRK and BRK2 is active) */ +/** + * @} + */ + +#if defined(TIM_CCR5_CCR5) +/** @defgroup TIM_Group_Channel5 TIM Group Channel 5 and Channel 1, 2 or 3 + * @{ + */ +#define TIM_GROUPCH5_NONE 0x00000000U /*!< No effect of OC5REF on OC1REFC, OC2REFC and OC3REFC */ +#define TIM_GROUPCH5_OC1REFC TIM_CCR5_GC5C1 /*!< OC1REFC is the logical AND of OC1REFC and OC5REF */ +#define TIM_GROUPCH5_OC2REFC TIM_CCR5_GC5C2 /*!< OC2REFC is the logical AND of OC2REFC and OC5REF */ +#define TIM_GROUPCH5_OC3REFC TIM_CCR5_GC5C3 /*!< OC3REFC is the logical AND of OC3REFC and OC5REF */ +/** + * @} + */ +#endif /* TIM_CCR5_CCR5 */ + +/** @defgroup TIM_Master_Mode_Selection TIM Master Mode Selection + * @{ + */ +#define TIM_TRGO_RESET 0x00000000U /*!< TIMx_EGR.UG bit is used as trigger output (TRGO) */ +#define TIM_TRGO_ENABLE TIM_CR2_MMS_0 /*!< TIMx_CR1.CEN bit is used as trigger output (TRGO) */ +#define TIM_TRGO_UPDATE TIM_CR2_MMS_1 /*!< Update event is used as trigger output (TRGO) */ +#define TIM_TRGO_OC1 (TIM_CR2_MMS_1 | TIM_CR2_MMS_0) /*!< Capture or a compare match 1 is used as trigger output (TRGO) */ +#define TIM_TRGO_OC1REF TIM_CR2_MMS_2 /*!< OC1REF signal is used as trigger output (TRGO) */ +#define TIM_TRGO_OC2REF (TIM_CR2_MMS_2 | TIM_CR2_MMS_0) /*!< OC2REF signal is used as trigger output(TRGO) */ +#define TIM_TRGO_OC3REF (TIM_CR2_MMS_2 | TIM_CR2_MMS_1) /*!< OC3REF signal is used as trigger output(TRGO) */ +#define TIM_TRGO_OC4REF (TIM_CR2_MMS_2 | TIM_CR2_MMS_1 | TIM_CR2_MMS_0) /*!< OC4REF signal is used as trigger output(TRGO) */ +/** + * @} + */ + +#if defined(TIM_CR2_MMS2) +/** @defgroup TIM_Master_Mode_Selection_2 TIM Master Mode Selection 2 (TRGO2) + * @{ + */ +#define TIM_TRGO2_RESET 0x00000000U /*!< TIMx_EGR.UG bit is used as trigger output (TRGO2) */ +#define TIM_TRGO2_ENABLE TIM_CR2_MMS2_0 /*!< TIMx_CR1.CEN bit is used as trigger output (TRGO2) */ +#define TIM_TRGO2_UPDATE TIM_CR2_MMS2_1 /*!< Update event is used as trigger output (TRGO2) */ +#define TIM_TRGO2_OC1 (TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0) /*!< Capture or a compare match 1 is used as trigger output (TRGO2) */ +#define TIM_TRGO2_OC1REF TIM_CR2_MMS2_2 /*!< OC1REF signal is used as trigger output (TRGO2) */ +#define TIM_TRGO2_OC2REF (TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0) /*!< OC2REF signal is used as trigger output (TRGO2) */ +#define TIM_TRGO2_OC3REF (TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1) /*!< OC3REF signal is used as trigger output (TRGO2) */ +#define TIM_TRGO2_OC4REF (TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0) /*!< OC4REF signal is used as trigger output (TRGO2) */ +#define TIM_TRGO2_OC5REF TIM_CR2_MMS2_3 /*!< OC5REF signal is used as trigger output (TRGO2) */ +#define TIM_TRGO2_OC6REF (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_0) /*!< OC6REF signal is used as trigger output (TRGO2) */ +#define TIM_TRGO2_OC4REF_RISINGFALLING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1) /*!< OC4REF rising or falling edges generate pulses on TRGO2 */ +#define TIM_TRGO2_OC6REF_RISINGFALLING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0) /*!< OC6REF rising or falling edges generate pulses on TRGO2 */ +#define TIM_TRGO2_OC4REF_RISING_OC6REF_RISING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2) /*!< OC4REF or OC6REF rising edges generate pulses on TRGO2 */ +#define TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0) /*!< OC4REF rising or OC6REF falling edges generate pulses on TRGO2 */ +#define TIM_TRGO2_OC5REF_RISING_OC6REF_RISING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 |TIM_CR2_MMS2_1) /*!< OC5REF or OC6REF rising edges generate pulses on TRGO2 */ +#define TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING (TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0) /*!< OC5REF or OC6REF rising edges generate pulses on TRGO2 */ +/** + * @} + */ +#endif /* TIM_CR2_MMS2 */ + +/** @defgroup TIM_Master_Slave_Mode TIM Master/Slave Mode + * @{ + */ +#define TIM_MASTERSLAVEMODE_ENABLE TIM_SMCR_MSM /*!< No action */ +#define TIM_MASTERSLAVEMODE_DISABLE 0x00000000U /*!< Master/slave mode is selected */ +/** + * @} + */ + +/** @defgroup TIM_Slave_Mode TIM Slave mode + * @{ + */ +#define TIM_SLAVEMODE_DISABLE 0x00000000U /*!< Slave mode disabled */ +#define TIM_SLAVEMODE_RESET TIM_SMCR_SMS_2 /*!< Reset Mode */ +#define TIM_SLAVEMODE_GATED (TIM_SMCR_SMS_2 | TIM_SMCR_SMS_0) /*!< Gated Mode */ +#define TIM_SLAVEMODE_TRIGGER (TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1) /*!< Trigger Mode */ +#define TIM_SLAVEMODE_EXTERNAL1 (TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0) /*!< External Clock Mode 1 */ +#if defined (TIM_SMCR_SMS_3) +#define TIM_SLAVEMODE_COMBINED_RESETTRIGGER TIM_SMCR_SMS_3 /*!< Combined reset + trigger mode */ +#endif /* TIM_SMCR_SMS_3 */ +/** + * @} + */ + +/** @defgroup TIM_Output_Compare_and_PWM_modes TIM Output Compare and PWM Modes + * @{ + */ +#define TIM_OCMODE_TIMING 0x00000000U /*!< Frozen */ +#define TIM_OCMODE_ACTIVE TIM_CCMR1_OC1M_0 /*!< Set channel to active level on match */ +#define TIM_OCMODE_INACTIVE TIM_CCMR1_OC1M_1 /*!< Set channel to inactive level on match */ +#define TIM_OCMODE_TOGGLE (TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0) /*!< Toggle */ +#define TIM_OCMODE_PWM1 (TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1) /*!< PWM mode 1 */ +#define TIM_OCMODE_PWM2 (TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0) /*!< PWM mode 2 */ +#define TIM_OCMODE_FORCED_ACTIVE (TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_0) /*!< Force active level */ +#define TIM_OCMODE_FORCED_INACTIVE TIM_CCMR1_OC1M_2 /*!< Force inactive level */ +#if defined(TIM_CCMR1_OC1M_3) +#define TIM_OCMODE_RETRIGERRABLE_OPM1 TIM_CCMR1_OC1M_3 /*!< Retrigerrable OPM mode 1 */ +#define TIM_OCMODE_RETRIGERRABLE_OPM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0) /*!< Retrigerrable OPM mode 2 */ +#define TIM_OCMODE_COMBINED_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_2) /*!< Combined PWM mode 1 */ +#define TIM_OCMODE_COMBINED_PWM2 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2) /*!< Combined PWM mode 2 */ +#define TIM_OCMODE_ASSYMETRIC_PWM1 (TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2) /*!< Asymmetric PWM mode 1 */ +#define TIM_OCMODE_ASSYMETRIC_PWM2 TIM_CCMR1_OC1M /*!< Asymmetric PWM mode 2 */ +#endif /* TIM_CCMR1_OC1M_3 */ +/** + * @} + */ + +/** @defgroup TIM_Trigger_Selection TIM Trigger Selection + * @{ + */ +#define TIM_TS_ITR0 0x00000000U /*!< Internal Trigger 0 (ITR0) */ +#define TIM_TS_ITR1 TIM_SMCR_TS_0 /*!< Internal Trigger 1 (ITR1) */ +#define TIM_TS_ITR2 TIM_SMCR_TS_1 /*!< Internal Trigger 2 (ITR2) */ +#define TIM_TS_ITR3 (TIM_SMCR_TS_0 | TIM_SMCR_TS_1) /*!< Internal Trigger 3 (ITR3) */ +#define TIM_TS_TI1F_ED TIM_SMCR_TS_2 /*!< TI1 Edge Detector (TI1F_ED) */ +#define TIM_TS_TI1FP1 (TIM_SMCR_TS_0 | TIM_SMCR_TS_2) /*!< Filtered Timer Input 1 (TI1FP1) */ +#define TIM_TS_TI2FP2 (TIM_SMCR_TS_1 | TIM_SMCR_TS_2) /*!< Filtered Timer Input 2 (TI2FP2) */ +#define TIM_TS_ETRF (TIM_SMCR_TS_0 | TIM_SMCR_TS_1 | TIM_SMCR_TS_2) /*!< Filtered External Trigger input (ETRF) */ +#define TIM_TS_NONE 0x0000FFFFU /*!< No trigger selected */ +/** + * @} + */ + +/** @defgroup TIM_Trigger_Polarity TIM Trigger Polarity + * @{ + */ +#define TIM_TRIGGERPOLARITY_INVERTED TIM_ETRPOLARITY_INVERTED /*!< Polarity for ETRx trigger sources */ +#define TIM_TRIGGERPOLARITY_NONINVERTED TIM_ETRPOLARITY_NONINVERTED /*!< Polarity for ETRx trigger sources */ +#define TIM_TRIGGERPOLARITY_RISING TIM_INPUTCHANNELPOLARITY_RISING /*!< Polarity for TIxFPx or TI1_ED trigger sources */ +#define TIM_TRIGGERPOLARITY_FALLING TIM_INPUTCHANNELPOLARITY_FALLING /*!< Polarity for TIxFPx or TI1_ED trigger sources */ +#define TIM_TRIGGERPOLARITY_BOTHEDGE TIM_INPUTCHANNELPOLARITY_BOTHEDGE /*!< Polarity for TIxFPx or TI1_ED trigger sources */ +/** + * @} + */ + +/** @defgroup TIM_Trigger_Prescaler TIM Trigger Prescaler + * @{ + */ +#define TIM_TRIGGERPRESCALER_DIV1 TIM_ETRPRESCALER_DIV1 /*!< No prescaler is used */ +#define TIM_TRIGGERPRESCALER_DIV2 TIM_ETRPRESCALER_DIV2 /*!< Prescaler for External ETR Trigger: Capture performed once every 2 events. */ +#define TIM_TRIGGERPRESCALER_DIV4 TIM_ETRPRESCALER_DIV4 /*!< Prescaler for External ETR Trigger: Capture performed once every 4 events. */ +#define TIM_TRIGGERPRESCALER_DIV8 TIM_ETRPRESCALER_DIV8 /*!< Prescaler for External ETR Trigger: Capture performed once every 8 events. */ +/** + * @} + */ + +/** @defgroup TIM_TI1_Selection TIM TI1 Input Selection + * @{ + */ +#define TIM_TI1SELECTION_CH1 0x00000000U /*!< The TIMx_CH1 pin is connected to TI1 input */ +#define TIM_TI1SELECTION_XORCOMBINATION TIM_CR2_TI1S /*!< The TIMx_CH1, CH2 and CH3 pins are connected to the TI1 input (XOR combination) */ +/** + * @} + */ + +/** @defgroup TIM_DMA_Burst_Length TIM DMA Burst Length + * @{ + */ +#define TIM_DMABURSTLENGTH_1TRANSFER 0x00000000U /*!< The transfer is done to 1 register starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_2TRANSFERS 0x00000100U /*!< The transfer is done to 2 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_3TRANSFERS 0x00000200U /*!< The transfer is done to 3 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_4TRANSFERS 0x00000300U /*!< The transfer is done to 4 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_5TRANSFERS 0x00000400U /*!< The transfer is done to 5 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_6TRANSFERS 0x00000500U /*!< The transfer is done to 6 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_7TRANSFERS 0x00000600U /*!< The transfer is done to 7 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_8TRANSFERS 0x00000700U /*!< The transfer is done to 8 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_9TRANSFERS 0x00000800U /*!< The transfer is done to 9 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_10TRANSFERS 0x00000900U /*!< The transfer is done to 10 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_11TRANSFERS 0x00000A00U /*!< The transfer is done to 11 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_12TRANSFERS 0x00000B00U /*!< The transfer is done to 12 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_13TRANSFERS 0x00000C00U /*!< The transfer is done to 13 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_14TRANSFERS 0x00000D00U /*!< The transfer is done to 14 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_15TRANSFERS 0x00000E00U /*!< The transfer is done to 15 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_16TRANSFERS 0x00000F00U /*!< The transfer is done to 16 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_17TRANSFERS 0x00001000U /*!< The transfer is done to 17 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +#define TIM_DMABURSTLENGTH_18TRANSFERS 0x00001100U /*!< The transfer is done to 18 registers starting from TIMx_CR1 + TIMx_DCR.DBA */ +/** + * @} + */ + +/** @defgroup DMA_Handle_index TIM DMA Handle Index + * @{ + */ +#define TIM_DMA_ID_UPDATE ((uint16_t) 0x0000) /*!< Index of the DMA handle used for Update DMA requests */ +#define TIM_DMA_ID_CC1 ((uint16_t) 0x0001) /*!< Index of the DMA handle used for Capture/Compare 1 DMA requests */ +#define TIM_DMA_ID_CC2 ((uint16_t) 0x0002) /*!< Index of the DMA handle used for Capture/Compare 2 DMA requests */ +#define TIM_DMA_ID_CC3 ((uint16_t) 0x0003) /*!< Index of the DMA handle used for Capture/Compare 3 DMA requests */ +#define TIM_DMA_ID_CC4 ((uint16_t) 0x0004) /*!< Index of the DMA handle used for Capture/Compare 4 DMA requests */ +#define TIM_DMA_ID_COMMUTATION ((uint16_t) 0x0005) /*!< Index of the DMA handle used for Commutation DMA requests */ +#define TIM_DMA_ID_TRIGGER ((uint16_t) 0x0006) /*!< Index of the DMA handle used for Trigger DMA requests */ +/** + * @} + */ + +/** @defgroup Channel_CC_State TIM Capture/Compare Channel State + * @{ + */ +#define TIM_CCx_ENABLE 0x00000001U /*!< Input or output channel is enabled */ +#define TIM_CCx_DISABLE 0x00000000U /*!< Input or output channel is disabled */ +#define TIM_CCxN_ENABLE 0x00000004U /*!< Complementary output channel is enabled */ +#define TIM_CCxN_DISABLE 0x00000000U /*!< Complementary output channel is enabled */ +/** + * @} + */ + +/** + * @} + */ +/* End of exported constants -------------------------------------------------*/ + +/* Exported macros -----------------------------------------------------------*/ +/** @defgroup TIM_Exported_Macros TIM Exported Macros + * @{ + */ + +/** @brief Reset TIM handle state. + * @param __HANDLE__ TIM handle. + * @retval None + */ +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) +#define __HAL_TIM_RESET_HANDLE_STATE(__HANDLE__) do { \ + (__HANDLE__)->State = HAL_TIM_STATE_RESET; \ + (__HANDLE__)->ChannelState[0] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[1] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[2] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[3] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[4] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[5] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelNState[0] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelNState[1] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelNState[2] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelNState[3] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->DMABurstState = HAL_DMA_BURST_STATE_RESET; \ + (__HANDLE__)->Base_MspInitCallback = NULL; \ + (__HANDLE__)->Base_MspDeInitCallback = NULL; \ + (__HANDLE__)->IC_MspInitCallback = NULL; \ + (__HANDLE__)->IC_MspDeInitCallback = NULL; \ + (__HANDLE__)->OC_MspInitCallback = NULL; \ + (__HANDLE__)->OC_MspDeInitCallback = NULL; \ + (__HANDLE__)->PWM_MspInitCallback = NULL; \ + (__HANDLE__)->PWM_MspDeInitCallback = NULL; \ + (__HANDLE__)->OnePulse_MspInitCallback = NULL; \ + (__HANDLE__)->OnePulse_MspDeInitCallback = NULL; \ + (__HANDLE__)->Encoder_MspInitCallback = NULL; \ + (__HANDLE__)->Encoder_MspDeInitCallback = NULL; \ + (__HANDLE__)->HallSensor_MspInitCallback = NULL; \ + (__HANDLE__)->HallSensor_MspDeInitCallback = NULL; \ + } while(0) +#else +#define __HAL_TIM_RESET_HANDLE_STATE(__HANDLE__) do { \ + (__HANDLE__)->State = HAL_TIM_STATE_RESET; \ + (__HANDLE__)->ChannelState[0] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[1] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[2] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[3] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[4] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelState[5] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelNState[0] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelNState[1] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelNState[2] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->ChannelNState[3] = HAL_TIM_CHANNEL_STATE_RESET; \ + (__HANDLE__)->DMABurstState = HAL_DMA_BURST_STATE_RESET; \ + } while(0) +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + +/** + * @brief Enable the TIM peripheral. + * @param __HANDLE__ TIM handle + * @retval None + */ +#define __HAL_TIM_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1|=(TIM_CR1_CEN)) + +/** + * @brief Enable the TIM main Output. + * @param __HANDLE__ TIM handle + * @retval None + */ +#define __HAL_TIM_MOE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->BDTR|=(TIM_BDTR_MOE)) + +/** + * @brief Disable the TIM peripheral. + * @param __HANDLE__ TIM handle + * @retval None + */ +#define __HAL_TIM_DISABLE(__HANDLE__) \ + do { \ + if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0UL) \ + { \ + if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0UL) \ + { \ + (__HANDLE__)->Instance->CR1 &= ~(TIM_CR1_CEN); \ + } \ + } \ + } while(0) + +/** + * @brief Disable the TIM main Output. + * @param __HANDLE__ TIM handle + * @retval None + * @note The Main Output Enable of a timer instance is disabled only if all the CCx and CCxN channels have been + * disabled + */ +#define __HAL_TIM_MOE_DISABLE(__HANDLE__) \ + do { \ + if (((__HANDLE__)->Instance->CCER & TIM_CCER_CCxE_MASK) == 0UL) \ + { \ + if(((__HANDLE__)->Instance->CCER & TIM_CCER_CCxNE_MASK) == 0UL) \ + { \ + (__HANDLE__)->Instance->BDTR &= ~(TIM_BDTR_MOE); \ + } \ + } \ + } while(0) + +/** + * @brief Disable the TIM main Output. + * @param __HANDLE__ TIM handle + * @retval None + * @note The Main Output Enable of a timer instance is disabled unconditionally + */ +#define __HAL_TIM_MOE_DISABLE_UNCONDITIONALLY(__HANDLE__) (__HANDLE__)->Instance->BDTR &= ~(TIM_BDTR_MOE) + +/** @brief Enable the specified TIM interrupt. + * @param __HANDLE__ specifies the TIM Handle. + * @param __INTERRUPT__ specifies the TIM interrupt source to enable. + * This parameter can be one of the following values: + * @arg TIM_IT_UPDATE: Update interrupt + * @arg TIM_IT_CC1: Capture/Compare 1 interrupt + * @arg TIM_IT_CC2: Capture/Compare 2 interrupt + * @arg TIM_IT_CC3: Capture/Compare 3 interrupt + * @arg TIM_IT_CC4: Capture/Compare 4 interrupt + * @arg TIM_IT_COM: Commutation interrupt + * @arg TIM_IT_TRIGGER: Trigger interrupt + * @arg TIM_IT_BREAK: Break interrupt + * @retval None + */ +#define __HAL_TIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER |= (__INTERRUPT__)) + +/** @brief Disable the specified TIM interrupt. + * @param __HANDLE__ specifies the TIM Handle. + * @param __INTERRUPT__ specifies the TIM interrupt source to disable. + * This parameter can be one of the following values: + * @arg TIM_IT_UPDATE: Update interrupt + * @arg TIM_IT_CC1: Capture/Compare 1 interrupt + * @arg TIM_IT_CC2: Capture/Compare 2 interrupt + * @arg TIM_IT_CC3: Capture/Compare 3 interrupt + * @arg TIM_IT_CC4: Capture/Compare 4 interrupt + * @arg TIM_IT_COM: Commutation interrupt + * @arg TIM_IT_TRIGGER: Trigger interrupt + * @arg TIM_IT_BREAK: Break interrupt + * @retval None + */ +#define __HAL_TIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->DIER &= ~(__INTERRUPT__)) + +/** @brief Enable the specified DMA request. + * @param __HANDLE__ specifies the TIM Handle. + * @param __DMA__ specifies the TIM DMA request to enable. + * This parameter can be one of the following values: + * @arg TIM_DMA_UPDATE: Update DMA request + * @arg TIM_DMA_CC1: Capture/Compare 1 DMA request + * @arg TIM_DMA_CC2: Capture/Compare 2 DMA request + * @arg TIM_DMA_CC3: Capture/Compare 3 DMA request + * @arg TIM_DMA_CC4: Capture/Compare 4 DMA request + * @arg TIM_DMA_COM: Commutation DMA request + * @arg TIM_DMA_TRIGGER: Trigger DMA request + * @retval None + */ +#define __HAL_TIM_ENABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->DIER |= (__DMA__)) + +/** @brief Disable the specified DMA request. + * @param __HANDLE__ specifies the TIM Handle. + * @param __DMA__ specifies the TIM DMA request to disable. + * This parameter can be one of the following values: + * @arg TIM_DMA_UPDATE: Update DMA request + * @arg TIM_DMA_CC1: Capture/Compare 1 DMA request + * @arg TIM_DMA_CC2: Capture/Compare 2 DMA request + * @arg TIM_DMA_CC3: Capture/Compare 3 DMA request + * @arg TIM_DMA_CC4: Capture/Compare 4 DMA request + * @arg TIM_DMA_COM: Commutation DMA request + * @arg TIM_DMA_TRIGGER: Trigger DMA request + * @retval None + */ +#define __HAL_TIM_DISABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->DIER &= ~(__DMA__)) + +/** @brief Check whether the specified TIM interrupt flag is set or not. + * @param __HANDLE__ specifies the TIM Handle. + * @param __FLAG__ specifies the TIM interrupt flag to check. + * This parameter can be one of the following values: + * @arg TIM_FLAG_UPDATE: Update interrupt flag + * @arg TIM_FLAG_CC1: Capture/Compare 1 interrupt flag + * @arg TIM_FLAG_CC2: Capture/Compare 2 interrupt flag + * @arg TIM_FLAG_CC3: Capture/Compare 3 interrupt flag + * @arg TIM_FLAG_CC4: Capture/Compare 4 interrupt flag + * @arg TIM_FLAG_CC5: Capture/Compare 5 interrupt flag (*) + * @arg TIM_FLAG_CC5: Capture/Compare 6 interrupt flag (*) + * @arg TIM_FLAG_COM: Commutation interrupt flag + * @arg TIM_FLAG_TRIGGER: Trigger interrupt flag + * @arg TIM_FLAG_BREAK: Break interrupt flag + * @arg TIM_FLAG_BREAK2: Break 2 interrupt flag (*) + * @arg TIM_FLAG_CC1OF: Capture/Compare 1 overcapture flag + * @arg TIM_FLAG_CC2OF: Capture/Compare 2 overcapture flag + * @arg TIM_FLAG_CC3OF: Capture/Compare 3 overcapture flag + * @arg TIM_FLAG_CC4OF: Capture/Compare 4 overcapture flag + * (*) Value not defined for all devices + * @retval The new state of __FLAG__ (TRUE or FALSE). + */ +#define __HAL_TIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR &(__FLAG__)) == (__FLAG__)) + +/** @brief Clear the specified TIM interrupt flag. + * @param __HANDLE__ specifies the TIM Handle. + * @param __FLAG__ specifies the TIM interrupt flag to clear. + * This parameter can be one of the following values: + * @arg TIM_FLAG_UPDATE: Update interrupt flag + * @arg TIM_FLAG_CC1: Capture/Compare 1 interrupt flag + * @arg TIM_FLAG_CC2: Capture/Compare 2 interrupt flag + * @arg TIM_FLAG_CC3: Capture/Compare 3 interrupt flag + * @arg TIM_FLAG_CC4: Capture/Compare 4 interrupt flag + * @arg TIM_FLAG_CC5: Capture/Compare 5 interrupt flag (*) + * @arg TIM_FLAG_CC5: Capture/Compare 6 interrupt flag (*) + * @arg TIM_FLAG_COM: Commutation interrupt flag + * @arg TIM_FLAG_TRIGGER: Trigger interrupt flag + * @arg TIM_FLAG_BREAK: Break interrupt flag + * @arg TIM_FLAG_BREAK2: Break 2 interrupt flag (*) + * @arg TIM_FLAG_CC1OF: Capture/Compare 1 overcapture flag + * @arg TIM_FLAG_CC2OF: Capture/Compare 2 overcapture flag + * @arg TIM_FLAG_CC3OF: Capture/Compare 3 overcapture flag + * @arg TIM_FLAG_CC4OF: Capture/Compare 4 overcapture flag + * (*) Value not defined for all devices + * @retval The new state of __FLAG__ (TRUE or FALSE). + */ +#define __HAL_TIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__)) + +/** + * @brief Check whether the specified TIM interrupt source is enabled or not. + * @param __HANDLE__ TIM handle + * @param __INTERRUPT__ specifies the TIM interrupt source to check. + * This parameter can be one of the following values: + * @arg TIM_IT_UPDATE: Update interrupt + * @arg TIM_IT_CC1: Capture/Compare 1 interrupt + * @arg TIM_IT_CC2: Capture/Compare 2 interrupt + * @arg TIM_IT_CC3: Capture/Compare 3 interrupt + * @arg TIM_IT_CC4: Capture/Compare 4 interrupt + * @arg TIM_IT_COM: Commutation interrupt + * @arg TIM_IT_TRIGGER: Trigger interrupt + * @arg TIM_IT_BREAK: Break interrupt + * @retval The state of TIM_IT (SET or RESET). + */ +#define __HAL_TIM_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->DIER & (__INTERRUPT__)) \ + == (__INTERRUPT__)) ? SET : RESET) + +/** @brief Clear the TIM interrupt pending bits. + * @param __HANDLE__ TIM handle + * @param __INTERRUPT__ specifies the interrupt pending bit to clear. + * This parameter can be one of the following values: + * @arg TIM_IT_UPDATE: Update interrupt + * @arg TIM_IT_CC1: Capture/Compare 1 interrupt + * @arg TIM_IT_CC2: Capture/Compare 2 interrupt + * @arg TIM_IT_CC3: Capture/Compare 3 interrupt + * @arg TIM_IT_CC4: Capture/Compare 4 interrupt + * @arg TIM_IT_COM: Commutation interrupt + * @arg TIM_IT_TRIGGER: Trigger interrupt + * @arg TIM_IT_BREAK: Break interrupt + * @retval None + */ +#define __HAL_TIM_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->SR = ~(__INTERRUPT__)) +#if defined(TIM_CR1_UIFREMAP) + +/** + * @brief Force a continuous copy of the update interrupt flag (UIF) into the timer counter register (bit 31). + * @note This allows both the counter value and a potential roll-over condition signalled by the UIFCPY flag to be read + * in an atomic way. + * @param __HANDLE__ TIM handle. + * @retval None +mode. + */ +#define __HAL_TIM_UIFREMAP_ENABLE(__HANDLE__) (((__HANDLE__)->Instance->CR1 |= TIM_CR1_UIFREMAP)) + +/** + * @brief Disable update interrupt flag (UIF) remapping. + * @param __HANDLE__ TIM handle. + * @retval None +mode. + */ +#define __HAL_TIM_UIFREMAP_DISABLE(__HANDLE__) (((__HANDLE__)->Instance->CR1 &= ~TIM_CR1_UIFREMAP)) + +/** + * @brief Get update interrupt flag (UIF) copy status. + * @param __COUNTER__ Counter value. + * @retval The state of UIFCPY (TRUE or FALSE). +mode. + */ +#define __HAL_TIM_GET_UIFCPY(__COUNTER__) (((__COUNTER__) & (TIM_CNT_UIFCPY)) == (TIM_CNT_UIFCPY)) +#endif /* TIM_CR1_UIFREMAP */ + +/** + * @brief Indicates whether or not the TIM Counter is used as downcounter. + * @param __HANDLE__ TIM handle. + * @retval False (Counter used as upcounter) or True (Counter used as downcounter) + * @note This macro is particularly useful to get the counting mode when the timer operates in Center-aligned mode + * or Encoder mode. + */ +#define __HAL_TIM_IS_TIM_COUNTING_DOWN(__HANDLE__) (((__HANDLE__)->Instance->CR1 &(TIM_CR1_DIR)) == (TIM_CR1_DIR)) + +/** + * @brief Set the TIM Prescaler on runtime. + * @param __HANDLE__ TIM handle. + * @param __PRESC__ specifies the Prescaler new value. + * @retval None + */ +#define __HAL_TIM_SET_PRESCALER(__HANDLE__, __PRESC__) ((__HANDLE__)->Instance->PSC = (__PRESC__)) + +/** + * @brief Set the TIM Counter Register value on runtime. + * Note Please check if the bit 31 of CNT register is used as UIF copy or not, this may affect the counter range in + * case of 32 bits counter TIM instance. + * Bit 31 of CNT can be enabled/disabled using __HAL_TIM_UIFREMAP_ENABLE()/__HAL_TIM_UIFREMAP_DISABLE() macros. + * @param __HANDLE__ TIM handle. + * @param __COUNTER__ specifies the Counter register new value. + * @retval None + */ +#define __HAL_TIM_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->CNT = (__COUNTER__)) + +/** + * @brief Get the TIM Counter Register value on runtime. + * @param __HANDLE__ TIM handle. + * @retval 16-bit or 32-bit value of the timer counter register (TIMx_CNT) + */ +#define __HAL_TIM_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNT) + +/** + * @brief Set the TIM Autoreload Register value on runtime without calling another time any Init function. + * @param __HANDLE__ TIM handle. + * @param __AUTORELOAD__ specifies the Counter register new value. + * @retval None + */ +#define __HAL_TIM_SET_AUTORELOAD(__HANDLE__, __AUTORELOAD__) \ + do{ \ + (__HANDLE__)->Instance->ARR = (__AUTORELOAD__); \ + (__HANDLE__)->Init.Period = (__AUTORELOAD__); \ + } while(0) + +/** + * @brief Get the TIM Autoreload Register value on runtime. + * @param __HANDLE__ TIM handle. + * @retval 16-bit or 32-bit value of the timer auto-reload register(TIMx_ARR) + */ +#define __HAL_TIM_GET_AUTORELOAD(__HANDLE__) ((__HANDLE__)->Instance->ARR) + +/** + * @brief Set the TIM Clock Division value on runtime without calling another time any Init function. + * @param __HANDLE__ TIM handle. + * @param __CKD__ specifies the clock division value. + * This parameter can be one of the following value: + * @arg TIM_CLOCKDIVISION_DIV1: tDTS=tCK_INT + * @arg TIM_CLOCKDIVISION_DIV2: tDTS=2*tCK_INT + * @arg TIM_CLOCKDIVISION_DIV4: tDTS=4*tCK_INT + * @retval None + */ +#define __HAL_TIM_SET_CLOCKDIVISION(__HANDLE__, __CKD__) \ + do{ \ + (__HANDLE__)->Instance->CR1 &= (~TIM_CR1_CKD); \ + (__HANDLE__)->Instance->CR1 |= (__CKD__); \ + (__HANDLE__)->Init.ClockDivision = (__CKD__); \ + } while(0) + +/** + * @brief Get the TIM Clock Division value on runtime. + * @param __HANDLE__ TIM handle. + * @retval The clock division can be one of the following values: + * @arg TIM_CLOCKDIVISION_DIV1: tDTS=tCK_INT + * @arg TIM_CLOCKDIVISION_DIV2: tDTS=2*tCK_INT + * @arg TIM_CLOCKDIVISION_DIV4: tDTS=4*tCK_INT + */ +#define __HAL_TIM_GET_CLOCKDIVISION(__HANDLE__) ((__HANDLE__)->Instance->CR1 & TIM_CR1_CKD) + +/** + * @brief Set the TIM Input Capture prescaler on runtime without calling another time HAL_TIM_IC_ConfigChannel() + * function. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @param __ICPSC__ specifies the Input Capture4 prescaler new value. + * This parameter can be one of the following values: + * @arg TIM_ICPSC_DIV1: no prescaler + * @arg TIM_ICPSC_DIV2: capture is done once every 2 events + * @arg TIM_ICPSC_DIV4: capture is done once every 4 events + * @arg TIM_ICPSC_DIV8: capture is done once every 8 events + * @retval None + */ +#define __HAL_TIM_SET_ICPRESCALER(__HANDLE__, __CHANNEL__, __ICPSC__) \ + do{ \ + TIM_RESET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__)); \ + TIM_SET_ICPRESCALERVALUE((__HANDLE__), (__CHANNEL__), (__ICPSC__)); \ + } while(0) + +/** + * @brief Get the TIM Input Capture prescaler on runtime. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: get input capture 1 prescaler value + * @arg TIM_CHANNEL_2: get input capture 2 prescaler value + * @arg TIM_CHANNEL_3: get input capture 3 prescaler value + * @arg TIM_CHANNEL_4: get input capture 4 prescaler value + * @retval The input capture prescaler can be one of the following values: + * @arg TIM_ICPSC_DIV1: no prescaler + * @arg TIM_ICPSC_DIV2: capture is done once every 2 events + * @arg TIM_ICPSC_DIV4: capture is done once every 4 events + * @arg TIM_ICPSC_DIV8: capture is done once every 8 events + */ +#define __HAL_TIM_GET_ICPRESCALER(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC1PSC) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? (((__HANDLE__)->Instance->CCMR1 & TIM_CCMR1_IC2PSC) >> 8U) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC3PSC) :\ + (((__HANDLE__)->Instance->CCMR2 & TIM_CCMR2_IC4PSC)) >> 8U) + +/** + * @brief Set the TIM Capture Compare Register value on runtime without calling another time ConfigChannel function. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @param __COMPARE__ specifies the Capture Compare register new value. + * @retval None + */ +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1 = (__COMPARE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2 = (__COMPARE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3 = (__COMPARE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4 = (__COMPARE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5 = (__COMPARE__)) :\ + ((__HANDLE__)->Instance->CCR6 = (__COMPARE__))) +#else +#define __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1 = (__COMPARE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2 = (__COMPARE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3 = (__COMPARE__)) :\ + ((__HANDLE__)->Instance->CCR4 = (__COMPARE__))) +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ + +/** + * @brief Get the TIM Capture Compare Register value on runtime. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channel associated with the capture compare register + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: get capture/compare 1 register value + * @arg TIM_CHANNEL_2: get capture/compare 2 register value + * @arg TIM_CHANNEL_3: get capture/compare 3 register value + * @arg TIM_CHANNEL_4: get capture/compare 4 register value + * @arg TIM_CHANNEL_5: get capture/compare 5 register value (*) + * @arg TIM_CHANNEL_6: get capture/compare 6 register value (*) + * (*) Value not defined for all devices + * @retval 16-bit or 32-bit value of the capture/compare register (TIMx_CCRy) + */ +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3) :\ + ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4) :\ + ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5) :\ + ((__HANDLE__)->Instance->CCR6)) +#else +#define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3) :\ + ((__HANDLE__)->Instance->CCR4)) +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ + +/** + * @brief Set the TIM Output compare preload. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @retval None + */ +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define __HAL_TIM_ENABLE_OCxPRELOAD(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC1PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC2PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC3PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC4PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC5PE) :\ + ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC6PE)) +#else +#define __HAL_TIM_ENABLE_OCxPRELOAD(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC1PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC2PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC3PE) :\ + ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC4PE)) +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ + +/** + * @brief Reset the TIM Output compare preload. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @retval None + */ +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define __HAL_TIM_DISABLE_OCxPRELOAD(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC1PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC2PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC3PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC4PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC5PE) :\ + ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC6PE)) +#else +#define __HAL_TIM_DISABLE_OCxPRELOAD(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC1PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC2PE) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC3PE) :\ + ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC4PE)) +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ + +/** + * @brief Enable fast mode for a given channel. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @note When fast mode is enabled an active edge on the trigger input acts + * like a compare match on CCx output. Delay to sample the trigger + * input and to activate CCx output is reduced to 3 clock cycles. + * @note Fast mode acts only if the channel is configured in PWM1 or PWM2 mode. + * @retval None + */ +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define __HAL_TIM_ENABLE_OCxFAST(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC1FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC2FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC3FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC4FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC5FE) :\ + ((__HANDLE__)->Instance->CCMR3 |= TIM_CCMR3_OC6FE)) +#else +#define __HAL_TIM_ENABLE_OCxFAST(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC1FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= TIM_CCMR1_OC2FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC3FE) :\ + ((__HANDLE__)->Instance->CCMR2 |= TIM_CCMR2_OC4FE)) +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ + +/** + * @brief Disable fast mode for a given channel. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @note When fast mode is disabled CCx output behaves normally depending + * on counter and CCRx values even when the trigger is ON. The minimum + * delay to activate CCx output when an active edge occurs on the + * trigger input is 5 clock cycles. + * @retval None + */ +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define __HAL_TIM_DISABLE_OCxFAST(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC1FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC2FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC3FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC4FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC5FE) :\ + ((__HANDLE__)->Instance->CCMR3 &= ~TIM_CCMR3_OC6FE)) +#else +#define __HAL_TIM_DISABLE_OCxFAST(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC1FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_OC2FE) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC3FE) :\ + ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_OC4FE)) +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ + +/** + * @brief Set the Update Request Source (URS) bit of the TIMx_CR1 register. + * @param __HANDLE__ TIM handle. + * @note When the URS bit of the TIMx_CR1 register is set, only counter + * overflow/underflow generates an update interrupt or DMA request (if + * enabled) + * @retval None + */ +#define __HAL_TIM_URS_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1|= TIM_CR1_URS) + +/** + * @brief Reset the Update Request Source (URS) bit of the TIMx_CR1 register. + * @param __HANDLE__ TIM handle. + * @note When the URS bit of the TIMx_CR1 register is reset, any of the + * following events generate an update interrupt or DMA request (if + * enabled): + * _ Counter overflow underflow + * _ Setting the UG bit + * _ Update generation through the slave mode controller + * @retval None + */ +#define __HAL_TIM_URS_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1&=~TIM_CR1_URS) + +/** + * @brief Set the TIM Capture x input polarity on runtime. + * @param __HANDLE__ TIM handle. + * @param __CHANNEL__ TIM Channels to be configured. + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @param __POLARITY__ Polarity for TIx source + * @arg TIM_INPUTCHANNELPOLARITY_RISING: Rising Edge + * @arg TIM_INPUTCHANNELPOLARITY_FALLING: Falling Edge + * @arg TIM_INPUTCHANNELPOLARITY_BOTHEDGE: Rising and Falling Edge + * @retval None + */ +#define __HAL_TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \ + do{ \ + TIM_RESET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__)); \ + TIM_SET_CAPTUREPOLARITY((__HANDLE__), (__CHANNEL__), (__POLARITY__)); \ + }while(0) + +/** @brief Select the Capture/compare DMA request source. + * @param __HANDLE__ specifies the TIM Handle. + * @param __CCDMA__ specifies Capture/compare DMA request source + * This parameter can be one of the following values: + * @arg TIM_CCDMAREQUEST_CC: CCx DMA request generated on Capture/Compare event + * @arg TIM_CCDMAREQUEST_UPDATE: CCx DMA request generated on Update event + * @retval None + */ +#define __HAL_TIM_SELECT_CCDMAREQUEST(__HANDLE__, __CCDMA__) \ + MODIFY_REG((__HANDLE__)->Instance->CR2, TIM_CR2_CCDS, (__CCDMA__)) + +/** + * @} + */ +/* End of exported macros ----------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup TIM_Private_Constants TIM Private Constants + * @{ + */ +/* The counter of a timer instance is disabled only if all the CCx and CCxN + channels have been disabled */ +#define TIM_CCER_CCxE_MASK ((uint32_t)(TIM_CCER_CC1E | TIM_CCER_CC2E | TIM_CCER_CC3E | TIM_CCER_CC4E)) +#define TIM_CCER_CCxNE_MASK ((uint32_t)(TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) +/** + * @} + */ +/* End of private constants --------------------------------------------------*/ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup TIM_Private_Macros TIM Private Macros + * @{ + */ +#if defined(TIM_SMCR_OCCS) +#define IS_TIM_CLEARINPUT_SOURCE(__MODE__) (((__MODE__) == TIM_CLEARINPUTSOURCE_NONE) || \ + ((__MODE__) == TIM_CLEARINPUTSOURCE_ETR) || \ + ((__MODE__) == TIM_CLEARINPUTSOURCE_OCREFCLR)) +#else +#define IS_TIM_CLEARINPUT_SOURCE(__MODE__) (((__MODE__) == TIM_CLEARINPUTSOURCE_NONE) || \ + ((__MODE__) == TIM_CLEARINPUTSOURCE_ETR)) +#endif /* TIM_SMCR_OCCS */ + +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define IS_TIM_DMA_BASE(__BASE__) (((__BASE__) == TIM_DMABASE_CR1) || \ + ((__BASE__) == TIM_DMABASE_CR2) || \ + ((__BASE__) == TIM_DMABASE_SMCR) || \ + ((__BASE__) == TIM_DMABASE_DIER) || \ + ((__BASE__) == TIM_DMABASE_SR) || \ + ((__BASE__) == TIM_DMABASE_EGR) || \ + ((__BASE__) == TIM_DMABASE_CCMR1) || \ + ((__BASE__) == TIM_DMABASE_CCMR2) || \ + ((__BASE__) == TIM_DMABASE_CCER) || \ + ((__BASE__) == TIM_DMABASE_CNT) || \ + ((__BASE__) == TIM_DMABASE_PSC) || \ + ((__BASE__) == TIM_DMABASE_ARR) || \ + ((__BASE__) == TIM_DMABASE_RCR) || \ + ((__BASE__) == TIM_DMABASE_CCR1) || \ + ((__BASE__) == TIM_DMABASE_CCR2) || \ + ((__BASE__) == TIM_DMABASE_CCR3) || \ + ((__BASE__) == TIM_DMABASE_CCR4) || \ + ((__BASE__) == TIM_DMABASE_BDTR) || \ + ((__BASE__) == TIM_DMABASE_CCMR3) || \ + ((__BASE__) == TIM_DMABASE_CCR5) || \ + ((__BASE__) == TIM_DMABASE_CCR6) || \ + ((__BASE__) == TIM_DMABASE_OR)) +#else +#define IS_TIM_DMA_BASE(__BASE__) (((__BASE__) == TIM_DMABASE_CR1) || \ + ((__BASE__) == TIM_DMABASE_CR2) || \ + ((__BASE__) == TIM_DMABASE_SMCR) || \ + ((__BASE__) == TIM_DMABASE_DIER) || \ + ((__BASE__) == TIM_DMABASE_SR) || \ + ((__BASE__) == TIM_DMABASE_EGR) || \ + ((__BASE__) == TIM_DMABASE_CCMR1) || \ + ((__BASE__) == TIM_DMABASE_CCMR2) || \ + ((__BASE__) == TIM_DMABASE_CCER) || \ + ((__BASE__) == TIM_DMABASE_CNT) || \ + ((__BASE__) == TIM_DMABASE_PSC) || \ + ((__BASE__) == TIM_DMABASE_ARR) || \ + ((__BASE__) == TIM_DMABASE_RCR) || \ + ((__BASE__) == TIM_DMABASE_CCR1) || \ + ((__BASE__) == TIM_DMABASE_CCR2) || \ + ((__BASE__) == TIM_DMABASE_CCR3) || \ + ((__BASE__) == TIM_DMABASE_CCR4) || \ + ((__BASE__) == TIM_DMABASE_BDTR) || \ + ((__BASE__) == TIM_DMABASE_OR)) +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ + +#if defined(TIM_EGR_B2G) +#define IS_TIM_EVENT_SOURCE(__SOURCE__) ((((__SOURCE__) & 0xFFFFFE00U) == 0x00000000U) && ((__SOURCE__) != 0x00000000U)) +#else +#define IS_TIM_EVENT_SOURCE(__SOURCE__) ((((__SOURCE__) & 0xFFFFFF00U) == 0x00000000U) && ((__SOURCE__) != 0x00000000U)) +#endif /* TIM_EGR_B2G */ + +#define IS_TIM_COUNTER_MODE(__MODE__) (((__MODE__) == TIM_COUNTERMODE_UP) || \ + ((__MODE__) == TIM_COUNTERMODE_DOWN) || \ + ((__MODE__) == TIM_COUNTERMODE_CENTERALIGNED1) || \ + ((__MODE__) == TIM_COUNTERMODE_CENTERALIGNED2) || \ + ((__MODE__) == TIM_COUNTERMODE_CENTERALIGNED3)) + +#if defined(TIM_CR1_UIFREMAP) +#define IS_TIM_UIFREMAP_MODE(__MODE__) (((__MODE__) == TIM_UIFREMAP_DISABLE) || \ + ((__MODE__) == TIM_UIFREMAP_ENABLE)) + +#endif /* TIM_CR1_UIFREMAP */ +#define IS_TIM_CLOCKDIVISION_DIV(__DIV__) (((__DIV__) == TIM_CLOCKDIVISION_DIV1) || \ + ((__DIV__) == TIM_CLOCKDIVISION_DIV2) || \ + ((__DIV__) == TIM_CLOCKDIVISION_DIV4)) + +#define IS_TIM_AUTORELOAD_PRELOAD(PRELOAD) (((PRELOAD) == TIM_AUTORELOAD_PRELOAD_DISABLE) || \ + ((PRELOAD) == TIM_AUTORELOAD_PRELOAD_ENABLE)) + +#define IS_TIM_FAST_STATE(__STATE__) (((__STATE__) == TIM_OCFAST_DISABLE) || \ + ((__STATE__) == TIM_OCFAST_ENABLE)) + +#define IS_TIM_OC_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_OCPOLARITY_HIGH) || \ + ((__POLARITY__) == TIM_OCPOLARITY_LOW)) + +#define IS_TIM_OCN_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_OCNPOLARITY_HIGH) || \ + ((__POLARITY__) == TIM_OCNPOLARITY_LOW)) + +#define IS_TIM_OCIDLE_STATE(__STATE__) (((__STATE__) == TIM_OCIDLESTATE_SET) || \ + ((__STATE__) == TIM_OCIDLESTATE_RESET)) + +#define IS_TIM_OCNIDLE_STATE(__STATE__) (((__STATE__) == TIM_OCNIDLESTATE_SET) || \ + ((__STATE__) == TIM_OCNIDLESTATE_RESET)) + +#define IS_TIM_ENCODERINPUT_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ENCODERINPUTPOLARITY_RISING) || \ + ((__POLARITY__) == TIM_ENCODERINPUTPOLARITY_FALLING)) + +#define IS_TIM_IC_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_ICPOLARITY_RISING) || \ + ((__POLARITY__) == TIM_ICPOLARITY_FALLING) || \ + ((__POLARITY__) == TIM_ICPOLARITY_BOTHEDGE)) + +#define IS_TIM_IC_SELECTION(__SELECTION__) (((__SELECTION__) == TIM_ICSELECTION_DIRECTTI) || \ + ((__SELECTION__) == TIM_ICSELECTION_INDIRECTTI) || \ + ((__SELECTION__) == TIM_ICSELECTION_TRC)) + +#define IS_TIM_IC_PRESCALER(__PRESCALER__) (((__PRESCALER__) == TIM_ICPSC_DIV1) || \ + ((__PRESCALER__) == TIM_ICPSC_DIV2) || \ + ((__PRESCALER__) == TIM_ICPSC_DIV4) || \ + ((__PRESCALER__) == TIM_ICPSC_DIV8)) + +#define IS_TIM_OPM_MODE(__MODE__) (((__MODE__) == TIM_OPMODE_SINGLE) || \ + ((__MODE__) == TIM_OPMODE_REPETITIVE)) + +#define IS_TIM_ENCODER_MODE(__MODE__) (((__MODE__) == TIM_ENCODERMODE_TI1) || \ + ((__MODE__) == TIM_ENCODERMODE_TI2) || \ + ((__MODE__) == TIM_ENCODERMODE_TI12)) + +#define IS_TIM_DMA_SOURCE(__SOURCE__) ((((__SOURCE__) & 0xFFFF80FFU) == 0x00000000U) && ((__SOURCE__) != 0x00000000U)) + +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define IS_TIM_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \ + ((__CHANNEL__) == TIM_CHANNEL_2) || \ + ((__CHANNEL__) == TIM_CHANNEL_3) || \ + ((__CHANNEL__) == TIM_CHANNEL_4) || \ + ((__CHANNEL__) == TIM_CHANNEL_5) || \ + ((__CHANNEL__) == TIM_CHANNEL_6) || \ + ((__CHANNEL__) == TIM_CHANNEL_ALL)) +#else +#define IS_TIM_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \ + ((__CHANNEL__) == TIM_CHANNEL_2) || \ + ((__CHANNEL__) == TIM_CHANNEL_3) || \ + ((__CHANNEL__) == TIM_CHANNEL_4) || \ + ((__CHANNEL__) == TIM_CHANNEL_ALL)) +#endif /* TIM_CCER_CC5E &&TIM_CCER_CC6E */ + +#define IS_TIM_OPM_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \ + ((__CHANNEL__) == TIM_CHANNEL_2)) + +#define IS_TIM_PERIOD(__HANDLE__, __PERIOD__) \ + ((IS_TIM_32B_COUNTER_INSTANCE(((__HANDLE__)->Instance)) == 0U) ? (((__PERIOD__) > 0U) && ((__PERIOD__) <= 0x0000FFFFU)) : ((__PERIOD__) > 0U)) + +#define IS_TIM_COMPLEMENTARY_CHANNELS(__CHANNEL__) (((__CHANNEL__) == TIM_CHANNEL_1) || \ + ((__CHANNEL__) == TIM_CHANNEL_2) || \ + ((__CHANNEL__) == TIM_CHANNEL_3)) + +#define IS_TIM_CLOCKSOURCE(__CLOCK__) (((__CLOCK__) == TIM_CLOCKSOURCE_INTERNAL) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_ETRMODE1) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_ETRMODE2) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_TI1ED) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_TI1) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_TI2) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_ITR0) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_ITR1) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_ITR2) || \ + ((__CLOCK__) == TIM_CLOCKSOURCE_ITR3)) + +#define IS_TIM_CLOCKPOLARITY(__POLARITY__) (((__POLARITY__) == TIM_CLOCKPOLARITY_INVERTED) || \ + ((__POLARITY__) == TIM_CLOCKPOLARITY_NONINVERTED) || \ + ((__POLARITY__) == TIM_CLOCKPOLARITY_RISING) || \ + ((__POLARITY__) == TIM_CLOCKPOLARITY_FALLING) || \ + ((__POLARITY__) == TIM_CLOCKPOLARITY_BOTHEDGE)) + +#define IS_TIM_CLOCKPRESCALER(__PRESCALER__) (((__PRESCALER__) == TIM_CLOCKPRESCALER_DIV1) || \ + ((__PRESCALER__) == TIM_CLOCKPRESCALER_DIV2) || \ + ((__PRESCALER__) == TIM_CLOCKPRESCALER_DIV4) || \ + ((__PRESCALER__) == TIM_CLOCKPRESCALER_DIV8)) + +#define IS_TIM_CLOCKFILTER(__ICFILTER__) ((__ICFILTER__) <= 0xFU) + +#define IS_TIM_CLEARINPUT_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_CLEARINPUTPOLARITY_INVERTED) || \ + ((__POLARITY__) == TIM_CLEARINPUTPOLARITY_NONINVERTED)) + +#define IS_TIM_CLEARINPUT_PRESCALER(__PRESCALER__) (((__PRESCALER__) == TIM_CLEARINPUTPRESCALER_DIV1) || \ + ((__PRESCALER__) == TIM_CLEARINPUTPRESCALER_DIV2) || \ + ((__PRESCALER__) == TIM_CLEARINPUTPRESCALER_DIV4) || \ + ((__PRESCALER__) == TIM_CLEARINPUTPRESCALER_DIV8)) + +#define IS_TIM_CLEARINPUT_FILTER(__ICFILTER__) ((__ICFILTER__) <= 0xFU) + +#define IS_TIM_OSSR_STATE(__STATE__) (((__STATE__) == TIM_OSSR_ENABLE) || \ + ((__STATE__) == TIM_OSSR_DISABLE)) + +#define IS_TIM_OSSI_STATE(__STATE__) (((__STATE__) == TIM_OSSI_ENABLE) || \ + ((__STATE__) == TIM_OSSI_DISABLE)) + +#define IS_TIM_LOCK_LEVEL(__LEVEL__) (((__LEVEL__) == TIM_LOCKLEVEL_OFF) || \ + ((__LEVEL__) == TIM_LOCKLEVEL_1) || \ + ((__LEVEL__) == TIM_LOCKLEVEL_2) || \ + ((__LEVEL__) == TIM_LOCKLEVEL_3)) + +#define IS_TIM_BREAK_FILTER(__BRKFILTER__) ((__BRKFILTER__) <= 0xFUL) + + +#define IS_TIM_BREAK_STATE(__STATE__) (((__STATE__) == TIM_BREAK_ENABLE) || \ + ((__STATE__) == TIM_BREAK_DISABLE)) + +#define IS_TIM_BREAK_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_BREAKPOLARITY_LOW) || \ + ((__POLARITY__) == TIM_BREAKPOLARITY_HIGH)) + +#if defined(TIM_BDTR_BK2E) +#define IS_TIM_BREAK2_STATE(__STATE__) (((__STATE__) == TIM_BREAK2_ENABLE) || \ + ((__STATE__) == TIM_BREAK2_DISABLE)) + +#define IS_TIM_BREAK2_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_BREAK2POLARITY_LOW) || \ + ((__POLARITY__) == TIM_BREAK2POLARITY_HIGH)) +#endif /* TIM_BDTR_BK2E */ + +#define IS_TIM_AUTOMATIC_OUTPUT_STATE(__STATE__) (((__STATE__) == TIM_AUTOMATICOUTPUT_ENABLE) || \ + ((__STATE__) == TIM_AUTOMATICOUTPUT_DISABLE)) + +#if defined(TIM_CCR5_CCR5) +#define IS_TIM_GROUPCH5(__OCREF__) ((((__OCREF__) & 0x1FFFFFFFU) == 0x00000000U)) +#endif /* TIM_CCR5_CCR5 */ + +#define IS_TIM_TRGO_SOURCE(__SOURCE__) (((__SOURCE__) == TIM_TRGO_RESET) || \ + ((__SOURCE__) == TIM_TRGO_ENABLE) || \ + ((__SOURCE__) == TIM_TRGO_UPDATE) || \ + ((__SOURCE__) == TIM_TRGO_OC1) || \ + ((__SOURCE__) == TIM_TRGO_OC1REF) || \ + ((__SOURCE__) == TIM_TRGO_OC2REF) || \ + ((__SOURCE__) == TIM_TRGO_OC3REF) || \ + ((__SOURCE__) == TIM_TRGO_OC4REF)) + +#if defined(TIM_CR2_MMS2) +#define IS_TIM_TRGO2_SOURCE(__SOURCE__) (((__SOURCE__) == TIM_TRGO2_RESET) || \ + ((__SOURCE__) == TIM_TRGO2_ENABLE) || \ + ((__SOURCE__) == TIM_TRGO2_UPDATE) || \ + ((__SOURCE__) == TIM_TRGO2_OC1) || \ + ((__SOURCE__) == TIM_TRGO2_OC1REF) || \ + ((__SOURCE__) == TIM_TRGO2_OC2REF) || \ + ((__SOURCE__) == TIM_TRGO2_OC3REF) || \ + ((__SOURCE__) == TIM_TRGO2_OC3REF) || \ + ((__SOURCE__) == TIM_TRGO2_OC4REF) || \ + ((__SOURCE__) == TIM_TRGO2_OC5REF) || \ + ((__SOURCE__) == TIM_TRGO2_OC6REF) || \ + ((__SOURCE__) == TIM_TRGO2_OC4REF_RISINGFALLING) || \ + ((__SOURCE__) == TIM_TRGO2_OC6REF_RISINGFALLING) || \ + ((__SOURCE__) == TIM_TRGO2_OC4REF_RISING_OC6REF_RISING) || \ + ((__SOURCE__) == TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING) || \ + ((__SOURCE__) == TIM_TRGO2_OC5REF_RISING_OC6REF_RISING) || \ + ((__SOURCE__) == TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING)) +#endif /* TIM_CR2_MMS2 */ + +#define IS_TIM_MSM_STATE(__STATE__) (((__STATE__) == TIM_MASTERSLAVEMODE_ENABLE) || \ + ((__STATE__) == TIM_MASTERSLAVEMODE_DISABLE)) + +#if defined (TIM_SMCR_SMS_3) +#define IS_TIM_SLAVE_MODE(__MODE__) (((__MODE__) == TIM_SLAVEMODE_DISABLE) || \ + ((__MODE__) == TIM_SLAVEMODE_RESET) || \ + ((__MODE__) == TIM_SLAVEMODE_GATED) || \ + ((__MODE__) == TIM_SLAVEMODE_TRIGGER) || \ + ((__MODE__) == TIM_SLAVEMODE_EXTERNAL1) || \ + ((__MODE__) == TIM_SLAVEMODE_COMBINED_RESETTRIGGER)) +#else +#define IS_TIM_SLAVE_MODE(__MODE__) (((__MODE__) == TIM_SLAVEMODE_DISABLE) || \ + ((__MODE__) == TIM_SLAVEMODE_RESET) || \ + ((__MODE__) == TIM_SLAVEMODE_GATED) || \ + ((__MODE__) == TIM_SLAVEMODE_TRIGGER) || \ + ((__MODE__) == TIM_SLAVEMODE_EXTERNAL1)) +#endif /* TIM_SMCR_SMS_3 */ + +#if defined(TIM_CCMR1_OC1M_3) +#define IS_TIM_PWM_MODE(__MODE__) (((__MODE__) == TIM_OCMODE_PWM1) || \ + ((__MODE__) == TIM_OCMODE_PWM2) || \ + ((__MODE__) == TIM_OCMODE_COMBINED_PWM1) || \ + ((__MODE__) == TIM_OCMODE_COMBINED_PWM2) || \ + ((__MODE__) == TIM_OCMODE_ASSYMETRIC_PWM1) || \ + ((__MODE__) == TIM_OCMODE_ASSYMETRIC_PWM2)) +#else +#define IS_TIM_PWM_MODE(__MODE__) (((__MODE__) == TIM_OCMODE_PWM1) || \ + ((__MODE__) == TIM_OCMODE_PWM2)) +#endif /* TIM_CCMR1_OC1M_3 */ + +#if defined(TIM_CCMR1_OC1M_3) +#define IS_TIM_OC_MODE(__MODE__) (((__MODE__) == TIM_OCMODE_TIMING) || \ + ((__MODE__) == TIM_OCMODE_ACTIVE) || \ + ((__MODE__) == TIM_OCMODE_INACTIVE) || \ + ((__MODE__) == TIM_OCMODE_TOGGLE) || \ + ((__MODE__) == TIM_OCMODE_FORCED_ACTIVE) || \ + ((__MODE__) == TIM_OCMODE_FORCED_INACTIVE) || \ + ((__MODE__) == TIM_OCMODE_RETRIGERRABLE_OPM1) || \ + ((__MODE__) == TIM_OCMODE_RETRIGERRABLE_OPM2)) +#else +#define IS_TIM_OC_MODE(__MODE__) (((__MODE__) == TIM_OCMODE_TIMING) || \ + ((__MODE__) == TIM_OCMODE_ACTIVE) || \ + ((__MODE__) == TIM_OCMODE_INACTIVE) || \ + ((__MODE__) == TIM_OCMODE_TOGGLE) || \ + ((__MODE__) == TIM_OCMODE_FORCED_ACTIVE) || \ + ((__MODE__) == TIM_OCMODE_FORCED_INACTIVE)) +#endif /* TIM_CCMR1_OC1M_3 */ + +#define IS_TIM_TRIGGER_SELECTION(__SELECTION__) (((__SELECTION__) == TIM_TS_ITR0) || \ + ((__SELECTION__) == TIM_TS_ITR1) || \ + ((__SELECTION__) == TIM_TS_ITR2) || \ + ((__SELECTION__) == TIM_TS_ITR3) || \ + ((__SELECTION__) == TIM_TS_TI1F_ED) || \ + ((__SELECTION__) == TIM_TS_TI1FP1) || \ + ((__SELECTION__) == TIM_TS_TI2FP2) || \ + ((__SELECTION__) == TIM_TS_ETRF)) + +#define IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(__SELECTION__) (((__SELECTION__) == TIM_TS_ITR0) || \ + ((__SELECTION__) == TIM_TS_ITR1) || \ + ((__SELECTION__) == TIM_TS_ITR2) || \ + ((__SELECTION__) == TIM_TS_ITR3) || \ + ((__SELECTION__) == TIM_TS_NONE)) + +#define IS_TIM_TRIGGERPOLARITY(__POLARITY__) (((__POLARITY__) == TIM_TRIGGERPOLARITY_INVERTED ) || \ + ((__POLARITY__) == TIM_TRIGGERPOLARITY_NONINVERTED) || \ + ((__POLARITY__) == TIM_TRIGGERPOLARITY_RISING ) || \ + ((__POLARITY__) == TIM_TRIGGERPOLARITY_FALLING ) || \ + ((__POLARITY__) == TIM_TRIGGERPOLARITY_BOTHEDGE )) + +#define IS_TIM_TRIGGERPRESCALER(__PRESCALER__) (((__PRESCALER__) == TIM_TRIGGERPRESCALER_DIV1) || \ + ((__PRESCALER__) == TIM_TRIGGERPRESCALER_DIV2) || \ + ((__PRESCALER__) == TIM_TRIGGERPRESCALER_DIV4) || \ + ((__PRESCALER__) == TIM_TRIGGERPRESCALER_DIV8)) + +#define IS_TIM_TRIGGERFILTER(__ICFILTER__) ((__ICFILTER__) <= 0xFU) + +#define IS_TIM_TI1SELECTION(__TI1SELECTION__) (((__TI1SELECTION__) == TIM_TI1SELECTION_CH1) || \ + ((__TI1SELECTION__) == TIM_TI1SELECTION_XORCOMBINATION)) + +#define IS_TIM_DMA_LENGTH(__LENGTH__) (((__LENGTH__) == TIM_DMABURSTLENGTH_1TRANSFER) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_2TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_3TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_4TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_5TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_6TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_7TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_8TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_9TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_10TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_11TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_12TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_13TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_14TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_15TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_16TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_17TRANSFERS) || \ + ((__LENGTH__) == TIM_DMABURSTLENGTH_18TRANSFERS)) + +#define IS_TIM_DMA_DATA_LENGTH(LENGTH) (((LENGTH) >= 0x1U) && ((LENGTH) < 0x10000U)) + +#define IS_TIM_IC_FILTER(__ICFILTER__) ((__ICFILTER__) <= 0xFU) + +#define IS_TIM_DEADTIME(__DEADTIME__) ((__DEADTIME__) <= 0xFFU) + +#if defined (TIM_SMCR_SMS_3) +#define IS_TIM_SLAVEMODE_TRIGGER_ENABLED(__TRIGGER__) (((__TRIGGER__) == TIM_SLAVEMODE_TRIGGER) || \ + ((__TRIGGER__) == TIM_SLAVEMODE_COMBINED_RESETTRIGGER)) +#else +#define IS_TIM_SLAVEMODE_TRIGGER_ENABLED(__TRIGGER__) ((__TRIGGER__) == TIM_SLAVEMODE_TRIGGER) +#endif /* TIM_SMCR_SMS_3 */ + +#define TIM_SET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__, __ICPSC__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 |= (__ICPSC__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 |= ((__ICPSC__) << 8U)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 |= (__ICPSC__)) :\ + ((__HANDLE__)->Instance->CCMR2 |= ((__ICPSC__) << 8U))) + +#define TIM_RESET_ICPRESCALERVALUE(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_IC1PSC) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCMR1 &= ~TIM_CCMR1_IC2PSC) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_IC3PSC) :\ + ((__HANDLE__)->Instance->CCMR2 &= ~TIM_CCMR2_IC4PSC)) + +#define TIM_SET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__, __POLARITY__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER |= (__POLARITY__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 4U)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER |= ((__POLARITY__) << 8U)) :\ + ((__HANDLE__)->Instance->CCER |= (((__POLARITY__) << 12U)))) + +#define TIM_RESET_CAPTUREPOLARITY(__HANDLE__, __CHANNEL__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC3P | TIM_CCER_CC3NP)) :\ + ((__HANDLE__)->Instance->CCER &= ~(TIM_CCER_CC4P | TIM_CCER_CC4NP))) + +#if defined(TIM_CCER_CC5E) && defined(TIM_CCER_CC6E) +#define TIM_CHANNEL_STATE_GET(__HANDLE__, __CHANNEL__)\ + (((__CHANNEL__) == TIM_CHANNEL_1) ? (__HANDLE__)->ChannelState[0] :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? (__HANDLE__)->ChannelState[1] :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? (__HANDLE__)->ChannelState[2] :\ + ((__CHANNEL__) == TIM_CHANNEL_4) ? (__HANDLE__)->ChannelState[3] :\ + ((__CHANNEL__) == TIM_CHANNEL_5) ? (__HANDLE__)->ChannelState[4] :\ + (__HANDLE__)->ChannelState[5]) + +#define TIM_CHANNEL_STATE_SET(__HANDLE__, __CHANNEL__, __CHANNEL_STATE__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->ChannelState[0] = (__CHANNEL_STATE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->ChannelState[1] = (__CHANNEL_STATE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->ChannelState[2] = (__CHANNEL_STATE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->ChannelState[3] = (__CHANNEL_STATE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->ChannelState[4] = (__CHANNEL_STATE__)) :\ + ((__HANDLE__)->ChannelState[5] = (__CHANNEL_STATE__))) + +#define TIM_CHANNEL_STATE_SET_ALL(__HANDLE__, __CHANNEL_STATE__) do { \ + (__HANDLE__)->ChannelState[0] = \ + (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelState[1] = \ + (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelState[2] = \ + (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelState[3] = \ + (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelState[4] = \ + (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelState[5] = \ + (__CHANNEL_STATE__); \ + } while(0) +#else +#define TIM_CHANNEL_STATE_GET(__HANDLE__, __CHANNEL__)\ + (((__CHANNEL__) == TIM_CHANNEL_1) ? (__HANDLE__)->ChannelState[0] :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? (__HANDLE__)->ChannelState[1] :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? (__HANDLE__)->ChannelState[2] :\ + (__HANDLE__)->ChannelState[3]) + +#define TIM_CHANNEL_STATE_SET(__HANDLE__, __CHANNEL__, __CHANNEL_STATE__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->ChannelState[0] = (__CHANNEL_STATE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->ChannelState[1] = (__CHANNEL_STATE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->ChannelState[2] = (__CHANNEL_STATE__)) :\ + ((__HANDLE__)->ChannelState[3] = (__CHANNEL_STATE__))) + +#define TIM_CHANNEL_STATE_SET_ALL(__HANDLE__, __CHANNEL_STATE__) do { \ + (__HANDLE__)->ChannelState[0] = (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelState[1] = (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelState[2] = (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelState[3] = (__CHANNEL_STATE__); \ + } while(0) +#endif /* TIM_CCER_CC5E && TIM_CCER_CC6E */ + +#define TIM_CHANNEL_N_STATE_GET(__HANDLE__, __CHANNEL__)\ + (((__CHANNEL__) == TIM_CHANNEL_1) ? (__HANDLE__)->ChannelNState[0] :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? (__HANDLE__)->ChannelNState[1] :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? (__HANDLE__)->ChannelNState[2] :\ + (__HANDLE__)->ChannelNState[3]) + +#define TIM_CHANNEL_N_STATE_SET(__HANDLE__, __CHANNEL__, __CHANNEL_STATE__) \ + (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->ChannelNState[0] = (__CHANNEL_STATE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->ChannelNState[1] = (__CHANNEL_STATE__)) :\ + ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->ChannelNState[2] = (__CHANNEL_STATE__)) :\ + ((__HANDLE__)->ChannelNState[3] = (__CHANNEL_STATE__))) + +#define TIM_CHANNEL_N_STATE_SET_ALL(__HANDLE__, __CHANNEL_STATE__) do { \ + (__HANDLE__)->ChannelNState[0] = \ + (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelNState[1] = \ + (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelNState[2] = \ + (__CHANNEL_STATE__); \ + (__HANDLE__)->ChannelNState[3] = \ + (__CHANNEL_STATE__); \ + } while(0) + +/** + * @} + */ +/* End of private macros -----------------------------------------------------*/ + +/* Include TIM HAL Extended module */ +#include "stm32f3xx_hal_tim_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup TIM_Exported_Functions TIM Exported Functions + * @{ + */ + +/** @addtogroup TIM_Exported_Functions_Group1 TIM Time Base functions + * @brief Time Base functions + * @{ + */ +/* Time Base functions ********************************************************/ +HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim); +HAL_StatusTypeDef HAL_TIM_Base_DeInit(TIM_HandleTypeDef *htim); +void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim); +void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim); +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIM_Base_Start(TIM_HandleTypeDef *htim); +HAL_StatusTypeDef HAL_TIM_Base_Stop(TIM_HandleTypeDef *htim); +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIM_Base_Start_IT(TIM_HandleTypeDef *htim); +HAL_StatusTypeDef HAL_TIM_Base_Stop_IT(TIM_HandleTypeDef *htim); +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_TIM_Base_Start_DMA(TIM_HandleTypeDef *htim, const uint32_t *pData, uint16_t Length); +HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA(TIM_HandleTypeDef *htim); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group2 TIM Output Compare functions + * @brief TIM Output Compare functions + * @{ + */ +/* Timer Output Compare functions *********************************************/ +HAL_StatusTypeDef HAL_TIM_OC_Init(TIM_HandleTypeDef *htim); +HAL_StatusTypeDef HAL_TIM_OC_DeInit(TIM_HandleTypeDef *htim); +void HAL_TIM_OC_MspInit(TIM_HandleTypeDef *htim); +void HAL_TIM_OC_MspDeInit(TIM_HandleTypeDef *htim); +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIM_OC_Start(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_OC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIM_OC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_OC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData, + uint16_t Length); +HAL_StatusTypeDef HAL_TIM_OC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group3 TIM PWM functions + * @brief TIM PWM functions + * @{ + */ +/* Timer PWM functions ********************************************************/ +HAL_StatusTypeDef HAL_TIM_PWM_Init(TIM_HandleTypeDef *htim); +HAL_StatusTypeDef HAL_TIM_PWM_DeInit(TIM_HandleTypeDef *htim); +void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim); +void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef *htim); +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIM_PWM_Start(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_PWM_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIM_PWM_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_PWM_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData, + uint16_t Length); +HAL_StatusTypeDef HAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group4 TIM Input Capture functions + * @brief TIM Input Capture functions + * @{ + */ +/* Timer Input Capture functions **********************************************/ +HAL_StatusTypeDef HAL_TIM_IC_Init(TIM_HandleTypeDef *htim); +HAL_StatusTypeDef HAL_TIM_IC_DeInit(TIM_HandleTypeDef *htim); +void HAL_TIM_IC_MspInit(TIM_HandleTypeDef *htim); +void HAL_TIM_IC_MspDeInit(TIM_HandleTypeDef *htim); +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIM_IC_Start(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_IC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIM_IC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_IC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length); +HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group5 TIM One Pulse functions + * @brief TIM One Pulse functions + * @{ + */ +/* Timer One Pulse functions **************************************************/ +HAL_StatusTypeDef HAL_TIM_OnePulse_Init(TIM_HandleTypeDef *htim, uint32_t OnePulseMode); +HAL_StatusTypeDef HAL_TIM_OnePulse_DeInit(TIM_HandleTypeDef *htim); +void HAL_TIM_OnePulse_MspInit(TIM_HandleTypeDef *htim); +void HAL_TIM_OnePulse_MspDeInit(TIM_HandleTypeDef *htim); +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIM_OnePulse_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel); +HAL_StatusTypeDef HAL_TIM_OnePulse_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel); +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIM_OnePulse_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); +HAL_StatusTypeDef HAL_TIM_OnePulse_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group6 TIM Encoder functions + * @brief TIM Encoder functions + * @{ + */ +/* Timer Encoder functions ****************************************************/ +HAL_StatusTypeDef HAL_TIM_Encoder_Init(TIM_HandleTypeDef *htim, const TIM_Encoder_InitTypeDef *sConfig); +HAL_StatusTypeDef HAL_TIM_Encoder_DeInit(TIM_HandleTypeDef *htim); +void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef *htim); +void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef *htim); +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIM_Encoder_Start(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_Encoder_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIM_Encoder_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData1, + uint32_t *pData2, uint16_t Length); +HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIM_Exported_Functions_Group7 TIM IRQ handler management + * @brief IRQ handler management + * @{ + */ +/* Interrupt Handler functions ***********************************************/ +void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim); +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group8 TIM Peripheral Control functions + * @brief Peripheral Control functions + * @{ + */ +/* Control functions *********************************************************/ +HAL_StatusTypeDef HAL_TIM_OC_ConfigChannel(TIM_HandleTypeDef *htim, const TIM_OC_InitTypeDef *sConfig, + uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, const TIM_OC_InitTypeDef *sConfig, + uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_IC_ConfigChannel(TIM_HandleTypeDef *htim, const TIM_IC_InitTypeDef *sConfig, + uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_OnePulse_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OnePulse_InitTypeDef *sConfig, + uint32_t OutputChannel, uint32_t InputChannel); +HAL_StatusTypeDef HAL_TIM_ConfigOCrefClear(TIM_HandleTypeDef *htim, + const TIM_ClearInputConfigTypeDef *sClearInputConfig, + uint32_t Channel); +HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, const TIM_ClockConfigTypeDef *sClockSourceConfig); +HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_Selection); +HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchro(TIM_HandleTypeDef *htim, const TIM_SlaveConfigTypeDef *sSlaveConfig); +HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchro_IT(TIM_HandleTypeDef *htim, const TIM_SlaveConfigTypeDef *sSlaveConfig); +HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, + uint32_t BurstRequestSrc, const uint32_t *BurstBuffer, uint32_t BurstLength); +HAL_StatusTypeDef HAL_TIM_DMABurst_MultiWriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, + uint32_t BurstRequestSrc, const uint32_t *BurstBuffer, + uint32_t BurstLength, uint32_t DataLength); +HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc); +HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, + uint32_t BurstRequestSrc, uint32_t *BurstBuffer, uint32_t BurstLength); +HAL_StatusTypeDef HAL_TIM_DMABurst_MultiReadStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, + uint32_t BurstRequestSrc, uint32_t *BurstBuffer, + uint32_t BurstLength, uint32_t DataLength); +HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc); +HAL_StatusTypeDef HAL_TIM_GenerateEvent(TIM_HandleTypeDef *htim, uint32_t EventSource); +uint32_t HAL_TIM_ReadCapturedValue(const TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group9 TIM Callbacks functions + * @brief TIM Callbacks functions + * @{ + */ +/* Callback in non blocking modes (Interrupt and DMA) *************************/ +void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_PeriodElapsedHalfCpltCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_IC_CaptureHalfCpltCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_PWM_PulseFinishedHalfCpltCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_TriggerCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_TriggerHalfCpltCallback(TIM_HandleTypeDef *htim); +void HAL_TIM_ErrorCallback(TIM_HandleTypeDef *htim); + +/* Callbacks Register/UnRegister functions ***********************************/ +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) +HAL_StatusTypeDef HAL_TIM_RegisterCallback(TIM_HandleTypeDef *htim, HAL_TIM_CallbackIDTypeDef CallbackID, + pTIM_CallbackTypeDef pCallback); +HAL_StatusTypeDef HAL_TIM_UnRegisterCallback(TIM_HandleTypeDef *htim, HAL_TIM_CallbackIDTypeDef CallbackID); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group10 TIM Peripheral State functions + * @brief Peripheral State functions + * @{ + */ +/* Peripheral State functions ************************************************/ +HAL_TIM_StateTypeDef HAL_TIM_Base_GetState(const TIM_HandleTypeDef *htim); +HAL_TIM_StateTypeDef HAL_TIM_OC_GetState(const TIM_HandleTypeDef *htim); +HAL_TIM_StateTypeDef HAL_TIM_PWM_GetState(const TIM_HandleTypeDef *htim); +HAL_TIM_StateTypeDef HAL_TIM_IC_GetState(const TIM_HandleTypeDef *htim); +HAL_TIM_StateTypeDef HAL_TIM_OnePulse_GetState(const TIM_HandleTypeDef *htim); +HAL_TIM_StateTypeDef HAL_TIM_Encoder_GetState(const TIM_HandleTypeDef *htim); + +/* Peripheral Channel state functions ************************************************/ +HAL_TIM_ActiveChannel HAL_TIM_GetActiveChannel(const TIM_HandleTypeDef *htim); +HAL_TIM_ChannelStateTypeDef HAL_TIM_GetChannelState(const TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_TIM_DMABurstStateTypeDef HAL_TIM_DMABurstState(const TIM_HandleTypeDef *htim); +/** + * @} + */ + +/** + * @} + */ +/* End of exported functions -------------------------------------------------*/ + +/* Private functions----------------------------------------------------------*/ +/** @defgroup TIM_Private_Functions TIM Private Functions + * @{ + */ +void TIM_Base_SetConfig(TIM_TypeDef *TIMx, const TIM_Base_InitTypeDef *Structure); +void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, uint32_t TIM_ICFilter); +void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config); +void TIM_ETR_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ExtTRGPrescaler, + uint32_t TIM_ExtTRGPolarity, uint32_t ExtTRGFilter); + +void TIM_DMADelayPulseHalfCplt(DMA_HandleTypeDef *hdma); +void TIM_DMAError(DMA_HandleTypeDef *hdma); +void TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma); +void TIM_DMACaptureHalfCplt(DMA_HandleTypeDef *hdma); +void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState); + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) +void TIM_ResetCallback(TIM_HandleTypeDef *htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + +/** + * @} + */ +/* End of private functions --------------------------------------------------*/ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32F3xx_HAL_TIM_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h new file mode 100644 index 0000000..b95c503 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h @@ -0,0 +1,342 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_tim_ex.h + * @author MCD Application Team + * @brief Header file of TIM HAL Extended module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_HAL_TIM_EX_H +#define STM32F3xx_HAL_TIM_EX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup TIMEx + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup TIMEx_Exported_Types TIM Extended Exported Types + * @{ + */ + +/** + * @brief TIM Hall sensor Configuration Structure definition + */ + +typedef struct +{ + uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal. + This parameter can be a value of @ref TIM_Input_Capture_Polarity */ + + uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler. + This parameter can be a value of @ref TIM_Input_Capture_Prescaler */ + + uint32_t IC1Filter; /*!< Specifies the input capture filter. + This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ + + uint32_t Commutation_Delay; /*!< Specifies the pulse value to be loaded into the Capture Compare Register. + This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ +} TIM_HallSensor_InitTypeDef; +/** + * @} + */ +/* End of exported types -----------------------------------------------------*/ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup TIMEx_Exported_Constants TIM Extended Exported Constants + * @{ + */ + +/** @defgroup TIMEx_Remap TIM Extended Remapping + * @{ + */ +#if defined(TIM1) +#define TIM_TIM1_ADC1_NONE (0x00000000U) /*!< TIM1_ETR is not connected to any AWD (analog watchdog)*/ +#define TIM_TIM1_ADC1_AWD1 (0x00000001U) /*!< TIM1_ETR is connected to ADC1 AWD1 */ +#define TIM_TIM1_ADC1_AWD2 (0x00000002U) /*!< TIM1_ETR is connected to ADC1 AWD2 */ +#define TIM_TIM1_ADC1_AWD3 (0x00000003U) /*!< TIM1_ETR is connected to ADC1 AWD3 */ + +#if defined(ADC4) +#define TIM_TIM1_ADC4_NONE (0x00000000U) /*!< TIM1_ETR is not connected to any AWD (analog watchdog)*/ +#define TIM_TIM1_ADC4_AWD1 (0x00000004U) /*!< TIM1_ETR is connected to ADC4 AWD1 */ +#define TIM_TIM1_ADC4_AWD2 (0x00000008U) /*!< TIM1_ETR is connected to ADC4 AWD2 */ +#define TIM_TIM1_ADC4_AWD3 (0x0000000CU) /*!< TIM1_ETR is connected to ADC4 AWD3 */ +#elif defined(ADC2) +#define TIM_TIM1_ADC2_NONE (0x00000000U) /*!< TIM1_ETR is not connected to any AWD (analog watchdog)*/ +#define TIM_TIM1_ADC2_AWD1 (0x00000004U) /*!< TIM1_ETR is connected to ADC2 AWD1 */ +#define TIM_TIM1_ADC2_AWD2 (0x00000008U) /*!< TIM1_ETR is connected to ADC2 AWD2 */ +#define TIM_TIM1_ADC2_AWD3 (0x0000000CU) /*!< TIM1_ETR is connected to ADC2 AWD3 */ +#endif /* ADC4 */ +#endif /* TIM1 */ + +#if defined(TIM8) +#define TIM_TIM8_ADC2_NONE (0x00000000U) /*!< TIM8_ETR is not connected to any AWD (analog watchdog) */ +#define TIM_TIM8_ADC2_AWD1 (0x00000001U) /*!< TIM8_ETR is connected to ADC2 AWD1 */ +#define TIM_TIM8_ADC2_AWD2 (0x00000002U) /*!< TIM8_ETR is connected to ADC2 AWD2 */ +#define TIM_TIM8_ADC2_AWD3 (0x00000003U) /*!< TIM8_ETR is connected to ADC2 AWD3 */ + +#define TIM_TIM8_ADC3_NONE (0x00000000U) /*!< TIM8_ETR is not connected to any AWD (analog watchdog) */ +#define TIM_TIM8_ADC3_AWD1 (0x00000004U) /*!< TIM8_ETR is connected to ADC3 AWD1 */ +#define TIM_TIM8_ADC3_AWD2 (0x00000008U) /*!< TIM8_ETR is connected to ADC3 AWD2 */ +#define TIM_TIM8_ADC3_AWD3 (0x0000000CU) /*!< TIM8_ETR is connected to ADC3 AWD3 */ +#endif /* TIM8 */ + +#if defined(TIM14) +#define TIM_TIM14_GPIO (0x00000000U) /*!< TIM14 TI1 is connected to GPIO */ +#define TIM_TIM14_RTC (0x00000001U) /*!< TIM14 TI1 is connected to RTC_clock */ +#define TIM_TIM14_HSE (0x00000002U) /*!< TIM14 TI1 is connected to HSE/32U */ +#define TIM_TIM14_MCO (0x00000003U) /*!< TIM14 TI1 is connected to MCO */ +#endif /* TIM14 */ + +#if defined(TIM16) +#define TIM_TIM16_GPIO (0x00000000U) /*!< TIM16 TI1 is connected to GPIO */ +#define TIM_TIM16_RTC (0x00000001U) /*!< TIM16 TI1 is connected to RTC_clock */ +#define TIM_TIM16_HSE (0x00000002U) /*!< TIM16 TI1 is connected to HSE/32 */ +#define TIM_TIM16_MCO (0x00000003U) /*!< TIM16 TI1 is connected to MCO */ +#endif /* TIM16 */ + +#if defined(TIM20) +#define TIM_TIM20_ADC3_NONE (0x00000000U) /*!< TIM20_ETR is not connected to any AWD (analog watchdog) */ +#define TIM_TIM20_ADC3_AWD1 (0x00000001U) /*!< TIM20_ETR is connected to ADC3 AWD1 */ +#define TIM_TIM20_ADC3_AWD2 (0x00000002U) /*!< TIM20_ETR is connected to ADC3 AWD2 */ +#define TIM_TIM20_ADC3_AWD3 (0x00000003U) /*!< TIM20_ETR is connected to ADC3 AWD3 */ + +#define TIM_TIM20_ADC4_NONE (0x00000000U) /*!< TIM20_ETR is not connected to any AWD (analog watchdog) */ +#define TIM_TIM20_ADC4_AWD1 (0x00000004U) /*!< TIM20_ETR is connected to ADC4 AWD1 */ +#define TIM_TIM20_ADC4_AWD2 (0x00000008U) /*!< TIM20_ETR is connected to ADC4 AWD2 */ +#define TIM_TIM20_ADC4_AWD3 (0x0000000CU) /*!< TIM20_ETR is connected to ADC4 AWD3 */ +#endif /* TIM20 */ +/** + * @} + */ + +/** + * @} + */ +/* End of exported constants -------------------------------------------------*/ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup TIMEx_Exported_Macros TIM Extended Exported Macros + * @{ + */ + +/** + * @} + */ +/* End of exported macro -----------------------------------------------------*/ + +/* Private macro -------------------------------------------------------------*/ +/** @defgroup TIMEx_Private_Macros TIM Extended Private Macros + * @{ + */ +#if defined(TIM1) && defined(TIM8) && defined(TIM20) && defined(TIM16) +#define IS_TIM_REMAP(__INSTANCE__, __REMAP__) \ + ((((__INSTANCE__) == TIM1) && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U))) \ + || (((__INSTANCE__) == TIM8) && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U))) \ + || (((__INSTANCE__) == TIM20) && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U))) \ + || (((__INSTANCE__) == TIM16) && ((((__REMAP__) & 0xFFFFFFFCU) == 0x00000000U)))) +#elif defined(TIM1) && defined(TIM8) && defined(TIM16) +#define IS_TIM_REMAP(__INSTANCE__, __REMAP__) \ + ((((__INSTANCE__) == TIM1) && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U))) \ + || (((__INSTANCE__) == TIM8) && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U))) \ + || (((__INSTANCE__) == TIM16) && ((((__REMAP__) & 0xFFFFFFFCU) == 0x00000000U)))) +#elif defined(TIM1) && defined(TIM16) +#define IS_TIM_REMAP(__INSTANCE__, __REMAP__) \ + ((((__INSTANCE__) == TIM1) && ((((__REMAP__) & 0xFFFFFFF0U) == 0x00000000U))) \ + || (((__INSTANCE__) == TIM16) && ((((__REMAP__) & 0xFFFFFFFCU) == 0x00000000U)))) +#elif defined(TIM14) +#define IS_TIM_REMAP(__INSTANCE__, __REMAP__) \ + (((__INSTANCE__) == TIM14) && (((__REMAP__) & 0xFFFFFFFCU) == 0x00000000U)) +#endif /* TIM1 && TIM8 && TIM20 && TIM16 */ + +/** + * @} + */ +/* End of private macro ------------------------------------------------------*/ + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup TIMEx_Exported_Functions TIM Extended Exported Functions + * @{ + */ + +/** @addtogroup TIMEx_Exported_Functions_Group1 Extended Timer Hall Sensor functions + * @brief Timer Hall Sensor functions + * @{ + */ +/* Timer Hall Sensor functions **********************************************/ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, const TIM_HallSensor_InitTypeDef *sConfig); +HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim); + +void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim); +void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim); + +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim); +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim); +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim); +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim); +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length); +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim); +/** + * @} + */ + +/** @addtogroup TIMEx_Exported_Functions_Group2 Extended Timer Complementary Output Compare functions + * @brief Timer Complementary Output Compare functions + * @{ + */ +/* Timer Complementary Output Compare functions *****************************/ +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); + +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); + +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData, + uint16_t Length); +HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIMEx_Exported_Functions_Group3 Extended Timer Complementary PWM functions + * @brief Timer Complementary PWM functions + * @{ + */ +/* Timer Complementary PWM functions ****************************************/ +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); + +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); +/* Non-Blocking mode: DMA */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData, + uint16_t Length); +HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); +/** + * @} + */ + +/** @addtogroup TIMEx_Exported_Functions_Group4 Extended Timer Complementary One Pulse functions + * @brief Timer Complementary One Pulse functions + * @{ + */ +/* Timer Complementary One Pulse functions **********************************/ +/* Blocking mode: Polling */ +HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel); +HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel); + +/* Non-Blocking mode: Interrupt */ +HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); +HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); +/** + * @} + */ + +/** @addtogroup TIMEx_Exported_Functions_Group5 Extended Peripheral Control functions + * @brief Peripheral Control functions + * @{ + */ +/* Extended Control functions ************************************************/ +HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger, + uint32_t CommutationSource); +HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger, + uint32_t CommutationSource); +HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger, + uint32_t CommutationSource); +HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, + const TIM_MasterConfigTypeDef *sMasterConfig); +HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, + const TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig); +#if defined(TIM_CCR5_CCR5) +HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Channels); +#endif /* TIM_CCR5_CCR5 */ +HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap); +/** + * @} + */ + +/** @addtogroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions + * @brief Extended Callbacks functions + * @{ + */ +/* Extended Callback **********************************************************/ +void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim); +void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim); +void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim); +#if defined(TIM_BDTR_BK2E) +void HAL_TIMEx_Break2Callback(TIM_HandleTypeDef *htim); +#endif /* TIM_BDTR_BK2E */ +/** + * @} + */ + +/** @addtogroup TIMEx_Exported_Functions_Group7 Extended Peripheral State functions + * @brief Extended Peripheral State functions + * @{ + */ +/* Extended Peripheral State functions ***************************************/ +HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(const TIM_HandleTypeDef *htim); +HAL_TIM_ChannelStateTypeDef HAL_TIMEx_GetChannelNState(const TIM_HandleTypeDef *htim, uint32_t ChannelN); +/** + * @} + */ + +/** + * @} + */ +/* End of exported functions -------------------------------------------------*/ + +/* Private functions----------------------------------------------------------*/ +/** @addtogroup TIMEx_Private_Functions TIM Extended Private Functions + * @{ + */ +void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma); +void TIMEx_DMACommutationHalfCplt(DMA_HandleTypeDef *hdma); +/** + * @} + */ +/* End of private functions --------------------------------------------------*/ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + + +#endif /* STM32F3xx_HAL_TIM_EX_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart.h new file mode 100644 index 0000000..d57ae55 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart.h @@ -0,0 +1,1588 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_uart.h + * @author MCD Application Team + * @brief Header file of UART HAL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_HAL_UART_H +#define STM32F3xx_HAL_UART_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup UART + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup UART_Exported_Types UART Exported Types + * @{ + */ + +/** + * @brief UART Init Structure definition + */ +typedef struct +{ + uint32_t BaudRate; /*!< This member configures the UART communication baud rate. + The baud rate register is computed using the following formula: + - If oversampling is 16 or in LIN mode, + Baud Rate Register = ((uart_ker_ck) / ((huart->Init.BaudRate))) + - If oversampling is 8, + Baud Rate Register[15:4] = ((2 * uart_ker_ck) / + ((huart->Init.BaudRate)))[15:4] + Baud Rate Register[3] = 0 + Baud Rate Register[2:0] = (((2 * uart_ker_ck) / + ((huart->Init.BaudRate)))[3:0]) >> 1 + where uart_ker_ck is the UART input clock */ + + uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame. + This parameter can be a value of @ref UARTEx_Word_Length. */ + + uint32_t StopBits; /*!< Specifies the number of stop bits transmitted. + This parameter can be a value of @ref UART_Stop_Bits. */ + + uint32_t Parity; /*!< Specifies the parity mode. + This parameter can be a value of @ref UART_Parity + @note When parity is enabled, the computed parity is inserted + at the MSB position of the transmitted data (9th bit when + the word length is set to 9 data bits; 8th bit when the + word length is set to 8 data bits). */ + + uint32_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled. + This parameter can be a value of @ref UART_Mode. */ + + uint32_t HwFlowCtl; /*!< Specifies whether the hardware flow control mode is enabled + or disabled. + This parameter can be a value of @ref UART_Hardware_Flow_Control. */ + + uint32_t OverSampling; /*!< Specifies whether the Over sampling 8 is enabled or disabled, + to achieve higher speed (up to f_PCLK/8). + This parameter can be a value of @ref UART_Over_Sampling. */ + + uint32_t OneBitSampling; /*!< Specifies whether a single sample or three samples' majority vote is selected. + Selecting the single sample method increases the receiver tolerance to clock + deviations. This parameter can be a value of @ref UART_OneBit_Sampling. */ + + +} UART_InitTypeDef; + +/** + * @brief UART Advanced Features initialization structure definition + */ +typedef struct +{ + uint32_t AdvFeatureInit; /*!< Specifies which advanced UART features is initialized. Several + Advanced Features may be initialized at the same time . + This parameter can be a value of + @ref UART_Advanced_Features_Initialization_Type. */ + + uint32_t TxPinLevelInvert; /*!< Specifies whether the TX pin active level is inverted. + This parameter can be a value of @ref UART_Tx_Inv. */ + + uint32_t RxPinLevelInvert; /*!< Specifies whether the RX pin active level is inverted. + This parameter can be a value of @ref UART_Rx_Inv. */ + + uint32_t DataInvert; /*!< Specifies whether data are inverted (positive/direct logic + vs negative/inverted logic). + This parameter can be a value of @ref UART_Data_Inv. */ + + uint32_t Swap; /*!< Specifies whether TX and RX pins are swapped. + This parameter can be a value of @ref UART_Rx_Tx_Swap. */ + + uint32_t OverrunDisable; /*!< Specifies whether the reception overrun detection is disabled. + This parameter can be a value of @ref UART_Overrun_Disable. */ + + uint32_t DMADisableonRxError; /*!< Specifies whether the DMA is disabled in case of reception error. + This parameter can be a value of @ref UART_DMA_Disable_on_Rx_Error. */ + + uint32_t AutoBaudRateEnable; /*!< Specifies whether auto Baud rate detection is enabled. + This parameter can be a value of @ref UART_AutoBaudRate_Enable. */ + + uint32_t AutoBaudRateMode; /*!< If auto Baud rate detection is enabled, specifies how the rate + detection is carried out. + This parameter can be a value of @ref UART_AutoBaud_Rate_Mode. */ + + uint32_t MSBFirst; /*!< Specifies whether MSB is sent first on UART line. + This parameter can be a value of @ref UART_MSB_First. */ +} UART_AdvFeatureInitTypeDef; + +/** + * @brief HAL UART State definition + * @note HAL UART State value is a combination of 2 different substates: + * gState and RxState (see @ref UART_State_Definition). + * - gState contains UART state information related to global Handle management + * and also information related to Tx operations. + * gState value coding follow below described bitmap : + * b7-b6 Error information + * 00 : No Error + * 01 : (Not Used) + * 10 : Timeout + * 11 : Error + * b5 Peripheral initialization status + * 0 : Reset (Peripheral not initialized) + * 1 : Init done (Peripheral initialized. HAL UART Init function already called) + * b4-b3 (not used) + * xx : Should be set to 00 + * b2 Intrinsic process state + * 0 : Ready + * 1 : Busy (Peripheral busy with some configuration or internal operations) + * b1 (not used) + * x : Should be set to 0 + * b0 Tx state + * 0 : Ready (no Tx operation ongoing) + * 1 : Busy (Tx operation ongoing) + * - RxState contains information related to Rx operations. + * RxState value coding follow below described bitmap : + * b7-b6 (not used) + * xx : Should be set to 00 + * b5 Peripheral initialization status + * 0 : Reset (Peripheral not initialized) + * 1 : Init done (Peripheral initialized) + * b4-b2 (not used) + * xxx : Should be set to 000 + * b1 Rx state + * 0 : Ready (no Rx operation ongoing) + * 1 : Busy (Rx operation ongoing) + * b0 (not used) + * x : Should be set to 0. + */ +typedef uint32_t HAL_UART_StateTypeDef; + +/** + * @brief UART clock sources definition + */ +typedef enum +{ + UART_CLOCKSOURCE_PCLK1 = 0x00U, /*!< PCLK1 clock source */ + UART_CLOCKSOURCE_PCLK2 = 0x01U, /*!< PCLK2 clock source */ + UART_CLOCKSOURCE_HSI = 0x02U, /*!< HSI clock source */ + UART_CLOCKSOURCE_SYSCLK = 0x04U, /*!< SYSCLK clock source */ + UART_CLOCKSOURCE_LSE = 0x08U, /*!< LSE clock source */ + UART_CLOCKSOURCE_UNDEFINED = 0x10U /*!< Undefined clock source */ +} UART_ClockSourceTypeDef; + +/** + * @brief HAL UART Reception type definition + * @note HAL UART Reception type value aims to identify which type of Reception is ongoing. + * This parameter can be a value of @ref UART_Reception_Type_Values : + * HAL_UART_RECEPTION_STANDARD = 0x00U, + * HAL_UART_RECEPTION_TOIDLE = 0x01U, + * HAL_UART_RECEPTION_TORTO = 0x02U, + * HAL_UART_RECEPTION_TOCHARMATCH = 0x03U, + */ +typedef uint32_t HAL_UART_RxTypeTypeDef; + +/** + * @brief HAL UART Rx Event type definition + * @note HAL UART Rx Event type value aims to identify which type of Event has occurred + * leading to call of the RxEvent callback. + * This parameter can be a value of @ref UART_RxEvent_Type_Values : + * HAL_UART_RXEVENT_TC = 0x00U, + * HAL_UART_RXEVENT_HT = 0x01U, + * HAL_UART_RXEVENT_IDLE = 0x02U, + */ +typedef uint32_t HAL_UART_RxEventTypeTypeDef; + +/** + * @brief UART handle Structure definition + */ +typedef struct __UART_HandleTypeDef +{ + USART_TypeDef *Instance; /*!< UART registers base address */ + + UART_InitTypeDef Init; /*!< UART communication parameters */ + + UART_AdvFeatureInitTypeDef AdvancedInit; /*!< UART Advanced Features initialization parameters */ + + const uint8_t *pTxBuffPtr; /*!< Pointer to UART Tx transfer Buffer */ + + uint16_t TxXferSize; /*!< UART Tx Transfer size */ + + __IO uint16_t TxXferCount; /*!< UART Tx Transfer Counter */ + + uint8_t *pRxBuffPtr; /*!< Pointer to UART Rx transfer Buffer */ + + uint16_t RxXferSize; /*!< UART Rx Transfer size */ + + __IO uint16_t RxXferCount; /*!< UART Rx Transfer Counter */ + + uint16_t Mask; /*!< UART Rx RDR register mask */ + + __IO HAL_UART_RxTypeTypeDef ReceptionType; /*!< Type of ongoing reception */ + + __IO HAL_UART_RxEventTypeTypeDef RxEventType; /*!< Type of Rx Event */ + + void (*RxISR)(struct __UART_HandleTypeDef *huart); /*!< Function pointer on Rx IRQ handler */ + + void (*TxISR)(struct __UART_HandleTypeDef *huart); /*!< Function pointer on Tx IRQ handler */ + + DMA_HandleTypeDef *hdmatx; /*!< UART Tx DMA Handle parameters */ + + DMA_HandleTypeDef *hdmarx; /*!< UART Rx DMA Handle parameters */ + + HAL_LockTypeDef Lock; /*!< Locking object */ + + __IO HAL_UART_StateTypeDef gState; /*!< UART state information related to global Handle management + and also related to Tx operations. This parameter + can be a value of @ref HAL_UART_StateTypeDef */ + + __IO HAL_UART_StateTypeDef RxState; /*!< UART state information related to Rx operations. This + parameter can be a value of @ref HAL_UART_StateTypeDef */ + + __IO uint32_t ErrorCode; /*!< UART Error code */ + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + void (* TxHalfCpltCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Tx Half Complete Callback */ + void (* TxCpltCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Tx Complete Callback */ + void (* RxHalfCpltCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Rx Half Complete Callback */ + void (* RxCpltCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Rx Complete Callback */ + void (* ErrorCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Error Callback */ + void (* AbortCpltCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Abort Complete Callback */ + void (* AbortTransmitCpltCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Abort Transmit Complete Callback */ + void (* AbortReceiveCpltCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Abort Receive Complete Callback */ + void (* WakeupCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Wakeup Callback */ + void (* RxEventCallback)(struct __UART_HandleTypeDef *huart, uint16_t Pos); /*!< UART Reception Event Callback */ + + void (* MspInitCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Msp Init callback */ + void (* MspDeInitCallback)(struct __UART_HandleTypeDef *huart); /*!< UART Msp DeInit callback */ +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + +} UART_HandleTypeDef; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) +/** + * @brief HAL UART Callback ID enumeration definition + */ +typedef enum +{ + HAL_UART_TX_HALFCOMPLETE_CB_ID = 0x00U, /*!< UART Tx Half Complete Callback ID */ + HAL_UART_TX_COMPLETE_CB_ID = 0x01U, /*!< UART Tx Complete Callback ID */ + HAL_UART_RX_HALFCOMPLETE_CB_ID = 0x02U, /*!< UART Rx Half Complete Callback ID */ + HAL_UART_RX_COMPLETE_CB_ID = 0x03U, /*!< UART Rx Complete Callback ID */ + HAL_UART_ERROR_CB_ID = 0x04U, /*!< UART Error Callback ID */ + HAL_UART_ABORT_COMPLETE_CB_ID = 0x05U, /*!< UART Abort Complete Callback ID */ + HAL_UART_ABORT_TRANSMIT_COMPLETE_CB_ID = 0x06U, /*!< UART Abort Transmit Complete Callback ID */ + HAL_UART_ABORT_RECEIVE_COMPLETE_CB_ID = 0x07U, /*!< UART Abort Receive Complete Callback ID */ + HAL_UART_WAKEUP_CB_ID = 0x08U, /*!< UART Wakeup Callback ID */ + + HAL_UART_MSPINIT_CB_ID = 0x0BU, /*!< UART MspInit callback ID */ + HAL_UART_MSPDEINIT_CB_ID = 0x0CU /*!< UART MspDeInit callback ID */ + +} HAL_UART_CallbackIDTypeDef; + +/** + * @brief HAL UART Callback pointer definition + */ +typedef void (*pUART_CallbackTypeDef)(UART_HandleTypeDef *huart); /*!< pointer to an UART callback function */ +typedef void (*pUART_RxEventCallbackTypeDef) +(struct __UART_HandleTypeDef *huart, uint16_t Pos); /*!< pointer to a UART Rx Event specific callback function */ + +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup UART_Exported_Constants UART Exported Constants + * @{ + */ + +/** @defgroup UART_State_Definition UART State Code Definition + * @{ + */ +#define HAL_UART_STATE_RESET 0x00000000U /*!< Peripheral is not initialized + Value is allowed for gState and RxState */ +#define HAL_UART_STATE_READY 0x00000020U /*!< Peripheral Initialized and ready for use + Value is allowed for gState and RxState */ +#define HAL_UART_STATE_BUSY 0x00000024U /*!< an internal process is ongoing + Value is allowed for gState only */ +#define HAL_UART_STATE_BUSY_TX 0x00000021U /*!< Data Transmission process is ongoing + Value is allowed for gState only */ +#define HAL_UART_STATE_BUSY_RX 0x00000022U /*!< Data Reception process is ongoing + Value is allowed for RxState only */ +#define HAL_UART_STATE_BUSY_TX_RX 0x00000023U /*!< Data Transmission and Reception process is ongoing + Not to be used for neither gState nor RxState.Value is result + of combination (Or) between gState and RxState values */ +#define HAL_UART_STATE_TIMEOUT 0x000000A0U /*!< Timeout state + Value is allowed for gState only */ +#define HAL_UART_STATE_ERROR 0x000000E0U /*!< Error + Value is allowed for gState only */ +/** + * @} + */ + +/** @defgroup UART_Error_Definition UART Error Definition + * @{ + */ +#define HAL_UART_ERROR_NONE (0x00000000U) /*!< No error */ +#define HAL_UART_ERROR_PE (0x00000001U) /*!< Parity error */ +#define HAL_UART_ERROR_NE (0x00000002U) /*!< Noise error */ +#define HAL_UART_ERROR_FE (0x00000004U) /*!< Frame error */ +#define HAL_UART_ERROR_ORE (0x00000008U) /*!< Overrun error */ +#define HAL_UART_ERROR_DMA (0x00000010U) /*!< DMA transfer error */ +#define HAL_UART_ERROR_RTO (0x00000020U) /*!< Receiver Timeout error */ + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) +#define HAL_UART_ERROR_INVALID_CALLBACK (0x00000040U) /*!< Invalid Callback error */ +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +/** + * @} + */ + +/** @defgroup UART_Stop_Bits UART Number of Stop Bits + * @{ + */ +#define UART_STOPBITS_0_5 USART_CR2_STOP_0 /*!< UART frame with 0.5 stop bit */ +#define UART_STOPBITS_1 0x00000000U /*!< UART frame with 1 stop bit */ +#define UART_STOPBITS_1_5 (USART_CR2_STOP_0 | USART_CR2_STOP_1) /*!< UART frame with 1.5 stop bits */ +#define UART_STOPBITS_2 USART_CR2_STOP_1 /*!< UART frame with 2 stop bits */ +/** + * @} + */ + +/** @defgroup UART_Parity UART Parity + * @{ + */ +#define UART_PARITY_NONE 0x00000000U /*!< No parity */ +#define UART_PARITY_EVEN USART_CR1_PCE /*!< Even parity */ +#define UART_PARITY_ODD (USART_CR1_PCE | USART_CR1_PS) /*!< Odd parity */ +/** + * @} + */ + +/** @defgroup UART_Hardware_Flow_Control UART Hardware Flow Control + * @{ + */ +#define UART_HWCONTROL_NONE 0x00000000U /*!< No hardware control */ +#define UART_HWCONTROL_RTS USART_CR3_RTSE /*!< Request To Send */ +#define UART_HWCONTROL_CTS USART_CR3_CTSE /*!< Clear To Send */ +#define UART_HWCONTROL_RTS_CTS (USART_CR3_RTSE | USART_CR3_CTSE) /*!< Request and Clear To Send */ +/** + * @} + */ + +/** @defgroup UART_Mode UART Transfer Mode + * @{ + */ +#define UART_MODE_RX USART_CR1_RE /*!< RX mode */ +#define UART_MODE_TX USART_CR1_TE /*!< TX mode */ +#define UART_MODE_TX_RX (USART_CR1_TE |USART_CR1_RE) /*!< RX and TX mode */ +/** + * @} + */ + +/** @defgroup UART_State UART State + * @{ + */ +#define UART_STATE_DISABLE 0x00000000U /*!< UART disabled */ +#define UART_STATE_ENABLE USART_CR1_UE /*!< UART enabled */ +/** + * @} + */ + +/** @defgroup UART_Over_Sampling UART Over Sampling + * @{ + */ +#define UART_OVERSAMPLING_16 0x00000000U /*!< Oversampling by 16 */ +#define UART_OVERSAMPLING_8 USART_CR1_OVER8 /*!< Oversampling by 8 */ +/** + * @} + */ + +/** @defgroup UART_OneBit_Sampling UART One Bit Sampling Method + * @{ + */ +#define UART_ONE_BIT_SAMPLE_DISABLE 0x00000000U /*!< One-bit sampling disable */ +#define UART_ONE_BIT_SAMPLE_ENABLE USART_CR3_ONEBIT /*!< One-bit sampling enable */ +/** + * @} + */ + +/** @defgroup UART_AutoBaud_Rate_Mode UART Advanced Feature AutoBaud Rate Mode + * @{ + */ +#define UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT 0x00000000U /*!< Auto Baud rate detection + on start bit */ +#define UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE USART_CR2_ABRMODE_0 /*!< Auto Baud rate detection + on falling edge */ +#define UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME USART_CR2_ABRMODE_1 /*!< Auto Baud rate detection + on 0x7F frame detection */ +#define UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME USART_CR2_ABRMODE /*!< Auto Baud rate detection + on 0x55 frame detection */ +/** + * @} + */ + +/** @defgroup UART_Receiver_Timeout UART Receiver Timeout + * @{ + */ +#define UART_RECEIVER_TIMEOUT_DISABLE 0x00000000U /*!< UART Receiver Timeout disable */ +#define UART_RECEIVER_TIMEOUT_ENABLE USART_CR2_RTOEN /*!< UART Receiver Timeout enable */ +/** + * @} + */ + +/** @defgroup UART_LIN UART Local Interconnection Network mode + * @{ + */ +#define UART_LIN_DISABLE 0x00000000U /*!< Local Interconnect Network disable */ +#define UART_LIN_ENABLE USART_CR2_LINEN /*!< Local Interconnect Network enable */ +/** + * @} + */ + +/** @defgroup UART_LIN_Break_Detection UART LIN Break Detection + * @{ + */ +#define UART_LINBREAKDETECTLENGTH_10B 0x00000000U /*!< LIN 10-bit break detection length */ +#define UART_LINBREAKDETECTLENGTH_11B USART_CR2_LBDL /*!< LIN 11-bit break detection length */ +/** + * @} + */ + +/** @defgroup UART_DMA_Tx UART DMA Tx + * @{ + */ +#define UART_DMA_TX_DISABLE 0x00000000U /*!< UART DMA TX disabled */ +#define UART_DMA_TX_ENABLE USART_CR3_DMAT /*!< UART DMA TX enabled */ +/** + * @} + */ + +/** @defgroup UART_DMA_Rx UART DMA Rx + * @{ + */ +#define UART_DMA_RX_DISABLE 0x00000000U /*!< UART DMA RX disabled */ +#define UART_DMA_RX_ENABLE USART_CR3_DMAR /*!< UART DMA RX enabled */ +/** + * @} + */ + +/** @defgroup UART_Half_Duplex_Selection UART Half Duplex Selection + * @{ + */ +#define UART_HALF_DUPLEX_DISABLE 0x00000000U /*!< UART half-duplex disabled */ +#define UART_HALF_DUPLEX_ENABLE USART_CR3_HDSEL /*!< UART half-duplex enabled */ +/** + * @} + */ + +/** @defgroup UART_WakeUp_Methods UART WakeUp Methods + * @{ + */ +#define UART_WAKEUPMETHOD_IDLELINE 0x00000000U /*!< UART wake-up on idle line */ +#define UART_WAKEUPMETHOD_ADDRESSMARK USART_CR1_WAKE /*!< UART wake-up on address mark */ +/** + * @} + */ + +/** @defgroup UART_Request_Parameters UART Request Parameters + * @{ + */ +#define UART_AUTOBAUD_REQUEST USART_RQR_ABRRQ /*!< Auto-Baud Rate Request */ +#define UART_SENDBREAK_REQUEST USART_RQR_SBKRQ /*!< Send Break Request */ +#define UART_MUTE_MODE_REQUEST USART_RQR_MMRQ /*!< Mute Mode Request */ +#define UART_RXDATA_FLUSH_REQUEST USART_RQR_RXFRQ /*!< Receive Data flush Request */ +#define UART_TXDATA_FLUSH_REQUEST USART_RQR_TXFRQ /*!< Transmit data flush Request */ +/** + * @} + */ + +/** @defgroup UART_Advanced_Features_Initialization_Type UART Advanced Feature Initialization Type + * @{ + */ +#define UART_ADVFEATURE_NO_INIT 0x00000000U /*!< No advanced feature initialization */ +#define UART_ADVFEATURE_TXINVERT_INIT 0x00000001U /*!< TX pin active level inversion */ +#define UART_ADVFEATURE_RXINVERT_INIT 0x00000002U /*!< RX pin active level inversion */ +#define UART_ADVFEATURE_DATAINVERT_INIT 0x00000004U /*!< Binary data inversion */ +#define UART_ADVFEATURE_SWAP_INIT 0x00000008U /*!< TX/RX pins swap */ +#define UART_ADVFEATURE_RXOVERRUNDISABLE_INIT 0x00000010U /*!< RX overrun disable */ +#define UART_ADVFEATURE_DMADISABLEONERROR_INIT 0x00000020U /*!< DMA disable on Reception Error */ +#define UART_ADVFEATURE_AUTOBAUDRATE_INIT 0x00000040U /*!< Auto Baud rate detection initialization */ +#define UART_ADVFEATURE_MSBFIRST_INIT 0x00000080U /*!< Most significant bit sent/received first */ +/** + * @} + */ + +/** @defgroup UART_Tx_Inv UART Advanced Feature TX Pin Active Level Inversion + * @{ + */ +#define UART_ADVFEATURE_TXINV_DISABLE 0x00000000U /*!< TX pin active level inversion disable */ +#define UART_ADVFEATURE_TXINV_ENABLE USART_CR2_TXINV /*!< TX pin active level inversion enable */ +/** + * @} + */ + +/** @defgroup UART_Rx_Inv UART Advanced Feature RX Pin Active Level Inversion + * @{ + */ +#define UART_ADVFEATURE_RXINV_DISABLE 0x00000000U /*!< RX pin active level inversion disable */ +#define UART_ADVFEATURE_RXINV_ENABLE USART_CR2_RXINV /*!< RX pin active level inversion enable */ +/** + * @} + */ + +/** @defgroup UART_Data_Inv UART Advanced Feature Binary Data Inversion + * @{ + */ +#define UART_ADVFEATURE_DATAINV_DISABLE 0x00000000U /*!< Binary data inversion disable */ +#define UART_ADVFEATURE_DATAINV_ENABLE USART_CR2_DATAINV /*!< Binary data inversion enable */ +/** + * @} + */ + +/** @defgroup UART_Rx_Tx_Swap UART Advanced Feature RX TX Pins Swap + * @{ + */ +#define UART_ADVFEATURE_SWAP_DISABLE 0x00000000U /*!< TX/RX pins swap disable */ +#define UART_ADVFEATURE_SWAP_ENABLE USART_CR2_SWAP /*!< TX/RX pins swap enable */ +/** + * @} + */ + +/** @defgroup UART_Overrun_Disable UART Advanced Feature Overrun Disable + * @{ + */ +#define UART_ADVFEATURE_OVERRUN_ENABLE 0x00000000U /*!< RX overrun enable */ +#define UART_ADVFEATURE_OVERRUN_DISABLE USART_CR3_OVRDIS /*!< RX overrun disable */ +/** + * @} + */ + +/** @defgroup UART_AutoBaudRate_Enable UART Advanced Feature Auto BaudRate Enable + * @{ + */ +#define UART_ADVFEATURE_AUTOBAUDRATE_DISABLE 0x00000000U /*!< RX Auto Baud rate detection enable */ +#define UART_ADVFEATURE_AUTOBAUDRATE_ENABLE USART_CR2_ABREN /*!< RX Auto Baud rate detection disable */ +/** + * @} + */ + +/** @defgroup UART_DMA_Disable_on_Rx_Error UART Advanced Feature DMA Disable On Rx Error + * @{ + */ +#define UART_ADVFEATURE_DMA_ENABLEONRXERROR 0x00000000U /*!< DMA enable on Reception Error */ +#define UART_ADVFEATURE_DMA_DISABLEONRXERROR USART_CR3_DDRE /*!< DMA disable on Reception Error */ +/** + * @} + */ + +/** @defgroup UART_MSB_First UART Advanced Feature MSB First + * @{ + */ +#define UART_ADVFEATURE_MSBFIRST_DISABLE 0x00000000U /*!< Most significant bit sent/received + first disable */ +#define UART_ADVFEATURE_MSBFIRST_ENABLE USART_CR2_MSBFIRST /*!< Most significant bit sent/received + first enable */ +/** + * @} + */ + +/** @defgroup UART_Stop_Mode_Enable UART Advanced Feature Stop Mode Enable + * @{ + */ +#define UART_ADVFEATURE_STOPMODE_DISABLE 0x00000000U /*!< UART stop mode disable */ +#define UART_ADVFEATURE_STOPMODE_ENABLE USART_CR1_UESM /*!< UART stop mode enable */ +/** + * @} + */ + +/** @defgroup UART_Mute_Mode UART Advanced Feature Mute Mode Enable + * @{ + */ +#define UART_ADVFEATURE_MUTEMODE_DISABLE 0x00000000U /*!< UART mute mode disable */ +#define UART_ADVFEATURE_MUTEMODE_ENABLE USART_CR1_MME /*!< UART mute mode enable */ +/** + * @} + */ + +/** @defgroup UART_CR2_ADDRESS_LSB_POS UART Address-matching LSB Position In CR2 Register + * @{ + */ +#define UART_CR2_ADDRESS_LSB_POS 24U /*!< UART address-matching LSB position in CR2 register */ +/** + * @} + */ + +/** @defgroup UART_WakeUp_from_Stop_Selection UART WakeUp From Stop Selection + * @{ + */ +#define UART_WAKEUP_ON_ADDRESS 0x00000000U /*!< UART wake-up on address */ +#define UART_WAKEUP_ON_STARTBIT USART_CR3_WUS_1 /*!< UART wake-up on start bit */ +#define UART_WAKEUP_ON_READDATA_NONEMPTY USART_CR3_WUS /*!< UART wake-up on receive data register + not empty or RXFIFO is not empty */ +/** + * @} + */ + +/** @defgroup UART_DriverEnable_Polarity UART DriverEnable Polarity + * @{ + */ +#define UART_DE_POLARITY_HIGH 0x00000000U /*!< Driver enable signal is active high */ +#define UART_DE_POLARITY_LOW USART_CR3_DEP /*!< Driver enable signal is active low */ +/** + * @} + */ + +/** @defgroup UART_CR1_DEAT_ADDRESS_LSB_POS UART Driver Enable Assertion Time LSB Position In CR1 Register + * @{ + */ +#define UART_CR1_DEAT_ADDRESS_LSB_POS 21U /*!< UART Driver Enable assertion time LSB + position in CR1 register */ +/** + * @} + */ + +/** @defgroup UART_CR1_DEDT_ADDRESS_LSB_POS UART Driver Enable DeAssertion Time LSB Position In CR1 Register + * @{ + */ +#define UART_CR1_DEDT_ADDRESS_LSB_POS 16U /*!< UART Driver Enable de-assertion time LSB + position in CR1 register */ +/** + * @} + */ + +/** @defgroup UART_Interruption_Mask UART Interruptions Flag Mask + * @{ + */ +#define UART_IT_MASK 0x001FU /*!< UART interruptions flags mask */ +/** + * @} + */ + +/** @defgroup UART_TimeOut_Value UART polling-based communications time-out value + * @{ + */ +#define HAL_UART_TIMEOUT_VALUE 0x1FFFFFFU /*!< UART polling-based communications time-out value */ +/** + * @} + */ + +/** @defgroup UART_Flags UART Status Flags + * Elements values convention: 0xXXXX + * - 0xXXXX : Flag mask in the ISR register + * @{ + */ +#define UART_FLAG_REACK USART_ISR_REACK /*!< UART receive enable acknowledge flag */ +#define UART_FLAG_TEACK USART_ISR_TEACK /*!< UART transmit enable acknowledge flag */ +#define UART_FLAG_WUF USART_ISR_WUF /*!< UART wake-up from stop mode flag */ +#define UART_FLAG_RWU USART_ISR_RWU /*!< UART receiver wake-up from mute mode flag */ +#define UART_FLAG_SBKF USART_ISR_SBKF /*!< UART send break flag */ +#define UART_FLAG_CMF USART_ISR_CMF /*!< UART character match flag */ +#define UART_FLAG_BUSY USART_ISR_BUSY /*!< UART busy flag */ +#define UART_FLAG_ABRF USART_ISR_ABRF /*!< UART auto Baud rate flag */ +#define UART_FLAG_ABRE USART_ISR_ABRE /*!< UART auto Baud rate error */ +#define UART_FLAG_RTOF USART_ISR_RTOF /*!< UART receiver timeout flag */ +#define UART_FLAG_CTS USART_ISR_CTS /*!< UART clear to send flag */ +#define UART_FLAG_CTSIF USART_ISR_CTSIF /*!< UART clear to send interrupt flag */ +#define UART_FLAG_LBDF USART_ISR_LBDF /*!< UART LIN break detection flag */ +#define UART_FLAG_TXE USART_ISR_TXE /*!< UART transmit data register empty */ +#define UART_FLAG_TC USART_ISR_TC /*!< UART transmission complete */ +#define UART_FLAG_RXNE USART_ISR_RXNE /*!< UART read data register not empty */ +#define UART_FLAG_IDLE USART_ISR_IDLE /*!< UART idle flag */ +#define UART_FLAG_ORE USART_ISR_ORE /*!< UART overrun error */ +#define UART_FLAG_NE USART_ISR_NE /*!< UART noise error */ +#define UART_FLAG_FE USART_ISR_FE /*!< UART frame error */ +#define UART_FLAG_PE USART_ISR_PE /*!< UART parity error */ +/** + * @} + */ + +/** @defgroup UART_Interrupt_definition UART Interrupts Definition + * Elements values convention: 000ZZZZZ0XXYYYYYb + * - YYYYY : Interrupt source position in the XX register (5bits) + * - XX : Interrupt source register (2bits) + * - 01: CR1 register + * - 10: CR2 register + * - 11: CR3 register + * - ZZZZZ : Flag position in the ISR register(5bits) + * Elements values convention: 000000000XXYYYYYb + * - YYYYY : Interrupt source position in the XX register (5bits) + * - XX : Interrupt source register (2bits) + * - 01: CR1 register + * - 10: CR2 register + * - 11: CR3 register + * Elements values convention: 0000ZZZZ00000000b + * - ZZZZ : Flag position in the ISR register(4bits) + * @{ + */ +#define UART_IT_PE 0x0028U /*!< UART parity error interruption */ +#define UART_IT_TXE 0x0727U /*!< UART transmit data register empty interruption */ +#define UART_IT_TC 0x0626U /*!< UART transmission complete interruption */ +#define UART_IT_RXNE 0x0525U /*!< UART read data register not empty interruption */ +#define UART_IT_IDLE 0x0424U /*!< UART idle interruption */ +#define UART_IT_LBD 0x0846U /*!< UART LIN break detection interruption */ +#define UART_IT_CTS 0x096AU /*!< UART CTS interruption */ +#define UART_IT_CM 0x112EU /*!< UART character match interruption */ +#define UART_IT_WUF 0x1476U /*!< UART wake-up from stop mode interruption */ +#define UART_IT_RTO 0x0B3AU /*!< UART receiver timeout interruption */ + +#define UART_IT_ERR 0x0060U /*!< UART error interruption */ + +#define UART_IT_ORE 0x0300U /*!< UART overrun error interruption */ +#define UART_IT_NE 0x0200U /*!< UART noise error interruption */ +#define UART_IT_FE 0x0100U /*!< UART frame error interruption */ +/** + * @} + */ + +/** @defgroup UART_IT_CLEAR_Flags UART Interruption Clear Flags + * @{ + */ +#define UART_CLEAR_PEF USART_ICR_PECF /*!< Parity Error Clear Flag */ +#define UART_CLEAR_FEF USART_ICR_FECF /*!< Framing Error Clear Flag */ +#define UART_CLEAR_NEF USART_ICR_NCF /*!< Noise Error detected Clear Flag */ +#define UART_CLEAR_OREF USART_ICR_ORECF /*!< Overrun Error Clear Flag */ +#define UART_CLEAR_IDLEF USART_ICR_IDLECF /*!< IDLE line detected Clear Flag */ +#define UART_CLEAR_TCF USART_ICR_TCCF /*!< Transmission Complete Clear Flag */ +#define UART_CLEAR_LBDF USART_ICR_LBDCF /*!< LIN Break Detection Clear Flag */ +#define UART_CLEAR_CTSF USART_ICR_CTSCF /*!< CTS Interrupt Clear Flag */ +#define UART_CLEAR_CMF USART_ICR_CMCF /*!< Character Match Clear Flag */ +#define UART_CLEAR_WUF USART_ICR_WUCF /*!< Wake Up from stop mode Clear Flag */ +#define UART_CLEAR_RTOF USART_ICR_RTOCF /*!< UART receiver timeout clear flag */ +/** + * @} + */ + +/** @defgroup UART_Reception_Type_Values UART Reception type values + * @{ + */ +#define HAL_UART_RECEPTION_STANDARD (0x00000000U) /*!< Standard reception */ +#define HAL_UART_RECEPTION_TOIDLE (0x00000001U) /*!< Reception till completion or IDLE event */ +#define HAL_UART_RECEPTION_TORTO (0x00000002U) /*!< Reception till completion or RTO event */ +#define HAL_UART_RECEPTION_TOCHARMATCH (0x00000003U) /*!< Reception till completion or CM event */ +/** + * @} + */ + +/** @defgroup UART_RxEvent_Type_Values UART RxEvent type values + * @{ + */ +#define HAL_UART_RXEVENT_TC (0x00000000U) /*!< RxEvent linked to Transfer Complete event */ +#define HAL_UART_RXEVENT_HT (0x00000001U) /*!< RxEvent linked to Half Transfer event */ +#define HAL_UART_RXEVENT_IDLE (0x00000002U) /*!< RxEvent linked to IDLE event */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macros -----------------------------------------------------------*/ +/** @defgroup UART_Exported_Macros UART Exported Macros + * @{ + */ + +/** @brief Reset UART handle states. + * @param __HANDLE__ UART handle. + * @retval None + */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) +#define __HAL_UART_RESET_HANDLE_STATE(__HANDLE__) do{ \ + (__HANDLE__)->gState = HAL_UART_STATE_RESET; \ + (__HANDLE__)->RxState = HAL_UART_STATE_RESET; \ + (__HANDLE__)->MspInitCallback = NULL; \ + (__HANDLE__)->MspDeInitCallback = NULL; \ + } while(0U) +#else +#define __HAL_UART_RESET_HANDLE_STATE(__HANDLE__) do{ \ + (__HANDLE__)->gState = HAL_UART_STATE_RESET; \ + (__HANDLE__)->RxState = HAL_UART_STATE_RESET; \ + } while(0U) +#endif /*USE_HAL_UART_REGISTER_CALLBACKS */ + +/** @brief Flush the UART Data registers. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) \ + do{ \ + SET_BIT((__HANDLE__)->Instance->RQR, UART_RXDATA_FLUSH_REQUEST); \ + SET_BIT((__HANDLE__)->Instance->RQR, UART_TXDATA_FLUSH_REQUEST); \ + } while(0U) + +/** @brief Clear the specified UART pending flag. + * @param __HANDLE__ specifies the UART Handle. + * @param __FLAG__ specifies the flag to check. + * This parameter can be any combination of the following values: + * @arg @ref UART_CLEAR_PEF Parity Error Clear Flag + * @arg @ref UART_CLEAR_FEF Framing Error Clear Flag + * @arg @ref UART_CLEAR_NEF Noise detected Clear Flag + * @arg @ref UART_CLEAR_OREF Overrun Error Clear Flag + * @arg @ref UART_CLEAR_IDLEF IDLE line detected Clear Flag + * @arg @ref UART_CLEAR_TCF Transmission Complete Clear Flag + * @arg @ref UART_CLEAR_RTOF Receiver Timeout clear flag + * @arg @ref UART_CLEAR_LBDF LIN Break Detection Clear Flag + * @arg @ref UART_CLEAR_CTSF CTS Interrupt Clear Flag + * @arg @ref UART_CLEAR_CMF Character Match Clear Flag + * @arg @ref UART_CLEAR_WUF Wake Up from stop mode Clear Flag + * @retval None + */ +#define __HAL_UART_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__)) + +/** @brief Clear the UART PE pending flag. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_CLEAR_PEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_PEF) + +/** @brief Clear the UART FE pending flag. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_CLEAR_FEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_FEF) + +/** @brief Clear the UART NE pending flag. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_CLEAR_NEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_NEF) + +/** @brief Clear the UART ORE pending flag. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_CLEAR_OREFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_OREF) + +/** @brief Clear the UART IDLE pending flag. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_IDLEF) + + +/** @brief Check whether the specified UART flag is set or not. + * @param __HANDLE__ specifies the UART Handle. + * @param __FLAG__ specifies the flag to check. + * This parameter can be one of the following values: + * @arg @ref UART_FLAG_REACK Receive enable acknowledge flag + * @arg @ref UART_FLAG_TEACK Transmit enable acknowledge flag + * @arg @ref UART_FLAG_WUF Wake up from stop mode flag + * @arg @ref UART_FLAG_RWU Receiver wake up flag (if the UART in mute mode) + * @arg @ref UART_FLAG_SBKF Send Break flag + * @arg @ref UART_FLAG_CMF Character match flag + * @arg @ref UART_FLAG_BUSY Busy flag + * @arg @ref UART_FLAG_ABRF Auto Baud rate detection flag + * @arg @ref UART_FLAG_ABRE Auto Baud rate detection error flag + * @arg @ref UART_FLAG_CTS CTS Change flag + * @arg @ref UART_FLAG_LBDF LIN Break detection flag + * @arg @ref UART_FLAG_TXE Transmit data register empty flag + * @arg @ref UART_FLAG_TC Transmission Complete flag + * @arg @ref UART_FLAG_RXNE Receive data register not empty flag + * @arg @ref UART_FLAG_RTOF Receiver Timeout flag + * @arg @ref UART_FLAG_IDLE Idle Line detection flag + * @arg @ref UART_FLAG_ORE Overrun Error flag + * @arg @ref UART_FLAG_NE Noise Error flag + * @arg @ref UART_FLAG_FE Framing Error flag + * @arg @ref UART_FLAG_PE Parity Error flag + * @retval The new state of __FLAG__ (TRUE or FALSE). + */ +#define __HAL_UART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__)) + +/** @brief Enable the specified UART interrupt. + * @param __HANDLE__ specifies the UART Handle. + * @param __INTERRUPT__ specifies the UART interrupt source to enable. + * This parameter can be one of the following values: + * @arg @ref UART_IT_WUF Wakeup from stop mode interrupt + * @arg @ref UART_IT_CM Character match interrupt + * @arg @ref UART_IT_CTS CTS change interrupt + * @arg @ref UART_IT_LBD LIN Break detection interrupt + * @arg @ref UART_IT_TXE Transmit Data Register empty interrupt + * @arg @ref UART_IT_TC Transmission complete interrupt + * @arg @ref UART_IT_RXNE Receive Data register not empty interrupt + * @arg @ref UART_IT_RTO Receive Timeout interrupt + * @arg @ref UART_IT_IDLE Idle line detection interrupt + * @arg @ref UART_IT_PE Parity Error interrupt + * @arg @ref UART_IT_ERR Error interrupt (frame error, noise error, overrun error) + * @retval None + */ +#define __HAL_UART_ENABLE_IT(__HANDLE__, __INTERRUPT__) (\ + ((((uint8_t)(__INTERRUPT__)) >> 5U) == 1U)?\ + ((__HANDLE__)->Instance->CR1 |= (1U <<\ + ((__INTERRUPT__) & UART_IT_MASK))): \ + ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2U)?\ + ((__HANDLE__)->Instance->CR2 |= (1U <<\ + ((__INTERRUPT__) & UART_IT_MASK))): \ + ((__HANDLE__)->Instance->CR3 |= (1U <<\ + ((__INTERRUPT__) & UART_IT_MASK)))) + +/** @brief Disable the specified UART interrupt. + * @param __HANDLE__ specifies the UART Handle. + * @param __INTERRUPT__ specifies the UART interrupt source to disable. + * This parameter can be one of the following values: + * @arg @ref UART_IT_WUF Wakeup from stop mode interrupt + * @arg @ref UART_IT_CM Character match interrupt + * @arg @ref UART_IT_CTS CTS change interrupt + * @arg @ref UART_IT_LBD LIN Break detection interrupt + * @arg @ref UART_IT_TXE Transmit Data Register empty interrupt + * @arg @ref UART_IT_TC Transmission complete interrupt + * @arg @ref UART_IT_RXNE Receive Data register not empty interrupt + * @arg @ref UART_IT_RTO Receive Timeout interrupt + * @arg @ref UART_IT_IDLE Idle line detection interrupt + * @arg @ref UART_IT_PE Parity Error interrupt + * @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error) + * @retval None + */ +#define __HAL_UART_DISABLE_IT(__HANDLE__, __INTERRUPT__) (\ + ((((uint8_t)(__INTERRUPT__)) >> 5U) == 1U)?\ + ((__HANDLE__)->Instance->CR1 &= ~ (1U <<\ + ((__INTERRUPT__) & UART_IT_MASK))): \ + ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2U)?\ + ((__HANDLE__)->Instance->CR2 &= ~ (1U <<\ + ((__INTERRUPT__) & UART_IT_MASK))): \ + ((__HANDLE__)->Instance->CR3 &= ~ (1U <<\ + ((__INTERRUPT__) & UART_IT_MASK)))) + +/** @brief Check whether the specified UART interrupt has occurred or not. + * @param __HANDLE__ specifies the UART Handle. + * @param __INTERRUPT__ specifies the UART interrupt to check. + * This parameter can be one of the following values: + * @arg @ref UART_IT_WUF Wakeup from stop mode interrupt + * @arg @ref UART_IT_CM Character match interrupt + * @arg @ref UART_IT_CTS CTS change interrupt + * @arg @ref UART_IT_LBD LIN Break detection interrupt + * @arg @ref UART_IT_TXE Transmit Data Register empty interrupt + * @arg @ref UART_IT_TC Transmission complete interrupt + * @arg @ref UART_IT_RXNE Receive Data register not empty interrupt + * @arg @ref UART_IT_RTO Receive Timeout interrupt + * @arg @ref UART_IT_IDLE Idle line detection interrupt + * @arg @ref UART_IT_PE Parity Error interrupt + * @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error) + * @retval The new state of __INTERRUPT__ (SET or RESET). + */ +#define __HAL_UART_GET_IT(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->ISR\ + & (1U << ((__INTERRUPT__)>> 8U))) != RESET) ? SET : RESET) + +/** @brief Check whether the specified UART interrupt source is enabled or not. + * @param __HANDLE__ specifies the UART Handle. + * @param __INTERRUPT__ specifies the UART interrupt source to check. + * This parameter can be one of the following values: + * @arg @ref UART_IT_WUF Wakeup from stop mode interrupt + * @arg @ref UART_IT_CM Character match interrupt + * @arg @ref UART_IT_CTS CTS change interrupt + * @arg @ref UART_IT_LBD LIN Break detection interrupt + * @arg @ref UART_IT_TXE Transmit Data Register empty interrupt + * @arg @ref UART_IT_TC Transmission complete interrupt + * @arg @ref UART_IT_RXNE Receive Data register not empty interrupt + * @arg @ref UART_IT_RTO Receive Timeout interrupt + * @arg @ref UART_IT_IDLE Idle line detection interrupt + * @arg @ref UART_IT_PE Parity Error interrupt + * @arg @ref UART_IT_ERR Error interrupt (Frame error, noise error, overrun error) + * @retval The new state of __INTERRUPT__ (SET or RESET). + */ +#define __HAL_UART_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((((((uint8_t)(__INTERRUPT__)) >> 5U) == 1U) ?\ + (__HANDLE__)->Instance->CR1 : \ + (((((uint8_t)(__INTERRUPT__)) >> 5U) == 2U) ?\ + (__HANDLE__)->Instance->CR2 : \ + (__HANDLE__)->Instance->CR3)) & (1U <<\ + (((uint16_t)(__INTERRUPT__)) &\ + UART_IT_MASK))) != RESET) ? SET : RESET) + +/** @brief Clear the specified UART ISR flag, in setting the proper ICR register flag. + * @param __HANDLE__ specifies the UART Handle. + * @param __IT_CLEAR__ specifies the interrupt clear register flag that needs to be set + * to clear the corresponding interrupt + * This parameter can be one of the following values: + * @arg @ref UART_CLEAR_PEF Parity Error Clear Flag + * @arg @ref UART_CLEAR_FEF Framing Error Clear Flag + * @arg @ref UART_CLEAR_NEF Noise detected Clear Flag + * @arg @ref UART_CLEAR_OREF Overrun Error Clear Flag + * @arg @ref UART_CLEAR_IDLEF IDLE line detected Clear Flag + * @arg @ref UART_CLEAR_RTOF Receiver timeout clear flag + * @arg @ref UART_CLEAR_TCF Transmission Complete Clear Flag + * @arg @ref UART_CLEAR_LBDF LIN Break Detection Clear Flag + * @arg @ref UART_CLEAR_CTSF CTS Interrupt Clear Flag + * @arg @ref UART_CLEAR_CMF Character Match Clear Flag + * @arg @ref UART_CLEAR_WUF Wake Up from stop mode Clear Flag + * @retval None + */ +#define __HAL_UART_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__)) + +/** @brief Set a specific UART request flag. + * @param __HANDLE__ specifies the UART Handle. + * @param __REQ__ specifies the request flag to set + * This parameter can be one of the following values: + * @arg @ref UART_AUTOBAUD_REQUEST Auto-Baud Rate Request + * @arg @ref UART_SENDBREAK_REQUEST Send Break Request + * @arg @ref UART_MUTE_MODE_REQUEST Mute Mode Request + * @arg @ref UART_RXDATA_FLUSH_REQUEST Receive Data flush Request + * @arg @ref UART_TXDATA_FLUSH_REQUEST Transmit data flush Request + * @retval None + */ +#define __HAL_UART_SEND_REQ(__HANDLE__, __REQ__) ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__)) + +/** @brief Enable the UART one bit sample method. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) + +/** @brief Disable the UART one bit sample method. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= ~USART_CR3_ONEBIT) + +/** @brief Enable UART. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE) + +/** @brief Disable UART. + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) + +/** @brief Enable CTS flow control. + * @note This macro allows to enable CTS hardware flow control for a given UART instance, + * without need to call HAL_UART_Init() function. + * As involving direct access to UART registers, usage of this macro should be fully endorsed by user. + * @note As macro is expected to be used for modifying CTS Hw flow control feature activation, without need + * for USART instance Deinit/Init, following conditions for macro call should be fulfilled : + * - UART instance should have already been initialised (through call of HAL_UART_Init() ) + * - macro could only be called when corresponding UART instance is disabled + * (i.e. __HAL_UART_DISABLE(__HANDLE__)) and should be followed by an Enable + * macro (i.e. __HAL_UART_ENABLE(__HANDLE__)). + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_HWCONTROL_CTS_ENABLE(__HANDLE__) \ + do{ \ + ATOMIC_SET_BIT((__HANDLE__)->Instance->CR3, USART_CR3_CTSE); \ + (__HANDLE__)->Init.HwFlowCtl |= USART_CR3_CTSE; \ + } while(0U) + +/** @brief Disable CTS flow control. + * @note This macro allows to disable CTS hardware flow control for a given UART instance, + * without need to call HAL_UART_Init() function. + * As involving direct access to UART registers, usage of this macro should be fully endorsed by user. + * @note As macro is expected to be used for modifying CTS Hw flow control feature activation, without need + * for USART instance Deinit/Init, following conditions for macro call should be fulfilled : + * - UART instance should have already been initialised (through call of HAL_UART_Init() ) + * - macro could only be called when corresponding UART instance is disabled + * (i.e. __HAL_UART_DISABLE(__HANDLE__)) and should be followed by an Enable + * macro (i.e. __HAL_UART_ENABLE(__HANDLE__)). + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_HWCONTROL_CTS_DISABLE(__HANDLE__) \ + do{ \ + ATOMIC_CLEAR_BIT((__HANDLE__)->Instance->CR3, USART_CR3_CTSE); \ + (__HANDLE__)->Init.HwFlowCtl &= ~(USART_CR3_CTSE); \ + } while(0U) + +/** @brief Enable RTS flow control. + * @note This macro allows to enable RTS hardware flow control for a given UART instance, + * without need to call HAL_UART_Init() function. + * As involving direct access to UART registers, usage of this macro should be fully endorsed by user. + * @note As macro is expected to be used for modifying RTS Hw flow control feature activation, without need + * for USART instance Deinit/Init, following conditions for macro call should be fulfilled : + * - UART instance should have already been initialised (through call of HAL_UART_Init() ) + * - macro could only be called when corresponding UART instance is disabled + * (i.e. __HAL_UART_DISABLE(__HANDLE__)) and should be followed by an Enable + * macro (i.e. __HAL_UART_ENABLE(__HANDLE__)). + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_HWCONTROL_RTS_ENABLE(__HANDLE__) \ + do{ \ + ATOMIC_SET_BIT((__HANDLE__)->Instance->CR3, USART_CR3_RTSE); \ + (__HANDLE__)->Init.HwFlowCtl |= USART_CR3_RTSE; \ + } while(0U) + +/** @brief Disable RTS flow control. + * @note This macro allows to disable RTS hardware flow control for a given UART instance, + * without need to call HAL_UART_Init() function. + * As involving direct access to UART registers, usage of this macro should be fully endorsed by user. + * @note As macro is expected to be used for modifying RTS Hw flow control feature activation, without need + * for USART instance Deinit/Init, following conditions for macro call should be fulfilled : + * - UART instance should have already been initialised (through call of HAL_UART_Init() ) + * - macro could only be called when corresponding UART instance is disabled + * (i.e. __HAL_UART_DISABLE(__HANDLE__)) and should be followed by an Enable + * macro (i.e. __HAL_UART_ENABLE(__HANDLE__)). + * @param __HANDLE__ specifies the UART Handle. + * @retval None + */ +#define __HAL_UART_HWCONTROL_RTS_DISABLE(__HANDLE__) \ + do{ \ + ATOMIC_CLEAR_BIT((__HANDLE__)->Instance->CR3, USART_CR3_RTSE);\ + (__HANDLE__)->Init.HwFlowCtl &= ~(USART_CR3_RTSE); \ + } while(0U) +/** + * @} + */ + +/* Private macros --------------------------------------------------------*/ +/** @defgroup UART_Private_Macros UART Private Macros + * @{ + */ + + +/** @brief BRR division operation to set BRR register in 8-bit oversampling mode. + * @param __PCLK__ UART clock. + * @param __BAUD__ Baud rate set by the user. + * @retval Division result + */ +#define UART_DIV_SAMPLING8(__PCLK__, __BAUD__) ((((__PCLK__)*2U) + ((__BAUD__)/2U)) / (__BAUD__)) + +/** @brief BRR division operation to set BRR register in 16-bit oversampling mode. + * @param __PCLK__ UART clock. + * @param __BAUD__ Baud rate set by the user. + * @retval Division result + */ +#define UART_DIV_SAMPLING16(__PCLK__, __BAUD__) (((__PCLK__) + ((__BAUD__)/2U)) / (__BAUD__)) + + +/** @brief Check UART Baud rate. + * @param __BAUDRATE__ Baudrate specified by the user. + * The maximum Baud Rate is derived from the maximum clock on F3 (i.e. 72 MHz) + * divided by the smallest oversampling used on the USART (i.e. 8) + * @retval SET (__BAUDRATE__ is valid) or RESET (__BAUDRATE__ is invalid) + */ +#define IS_UART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) < 9000001U) + +/** @brief Check UART assertion time. + * @param __TIME__ 5-bit value assertion time. + * @retval Test result (TRUE or FALSE). + */ +#define IS_UART_ASSERTIONTIME(__TIME__) ((__TIME__) <= 0x1FU) + +/** @brief Check UART deassertion time. + * @param __TIME__ 5-bit value deassertion time. + * @retval Test result (TRUE or FALSE). + */ +#define IS_UART_DEASSERTIONTIME(__TIME__) ((__TIME__) <= 0x1FU) + +/** + * @brief Ensure that UART frame number of stop bits is valid. + * @param __STOPBITS__ UART frame number of stop bits. + * @retval SET (__STOPBITS__ is valid) or RESET (__STOPBITS__ is invalid) + */ +#define IS_UART_STOPBITS(__STOPBITS__) (((__STOPBITS__) == UART_STOPBITS_0_5) || \ + ((__STOPBITS__) == UART_STOPBITS_1) || \ + ((__STOPBITS__) == UART_STOPBITS_1_5) || \ + ((__STOPBITS__) == UART_STOPBITS_2)) + + +/** + * @brief Ensure that UART frame parity is valid. + * @param __PARITY__ UART frame parity. + * @retval SET (__PARITY__ is valid) or RESET (__PARITY__ is invalid) + */ +#define IS_UART_PARITY(__PARITY__) (((__PARITY__) == UART_PARITY_NONE) || \ + ((__PARITY__) == UART_PARITY_EVEN) || \ + ((__PARITY__) == UART_PARITY_ODD)) + +/** + * @brief Ensure that UART hardware flow control is valid. + * @param __CONTROL__ UART hardware flow control. + * @retval SET (__CONTROL__ is valid) or RESET (__CONTROL__ is invalid) + */ +#define IS_UART_HARDWARE_FLOW_CONTROL(__CONTROL__)\ + (((__CONTROL__) == UART_HWCONTROL_NONE) || \ + ((__CONTROL__) == UART_HWCONTROL_RTS) || \ + ((__CONTROL__) == UART_HWCONTROL_CTS) || \ + ((__CONTROL__) == UART_HWCONTROL_RTS_CTS)) + +/** + * @brief Ensure that UART communication mode is valid. + * @param __MODE__ UART communication mode. + * @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid) + */ +#define IS_UART_MODE(__MODE__) ((((__MODE__) & (~((uint32_t)(UART_MODE_TX_RX)))) == 0x00U) && ((__MODE__) != 0x00U)) + +/** + * @brief Ensure that UART state is valid. + * @param __STATE__ UART state. + * @retval SET (__STATE__ is valid) or RESET (__STATE__ is invalid) + */ +#define IS_UART_STATE(__STATE__) (((__STATE__) == UART_STATE_DISABLE) || \ + ((__STATE__) == UART_STATE_ENABLE)) + +/** + * @brief Ensure that UART oversampling is valid. + * @param __SAMPLING__ UART oversampling. + * @retval SET (__SAMPLING__ is valid) or RESET (__SAMPLING__ is invalid) + */ +#define IS_UART_OVERSAMPLING(__SAMPLING__) (((__SAMPLING__) == UART_OVERSAMPLING_16) || \ + ((__SAMPLING__) == UART_OVERSAMPLING_8)) + +/** + * @brief Ensure that UART frame sampling is valid. + * @param __ONEBIT__ UART frame sampling. + * @retval SET (__ONEBIT__ is valid) or RESET (__ONEBIT__ is invalid) + */ +#define IS_UART_ONE_BIT_SAMPLE(__ONEBIT__) (((__ONEBIT__) == UART_ONE_BIT_SAMPLE_DISABLE) || \ + ((__ONEBIT__) == UART_ONE_BIT_SAMPLE_ENABLE)) + +/** + * @brief Ensure that UART auto Baud rate detection mode is valid. + * @param __MODE__ UART auto Baud rate detection mode. + * @retval SET (__MODE__ is valid) or RESET (__MODE__ is invalid) + */ +#define IS_UART_ADVFEATURE_AUTOBAUDRATEMODE(__MODE__) (((__MODE__) == UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT) || \ + ((__MODE__) == UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE) || \ + ((__MODE__) == UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME) || \ + ((__MODE__) == UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME)) + +/** + * @brief Ensure that UART receiver timeout setting is valid. + * @param __TIMEOUT__ UART receiver timeout setting. + * @retval SET (__TIMEOUT__ is valid) or RESET (__TIMEOUT__ is invalid) + */ +#define IS_UART_RECEIVER_TIMEOUT(__TIMEOUT__) (((__TIMEOUT__) == UART_RECEIVER_TIMEOUT_DISABLE) || \ + ((__TIMEOUT__) == UART_RECEIVER_TIMEOUT_ENABLE)) + +/** @brief Check the receiver timeout value. + * @note The maximum UART receiver timeout value is 0xFFFFFF. + * @param __TIMEOUTVALUE__ receiver timeout value. + * @retval Test result (TRUE or FALSE) + */ +#define IS_UART_RECEIVER_TIMEOUT_VALUE(__TIMEOUTVALUE__) ((__TIMEOUTVALUE__) <= 0xFFFFFFU) + +/** + * @brief Ensure that UART LIN state is valid. + * @param __LIN__ UART LIN state. + * @retval SET (__LIN__ is valid) or RESET (__LIN__ is invalid) + */ +#define IS_UART_LIN(__LIN__) (((__LIN__) == UART_LIN_DISABLE) || \ + ((__LIN__) == UART_LIN_ENABLE)) + +/** + * @brief Ensure that UART LIN break detection length is valid. + * @param __LENGTH__ UART LIN break detection length. + * @retval SET (__LENGTH__ is valid) or RESET (__LENGTH__ is invalid) + */ +#define IS_UART_LIN_BREAK_DETECT_LENGTH(__LENGTH__) (((__LENGTH__) == UART_LINBREAKDETECTLENGTH_10B) || \ + ((__LENGTH__) == UART_LINBREAKDETECTLENGTH_11B)) + +/** + * @brief Ensure that UART DMA TX state is valid. + * @param __DMATX__ UART DMA TX state. + * @retval SET (__DMATX__ is valid) or RESET (__DMATX__ is invalid) + */ +#define IS_UART_DMA_TX(__DMATX__) (((__DMATX__) == UART_DMA_TX_DISABLE) || \ + ((__DMATX__) == UART_DMA_TX_ENABLE)) + +/** + * @brief Ensure that UART DMA RX state is valid. + * @param __DMARX__ UART DMA RX state. + * @retval SET (__DMARX__ is valid) or RESET (__DMARX__ is invalid) + */ +#define IS_UART_DMA_RX(__DMARX__) (((__DMARX__) == UART_DMA_RX_DISABLE) || \ + ((__DMARX__) == UART_DMA_RX_ENABLE)) + +/** + * @brief Ensure that UART half-duplex state is valid. + * @param __HDSEL__ UART half-duplex state. + * @retval SET (__HDSEL__ is valid) or RESET (__HDSEL__ is invalid) + */ +#define IS_UART_HALF_DUPLEX(__HDSEL__) (((__HDSEL__) == UART_HALF_DUPLEX_DISABLE) || \ + ((__HDSEL__) == UART_HALF_DUPLEX_ENABLE)) + +/** + * @brief Ensure that UART wake-up method is valid. + * @param __WAKEUP__ UART wake-up method . + * @retval SET (__WAKEUP__ is valid) or RESET (__WAKEUP__ is invalid) + */ +#define IS_UART_WAKEUPMETHOD(__WAKEUP__) (((__WAKEUP__) == UART_WAKEUPMETHOD_IDLELINE) || \ + ((__WAKEUP__) == UART_WAKEUPMETHOD_ADDRESSMARK)) + +/** + * @brief Ensure that UART request parameter is valid. + * @param __PARAM__ UART request parameter. + * @retval SET (__PARAM__ is valid) or RESET (__PARAM__ is invalid) + */ +#define IS_UART_REQUEST_PARAMETER(__PARAM__) (((__PARAM__) == UART_AUTOBAUD_REQUEST) || \ + ((__PARAM__) == UART_SENDBREAK_REQUEST) || \ + ((__PARAM__) == UART_MUTE_MODE_REQUEST) || \ + ((__PARAM__) == UART_RXDATA_FLUSH_REQUEST) || \ + ((__PARAM__) == UART_TXDATA_FLUSH_REQUEST)) + +/** + * @brief Ensure that UART advanced features initialization is valid. + * @param __INIT__ UART advanced features initialization. + * @retval SET (__INIT__ is valid) or RESET (__INIT__ is invalid) + */ +#define IS_UART_ADVFEATURE_INIT(__INIT__) ((__INIT__) <= (UART_ADVFEATURE_NO_INIT | \ + UART_ADVFEATURE_TXINVERT_INIT | \ + UART_ADVFEATURE_RXINVERT_INIT | \ + UART_ADVFEATURE_DATAINVERT_INIT | \ + UART_ADVFEATURE_SWAP_INIT | \ + UART_ADVFEATURE_RXOVERRUNDISABLE_INIT | \ + UART_ADVFEATURE_DMADISABLEONERROR_INIT | \ + UART_ADVFEATURE_AUTOBAUDRATE_INIT | \ + UART_ADVFEATURE_MSBFIRST_INIT)) + +/** + * @brief Ensure that UART frame TX inversion setting is valid. + * @param __TXINV__ UART frame TX inversion setting. + * @retval SET (__TXINV__ is valid) or RESET (__TXINV__ is invalid) + */ +#define IS_UART_ADVFEATURE_TXINV(__TXINV__) (((__TXINV__) == UART_ADVFEATURE_TXINV_DISABLE) || \ + ((__TXINV__) == UART_ADVFEATURE_TXINV_ENABLE)) + +/** + * @brief Ensure that UART frame RX inversion setting is valid. + * @param __RXINV__ UART frame RX inversion setting. + * @retval SET (__RXINV__ is valid) or RESET (__RXINV__ is invalid) + */ +#define IS_UART_ADVFEATURE_RXINV(__RXINV__) (((__RXINV__) == UART_ADVFEATURE_RXINV_DISABLE) || \ + ((__RXINV__) == UART_ADVFEATURE_RXINV_ENABLE)) + +/** + * @brief Ensure that UART frame data inversion setting is valid. + * @param __DATAINV__ UART frame data inversion setting. + * @retval SET (__DATAINV__ is valid) or RESET (__DATAINV__ is invalid) + */ +#define IS_UART_ADVFEATURE_DATAINV(__DATAINV__) (((__DATAINV__) == UART_ADVFEATURE_DATAINV_DISABLE) || \ + ((__DATAINV__) == UART_ADVFEATURE_DATAINV_ENABLE)) + +/** + * @brief Ensure that UART frame RX/TX pins swap setting is valid. + * @param __SWAP__ UART frame RX/TX pins swap setting. + * @retval SET (__SWAP__ is valid) or RESET (__SWAP__ is invalid) + */ +#define IS_UART_ADVFEATURE_SWAP(__SWAP__) (((__SWAP__) == UART_ADVFEATURE_SWAP_DISABLE) || \ + ((__SWAP__) == UART_ADVFEATURE_SWAP_ENABLE)) + +/** + * @brief Ensure that UART frame overrun setting is valid. + * @param __OVERRUN__ UART frame overrun setting. + * @retval SET (__OVERRUN__ is valid) or RESET (__OVERRUN__ is invalid) + */ +#define IS_UART_OVERRUN(__OVERRUN__) (((__OVERRUN__) == UART_ADVFEATURE_OVERRUN_ENABLE) || \ + ((__OVERRUN__) == UART_ADVFEATURE_OVERRUN_DISABLE)) + +/** + * @brief Ensure that UART auto Baud rate state is valid. + * @param __AUTOBAUDRATE__ UART auto Baud rate state. + * @retval SET (__AUTOBAUDRATE__ is valid) or RESET (__AUTOBAUDRATE__ is invalid) + */ +#define IS_UART_ADVFEATURE_AUTOBAUDRATE(__AUTOBAUDRATE__) (((__AUTOBAUDRATE__) == \ + UART_ADVFEATURE_AUTOBAUDRATE_DISABLE) || \ + ((__AUTOBAUDRATE__) == UART_ADVFEATURE_AUTOBAUDRATE_ENABLE)) + +/** + * @brief Ensure that UART DMA enabling or disabling on error setting is valid. + * @param __DMA__ UART DMA enabling or disabling on error setting. + * @retval SET (__DMA__ is valid) or RESET (__DMA__ is invalid) + */ +#define IS_UART_ADVFEATURE_DMAONRXERROR(__DMA__) (((__DMA__) == UART_ADVFEATURE_DMA_ENABLEONRXERROR) || \ + ((__DMA__) == UART_ADVFEATURE_DMA_DISABLEONRXERROR)) + +/** + * @brief Ensure that UART frame MSB first setting is valid. + * @param __MSBFIRST__ UART frame MSB first setting. + * @retval SET (__MSBFIRST__ is valid) or RESET (__MSBFIRST__ is invalid) + */ +#define IS_UART_ADVFEATURE_MSBFIRST(__MSBFIRST__) (((__MSBFIRST__) == UART_ADVFEATURE_MSBFIRST_DISABLE) || \ + ((__MSBFIRST__) == UART_ADVFEATURE_MSBFIRST_ENABLE)) + +/** + * @brief Ensure that UART stop mode state is valid. + * @param __STOPMODE__ UART stop mode state. + * @retval SET (__STOPMODE__ is valid) or RESET (__STOPMODE__ is invalid) + */ +#define IS_UART_ADVFEATURE_STOPMODE(__STOPMODE__) (((__STOPMODE__) == UART_ADVFEATURE_STOPMODE_DISABLE) || \ + ((__STOPMODE__) == UART_ADVFEATURE_STOPMODE_ENABLE)) + +/** + * @brief Ensure that UART mute mode state is valid. + * @param __MUTE__ UART mute mode state. + * @retval SET (__MUTE__ is valid) or RESET (__MUTE__ is invalid) + */ +#define IS_UART_MUTE_MODE(__MUTE__) (((__MUTE__) == UART_ADVFEATURE_MUTEMODE_DISABLE) || \ + ((__MUTE__) == UART_ADVFEATURE_MUTEMODE_ENABLE)) + +/** + * @brief Ensure that UART wake-up selection is valid. + * @param __WAKE__ UART wake-up selection. + * @retval SET (__WAKE__ is valid) or RESET (__WAKE__ is invalid) + */ +#define IS_UART_WAKEUP_SELECTION(__WAKE__) (((__WAKE__) == UART_WAKEUP_ON_ADDRESS) || \ + ((__WAKE__) == UART_WAKEUP_ON_STARTBIT) || \ + ((__WAKE__) == UART_WAKEUP_ON_READDATA_NONEMPTY)) + +/** + * @brief Ensure that UART driver enable polarity is valid. + * @param __POLARITY__ UART driver enable polarity. + * @retval SET (__POLARITY__ is valid) or RESET (__POLARITY__ is invalid) + */ +#define IS_UART_DE_POLARITY(__POLARITY__) (((__POLARITY__) == UART_DE_POLARITY_HIGH) || \ + ((__POLARITY__) == UART_DE_POLARITY_LOW)) + + +/** + * @} + */ + +/* Include UART HAL Extended module */ +#include "stm32f3xx_hal_uart_ex.h" + +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup UART_Exported_Functions UART Exported Functions + * @{ + */ + +/** @addtogroup UART_Exported_Functions_Group1 Initialization and de-initialization functions + * @{ + */ + +/* Initialization and de-initialization functions ****************************/ +HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_HalfDuplex_Init(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLength); +HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod); +HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart); +void HAL_UART_MspInit(UART_HandleTypeDef *huart); +void HAL_UART_MspDeInit(UART_HandleTypeDef *huart); + +/* Callbacks Register/UnRegister functions ***********************************/ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) +HAL_StatusTypeDef HAL_UART_RegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID, + pUART_CallbackTypeDef pCallback); +HAL_StatusTypeDef HAL_UART_UnRegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID); + +HAL_StatusTypeDef HAL_UART_RegisterRxEventCallback(UART_HandleTypeDef *huart, pUART_RxEventCallbackTypeDef pCallback); +HAL_StatusTypeDef HAL_UART_UnRegisterRxEventCallback(UART_HandleTypeDef *huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/** @addtogroup UART_Exported_Functions_Group2 IO operation functions + * @{ + */ + +/* IO operation functions *****************************************************/ +HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout); +HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_UART_Transmit_DMA(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_UART_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_UART_DMAPause(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UART_DMAResume(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UART_DMAStop(UART_HandleTypeDef *huart); +/* Transfer Abort functions */ +HAL_StatusTypeDef HAL_UART_Abort(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UART_AbortTransmit(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UART_AbortReceive(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UART_Abort_IT(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UART_AbortTransmit_IT(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UART_AbortReceive_IT(UART_HandleTypeDef *huart); + +void HAL_UART_IRQHandler(UART_HandleTypeDef *huart); +void HAL_UART_TxHalfCpltCallback(UART_HandleTypeDef *huart); +void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart); +void HAL_UART_RxHalfCpltCallback(UART_HandleTypeDef *huart); +void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart); +void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart); +void HAL_UART_AbortCpltCallback(UART_HandleTypeDef *huart); +void HAL_UART_AbortTransmitCpltCallback(UART_HandleTypeDef *huart); +void HAL_UART_AbortReceiveCpltCallback(UART_HandleTypeDef *huart); + +void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size); + +/** + * @} + */ + +/** @addtogroup UART_Exported_Functions_Group3 Peripheral Control functions + * @{ + */ + +/* Peripheral Control functions ************************************************/ +void HAL_UART_ReceiverTimeout_Config(UART_HandleTypeDef *huart, uint32_t TimeoutValue); +HAL_StatusTypeDef HAL_UART_EnableReceiverTimeout(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UART_DisableReceiverTimeout(UART_HandleTypeDef *huart); + +HAL_StatusTypeDef HAL_LIN_SendBreak(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_MultiProcessor_EnableMuteMode(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_MultiProcessor_DisableMuteMode(UART_HandleTypeDef *huart); +void HAL_MultiProcessor_EnterMuteMode(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_HalfDuplex_EnableTransmitter(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_HalfDuplex_EnableReceiver(UART_HandleTypeDef *huart); + +/** + * @} + */ + +/** @addtogroup UART_Exported_Functions_Group4 Peripheral State and Error functions + * @{ + */ + +/* Peripheral State and Errors functions **************************************************/ +HAL_UART_StateTypeDef HAL_UART_GetState(const UART_HandleTypeDef *huart); +uint32_t HAL_UART_GetError(const UART_HandleTypeDef *huart); + +/** + * @} + */ + +/** + * @} + */ + +/* Private functions -----------------------------------------------------------*/ +/** @addtogroup UART_Private_Functions UART Private Functions + * @{ + */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) +void UART_InitCallbacksToDefault(UART_HandleTypeDef *huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +HAL_StatusTypeDef UART_SetConfig(UART_HandleTypeDef *huart); +HAL_StatusTypeDef UART_CheckIdleState(UART_HandleTypeDef *huart); +HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, + uint32_t Tickstart, uint32_t Timeout); +void UART_AdvFeatureConfig(UART_HandleTypeDef *huart); +HAL_StatusTypeDef UART_Start_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef UART_Start_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); + +/** + * @} + */ + +/* Private variables -----------------------------------------------------------*/ +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32F3xx_HAL_UART_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart_ex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart_ex.h new file mode 100644 index 0000000..058c49e --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_uart_ex.h @@ -0,0 +1,513 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_uart_ex.h + * @author MCD Application Team + * @brief Header file of UART HAL Extended module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_HAL_UART_EX_H +#define STM32F3xx_HAL_UART_EX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal_def.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup UARTEx + * @{ + */ + +/* Exported types ------------------------------------------------------------*/ +/** @defgroup UARTEx_Exported_Types UARTEx Exported Types + * @{ + */ + +/** + * @brief UART wake up from stop mode parameters + */ +typedef struct +{ + uint32_t WakeUpEvent; /*!< Specifies which event will activate the Wakeup from Stop mode flag (WUF). + This parameter can be a value of @ref UART_WakeUp_from_Stop_Selection. + If set to UART_WAKEUP_ON_ADDRESS, the two other fields below must + be filled up. */ + + uint16_t AddressLength; /*!< Specifies whether the address is 4 or 7-bit long. + This parameter can be a value of @ref UARTEx_WakeUp_Address_Length. */ + + uint8_t Address; /*!< UART/USART node address (7-bit long max). */ +} UART_WakeUpTypeDef; + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup UARTEx_Exported_Constants UARTEx Exported Constants + * @{ + */ + +/** @defgroup UARTEx_Word_Length UARTEx Word Length + * @{ + */ +#if defined(USART_CR1_M1) +#define UART_WORDLENGTH_7B USART_CR1_M1 /*!< 7-bit long UART frame */ +#endif /* USART_CR1_M1 */ +#define UART_WORDLENGTH_8B 0x00000000U /*!< 8-bit long UART frame */ +#if defined (USART_CR1_M0) +#define UART_WORDLENGTH_9B USART_CR1_M0 /*!< 9-bit long UART frame */ +#else +#define UART_WORDLENGTH_9B USART_CR1_M /*!< 9-bit long UART frame */ +#endif /* USART_CR1_M0 */ +/** + * @} + */ + +/** @defgroup UARTEx_WakeUp_Address_Length UARTEx WakeUp Address Length + * @{ + */ +#define UART_ADDRESS_DETECT_4B 0x00000000U /*!< 4-bit long wake-up address */ +#define UART_ADDRESS_DETECT_7B USART_CR2_ADDM7 /*!< 7-bit long wake-up address */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macros -----------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ +/** @addtogroup UARTEx_Exported_Functions + * @{ + */ + +/** @addtogroup UARTEx_Exported_Functions_Group1 + * @{ + */ + +/* Initialization and de-initialization functions ****************************/ +HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity, uint32_t AssertionTime, + uint32_t DeassertionTime); + +/** + * @} + */ + +/** @addtogroup UARTEx_Exported_Functions_Group2 + * @{ + */ + +void HAL_UARTEx_WakeupCallback(UART_HandleTypeDef *huart); + +/** + * @} + */ + +/** @addtogroup UARTEx_Exported_Functions_Group3 + * @{ + */ + +/* Peripheral Control functions **********************************************/ +HAL_StatusTypeDef HAL_UARTEx_StopModeWakeUpSourceConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection); +HAL_StatusTypeDef HAL_UARTEx_EnableStopMode(UART_HandleTypeDef *huart); +HAL_StatusTypeDef HAL_UARTEx_DisableStopMode(UART_HandleTypeDef *huart); + +HAL_StatusTypeDef HAL_MultiProcessorEx_AddressLength_Set(UART_HandleTypeDef *huart, uint32_t AddressLength); + + +HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint16_t *RxLen, + uint32_t Timeout); +HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); +HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); + +HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(UART_HandleTypeDef *huart); + + +/** + * @} + */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup UARTEx_Private_Macros UARTEx Private Macros + * @{ + */ + +/** @brief Report the UART clock source. + * @param __HANDLE__ specifies the UART Handle. + * @param __CLOCKSOURCE__ output variable. + * @retval UART clocking source, written in __CLOCKSOURCE__. + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || defined(STM32F302xC) \ + || defined(STM32F303xC) || defined(STM32F358xx) +#define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ + do { \ + if((__HANDLE__)->Instance == USART1) \ + { \ + switch(__HAL_RCC_GET_USART1_SOURCE()) \ + { \ + case RCC_USART1CLKSOURCE_PCLK2: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2; \ + break; \ + case RCC_USART1CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_USART1CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_USART1CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else if((__HANDLE__)->Instance == USART2) \ + { \ + switch(__HAL_RCC_GET_USART2_SOURCE()) \ + { \ + case RCC_USART2CLKSOURCE_PCLK1: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + break; \ + case RCC_USART2CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_USART2CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_USART2CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else if((__HANDLE__)->Instance == USART3) \ + { \ + switch(__HAL_RCC_GET_USART3_SOURCE()) \ + { \ + case RCC_USART3CLKSOURCE_PCLK1: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + break; \ + case RCC_USART3CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_USART3CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_USART3CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else if((__HANDLE__)->Instance == UART4) \ + { \ + switch(__HAL_RCC_GET_UART4_SOURCE()) \ + { \ + case RCC_UART4CLKSOURCE_PCLK1: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + break; \ + case RCC_UART4CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_UART4CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_UART4CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else if ((__HANDLE__)->Instance == UART5) \ + { \ + switch(__HAL_RCC_GET_UART5_SOURCE()) \ + { \ + case RCC_UART5CLKSOURCE_PCLK1: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + break; \ + case RCC_UART5CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_UART5CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_UART5CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else \ + { \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + } \ + } while(0U) +#elif defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || defined(STM32F301x8) \ + || defined(STM32F302x8) || defined(STM32F318xx) +#define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ + do { \ + if((__HANDLE__)->Instance == USART1) \ + { \ + switch(__HAL_RCC_GET_USART1_SOURCE()) \ + { \ + case RCC_USART1CLKSOURCE_PCLK1: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + break; \ + case RCC_USART1CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_USART1CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_USART1CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else if((__HANDLE__)->Instance == USART2) \ + { \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + } \ + else if((__HANDLE__)->Instance == USART3) \ + { \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + } \ + else \ + { \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + } \ + } while(0U) +#else +#define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ + do { \ + if((__HANDLE__)->Instance == USART1) \ + { \ + switch(__HAL_RCC_GET_USART1_SOURCE()) \ + { \ + case RCC_USART1CLKSOURCE_PCLK2: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2; \ + break; \ + case RCC_USART1CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_USART1CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_USART1CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else if((__HANDLE__)->Instance == USART2) \ + { \ + switch(__HAL_RCC_GET_USART2_SOURCE()) \ + { \ + case RCC_USART2CLKSOURCE_PCLK1: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + break; \ + case RCC_USART2CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_USART2CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_USART2CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else if((__HANDLE__)->Instance == USART3) \ + { \ + switch(__HAL_RCC_GET_USART3_SOURCE()) \ + { \ + case RCC_USART3CLKSOURCE_PCLK1: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ + break; \ + case RCC_USART3CLKSOURCE_HSI: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ + break; \ + case RCC_USART3CLKSOURCE_SYSCLK: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ + break; \ + case RCC_USART3CLKSOURCE_LSE: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ + break; \ + default: \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + break; \ + } \ + } \ + else \ + { \ + (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ + } \ + } while(0U) +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || STM32F302xC || STM32F303xC || STM32F358xx */ + +/** @brief Report the UART mask to apply to retrieve the received data + * according to the word length and to the parity bits activation. + * @note If PCE = 1, the parity bit is not included in the data extracted + * by the reception API(). + * This masking operation is not carried out in the case of + * DMA transfers. + * @param __HANDLE__ specifies the UART Handle. + * @retval None, the mask to apply to UART RDR register is stored in (__HANDLE__)->Mask field. + */ +#if defined (USART_CR1_M1) +#define UART_MASK_COMPUTATION(__HANDLE__) \ + do { \ + if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B) \ + { \ + if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ + { \ + (__HANDLE__)->Mask = 0x01FFU ; \ + } \ + else \ + { \ + (__HANDLE__)->Mask = 0x00FFU ; \ + } \ + } \ + else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B) \ + { \ + if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ + { \ + (__HANDLE__)->Mask = 0x00FFU ; \ + } \ + else \ + { \ + (__HANDLE__)->Mask = 0x007FU ; \ + } \ + } \ + else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_7B) \ + { \ + if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ + { \ + (__HANDLE__)->Mask = 0x007FU ; \ + } \ + else \ + { \ + (__HANDLE__)->Mask = 0x003FU ; \ + } \ + } \ + else \ + { \ + (__HANDLE__)->Mask = 0x0000U; \ + } \ + } while(0U) + +#else +#define UART_MASK_COMPUTATION(__HANDLE__) \ + do { \ + if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B) \ + { \ + if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ + { \ + (__HANDLE__)->Mask = 0x01FFU ; \ + } \ + else \ + { \ + (__HANDLE__)->Mask = 0x00FFU ; \ + } \ + } \ + else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B) \ + { \ + if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ + { \ + (__HANDLE__)->Mask = 0x00FFU ; \ + } \ + else \ + { \ + (__HANDLE__)->Mask = 0x007FU ; \ + } \ + } \ + else \ + { \ + (__HANDLE__)->Mask = 0x0000U; \ + } \ + } while(0U) + +#endif /* USART_CR1_M1 */ + +/** + * @brief Ensure that UART frame length is valid. + * @param __LENGTH__ UART frame length. + * @retval SET (__LENGTH__ is valid) or RESET (__LENGTH__ is invalid) + */ +#if defined (USART_CR1_M1) +#define IS_UART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == UART_WORDLENGTH_7B) || \ + ((__LENGTH__) == UART_WORDLENGTH_8B) || \ + ((__LENGTH__) == UART_WORDLENGTH_9B)) +#else +#define IS_UART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == UART_WORDLENGTH_8B) || \ + ((__LENGTH__) == UART_WORDLENGTH_9B)) +#endif /* USART_CR1_M1 */ + +/** + * @brief Ensure that UART wake-up address length is valid. + * @param __ADDRESS__ UART wake-up address length. + * @retval SET (__ADDRESS__ is valid) or RESET (__ADDRESS__ is invalid) + */ +#define IS_UART_ADDRESSLENGTH_DETECT(__ADDRESS__) (((__ADDRESS__) == UART_ADDRESS_DETECT_4B) || \ + ((__ADDRESS__) == UART_ADDRESS_DETECT_7B)) + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32F3xx_HAL_UART_EX_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_adc.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_adc.h new file mode 100644 index 0000000..fa1d43e --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_adc.h @@ -0,0 +1,10828 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_adc.h + * @author MCD Application Team + * @brief Header file of ADC LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_ADC_H +#define __STM32F3xx_LL_ADC_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +/* Note: Devices of STM32F3 series embed 1 out of 2 different ADC IP. */ +/* - STM32F30x, STM32F31x, STM32F32x, STM32F33x, STM32F35x, STM32F39x: */ +/* ADC IP 5Msamples/sec, from 1 to 4 ADC instances and other specific */ +/* features (refer to reference manual). */ +/* - STM32F37x: */ +/* ADC IP 1Msamples/sec, 1 ADC instance */ +/* This file contains the drivers of these ADC IP, located in 2 area */ +/* delimited by compilation switches. */ + +#if defined(ADC5_V1_1) + +#if defined (ADC1) || defined (ADC2) || defined (ADC3) || defined (ADC4) + +/** @defgroup ADC_LL ADC + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup ADC_LL_Private_Constants ADC Private Constants + * @{ + */ + +/* Internal mask for ADC group regular sequencer: */ +/* To select into literal LL_ADC_REG_RANK_x the relevant bits for: */ +/* - sequencer register offset */ +/* - sequencer rank bits position into the selected register */ + +/* Internal register offset for ADC group regular sequencer configuration */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_SQR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_SQR2_REGOFFSET ((uint32_t)0x00000100U) +#define ADC_SQR3_REGOFFSET ((uint32_t)0x00000200U) +#define ADC_SQR4_REGOFFSET ((uint32_t)0x00000300U) + +#define ADC_REG_SQRX_REGOFFSET_MASK (ADC_SQR1_REGOFFSET | ADC_SQR2_REGOFFSET | ADC_SQR3_REGOFFSET | ADC_SQR4_REGOFFSET) +#define ADC_REG_RANK_ID_SQRX_MASK (ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0) + +/* Definition of ADC group regular sequencer bits information to be inserted */ +/* into ADC group regular sequencer ranks literals definition. */ +#define ADC_REG_RANK_1_SQRX_BITOFFSET_POS ((uint32_t) 6U) /* Value equivalent to POSITION_VAL(ADC_SQR1_SQ1) */ +#define ADC_REG_RANK_2_SQRX_BITOFFSET_POS ((uint32_t)12U) /* Value equivalent to POSITION_VAL(ADC_SQR1_SQ2) */ +#define ADC_REG_RANK_3_SQRX_BITOFFSET_POS ((uint32_t)18U) /* Value equivalent to POSITION_VAL(ADC_SQR1_SQ3) */ +#define ADC_REG_RANK_4_SQRX_BITOFFSET_POS ((uint32_t)24U) /* Value equivalent to POSITION_VAL(ADC_SQR1_SQ4) */ +#define ADC_REG_RANK_5_SQRX_BITOFFSET_POS ((uint32_t) 0U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ5) */ +#define ADC_REG_RANK_6_SQRX_BITOFFSET_POS ((uint32_t) 6U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ6) */ +#define ADC_REG_RANK_7_SQRX_BITOFFSET_POS ((uint32_t)12U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ7) */ +#define ADC_REG_RANK_8_SQRX_BITOFFSET_POS ((uint32_t)18U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ8) */ +#define ADC_REG_RANK_9_SQRX_BITOFFSET_POS ((uint32_t)24U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ9) */ +#define ADC_REG_RANK_10_SQRX_BITOFFSET_POS ((uint32_t) 0U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ10) */ +#define ADC_REG_RANK_11_SQRX_BITOFFSET_POS ((uint32_t) 6U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ11) */ +#define ADC_REG_RANK_12_SQRX_BITOFFSET_POS ((uint32_t)12U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ12) */ +#define ADC_REG_RANK_13_SQRX_BITOFFSET_POS ((uint32_t)18U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ13) */ +#define ADC_REG_RANK_14_SQRX_BITOFFSET_POS ((uint32_t)24U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ14) */ +#define ADC_REG_RANK_15_SQRX_BITOFFSET_POS ((uint32_t) 0U) /* Value equivalent to POSITION_VAL(ADC_SQR4_SQ15) */ +#define ADC_REG_RANK_16_SQRX_BITOFFSET_POS ((uint32_t) 6U) /* Value equivalent to POSITION_VAL(ADC_SQR4_SQ16) */ + + + +/* Internal mask for ADC group injected sequencer: */ +/* To select into literal LL_ADC_INJ_RANK_x the relevant bits for: */ +/* - data register offset */ +/* - sequencer rank bits position into the selected register */ + +/* Internal register offset for ADC group injected data register */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_JDR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_JDR2_REGOFFSET ((uint32_t)0x00000100U) +#define ADC_JDR3_REGOFFSET ((uint32_t)0x00000200U) +#define ADC_JDR4_REGOFFSET ((uint32_t)0x00000300U) + +#define ADC_INJ_JDRX_REGOFFSET_MASK (ADC_JDR1_REGOFFSET | ADC_JDR2_REGOFFSET | ADC_JDR3_REGOFFSET | ADC_JDR4_REGOFFSET) +#define ADC_INJ_RANK_ID_JSQR_MASK (ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0) + +/* Definition of ADC group injected sequencer bits information to be inserted */ +/* into ADC group injected sequencer ranks literals definition. */ +#define ADC_INJ_RANK_1_JSQR_BITOFFSET_POS ((uint32_t) 8U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JSQ1) */ +#define ADC_INJ_RANK_2_JSQR_BITOFFSET_POS ((uint32_t)14U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JSQ2) */ +#define ADC_INJ_RANK_3_JSQR_BITOFFSET_POS ((uint32_t)20U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JSQ3) */ +#define ADC_INJ_RANK_4_JSQR_BITOFFSET_POS ((uint32_t)26U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JSQ4) */ + + + +/* Internal mask for ADC group regular trigger: */ +/* To select into literal LL_ADC_REG_TRIG_x the relevant bits for: */ +/* - regular trigger source */ +/* - regular trigger edge */ +#define ADC_REG_TRIG_EXT_EDGE_DEFAULT (ADC_CFGR_EXTEN_0) /* Trigger edge set to rising edge (default setting for compatibility with some ADC on other STM32 families having this setting set by HW default value) */ + +/* Mask containing trigger source masks for each of possible */ +/* trigger edge selection duplicated with shifts [0; 4; 8; 12] */ +/* corresponding to {SW start; ext trigger; ext trigger; ext trigger}. */ +#define ADC_REG_TRIG_SOURCE_MASK (((LL_ADC_REG_TRIG_SOFTWARE & ADC_CFGR_EXTSEL) << (4U * 0U)) | \ + ((ADC_CFGR_EXTSEL) << (4U * 1U)) | \ + ((ADC_CFGR_EXTSEL) << (4U * 2U)) | \ + ((ADC_CFGR_EXTSEL) << (4U * 3U)) ) + +/* Mask containing trigger edge masks for each of possible */ +/* trigger edge selection duplicated with shifts [0; 4; 8; 12] */ +/* corresponding to {SW start; ext trigger; ext trigger; ext trigger}. */ +#define ADC_REG_TRIG_EDGE_MASK (((LL_ADC_REG_TRIG_SOFTWARE & ADC_CFGR_EXTEN) << (4U * 0U)) | \ + ((ADC_REG_TRIG_EXT_EDGE_DEFAULT) << (4U * 1U)) | \ + ((ADC_REG_TRIG_EXT_EDGE_DEFAULT) << (4U * 2U)) | \ + ((ADC_REG_TRIG_EXT_EDGE_DEFAULT) << (4U * 3U)) ) + +/* Definition of ADC group regular trigger bits information. */ +#define ADC_REG_TRIG_EXTSEL_BITOFFSET_POS ((uint32_t) 6U) /* Value equivalent to POSITION_VAL(ADC_CFGR_EXTSEL) */ +#define ADC_REG_TRIG_EXTEN_BITOFFSET_POS ((uint32_t)10U) /* Value equivalent to POSITION_VAL(ADC_CFGR_EXTEN) */ + + + +/* Internal definitions for ADC group regular trigger sources: */ +/* To differentiate into literal LL_ADC_REG_TRIG_x the trigger sources */ +/* depending on ADC instances ADC1, ADC2, ADC3, ADC4 (if ADC instance is */ +/* available on the selected device). */ + +#if defined(STM32F303xC) || defined(STM32F358xx) || defined(STM32F303xE) || defined(STM32F398xx) +/* Internal mask offset for ADC group injected trigger sources */ +/* available only on specific ADC instances. */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_REG_TRIG_EXT_INST_ADC12 ((uint32_t)0x00000001U) /* Marker for differentiation of ADC group regular external trigger available only on ADC instance: ADC1, ADC2 */ +#define ADC_REG_TRIG_EXT_INST_ADC34 ((uint32_t)0x00000002U) /* Marker for differentiation of ADC group regular external trigger available only on ADC instance: ADC3, ADC4 */ +#endif + +/* Internal mask for ADC group injected trigger: */ +/* To select into literal LL_ADC_INJ_TRIG_x the relevant bits for: */ +/* - injected trigger source */ +/* - injected trigger edge */ +#define ADC_INJ_TRIG_EXT_EDGE_DEFAULT (ADC_JSQR_JEXTEN_0) /* Trigger edge set to rising edge (default setting for compatibility with some ADC on other STM32 families having this setting set by HW default value) */ + +/* Mask containing trigger source masks for each of possible */ +/* trigger edge selection duplicated with shifts [0; 4; 8; 12] */ +/* corresponding to {SW start; ext trigger; ext trigger; ext trigger}. */ +#define ADC_INJ_TRIG_SOURCE_MASK (((LL_ADC_INJ_TRIG_SOFTWARE & ADC_JSQR_JEXTSEL) << (4U * 0U)) | \ + ((ADC_JSQR_JEXTSEL) << (4U * 1U)) | \ + ((ADC_JSQR_JEXTSEL) << (4U * 2U)) | \ + ((ADC_JSQR_JEXTSEL) << (4U * 3U)) ) + +/* Mask containing trigger edge masks for each of possible */ +/* trigger edge selection duplicated with shifts [0; 4; 8; 12] */ +/* corresponding to {SW start; ext trigger; ext trigger; ext trigger}. */ +#define ADC_INJ_TRIG_EDGE_MASK (((LL_ADC_INJ_TRIG_SOFTWARE & ADC_JSQR_JEXTEN) << (4U * 0U)) | \ + ((ADC_INJ_TRIG_EXT_EDGE_DEFAULT) << (4U * 1U)) | \ + ((ADC_INJ_TRIG_EXT_EDGE_DEFAULT) << (4U * 2U)) | \ + ((ADC_INJ_TRIG_EXT_EDGE_DEFAULT) << (4U * 3U)) ) + +/* Definition of ADC group injected trigger bits information. */ +#define ADC_INJ_TRIG_EXTSEL_BITOFFSET_POS ((uint32_t) 2U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JEXTSEL) */ +#define ADC_INJ_TRIG_EXTEN_BITOFFSET_POS ((uint32_t) 6U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JEXTEN) */ + + + +/* Internal definitions for ADC group injected trigger sources: */ +/* To differentiate into literal LL_ADC_INJ_TRIG_x the trigger sources */ +/* depending on ADC instances ADC1, ADC2, ADC3, ADC4 (if ADC instance is */ +/* available on the selected device). */ + +#if defined(STM32F303xC) || defined(STM32F358xx) || defined(STM32F303xE) || defined(STM32F398xx) +/* Internal mask offset for ADC group injected trigger sources */ +/* available only on specific ADC instances. */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_INJ_TRIG_EXT_INST_ADC12 ((uint32_t)0x00000001U) /* Marker for differentiation of ADC group injected external trigger available only on ADC instance: ADC1, ADC2 */ +#define ADC_INJ_TRIG_EXT_INST_ADC34 ((uint32_t)0x00000002U) /* Marker for differentiation of ADC group injected external trigger available only on ADC instance: ADC3, ADC4 */ +#endif + + + + +/* Internal mask for ADC channel: */ +/* To select into literal LL_ADC_CHANNEL_x the relevant bits for: */ +/* - channel identifier defined by number */ +/* - channel identifier defined by bitfield */ +/* - channel differentiation between external channels (connected to */ +/* GPIO pins) and internal channels (connected to internal paths) */ +/* - channel sampling time defined by SMPRx register offset */ +/* and SMPx bits positions into SMPRx register */ +#define ADC_CHANNEL_ID_NUMBER_MASK (ADC_CFGR_AWD1CH) +#define ADC_CHANNEL_ID_BITFIELD_MASK (ADC_AWD2CR_AWD2CH) +#define ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS ((uint32_t)26U)/* Value equivalent to POSITION_VAL(ADC_CHANNEL_ID_NUMBER_MASK) */ +#define ADC_CHANNEL_ID_MASK (ADC_CHANNEL_ID_NUMBER_MASK | ADC_CHANNEL_ID_BITFIELD_MASK | ADC_CHANNEL_ID_INTERNAL_CH_MASK) +/* Equivalent mask of ADC_CHANNEL_NUMBER_MASK aligned on register LSB (bit 0) */ +#define ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0 (ADC_SQR2_SQ5) /* Equivalent to shift: (ADC_CHANNEL_NUMBER_MASK >> POSITION_VAL(ADC_CHANNEL_NUMBER_MASK)) */ + +/* Channel differentiation between external and internal channels */ +#define ADC_CHANNEL_ID_INTERNAL_CH ((uint32_t)0x80000000U) /* Marker of internal channel */ +#define ADC_CHANNEL_ID_INTERNAL_CH_2 ((uint32_t)0x00080000U) /* Marker of internal channel for other ADC instances, in case of different ADC internal channels mapped on same channel number on different ADC instances */ +#define ADC_CHANNEL_ID_INTERNAL_CH_MASK (ADC_CHANNEL_ID_INTERNAL_CH | ADC_CHANNEL_ID_INTERNAL_CH_2) + +/* Internal register offset for ADC channel sampling time configuration */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_SMPR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_SMPR2_REGOFFSET ((uint32_t)0x02000000U) +#define ADC_CHANNEL_SMPRX_REGOFFSET_MASK (ADC_SMPR1_REGOFFSET | ADC_SMPR2_REGOFFSET) + +#define ADC_CHANNEL_SMPx_BITOFFSET_MASK ((uint32_t)0x01F00000U) +#define ADC_CHANNEL_SMPx_BITOFFSET_POS ((uint32_t)20U) /* Value equivalent to POSITION_VAL(ADC_CHANNEL_SMPx_BITOFFSET_MASK) */ + +/* Definition of channels ID number information to be inserted into */ +/* channels literals definition. */ +#define ADC_CHANNEL_0_NUMBER ((uint32_t)0x00000000U) +#define ADC_CHANNEL_1_NUMBER ( ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_2_NUMBER ( ADC_CFGR_AWD1CH_1 ) +#define ADC_CHANNEL_3_NUMBER ( ADC_CFGR_AWD1CH_1 | ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_4_NUMBER ( ADC_CFGR_AWD1CH_2 ) +#define ADC_CHANNEL_5_NUMBER ( ADC_CFGR_AWD1CH_2 | ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_6_NUMBER ( ADC_CFGR_AWD1CH_2 | ADC_CFGR_AWD1CH_1 ) +#define ADC_CHANNEL_7_NUMBER ( ADC_CFGR_AWD1CH_2 | ADC_CFGR_AWD1CH_1 | ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_8_NUMBER ( ADC_CFGR_AWD1CH_3 ) +#define ADC_CHANNEL_9_NUMBER ( ADC_CFGR_AWD1CH_3 | ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_10_NUMBER ( ADC_CFGR_AWD1CH_3 | ADC_CFGR_AWD1CH_1 ) +#define ADC_CHANNEL_11_NUMBER ( ADC_CFGR_AWD1CH_3 | ADC_CFGR_AWD1CH_1 | ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_12_NUMBER ( ADC_CFGR_AWD1CH_3 | ADC_CFGR_AWD1CH_2 ) +#define ADC_CHANNEL_13_NUMBER ( ADC_CFGR_AWD1CH_3 | ADC_CFGR_AWD1CH_2 | ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_14_NUMBER ( ADC_CFGR_AWD1CH_3 | ADC_CFGR_AWD1CH_2 | ADC_CFGR_AWD1CH_1 ) +#define ADC_CHANNEL_15_NUMBER ( ADC_CFGR_AWD1CH_3 | ADC_CFGR_AWD1CH_2 | ADC_CFGR_AWD1CH_1 | ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_16_NUMBER (ADC_CFGR_AWD1CH_4 ) +#define ADC_CHANNEL_17_NUMBER (ADC_CFGR_AWD1CH_4 | ADC_CFGR_AWD1CH_0) +#define ADC_CHANNEL_18_NUMBER (ADC_CFGR_AWD1CH_4 | ADC_CFGR_AWD1CH_1 ) + +/* Definition of channels ID bitfield information to be inserted into */ +/* channels literals definition. */ +#define ADC_CHANNEL_0_BITFIELD 0x00000001UL +#define ADC_CHANNEL_1_BITFIELD 0x00000002UL +#define ADC_CHANNEL_2_BITFIELD 0x00000004UL +#define ADC_CHANNEL_3_BITFIELD 0x00000008UL +#define ADC_CHANNEL_4_BITFIELD 0x00000010UL +#define ADC_CHANNEL_5_BITFIELD 0x00000020UL +#define ADC_CHANNEL_6_BITFIELD 0x00000040UL +#define ADC_CHANNEL_7_BITFIELD 0x00000080UL +#define ADC_CHANNEL_8_BITFIELD 0x00000100UL +#define ADC_CHANNEL_9_BITFIELD 0x00000200UL +#define ADC_CHANNEL_10_BITFIELD 0x00000400UL +#define ADC_CHANNEL_11_BITFIELD 0x00000800UL +#define ADC_CHANNEL_12_BITFIELD 0x00001000UL +#define ADC_CHANNEL_13_BITFIELD 0x00002000UL +#define ADC_CHANNEL_14_BITFIELD 0x00004000UL +#define ADC_CHANNEL_15_BITFIELD 0x00008000UL +#define ADC_CHANNEL_16_BITFIELD 0x00010000UL +#define ADC_CHANNEL_17_BITFIELD 0x00020000UL +#define ADC_CHANNEL_18_BITFIELD 0x00040000UL + +/* Definition of channels sampling time information to be inserted into */ +/* channels literals definition. */ +#define ADC_CHANNEL_0_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t) 0U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP0) */ +#define ADC_CHANNEL_1_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t) 3U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP1) */ +#define ADC_CHANNEL_2_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t) 6U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP2) */ +#define ADC_CHANNEL_3_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t) 9U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP3) */ +#define ADC_CHANNEL_4_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)12U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP4) */ +#define ADC_CHANNEL_5_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)15U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP5) */ +#define ADC_CHANNEL_6_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)18U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP6) */ +#define ADC_CHANNEL_7_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)21U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP7) */ +#define ADC_CHANNEL_8_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)24U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP8) */ +#define ADC_CHANNEL_9_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)27U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP9) */ +#define ADC_CHANNEL_10_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t) 0U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP10) */ +#define ADC_CHANNEL_11_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t) 3U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP11) */ +#define ADC_CHANNEL_12_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t) 6U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP12) */ +#define ADC_CHANNEL_13_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t) 9U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP13) */ +#define ADC_CHANNEL_14_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)12U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP14) */ +#define ADC_CHANNEL_15_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)15U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP15) */ +#define ADC_CHANNEL_16_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)18U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP16) */ +#define ADC_CHANNEL_17_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)21U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP17) */ +#define ADC_CHANNEL_18_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)24U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP18) */ + + +/* Internal mask for ADC mode single or differential ended: */ +/* To select into literals LL_ADC_SINGLE_ENDED or LL_ADC_SINGLE_DIFFERENTIAL */ +/* the relevant bits for: */ +/* (concatenation of multiple bits used in different registers) */ +/* - ADC calibration: calibration start, calibration factor get or set */ +/* - ADC channels: set each ADC channel ending mode */ +#define ADC_SINGLEDIFF_CALIB_START_MASK (ADC_CR_ADCALDIF) +#define ADC_SINGLEDIFF_CALIB_FACTOR_MASK (ADC_CALFACT_CALFACT_D | ADC_CALFACT_CALFACT_S) +#define ADC_SINGLEDIFF_CHANNEL_MASK (ADC_CHANNEL_ID_BITFIELD_MASK) /* Equivalent to ADC_DIFSEL_DIFSEL */ +#define ADC_SINGLEDIFF_CHANNEL_SHIFT_MASK (ADC_CALFACT_CALFACT_S_4 | ADC_CALFACT_CALFACT_S_3) /* Bits chosen to perform of shift when single mode is selected, shift value out of channels bits range. */ + + +/* Internal mask for ADC analog watchdog: */ +/* To select into literals LL_ADC_AWD_CHANNELx_xxx the relevant bits for: */ +/* (concatenation of multiple bits used in different analog watchdogs, */ +/* (feature of several watchdogs not available on all STM32 families)). */ +/* - analog watchdog 1: monitored channel defined by number, */ +/* selection of ADC group (ADC groups regular and-or injected). */ +/* - analog watchdog 2 and 3: monitored channel defined by bitfield, no */ +/* selection on groups. */ + +/* Internal register offset for ADC analog watchdog channel configuration */ +#define ADC_AWD_CR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_AWD_CR2_REGOFFSET ((uint32_t)0x00100000U) +#define ADC_AWD_CR3_REGOFFSET ((uint32_t)0x00200000U) + +/* Register offset gap between AWD1 and AWD2-AWD3 configuration registers */ +/* (Set separately as ADC_AWD_CRX_REGOFFSET to spare 32 bits space */ +#define ADC_AWD_CR12_REGOFFSETGAP_MASK (ADC_AWD2CR_AWD2CH_0) +#define ADC_AWD_CR12_REGOFFSETGAP_VAL ((uint32_t)0x00000024U) + +#define ADC_AWD_CRX_REGOFFSET_MASK (ADC_AWD_CR1_REGOFFSET | ADC_AWD_CR2_REGOFFSET | ADC_AWD_CR3_REGOFFSET) + +#define ADC_AWD_CR1_CHANNEL_MASK (ADC_CFGR_AWD1CH | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) +#define ADC_AWD_CR23_CHANNEL_MASK (ADC_AWD2CR_AWD2CH) +#define ADC_AWD_CR_ALL_CHANNEL_MASK (ADC_AWD_CR1_CHANNEL_MASK | ADC_AWD_CR23_CHANNEL_MASK) + +/* Internal register offset for ADC analog watchdog threshold configuration */ +#define ADC_AWD_TR1_REGOFFSET (ADC_AWD_CR1_REGOFFSET) +#define ADC_AWD_TR2_REGOFFSET (ADC_AWD_CR2_REGOFFSET) +#define ADC_AWD_TR3_REGOFFSET (ADC_AWD_CR3_REGOFFSET) +#define ADC_AWD_TRX_REGOFFSET_MASK (ADC_AWD_TR1_REGOFFSET | ADC_AWD_TR2_REGOFFSET | ADC_AWD_TR3_REGOFFSET) + + +/* Internal mask for ADC offset: */ +/* Internal register offset for ADC offset number configuration */ +#define ADC_OFR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_OFR2_REGOFFSET ((uint32_t)0x00000001U) +#define ADC_OFR3_REGOFFSET ((uint32_t)0x00000002U) +#define ADC_OFR4_REGOFFSET ((uint32_t)0x00000003U) +#define ADC_OFRx_REGOFFSET_MASK (ADC_OFR1_REGOFFSET | ADC_OFR2_REGOFFSET | ADC_OFR3_REGOFFSET | ADC_OFR4_REGOFFSET) + + +/* ADC registers bits positions */ +#define ADC_CFGR_RES_BITOFFSET_POS ((uint32_t) 3U) /* Value equivalent to POSITION_VAL(ADC_CFGR_RES) */ +#define ADC_CFGR_AWD1SGL_BITOFFSET_POS ((uint32_t)22U) /* Value equivalent to POSITION_VAL(ADC_CFGR_AWD1SGL) */ +#define ADC_CFGR_AWD1EN_BITOFFSET_POS ((uint32_t)23U) /* Value equivalent to POSITION_VAL(ADC_CFGR_AWD1EN) */ +#define ADC_CFGR_JAWD1EN_BITOFFSET_POS ((uint32_t)24U) /* Value equivalent to POSITION_VAL(ADC_CFGR_JAWD1EN) */ +#define ADC_TR1_HT1_BITOFFSET_POS ((uint32_t)16U) /* Value equivalent to POSITION_VAL(ADC_TR1_HT1) */ + + +/* ADC registers bits groups */ +#define ADC_CR_BITS_PROPERTY_RS (ADC_CR_ADCAL | ADC_CR_JADSTP | ADC_CR_ADSTP | ADC_CR_JADSTART | ADC_CR_ADSTART | ADC_CR_ADDIS | ADC_CR_ADEN) /* ADC register CR bits with HW property "rs": Software can read as well as set this bit. Writing '0' has no effect on the bit value. */ + + +/* ADC internal channels related definitions */ +/* Internal voltage reference VrefInt */ +#define VREFINT_CAL_ADDR ((uint16_t*) ((uint32_t)0x1FFFF7BAU)) /* Internal voltage reference, address of parameter VREFINT_CAL: VrefInt ADC raw data acquired at temperature 30 DegC (tolerance: +-5 DegC), Vref+ = 3.3 V (tolerance: +-10 mV). */ +#define VREFINT_CAL_VREF ((uint32_t) 3300U) /* Analog voltage reference (Vref+) value with which temperature sensor has been calibrated in production (tolerance: +-10 mV) (unit: mV). */ +/* Temperature sensor */ +#define TEMPSENSOR_CAL1_ADDR ((uint16_t*) ((uint32_t)0x1FFFF7B8U)) /* Internal temperature sensor, address of parameter TS_CAL1: On STM32F3, temperature sensor ADC raw data acquired at temperature 30 DegC (tolerance: +-5 DegC), Vref+ = 3.3 V (tolerance: +-10 mV). */ +#define TEMPSENSOR_CAL2_ADDR ((uint16_t*) ((uint32_t)0x1FFFF7C2U)) /* Internal temperature sensor, address of parameter TS_CAL2: On STM32F3, temperature sensor ADC raw data acquired at temperature 110 DegC (tolerance: +-5 DegC), Vref+ = 3.3 V (tolerance: +-10 mV). */ +#define TEMPSENSOR_CAL1_TEMP (( int32_t) 30) /* Internal temperature sensor, temperature at which temperature sensor has been calibrated in production for data into TEMPSENSOR_CAL1_ADDR (tolerance: +-5 DegC) (unit: DegC). */ +#define TEMPSENSOR_CAL2_TEMP (( int32_t) 110) /* Internal temperature sensor, temperature at which temperature sensor has been calibrated in production for data into TEMPSENSOR_CAL2_ADDR (tolerance: +-5 DegC) (unit: DegC). */ +#define TEMPSENSOR_CAL_VREFANALOG ((uint32_t) 3300U) /* Analog voltage reference (Vref+) voltage with which temperature sensor has been calibrated in production (+-10 mV) (unit: mV). */ + + +/** + * @} + */ + + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup ADC_LL_Private_Macros ADC Private Macros + * @{ + */ + +/** + * @brief Driver macro reserved for internal use: isolate bits with the + * selected mask and shift them to the register LSB + * (shift mask on register position bit 0). + * @param __BITS__ Bits in register 32 bits + * @param __MASK__ Mask in register 32 bits + * @retval Bits in register 32 bits + */ +#define __ADC_MASK_SHIFT(__BITS__, __MASK__) \ + (((__BITS__) & (__MASK__)) >> POSITION_VAL((__MASK__))) + +/** + * @brief Driver macro reserved for internal use: set a pointer to + * a register from a register basis from which an offset + * is applied. + * @param __REG__ Register basis from which the offset is applied. + * @param __REG_OFFFSET__ Offset to be applied (unit: number of registers). + * @retval Pointer to register address + */ +#define __ADC_PTR_REG_OFFSET(__REG__, __REG_OFFFSET__) \ + ((__IO uint32_t *)((uint32_t) ((uint32_t)(&(__REG__)) + ((__REG_OFFFSET__) << 2U)))) + +/** + * @} + */ + + +/* Exported types ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup ADC_LL_ES_INIT ADC Exported Init structure + * @{ + */ + +/** + * @brief Structure definition of some features of ADC common parameters + * and multimode + * (all ADC instances belonging to the same ADC common instance). + * @note The setting of these parameters by function @ref LL_ADC_CommonInit() + * is conditioned to ADC instances state (all ADC instances + * sharing the same ADC common instance): + * All ADC instances sharing the same ADC common instance must be + * disabled. + */ +typedef struct +{ + uint32_t CommonClock; /*!< Set parameter common to several ADC: Clock source and prescaler. + This parameter can be a value of @ref ADC_LL_EC_COMMON_CLOCK_SOURCE + @note On this STM32 series, if ADC group injected is used, some + clock ratio constraints between ADC clock and AHB clock + must be respected. Refer to reference manual. + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetCommonClock(). */ + +#if defined(ADC_MULTIMODE_SUPPORT) + uint32_t Multimode; /*!< Set ADC multimode configuration to operate in independent mode or multimode (for devices with several ADC instances). + This parameter can be a value of @ref ADC_LL_EC_MULTI_MODE + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetMultimode(). */ + + uint32_t MultiDMATransfer; /*!< Set ADC multimode conversion data transfer: no transfer or transfer by DMA. + This parameter can be a value of @ref ADC_LL_EC_MULTI_DMA_TRANSFER + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetMultiDMATransfer(). */ + + uint32_t MultiTwoSamplingDelay; /*!< Set ADC multimode delay between 2 sampling phases. + This parameter can be a value of @ref ADC_LL_EC_MULTI_TWOSMP_DELAY + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetMultiTwoSamplingDelay(). */ +#endif /* ADC_MULTIMODE_SUPPORT */ + +} LL_ADC_CommonInitTypeDef; + +/** + * @brief Structure definition of some features of ADC instance. + * @note These parameters have an impact on ADC scope: ADC instance. + * Affects both group regular and group injected (availability + * of ADC group injected depends on STM32 families). + * Refer to corresponding unitary functions into + * @ref ADC_LL_EF_Configuration_ADC_Instance . + * @note The setting of these parameters by function @ref LL_ADC_Init() + * is conditioned to ADC state: + * ADC instance must be disabled. + * This condition is applied to all ADC features, for efficiency + * and compatibility over all STM32 families. However, the different + * features can be set under different ADC state conditions + * (setting possible with ADC enabled without conversion on going, + * ADC enabled with conversion on going, ...) + * Each feature can be updated afterwards with a unitary function + * and potentially with ADC in a different state than disabled, + * refer to description of each function for setting + * conditioned to ADC state. + */ +typedef struct +{ + uint32_t Resolution; /*!< Set ADC resolution. + This parameter can be a value of @ref ADC_LL_EC_RESOLUTION + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetResolution(). */ + + uint32_t DataAlignment; /*!< Set ADC conversion data alignment. + This parameter can be a value of @ref ADC_LL_EC_DATA_ALIGN + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetDataAlignment(). */ + + uint32_t LowPowerMode; /*!< Set ADC low power mode. + This parameter can be a value of @ref ADC_LL_EC_LP_MODE + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetLowPowerMode(). */ + +} LL_ADC_InitTypeDef; + +/** + * @brief Structure definition of some features of ADC group regular. + * @note These parameters have an impact on ADC scope: ADC group regular. + * Refer to corresponding unitary functions into + * @ref ADC_LL_EF_Configuration_ADC_Group_Regular + * (functions with prefix "REG"). + * @note The setting of these parameters by function @ref LL_ADC_REG_Init() + * is conditioned to ADC state: + * ADC instance must be disabled. + * This condition is applied to all ADC features, for efficiency + * and compatibility over all STM32 families. However, the different + * features can be set under different ADC state conditions + * (setting possible with ADC enabled without conversion on going, + * ADC enabled with conversion on going, ...) + * Each feature can be updated afterwards with a unitary function + * and potentially with ADC in a different state than disabled, + * refer to description of each function for setting + * conditioned to ADC state. + */ +typedef struct +{ + uint32_t TriggerSource; /*!< Set ADC group regular conversion trigger source: internal (SW start) or from external IP (timer event, external interrupt line). + This parameter can be a value of @ref ADC_LL_EC_REG_TRIGGER_SOURCE + @note On this STM32 series, setting trigger source to external trigger also set trigger polarity to rising edge + (default setting for compatibility with some ADC on other STM32 families having this setting set by HW default value). + In case of need to modify trigger edge, use function @ref LL_ADC_REG_SetTriggerEdge(). + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetTriggerSource(). */ + + uint32_t SequencerLength; /*!< Set ADC group regular sequencer length. + This parameter can be a value of @ref ADC_LL_EC_REG_SEQ_SCAN_LENGTH + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetSequencerLength(). */ + + uint32_t SequencerDiscont; /*!< Set ADC group regular sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks. + This parameter can be a value of @ref ADC_LL_EC_REG_SEQ_DISCONT_MODE + @note This parameter has an effect only if group regular sequencer is enabled + (scan length of 2 ranks or more). + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetSequencerDiscont(). */ + + uint32_t ContinuousMode; /*!< Set ADC continuous conversion mode on ADC group regular, whether ADC conversions are performed in single mode (one conversion per trigger) or in continuous mode (after the first trigger, following conversions launched successively automatically). + This parameter can be a value of @ref ADC_LL_EC_REG_CONTINUOUS_MODE + Note: It is not possible to enable both ADC group regular continuous mode and discontinuous mode. + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetContinuousMode(). */ + + uint32_t DMATransfer; /*!< Set ADC group regular conversion data transfer: no transfer or transfer by DMA, and DMA requests mode. + This parameter can be a value of @ref ADC_LL_EC_REG_DMA_TRANSFER + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetDMATransfer(). */ + + uint32_t Overrun; /*!< Set ADC group regular behavior in case of overrun: + data preserved or overwritten. + This parameter can be a value of @ref ADC_LL_EC_REG_OVR_DATA_BEHAVIOR + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetOverrun(). */ + +} LL_ADC_REG_InitTypeDef; + +/** + * @brief Structure definition of some features of ADC group injected. + * @note These parameters have an impact on ADC scope: ADC group injected. + * Refer to corresponding unitary functions into + * @ref ADC_LL_EF_Configuration_ADC_Group_Regular + * (functions with prefix "INJ"). + * @note The setting of these parameters by function @ref LL_ADC_INJ_Init() + * is conditioned to ADC state: + * ADC instance must be disabled. + * This condition is applied to all ADC features, for efficiency + * and compatibility over all STM32 families. However, the different + * features can be set under different ADC state conditions + * (setting possible with ADC enabled without conversion on going, + * ADC enabled with conversion on going, ...) + * Each feature can be updated afterwards with a unitary function + * and potentially with ADC in a different state than disabled, + * refer to description of each function for setting + * conditioned to ADC state. + */ +typedef struct +{ + uint32_t TriggerSource; /*!< Set ADC group injected conversion trigger source: internal (SW start) or from external IP (timer event, external interrupt line). + This parameter can be a value of @ref ADC_LL_EC_INJ_TRIGGER_SOURCE + @note On this STM32 series, setting trigger source to external trigger also set trigger polarity to rising edge + (default setting for compatibility with some ADC on other STM32 families having this setting set by HW default value). + In case of need to modify trigger edge, use function @ref LL_ADC_INJ_SetTriggerEdge(). + + This feature can be modified afterwards using unitary function @ref LL_ADC_INJ_SetTriggerSource(). */ + + uint32_t SequencerLength; /*!< Set ADC group injected sequencer length. + This parameter can be a value of @ref ADC_LL_EC_INJ_SEQ_SCAN_LENGTH + + This feature can be modified afterwards using unitary function @ref LL_ADC_INJ_SetSequencerLength(). */ + + uint32_t SequencerDiscont; /*!< Set ADC group injected sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks. + This parameter can be a value of @ref ADC_LL_EC_INJ_SEQ_DISCONT_MODE + @note This parameter has an effect only if group injected sequencer is enabled + (scan length of 2 ranks or more). + + This feature can be modified afterwards using unitary function @ref LL_ADC_INJ_SetSequencerDiscont(). */ + + uint32_t TrigAuto; /*!< Set ADC group injected conversion trigger: independent or from ADC group regular. + This parameter can be a value of @ref ADC_LL_EC_INJ_TRIG_AUTO + Note: This parameter must be set to set to independent trigger if injected trigger source is set to an external trigger. + + This feature can be modified afterwards using unitary function @ref LL_ADC_INJ_SetTrigAuto(). */ + +} LL_ADC_INJ_InitTypeDef; + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup ADC_LL_Exported_Constants ADC Exported Constants + * @{ + */ + +/** @defgroup ADC_LL_EC_FLAG ADC flags + * @brief Flags defines which can be used with LL_ADC_ReadReg function + * @{ + */ +#define LL_ADC_FLAG_ADRDY ADC_ISR_ADRDY /*!< ADC flag ADC instance ready */ +#define LL_ADC_FLAG_EOC ADC_ISR_EOC /*!< ADC flag ADC group regular end of unitary conversion */ +#define LL_ADC_FLAG_EOS ADC_ISR_EOS /*!< ADC flag ADC group regular end of sequence conversions */ +#define LL_ADC_FLAG_OVR ADC_ISR_OVR /*!< ADC flag ADC group regular overrun */ +#define LL_ADC_FLAG_EOSMP ADC_ISR_EOSMP /*!< ADC flag ADC group regular end of sampling phase */ +#define LL_ADC_FLAG_JEOC ADC_ISR_JEOC /*!< ADC flag ADC group injected end of unitary conversion */ +#define LL_ADC_FLAG_JEOS ADC_ISR_JEOS /*!< ADC flag ADC group injected end of sequence conversions */ +#define LL_ADC_FLAG_JQOVF ADC_ISR_JQOVF /*!< ADC flag ADC group injected contexts queue overflow */ +#define LL_ADC_FLAG_AWD1 ADC_ISR_AWD1 /*!< ADC flag ADC analog watchdog 1 */ +#define LL_ADC_FLAG_AWD2 ADC_ISR_AWD2 /*!< ADC flag ADC analog watchdog 2 */ +#define LL_ADC_FLAG_AWD3 ADC_ISR_AWD3 /*!< ADC flag ADC analog watchdog 3 */ +#if defined(ADC_MULTIMODE_SUPPORT) +#define LL_ADC_FLAG_ADRDY_MST ADC_CSR_ADRDY_MST /*!< ADC flag ADC multimode master instance ready */ +#define LL_ADC_FLAG_ADRDY_SLV ADC_CSR_ADRDY_SLV /*!< ADC flag ADC multimode slave instance ready */ +#define LL_ADC_FLAG_EOC_MST ADC_CSR_EOC_MST /*!< ADC flag ADC multimode master group regular end of unitary conversion */ +#define LL_ADC_FLAG_EOC_SLV ADC_CSR_EOC_SLV /*!< ADC flag ADC multimode slave group regular end of unitary conversion */ +#define LL_ADC_FLAG_EOS_MST ADC_CSR_EOS_MST /*!< ADC flag ADC multimode master group regular end of sequence conversions */ +#define LL_ADC_FLAG_EOS_SLV ADC_CSR_EOS_SLV /*!< ADC flag ADC multimode slave group regular end of sequence conversions */ +#define LL_ADC_FLAG_OVR_MST ADC_CSR_OVR_MST /*!< ADC flag ADC multimode master group regular overrun */ +#define LL_ADC_FLAG_OVR_SLV ADC_CSR_OVR_SLV /*!< ADC flag ADC multimode slave group regular overrun */ +#define LL_ADC_FLAG_EOSMP_MST ADC_CSR_EOSMP_MST /*!< ADC flag ADC multimode master group regular end of sampling phase */ +#define LL_ADC_FLAG_EOSMP_SLV ADC_CSR_EOSMP_SLV /*!< ADC flag ADC multimode slave group regular end of sampling phase */ +#define LL_ADC_FLAG_JEOC_MST ADC_CSR_JEOC_MST /*!< ADC flag ADC multimode master group injected end of unitary conversion */ +#define LL_ADC_FLAG_JEOC_SLV ADC_CSR_JEOC_SLV /*!< ADC flag ADC multimode slave group injected end of unitary conversion */ +#define LL_ADC_FLAG_JEOS_MST ADC_CSR_JEOS_MST /*!< ADC flag ADC multimode master group injected end of sequence conversions */ +#define LL_ADC_FLAG_JEOS_SLV ADC_CSR_JEOS_SLV /*!< ADC flag ADC multimode slave group injected end of sequence conversions */ +#define LL_ADC_FLAG_JQOVF_MST ADC_CSR_JQOVF_MST /*!< ADC flag ADC multimode master group injected contexts queue overflow */ +#define LL_ADC_FLAG_JQOVF_SLV ADC_CSR_JQOVF_SLV /*!< ADC flag ADC multimode slave group injected contexts queue overflow */ +#define LL_ADC_FLAG_AWD1_MST ADC_CSR_AWD1_MST /*!< ADC flag ADC multimode master analog watchdog 1 of the ADC master */ +#define LL_ADC_FLAG_AWD1_SLV ADC_CSR_AWD1_SLV /*!< ADC flag ADC multimode slave analog watchdog 1 of the ADC slave */ +#define LL_ADC_FLAG_AWD2_MST ADC_CSR_AWD2_MST /*!< ADC flag ADC multimode master analog watchdog 2 of the ADC master */ +#define LL_ADC_FLAG_AWD2_SLV ADC_CSR_AWD2_SLV /*!< ADC flag ADC multimode slave analog watchdog 2 of the ADC slave */ +#define LL_ADC_FLAG_AWD3_MST ADC_CSR_AWD3_MST /*!< ADC flag ADC multimode master analog watchdog 3 of the ADC master */ +#define LL_ADC_FLAG_AWD3_SLV ADC_CSR_AWD3_SLV /*!< ADC flag ADC multimode slave analog watchdog 3 of the ADC slave */ +#endif +/** + * @} + */ + +/** @defgroup ADC_LL_EC_IT ADC interruptions for configuration (interruption enable or disable) + * @brief IT defines which can be used with LL_ADC_ReadReg and LL_ADC_WriteReg functions + * @{ + */ +#define LL_ADC_IT_ADRDY ADC_IER_ADRDYIE /*!< ADC interruption ADC instance ready */ +#define LL_ADC_IT_EOC ADC_IER_EOCIE /*!< ADC interruption ADC group regular end of unitary conversion */ +#define LL_ADC_IT_EOS ADC_IER_EOSIE /*!< ADC interruption ADC group regular end of sequence conversions */ +#define LL_ADC_IT_OVR ADC_IER_OVRIE /*!< ADC interruption ADC group regular overrun */ +#define LL_ADC_IT_EOSMP ADC_IER_EOSMPIE /*!< ADC interruption ADC group regular end of sampling phase */ +#define LL_ADC_IT_JEOC ADC_IER_JEOCIE /*!< ADC interruption ADC group injected end of unitary conversion */ +#define LL_ADC_IT_JEOS ADC_IER_JEOSIE /*!< ADC interruption ADC group injected end of sequence conversions */ +#define LL_ADC_IT_JQOVF ADC_IER_JQOVFIE /*!< ADC interruption ADC group injected contexts queue overflow */ +#define LL_ADC_IT_AWD1 ADC_IER_AWD1IE /*!< ADC interruption ADC analog watchdog 1 */ +#define LL_ADC_IT_AWD2 ADC_IER_AWD2IE /*!< ADC interruption ADC analog watchdog 2 */ +#define LL_ADC_IT_AWD3 ADC_IER_AWD3IE /*!< ADC interruption ADC analog watchdog 3 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REGISTERS ADC registers compliant with specific purpose + * @{ + */ +/* List of ADC registers intended to be used (most commonly) with */ +/* DMA transfer. */ +/* Refer to function @ref LL_ADC_DMA_GetRegAddr(). */ +#define LL_ADC_DMA_REG_REGULAR_DATA ((uint32_t)0x00000000U) /* ADC group regular conversion data register (corresponding to register DR) to be used with ADC configured in independent mode. Without DMA transfer, register accessed by LL function @ref LL_ADC_REG_ReadConversionData32() and other functions @ref LL_ADC_REG_ReadConversionDatax() */ +#if defined(ADC_MULTIMODE_SUPPORT) +#define LL_ADC_DMA_REG_REGULAR_DATA_MULTI ((uint32_t)0x00000001U) /* ADC group regular conversion data register (corresponding to register CDR) to be used with ADC configured in multimode (available on STM32 devices with several ADC instances). Without DMA transfer, register accessed by LL function @ref LL_ADC_REG_ReadMultiConversionData32() */ +#endif +/** + * @} + */ + +/** @defgroup ADC_LL_EC_COMMON_CLOCK_SOURCE ADC common - Clock source + * @{ + */ +#define LL_ADC_CLOCK_SYNC_PCLK_DIV1 (ADC_CCR_CKMODE_0) /*!< ADC synchronous clock derived from AHB clock without prescaler */ +#define LL_ADC_CLOCK_SYNC_PCLK_DIV2 (ADC_CCR_CKMODE_1 ) /*!< ADC synchronous clock derived from AHB clock with prescaler division by 2 */ +#define LL_ADC_CLOCK_SYNC_PCLK_DIV4 (ADC_CCR_CKMODE_1 | ADC_CCR_CKMODE_0) /*!< ADC synchronous clock derived from AHB clock with prescaler division by 4 */ +#define LL_ADC_CLOCK_ASYNC_DIV1 ((uint32_t)0x00000000U) /*!< ADC asynchronous clock without prescaler */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_COMMON_PATH_INTERNAL ADC common - Measurement path to internal channels + * @{ + */ +/* Note: Other measurement paths to internal channels may be available */ +/* (connections to other peripherals). */ +/* If they are not listed below, they do not require any specific */ +/* path enable. In this case, Access to measurement path is done */ +/* only by selecting the corresponding ADC internal channel. */ +#define LL_ADC_PATH_INTERNAL_NONE ((uint32_t)0x00000000U)/*!< ADC measurement paths all disabled */ +#define LL_ADC_PATH_INTERNAL_VREFINT (ADC_CCR_VREFEN) /*!< ADC measurement path to internal channel VrefInt */ +#define LL_ADC_PATH_INTERNAL_TEMPSENSOR (ADC_CCR_TSEN) /*!< ADC measurement path to internal channel temperature sensor */ +#define LL_ADC_PATH_INTERNAL_VBAT (ADC_CCR_VBATEN) /*!< ADC measurement path to internal channel Vbat */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_RESOLUTION ADC instance - Resolution + * @{ + */ +#define LL_ADC_RESOLUTION_12B ((uint32_t)0x00000000U) /*!< ADC resolution 12 bits */ +#define LL_ADC_RESOLUTION_10B ( ADC_CFGR_RES_0) /*!< ADC resolution 10 bits */ +#define LL_ADC_RESOLUTION_8B (ADC_CFGR_RES_1 ) /*!< ADC resolution 8 bits */ +#define LL_ADC_RESOLUTION_6B (ADC_CFGR_RES_1 | ADC_CFGR_RES_0) /*!< ADC resolution 6 bits */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_DATA_ALIGN ADC instance - Data alignment + * @{ + */ +#define LL_ADC_DATA_ALIGN_RIGHT ((uint32_t)0x00000000U)/*!< ADC conversion data alignment: right aligned (alignment on data register LSB bit 0)*/ +#define LL_ADC_DATA_ALIGN_LEFT (ADC_CFGR_ALIGN) /*!< ADC conversion data alignment: left aligned (alignment on data register MSB bit 15)*/ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_LP_MODE ADC instance - Low power mode + * @{ + */ +#define LL_ADC_LP_MODE_NONE ((uint32_t)0x00000000U) /*!< No ADC low power mode activated */ +#define LL_ADC_LP_AUTOWAIT (ADC_CFGR_AUTDLY) /*!< ADC low power mode auto delay: Dynamic low power mode, ADC conversions are performed only when necessary (when previous ADC conversion data is read). See description with function @ref LL_ADC_SetLowPowerMode(). */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_OFFSET_NB ADC instance - Offset number + * @{ + */ +#define LL_ADC_OFFSET_1 ADC_OFR1_REGOFFSET /*!< ADC offset number 1: ADC channel and offset level to which the offset programmed will be applied (independently of channel mapped on ADC group regular or group injected) */ +#define LL_ADC_OFFSET_2 ADC_OFR2_REGOFFSET /*!< ADC offset number 2: ADC channel and offset level to which the offset programmed will be applied (independently of channel mapped on ADC group regular or group injected) */ +#define LL_ADC_OFFSET_3 ADC_OFR3_REGOFFSET /*!< ADC offset number 3: ADC channel and offset level to which the offset programmed will be applied (independently of channel mapped on ADC group regular or group injected) */ +#define LL_ADC_OFFSET_4 ADC_OFR4_REGOFFSET /*!< ADC offset number 4: ADC channel and offset level to which the offset programmed will be applied (independently of channel mapped on ADC group regular or group injected) */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_OFFSET_STATE ADC instance - Offset state + * @{ + */ +#define LL_ADC_OFFSET_DISABLE ((uint32_t)0x00000000U)/*!< ADC offset disabled (among ADC selected offset number 1, 2, 3 or 4) */ +#define LL_ADC_OFFSET_ENABLE (ADC_OFR1_OFFSET1_EN) /*!< ADC offset enabled (among ADC selected offset number 1, 2, 3 or 4) */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_GROUPS ADC instance - Groups + * @{ + */ +#define LL_ADC_GROUP_REGULAR ((uint32_t)0x00000001U) /*!< ADC group regular (available on all STM32 devices) */ +#define LL_ADC_GROUP_INJECTED ((uint32_t)0x00000002U) /*!< ADC group injected (not available on all STM32 devices)*/ +#define LL_ADC_GROUP_REGULAR_INJECTED ((uint32_t)0x00000003U) /*!< ADC both groups regular and injected */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_CHANNEL ADC instance - Channel number + * @{ + */ +#define LL_ADC_CHANNEL_0 (ADC_CHANNEL_0_NUMBER | ADC_CHANNEL_0_SMP | ADC_CHANNEL_0_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN0 */ +#define LL_ADC_CHANNEL_1 (ADC_CHANNEL_1_NUMBER | ADC_CHANNEL_1_SMP | ADC_CHANNEL_1_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN1 */ +#define LL_ADC_CHANNEL_2 (ADC_CHANNEL_2_NUMBER | ADC_CHANNEL_2_SMP | ADC_CHANNEL_2_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN2 */ +#define LL_ADC_CHANNEL_3 (ADC_CHANNEL_3_NUMBER | ADC_CHANNEL_3_SMP | ADC_CHANNEL_3_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN3 */ +#define LL_ADC_CHANNEL_4 (ADC_CHANNEL_4_NUMBER | ADC_CHANNEL_4_SMP | ADC_CHANNEL_4_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN4 */ +#define LL_ADC_CHANNEL_5 (ADC_CHANNEL_5_NUMBER | ADC_CHANNEL_5_SMP | ADC_CHANNEL_5_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN5 */ +#define LL_ADC_CHANNEL_6 (ADC_CHANNEL_6_NUMBER | ADC_CHANNEL_6_SMP | ADC_CHANNEL_6_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN6 */ +#define LL_ADC_CHANNEL_7 (ADC_CHANNEL_7_NUMBER | ADC_CHANNEL_7_SMP | ADC_CHANNEL_7_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN7 */ +#define LL_ADC_CHANNEL_8 (ADC_CHANNEL_8_NUMBER | ADC_CHANNEL_8_SMP | ADC_CHANNEL_8_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN8 */ +#define LL_ADC_CHANNEL_9 (ADC_CHANNEL_9_NUMBER | ADC_CHANNEL_9_SMP | ADC_CHANNEL_9_BITFIELD ) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN9 */ +#define LL_ADC_CHANNEL_10 (ADC_CHANNEL_10_NUMBER | ADC_CHANNEL_10_SMP | ADC_CHANNEL_10_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN10 */ +#define LL_ADC_CHANNEL_11 (ADC_CHANNEL_11_NUMBER | ADC_CHANNEL_11_SMP | ADC_CHANNEL_11_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN11 */ +#define LL_ADC_CHANNEL_12 (ADC_CHANNEL_12_NUMBER | ADC_CHANNEL_12_SMP | ADC_CHANNEL_12_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN12 */ +#define LL_ADC_CHANNEL_13 (ADC_CHANNEL_13_NUMBER | ADC_CHANNEL_13_SMP | ADC_CHANNEL_13_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN13 */ +#define LL_ADC_CHANNEL_14 (ADC_CHANNEL_14_NUMBER | ADC_CHANNEL_14_SMP | ADC_CHANNEL_14_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN14 */ +#define LL_ADC_CHANNEL_15 (ADC_CHANNEL_15_NUMBER | ADC_CHANNEL_15_SMP | ADC_CHANNEL_15_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN15 */ +#define LL_ADC_CHANNEL_16 (ADC_CHANNEL_16_NUMBER | ADC_CHANNEL_16_SMP | ADC_CHANNEL_16_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN16 */ +#define LL_ADC_CHANNEL_17 (ADC_CHANNEL_17_NUMBER | ADC_CHANNEL_17_SMP | ADC_CHANNEL_17_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN17 */ +#define LL_ADC_CHANNEL_18 (ADC_CHANNEL_18_NUMBER | ADC_CHANNEL_18_SMP | ADC_CHANNEL_18_BITFIELD) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN18 */ +#define LL_ADC_CHANNEL_VREFINT (LL_ADC_CHANNEL_18 | ADC_CHANNEL_ID_INTERNAL_CH) /*!< ADC internal channel connected to VrefInt: Internal voltage reference. On STM32F3, ADC channel available only on all ADC instances, but only one ADC instance is allowed to be connected to VrefInt at the same time. */ +#define LL_ADC_CHANNEL_TEMPSENSOR (LL_ADC_CHANNEL_16 | ADC_CHANNEL_ID_INTERNAL_CH) /*!< ADC internal channel connected to Temperature sensor. On STM32F3, ADC channel available only on ADC instance: ADC1. */ +#define LL_ADC_CHANNEL_VBAT (LL_ADC_CHANNEL_17 | ADC_CHANNEL_ID_INTERNAL_CH) /*!< ADC internal channel connected to Vbat/3: Vbat voltage through a divider ladder of factor 1/3 to have Vbat always below Vdda. On STM32F3, ADC channel available only on ADC instance: ADC1. */ +#if defined(OPAMP1_CSR_OPAMP1EN) +#define LL_ADC_CHANNEL_VOPAMP1 (LL_ADC_CHANNEL_15 | ADC_CHANNEL_ID_INTERNAL_CH) /*!< ADC internal channel connected to OPAMP1 output. On STM32F3, ADC channel available only on ADC instance: ADC1. */ +#endif +#if defined(OPAMP2_CSR_OPAMP2EN) +#define LL_ADC_CHANNEL_VOPAMP2 (LL_ADC_CHANNEL_17 | ADC_CHANNEL_ID_INTERNAL_CH | ADC_CHANNEL_ID_INTERNAL_CH_2) /*!< ADC internal channel connected to OPAMP2 output. On STM32F3, ADC channel available only on ADC instance: ADC2. */ +#endif +#if defined(OPAMP3_CSR_OPAMP3EN) +#define LL_ADC_CHANNEL_VOPAMP3 (LL_ADC_CHANNEL_17 | ADC_CHANNEL_ID_INTERNAL_CH | ADC_CHANNEL_ID_INTERNAL_CH_2) /*!< ADC internal channel connected to OPAMP3 output. On STM32F3, ADC channel available only on ADC instance: ADC3. */ +#endif +#if defined(OPAMP4_CSR_OPAMP4EN) +#define LL_ADC_CHANNEL_VOPAMP4 (LL_ADC_CHANNEL_17 | ADC_CHANNEL_ID_INTERNAL_CH | ADC_CHANNEL_ID_INTERNAL_CH_2) /*!< ADC internal channel connected to OPAMP4 output. On STM32F3, ADC channel available only on ADC instance: ADC4. */ +#endif +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_TRIGGER_SOURCE ADC group regular - Trigger source + * @{ + */ +#define LL_ADC_REG_TRIG_SOFTWARE ((uint32_t)0x00000000U) /*!< ADC group regular conversion trigger internal: SW start. */ +#if defined(STM32F303xC) || defined(STM32F358xx) || defined(STM32F303xE) || defined(STM32F398xx) +/* ADC group regular external triggers for ADC instances: ADC1, ADC2 (for */ +/* ADC instances ADCx available on the selected device) */ +/* Note: Literal without suffix "ADCxy" means that external trigger */ +/* is available on all ADC instances. */ +/* Note: For devices STM32F303xE, STM32F398xx: some triggers require to set */ +/* register SYSCFG_CFGR4. Refer to reference manual. */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH1_ADC12 (ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH2_ADC12 (ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH3 (ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_CH2_ADC12 (ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_TRGO_ADC12 (ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_CH4_ADC12 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM4 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_EXTI_LINE11_ADC12 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: external interrupt line 11. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM8_TRGO_ADC12 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM8 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM8_TRGO2 (ADC_CFGR_EXTSEL_3 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM8 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO2 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_TRGO_ADC12 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM4 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM6_TRGO_ADC12 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM6 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM15_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM15 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_CH4_ADC12 (ADC_CFGR_EXTSEL | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#if defined(STM32F303xE) || defined(STM32F398xx) +#define LL_ADC_REG_TRIG_EXT_TIM20_TRG0_ADC12 (LL_ADC_REG_TRIG_EXT_TIM1_CH3) /*!< ADC group regular conversion trigger from external IP: TIM20 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM20_TRG02_ADC12 (LL_ADC_REG_TRIG_EXT_TIM2_CH2_ADC12) /*!< ADC group regular conversion trigger from external IP: TIM20 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM20_CH1_ADC12 (LL_ADC_REG_TRIG_EXT_TIM4_CH4_ADC12) /*!< ADC group regular conversion trigger from external IP: TIM20 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM20_CH2_ADC12 (LL_ADC_REG_TRIG_EXT_TIM6_TRGO_ADC12) /*!< ADC group regular conversion trigger from external IP: TIM20 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM20_CH3_ADC12 (LL_ADC_REG_TRIG_EXT_TIM3_CH4_ADC12) /*!< ADC group regular conversion trigger from external IP: TIM20 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#endif /* STM32F303xE || STM32F398xx */ + +/* ADC group regular external triggers for ADC instances: ADC3, ADC4 (for */ +/* ADC instances ADCx available on the selected device) */ +/* Note: Literal without suffix "ADCxy" means that external trigger */ +/* is available on all ADC instances. */ +/* Note: For devices STM32F303xE, STM32F398xx: some triggers require to set */ +/* register SYSCFG_CFGR4. Refer to reference manual. */ +#define LL_ADC_REG_TRIG_EXT_TIM3_CH1_ADC34 (ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_CH3_ADC34 (ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH3 (ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM8_CH1_ADC34 (ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM8 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM8_TRGO__ADC34 (ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM8 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_EXTI_LINE2_ADC34 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: external interrupt line 2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_CH1_ADC34 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM4 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_TRGO__ADC34 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM8_TRGO2 (ADC_CFGR_EXTSEL_3 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM8 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO2 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_TRGO__ADC34 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM4 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM7_TRGO_ADC34 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM7 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM15_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM15 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_CH1_ADC34 (ADC_CFGR_EXTSEL | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 CCx. Trigger edge set to rising edge (default setting). */ +#if defined(STM32F303xE) || defined(STM32F398xx) +#define LL_ADC_REG_TRIG_EXT_TIM20_TRG0_ADC34 (LL_ADC_REG_TRIG_EXT_EXTI_LINE2_ADC34) /*!< ADC group regular conversion trigger from external IP: TIM20 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM20_TRG02_ADC34 (LL_ADC_REG_TRIG_EXT_TIM4_CH1_ADC34) /*!< ADC group regular conversion trigger from external IP: TIM20 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM20_CH1_ADC34 (LL_ADC_REG_TRIG_EXT_TIM2_CH1_ADC34) /*!< ADC group regular conversion trigger from external IP: TIM20 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#endif /* STM32F303xE || STM32F398xx */ + +#elif defined(STM32F303x8) || defined(STM32F328xx) +#define LL_ADC_REG_TRIG_EXT_TIM1_CH1 (ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH2 (ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH3 (ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_CH2 (ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_TRGO (ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_CH4 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM4 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_EXTI_LINE11 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: external interrupt line 11. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM8_TRGO (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM8 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO2 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM4 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM6_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM6 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM15_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM15 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_CH4 (ADC_CFGR_EXTSEL | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ + +#elif defined(STM32F334x8) +#define LL_ADC_REG_TRIG_EXT_TIM1_CH1 (ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH2 (ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH3 (ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_CH2 (ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_TRGO (ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_EXTI_LINE11 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: external interrupt line 11. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_HRTIM_TRG1 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: HRTIM TRG1. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_HRTIM_TRG3 (ADC_CFGR_EXTSEL_3 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: HRTIM TRG3. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO2 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM6_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM6 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM15_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM15 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_CH4 (ADC_CFGR_EXTSEL | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ + +#elif defined(STM32F302xC) || defined(STM32F302xE) +#define LL_ADC_REG_TRIG_EXT_TIM1_CH1 (ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH2 (ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH3 (ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_CH2 (ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_TRGO (ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_CH4 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM4 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_EXTI_LINE11 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: external interrupt line 11. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO2 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM4 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM6_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM6 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM15_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM15 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_CH4 (ADC_CFGR_EXTSEL | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM3 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ + +#elif defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define LL_ADC_REG_TRIG_EXT_TIM1_CH1 (ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH2 (ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_CH3 (ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_CH2 (ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_EXTI_LINE11 (ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: external interrupt line 11. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM1_TRGO2 (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM1 TRGO2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM2_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_1 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM2 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM6_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_0 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM6 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM15_TRGO (ADC_CFGR_EXTSEL_3 | ADC_CFGR_EXTSEL_2 | ADC_CFGR_EXTSEL_1 | ADC_REG_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group regular conversion trigger from external IP: TIM15 TRGO. Trigger edge set to rising edge (default setting). */ +#endif +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_TRIGGER_EDGE ADC group regular - Trigger edge + * @{ + */ +#define LL_ADC_REG_TRIG_EXT_RISING ( ADC_CFGR_EXTEN_0) /*!< ADC group regular conversion trigger polarity set to rising edge */ +#define LL_ADC_REG_TRIG_EXT_FALLING (ADC_CFGR_EXTEN_1 ) /*!< ADC group regular conversion trigger polarity set to falling edge */ +#define LL_ADC_REG_TRIG_EXT_RISINGFALLING (ADC_CFGR_EXTEN_1 | ADC_CFGR_EXTEN_0) /*!< ADC group regular conversion trigger polarity set to both rising and falling edges */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_CONTINUOUS_MODE ADC group regular - Continuous mode +* @{ +*/ +#define LL_ADC_REG_CONV_SINGLE ((uint32_t)0x00000000U) /*!< ADC conversions are performed in single mode: one conversion per trigger */ +#define LL_ADC_REG_CONV_CONTINUOUS (ADC_CFGR_CONT) /*!< ADC conversions are performed in continuous mode: after the first trigger, following conversions launched successively automatically */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_DMA_TRANSFER ADC group regular - DMA transfer of ADC conversion data + * @{ + */ +#define LL_ADC_REG_DMA_TRANSFER_NONE ((uint32_t)0x00000000U) /*!< ADC conversions are not transferred by DMA */ +#define LL_ADC_REG_DMA_TRANSFER_LIMITED ( ADC_CFGR_DMAEN) /*!< ADC conversion data are transferred by DMA, in limited mode (one shot mode): DMA transfer requests are stopped when number of DMA data transfers (number of ADC conversions) is reached. This ADC mode is intended to be used with DMA mode non-circular. */ +#define LL_ADC_REG_DMA_TRANSFER_UNLIMITED (ADC_CFGR_DMACFG | ADC_CFGR_DMAEN) /*!< ADC conversion data are transferred by DMA, in unlimited mode: DMA transfer requests are unlimited, whatever number of DMA data transferred (number of ADC conversions). This ADC mode is intended to be used with DMA mode circular. */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_OVR_DATA_BEHAVIOR ADC group regular - Overrun behavior on conversion data +* @{ +*/ +#define LL_ADC_REG_OVR_DATA_PRESERVED ((uint32_t)0x00000000U)/*!< ADC group regular behavior in case of overrun: data preserved */ +#define LL_ADC_REG_OVR_DATA_OVERWRITTEN (ADC_CFGR_OVRMOD) /*!< ADC group regular behavior in case of overrun: data overwritten */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_SEQ_SCAN_LENGTH ADC group regular - Sequencer scan length + * @{ + */ +#define LL_ADC_REG_SEQ_SCAN_DISABLE ((uint32_t)0x00000000U) /*!< ADC group regular sequencer disable (equivalent to sequencer of 1 rank: ADC conversion on only 1 channel) */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_2RANKS ( ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 2 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_3RANKS ( ADC_SQR1_L_1 ) /*!< ADC group regular sequencer enable with 3 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_4RANKS ( ADC_SQR1_L_1 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 4 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_5RANKS ( ADC_SQR1_L_2 ) /*!< ADC group regular sequencer enable with 5 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_6RANKS ( ADC_SQR1_L_2 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 6 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_7RANKS ( ADC_SQR1_L_2 | ADC_SQR1_L_1 ) /*!< ADC group regular sequencer enable with 7 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_8RANKS ( ADC_SQR1_L_2 | ADC_SQR1_L_1 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 8 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_9RANKS (ADC_SQR1_L_3 ) /*!< ADC group regular sequencer enable with 9 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_10RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 10 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_11RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_1 ) /*!< ADC group regular sequencer enable with 11 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_12RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_1 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 12 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_13RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_2 ) /*!< ADC group regular sequencer enable with 13 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_14RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_2 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 14 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_15RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_2 | ADC_SQR1_L_1 ) /*!< ADC group regular sequencer enable with 15 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_16RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_2 | ADC_SQR1_L_1 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 16 ranks in the sequence */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_SEQ_DISCONT_MODE ADC group regular - Sequencer discontinuous mode + * @{ + */ +#define LL_ADC_REG_SEQ_DISCONT_DISABLE ((uint32_t)0x00000000U) /*!< ADC group regular sequencer discontinuous mode disable */ +#define LL_ADC_REG_SEQ_DISCONT_1RANK ( ADC_CFGR_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every rank */ +#define LL_ADC_REG_SEQ_DISCONT_2RANKS ( ADC_CFGR_DISCNUM_0 | ADC_CFGR_DISCEN) /*!< ADC group regular sequencer discontinuous mode enabled with sequence interruption every 2 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_3RANKS ( ADC_CFGR_DISCNUM_1 | ADC_CFGR_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 3 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_4RANKS ( ADC_CFGR_DISCNUM_1 | ADC_CFGR_DISCNUM_0 | ADC_CFGR_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 4 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_5RANKS (ADC_CFGR_DISCNUM_2 | ADC_CFGR_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 5 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_6RANKS (ADC_CFGR_DISCNUM_2 | ADC_CFGR_DISCNUM_0 | ADC_CFGR_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 6 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_7RANKS (ADC_CFGR_DISCNUM_2 | ADC_CFGR_DISCNUM_1 | ADC_CFGR_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 7 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_8RANKS (ADC_CFGR_DISCNUM_2 | ADC_CFGR_DISCNUM_1 | ADC_CFGR_DISCNUM_0 | ADC_CFGR_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 8 ranks */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_SEQ_RANKS ADC group regular - Sequencer ranks + * @{ + */ +#define LL_ADC_REG_RANK_1 (ADC_SQR1_REGOFFSET | ADC_REG_RANK_1_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 1 */ +#define LL_ADC_REG_RANK_2 (ADC_SQR1_REGOFFSET | ADC_REG_RANK_2_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 2 */ +#define LL_ADC_REG_RANK_3 (ADC_SQR1_REGOFFSET | ADC_REG_RANK_3_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 3 */ +#define LL_ADC_REG_RANK_4 (ADC_SQR1_REGOFFSET | ADC_REG_RANK_4_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 4 */ +#define LL_ADC_REG_RANK_5 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_5_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 5 */ +#define LL_ADC_REG_RANK_6 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_6_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 6 */ +#define LL_ADC_REG_RANK_7 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_7_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 7 */ +#define LL_ADC_REG_RANK_8 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_8_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 8 */ +#define LL_ADC_REG_RANK_9 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_9_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 9 */ +#define LL_ADC_REG_RANK_10 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_10_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 10 */ +#define LL_ADC_REG_RANK_11 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_11_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 11 */ +#define LL_ADC_REG_RANK_12 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_12_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 12 */ +#define LL_ADC_REG_RANK_13 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_13_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 13 */ +#define LL_ADC_REG_RANK_14 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_14_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 14 */ +#define LL_ADC_REG_RANK_15 (ADC_SQR4_REGOFFSET | ADC_REG_RANK_15_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 15 */ +#define LL_ADC_REG_RANK_16 (ADC_SQR4_REGOFFSET | ADC_REG_RANK_16_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 16 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_TRIGGER_SOURCE ADC group injected - Trigger source + * @{ + */ +#define LL_ADC_INJ_TRIG_SOFTWARE ((uint32_t)0x00000000U) /*!< ADC group injected conversion trigger internal: SW start.. Trigger edge set to rising edge (default setting). */ +#if defined(STM32F303xC) || defined(STM32F358xx) || defined(STM32F303xE) || defined(STM32F398xx) +/* ADC group injected external triggers for ADC instances: ADC1, ADC2 (for */ +/* ADC instances ADCx available on the selected device) */ +/* Note: Literal without suffix "ADCxy" means that external trigger */ +/* is available on all ADC instances. */ +/* Note: For devices STM32F303xE, STM32F398xx: some triggers require to set */ +/* register SYSCFG_CFGR4. Refer to reference manual. */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO (ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_CH4 (ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_TRGO_ADC12 (ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_CH1_ADC12 (ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH4_ADC12 (ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM4_TRGO_ADC12 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM4 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_EXTI_LINE15_ADC12 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: external interrupt line 15. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_CH4_ADC12 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH3_ADC12 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH1_ADC12 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM6_TRGO_ADC12 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM6 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM15_TRGO (ADC_JSQR_JEXTSEL | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM15 TRG0. Trigger edge set to rising edge (default setting). */ +#if defined(STM32F303xE) || defined(STM32F398xx) +#define LL_ADC_INJ_TRIG_EXT_TIM20_TRGO_ADC12 (LL_ADC_INJ_TRIG_EXT_TIM2_CH1_ADC12) /*!< ADC group injected conversion trigger from external IP: TIM20 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM20_TRGO2_ADC12 (LL_ADC_INJ_TRIG_EXT_EXTI_LINE15_ADC12) /*!< ADC group injected conversion trigger from external IP: TIM20 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM20_CH4_ADC12 (LL_ADC_INJ_TRIG_EXT_TIM2_CH1_ADC12) /*!< ADC group injected conversion trigger from external IP: TIM20 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#endif /* STM32F303xE || STM32F398xx */ + +/* ADC group injected external triggers for ADC instances: ADC3, ADC4 (for */ +/* ADC instances ADCx available on the selected device) */ +/* Note: Literal without suffix "ADCxy" means that external trigger */ +/* is available on all ADC instances. */ +/* Note: External triggers JEXT2 and JEXT5 are the same (TIM4_CH3 event). */ +/* JEXT2 is the main trigger, JEXT5 is kept as spare trigger for */ +/* future devices. */ +/* Note: For devices STM32F303xE, STM32F398xx: some triggers require to set */ +/* register SYSCFG_CFGR4. Refer to reference manual. */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO (ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_CH4 (ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM4_CH3_ADC34 (ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM4 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_CH2_ADC34 (ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_CH4__ADC34 (ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM4_CH4_ADC34 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM4 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM4_TRGO__ADC34 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM4 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_CH3_ADC34 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_TRGO__ADC34 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM7_TRGO_ADC34 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM7 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM15_TRGO (ADC_JSQR_JEXTSEL | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM15 TRG0. Trigger edge set to rising edge (default setting). */ +#if defined(STM32F303xE) || defined(STM32F398xx) +#define LL_ADC_INJ_TRIG_EXT_TIM20_TRG_ADC34 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM20 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM20_TRG2_ADC34 (LL_ADC_INJ_TRIG_EXT_TIM1_CH3_ADC34) /*!< ADC group injected conversion trigger from external IP: TIM20 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM20_CH2 (LL_ADC_INJ_TRIG_EXT_TIM15_TRGO) /*!< ADC group injected conversion trigger from external IP: TIM20 channel 2 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#endif /* STM32F303xE || STM32F398xx */ + +#elif defined(STM32F303x8) || defined(STM32F328xx) +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO (ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_CH4 (ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_TRGO (ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_CH1 (ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH4 (ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM4_TRGO (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM4 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: external interrupt line 15. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_CH4 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM8_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM8 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH3 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH1 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM6_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM6 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM15_TRGO (ADC_JSQR_JEXTSEL | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM15 TRG0. Trigger edge set to rising edge (default setting). */ + +#elif defined(STM32F334x8) +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO (ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_CH4 (ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_TRGO (ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_CH1 (ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH4 (ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: external interrupt line 15. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_HRTIM_TRG2 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: HRTIM TRG2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_HRTIM_TRG4 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: HRTIM TRG4. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH3 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH1 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM6_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM6 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM15_TRGO (ADC_JSQR_JEXTSEL | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM15 TRG0. Trigger edge set to rising edge (default setting). */ + +#elif defined(STM32F302xC) || defined(STM32F302xE) +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO (ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_CH4 (ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_TRGO (ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_CH1 (ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM2 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH4 (ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM4_TRGO (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM4 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: external interrupt line 15. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH3 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_1 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 3 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH1 (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM3 channel 1 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM6_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM6 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM15_TRGO (ADC_JSQR_JEXTSEL | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM15 TRG0. Trigger edge set to rising edge (default setting). */ + +#elif defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO (ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_CH4 (ADC_JSQR_JEXTSEL_0 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 channel 4 event (capture compare: input capture or output capture). Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 (ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: external interrupt line 15. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 (ADC_JSQR_JEXTSEL_3 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM1 TRG02. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM6_TRGO (ADC_JSQR_JEXTSEL_3 | ADC_JSQR_JEXTSEL_2 | ADC_JSQR_JEXTSEL_1 | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM6 TRG0. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM15_TRGO (ADC_JSQR_JEXTSEL | ADC_INJ_TRIG_EXT_EDGE_DEFAULT) /*!< ADC group injected conversion trigger from external IP: TIM15 TRG0. Trigger edge set to rising edge (default setting). */ +#endif +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_TRIGGER_EDGE ADC group injected - Trigger edge + * @{ + */ +#define LL_ADC_INJ_TRIG_EXT_RISING ( ADC_JSQR_JEXTEN_0) /*!< ADC group injected conversion trigger polarity set to rising edge */ +#define LL_ADC_INJ_TRIG_EXT_FALLING (ADC_JSQR_JEXTEN_1 ) /*!< ADC group injected conversion trigger polarity set to falling edge */ +#define LL_ADC_INJ_TRIG_EXT_RISINGFALLING (ADC_JSQR_JEXTEN_1 | ADC_JSQR_JEXTEN_0) /*!< ADC group injected conversion trigger polarity set to both rising and falling edges */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_TRIG_AUTO ADC group injected - Automatic trigger mode +* @{ +*/ +#define LL_ADC_INJ_TRIG_INDEPENDENT ((uint32_t)0x00000000U)/*!< ADC group injected conversion trigger independent. Setting mandatory if ADC group injected injected trigger source is set to an external trigger. */ +#define LL_ADC_INJ_TRIG_FROM_GRP_REGULAR (ADC_CFGR_JAUTO) /*!< ADC group injected conversion trigger from ADC group regular. Setting compliant only with group injected trigger source set to SW start, without any further action on ADC group injected conversion start or stop: in this case, ADC group injected is controlled only from ADC group regular. */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_CONTEXT_QUEUE ADC group injected - Context queue mode + * @{ + */ +#define LL_ADC_INJ_QUEUE_2CONTEXTS_LAST_ACTIVE ((uint32_t)0x00000000U)/* Group injected sequence context queue is enabled and can contain up to 2 contexts. When all contexts have been processed, the queue maintains the last context active perpetually. */ +#define LL_ADC_INJ_QUEUE_2CONTEXTS_END_EMPTY (ADC_CFGR_JQM) /* Group injected sequence context queue is enabled and can contain up to 2 contexts. When all contexts have been processed, the queue is empty and injected group triggers are disabled. */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_SEQ_SCAN_LENGTH ADC group injected - Sequencer scan length + * @{ + */ +#define LL_ADC_INJ_SEQ_SCAN_DISABLE ((uint32_t)0x00000000U) /*!< ADC group injected sequencer disable (equivalent to sequencer of 1 rank: ADC conversion on only 1 channel) */ +#define LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS ( ADC_JSQR_JL_0) /*!< ADC group injected sequencer enable with 2 ranks in the sequence */ +#define LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS (ADC_JSQR_JL_1 ) /*!< ADC group injected sequencer enable with 3 ranks in the sequence */ +#define LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS (ADC_JSQR_JL_1 | ADC_JSQR_JL_0) /*!< ADC group injected sequencer enable with 4 ranks in the sequence */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_SEQ_DISCONT_MODE ADC group injected - Sequencer discontinuous mode + * @{ + */ +#define LL_ADC_INJ_SEQ_DISCONT_DISABLE ((uint32_t)0x00000000U)/*!< ADC group injected sequencer discontinuous mode disable */ +#define LL_ADC_INJ_SEQ_DISCONT_1RANK (ADC_CFGR_JDISCEN) /*!< ADC group injected sequencer discontinuous mode enable with sequence interruption every rank */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_SEQ_RANKS ADC group injected - Sequencer ranks + * @{ + */ +#define LL_ADC_INJ_RANK_1 (ADC_JDR1_REGOFFSET | ADC_INJ_RANK_1_JSQR_BITOFFSET_POS) /*!< ADC group injected sequencer rank 1 */ +#define LL_ADC_INJ_RANK_2 (ADC_JDR2_REGOFFSET | ADC_INJ_RANK_2_JSQR_BITOFFSET_POS) /*!< ADC group injected sequencer rank 2 */ +#define LL_ADC_INJ_RANK_3 (ADC_JDR3_REGOFFSET | ADC_INJ_RANK_3_JSQR_BITOFFSET_POS) /*!< ADC group injected sequencer rank 3 */ +#define LL_ADC_INJ_RANK_4 (ADC_JDR4_REGOFFSET | ADC_INJ_RANK_4_JSQR_BITOFFSET_POS) /*!< ADC group injected sequencer rank 4 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_CHANNEL_SAMPLINGTIME Channel - Sampling time + * @{ + */ +#define LL_ADC_SAMPLINGTIME_1CYCLE_5 (0x00000000U) /*!< Sampling time 1.5 ADC clock cycle */ +#define LL_ADC_SAMPLINGTIME_2CYCLES_5 ( ADC_SMPR2_SMP10_0) /*!< Sampling time 2.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_4CYCLES_5 ( ADC_SMPR2_SMP10_1 ) /*!< Sampling time 4.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_7CYCLES_5 ( ADC_SMPR2_SMP10_1 | ADC_SMPR2_SMP10_0) /*!< Sampling time 7.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_19CYCLES_5 (ADC_SMPR2_SMP10_2 ) /*!< Sampling time 19.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_61CYCLES_5 (ADC_SMPR2_SMP10_2 | ADC_SMPR2_SMP10_0) /*!< Sampling time 61.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_181CYCLES_5 (ADC_SMPR2_SMP10_2 | ADC_SMPR2_SMP10_1 ) /*!< Sampling time 181.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_601CYCLES_5 (ADC_SMPR2_SMP10_2 | ADC_SMPR2_SMP10_1 | ADC_SMPR2_SMP10_0) /*!< Sampling time 601.5 ADC clock cycles */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_CHANNEL_SINGLE_DIFF_ENDING Channel - Single or differential ending + * @{ + */ +#define LL_ADC_SINGLE_ENDED ( ADC_CALFACT_CALFACT_S) /*!< ADC channel ending set to single ended (literal also used to set calibration mode) */ +#define LL_ADC_DIFFERENTIAL_ENDED (ADC_CR_ADCALDIF | ADC_CALFACT_CALFACT_D) /*!< ADC channel ending set to differential (literal also used to set calibration mode) */ +#define LL_ADC_BOTH_SINGLE_DIFF_ENDED (LL_ADC_SINGLE_ENDED | LL_ADC_DIFFERENTIAL_ENDED) /*!< ADC channel ending set to both single ended and differential (literal used only to set calibration factors) */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_AWD_NUMBER Analog watchdog - Analog watchdog number + * @{ + */ +#define LL_ADC_AWD1 (ADC_AWD_CR1_CHANNEL_MASK | ADC_AWD_CR1_REGOFFSET) /*!< ADC analog watchdog number 1 */ +#define LL_ADC_AWD2 (ADC_AWD_CR23_CHANNEL_MASK | ADC_AWD_CR2_REGOFFSET) /*!< ADC analog watchdog number 2 */ +#define LL_ADC_AWD3 (ADC_AWD_CR23_CHANNEL_MASK | ADC_AWD_CR3_REGOFFSET) /*!< ADC analog watchdog number 3 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_AWD_CHANNELS Analog watchdog - Monitored channels + * @{ + */ +#define LL_ADC_AWD_DISABLE ((uint32_t)0x00000000U) /*!< ADC analog watchdog monitoring disabled */ +#define LL_ADC_AWD_ALL_CHANNELS_REG (ADC_AWD_CR23_CHANNEL_MASK | ADC_CFGR_AWD1EN ) /*!< ADC analog watchdog monitoring of all channels, converted by group regular only */ +#define LL_ADC_AWD_ALL_CHANNELS_INJ (ADC_AWD_CR23_CHANNEL_MASK | ADC_CFGR_JAWD1EN ) /*!< ADC analog watchdog monitoring of all channels, converted by group injected only */ +#define LL_ADC_AWD_ALL_CHANNELS_REG_INJ (ADC_AWD_CR23_CHANNEL_MASK | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN ) /*!< ADC analog watchdog monitoring of all channels, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_0_REG ((LL_ADC_CHANNEL_0 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN0, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_0_INJ ((LL_ADC_CHANNEL_0 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN0, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_0_REG_INJ ((LL_ADC_CHANNEL_0 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN0, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_1_REG ((LL_ADC_CHANNEL_1 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN1, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_1_INJ ((LL_ADC_CHANNEL_1 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN1, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_1_REG_INJ ((LL_ADC_CHANNEL_1 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN1, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_2_REG ((LL_ADC_CHANNEL_2 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN2, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_2_INJ ((LL_ADC_CHANNEL_2 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN2, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_2_REG_INJ ((LL_ADC_CHANNEL_2 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN2, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_3_REG ((LL_ADC_CHANNEL_3 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN3, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_3_INJ ((LL_ADC_CHANNEL_3 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN3, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_3_REG_INJ ((LL_ADC_CHANNEL_3 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN3, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_4_REG ((LL_ADC_CHANNEL_4 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN4, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_4_INJ ((LL_ADC_CHANNEL_4 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN4, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_4_REG_INJ ((LL_ADC_CHANNEL_4 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN4, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_5_REG ((LL_ADC_CHANNEL_5 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN5, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_5_INJ ((LL_ADC_CHANNEL_5 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN5, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_5_REG_INJ ((LL_ADC_CHANNEL_5 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN5, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_6_REG ((LL_ADC_CHANNEL_6 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN6, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_6_INJ ((LL_ADC_CHANNEL_6 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN6, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_6_REG_INJ ((LL_ADC_CHANNEL_6 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN6, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_7_REG ((LL_ADC_CHANNEL_7 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN7, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_7_INJ ((LL_ADC_CHANNEL_7 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN7, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_7_REG_INJ ((LL_ADC_CHANNEL_7 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN7, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_8_REG ((LL_ADC_CHANNEL_8 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN8, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_8_INJ ((LL_ADC_CHANNEL_8 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN8, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_8_REG_INJ ((LL_ADC_CHANNEL_8 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN8, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_9_REG ((LL_ADC_CHANNEL_9 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN9, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_9_INJ ((LL_ADC_CHANNEL_9 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN9, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_9_REG_INJ ((LL_ADC_CHANNEL_9 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN9, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_10_REG ((LL_ADC_CHANNEL_10 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN10, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_10_INJ ((LL_ADC_CHANNEL_10 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN10, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_10_REG_INJ ((LL_ADC_CHANNEL_10 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN10, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_11_REG ((LL_ADC_CHANNEL_11 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN11, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_11_INJ ((LL_ADC_CHANNEL_11 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN11, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_11_REG_INJ ((LL_ADC_CHANNEL_11 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN11, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_12_REG ((LL_ADC_CHANNEL_12 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN12, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_12_INJ ((LL_ADC_CHANNEL_12 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN12, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_12_REG_INJ ((LL_ADC_CHANNEL_12 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN12, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_13_REG ((LL_ADC_CHANNEL_13 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN13, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_13_INJ ((LL_ADC_CHANNEL_13 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN13, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_13_REG_INJ ((LL_ADC_CHANNEL_13 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN13, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_14_REG ((LL_ADC_CHANNEL_14 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN14, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_14_INJ ((LL_ADC_CHANNEL_14 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN14, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_14_REG_INJ ((LL_ADC_CHANNEL_14 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN14, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_15_REG ((LL_ADC_CHANNEL_15 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN15, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_15_INJ ((LL_ADC_CHANNEL_15 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN15, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_15_REG_INJ ((LL_ADC_CHANNEL_15 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN15, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_16_REG ((LL_ADC_CHANNEL_16 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN16, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_16_INJ ((LL_ADC_CHANNEL_16 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN16, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_16_REG_INJ ((LL_ADC_CHANNEL_16 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN16, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_17_REG ((LL_ADC_CHANNEL_17 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN17, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_17_INJ ((LL_ADC_CHANNEL_17 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN17, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_17_REG_INJ ((LL_ADC_CHANNEL_17 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN17, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_18_REG ((LL_ADC_CHANNEL_18 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN18, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_18_INJ ((LL_ADC_CHANNEL_18 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN18, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_18_REG_INJ ((LL_ADC_CHANNEL_18 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN18, converted by either group regular or injected */ +#define LL_ADC_AWD_CH_VREFINT_REG ((LL_ADC_CHANNEL_VREFINT & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to VrefInt: Internal voltage reference, converted by group regular only */ +#define LL_ADC_AWD_CH_VREFINT_INJ ((LL_ADC_CHANNEL_VREFINT & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to VrefInt: Internal voltage reference, converted by group injected only */ +#define LL_ADC_AWD_CH_VREFINT_REG_INJ ((LL_ADC_CHANNEL_VREFINT & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to VrefInt: Internal voltage reference, converted by either group regular or injected */ +#define LL_ADC_AWD_CH_TEMPSENSOR_REG ((LL_ADC_CHANNEL_TEMPSENSOR & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Temperature sensor, converted by group regular only */ +#define LL_ADC_AWD_CH_TEMPSENSOR_INJ ((LL_ADC_CHANNEL_TEMPSENSOR & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Temperature sensor, converted by group injected only */ +#define LL_ADC_AWD_CH_TEMPSENSOR_REG_INJ ((LL_ADC_CHANNEL_TEMPSENSOR & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Temperature sensor, converted by either group regular or injected */ +#define LL_ADC_AWD_CH_VBAT_REG ((LL_ADC_CHANNEL_VBAT & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Vbat/3: Vbat voltage through a divider ladder of factor 1/3 to have Vbat always below Vdda, converted by group regular only */ +#define LL_ADC_AWD_CH_VBAT_INJ ((LL_ADC_CHANNEL_VBAT & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Vbat/3: Vbat voltage through a divider ladder of factor 1/3 to have Vbat always below Vdda, converted by group injected only */ +#define LL_ADC_AWD_CH_VBAT_REG_INJ ((LL_ADC_CHANNEL_VBAT & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Vbat/3: Vbat voltage through a divider ladder of factor 1/3 to have Vbat always below Vdda */ +#if defined(OPAMP1_CSR_OPAMP1EN) +#define LL_ADC_AWD_CH_VOPAMP1_REG ((LL_ADC_CHANNEL_VOPAMP1 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC2, converted by group regular only */ +#define LL_ADC_AWD_CH_VOPAMP1_INJ ((LL_ADC_CHANNEL_VOPAMP1 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC2, converted by group injected only */ +#define LL_ADC_AWD_CH_VOPAMP1_REG_INJ ((LL_ADC_CHANNEL_VOPAMP1 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC2, converted by either group regular or injected */ +#endif +#if defined(OPAMP2_CSR_OPAMP2EN) +#define LL_ADC_AWD_CH_VOPAMP2_REG ((LL_ADC_CHANNEL_VOPAMP2 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC2, converted by group regular only */ +#define LL_ADC_AWD_CH_VOPAMP2_INJ ((LL_ADC_CHANNEL_VOPAMP2 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC2, converted by group injected only */ +#define LL_ADC_AWD_CH_VOPAMP2_REG_INJ ((LL_ADC_CHANNEL_VOPAMP2 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC2, converted by either group regular or injected */ +#endif +#if defined(OPAMP3_CSR_OPAMP3EN) +#define LL_ADC_AWD_CH_VOPAMP3_REG ((LL_ADC_CHANNEL_VOPAMP3 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC3, converted by group regular only */ +#define LL_ADC_AWD_CH_VOPAMP3_INJ ((LL_ADC_CHANNEL_VOPAMP3 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC3, converted by group injected only */ +#define LL_ADC_AWD_CH_VOPAMP3_REG_INJ ((LL_ADC_CHANNEL_VOPAMP3 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC3, converted by either group regular or injected */ +#endif +#if defined(OPAMP4_CSR_OPAMP4EN) +#define LL_ADC_AWD_CH_VOPAMP4_REG ((LL_ADC_CHANNEL_VOPAMP4 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC3, converted by group regular only */ +#define LL_ADC_AWD_CH_VOPAMP4_INJ ((LL_ADC_CHANNEL_VOPAMP4 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC3, converted by group injected only */ +#define LL_ADC_AWD_CH_VOPAMP4_REG_INJ ((LL_ADC_CHANNEL_VOPAMP4 & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to DAC1 channel 1, channel specific to ADC3, converted by either group regular or injected */ +#endif +/** + * @} + */ + +/** @defgroup ADC_LL_EC_AWD_THRESHOLDS Analog watchdog - Thresholds + * @{ + */ +#define LL_ADC_AWD_THRESHOLD_HIGH (ADC_TR1_HT1 ) /*!< ADC analog watchdog threshold high */ +#define LL_ADC_AWD_THRESHOLD_LOW ( ADC_TR1_LT1) /*!< ADC analog watchdog threshold low */ +#define LL_ADC_AWD_THRESHOLDS_HIGH_LOW (ADC_TR1_HT1 | ADC_TR1_LT1) /*!< ADC analog watchdog both thresholds high and low concatenated into the same data */ +/** + * @} + */ + +#if defined(ADC_MULTIMODE_SUPPORT) +/** @defgroup ADC_LL_EC_MULTI_MODE Multimode - Mode + * @{ + */ +#define LL_ADC_MULTI_INDEPENDENT ((uint32_t)0x00000000U) /*!< ADC dual mode disabled (ADC independent mode) */ +#define LL_ADC_MULTI_DUAL_REG_SIMULT ( ADC_CCR_DUAL_2 | ADC_CCR_DUAL_1 ) /*!< ADC dual mode enabled: group regular simultaneous */ +#define LL_ADC_MULTI_DUAL_REG_INTERL ( ADC_CCR_DUAL_2 | ADC_CCR_DUAL_1 | ADC_CCR_DUAL_0) /*!< ADC dual mode enabled: Combined group regular interleaved */ +#define LL_ADC_MULTI_DUAL_INJ_SIMULT ( ADC_CCR_DUAL_2 | ADC_CCR_DUAL_0) /*!< ADC dual mode enabled: group injected simultaneous */ +#define LL_ADC_MULTI_DUAL_INJ_ALTERN (ADC_CCR_DUAL_3 | ADC_CCR_DUAL_0) /*!< ADC dual mode enabled: group injected alternate trigger. Works only with external triggers (not internal SW start) */ +#define LL_ADC_MULTI_DUAL_REG_SIM_INJ_SIM ( ADC_CCR_DUAL_0) /*!< ADC dual mode enabled: Combined group regular simultaneous + group injected simultaneous */ +#define LL_ADC_MULTI_DUAL_REG_SIM_INJ_ALT ( ADC_CCR_DUAL_1 ) /*!< ADC dual mode enabled: Combined group regular simultaneous + group injected alternate trigger */ +#define LL_ADC_MULTI_DUAL_REG_INT_INJ_SIM ( ADC_CCR_DUAL_1 | ADC_CCR_DUAL_0) /*!< ADC dual mode enabled: Combined group regular interleaved + group injected simultaneous */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_MULTI_DMA_TRANSFER Multimode - DMA transfer + * @{ + */ +#define LL_ADC_MULTI_REG_DMA_EACH_ADC ((uint32_t)0x00000000U) /*!< ADC multimode group regular conversions are transferred by DMA: each ADC uses its own DMA channel, with its individual DMA transfer settings */ +#define LL_ADC_MULTI_REG_DMA_LIMIT_RES12_10B ( ADC_CCR_MDMA_1 ) /*!< ADC multimode group regular conversions are transferred by DMA, one DMA channel for both ADC (DMA of ADC master), in limited mode (one shot mode): DMA transfer requests are stopped when number of DMA data transfers (number of ADC conversions) is reached. This ADC mode is intended to be used with DMA mode non-circular. Setting for ADC resolution of 12 and 10 bits */ +#define LL_ADC_MULTI_REG_DMA_LIMIT_RES8_6B ( ADC_CCR_MDMA_1 | ADC_CCR_MDMA_0) /*!< ADC multimode group regular conversions are transferred by DMA, one DMA channel for both ADC (DMA of ADC master), in limited mode (one shot mode): DMA transfer requests are stopped when number of DMA data transfers (number of ADC conversions) is reached. This ADC mode is intended to be used with DMA mode non-circular. Setting for ADC resolution of 8 and 6 bits */ +#define LL_ADC_MULTI_REG_DMA_UNLMT_RES12_10B (ADC_CCR_DMACFG | ADC_CCR_MDMA_1 ) /*!< ADC multimode group regular conversions are transferred by DMA, one DMA channel for both ADC (DMA of ADC master), in unlimited mode: DMA transfer requests are unlimited, whatever number of DMA data transferred (number of ADC conversions). This ADC mode is intended to be used with DMA mode circular. Setting for ADC resolution of 12 and 10 bits */ +#define LL_ADC_MULTI_REG_DMA_UNLMT_RES8_6B (ADC_CCR_DMACFG | ADC_CCR_MDMA_1 | ADC_CCR_MDMA_0) /*!< ADC multimode group regular conversions are transferred by DMA, one DMA channel for both ADC (DMA of ADC master), in unlimited mode: DMA transfer requests are unlimited, whatever number of DMA data transferred (number of ADC conversions). This ADC mode is intended to be used with DMA mode circular. Setting for ADC resolution of 8 and 6 bits */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_MULTI_TWOSMP_DELAY Multimode - Delay between two sampling phases + * @{ + */ +#define LL_ADC_MULTI_TWOSMP_DELAY_1CYCLE ((uint32_t)0x00000000U) /*!< ADC multimode delay between two sampling phases: 1 ADC clock cycle */ +#define LL_ADC_MULTI_TWOSMP_DELAY_2CYCLES ( ADC_CCR_DELAY_0) /*!< ADC multimode delay between two sampling phases: 2 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_3CYCLES ( ADC_CCR_DELAY_1 ) /*!< ADC multimode delay between two sampling phases: 3 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_4CYCLES ( ADC_CCR_DELAY_1 | ADC_CCR_DELAY_0) /*!< ADC multimode delay between two sampling phases: 4 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_5CYCLES ( ADC_CCR_DELAY_2 ) /*!< ADC multimode delay between two sampling phases: 5 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_6CYCLES ( ADC_CCR_DELAY_2 | ADC_CCR_DELAY_0) /*!< ADC multimode delay between two sampling phases: 6 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_7CYCLES ( ADC_CCR_DELAY_2 | ADC_CCR_DELAY_1 ) /*!< ADC multimode delay between two sampling phases: 7 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_8CYCLES ( ADC_CCR_DELAY_2 | ADC_CCR_DELAY_1 | ADC_CCR_DELAY_0) /*!< ADC multimode delay between two sampling phases: 8 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_9CYCLES (ADC_CCR_DELAY_3 ) /*!< ADC multimode delay between two sampling phases: 9 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_10CYCLES (ADC_CCR_DELAY_3 | ADC_CCR_DELAY_0) /*!< ADC multimode delay between two sampling phases: 10 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_11CYCLES (ADC_CCR_DELAY_3 | ADC_CCR_DELAY_1 ) /*!< ADC multimode delay between two sampling phases: 11 ADC clock cycles */ +#define LL_ADC_MULTI_TWOSMP_DELAY_12CYCLES (ADC_CCR_DELAY_3 | ADC_CCR_DELAY_1 | ADC_CCR_DELAY_0) /*!< ADC multimode delay between two sampling phases: 12 ADC clock cycles */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_MULTI_MASTER_SLAVE Multimode - ADC master or slave + * @{ + */ +#define LL_ADC_MULTI_MASTER ( ADC_CDR_RDATA_MST) /*!< In multimode, selection among several ADC instances: ADC master */ +#define LL_ADC_MULTI_SLAVE (ADC_CDR_RDATA_SLV ) /*!< In multimode, selection among several ADC instances: ADC slave */ +#define LL_ADC_MULTI_MASTER_SLAVE (ADC_CDR_RDATA_SLV | ADC_CDR_RDATA_MST) /*!< In multimode, selection among several ADC instances: both ADC master and ADC slave */ +/** + * @} + */ + +#endif /* ADC_MULTIMODE_SUPPORT */ + + +/** @defgroup ADC_LL_EC_HW_DELAYS Definitions of ADC hardware constraints delays + * @note Only ADC IP HW delays are defined in ADC LL driver driver, + * not timeout values. + * For details on delays values, refer to descriptions in source code + * above each literal definition. + * @{ + */ + +/* Note: Only ADC IP HW delays are defined in ADC LL driver driver, */ +/* not timeout values. */ +/* Timeout values for ADC operations are dependent to device clock */ +/* configuration (system clock versus ADC clock), */ +/* and therefore must be defined in user application. */ +/* Indications for estimation of ADC timeout delays, for this */ +/* STM32 series: */ +/* - ADC calibration time: maximum delay is 112/fADC. */ +/* (refer to device datasheet, parameter "tCAL") */ +/* - ADC enable time: maximum delay is 1 conversion cycle. */ +/* (refer to device datasheet, parameter "tSTAB") */ +/* - ADC disable time: maximum delay should be a few ADC clock cycles */ +/* - ADC stop conversion time: maximum delay should be a few ADC clock */ +/* cycles */ +/* - ADC conversion time: duration depending on ADC clock and ADC */ +/* configuration. */ +/* (refer to device reference manual, section "Timing") */ + +/* Delay for ADC stabilization time (ADC voltage regulator start-up time) */ +/* Delay set to maximum value (refer to device datasheet, */ +/* parameter "tADCVREG_STUP"). */ +/* Unit: us */ +#define LL_ADC_DELAY_INTERNAL_REGUL_STAB_US ((uint32_t) 10U) /*!< Delay for ADC stabilization time (ADC voltage regulator start-up time) */ + +/* Delay for internal voltage reference stabilization time. */ +/* Delay set to maximum value (refer to device datasheet, */ +/* parameter "tstart_vrefint"). */ +/* Unit: us */ +#define LL_ADC_DELAY_VREFINT_STAB_US ((uint32_t) 12U) /*!< Delay for internal voltage reference stabilization time */ + +/* Delay for temperature sensor stabilization time. */ +/* Literal set to maximum value (refer to device datasheet, */ +/* parameter "tSTART"). */ +/* Unit: us */ +#define LL_ADC_DELAY_TEMPSENSOR_STAB_US ((uint32_t) 120U) /*!< Delay for temperature sensor stabilization time */ + +/* Delay required between ADC end of calibration and ADC enable. */ +/* Note: On this STM32 series, a minimum number of ADC clock cycles */ +/* are required between ADC end of calibration and ADC enable. */ +/* Wait time can be computed in user application by waiting for the */ +/* equivalent number of CPU cycles, by taking into account */ +/* ratio of CPU clock versus ADC clock prescalers. */ +/* Unit: ADC clock cycles. */ +#define LL_ADC_DELAY_CALIB_ENABLE_ADC_CYCLES ((uint32_t) 4U) /*!< Delay required between ADC end of calibration and ADC enable */ + +/** + * @} + */ + +/** + * @} + */ + + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup ADC_LL_Exported_Macros ADC Exported Macros + * @{ + */ + +/** @defgroup ADC_LL_EM_WRITE_READ Common write and read registers Macros + * @{ + */ + +/** + * @brief Write a value in ADC register + * @param __INSTANCE__ ADC Instance + * @param __REG__ Register to be written + * @param __VALUE__ Value to be written in the register + * @retval None + */ +#define LL_ADC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) + +/** + * @brief Read a value in ADC register + * @param __INSTANCE__ ADC Instance + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_ADC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) +/** + * @} + */ + +/** @defgroup ADC_LL_EM_HELPER_MACRO ADC helper macro + * @{ + */ + +/** + * @brief Helper macro to get ADC channel number in decimal format + * from literals LL_ADC_CHANNEL_x. + * @note Example: + * __LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_CHANNEL_4) + * will return decimal number "4". + * @note The input can be a value from functions where a channel + * number is returned, either defined with number + * or with bitfield (only one bit must be set). + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval Value between Min_Data=0 and Max_Data=18 + */ +#define __LL_ADC_CHANNEL_TO_DECIMAL_NB(__CHANNEL__) \ + ((((__CHANNEL__) & ADC_CHANNEL_ID_BITFIELD_MASK) == 0U) \ + ? ( \ + ((__CHANNEL__) & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS \ + ) \ + : \ + ( \ + POSITION_VAL((__CHANNEL__)) \ + ) \ + ) + +/** + * @brief Helper macro to get ADC channel in literal format LL_ADC_CHANNEL_x + * from number in decimal format. + * @note Example: + * __LL_ADC_DECIMAL_NB_TO_CHANNEL(4) + * will return a data equivalent to "LL_ADC_CHANNEL_4". + * @param __DECIMAL_NB__ Value between Min_Data=0 and Max_Data=18 + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time.\n + * (1, 2, 3, 4, 5) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + */ +#define __LL_ADC_DECIMAL_NB_TO_CHANNEL(__DECIMAL_NB__) \ + (((__DECIMAL_NB__) <= 9U) \ + ? ( \ + ((__DECIMAL_NB__) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) | \ + (ADC_AWD2CR_AWD2CH_0 << (__DECIMAL_NB__)) | \ + (ADC_SMPR1_REGOFFSET | (((uint32_t) (3U * (__DECIMAL_NB__))) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) \ + ) \ + : \ + ( \ + ((__DECIMAL_NB__) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) | \ + (ADC_AWD2CR_AWD2CH_0 << (__DECIMAL_NB__)) | \ + (ADC_SMPR2_REGOFFSET | (((uint32_t) (3U * ((__DECIMAL_NB__) - 10U))) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) \ + ) \ + ) + +/** + * @brief Helper macro to determine whether the selected channel + * corresponds to literal definitions of driver. + * @note The different literal definitions of ADC channels are: + * - ADC internal channel: + * LL_ADC_CHANNEL_VREFINT, LL_ADC_CHANNEL_TEMPSENSOR, ... + * - ADC external channel (channel connected to a GPIO pin): + * LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ... + * @note The channel parameter must be a value defined from literal + * definition of a ADC internal channel (LL_ADC_CHANNEL_VREFINT, + * LL_ADC_CHANNEL_TEMPSENSOR, ...), + * ADC external channel (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...), + * must not be a value from functions where a channel number is + * returned from ADC registers, + * because internal and external channels share the same channel + * number in ADC registers. The differentiation is made only with + * parameters definitions of driver. + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval Value "0" if the channel corresponds to a parameter definition of a ADC external channel (channel connected to a GPIO pin). + * Value "1" if the channel corresponds to a parameter definition of a ADC internal channel. + */ +#define __LL_ADC_IS_CHANNEL_INTERNAL(__CHANNEL__) \ + (((__CHANNEL__) & ADC_CHANNEL_ID_INTERNAL_CH_MASK) != 0U) + +/** + * @brief Helper macro to convert a channel defined from parameter + * definition of a ADC internal channel (LL_ADC_CHANNEL_VREFINT, + * LL_ADC_CHANNEL_TEMPSENSOR, ...), + * to its equivalent parameter definition of a ADC external channel + * (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...). + * @note The channel parameter can be, additionally to a value + * defined from parameter definition of a ADC internal channel + * (LL_ADC_CHANNEL_VREFINT, LL_ADC_CHANNEL_TEMPSENSOR, ...), + * a value defined from parameter definition of + * ADC external channel (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...) + * or a value from functions where a channel number is returned + * from ADC registers. + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + */ +#define __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(__CHANNEL__) \ + ((__CHANNEL__) & ~ADC_CHANNEL_ID_INTERNAL_CH_MASK) + +/** + * @brief Helper macro to determine whether the internal channel + * selected is available on the ADC instance selected. + * @note The channel parameter must be a value defined from parameter + * definition of a ADC internal channel (LL_ADC_CHANNEL_VREFINT, + * LL_ADC_CHANNEL_TEMPSENSOR, ...), + * must not be a value defined from parameter definition of + * ADC external channel (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...) + * or a value from functions where a channel number is + * returned from ADC registers, + * because internal and external channels share the same channel + * number in ADC registers. The differentiation is made only with + * parameters definitions of driver. + * @param __ADC_INSTANCE__ ADC instance + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval Value "0" if the internal channel selected is not available on the ADC instance selected. + * Value "1" if the internal channel selected is available on the ADC instance selected. + */ +#if defined (ADC1) && defined (ADC2) && defined (ADC3) && defined (ADC4) +#define __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) \ + (((__ADC_INSTANCE__) == ADC1) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_TEMPSENSOR) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VBAT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP1) \ + ) \ + : \ + ((__ADC_INSTANCE__) == ADC2) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP2) \ + ) \ + : \ + ((__ADC_INSTANCE__) == ADC3) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP3) \ + ) \ + : \ + ((__ADC_INSTANCE__) == ADC4) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP4) \ + ) \ + : \ + (0U) \ + ) +#elif defined (ADC1) && defined (ADC2) +#if defined(OPAMP1_CSR_OPAMP1EN) && defined(OPAMP2_CSR_OPAMP2EN) +#define __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) \ + (((__ADC_INSTANCE__) == ADC1) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_TEMPSENSOR) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VBAT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP1) \ + ) \ + : \ + ((__ADC_INSTANCE__) == ADC2) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP2) \ + ) \ + : \ + (0U) \ + ) +#elif defined(OPAMP2_CSR_OPAMP2EN) +#define __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) \ + (((__ADC_INSTANCE__) == ADC1) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_TEMPSENSOR) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VBAT) \ + ) \ + : \ + ((__ADC_INSTANCE__) == ADC2) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP2) \ + ) \ + : \ + (0U) \ + ) +#else +#define __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) \ + (((__ADC_INSTANCE__) == ADC1) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_TEMPSENSOR) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VBAT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP1) \ + ) \ + : \ + ((__ADC_INSTANCE__) == ADC2) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) \ + ) \ + : \ + (0U) \ + ) +#endif +#elif defined (ADC1) +#if defined(OPAMP1_CSR_OPAMP1EN) +#define __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) \ + ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_TEMPSENSOR) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VBAT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VOPAMP1) \ + ) +#else +#define __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) \ + ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_TEMPSENSOR) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VBAT) \ + ) +#endif +#endif + +/** + * @brief Helper macro to define ADC analog watchdog parameter: + * define a single channel to monitor with analog watchdog + * from sequencer channel and groups definition. + * @note To be used with function @ref LL_ADC_SetAnalogWDMonitChannels(). + * Example: + * LL_ADC_SetAnalogWDMonitChannels( + * ADC1, LL_ADC_AWD1, + * __LL_ADC_ANALOGWD_CHANNEL_GROUP(LL_ADC_CHANNEL4, LL_ADC_GROUP_REGULAR)) + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time.\n + * (1, 2, 3, 4, 5) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + * @param __GROUP__ This parameter can be one of the following values: + * @arg @ref LL_ADC_GROUP_REGULAR + * @arg @ref LL_ADC_GROUP_INJECTED + * @arg @ref LL_ADC_GROUP_REGULAR_INJECTED + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_AWD_DISABLE + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG (0) + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_INJ (0) + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_0_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_1_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_2_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_3_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_4_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_5_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_6_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_7_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_8_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_9_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_10_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_11_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_12_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_13_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_14_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_15_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_16_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_17_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_18_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_18_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_18_REG_INJ + * @arg @ref LL_ADC_AWD_CH_VREFINT_REG (0)(5) + * @arg @ref LL_ADC_AWD_CH_VREFINT_INJ (0)(5) + * @arg @ref LL_ADC_AWD_CH_VREFINT_REG_INJ (5) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_REG (0)(1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_INJ (0)(1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_REG_INJ (1) + * @arg @ref LL_ADC_AWD_CH_VBAT_REG (0)(1) + * @arg @ref LL_ADC_AWD_CH_VBAT_INJ (0)(1) + * @arg @ref LL_ADC_AWD_CH_VBAT_REG_INJ (1) + * @arg @ref LL_ADC_AWD_CH_VOPAMP1_REG (0)(1) + * @arg @ref LL_ADC_AWD_CH_VOPAMP1_INJ (0)(1) + * @arg @ref LL_ADC_AWD_CH_VOPAMP1_REG_INJ (1) + * @arg @ref LL_ADC_AWD_CH_VOPAMP2_REG (0)(2) + * @arg @ref LL_ADC_AWD_CH_VOPAMP2_INJ (0)(2) + * @arg @ref LL_ADC_AWD_CH_VOPAMP2_REG_INJ (2) + * @arg @ref LL_ADC_AWD_CH_VOPAMP3_REG (0)(3) + * @arg @ref LL_ADC_AWD_CH_VOPAMP3_INJ (0)(3) + * @arg @ref LL_ADC_AWD_CH_VOPAMP3_REG_INJ (3) + * @arg @ref LL_ADC_AWD_CH_VOPAMP4_REG (0)(4) + * @arg @ref LL_ADC_AWD_CH_VOPAMP4_INJ (0)(4) + * @arg @ref LL_ADC_AWD_CH_VOPAMP4_REG_INJ (4) + * + * (0) On STM32F3, parameter available only on analog watchdog number: AWD1.\n + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + */ +#define __LL_ADC_ANALOGWD_CHANNEL_GROUP(__CHANNEL__, __GROUP__) \ + (((__GROUP__) == LL_ADC_GROUP_REGULAR) \ + ? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) \ + : \ + ((__GROUP__) == LL_ADC_GROUP_INJECTED) \ + ? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1SGL) \ + : \ + (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL) \ + ) + +/** + * @brief Helper macro to set the value of ADC analog watchdog threshold high + * or low in function of ADC resolution, when ADC resolution is + * different of 12 bits. + * @note To be used with function @ref LL_ADC_ConfigAnalogWDThresholds() + * or @ref LL_ADC_SetAnalogWDThresholds(). + * Example, with a ADC resolution of 8 bits, to set the value of + * analog watchdog threshold high (on 8 bits): + * LL_ADC_SetAnalogWDThresholds + * (< ADCx param >, + * __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION(LL_ADC_RESOLUTION_8B, ) + * ); + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @param __AWD_THRESHOLD__ Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +#define __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION(__ADC_RESOLUTION__, __AWD_THRESHOLD__) \ + ((__AWD_THRESHOLD__) << ((__ADC_RESOLUTION__) >> (ADC_CFGR_RES_BITOFFSET_POS - 1U ))) + +/** + * @brief Helper macro to get the value of ADC analog watchdog threshold high + * or low in function of ADC resolution, when ADC resolution is + * different of 12 bits. + * @note To be used with function @ref LL_ADC_GetAnalogWDThresholds(). + * Example, with a ADC resolution of 8 bits, to get the value of + * analog watchdog threshold high (on 8 bits): + * < threshold_value_6_bits > = __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION + * (LL_ADC_RESOLUTION_8B, + * LL_ADC_GetAnalogWDThresholds(, LL_ADC_AWD_THRESHOLD_HIGH) + * ); + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @param __AWD_THRESHOLD_12_BITS__ Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +#define __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION(__ADC_RESOLUTION__, __AWD_THRESHOLD_12_BITS__) \ + ((__AWD_THRESHOLD_12_BITS__) >> ((__ADC_RESOLUTION__) >> (ADC_CFGR_RES_BITOFFSET_POS - 1U ))) + +/** + * @brief Helper macro to get the ADC analog watchdog threshold high + * or low from raw value containing both thresholds concatenated. + * @note To be used with function @ref LL_ADC_GetAnalogWDThresholds(). + * Example, to get analog watchdog threshold high from the register raw value: + * __LL_ADC_ANALOGWD_THRESHOLDS_HIGH_LOW(LL_ADC_AWD_THRESHOLD_HIGH, ); + * @param __AWD_THRESHOLD_TYPE__ This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD_THRESHOLD_HIGH + * @arg @ref LL_ADC_AWD_THRESHOLD_LOW + * @param __AWD_THRESHOLDS__ Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +#define __LL_ADC_ANALOGWD_THRESHOLDS_HIGH_LOW(__AWD_THRESHOLD_TYPE__, __AWD_THRESHOLDS__) \ + (((__AWD_THRESHOLDS__) >> POSITION_VAL((__AWD_THRESHOLD_TYPE__))) & LL_ADC_AWD_THRESHOLD_LOW) + +/** + * @brief Helper macro to set the ADC calibration value with both single ended + * and differential modes calibration factors concatenated. + * @note To be used with function @ref LL_ADC_SetCalibrationFactor(). + * Example, to set calibration factors single ended to 0x55 + * and differential ended to 0x2A: + * LL_ADC_SetCalibrationFactor( + * ADC1, + * __LL_ADC_CALIB_FACTOR_SINGLE_DIFF(0x55, 0x2A)) + * @param __CALIB_FACTOR_SINGLE_ENDED__ Value between Min_Data=0x00 and Max_Data=0x7F + * @param __CALIB_FACTOR_DIFFERENTIAL__ Value between Min_Data=0x00 and Max_Data=0x7F + * @retval Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF + */ +#define __LL_ADC_CALIB_FACTOR_SINGLE_DIFF(__CALIB_FACTOR_SINGLE_ENDED__, __CALIB_FACTOR_DIFFERENTIAL__) \ + (((__CALIB_FACTOR_DIFFERENTIAL__) << POSITION_VAL(ADC_CALFACT_CALFACT_D)) | (__CALIB_FACTOR_SINGLE_ENDED__)) + +#if defined(ADC_MULTIMODE_SUPPORT) +/** + * @brief Helper macro to get the ADC multimode conversion data of ADC master + * or ADC slave from raw value with both ADC conversion data concatenated. + * @note This macro is intended to be used when multimode transfer by DMA + * is enabled: refer to function @ref LL_ADC_SetMultiDMATransfer(). + * In this case the transferred data need to processed with this macro + * to separate the conversion data of ADC master and ADC slave. + * @param __ADC_MULTI_MASTER_SLAVE__ This parameter can be one of the following values: + * @arg @ref LL_ADC_MULTI_MASTER + * @arg @ref LL_ADC_MULTI_SLAVE + * @param __ADC_MULTI_CONV_DATA__ Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +#define __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE(__ADC_MULTI_MASTER_SLAVE__, __ADC_MULTI_CONV_DATA__) \ + (((__ADC_MULTI_CONV_DATA__) >> POSITION_VAL((__ADC_MULTI_MASTER_SLAVE__))) & ADC_CDR_RDATA_MST) +#endif + +/** + * @brief Helper macro to select the ADC common instance + * to which is belonging the selected ADC instance. + * @note ADC common register instance can be used for: + * - Set parameters common to several ADC instances + * - Multimode (for devices with several ADC instances) + * Refer to functions having argument "ADCxy_COMMON" as parameter. + * @param __ADCx__ ADC instance + * @retval ADC common register instance + */ +#if defined(ADC3) && defined(ADC4) +#define __LL_ADC_COMMON_INSTANCE(__ADCx__) \ + ((((__ADCx__) == ADC1) || ((__ADCx__) == ADC2)) \ + ? ( \ + (ADC12_COMMON) \ + ) \ + : \ + ( \ + (ADC34_COMMON) \ + ) \ + ) +#elif defined(ADC1) && defined(ADC2) +#define __LL_ADC_COMMON_INSTANCE(__ADCx__) \ + (ADC12_COMMON) +#else +#define __LL_ADC_COMMON_INSTANCE(__ADCx__) \ + (ADC1_COMMON) +#endif + +/** + * @brief Helper macro to check if all ADC instances sharing the same + * ADC common instance are disabled. + * @note This check is required by functions with setting conditioned to + * ADC state: + * All ADC instances of the ADC common group must be disabled. + * Refer to functions having argument "ADCxy_COMMON" as parameter. + * @note On devices with only 1 ADC common instance, parameter of this macro + * is useless and can be ignored (parameter kept for compatibility + * with devices featuring several ADC common instances). + * @param __ADCXY_COMMON__ ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval Value "0" if all ADC instances sharing the same ADC common instance + * are disabled. + * Value "1" if at least one ADC instance sharing the same ADC common instance + * is enabled. + */ +#if defined(ADC3) && defined(ADC4) +#define __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(__ADCXY_COMMON__) \ + (((__ADCXY_COMMON__) == ADC12_COMMON) \ + ? ( \ + (LL_ADC_IsEnabled(ADC1) | \ + LL_ADC_IsEnabled(ADC2) ) \ + ) \ + : \ + ( \ + (LL_ADC_IsEnabled(ADC3) | \ + LL_ADC_IsEnabled(ADC4) ) \ + ) \ + ) +#elif defined(ADC1) && defined(ADC2) +#define __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(__ADCXY_COMMON__) \ + (LL_ADC_IsEnabled(ADC1) | \ + LL_ADC_IsEnabled(ADC2) ) +#else +#define __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(__ADCXY_COMMON__) \ + LL_ADC_IsEnabled(ADC1) +#endif + +/** + * @brief Helper macro to define the ADC conversion data full-scale digital + * value corresponding to the selected ADC resolution. + * @note ADC conversion data full-scale corresponds to voltage range + * determined by analog voltage references Vref+ and Vref- + * (refer to reference manual). + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @retval ADC conversion data equivalent voltage value (unit: mVolt) + */ +#define __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__) \ + (((uint32_t)0xFFFU) >> ((__ADC_RESOLUTION__) >> (ADC_CFGR_RES_BITOFFSET_POS - 1U))) + +/** + * @brief Helper macro to convert the ADC conversion data from + * a resolution to another resolution. + * @param __DATA__ ADC conversion data to be converted + * @param __ADC_RESOLUTION_CURRENT__ Resolution of to the data to be converted + * This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @param __ADC_RESOLUTION_TARGET__ Resolution of the data after conversion + * This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @retval ADC conversion data to the requested resolution + */ +#define __LL_ADC_CONVERT_DATA_RESOLUTION(__DATA__,\ + __ADC_RESOLUTION_CURRENT__,\ + __ADC_RESOLUTION_TARGET__) \ + (((__DATA__) \ + << ((__ADC_RESOLUTION_CURRENT__) >> (ADC_CFGR_RES_BITOFFSET_POS - 1U))) \ + >> ((__ADC_RESOLUTION_TARGET__) >> (ADC_CFGR_RES_BITOFFSET_POS - 1U)) \ + ) + +/** + * @brief Helper macro to calculate the voltage (unit: mVolt) + * corresponding to a ADC conversion data (unit: digital value). + * @note Analog reference voltage (Vref+) must be either known from + * user board environment or can be calculated using ADC measurement + * and ADC helper macro @ref __LL_ADC_CALC_VREFANALOG_VOLTAGE(). + * @param __VREFANALOG_VOLTAGE__ Analog reference voltage (unit: mV) + * @param __ADC_DATA__ ADC conversion data (resolution 12 bits) + * (unit: digital value). + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @retval ADC conversion data equivalent voltage value (unit: mVolt) + */ +#define __LL_ADC_CALC_DATA_TO_VOLTAGE(__VREFANALOG_VOLTAGE__,\ + __ADC_DATA__,\ + __ADC_RESOLUTION__) \ + ((__ADC_DATA__) * (__VREFANALOG_VOLTAGE__) \ + / __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__) \ + ) + +/** + * @brief Helper macro to calculate analog reference voltage (Vref+) + * (unit: mVolt) from ADC conversion data of internal voltage + * reference VrefInt. + * @note Computation is using VrefInt calibration value + * stored in system memory for each device during production. + * @note This voltage depends on user board environment: voltage level + * connected to pin Vref+. + * On devices with small package, the pin Vref+ is not present + * and internally bonded to pin Vdda. + * @note On this STM32 series, calibration data of internal voltage reference + * VrefInt corresponds to a resolution of 12 bits, + * this is the recommended ADC resolution to convert voltage of + * internal voltage reference VrefInt. + * Otherwise, this macro performs the processing to scale + * ADC conversion data to 12 bits. + * @param __VREFINT_ADC_DATA__ ADC conversion data (resolution 12 bits) + * of internal voltage reference VrefInt (unit: digital value). + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @retval Analog reference voltage (unit: mV) + */ +#define __LL_ADC_CALC_VREFANALOG_VOLTAGE(__VREFINT_ADC_DATA__,\ + __ADC_RESOLUTION__) \ + (((uint32_t)(*VREFINT_CAL_ADDR) * VREFINT_CAL_VREF) \ + / __LL_ADC_CONVERT_DATA_RESOLUTION((__VREFINT_ADC_DATA__), \ + (__ADC_RESOLUTION__), \ + LL_ADC_RESOLUTION_12B) \ + ) + +/** + * @brief Helper macro to calculate the temperature (unit: degree Celsius) + * from ADC conversion data of internal temperature sensor. + * @note Computation is using temperature sensor calibration values + * stored in system memory for each device during production. + * @note Calculation formula: + * Temperature = ((TS_ADC_DATA - TS_CAL1) + * * (TS_CAL2_TEMP - TS_CAL1_TEMP)) + * / (TS_CAL2 - TS_CAL1) + TS_CAL1_TEMP + * with TS_ADC_DATA = temperature sensor raw data measured by ADC + * Avg_Slope = (TS_CAL2 - TS_CAL1) + * / (TS_CAL2_TEMP - TS_CAL1_TEMP) + * TS_CAL1 = equivalent TS_ADC_DATA at temperature + * TEMP_DEGC_CAL1 (calibrated in factory) + * TS_CAL2 = equivalent TS_ADC_DATA at temperature + * TEMP_DEGC_CAL2 (calibrated in factory) + * Caution: Calculation relevancy under reserve that calibration + * parameters are correct (address and data). + * To calculate temperature using temperature sensor + * datasheet typical values (generic values less, therefore + * less accurate than calibrated values), + * use helper macro @ref __LL_ADC_CALC_TEMPERATURE_TYP_PARAMS(). + * @note As calculation input, the analog reference voltage (Vref+) must be + * defined as it impacts the ADC LSB equivalent voltage. + * @note Analog reference voltage (Vref+) must be either known from + * user board environment or can be calculated using ADC measurement + * and ADC helper macro @ref __LL_ADC_CALC_VREFANALOG_VOLTAGE(). + * @note On this STM32 series, calibration data of temperature sensor + * corresponds to a resolution of 12 bits, + * this is the recommended ADC resolution to convert voltage of + * temperature sensor. + * Otherwise, this macro performs the processing to scale + * ADC conversion data to 12 bits. + * @param __VREFANALOG_VOLTAGE__ Analog reference voltage (unit: mV) + * @param __TEMPSENSOR_ADC_DATA__ ADC conversion data of internal + * temperature sensor (unit: digital value). + * @param __ADC_RESOLUTION__ ADC resolution at which internal temperature + * sensor voltage has been measured. + * This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @retval Temperature (unit: degree Celsius) + */ +#define __LL_ADC_CALC_TEMPERATURE(__VREFANALOG_VOLTAGE__,\ + __TEMPSENSOR_ADC_DATA__,\ + __ADC_RESOLUTION__) \ + (((( ((int32_t)((__LL_ADC_CONVERT_DATA_RESOLUTION((__TEMPSENSOR_ADC_DATA__), \ + (__ADC_RESOLUTION__), \ + LL_ADC_RESOLUTION_12B) \ + * (__VREFANALOG_VOLTAGE__)) \ + / TEMPSENSOR_CAL_VREFANALOG) \ + - (int32_t) *TEMPSENSOR_CAL1_ADDR) \ + ) * (int32_t)(TEMPSENSOR_CAL2_TEMP - TEMPSENSOR_CAL1_TEMP) \ + ) / (int32_t)((int32_t)*TEMPSENSOR_CAL2_ADDR - (int32_t)*TEMPSENSOR_CAL1_ADDR) \ + ) + TEMPSENSOR_CAL1_TEMP \ + ) + +/** + * @brief Helper macro to calculate the temperature (unit: degree Celsius) + * from ADC conversion data of internal temperature sensor. + * @note Computation is using temperature sensor typical values + * (refer to device datasheet). + * @note Calculation formula: + * Temperature = (TS_TYP_CALx_VOLT(uV) - TS_ADC_DATA * Conversion_uV) + * / Avg_Slope + CALx_TEMP + * with TS_ADC_DATA = temperature sensor raw data measured by ADC + * (unit: digital value) + * Avg_Slope = temperature sensor slope + * (unit: uV/Degree Celsius) + * TS_TYP_CALx_VOLT = temperature sensor digital value at + * temperature CALx_TEMP (unit: mV) + * Caution: Calculation relevancy under reserve the temperature sensor + * of the current device has characteristics in line with + * datasheet typical values. + * If temperature sensor calibration values are available on + * on this device (presence of macro __LL_ADC_CALC_TEMPERATURE()), + * temperature calculation will be more accurate using + * helper macro @ref __LL_ADC_CALC_TEMPERATURE(). + * @note As calculation input, the analog reference voltage (Vref+) must be + * defined as it impacts the ADC LSB equivalent voltage. + * @note Analog reference voltage (Vref+) must be either known from + * user board environment or can be calculated using ADC measurement + * and ADC helper macro @ref __LL_ADC_CALC_VREFANALOG_VOLTAGE(). + * @note ADC measurement data must correspond to a resolution of 12bits + * (full scale digital value 4095). If not the case, the data must be + * preliminarily rescaled to an equivalent resolution of 12 bits. + * @param __TEMPSENSOR_TYP_AVGSLOPE__ Device datasheet data: Temperature sensor slope typical value (unit: uV/DegCelsius). + * On STM32F3, refer to device datasheet parameter "Avg_Slope". + * @param __TEMPSENSOR_TYP_CALX_V__ Device datasheet data: Temperature sensor voltage typical value (at temperature and Vref+ defined in parameters below) (unit: mV). + * On STM32F3, refer to device datasheet parameter "V25" (corresponding to TS_CAL1). + * @param __TEMPSENSOR_CALX_TEMP__ Device datasheet data: Temperature at which temperature sensor voltage (see parameter above) is corresponding (unit: DegC) + * @param __VREFANALOG_VOLTAGE__ Analog voltage reference (Vref+) voltage (unit: mV) + * @param __TEMPSENSOR_ADC_DATA__ ADC conversion data of internal temperature sensor (unit: digital value). + * @param __ADC_RESOLUTION__ ADC resolution at which internal temperature sensor voltage has been measured. + * This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @retval Temperature (unit: degree Celsius) + */ +#define __LL_ADC_CALC_TEMPERATURE_TYP_PARAMS(__TEMPSENSOR_TYP_AVGSLOPE__,\ + __TEMPSENSOR_TYP_CALX_V__,\ + __TEMPSENSOR_CALX_TEMP__,\ + __VREFANALOG_VOLTAGE__,\ + __TEMPSENSOR_ADC_DATA__,\ + __ADC_RESOLUTION__) \ + ((( ( \ + (int32_t)(((__TEMPSENSOR_TYP_CALX_V__)) \ + * 1000) \ + - \ + (int32_t)((((__TEMPSENSOR_ADC_DATA__) * (__VREFANALOG_VOLTAGE__)) \ + / __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__)) \ + * 1000) \ + ) \ + ) / (__TEMPSENSOR_TYP_AVGSLOPE__) \ + ) + (__TEMPSENSOR_CALX_TEMP__) \ + ) + +/** + * @} + */ + +/** + * @} + */ + + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup ADC_LL_Exported_Functions ADC Exported Functions + * @{ + */ + +/** @defgroup ADC_LL_EF_DMA_Management ADC DMA management + * @{ + */ +/* Note: LL ADC functions to set DMA transfer are located into sections of */ +/* configuration of ADC instance, groups and multimode (if available): */ +/* @ref LL_ADC_REG_SetDMATransfer(), ... */ + +/** + * @brief Function to help to configure DMA transfer from ADC: retrieve the + * ADC register address from ADC instance and a list of ADC registers + * intended to be used (most commonly) with DMA transfer. + * @note These ADC registers are data registers: + * when ADC conversion data is available in ADC data registers, + * ADC generates a DMA transfer request. + * @note This macro is intended to be used with LL DMA driver, refer to + * function "LL_DMA_ConfigAddresses()". + * Example: + * LL_DMA_ConfigAddresses(DMA1, + * LL_DMA_CHANNEL_1, + * LL_ADC_DMA_GetRegAddr(ADC1, LL_ADC_DMA_REG_REGULAR_DATA), + * (uint32_t)&< array or variable >, + * LL_DMA_DIRECTION_PERIPH_TO_MEMORY); + * @note For devices with several ADC: in multimode, some devices + * use a different data register outside of ADC instance scope + * (common data register). This macro manages this register difference, + * only ADC instance has to be set as parameter. + * @rmtoll DR RDATA LL_ADC_DMA_GetRegAddr\n + * CDR RDATA_MST LL_ADC_DMA_GetRegAddr\n + * CDR RDATA_SLV LL_ADC_DMA_GetRegAddr + * @param ADCx ADC instance + * @param Register This parameter can be one of the following values: + * @arg @ref LL_ADC_DMA_REG_REGULAR_DATA + * @arg @ref LL_ADC_DMA_REG_REGULAR_DATA_MULTI (1) + * + * (1) Available on devices with several ADC instances. + * @retval ADC register address + */ +#if defined(ADC_MULTIMODE_SUPPORT) +__STATIC_INLINE uint32_t LL_ADC_DMA_GetRegAddr(ADC_TypeDef *ADCx, uint32_t Register) +{ + uint32_t data_reg_addr = 0U; + + if (Register == LL_ADC_DMA_REG_REGULAR_DATA) + { + /* Retrieve address of register DR */ + data_reg_addr = (uint32_t)&(ADCx->DR); + } + else /* (Register == LL_ADC_DMA_REG_REGULAR_DATA_MULTI) */ + { + /* Retrieve address of register CDR */ + data_reg_addr = (uint32_t)&((__LL_ADC_COMMON_INSTANCE(ADCx))->CDR); + } + + return data_reg_addr; +} +#else +__STATIC_INLINE uint32_t LL_ADC_DMA_GetRegAddr(ADC_TypeDef *ADCx, uint32_t Register) +{ + /* Prevent unused argument compilation warning */ + (void)Register; + + /* Retrieve address of register DR */ + return (uint32_t)&(ADCx->DR); +} +#endif + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Common Configuration of ADC hierarchical scope: common to several ADC instances + * @{ + */ + +/** + * @brief Set parameter common to several ADC: Clock source and prescaler. + * @note On this STM32 series, if ADC group injected is used, some + * clock ratio constraints between ADC clock and AHB clock + * must be respected. + * Refer to reference manual. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * All ADC instances of the ADC common group must be disabled. + * This check can be done with function @ref LL_ADC_IsEnabled() for each + * ADC instance or by using helper macro helper macro + * @ref __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(). + * @rmtoll CCR CKMODE LL_ADC_SetCommonClock\n + * CCR PRESC LL_ADC_SetCommonClock + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @param CommonClock This parameter can be one of the following values: + * @arg @ref LL_ADC_CLOCK_SYNC_PCLK_DIV1 + * @arg @ref LL_ADC_CLOCK_SYNC_PCLK_DIV2 + * @arg @ref LL_ADC_CLOCK_SYNC_PCLK_DIV4 + * @arg @ref LL_ADC_CLOCK_ASYNC_DIV1 + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetCommonClock(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t CommonClock) +{ + MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_CKMODE, CommonClock); +} + +/** + * @brief Get parameter common to several ADC: Clock source and prescaler. + * @rmtoll CCR CKMODE LL_ADC_GetCommonClock\n + * CCR PRESC LL_ADC_GetCommonClock + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CLOCK_SYNC_PCLK_DIV1 + * @arg @ref LL_ADC_CLOCK_SYNC_PCLK_DIV2 + * @arg @ref LL_ADC_CLOCK_SYNC_PCLK_DIV4 + * @arg @ref LL_ADC_CLOCK_ASYNC_DIV1 + */ +__STATIC_INLINE uint32_t LL_ADC_GetCommonClock(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (uint32_t)(READ_BIT(ADCxy_COMMON->CCR, ADC_CCR_CKMODE)); +} + +/** + * @brief Set parameter common to several ADC: measurement path to internal + * channels (VrefInt, temperature sensor, ...). + * @note One or several values can be selected. + * Example: (LL_ADC_PATH_INTERNAL_VREFINT | + * LL_ADC_PATH_INTERNAL_TEMPSENSOR) + * @note Stabilization time of measurement path to internal channel: + * After enabling internal paths, before starting ADC conversion, + * a delay is required for internal voltage reference and + * temperature sensor stabilization time. + * Refer to device datasheet. + * Refer to literal @ref LL_ADC_DELAY_VREFINT_STAB_US. + * Refer to literal @ref LL_ADC_DELAY_TEMPSENSOR_STAB_US. + * @note ADC internal channel sampling time constraint: + * For ADC conversion of internal channels, + * a sampling time minimum value is required. + * Refer to device datasheet. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * All ADC instances of the ADC common group must be disabled. + * This check can be done with function @ref LL_ADC_IsEnabled() for each + * ADC instance or by using helper macro helper macro + * @ref __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(). + * @rmtoll CCR VREFEN LL_ADC_SetCommonPathInternalCh\n + * CCR TSEN LL_ADC_SetCommonPathInternalCh\n + * CCR VBATEN LL_ADC_SetCommonPathInternalCh + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @param PathInternal This parameter can be a combination of the following values: + * @arg @ref LL_ADC_PATH_INTERNAL_NONE + * @arg @ref LL_ADC_PATH_INTERNAL_VREFINT + * @arg @ref LL_ADC_PATH_INTERNAL_TEMPSENSOR + * @arg @ref LL_ADC_PATH_INTERNAL_VBAT + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetCommonPathInternalCh(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t PathInternal) +{ + MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_VREFEN | ADC_CCR_TSEN | ADC_CCR_VBATEN, PathInternal); +} + +/** + * @brief Get parameter common to several ADC: measurement path to internal + * channels (VrefInt, temperature sensor, ...). + * @note One or several values can be selected. + * Example: (LL_ADC_PATH_INTERNAL_VREFINT | + * LL_ADC_PATH_INTERNAL_TEMPSENSOR) + * @rmtoll CCR VREFEN LL_ADC_GetCommonPathInternalCh\n + * CCR TSEN LL_ADC_GetCommonPathInternalCh\n + * CCR VBATEN LL_ADC_GetCommonPathInternalCh + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval Returned value can be a combination of the following values: + * @arg @ref LL_ADC_PATH_INTERNAL_NONE + * @arg @ref LL_ADC_PATH_INTERNAL_VREFINT + * @arg @ref LL_ADC_PATH_INTERNAL_TEMPSENSOR + * @arg @ref LL_ADC_PATH_INTERNAL_VBAT + */ +__STATIC_INLINE uint32_t LL_ADC_GetCommonPathInternalCh(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (uint32_t)(READ_BIT(ADCxy_COMMON->CCR, ADC_CCR_VREFEN | ADC_CCR_TSEN | ADC_CCR_VBATEN)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Instance Configuration of ADC hierarchical scope: ADC instance + * @{ + */ + +/** + * @brief Set ADC calibration factor in the mode single-ended + * or differential (for devices with differential mode available). + * @note This function is intended to set calibration parameters + * without having to perform a new calibration using + * @ref LL_ADC_StartCalibration(). + * @note For devices with differential mode available: + * Calibration of offset is specific to each of + * single-ended and differential modes + * (calibration factor must be specified for each of these + * differential modes, if used afterwards and if the application + * requires their calibration). + * @note In case of setting calibration factors of both modes single ended + * and differential (parameter LL_ADC_BOTH_SINGLE_DIFF_ENDED): + * both calibration factors must be concatenated. + * To perform this processing, use helper macro + * @ref __LL_ADC_CALIB_FACTOR_SINGLE_DIFF(). + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be enabled, without calibration on going, without conversion + * on going on group regular. + * @rmtoll CALFACT CALFACT_S LL_ADC_SetCalibrationFactor\n + * CALFACT CALFACT_D LL_ADC_SetCalibrationFactor + * @param ADCx ADC instance + * @param SingleDiff This parameter can be one of the following values: + * @arg @ref LL_ADC_SINGLE_ENDED + * @arg @ref LL_ADC_DIFFERENTIAL_ENDED + * @arg @ref LL_ADC_BOTH_SINGLE_DIFF_ENDED + * @param CalibrationFactor Value between Min_Data=0x00 and Max_Data=0x7F + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetCalibrationFactor(ADC_TypeDef *ADCx, uint32_t SingleDiff, uint32_t CalibrationFactor) +{ + MODIFY_REG(ADCx->CALFACT, + SingleDiff & ADC_SINGLEDIFF_CALIB_FACTOR_MASK, + CalibrationFactor << POSITION_VAL(SingleDiff & ADC_SINGLEDIFF_CALIB_FACTOR_MASK)); +} + +/** + * @brief Get ADC calibration factor in the mode single-ended + * or differential (for devices with differential mode available). + * @note Calibration factors are set by hardware after performing + * a calibration run using function @ref LL_ADC_StartCalibration(). + * @note For devices with differential mode available: + * Calibration of offset is specific to each of + * single-ended and differential modes + * @rmtoll CALFACT CALFACT_S LL_ADC_GetCalibrationFactor\n + * CALFACT CALFACT_D LL_ADC_GetCalibrationFactor + * @param ADCx ADC instance + * @param SingleDiff This parameter can be one of the following values: + * @arg @ref LL_ADC_SINGLE_ENDED + * @arg @ref LL_ADC_DIFFERENTIAL_ENDED + * @retval Value between Min_Data=0x00 and Max_Data=0x7F + */ +__STATIC_INLINE uint32_t LL_ADC_GetCalibrationFactor(ADC_TypeDef *ADCx, uint32_t SingleDiff) +{ + /* Retrieve bits with position in register depending on parameter */ + /* "SingleDiff". */ + /* Parameter used with mask "ADC_SINGLEDIFF_CALIB_FACTOR_MASK" because */ + /* containing other bits reserved for other purpose. */ + return (uint32_t)(READ_BIT(ADCx->CALFACT, (SingleDiff & ADC_SINGLEDIFF_CALIB_FACTOR_MASK)) >> POSITION_VAL(SingleDiff & ADC_SINGLEDIFF_CALIB_FACTOR_MASK)); +} + +/** + * @brief Set ADC resolution. + * Refer to reference manual for alignments formats + * dependencies to ADC resolutions. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CFGR RES LL_ADC_SetResolution + * @param ADCx ADC instance + * @param Resolution This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetResolution(ADC_TypeDef *ADCx, uint32_t Resolution) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_RES, Resolution); +} + +/** + * @brief Get ADC resolution. + * Refer to reference manual for alignments formats + * dependencies to ADC resolutions. + * @rmtoll CFGR RES LL_ADC_GetResolution + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @arg @ref LL_ADC_RESOLUTION_10B + * @arg @ref LL_ADC_RESOLUTION_8B + * @arg @ref LL_ADC_RESOLUTION_6B + */ +__STATIC_INLINE uint32_t LL_ADC_GetResolution(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_RES)); +} + +/** + * @brief Set ADC conversion data alignment. + * @note Refer to reference manual for alignments formats + * dependencies to ADC resolutions. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CFGR ALIGN LL_ADC_SetDataAlignment + * @param ADCx ADC instance + * @param DataAlignment This parameter can be one of the following values: + * @arg @ref LL_ADC_DATA_ALIGN_RIGHT + * @arg @ref LL_ADC_DATA_ALIGN_LEFT + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetDataAlignment(ADC_TypeDef *ADCx, uint32_t DataAlignment) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_ALIGN, DataAlignment); +} + +/** + * @brief Get ADC conversion data alignment. + * @note Refer to reference manual for alignments formats + * dependencies to ADC resolutions. + * @rmtoll CFGR ALIGN LL_ADC_GetDataAlignment + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_DATA_ALIGN_RIGHT + * @arg @ref LL_ADC_DATA_ALIGN_LEFT + */ +__STATIC_INLINE uint32_t LL_ADC_GetDataAlignment(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_ALIGN)); +} + +/** + * @brief Set ADC low power mode. + * @note Description of ADC low power modes: + * - ADC low power mode "auto wait": Dynamic low power mode, + * ADC conversions occurrences are limited to the minimum necessary + * in order to reduce power consumption. + * New ADC conversion starts only when the previous + * unitary conversion data (for ADC group regular) + * or previous sequence conversions data (for ADC group injected) + * has been retrieved by user software. + * In the meantime, ADC remains idle: does not performs any + * other conversion. + * This mode allows to automatically adapt the ADC conversions + * triggers to the speed of the software that reads the data. + * Moreover, this avoids risk of overrun for low frequency + * applications. + * How to use this low power mode: + * - It is not recommended to use with interruption or DMA + * since these modes have to clear immediately the EOC flag + * (by CPU to free the IRQ pending event or by DMA). + * Auto wait will work but fort a very short time, discarding + * its intended benefit (except specific case of high load of CPU + * or DMA transfers which can justify usage of auto wait). + * - Do use with polling: 1. Start conversion, + * 2. Later on, when conversion data is needed: poll for end of + * conversion to ensure that conversion is completed and + * retrieve ADC conversion data. This will trig another + * ADC conversion start. + * - ADC low power mode "auto power-off" (feature available on + * this device if parameter LL_ADC_LP_MODE_AUTOOFF is available): + * the ADC automatically powers-off after a conversion and + * automatically wakes up when a new conversion is triggered + * (with startup time between trigger and start of sampling). + * This feature can be combined with low power mode "auto wait". + * @note With ADC low power mode "auto wait", the ADC conversion data read + * is corresponding to previous ADC conversion start, independently + * of delay during which ADC was idle. + * Therefore, the ADC conversion data may be outdated: does not + * correspond to the current voltage level on the selected + * ADC channel. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CFGR AUTDLY LL_ADC_SetLowPowerMode + * @param ADCx ADC instance + * @param LowPowerMode This parameter can be one of the following values: + * @arg @ref LL_ADC_LP_MODE_NONE + * @arg @ref LL_ADC_LP_AUTOWAIT + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetLowPowerMode(ADC_TypeDef *ADCx, uint32_t LowPowerMode) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_AUTDLY, LowPowerMode); +} + +/** + * @brief Get ADC low power mode: + * @note Description of ADC low power modes: + * - ADC low power mode "auto wait": Dynamic low power mode, + * ADC conversions occurrences are limited to the minimum necessary + * in order to reduce power consumption. + * New ADC conversion starts only when the previous + * unitary conversion data (for ADC group regular) + * or previous sequence conversions data (for ADC group injected) + * has been retrieved by user software. + * In the meantime, ADC remains idle: does not performs any + * other conversion. + * This mode allows to automatically adapt the ADC conversions + * triggers to the speed of the software that reads the data. + * Moreover, this avoids risk of overrun for low frequency + * applications. + * How to use this low power mode: + * - It is not recommended to use with interruption or DMA + * since these modes have to clear immediately the EOC flag + * (by CPU to free the IRQ pending event or by DMA). + * Auto wait will work but fort a very short time, discarding + * its intended benefit (except specific case of high load of CPU + * or DMA transfers which can justify usage of auto wait). + * - Do use with polling: 1. Start conversion, + * 2. Later on, when conversion data is needed: poll for end of + * conversion to ensure that conversion is completed and + * retrieve ADC conversion data. This will trig another + * ADC conversion start. + * - ADC low power mode "auto power-off" (feature available on + * this device if parameter LL_ADC_LP_MODE_AUTOOFF is available): + * the ADC automatically powers-off after a conversion and + * automatically wakes up when a new conversion is triggered + * (with startup time between trigger and start of sampling). + * This feature can be combined with low power mode "auto wait". + * @note With ADC low power mode "auto wait", the ADC conversion data read + * is corresponding to previous ADC conversion start, independently + * of delay during which ADC was idle. + * Therefore, the ADC conversion data may be outdated: does not + * correspond to the current voltage level on the selected + * ADC channel. + * @rmtoll CFGR AUTDLY LL_ADC_GetLowPowerMode + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_LP_MODE_NONE + * @arg @ref LL_ADC_LP_AUTOWAIT + */ +__STATIC_INLINE uint32_t LL_ADC_GetLowPowerMode(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_AUTDLY)); +} + +/** + * @brief Set ADC selected offset number 1, 2, 3 or 4. + * @note This function set the 2 items of offset configuration: + * - ADC channel to which the offset programmed will be applied + * (independently of channel mapped on ADC group regular + * or group injected) + * - Offset level (offset to be subtracted from the raw + * converted data). + * @note Caution: Offset format is dependent to ADC resolution: + * offset has to be left-aligned on bit 11, the LSB (right bits) + * are set to 0. + * @note This function enables the offset, by default. It can be forced + * to disable state using function LL_ADC_SetOffsetState(). + * @note If a channel is mapped on several offsets numbers, only the offset + * with the lowest value is considered for the subtraction. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll OFR1 OFFSET1_CH LL_ADC_SetOffset\n + * OFR1 OFFSET1 LL_ADC_SetOffset\n + * OFR1 OFFSET1_EN LL_ADC_SetOffset\n + * OFR2 OFFSET2_CH LL_ADC_SetOffset\n + * OFR2 OFFSET2 LL_ADC_SetOffset\n + * OFR2 OFFSET2_EN LL_ADC_SetOffset\n + * OFR3 OFFSET3_CH LL_ADC_SetOffset\n + * OFR3 OFFSET3 LL_ADC_SetOffset\n + * OFR3 OFFSET3_EN LL_ADC_SetOffset\n + * OFR4 OFFSET4_CH LL_ADC_SetOffset\n + * OFR4 OFFSET4 LL_ADC_SetOffset\n + * OFR4 OFFSET4_EN LL_ADC_SetOffset + * @param ADCx ADC instance + * @param Offsety This parameter can be one of the following values: + * @arg @ref LL_ADC_OFFSET_1 + * @arg @ref LL_ADC_OFFSET_2 + * @arg @ref LL_ADC_OFFSET_3 + * @arg @ref LL_ADC_OFFSET_4 + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @param OffsetLevel Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetOffset(ADC_TypeDef *ADCx, uint32_t Offsety, uint32_t Channel, uint32_t OffsetLevel) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->OFR1, Offsety); + + MODIFY_REG(*preg, + ADC_OFR1_OFFSET1_EN | ADC_OFR1_OFFSET1_CH | ADC_OFR1_OFFSET1, + ADC_OFR1_OFFSET1_EN | (Channel & ADC_CHANNEL_ID_NUMBER_MASK) | OffsetLevel); +} + +/** + * @brief Get for the ADC selected offset number 1, 2, 3 or 4: + * Channel to which the offset programmed will be applied + * (independently of channel mapped on ADC group regular + * or group injected) + * @note Usage of the returned channel number: + * - To reinject this channel into another function LL_ADC_xxx: + * the returned channel number is only partly formatted on definition + * of literals LL_ADC_CHANNEL_x. Therefore, it has to be compared + * with parts of literals LL_ADC_CHANNEL_x or using + * helper macro @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Then the selected literal LL_ADC_CHANNEL_x can be used + * as parameter for another function. + * - To get the channel number in decimal format: + * process the returned value with the helper macro + * @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * @rmtoll OFR1 OFFSET1_CH LL_ADC_GetOffsetChannel\n + * OFR2 OFFSET2_CH LL_ADC_GetOffsetChannel\n + * OFR3 OFFSET3_CH LL_ADC_GetOffsetChannel\n + * OFR4 OFFSET4_CH LL_ADC_GetOffsetChannel + * @param ADCx ADC instance + * @param Offsety This parameter can be one of the following values: + * @arg @ref LL_ADC_OFFSET_1 + * @arg @ref LL_ADC_OFFSET_2 + * @arg @ref LL_ADC_OFFSET_3 + * @arg @ref LL_ADC_OFFSET_4 + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time.\n + * (1, 2, 3, 4, 5) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + */ +__STATIC_INLINE uint32_t LL_ADC_GetOffsetChannel(ADC_TypeDef *ADCx, uint32_t Offsety) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->OFR1, Offsety); + + return (uint32_t) READ_BIT(*preg, ADC_OFR1_OFFSET1_CH); +} + +/** + * @brief Get for the ADC selected offset number 1, 2, 3 or 4: + * Offset level (offset to be subtracted from the raw + * converted data). + * @note Caution: Offset format is dependent to ADC resolution: + * offset has to be left-aligned on bit 11, the LSB (right bits) + * are set to 0. + * @rmtoll OFR1 OFFSET1 LL_ADC_GetOffsetLevel\n + * OFR2 OFFSET2 LL_ADC_GetOffsetLevel\n + * OFR3 OFFSET3 LL_ADC_GetOffsetLevel\n + * OFR4 OFFSET4 LL_ADC_GetOffsetLevel + * @param ADCx ADC instance + * @param Offsety This parameter can be one of the following values: + * @arg @ref LL_ADC_OFFSET_1 + * @arg @ref LL_ADC_OFFSET_2 + * @arg @ref LL_ADC_OFFSET_3 + * @arg @ref LL_ADC_OFFSET_4 + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +__STATIC_INLINE uint32_t LL_ADC_GetOffsetLevel(ADC_TypeDef *ADCx, uint32_t Offsety) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->OFR1, Offsety); + + return (uint32_t) READ_BIT(*preg, ADC_OFR1_OFFSET1); +} + +/** + * @brief Set for the ADC selected offset number 1, 2, 3 or 4: + * force offset state disable or enable + * without modifying offset channel or offset value. + * @note This function should be needed only in case of offset to be + * enabled-disabled dynamically, and should not be needed in other cases: + * function LL_ADC_SetOffset() automatically enables the offset. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll OFR1 OFFSET1_EN LL_ADC_SetOffsetState\n + * OFR2 OFFSET2_EN LL_ADC_SetOffsetState\n + * OFR3 OFFSET3_EN LL_ADC_SetOffsetState\n + * OFR4 OFFSET4_EN LL_ADC_SetOffsetState + * @param ADCx ADC instance + * @param Offsety This parameter can be one of the following values: + * @arg @ref LL_ADC_OFFSET_1 + * @arg @ref LL_ADC_OFFSET_2 + * @arg @ref LL_ADC_OFFSET_3 + * @arg @ref LL_ADC_OFFSET_4 + * @param OffsetState This parameter can be one of the following values: + * @arg @ref LL_ADC_OFFSET_DISABLE + * @arg @ref LL_ADC_OFFSET_ENABLE + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetOffsetState(ADC_TypeDef *ADCx, uint32_t Offsety, uint32_t OffsetState) +{ + __IO uint32_t *preg = (__IO uint32_t *)((uint32_t) + ((uint32_t)(&ADCx->OFR1) + (Offsety*4U))); + + MODIFY_REG(*preg, + ADC_OFR1_OFFSET1_EN, + OffsetState); +} + +/** + * @brief Get for the ADC selected offset number 1, 2, 3 or 4: + * offset state disabled or enabled. + * @rmtoll OFR1 OFFSET1_EN LL_ADC_GetOffsetState\n + * OFR2 OFFSET2_EN LL_ADC_GetOffsetState\n + * OFR3 OFFSET3_EN LL_ADC_GetOffsetState\n + * OFR4 OFFSET4_EN LL_ADC_GetOffsetState + * @param ADCx ADC instance + * @param Offsety This parameter can be one of the following values: + * @arg @ref LL_ADC_OFFSET_1 + * @arg @ref LL_ADC_OFFSET_2 + * @arg @ref LL_ADC_OFFSET_3 + * @arg @ref LL_ADC_OFFSET_4 + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_OFFSET_DISABLE + * @arg @ref LL_ADC_OFFSET_ENABLE + */ +__STATIC_INLINE uint32_t LL_ADC_GetOffsetState(ADC_TypeDef *ADCx, uint32_t Offsety) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->OFR1, Offsety); + + return (uint32_t) READ_BIT(*preg, ADC_OFR1_OFFSET1_EN); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Group_Regular Configuration of ADC hierarchical scope: group regular + * @{ + */ + +/** + * @brief Set ADC group regular conversion trigger source: + * internal (SW start) or from external IP (timer event, + * external interrupt line). + * @note On this STM32 series, setting trigger source to external trigger + * also set trigger polarity to rising edge + * (default setting for compatibility with some ADC on other + * STM32 families having this setting set by HW default value). + * In case of need to modify trigger edge, use + * function @ref LL_ADC_REG_SetTriggerEdge(). + * @note Availability of parameters of trigger sources from timer + * depends on timers availability on the selected device. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on group regular. + * @rmtoll CFGR EXTSEL LL_ADC_REG_SetTriggerSource\n + * CFGR EXTEN LL_ADC_REG_SetTriggerSource + * @param ADCx ADC instance + * @param TriggerSource This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_TRIG_SOFTWARE + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_TRGO + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_TRGO2 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH1 (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH1_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH2 (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH2_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH3 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_TRGO (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_CH1_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_CH2_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_CH3_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_TRGO (3)(4)(5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_CH1_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_CH4 (3)(4)(5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_CH4_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_TRGO (1)(2)(3)(5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_CH1_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_CH4 (3) (5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_CH4_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM6_TRGO (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM6_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO (3) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO2 (1)(2) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM6_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM7_TRGO_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO2 (1)(2) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_CH1_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM15_TRGO (5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_TRG0_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_TRG02_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_CH1_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_CH2_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_CH3_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_TRG0_ADC3 (1) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_TRG02_ADC34 (1) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_CH1_ADC34 (1) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_HRTIM_TRG1 (4) + * @arg @ref LL_ADC_REG_TRIG_EXT_HRTIM_TRG3 (4) + * @arg @ref LL_ADC_REG_TRIG_EXT_EXTI_LINE2_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_EXTI_LINE11 (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_EXTI_LINE11_ADC12 (1)(2) (7) + + * (1) On STM32F3, parameter not available on all devices: among others, on STM32F303xE, STM32F398xx.\n + * (2) On STM32F3, parameter not available on all devices: among others, on STM32F303xC, STM32F358xx.\n + * (3) On STM32F3, parameter not available on all devices: among others, on STM32F303x8, STM32F328xx.\n + * (4) On STM32F3, parameter not available on all devices: among others, on STM32F334x8.\n + * (5) On STM32F3, parameter not available on all devices: among others, on STM32F302xC, STM32F302xE.\n + * (6) On STM32F3, parameter not available on all devices: among others, on STM32F301x8, STM32F302x8, STM32F318xx.\n + * (7) On STM32F3, parameter not available on all ADC instances: ADC1, ADC2 (for ADC instances ADCx available on the selected device).\n + * (8) On STM32F3, parameter not available on all ADC instances: ADC3, ADC4 (for ADC instances ADCx available on the selected device). + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetTriggerSource(ADC_TypeDef *ADCx, uint32_t TriggerSource) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_EXTEN | ADC_CFGR_EXTSEL, TriggerSource); +} + +/** + * @brief Get ADC group regular conversion trigger source: + * internal (SW start) or from external IP (timer event, + * external interrupt line). + * @note To determine whether group regular trigger source is + * internal (SW start) or external, without detail + * of which peripheral is selected as external trigger, + * (equivalent to + * "if(LL_ADC_REG_GetTriggerSource(ADC1) == LL_ADC_REG_TRIG_SOFTWARE)") + * use function @ref LL_ADC_REG_IsTriggerSourceSWStart. + * @note Availability of parameters of trigger sources from timer + * depends on timers availability on the selected device. + * @rmtoll CFGR EXTSEL LL_ADC_REG_GetTriggerSource\n + * CFGR EXTEN LL_ADC_REG_GetTriggerSource + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_TRIG_SOFTWARE + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_TRGO + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_TRGO2 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH1 (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH1_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH2 (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH2_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM1_CH3 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_TRGO (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_CH1_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_CH2_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_CH3_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_TRGO (3)(4)(5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_CH1_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_CH4 (3)(4)(5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_CH4_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_TRGO (1)(2)(3)(5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_CH1_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_CH4 (3) (5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_CH4_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM6_TRGO (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM6_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO (3) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO2 (1)(2) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM6_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM7_TRGO_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_TRGO2 (1)(2) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM8_CH1_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM15_TRGO (5) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_TRG0_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_TRG02_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_CH1_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_CH2_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_CH3_ADC12 (1) (7) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_TRG0_ADC3 (1) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_TRG02_ADC34 (1) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM20_CH1_ADC34 (1) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_HRTIM_TRG1 (4) + * @arg @ref LL_ADC_REG_TRIG_EXT_HRTIM_TRG3 (4) + * @arg @ref LL_ADC_REG_TRIG_EXT_EXTI_LINE2_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_REG_TRIG_EXT_EXTI_LINE11 (3)(4)(5)(6) + * @arg @ref LL_ADC_REG_TRIG_EXT_EXTI_LINE11_ADC12 (1)(2) (7) + + * (1) On STM32F3, parameter not available on all devices: among others, on STM32F303xE, STM32F398xx.\n + * (2) On STM32F3, parameter not available on all devices: among others, on STM32F303xC, STM32F358xx.\n + * (3) On STM32F3, parameter not available on all devices: among others, on STM32F303x8, STM32F328xx.\n + * (4) On STM32F3, parameter not available on all devices: among others, on STM32F334x8.\n + * (5) On STM32F3, parameter not available on all devices: among others, on STM32F302xC, STM32F302xE.\n + * (6) On STM32F3, parameter not available on all devices: among others, on STM32F301x8, STM32F302x8, STM32F318xx.\n + * (7) On STM32F3, parameter not available on all ADC instances: ADC1, ADC2 (for ADC instances ADCx available on the selected device).\n + * (8) On STM32F3, parameter not available on all ADC instances: ADC3, ADC4 (for ADC instances ADCx available on the selected device). + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetTriggerSource(ADC_TypeDef *ADCx) +{ + uint32_t TriggerSource = READ_BIT(ADCx->CFGR, ADC_CFGR_EXTSEL | ADC_CFGR_EXTEN); + + /* Value for shift of {0; 4; 8; 12} depending on value of bitfield */ + /* corresponding to ADC_CFGR_EXTEN {0; 1; 2; 3}. */ + uint32_t ShiftExten = ((TriggerSource & ADC_CFGR_EXTEN) >> (ADC_REG_TRIG_EXTEN_BITOFFSET_POS - 2U)); + + /* Set bitfield corresponding to ADC_CFGR_EXTEN and ADC_CFGR_EXTSEL */ + /* to match with triggers literals definition. */ + return ((TriggerSource + & (ADC_REG_TRIG_SOURCE_MASK >> ShiftExten) & ADC_CFGR_EXTSEL) + | ((ADC_REG_TRIG_EDGE_MASK >> ShiftExten) & ADC_CFGR_EXTEN) + ); +} + +/** + * @brief Get ADC group regular conversion trigger source internal (SW start) + or external. + * @note In case of group regular trigger source set to external trigger, + * to determine which peripheral is selected as external trigger, + * use function @ref LL_ADC_REG_GetTriggerSource(). + * @rmtoll CFGR EXTEN LL_ADC_REG_IsTriggerSourceSWStart + * @param ADCx ADC instance + * @retval Value "0" if trigger source external trigger + * Value "1" if trigger source SW start. + */ +__STATIC_INLINE uint32_t LL_ADC_REG_IsTriggerSourceSWStart(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CFGR, ADC_CFGR_EXTEN) == (LL_ADC_REG_TRIG_SOFTWARE & ADC_CFGR_EXTEN)); +} + +/** + * @brief Set ADC group regular conversion trigger polarity. + * @note Applicable only for trigger source set to external trigger. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on group regular. + * @rmtoll CFGR EXTEN LL_ADC_REG_SetTriggerEdge + * @param ADCx ADC instance + * @param ExternalTriggerEdge This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_TRIG_EXT_RISING + * @arg @ref LL_ADC_REG_TRIG_EXT_FALLING + * @arg @ref LL_ADC_REG_TRIG_EXT_RISINGFALLING + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetTriggerEdge(ADC_TypeDef *ADCx, uint32_t ExternalTriggerEdge) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_EXTEN, ExternalTriggerEdge); +} + +/** + * @brief Get ADC group regular conversion trigger polarity. + * @note Applicable only for trigger source set to external trigger. + * @rmtoll CFGR EXTEN LL_ADC_REG_GetTriggerEdge + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_TRIG_EXT_RISING + * @arg @ref LL_ADC_REG_TRIG_EXT_FALLING + * @arg @ref LL_ADC_REG_TRIG_EXT_RISINGFALLING + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetTriggerEdge(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_EXTEN)); +} + + +/** + * @brief Set ADC group regular sequencer length and scan direction. + * @note Description of ADC group regular sequencer features: + * - For devices with sequencer fully configurable + * (function "LL_ADC_REG_SetSequencerRanks()" available): + * sequencer length and each rank affectation to a channel + * are configurable. + * This function performs configuration of: + * - Sequence length: Number of ranks in the scan sequence. + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from rank 1 to rank n). + * Sequencer ranks are selected using + * function "LL_ADC_REG_SetSequencerRanks()". + * - For devices with sequencer not fully configurable + * (function "LL_ADC_REG_SetSequencerChannels()" available): + * sequencer length and each rank affectation to a channel + * are defined by channel number. + * This function performs configuration of: + * - Sequence length: Number of ranks in the scan sequence is + * defined by number of channels set in the sequence, + * rank of each channel is fixed by channel HW number. + * (channel 0 fixed on rank 0, channel 1 fixed on rank1, ...). + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from lowest channel number to + * highest channel number). + * Sequencer ranks are selected using + * function "LL_ADC_REG_SetSequencerChannels()". + * @note Sequencer disabled is equivalent to sequencer of 1 rank: + * ADC conversion on only 1 channel. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on group regular. + * @rmtoll SQR1 L LL_ADC_REG_SetSequencerLength + * @param ADCx ADC instance + * @param SequencerNbRanks This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_4RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_5RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_6RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_7RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_8RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_9RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_10RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_11RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_12RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_13RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_14RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_15RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_16RANKS + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetSequencerLength(ADC_TypeDef *ADCx, uint32_t SequencerNbRanks) +{ + MODIFY_REG(ADCx->SQR1, ADC_SQR1_L, SequencerNbRanks); +} + +/** + * @brief Get ADC group regular sequencer length and scan direction. + * @note Description of ADC group regular sequencer features: + * - For devices with sequencer fully configurable + * (function "LL_ADC_REG_SetSequencerRanks()" available): + * sequencer length and each rank affectation to a channel + * are configurable. + * This function retrieves: + * - Sequence length: Number of ranks in the scan sequence. + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from rank 1 to rank n). + * Sequencer ranks are selected using + * function "LL_ADC_REG_SetSequencerRanks()". + * - For devices with sequencer not fully configurable + * (function "LL_ADC_REG_SetSequencerChannels()" available): + * sequencer length and each rank affectation to a channel + * are defined by channel number. + * This function retrieves: + * - Sequence length: Number of ranks in the scan sequence is + * defined by number of channels set in the sequence, + * rank of each channel is fixed by channel HW number. + * (channel 0 fixed on rank 0, channel 1 fixed on rank1, ...). + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from lowest channel number to + * highest channel number). + * Sequencer ranks are selected using + * function "LL_ADC_REG_SetSequencerChannels()". + * @note Sequencer disabled is equivalent to sequencer of 1 rank: + * ADC conversion on only 1 channel. + * @rmtoll SQR1 L LL_ADC_REG_GetSequencerLength + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_4RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_5RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_6RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_7RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_8RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_9RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_10RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_11RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_12RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_13RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_14RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_15RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_16RANKS + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetSequencerLength(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->SQR1, ADC_SQR1_L)); +} + +/** + * @brief Set ADC group regular sequencer discontinuous mode: + * sequence subdivided and scan conversions interrupted every selected + * number of ranks. + * @note It is not possible to enable both ADC group regular + * continuous mode and sequencer discontinuous mode. + * @note It is not possible to enable both ADC auto-injected mode + * and ADC group regular sequencer discontinuous mode. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on group regular. + * @rmtoll CFGR DISCEN LL_ADC_REG_SetSequencerDiscont\n + * CFGR DISCNUM LL_ADC_REG_SetSequencerDiscont + * @param ADCx ADC instance + * @param SeqDiscont This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_SEQ_DISCONT_DISABLE + * @arg @ref LL_ADC_REG_SEQ_DISCONT_1RANK + * @arg @ref LL_ADC_REG_SEQ_DISCONT_2RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_3RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_4RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_5RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_6RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_7RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_8RANKS + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetSequencerDiscont(ADC_TypeDef *ADCx, uint32_t SeqDiscont) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_DISCEN | ADC_CFGR_DISCNUM, SeqDiscont); +} + +/** + * @brief Get ADC group regular sequencer discontinuous mode: + * sequence subdivided and scan conversions interrupted every selected + * number of ranks. + * @rmtoll CFGR DISCEN LL_ADC_REG_GetSequencerDiscont\n + * CFGR DISCNUM LL_ADC_REG_GetSequencerDiscont + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_SEQ_DISCONT_DISABLE + * @arg @ref LL_ADC_REG_SEQ_DISCONT_1RANK + * @arg @ref LL_ADC_REG_SEQ_DISCONT_2RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_3RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_4RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_5RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_6RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_7RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_8RANKS + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetSequencerDiscont(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_DISCEN | ADC_CFGR_DISCNUM)); +} + +/** + * @brief Set ADC group regular sequence: channel on the selected + * scan sequence rank. + * @note This function performs configuration of: + * - Channels ordering into each rank of scan sequence: + * whatever channel can be placed into whatever rank. + * @note On this STM32 series, ADC group regular sequencer is + * fully configurable: sequencer length and each rank + * affectation to a channel are configurable. + * Refer to description of function @ref LL_ADC_REG_SetSequencerLength(). + * @note Depending on devices and packages, some channels may not be available. + * Refer to device datasheet for channels availability. + * @note On this STM32 series, to measure internal channels (VrefInt, + * TempSensor, ...), measurement paths to internal channels must be + * enabled separately. + * This can be done using function @ref LL_ADC_SetCommonPathInternalCh(). + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on group regular. + * @rmtoll SQR1 SQ1 LL_ADC_REG_SetSequencerRanks\n + * SQR1 SQ2 LL_ADC_REG_SetSequencerRanks\n + * SQR1 SQ3 LL_ADC_REG_SetSequencerRanks\n + * SQR1 SQ4 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ5 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ6 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ7 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ8 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ9 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ10 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ11 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ12 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ13 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ14 LL_ADC_REG_SetSequencerRanks\n + * SQR4 SQ15 LL_ADC_REG_SetSequencerRanks\n + * SQR4 SQ16 LL_ADC_REG_SetSequencerRanks + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_RANK_1 + * @arg @ref LL_ADC_REG_RANK_2 + * @arg @ref LL_ADC_REG_RANK_3 + * @arg @ref LL_ADC_REG_RANK_4 + * @arg @ref LL_ADC_REG_RANK_5 + * @arg @ref LL_ADC_REG_RANK_6 + * @arg @ref LL_ADC_REG_RANK_7 + * @arg @ref LL_ADC_REG_RANK_8 + * @arg @ref LL_ADC_REG_RANK_9 + * @arg @ref LL_ADC_REG_RANK_10 + * @arg @ref LL_ADC_REG_RANK_11 + * @arg @ref LL_ADC_REG_RANK_12 + * @arg @ref LL_ADC_REG_RANK_13 + * @arg @ref LL_ADC_REG_RANK_14 + * @arg @ref LL_ADC_REG_RANK_15 + * @arg @ref LL_ADC_REG_RANK_16 + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank, uint32_t Channel) +{ + /* Set bits with content of parameter "Channel" with bits position */ + /* in register and register position depending on parameter "Rank". */ + /* Parameters "Rank" and "Channel" are used with masks because containing */ + /* other bits reserved for other purpose. */ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SQR1, __ADC_MASK_SHIFT(Rank, ADC_REG_SQRX_REGOFFSET_MASK)); + + MODIFY_REG(*preg, + ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0 << (Rank & ADC_REG_RANK_ID_SQRX_MASK), + ((Channel & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) << (Rank & ADC_REG_RANK_ID_SQRX_MASK)); +} + +/** + * @brief Get ADC group regular sequence: channel on the selected + * scan sequence rank. + * @note On this STM32 series, ADC group regular sequencer is + * fully configurable: sequencer length and each rank + * affectation to a channel are configurable. + * Refer to description of function @ref LL_ADC_REG_SetSequencerLength(). + * @note Depending on devices and packages, some channels may not be available. + * Refer to device datasheet for channels availability. + * @note Usage of the returned channel number: + * - To reinject this channel into another function LL_ADC_xxx: + * the returned channel number is only partly formatted on definition + * of literals LL_ADC_CHANNEL_x. Therefore, it has to be compared + * with parts of literals LL_ADC_CHANNEL_x or using + * helper macro @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Then the selected literal LL_ADC_CHANNEL_x can be used + * as parameter for another function. + * - To get the channel number in decimal format: + * process the returned value with the helper macro + * @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * @rmtoll SQR1 SQ1 LL_ADC_REG_GetSequencerRanks\n + * SQR1 SQ2 LL_ADC_REG_GetSequencerRanks\n + * SQR1 SQ3 LL_ADC_REG_GetSequencerRanks\n + * SQR1 SQ4 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ5 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ6 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ7 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ8 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ9 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ10 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ11 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ12 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ13 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ14 LL_ADC_REG_GetSequencerRanks\n + * SQR4 SQ15 LL_ADC_REG_GetSequencerRanks\n + * SQR4 SQ16 LL_ADC_REG_GetSequencerRanks + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_RANK_1 + * @arg @ref LL_ADC_REG_RANK_2 + * @arg @ref LL_ADC_REG_RANK_3 + * @arg @ref LL_ADC_REG_RANK_4 + * @arg @ref LL_ADC_REG_RANK_5 + * @arg @ref LL_ADC_REG_RANK_6 + * @arg @ref LL_ADC_REG_RANK_7 + * @arg @ref LL_ADC_REG_RANK_8 + * @arg @ref LL_ADC_REG_RANK_9 + * @arg @ref LL_ADC_REG_RANK_10 + * @arg @ref LL_ADC_REG_RANK_11 + * @arg @ref LL_ADC_REG_RANK_12 + * @arg @ref LL_ADC_REG_RANK_13 + * @arg @ref LL_ADC_REG_RANK_14 + * @arg @ref LL_ADC_REG_RANK_15 + * @arg @ref LL_ADC_REG_RANK_16 + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time.\n + * (1, 2, 3, 4, 5) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SQR1, __ADC_MASK_SHIFT(Rank, ADC_REG_SQRX_REGOFFSET_MASK)); + + return (uint32_t) ((READ_BIT(*preg, + ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0 << (Rank & ADC_REG_RANK_ID_SQRX_MASK)) + >> (Rank & ADC_REG_RANK_ID_SQRX_MASK)) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS + ); +} + +/** + * @brief Set ADC continuous conversion mode on ADC group regular. + * @note Description of ADC continuous conversion mode: + * - single mode: one conversion per trigger + * - continuous mode: after the first trigger, following + * conversions launched successively automatically. + * @note It is not possible to enable both ADC group regular + * continuous mode and sequencer discontinuous mode. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on group regular. + * @rmtoll CFGR CONT LL_ADC_REG_SetContinuousMode + * @param ADCx ADC instance + * @param Continuous This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_CONV_SINGLE + * @arg @ref LL_ADC_REG_CONV_CONTINUOUS + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetContinuousMode(ADC_TypeDef *ADCx, uint32_t Continuous) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_CONT, Continuous); +} + +/** + * @brief Get ADC continuous conversion mode on ADC group regular. + * @note Description of ADC continuous conversion mode: + * - single mode: one conversion per trigger + * - continuous mode: after the first trigger, following + * conversions launched successively automatically. + * @rmtoll CFGR CONT LL_ADC_REG_GetContinuousMode + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_CONV_SINGLE + * @arg @ref LL_ADC_REG_CONV_CONTINUOUS + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetContinuousMode(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_CONT)); +} + +/** + * @brief Set ADC group regular conversion data transfer: no transfer or + * transfer by DMA, and DMA requests mode. + * @note If transfer by DMA selected, specifies the DMA requests + * mode: + * - Limited mode (One shot mode): DMA transfer requests are stopped + * when number of DMA data transfers (number of + * ADC conversions) is reached. + * This ADC mode is intended to be used with DMA mode non-circular. + * - Unlimited mode: DMA transfer requests are unlimited, + * whatever number of DMA data transfers (number of + * ADC conversions). + * This ADC mode is intended to be used with DMA mode circular. + * @note If ADC DMA requests mode is set to unlimited and DMA is set to + * mode non-circular: + * when DMA transfers size will be reached, DMA will stop transfers of + * ADC conversions data ADC will raise an overrun error + * (overrun flag and interruption if enabled). + * @note For devices with several ADC instances: ADC multimode DMA + * settings are available using function @ref LL_ADC_SetMultiDMATransfer(). + * @note To configure DMA source address (peripheral address), + * use function @ref LL_ADC_DMA_GetRegAddr(). + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CFGR DMAEN LL_ADC_REG_SetDMATransfer\n + * CFGR DMACFG LL_ADC_REG_SetDMATransfer + * @param ADCx ADC instance + * @param DMATransfer This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_DMA_TRANSFER_NONE + * @arg @ref LL_ADC_REG_DMA_TRANSFER_LIMITED + * @arg @ref LL_ADC_REG_DMA_TRANSFER_UNLIMITED + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetDMATransfer(ADC_TypeDef *ADCx, uint32_t DMATransfer) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_DMAEN | ADC_CFGR_DMACFG, DMATransfer); +} + +/** + * @brief Get ADC group regular conversion data transfer: no transfer or + * transfer by DMA, and DMA requests mode. + * @note If transfer by DMA selected, specifies the DMA requests + * mode: + * - Limited mode (One shot mode): DMA transfer requests are stopped + * when number of DMA data transfers (number of + * ADC conversions) is reached. + * This ADC mode is intended to be used with DMA mode non-circular. + * - Unlimited mode: DMA transfer requests are unlimited, + * whatever number of DMA data transfers (number of + * ADC conversions). + * This ADC mode is intended to be used with DMA mode circular. + * @note If ADC DMA requests mode is set to unlimited and DMA is set to + * mode non-circular: + * when DMA transfers size will be reached, DMA will stop transfers of + * ADC conversions data ADC will raise an overrun error + * (overrun flag and interruption if enabled). + * @note For devices with several ADC instances: ADC multimode DMA + * settings are available using function @ref LL_ADC_GetMultiDMATransfer(). + * @note To configure DMA source address (peripheral address), + * use function @ref LL_ADC_DMA_GetRegAddr(). + * @rmtoll CFGR DMAEN LL_ADC_REG_GetDMATransfer\n + * CFGR DMACFG LL_ADC_REG_GetDMATransfer + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_DMA_TRANSFER_NONE + * @arg @ref LL_ADC_REG_DMA_TRANSFER_LIMITED + * @arg @ref LL_ADC_REG_DMA_TRANSFER_UNLIMITED + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetDMATransfer(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_DMAEN | ADC_CFGR_DMACFG)); +} + +/** + * @brief Set ADC group regular behavior in case of overrun: + * data preserved or overwritten. + * @note Compatibility with devices without feature overrun: + * other devices without this feature have a behavior + * equivalent to data overwritten. + * The default setting of overrun is data preserved. + * Therefore, for compatibility with all devices, parameter + * overrun should be set to data overwritten. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on group regular. + * @rmtoll CFGR OVRMOD LL_ADC_REG_SetOverrun + * @param ADCx ADC instance + * @param Overrun This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_OVR_DATA_PRESERVED + * @arg @ref LL_ADC_REG_OVR_DATA_OVERWRITTEN + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetOverrun(ADC_TypeDef *ADCx, uint32_t Overrun) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_OVRMOD, Overrun); +} + +/** + * @brief Get ADC group regular behavior in case of overrun: + * data preserved or overwritten. + * @rmtoll CFGR OVRMOD LL_ADC_REG_GetOverrun + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_OVR_DATA_PRESERVED + * @arg @ref LL_ADC_REG_OVR_DATA_OVERWRITTEN + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetOverrun(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_OVRMOD)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Group_Injected Configuration of ADC hierarchical scope: group injected + * @{ + */ + +/** + * @brief Set ADC group injected conversion trigger source: + * internal (SW start) or from external IP (timer event, + * external interrupt line). + * @note On this STM32 series, setting trigger source to external trigger + * also set trigger polarity to rising edge + * (default setting for compatibility with some ADC on other + * STM32 families having this setting set by HW default value). + * In case of need to modify trigger edge, use + * function @ref LL_ADC_INJ_SetTriggerEdge(). + * @note Caution to ADC group injected contexts queue: On this STM32 series, + * using successively several times this function will appear has + * having no effect. + * This is due to ADC group injected contexts queue (this feature + * cannot be disabled on this STM32 series). + * To set several features of ADC group injected, use + * function @ref LL_ADC_INJ_ConfigQueueContext(). + * @note Availability of parameters of trigger sources from timer + * depends on timers availability on the selected device. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must not be disabled. Can be enabled with or without conversion + * on going on either groups regular or injected. + * @rmtoll JSQR JEXTSEL LL_ADC_INJ_SetTriggerSource\n + * JSQR JEXTEN LL_ADC_INJ_SetTriggerSource + * @param ADCx ADC instance + * @param TriggerSource This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_SOFTWARE + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_CH3_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_CH4 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_CH1 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_CH1_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_TRGO (1)(2)(3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH1 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH1_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH3 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH3_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH4 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH4_ADC12 (1)(2)(3)(4)(5) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO (3) (5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_CH3_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_CH4_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM6_TRGO (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM6_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM7_TRGO_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_TRGO (1)(2) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_TRGO2 (1)(2) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH2_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH4_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH4__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM15_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRGO_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRGO2_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_CH4_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRG_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRG2_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_CH2_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_HRTIM_TRG2 (4) + * @arg @ref LL_ADC_INJ_TRIG_EXT_HRTIM_TRG4 (4) + * @arg @ref LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 (3)(4)(5)(6) + * @arg @ref LL_ADC_INJ_TRIG_EXT_EXTI_LINE15_ADC12 (1)(2) (7) + * + * (1) On STM32F3, parameter not available on all devices: among others, on STM32F303xE, STM32F398xx.\n + * (2) On STM32F3, parameter not available on all devices: among others, on STM32F303xC, STM32F358xx.\n + * (3) On STM32F3, parameter not available on all devices: among others, on STM32F303x8, STM32F328xx.\n + * (4) On STM32F3, parameter not available on all devices: among others, on STM32F334x8.\n + * (5) On STM32F3, parameter not available on all devices: among others, on STM32F302xC, STM32F302xE.\n + * (6) On STM32F3, parameter not available on all devices: among others, on STM32F301x8, STM32F302x8, STM32F318xx.\n + * (7) On STM32F3, parameter not available on all ADC instances: ADC1, ADC2 (for ADC instances ADCx available on the selected device).\n + * (8) On STM32F3, parameter not available on all ADC instances: ADC3, ADC4 (for ADC instances ADCx available on the selected device). + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetTriggerSource(ADC_TypeDef *ADCx, uint32_t TriggerSource) +{ + MODIFY_REG(ADCx->JSQR, ADC_JSQR_JEXTSEL | ADC_JSQR_JEXTEN, TriggerSource); +} + +/** + * @brief Get ADC group injected conversion trigger source: + * internal (SW start) or from external IP (timer event, + * external interrupt line). + * @note To determine whether group injected trigger source is + * internal (SW start) or external, without detail + * of which peripheral is selected as external trigger, + * (equivalent to + * "if(LL_ADC_INJ_GetTriggerSource(ADC1) == LL_ADC_INJ_TRIG_SOFTWARE)") + * use function @ref LL_ADC_INJ_IsTriggerSourceSWStart. + * @note Availability of parameters of trigger sources from timer + * depends on timers availability on the selected device. + * @rmtoll JSQR JEXTSEL LL_ADC_INJ_GetTriggerSource\n + * JSQR JEXTEN LL_ADC_INJ_GetTriggerSource + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_SOFTWARE + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_CH3_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_CH4 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_CH1 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_CH1_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_TRGO (1)(2)(3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH1 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH1_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH3 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH3_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH4 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH4_ADC12 (1)(2)(3)(4)(5) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO (3) (5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_CH3_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_CH4_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM6_TRGO (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM6_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM7_TRGO_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_TRGO (1)(2) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_TRGO2 (1)(2) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH2_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH4_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH4__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM15_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRGO_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRGO2_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_CH4_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRG_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRG2_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_CH2_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_HRTIM_TRG2 (4) + * @arg @ref LL_ADC_INJ_TRIG_EXT_HRTIM_TRG4 (4) + * @arg @ref LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 (3)(4)(5)(6) + * @arg @ref LL_ADC_INJ_TRIG_EXT_EXTI_LINE15_ADC12 (1)(2) (7) + * + * (1) On STM32F3, parameter not available on all devices: among others, on STM32F303xE, STM32F398xx.\n + * (2) On STM32F3, parameter not available on all devices: among others, on STM32F303xC, STM32F358xx.\n + * (3) On STM32F3, parameter not available on all devices: among others, on STM32F303x8, STM32F328xx.\n + * (4) On STM32F3, parameter not available on all devices: among others, on STM32F334x8.\n + * (5) On STM32F3, parameter not available on all devices: among others, on STM32F302xC, STM32F302xE.\n + * (6) On STM32F3, parameter not available on all devices: among others, on STM32F301x8, STM32F302x8, STM32F318xx.\n + * (7) On STM32F3, parameter not available on all ADC instances: ADC1, ADC2 (for ADC instances ADCx available on the selected device).\n + * (8) On STM32F3, parameter not available on all ADC instances: ADC3, ADC4 (for ADC instances ADCx available on the selected device). + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerSource(ADC_TypeDef *ADCx) +{ + uint32_t TriggerSource = READ_BIT(ADCx->JSQR, ADC_JSQR_JEXTSEL | ADC_JSQR_JEXTEN); + + /* Value for shift of {0; 4; 8; 12} depending on value of bitfield */ + /* corresponding to ADC_JSQR_JEXTEN {0; 1; 2; 3}. */ + uint32_t ShiftJexten = ((TriggerSource & ADC_JSQR_JEXTEN) >> (ADC_INJ_TRIG_EXTEN_BITOFFSET_POS - 2U)); + + /* Set bitfield corresponding to ADC_JSQR_JEXTEN and ADC_JSQR_JEXTSEL */ + /* to match with triggers literals definition. */ + return ((TriggerSource + & (ADC_INJ_TRIG_SOURCE_MASK >> ShiftJexten) & ADC_JSQR_JEXTSEL) + | ((ADC_INJ_TRIG_EDGE_MASK >> ShiftJexten) & ADC_JSQR_JEXTEN) + ); +} + +/** + * @brief Get ADC group injected conversion trigger source internal (SW start) + or external + * @note In case of group injected trigger source set to external trigger, + * to determine which peripheral is selected as external trigger, + * use function @ref LL_ADC_INJ_GetTriggerSource. + * @rmtoll JSQR JEXTEN LL_ADC_INJ_IsTriggerSourceSWStart + * @param ADCx ADC instance + * @retval Value "0" if trigger source external trigger + * Value "1" if trigger source SW start. + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_IsTriggerSourceSWStart(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->JSQR, ADC_JSQR_JEXTEN) == (LL_ADC_INJ_TRIG_SOFTWARE & ADC_JSQR_JEXTEN)); +} + +/** + * @brief Set ADC group injected conversion trigger polarity. + * Applicable only for trigger source set to external trigger. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must not be disabled. Can be enabled with or without conversion + * on going on either groups regular or injected. + * @rmtoll JSQR JEXTEN LL_ADC_INJ_SetTriggerEdge + * @param ADCx ADC instance + * @param ExternalTriggerEdge This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_EXT_RISING + * @arg @ref LL_ADC_INJ_TRIG_EXT_FALLING + * @arg @ref LL_ADC_INJ_TRIG_EXT_RISINGFALLING + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetTriggerEdge(ADC_TypeDef *ADCx, uint32_t ExternalTriggerEdge) +{ + MODIFY_REG(ADCx->JSQR, ADC_JSQR_JEXTEN, ExternalTriggerEdge); +} + +/** + * @brief Get ADC group injected conversion trigger polarity. + * Applicable only for trigger source set to external trigger. + * @rmtoll JSQR JEXTEN LL_ADC_INJ_GetTriggerEdge + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_EXT_RISING + * @arg @ref LL_ADC_INJ_TRIG_EXT_FALLING + * @arg @ref LL_ADC_INJ_TRIG_EXT_RISINGFALLING + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerEdge(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->JSQR, ADC_JSQR_JEXTEN)); +} + +/** + * @brief Set ADC group injected sequencer length and scan direction. + * @note This function performs configuration of: + * - Sequence length: Number of ranks in the scan sequence. + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from rank 1 to rank n). + * @note Sequencer disabled is equivalent to sequencer of 1 rank: + * ADC conversion on only 1 channel. + * @note Caution to ADC group injected contexts queue: On this STM32 series, + * using successively several times this function will appear has + * having no effect. + * This is due to ADC group injected contexts queue (this feature + * cannot be disabled on this STM32 series). + * To set several features of ADC group injected, use + * function @ref LL_ADC_INJ_ConfigQueueContext(). + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must not be disabled. Can be enabled with or without conversion + * on going on either groups regular or injected. + * @rmtoll JSQR JL LL_ADC_INJ_SetSequencerLength + * @param ADCx ADC instance + * @param SequencerNbRanks This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetSequencerLength(ADC_TypeDef *ADCx, uint32_t SequencerNbRanks) +{ + MODIFY_REG(ADCx->JSQR, ADC_JSQR_JL, SequencerNbRanks); +} + +/** + * @brief Get ADC group injected sequencer length and scan direction. + * @note This function retrieves: + * - Sequence length: Number of ranks in the scan sequence. + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from rank 1 to rank n). + * @note Sequencer disabled is equivalent to sequencer of 1 rank: + * ADC conversion on only 1 channel. + * @rmtoll JSQR JL LL_ADC_INJ_GetSequencerLength + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerLength(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->JSQR, ADC_JSQR_JL)); +} + +/** + * @brief Set ADC group injected sequencer discontinuous mode: + * sequence subdivided and scan conversions interrupted every selected + * number of ranks. + * @note It is not possible to enable both ADC group injected + * auto-injected mode and sequencer discontinuous mode. + * @rmtoll CFGR JDISCEN LL_ADC_INJ_SetSequencerDiscont + * @param ADCx ADC instance + * @param SeqDiscont This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_DISCONT_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_DISCONT_1RANK + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetSequencerDiscont(ADC_TypeDef *ADCx, uint32_t SeqDiscont) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_JDISCEN, SeqDiscont); +} + +/** + * @brief Get ADC group injected sequencer discontinuous mode: + * sequence subdivided and scan conversions interrupted every selected + * number of ranks. + * @rmtoll CFGR JDISCEN LL_ADC_INJ_GetSequencerDiscont + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_DISCONT_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_DISCONT_1RANK + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerDiscont(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_JDISCEN)); +} + +/** + * @brief Set ADC group injected sequence: channel on the selected + * sequence rank. + * @note Depending on devices and packages, some channels may not be available. + * Refer to device datasheet for channels availability. + * @note On this STM32 series, to measure internal channels (VrefInt, + * TempSensor, ...), measurement paths to internal channels must be + * enabled separately. + * This can be done using function @ref LL_ADC_SetCommonPathInternalCh(). + * @note Caution to ADC group injected contexts queue: On this STM32 series, + * using successively several times this function will appear has + * having no effect. + * This is due to ADC group injected contexts queue (this feature + * cannot be disabled on this STM32 series). + * To set several features of ADC group injected, use + * function @ref LL_ADC_INJ_ConfigQueueContext(). + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must not be disabled. Can be enabled with or without conversion + * on going on either groups regular or injected. + * @rmtoll JSQR JSQ1 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ2 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ3 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ4 LL_ADC_INJ_SetSequencerRanks + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank, uint32_t Channel) +{ + /* Set bits with content of parameter "Channel" with bits position */ + /* in register depending on parameter "Rank". */ + /* Parameters "Rank" and "Channel" are used with masks because containing */ + /* other bits reserved for other purpose. */ + MODIFY_REG(ADCx->JSQR, + (ADC_CHANNEL_ID_NUMBER_MASK >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) << (Rank & ADC_INJ_RANK_ID_JSQR_MASK), + ((Channel & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) << (Rank & ADC_INJ_RANK_ID_JSQR_MASK)); +} + +/** + * @brief Get ADC group injected sequence: channel on the selected + * sequence rank. + * @note Depending on devices and packages, some channels may not be available. + * Refer to device datasheet for channels availability. + * @note Usage of the returned channel number: + * - To reinject this channel into another function LL_ADC_xxx: + * the returned channel number is only partly formatted on definition + * of literals LL_ADC_CHANNEL_x. Therefore, it has to be compared + * with parts of literals LL_ADC_CHANNEL_x or using + * helper macro @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Then the selected literal LL_ADC_CHANNEL_x can be used + * as parameter for another function. + * - To get the channel number in decimal format: + * process the returned value with the helper macro + * @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * @rmtoll JSQR JSQ1 LL_ADC_INJ_GetSequencerRanks\n + * JSQR JSQ2 LL_ADC_INJ_GetSequencerRanks\n + * JSQR JSQ3 LL_ADC_INJ_GetSequencerRanks\n + * JSQR JSQ4 LL_ADC_INJ_GetSequencerRanks + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time.\n + * (1, 2, 3, 4, 5) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank) +{ + return (uint32_t)((READ_BIT(ADCx->JSQR, + (ADC_CHANNEL_ID_NUMBER_MASK >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) << (Rank & ADC_INJ_RANK_ID_JSQR_MASK)) + >> (Rank & ADC_INJ_RANK_ID_JSQR_MASK)) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS + ); +} + +/** + * @brief Set ADC group injected conversion trigger: + * independent or from ADC group regular. + * @note This mode can be used to extend number of data registers + * updated after one ADC conversion trigger and with data + * permanently kept (not erased by successive conversions of scan of + * ADC sequencer ranks), up to 5 data registers: + * 1 data register on ADC group regular, 4 data registers + * on ADC group injected. + * @note If ADC group injected injected trigger source is set to an + * external trigger, this feature must be must be set to + * independent trigger. + * ADC group injected automatic trigger is compliant only with + * group injected trigger source set to SW start, without any + * further action on ADC group injected conversion start or stop: + * in this case, ADC group injected is controlled only + * from ADC group regular. + * @note It is not possible to enable both ADC group injected + * auto-injected mode and sequencer discontinuous mode. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CFGR JAUTO LL_ADC_INJ_SetTrigAuto + * @param ADCx ADC instance + * @param TrigAuto This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_INDEPENDENT + * @arg @ref LL_ADC_INJ_TRIG_FROM_GRP_REGULAR + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetTrigAuto(ADC_TypeDef *ADCx, uint32_t TrigAuto) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_JAUTO, TrigAuto); +} + +/** + * @brief Get ADC group injected conversion trigger: + * independent or from ADC group regular. + * @rmtoll CFGR JAUTO LL_ADC_INJ_GetTrigAuto + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_INDEPENDENT + * @arg @ref LL_ADC_INJ_TRIG_FROM_GRP_REGULAR + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetTrigAuto(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_JAUTO)); +} + +/** + * @brief Set ADC group injected contexts queue mode. + * @note A context is a setting of group injected sequencer: + * - group injected trigger + * - sequencer length + * - sequencer ranks + * If contexts queue is disabled: + * - only 1 sequence can be configured + * and is active perpetually. + * If contexts queue is enabled: + * - up to 2 contexts can be queued + * and are checked in and out as a FIFO stack (first-in, first-out). + * - If a new context is set when queues is full, error is triggered + * by interruption "Injected Queue Overflow". + * - Two behaviors are possible when all contexts have been processed: + * the contexts queue can maintain the last context active perpetually + * or can be empty and injected group triggers are disabled. + * - Triggers can be only external (not internal SW start) + * - Caution: The sequence must be fully configured in one time + * (one write of register JSQR makes a check-in of a new context + * into the queue). + * Therefore functions to set separately injected trigger and + * sequencer channels cannot be used, register JSQR must be set + * using function @ref LL_ADC_INJ_ConfigQueueContext(). + * @note This parameter can be modified only when no conversion is on going + * on either groups regular or injected. + * @note A modification of the context mode (bit JQDIS) causes the contexts + * queue to be flushed and the register JSQR is cleared. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CFGR JQM LL_ADC_INJ_SetQueueMode + * @param ADCx ADC instance + * @param QueueMode This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_QUEUE_2CONTEXTS_LAST_ACTIVE + * @arg @ref LL_ADC_INJ_QUEUE_2CONTEXTS_END_EMPTY + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetQueueMode(ADC_TypeDef *ADCx, uint32_t QueueMode) +{ + MODIFY_REG(ADCx->CFGR, ADC_CFGR_JQM, QueueMode); +} + +/** + * @brief Get ADC group injected context queue mode. + * @rmtoll CFGR JQM LL_ADC_INJ_GetQueueMode + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_QUEUE_2CONTEXTS_LAST_ACTIVE + * @arg @ref LL_ADC_INJ_QUEUE_2CONTEXTS_END_EMPTY + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetQueueMode(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CFGR, ADC_CFGR_JQM)); +} + +/** + * @brief Set one context on ADC group injected that will be checked in + * contexts queue. + * @note A context is a setting of group injected sequencer: + * - group injected trigger + * - sequencer length + * - sequencer ranks + * This function is intended to be used when contexts queue is enabled, + * because the sequence must be fully configured in one time + * (functions to set separately injected trigger and sequencer channels + * cannot be used): + * Refer to function @ref LL_ADC_INJ_SetQueueMode(). + * @note In the contexts queue, only the active context can be read. + * The parameters of this function can be read using functions: + * @arg @ref LL_ADC_INJ_GetTriggerSource() + * @arg @ref LL_ADC_INJ_GetTriggerEdge() + * @arg @ref LL_ADC_INJ_GetSequencerRanks() + * @note On this STM32 series, to measure internal channels (VrefInt, + * TempSensor, ...), measurement paths to internal channels must be + * enabled separately. + * This can be done using function @ref LL_ADC_SetCommonPathInternalCh(). + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must not be disabled. Can be enabled with or without conversion + * on going on either groups regular or injected. + * @rmtoll JSQR JEXTSEL LL_ADC_INJ_ConfigQueueContext\n + * JSQR JEXTEN LL_ADC_INJ_ConfigQueueContext\n + * JSQR JL LL_ADC_INJ_ConfigQueueContext\n + * JSQR JSQ1 LL_ADC_INJ_ConfigQueueContext\n + * JSQR JSQ2 LL_ADC_INJ_ConfigQueueContext\n + * JSQR JSQ3 LL_ADC_INJ_ConfigQueueContext\n + * JSQR JSQ4 LL_ADC_INJ_ConfigQueueContext + * @param ADCx ADC instance + * @param TriggerSource This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_SOFTWARE + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_TRGO2 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_CH3_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM1_CH4 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_CH1 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_CH1_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_TRGO (1)(2)(3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH1 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH1_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH3 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH3_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH4 (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH4_ADC12 (1)(2)(3)(4)(5) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO (3) (5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_CH3_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_CH4_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM6_TRGO (3)(4)(5) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM6_TRGO_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM7_TRGO_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_TRGO (1)(2) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_TRGO2 (1)(2) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH2_ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH4_ADC12 (1)(2) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM8_CH4__ADC34 (1)(2) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM15_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRGO_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRGO2_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_CH4_ADC12 (1) (7) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRG_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_TRG2_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM20_CH2_ADC34 (1) (8) + * @arg @ref LL_ADC_INJ_TRIG_EXT_HRTIM_TRG2 (4) + * @arg @ref LL_ADC_INJ_TRIG_EXT_HRTIM_TRG4 (4) + * @arg @ref LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 (3)(4)(5)(6) + * @arg @ref LL_ADC_INJ_TRIG_EXT_EXTI_LINE15_ADC12 (1)(2) (7) + * + * (1) On STM32F3, parameter not available on all devices: among others, on STM32F303xE, STM32F398xx.\n + * (2) On STM32F3, parameter not available on all devices: among others, on STM32F303xC, STM32F358xx.\n + * (3) On STM32F3, parameter not available on all devices: among others, on STM32F303x8, STM32F328xx.\n + * (4) On STM32F3, parameter not available on all devices: among others, on STM32F334x8.\n + * (5) On STM32F3, parameter not available on all devices: among others, on STM32F302xC, STM32F302xE.\n + * (6) On STM32F3, parameter not available on all devices: among others, on STM32F301x8, STM32F302x8, STM32F318xx.\n + * (7) On STM32F3, parameter not available on all ADC instances: ADC1, ADC2 (for ADC instances ADCx available on the selected device).\n + * (8) On STM32F3, parameter not available on all ADC instances: ADC3, ADC4 (for ADC instances ADCx available on the selected device). + * @param ExternalTriggerEdge This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_EXT_RISING + * @arg @ref LL_ADC_INJ_TRIG_EXT_FALLING + * @arg @ref LL_ADC_INJ_TRIG_EXT_RISINGFALLING + * + * Note: This parameter is discarded in case of SW start: + * parameter "TriggerSource" set to "LL_ADC_INJ_TRIG_SOFTWARE". + * @param SequencerNbRanks This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS + * @param Rank1_Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @param Rank2_Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @param Rank3_Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @param Rank4_Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_ConfigQueueContext(ADC_TypeDef *ADCx, + uint32_t TriggerSource, + uint32_t ExternalTriggerEdge, + uint32_t SequencerNbRanks, + uint32_t Rank1_Channel, + uint32_t Rank2_Channel, + uint32_t Rank3_Channel, + uint32_t Rank4_Channel) +{ + /* Set bits with content of parameter "Rankx_Channel" with bits position */ + /* in register depending on literal "LL_ADC_INJ_RANK_x". */ + /* Parameters "Rankx_Channel" and "LL_ADC_INJ_RANK_x" are used with masks */ + /* because containing other bits reserved for other purpose. */ + /* If parameter "TriggerSource" is set to SW start, then parameter */ + /* "ExternalTriggerEdge" is discarded. */ + MODIFY_REG(ADCx->JSQR , + ADC_JSQR_JEXTSEL | + ADC_JSQR_JEXTEN | + ADC_JSQR_JSQ4 | + ADC_JSQR_JSQ3 | + ADC_JSQR_JSQ2 | + ADC_JSQR_JSQ1 | + ADC_JSQR_JL , + TriggerSource | + (ExternalTriggerEdge * ((TriggerSource != LL_ADC_INJ_TRIG_SOFTWARE))) | + ((Rank4_Channel & ADC_CHANNEL_ID_NUMBER_MASK) >> (ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS - (LL_ADC_INJ_RANK_4 & ADC_INJ_RANK_ID_JSQR_MASK))) | + ((Rank3_Channel & ADC_CHANNEL_ID_NUMBER_MASK) >> (ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS - (LL_ADC_INJ_RANK_3 & ADC_INJ_RANK_ID_JSQR_MASK))) | + ((Rank2_Channel & ADC_CHANNEL_ID_NUMBER_MASK) >> (ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS - (LL_ADC_INJ_RANK_2 & ADC_INJ_RANK_ID_JSQR_MASK))) | + ((Rank1_Channel & ADC_CHANNEL_ID_NUMBER_MASK) >> (ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS - (LL_ADC_INJ_RANK_1 & ADC_INJ_RANK_ID_JSQR_MASK))) | + SequencerNbRanks + ); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_Channels Configuration of ADC hierarchical scope: channels + * @{ + */ + +/** + * @brief Set sampling time of the selected ADC channel + * Unit: ADC clock cycles. + * @note On this device, sampling time is on channel scope: independently + * of channel mapped on ADC group regular or injected. + * @note In case of internal channel (VrefInt, TempSensor, ...) to be + * converted: + * sampling time constraints must be respected (sampling time can be + * adjusted in function of ADC clock frequency and sampling time + * setting). + * Refer to device datasheet for timings values (parameters TS_vrefint, + * TS_temp, ...). + * @note Conversion time is the addition of sampling time and processing time. + * On this STM32 series, ADC processing time is: + * - 12.5 ADC clock cycles at ADC resolution 12 bits + * - 10.5 ADC clock cycles at ADC resolution 10 bits + * - 8.5 ADC clock cycles at ADC resolution 8 bits + * - 6.5 ADC clock cycles at ADC resolution 6 bits + * @note In case of ADC conversion of internal channel (VrefInt, + * temperature sensor, ...), a sampling time minimum value + * is required. + * Refer to device datasheet. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll SMPR1 SMP0 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP1 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP2 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP3 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP4 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP5 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP6 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP7 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP8 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP9 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP10 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP11 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP12 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP13 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP14 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP15 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP16 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP17 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP18 LL_ADC_SetChannelSamplingTime + * @param ADCx ADC instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @param SamplingTime This parameter can be one of the following values: + * @arg @ref LL_ADC_SAMPLINGTIME_1CYCLE_5 + * @arg @ref LL_ADC_SAMPLINGTIME_2CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_4CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_7CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_19CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_61CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_181CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_601CYCLES_5 + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetChannelSamplingTime(ADC_TypeDef *ADCx, uint32_t Channel, uint32_t SamplingTime) +{ + /* Set bits with content of parameter "SamplingTime" with bits position */ + /* in register and register position depending on parameter "Channel". */ + /* Parameter "Channel" is used with masks because containing */ + /* other bits reserved for other purpose. */ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SMPR1, __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPRX_REGOFFSET_MASK)); + + MODIFY_REG(*preg, + ADC_SMPR1_SMP0 << __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPx_BITOFFSET_MASK), + SamplingTime << __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPx_BITOFFSET_MASK)); +} + +/** + * @brief Get sampling time of the selected ADC channel + * Unit: ADC clock cycles. + * @note On this device, sampling time is on channel scope: independently + * of channel mapped on ADC group regular or injected. + * @note Conversion time is the addition of sampling time and processing time. + * On this STM32 series, ADC processing time is: + * - 12.5 ADC clock cycles at ADC resolution 12 bits + * - 10.5 ADC clock cycles at ADC resolution 10 bits + * - 8.5 ADC clock cycles at ADC resolution 8 bits + * - 6.5 ADC clock cycles at ADC resolution 6 bits + * @rmtoll SMPR1 SMP0 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP1 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP2 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP3 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP4 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP5 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP6 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP7 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP8 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP9 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP10 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP11 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP12 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP13 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP14 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP15 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP16 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP17 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP18 LL_ADC_GetChannelSamplingTime + * @param ADCx ADC instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_18 + * @arg @ref LL_ADC_CHANNEL_VREFINT (5) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * @arg @ref LL_ADC_CHANNEL_VBAT (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP1 (1) + * @arg @ref LL_ADC_CHANNEL_VOPAMP2 (2) + * @arg @ref LL_ADC_CHANNEL_VOPAMP3 (3) + * @arg @ref LL_ADC_CHANNEL_VOPAMP4 (4) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_SAMPLINGTIME_1CYCLE_5 + * @arg @ref LL_ADC_SAMPLINGTIME_2CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_4CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_7CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_19CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_61CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_181CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_601CYCLES_5 + */ +__STATIC_INLINE uint32_t LL_ADC_GetChannelSamplingTime(ADC_TypeDef *ADCx, uint32_t Channel) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SMPR1, __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPRX_REGOFFSET_MASK)); + + return (uint32_t)(READ_BIT(*preg, + ADC_SMPR1_SMP0 << __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPx_BITOFFSET_MASK)) + >> __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPx_BITOFFSET_MASK) + ); +} + +/** + * @brief Set mode single-ended or differential input of the selected + * ADC channel. + * @note Channel ending is on channel scope: independently of channel mapped + * on ADC group regular or injected. + * In differential mode: Differential measurement is carried out + * between the selected channel 'i' (positive input) and + * channel 'i+1' (negative input). Only channel 'i' has to be + * configured, channel 'i+1' is configured automatically. + * @note Refer to Reference Manual to ensure the selected channel is + * available in differential mode. + * For example, internal channels (VrefInt, TempSensor, ...) are + * not available in differential mode. + * @note When configuring a channel 'i' in differential mode, + * the channel 'i+1' is not usable separately. + * @note On STM32F3, channels 16, 17, 18 of ADC1, + * channels 17, 18 of ADC2, ADC3, ADC4 (if available) + * are internally fixed to single-ended inputs configuration. + * @note For ADC channels configured in differential mode, both inputs + * should be biased at (Vref+)/2 +/-200mV. + * (Vref+ is the analog voltage reference) + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be ADC disabled. + * @note One or several values can be selected. + * Example: (LL_ADC_CHANNEL_4 | LL_ADC_CHANNEL_12 | ...) + * @rmtoll DIFSEL DIFSEL LL_ADC_GetChannelSamplingTime + * @param ADCx ADC instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 (1) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1. + * @param SingleDiff This parameter can be a combination of the following values: + * @arg @ref LL_ADC_SINGLE_ENDED + * @arg @ref LL_ADC_DIFFERENTIAL_ENDED + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetChannelSingleDiff(ADC_TypeDef *ADCx, uint32_t Channel, uint32_t SingleDiff) +{ + /* Bits of channels in single or differential mode are set only for */ + /* differential mode (for single mode, mask of bits allowed to be set is */ + /* shifted out of range of bits of channels in single or differential mode. */ + MODIFY_REG(ADCx->DIFSEL, + Channel & ADC_SINGLEDIFF_CHANNEL_MASK, + (Channel & ADC_SINGLEDIFF_CHANNEL_MASK) & (ADC_DIFSEL_DIFSEL >> (SingleDiff & ADC_SINGLEDIFF_CHANNEL_SHIFT_MASK))); +} + +/** + * @brief Get mode single-ended or differential input of the selected + * ADC channel. + * @note When configuring a channel 'i' in differential mode, + * the channel 'i+1' is not usable separately. + * Therefore, to ensure a channel is configured in single-ended mode, + * the configuration of channel itself and the channel 'i-1' must be + * read back (to ensure that the selected channel channel has not been + * configured in differential mode by the previous channel). + * @note Refer to Reference Manual to ensure the selected channel is + * available in differential mode. + * For example, internal channels (VrefInt, TempSensor, ...) are + * not available in differential mode. + * @note When configuring a channel 'i' in differential mode, + * the channel 'i+1' is not usable separately. + * @note On STM32F3, channels 16, 17, 18 of ADC1, + * channels 17, 18 of ADC2, ADC3, ADC4 (if available) + * are internally fixed to single-ended inputs configuration. + * @note One or several values can be selected. In this case, the value + * returned is null if all channels are in single ended-mode. + * Example: (LL_ADC_CHANNEL_4 | LL_ADC_CHANNEL_12 | ...) + * @rmtoll DIFSEL DIFSEL LL_ADC_GetChannelSamplingTime + * @param ADCx ADC instance + * @param Channel This parameter can be a combination of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 (1) + * + * (1) On STM32F3, parameter available only on ADC instance: ADC1. + * @retval 0: channel in single-ended mode, else: channel in differential mode + */ +__STATIC_INLINE uint32_t LL_ADC_GetChannelSingleDiff(ADC_TypeDef *ADCx, uint32_t Channel) +{ + return (uint32_t)(READ_BIT(ADCx->DIFSEL, (Channel & ADC_SINGLEDIFF_CHANNEL_MASK))); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_AnalogWatchdog Configuration of ADC transversal scope: analog watchdog + * @{ + */ + +/** + * @brief Set ADC analog watchdog monitored channels: + * a single channel, multiple channels or all channels, + * on ADC groups regular and-or injected. + * @note Once monitored channels are selected, analog watchdog + * is enabled. + * @note In case of need to define a single channel to monitor + * with analog watchdog from sequencer channel definition, + * use helper macro @ref __LL_ADC_ANALOGWD_CHANNEL_GROUP(). + * @note On this STM32 series, there are 2 kinds of analog watchdog + * instance: + * - AWD standard (instance AWD1): + * - channels monitored: can monitor 1 channel or all channels. + * - groups monitored: ADC groups regular and-or injected. + * - resolution: resolution is not limited (corresponds to + * ADC resolution configured). + * - AWD flexible (instances AWD2, AWD3): + * - channels monitored: flexible on channels monitored, selection is + * channel wise, from from 1 to all channels. + * Specificity of this analog watchdog: Multiple channels can + * be selected. For example: + * (LL_ADC_AWD_CHANNEL4_REG_INJ | LL_ADC_AWD_CHANNEL5_REG_INJ | ...) + * - groups monitored: not selection possible (monitoring on both + * groups regular and injected). + * Channels selected are monitored on groups regular and injected: + * LL_ADC_AWD_CHANNELxx_REG_INJ (do not use parameters + * LL_ADC_AWD_CHANNELxx_REG and LL_ADC_AWD_CHANNELxx_INJ) + * - resolution: resolution is limited to 8 bits: if ADC resolution is + * 12 bits the 4 LSB are ignored, if ADC resolution is 10 bits + * the 2 LSB are ignored. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CFGR AWD1CH LL_ADC_SetAnalogWDMonitChannels\n + * CFGR AWD1SGL LL_ADC_SetAnalogWDMonitChannels\n + * CFGR AWD1EN LL_ADC_SetAnalogWDMonitChannels\n + * CFGR JAWD1EN LL_ADC_SetAnalogWDMonitChannels\n + * AWD2CR AWD2CH LL_ADC_SetAnalogWDMonitChannels\n + * AWD3CR AWD3CH LL_ADC_SetAnalogWDMonitChannels + * @param ADCx ADC instance + * @param AWDy This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD1 + * @arg @ref LL_ADC_AWD2 + * @arg @ref LL_ADC_AWD3 + * @param AWDChannelGroup This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD_DISABLE + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG (0) + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_INJ (0) + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_0_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_1_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_2_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_3_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_4_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_5_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_6_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_7_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_8_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_9_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_10_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_11_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_12_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_13_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_14_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_15_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_16_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_17_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_18_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_18_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_18_REG_INJ + * @arg @ref LL_ADC_AWD_CH_VREFINT_REG (0)(5) + * @arg @ref LL_ADC_AWD_CH_VREFINT_INJ (0)(5) + * @arg @ref LL_ADC_AWD_CH_VREFINT_REG_INJ (5) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_REG (0)(1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_INJ (0)(1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_REG_INJ (1) + * @arg @ref LL_ADC_AWD_CH_VBAT_REG (0)(1) + * @arg @ref LL_ADC_AWD_CH_VBAT_INJ (0)(1) + * @arg @ref LL_ADC_AWD_CH_VBAT_REG_INJ (1) + * @arg @ref LL_ADC_AWD_CH_VOPAMP1_REG (0)(1) + * @arg @ref LL_ADC_AWD_CH_VOPAMP1_INJ (0)(1) + * @arg @ref LL_ADC_AWD_CH_VOPAMP1_REG_INJ (1) + * @arg @ref LL_ADC_AWD_CH_VOPAMP2_REG (0)(2) + * @arg @ref LL_ADC_AWD_CH_VOPAMP2_INJ (0)(2) + * @arg @ref LL_ADC_AWD_CH_VOPAMP2_REG_INJ (2) + * @arg @ref LL_ADC_AWD_CH_VOPAMP3_REG (0)(3) + * @arg @ref LL_ADC_AWD_CH_VOPAMP3_INJ (0)(3) + * @arg @ref LL_ADC_AWD_CH_VOPAMP3_REG_INJ (3) + * @arg @ref LL_ADC_AWD_CH_VOPAMP4_REG (0)(4) + * @arg @ref LL_ADC_AWD_CH_VOPAMP4_INJ (0)(4) + * @arg @ref LL_ADC_AWD_CH_VOPAMP4_REG_INJ (4) + * + * (0) On STM32F3, parameter available only on analog watchdog number: AWD1.\n + * (1) On STM32F3, parameter available only on ADC instance: ADC1.\n + * (2) On STM32F3, parameter available only on ADC instance: ADC2.\n + * (3) On STM32F3, parameter available only on ADC instance: ADC3.\n + * (4) On STM32F3, parameter available only on ADC instances: ADC4.\n + * (5) On STM32F3, ADC channel available only on all ADC instances, but + * only one ADC instance is allowed to be connected to VrefInt at the same time. + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDChannelGroup) +{ + /* Set bits with content of parameter "AWDChannelGroup" with bits position */ + /* in register and register position depending on parameter "AWDy". */ + /* Parameters "AWDChannelGroup" and "AWDy" are used with masks because */ + /* containing other bits reserved for other purpose. */ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->CFGR, __ADC_MASK_SHIFT(AWDy, ADC_AWD_CRX_REGOFFSET_MASK) + + ((AWDy & ADC_AWD_CR12_REGOFFSETGAP_MASK) * ADC_AWD_CR12_REGOFFSETGAP_VAL)); + + MODIFY_REG(*preg, + (AWDy & ADC_AWD_CR_ALL_CHANNEL_MASK), + AWDChannelGroup & AWDy); +} + +/** + * @brief Get ADC analog watchdog monitored channel. + * @note Usage of the returned channel number: + * - To reinject this channel into another function LL_ADC_xxx: + * the returned channel number is only partly formatted on definition + * of literals LL_ADC_CHANNEL_x. Therefore, it has to be compared + * with parts of literals LL_ADC_CHANNEL_x or using + * helper macro @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Then the selected literal LL_ADC_CHANNEL_x can be used + * as parameter for another function. + * - To get the channel number in decimal format: + * process the returned value with the helper macro + * @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Applicable only when the analog watchdog is set to monitor + * one channel. + * @note On this STM32 series, there are 2 kinds of analog watchdog + * instance: + * - AWD standard (instance AWD1): + * - channels monitored: can monitor 1 channel or all channels. + * - groups monitored: ADC groups regular and-or injected. + * - resolution: resolution is not limited (corresponds to + * ADC resolution configured). + * - AWD flexible (instances AWD2, AWD3): + * - channels monitored: flexible on channels monitored, selection is + * channel wise, from from 1 to all channels. + * Specificity of this analog watchdog: Multiple channels can + * be selected. For example: + * (LL_ADC_AWD_CHANNEL4_REG_INJ | LL_ADC_AWD_CHANNEL5_REG_INJ | ...) + * - groups monitored: not selection possible (monitoring on both + * groups regular and injected). + * Channels selected are monitored on groups regular and injected: + * LL_ADC_AWD_CHANNELxx_REG_INJ (do not use parameters + * LL_ADC_AWD_CHANNELxx_REG and LL_ADC_AWD_CHANNELxx_INJ) + * - resolution: resolution is limited to 8 bits: if ADC resolution is + * 12 bits the 4 LSB are ignored, if ADC resolution is 10 bits + * the 2 LSB are ignored. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CFGR AWD1CH LL_ADC_GetAnalogWDMonitChannels\n + * CFGR AWD1SGL LL_ADC_GetAnalogWDMonitChannels\n + * CFGR AWD1EN LL_ADC_GetAnalogWDMonitChannels\n + * CFGR JAWD1EN LL_ADC_GetAnalogWDMonitChannels\n + * AWD2CR AWD2CH LL_ADC_GetAnalogWDMonitChannels\n + * AWD3CR AWD3CH LL_ADC_GetAnalogWDMonitChannels + * @param ADCx ADC instance + * @param AWDy This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD1 + * @arg @ref LL_ADC_AWD2 (1) + * @arg @ref LL_ADC_AWD3 (1) + * + * (1) On this AWD number, monitored channel can be retrieved + * if only 1 channel is programmed (or none or all channels). + * This function cannot retrieve monitored channel if + * multiple channels are programmed simultaneously + * by bitfield. + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_AWD_DISABLE + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG (0) + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_INJ (0) + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_0_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_1_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_2_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_3_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_4_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_5_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_6_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_7_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_8_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_9_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_10_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_11_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_12_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_13_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_14_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_15_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_16_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_17_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_18_REG (0) + * @arg @ref LL_ADC_AWD_CHANNEL_18_INJ (0) + * @arg @ref LL_ADC_AWD_CHANNEL_18_REG_INJ + * + * (0) On STM32F3, parameter available only on analog watchdog number: AWD1. + */ +__STATIC_INLINE uint32_t LL_ADC_GetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint32_t AWDy) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->CFGR, __ADC_MASK_SHIFT(AWDy, ADC_AWD_CRX_REGOFFSET_MASK) + + ((AWDy & ADC_AWD_CR12_REGOFFSETGAP_MASK) * ADC_AWD_CR12_REGOFFSETGAP_VAL)); + + /* Variable "AWDy" used to retrieve appropriate bitfield corresponding to */ + /* ADC_AWD_CR1_CHANNEL_MASK or ADC_AWD_CR23_CHANNEL_MASK. */ + uint32_t AWD123ChannelGroup = READ_BIT(*preg, (AWDy | ADC_AWD_CR_ALL_CHANNEL_MASK)); + + /* Set variable of AWD1 monitored channel according to AWD1 features */ + /* and ADC channel definition: */ + /* - channel ID with number */ + /* - channel ID with bitfield */ + /* - AWD1 single or all channels */ + /* - AWD1 enable or disable (also used to discard AWD1 bitfield in case of */ + /* AWD2 or AWD3 selected). */ + uint32_t AWD1ChannelSingle = ((AWD123ChannelGroup & ADC_CFGR_AWD1SGL) >> ADC_CFGR_AWD1SGL_BITOFFSET_POS); + + uint32_t AWD1ChannelGroup = ( ( AWD123ChannelGroup + | ((ADC_CHANNEL_0_BITFIELD << ((AWD123ChannelGroup & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS)) * AWD1ChannelSingle) + | (ADC_CHANNEL_ID_BITFIELD_MASK * (~AWD1ChannelSingle & ((uint32_t)0x00000001U))) + ) + * (((AWD123ChannelGroup & ADC_CFGR_JAWD1EN) >> ADC_CFGR_JAWD1EN_BITOFFSET_POS) | ((AWD123ChannelGroup & ADC_CFGR_AWD1EN) >> ADC_CFGR_AWD1EN_BITOFFSET_POS)) + ); + + /* Set variable of AWD2 and AWD3 monitored channel according to AWD2-3 */ + /* features and ADC channel definition: */ + /* - channel ID with number */ + /* - channel ID with bitfield */ + /* - AWD2-3 single or all channels (shift value 32 (0x1 shift 5) used to */ + /* shift AWD1 equivalent single-all channels out of register) */ + /* - AWD2-3 enable or disable */ + /* Note: Use modulo 3 to avoid a shift value too long. On AWD2 and AWD3, */ + /* channel can be read back if only 1 channel monitoring */ + /* is activated, therefore the channel monitoring value channel "3" */ + /* is not not supported by this function, there is no risk of */ + /* conflict. */ + uint32_t AWD23Enabled = ((((uint32_t)0x00000001U) >> (AWD123ChannelGroup % 3U)) << 6U); /* Value "0" if AWD2-3 is enabled, value "32" if AWD2-3 is disabled */ + + uint32_t AWD23ChannelGroup = ((( AWD123ChannelGroup + | ((uint32_t)POSITION_VAL(AWD123ChannelGroup) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) + | ((ADC_CFGR_AWD1SGL) >> ((((uint32_t)0x00000001U) >> (ADC_AWD_CR23_CHANNEL_MASK - AWD123ChannelGroup)) << 5U)) + | (ADC_CFGR_JAWD1EN | ADC_CFGR_AWD1EN) + ) >> AWD23Enabled + ) >> (((AWDy & ADC_CFGR_AWD1SGL) >> ADC_CFGR_AWD1SGL_BITOFFSET_POS) << 5U)); + + return (AWD1ChannelGroup | AWD23ChannelGroup); +} + +/** + * @brief Set ADC analog watchdog thresholds value of both thresholds + * high and low. + * @note If value of only one threshold high or low must be set, + * use function @ref LL_ADC_SetAnalogWDThresholds(). + * @note In case of ADC resolution different of 12 bits, + * analog watchdog thresholds data require a specific shift. + * Use helper macro @ref __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION(). + * @note On this STM32 series, there are 2 kinds of analog watchdog + * instance: + * - AWD standard (instance AWD1): + * - channels monitored: can monitor 1 channel or all channels. + * - groups monitored: ADC groups regular and-or injected. + * - resolution: resolution is not limited (corresponds to + * ADC resolution configured). + * - AWD flexible (instances AWD2, AWD3): + * - channels monitored: flexible on channels monitored, selection is + * channel wise, from from 1 to all channels. + * Specificity of this analog watchdog: Multiple channels can + * be selected. For example: + * (LL_ADC_AWD_CHANNEL4_REG_INJ | LL_ADC_AWD_CHANNEL5_REG_INJ | ...) + * - groups monitored: not selection possible (monitoring on both + * groups regular and injected). + * Channels selected are monitored on groups regular and injected: + * LL_ADC_AWD_CHANNELxx_REG_INJ (do not use parameters + * LL_ADC_AWD_CHANNELxx_REG and LL_ADC_AWD_CHANNELxx_INJ) + * - resolution: resolution is limited to 8 bits: if ADC resolution is + * 12 bits the 4 LSB are ignored, if ADC resolution is 10 bits + * the 2 LSB are ignored. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll TR1 HT1 LL_ADC_ConfigAnalogWDThresholds\n + * TR2 HT2 LL_ADC_ConfigAnalogWDThresholds\n + * TR3 HT3 LL_ADC_ConfigAnalogWDThresholds\n + * TR1 LT1 LL_ADC_ConfigAnalogWDThresholds\n + * TR2 LT2 LL_ADC_ConfigAnalogWDThresholds\n + * TR3 LT3 LL_ADC_ConfigAnalogWDThresholds + * @param ADCx ADC instance + * @param AWDy This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD1 + * @arg @ref LL_ADC_AWD2 + * @arg @ref LL_ADC_AWD3 + * @param AWDThresholdHighValue Value between Min_Data=0x000 and Max_Data=0xFFF + * @param AWDThresholdLowValue Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval None + */ +__STATIC_INLINE void LL_ADC_ConfigAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdHighValue, uint32_t AWDThresholdLowValue) +{ + /* Set bits with content of parameter "AWDThresholdxxxValue" with bits */ + /* position in register and register position depending on parameter */ + /* "AWDy". */ + /* Parameters "AWDy" and "AWDThresholdxxxValue" are used with masks because */ + /* containing other bits reserved for other purpose. */ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->TR1, __ADC_MASK_SHIFT(AWDy, ADC_AWD_TRX_REGOFFSET_MASK)); + + MODIFY_REG(*preg, + ADC_TR1_HT1 | ADC_TR1_LT1, + (AWDThresholdHighValue << ADC_TR1_HT1_BITOFFSET_POS) | AWDThresholdLowValue); +} + +/** + * @brief Set ADC analog watchdog threshold value of threshold + * high or low. + * @note If values of both thresholds high or low must be set, + * use function @ref LL_ADC_ConfigAnalogWDThresholds(). + * @note In case of ADC resolution different of 12 bits, + * analog watchdog thresholds data require a specific shift. + * Use helper macro @ref __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION(). + * @note On this STM32 series, there are 2 kinds of analog watchdog + * instance: + * - AWD standard (instance AWD1): + * - channels monitored: can monitor 1 channel or all channels. + * - groups monitored: ADC groups regular and-or injected. + * - resolution: resolution is not limited (corresponds to + * ADC resolution configured). + * - AWD flexible (instances AWD2, AWD3): + * - channels monitored: flexible on channels monitored, selection is + * channel wise, from from 1 to all channels. + * Specificity of this analog watchdog: Multiple channels can + * be selected. For example: + * (LL_ADC_AWD_CHANNEL4_REG_INJ | LL_ADC_AWD_CHANNEL5_REG_INJ | ...) + * - groups monitored: not selection possible (monitoring on both + * groups regular and injected). + * Channels selected are monitored on groups regular and injected: + * LL_ADC_AWD_CHANNELxx_REG_INJ (do not use parameters + * LL_ADC_AWD_CHANNELxx_REG and LL_ADC_AWD_CHANNELxx_INJ) + * - resolution: resolution is limited to 8 bits: if ADC resolution is + * 12 bits the 4 LSB are ignored, if ADC resolution is 10 bits + * the 2 LSB are ignored. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be disabled or enabled without conversion on going + * on either groups regular or injected. + * @rmtoll TR1 HT1 LL_ADC_SetAnalogWDThresholds\n + * TR2 HT2 LL_ADC_SetAnalogWDThresholds\n + * TR3 HT3 LL_ADC_SetAnalogWDThresholds\n + * TR1 LT1 LL_ADC_SetAnalogWDThresholds\n + * TR2 LT2 LL_ADC_SetAnalogWDThresholds\n + * TR3 LT3 LL_ADC_SetAnalogWDThresholds + * @param ADCx ADC instance + * @param AWDy This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD1 + * @arg @ref LL_ADC_AWD2 + * @arg @ref LL_ADC_AWD3 + * @param AWDThresholdsHighLow This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD_THRESHOLD_HIGH + * @arg @ref LL_ADC_AWD_THRESHOLD_LOW + * @param AWDThresholdValue Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdsHighLow, uint32_t AWDThresholdValue) +{ + /* Set bits with content of parameter "AWDThresholdValue" with bits */ + /* position in register and register position depending on parameters */ + /* "AWDThresholdsHighLow" and "AWDy". */ + /* Parameters "AWDy" and "AWDThresholdValue" are used with masks because */ + /* containing other bits reserved for other purpose. */ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->TR1, __ADC_MASK_SHIFT(AWDy, ADC_AWD_TRX_REGOFFSET_MASK)); + + MODIFY_REG(*preg, + AWDThresholdsHighLow, + AWDThresholdValue << POSITION_VAL(AWDThresholdsHighLow)); +} + +/** + * @brief Get ADC analog watchdog threshold value of threshold high, + * threshold low or raw data with ADC thresholds high and low + * concatenated. + * @note If raw data with ADC thresholds high and low is retrieved, + * the data of each threshold high or low can be isolated + * using helper macro: + * @ref __LL_ADC_ANALOGWD_THRESHOLDS_HIGH_LOW(). + * @note In case of ADC resolution different of 12 bits, + * analog watchdog thresholds data require a specific shift. + * Use helper macro @ref __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION(). + * @rmtoll TR1 HT1 LL_ADC_GetAnalogWDThresholds\n + * TR2 HT2 LL_ADC_GetAnalogWDThresholds\n + * TR3 HT3 LL_ADC_GetAnalogWDThresholds\n + * TR1 LT1 LL_ADC_GetAnalogWDThresholds\n + * TR2 LT2 LL_ADC_GetAnalogWDThresholds\n + * TR3 LT3 LL_ADC_GetAnalogWDThresholds + * @param ADCx ADC instance + * @param AWDy This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD1 + * @arg @ref LL_ADC_AWD2 + * @arg @ref LL_ADC_AWD3 + * @param AWDThresholdsHighLow This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD_THRESHOLD_HIGH + * @arg @ref LL_ADC_AWD_THRESHOLD_LOW + * @arg @ref LL_ADC_AWD_THRESHOLDS_HIGH_LOW + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF +*/ +__STATIC_INLINE uint32_t LL_ADC_GetAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDy, uint32_t AWDThresholdsHighLow) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->TR1, __ADC_MASK_SHIFT(AWDy, ADC_AWD_TRX_REGOFFSET_MASK)); + + return (uint32_t)(READ_BIT(*preg, + (AWDThresholdsHighLow | ADC_TR1_LT1)) + >> POSITION_VAL(AWDThresholdsHighLow) + ); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Multimode Configuration of ADC hierarchical scope: multimode + * @{ + */ + +#if defined(ADC_MULTIMODE_SUPPORT) +/** + * @brief Set ADC multimode configuration to operate in independent mode + * or multimode (for devices with several ADC instances). + * @note If multimode configuration: the selected ADC instance is + * either master or slave depending on hardware. + * Refer to reference manual. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * All ADC instances of the ADC common group must be disabled. + * This check can be done with function @ref LL_ADC_IsEnabled() for each + * ADC instance or by using helper macro + * @ref __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(). + * @rmtoll CCR DUAL LL_ADC_SetMultimode + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @param Multimode This parameter can be one of the following values: + * @arg @ref LL_ADC_MULTI_INDEPENDENT + * @arg @ref LL_ADC_MULTI_DUAL_REG_SIMULT + * @arg @ref LL_ADC_MULTI_DUAL_REG_INTERL + * @arg @ref LL_ADC_MULTI_DUAL_INJ_SIMULT + * @arg @ref LL_ADC_MULTI_DUAL_INJ_ALTERN + * @arg @ref LL_ADC_MULTI_DUAL_REG_SIM_INJ_SIM + * @arg @ref LL_ADC_MULTI_DUAL_REG_SIM_INJ_ALT + * @arg @ref LL_ADC_MULTI_DUAL_REG_INT_INJ_SIM + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetMultimode(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t Multimode) +{ + MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_DUAL, Multimode); +} + +/** + * @brief Get ADC multimode configuration to operate in independent mode + * or multimode (for devices with several ADC instances). + * @note If multimode configuration: the selected ADC instance is + * either master or slave depending on hardware. + * Refer to reference manual. + * @rmtoll CCR DUAL LL_ADC_GetMultimode + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_MULTI_INDEPENDENT + * @arg @ref LL_ADC_MULTI_DUAL_REG_SIMULT + * @arg @ref LL_ADC_MULTI_DUAL_REG_INTERL + * @arg @ref LL_ADC_MULTI_DUAL_INJ_SIMULT + * @arg @ref LL_ADC_MULTI_DUAL_INJ_ALTERN + * @arg @ref LL_ADC_MULTI_DUAL_REG_SIM_INJ_SIM + * @arg @ref LL_ADC_MULTI_DUAL_REG_SIM_INJ_ALT + * @arg @ref LL_ADC_MULTI_DUAL_REG_INT_INJ_SIM + */ +__STATIC_INLINE uint32_t LL_ADC_GetMultimode(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (uint32_t)(READ_BIT(ADCxy_COMMON->CCR, ADC_CCR_DUAL)); +} + +/** + * @brief Set ADC multimode conversion data transfer: no transfer + * or transfer by DMA. + * @note If ADC multimode transfer by DMA is not selected: + * each ADC uses its own DMA channel, with its individual + * DMA transfer settings. + * If ADC multimode transfer by DMA is selected: + * One DMA channel is used for both ADC (DMA of ADC master) + * Specifies the DMA requests mode: + * - Limited mode (One shot mode): DMA transfer requests are stopped + * when number of DMA data transfers (number of + * ADC conversions) is reached. + * This ADC mode is intended to be used with DMA mode non-circular. + * - Unlimited mode: DMA transfer requests are unlimited, + * whatever number of DMA data transfers (number of + * ADC conversions). + * This ADC mode is intended to be used with DMA mode circular. + * @note If ADC DMA requests mode is set to unlimited and DMA is set to + * mode non-circular: + * when DMA transfers size will be reached, DMA will stop transfers of + * ADC conversions data ADC will raise an overrun error + * (overrun flag and interruption if enabled). + * @note How to retrieve multimode conversion data: + * Whatever multimode transfer by DMA setting: using function + * @ref LL_ADC_REG_ReadMultiConversionData32(). + * If ADC multimode transfer by DMA is selected: conversion data + * is a raw data with ADC master and slave concatenated. + * A macro is available to get the conversion data of + * ADC master or ADC slave: see helper macro + * @ref __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE(). + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * All ADC instances of the ADC common group must be disabled + * or enabled without conversion on going on group regular. + * @rmtoll CCR MDMA LL_ADC_SetMultiDMATransfer\n + * CCR DMACFG LL_ADC_SetMultiDMATransfer + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @param MultiDMATransfer This parameter can be one of the following values: + * @arg @ref LL_ADC_MULTI_REG_DMA_EACH_ADC + * @arg @ref LL_ADC_MULTI_REG_DMA_LIMIT_RES12_10B + * @arg @ref LL_ADC_MULTI_REG_DMA_LIMIT_RES8_6B + * @arg @ref LL_ADC_MULTI_REG_DMA_UNLMT_RES12_10B + * @arg @ref LL_ADC_MULTI_REG_DMA_UNLMT_RES8_6B + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetMultiDMATransfer(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t MultiDMATransfer) +{ + MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_MDMA | ADC_CCR_DMACFG, MultiDMATransfer); +} + +/** + * @brief Get ADC multimode conversion data transfer: no transfer + * or transfer by DMA. + * @note If ADC multimode transfer by DMA is not selected: + * each ADC uses its own DMA channel, with its individual + * DMA transfer settings. + * If ADC multimode transfer by DMA is selected: + * One DMA channel is used for both ADC (DMA of ADC master) + * Specifies the DMA requests mode: + * - Limited mode (One shot mode): DMA transfer requests are stopped + * when number of DMA data transfers (number of + * ADC conversions) is reached. + * This ADC mode is intended to be used with DMA mode non-circular. + * - Unlimited mode: DMA transfer requests are unlimited, + * whatever number of DMA data transfers (number of + * ADC conversions). + * This ADC mode is intended to be used with DMA mode circular. + * @note If ADC DMA requests mode is set to unlimited and DMA is set to + * mode non-circular: + * when DMA transfers size will be reached, DMA will stop transfers of + * ADC conversions data ADC will raise an overrun error + * (overrun flag and interruption if enabled). + * @note How to retrieve multimode conversion data: + * Whatever multimode transfer by DMA setting: using function + * @ref LL_ADC_REG_ReadMultiConversionData32(). + * If ADC multimode transfer by DMA is selected: conversion data + * is a raw data with ADC master and slave concatenated. + * A macro is available to get the conversion data of + * ADC master or ADC slave: see helper macro + * @ref __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE(). + * @rmtoll CCR MDMA LL_ADC_GetMultiDMATransfer\n + * CCR DMACFG LL_ADC_GetMultiDMATransfer + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_MULTI_REG_DMA_EACH_ADC + * @arg @ref LL_ADC_MULTI_REG_DMA_LIMIT_RES12_10B + * @arg @ref LL_ADC_MULTI_REG_DMA_LIMIT_RES8_6B + * @arg @ref LL_ADC_MULTI_REG_DMA_UNLMT_RES12_10B + * @arg @ref LL_ADC_MULTI_REG_DMA_UNLMT_RES8_6B + */ +__STATIC_INLINE uint32_t LL_ADC_GetMultiDMATransfer(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (uint32_t)(READ_BIT(ADCxy_COMMON->CCR, ADC_CCR_MDMA | ADC_CCR_DMACFG)); +} + +/** + * @brief Set ADC multimode delay between 2 sampling phases. + * @note The sampling delay range depends on ADC resolution: + * - ADC resolution 12 bits can have maximum delay of 12 cycles. + * - ADC resolution 10 bits can have maximum delay of 10 cycles. + * - ADC resolution 8 bits can have maximum delay of 8 cycles. + * - ADC resolution 6 bits can have maximum delay of 6 cycles. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * All ADC instances of the ADC common group must be disabled. + * This check can be done with function @ref LL_ADC_IsEnabled() for each + * ADC instance or by using helper macro helper macro + * @ref __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(). + * @rmtoll CCR DELAY LL_ADC_SetMultiTwoSamplingDelay + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @param MultiTwoSamplingDelay This parameter can be one of the following values: + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_1CYCLE + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_2CYCLES + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_3CYCLES + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_4CYCLES + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_5CYCLES + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_6CYCLES (1) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_7CYCLES (1) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_8CYCLES (2) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_9CYCLES (2) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_10CYCLES (2) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_11CYCLES (3) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_12CYCLES (3) + * + * (1) Parameter available only if ADC resolution is 12, 10 or 8 bits.\n + * (2) Parameter available only if ADC resolution is 12 or 10 bits.\n + * (3) Parameter available only if ADC resolution is 12 bits. + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetMultiTwoSamplingDelay(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t MultiTwoSamplingDelay) +{ + MODIFY_REG(ADCxy_COMMON->CCR, ADC_CCR_DELAY, MultiTwoSamplingDelay); +} + +/** + * @brief Get ADC multimode delay between 2 sampling phases. + * @rmtoll CCR DELAY LL_ADC_GetMultiTwoSamplingDelay + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_1CYCLE + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_2CYCLES + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_3CYCLES + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_4CYCLES + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_5CYCLES + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_6CYCLES (1) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_7CYCLES (1) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_8CYCLES (2) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_9CYCLES (2) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_10CYCLES (2) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_11CYCLES (3) + * @arg @ref LL_ADC_MULTI_TWOSMP_DELAY_12CYCLES (3) + * + * (1) Parameter available only if ADC resolution is 12, 10 or 8 bits.\n + * (2) Parameter available only if ADC resolution is 12 or 10 bits.\n + * (3) Parameter available only if ADC resolution is 12 bits. + */ +__STATIC_INLINE uint32_t LL_ADC_GetMultiTwoSamplingDelay(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (uint32_t)(READ_BIT(ADCxy_COMMON->CCR, ADC_CCR_DELAY)); +} +#endif /* ADC_MULTIMODE_SUPPORT */ + +/** + * @} + */ +/** @defgroup ADC_LL_EF_Operation_ADC_Instance Operation on ADC hierarchical scope: ADC instance + * @{ + */ + +/** + * @brief Enable ADC instance internal voltage regulator. + * @note On this STM32 series, after ADC internal voltage regulator enable, + * a delay for ADC internal voltage regulator stabilization + * is required before performing a ADC calibration or ADC enable. + * Refer to device datasheet, parameter tADCVREG_STUP. + * Refer to literal @ref LL_ADC_DELAY_INTERNAL_REGUL_STAB_US. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be ADC disabled. + * @rmtoll CR ADVREGEN LL_ADC_EnableInternalRegulator + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableInternalRegulator(ADC_TypeDef *ADCx) +{ + /* 1. Set the intermediate state before moving the ADC voltage regulator */ + /* to state enable. */ + CLEAR_BIT(ADCx->CR, (ADC_CR_ADVREGEN_1 | ADC_CR_ADVREGEN_0)); + /* 2. Set the final state of ADC voltage regulator enable */ + /* (ADVREGEN bits set to 0x01). */ + /* Note: Write register with some additional bits forced to state reset */ + /* instead of modifying only the selected bit for this function, */ + /* to not interfere with bits with HW property "rs". */ + MODIFY_REG(ADCx->CR, + ADC_CR_BITS_PROPERTY_RS, + ADC_CR_ADVREGEN_0); +} + +/** + * @brief Disable ADC internal voltage regulator. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be ADC disabled. + * @rmtoll CR ADVREGEN LL_ADC_DisableInternalRegulator + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableInternalRegulator(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->CR, (ADC_CR_ADVREGEN | ADC_CR_BITS_PROPERTY_RS)); +} + +/** + * @brief Get the selected ADC instance internal voltage regulator state. + * @rmtoll CR ADVREGEN LL_ADC_IsInternalRegulatorEnabled + * @param ADCx ADC instance + * @retval 0: internal regulator is disabled, 1: internal regulator is enabled. + */ +__STATIC_INLINE uint32_t LL_ADC_IsInternalRegulatorEnabled(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR, (ADC_CR_ADVREGEN_1 | ADC_CR_ADVREGEN_0)) == (ADC_CR_ADVREGEN_0)); +} + +/** + * @brief Enable the selected ADC instance. + * @note On this STM32 series, after ADC enable, a delay for + * ADC internal analog stabilization is required before performing a + * ADC conversion start. + * Refer to device datasheet, parameter tSTAB. + * @note On this STM32 series, flag LL_ADC_FLAG_ADRDY is raised when the ADC + * is enabled and when conversion clock is active. + * (not only core clock: this ADC has a dual clock domain) + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be ADC disabled and ADC internal voltage regulator enabled. + * @rmtoll CR ADEN LL_ADC_Enable + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_Enable(ADC_TypeDef *ADCx) +{ + /* Note: Write register with some additional bits forced to state reset */ + /* instead of modifying only the selected bit for this function, */ + /* to not interfere with bits with HW property "rs". */ + MODIFY_REG(ADCx->CR, + ADC_CR_BITS_PROPERTY_RS, + ADC_CR_ADEN); +} + +/** + * @brief Disable the selected ADC instance. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be not disabled. Must be enabled without conversion on going + * on either groups regular or injected. + * @rmtoll CR ADDIS LL_ADC_Disable + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_Disable(ADC_TypeDef *ADCx) +{ + /* Note: Write register with some additional bits forced to state reset */ + /* instead of modifying only the selected bit for this function, */ + /* to not interfere with bits with HW property "rs". */ + MODIFY_REG(ADCx->CR, + ADC_CR_BITS_PROPERTY_RS, + ADC_CR_ADDIS); +} + +/** + * @brief Get the selected ADC instance enable state. + * @note On this STM32 series, flag LL_ADC_FLAG_ADRDY is raised when the ADC + * is enabled and when conversion clock is active. + * (not only core clock: this ADC has a dual clock domain) + * @rmtoll CR ADEN LL_ADC_IsEnabled + * @param ADCx ADC instance + * @retval 0: ADC is disabled, 1: ADC is enabled. + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabled(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR, ADC_CR_ADEN) == (ADC_CR_ADEN)); +} + +/** + * @brief Get the selected ADC instance disable state. + * @rmtoll CR ADDIS LL_ADC_IsDisableOngoing + * @param ADCx ADC instance + * @retval 0: no ADC disable command on going. + */ +__STATIC_INLINE uint32_t LL_ADC_IsDisableOngoing(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR, ADC_CR_ADDIS) == (ADC_CR_ADDIS)); +} + +/** + * @brief Start ADC calibration in the mode single-ended + * or differential (for devices with differential mode available). + * @note On this STM32 series, a minimum number of ADC clock cycles + * are required between ADC end of calibration and ADC enable. + * Refer to literal @ref LL_ADC_DELAY_CALIB_ENABLE_ADC_CYCLES. + * @note For devices with differential mode available: + * Calibration of offset is specific to each of + * single-ended and differential modes + * (calibration run must be performed for each of these + * differential modes, if used afterwards and if the application + * requires their calibration). + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be ADC disabled. + * @rmtoll CR ADCAL LL_ADC_StartCalibration\n + * CR ADCALDIF LL_ADC_StartCalibration + * @param ADCx ADC instance + * @param SingleDiff This parameter can be one of the following values: + * @arg @ref LL_ADC_SINGLE_ENDED + * @arg @ref LL_ADC_DIFFERENTIAL_ENDED + * @retval None + */ +__STATIC_INLINE void LL_ADC_StartCalibration(ADC_TypeDef *ADCx, uint32_t SingleDiff) +{ + /* Note: Write register with some additional bits forced to state reset */ + /* instead of modifying only the selected bit for this function, */ + /* to not interfere with bits with HW property "rs". */ + MODIFY_REG(ADCx->CR, + ADC_CR_ADCALDIF | ADC_CR_BITS_PROPERTY_RS, + ADC_CR_ADCAL | (SingleDiff & ADC_SINGLEDIFF_CALIB_START_MASK)); +} + +/** + * @brief Get ADC calibration state. + * @rmtoll CR ADCAL LL_ADC_IsCalibrationOnGoing + * @param ADCx ADC instance + * @retval 0: calibration complete, 1: calibration in progress. + */ +__STATIC_INLINE uint32_t LL_ADC_IsCalibrationOnGoing(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR, ADC_CR_ADCAL) == (ADC_CR_ADCAL)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Operation_ADC_Group_Regular Operation on ADC hierarchical scope: group regular + * @{ + */ + +/** + * @brief Start ADC group regular conversion. + * @note On this STM32 series, this function is relevant for both + * internal trigger (SW start) and external trigger: + * - If ADC trigger has been set to software start, ADC conversion + * starts immediately. + * - If ADC trigger has been set to external trigger, ADC conversion + * will start at next trigger event (on the selected trigger edge) + * following the ADC start conversion command. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be enabled without conversion on going on group regular, + * without conversion stop command on going on group regular, + * without ADC disable command on going. + * @rmtoll CR ADSTART LL_ADC_REG_StartConversion + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_StartConversion(ADC_TypeDef *ADCx) +{ + /* Note: Write register with some additional bits forced to state reset */ + /* instead of modifying only the selected bit for this function, */ + /* to not interfere with bits with HW property "rs". */ + MODIFY_REG(ADCx->CR, + ADC_CR_BITS_PROPERTY_RS, + ADC_CR_ADSTART); +} + +/** + * @brief Stop ADC group regular conversion. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be enabled with conversion on going on group regular, + * without ADC disable command on going. + * @rmtoll CR ADSTP LL_ADC_REG_StopConversion + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_StopConversion(ADC_TypeDef *ADCx) +{ + /* Note: Write register with some additional bits forced to state reset */ + /* instead of modifying only the selected bit for this function, */ + /* to not interfere with bits with HW property "rs". */ + MODIFY_REG(ADCx->CR, + ADC_CR_BITS_PROPERTY_RS, + ADC_CR_ADSTP); +} + +/** + * @brief Get ADC group regular conversion state. + * @rmtoll CR ADSTART LL_ADC_REG_IsConversionOngoing + * @param ADCx ADC instance + * @retval 0: no conversion is on going on ADC group regular. + */ +__STATIC_INLINE uint32_t LL_ADC_REG_IsConversionOngoing(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR, ADC_CR_ADSTART) == (ADC_CR_ADSTART)); +} + +/** + * @brief Get ADC group regular command of conversion stop state + * @rmtoll CR ADSTP LL_ADC_REG_IsStopConversionOngoing + * @param ADCx ADC instance + * @retval 0: no command of conversion stop is on going on ADC group regular. + */ +__STATIC_INLINE uint32_t LL_ADC_REG_IsStopConversionOngoing(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR, ADC_CR_ADSTP) == (ADC_CR_ADSTP)); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * all ADC configurations: all ADC resolutions and + * all oversampling increased data width (for devices + * with feature oversampling). + * @rmtoll DR RDATA LL_ADC_REG_ReadConversionData32 + * @param ADCx ADC instance + * @retval Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_ADC_REG_ReadConversionData32(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA)); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * ADC resolution 12 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_REG_ReadConversionData32. + * @rmtoll DR RDATA LL_ADC_REG_ReadConversionData12 + * @param ADCx ADC instance + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +__STATIC_INLINE uint16_t LL_ADC_REG_ReadConversionData12(ADC_TypeDef *ADCx) +{ + return (uint16_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA)); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * ADC resolution 10 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_REG_ReadConversionData32. + * @rmtoll DR RDATA LL_ADC_REG_ReadConversionData10 + * @param ADCx ADC instance + * @retval Value between Min_Data=0x000 and Max_Data=0x3FF + */ +__STATIC_INLINE uint16_t LL_ADC_REG_ReadConversionData10(ADC_TypeDef *ADCx) +{ + return (uint16_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA)); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * ADC resolution 8 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_REG_ReadConversionData32. + * @rmtoll DR RDATA LL_ADC_REG_ReadConversionData8 + * @param ADCx ADC instance + * @retval Value between Min_Data=0x00 and Max_Data=0xFF + */ +__STATIC_INLINE uint8_t LL_ADC_REG_ReadConversionData8(ADC_TypeDef *ADCx) +{ + return (uint8_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA)); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * ADC resolution 6 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_REG_ReadConversionData32. + * @rmtoll DR RDATA LL_ADC_REG_ReadConversionData6 + * @param ADCx ADC instance + * @retval Value between Min_Data=0x00 and Max_Data=0x3F + */ +__STATIC_INLINE uint8_t LL_ADC_REG_ReadConversionData6(ADC_TypeDef *ADCx) +{ + return (uint8_t)(READ_BIT(ADCx->DR, ADC_DR_RDATA)); +} + +#if defined(ADC_MULTIMODE_SUPPORT) +/** + * @brief Get ADC multimode conversion data of ADC master, ADC slave + * or raw data with ADC master and slave concatenated. + * @note If raw data with ADC master and slave concatenated is retrieved, + * a macro is available to get the conversion data of + * ADC master or ADC slave: see helper macro + * @ref __LL_ADC_MULTI_CONV_DATA_MASTER_SLAVE(). + * (however this macro is mainly intended for multimode + * transfer by DMA, because this function can do the same + * by getting multimode conversion data of ADC master or ADC slave + * separately). + * @rmtoll CDR RDATA_MST LL_ADC_REG_ReadMultiConversionData32\n + * CDR RDATA_SLV LL_ADC_REG_ReadMultiConversionData32 + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @param ConversionData This parameter can be one of the following values: + * @arg @ref LL_ADC_MULTI_MASTER + * @arg @ref LL_ADC_MULTI_SLAVE + * @arg @ref LL_ADC_MULTI_MASTER_SLAVE + * @retval Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_ADC_REG_ReadMultiConversionData32(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t ConversionData) +{ + return (uint32_t)(READ_BIT(ADCxy_COMMON->CDR, + ConversionData) + >> POSITION_VAL(ConversionData) + ); +} +#endif /* ADC_MULTIMODE_SUPPORT */ + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Operation_ADC_Group_Injected Operation on ADC hierarchical scope: group injected + * @{ + */ + +/** + * @brief Start ADC group injected conversion. + * @note On this STM32 series, this function is relevant for both + * internal trigger (SW start) and external trigger: + * - If ADC trigger has been set to software start, ADC conversion + * starts immediately. + * - If ADC trigger has been set to external trigger, ADC conversion + * will start at next trigger event (on the selected trigger edge) + * following the ADC start conversion command. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be enabled without conversion on going on group injected, + * without conversion stop command on going on group injected, + * without ADC disable command on going. + * @rmtoll CR JADSTART LL_ADC_INJ_StartConversion + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_StartConversion(ADC_TypeDef *ADCx) +{ + /* Note: Write register with some additional bits forced to state reset */ + /* instead of modifying only the selected bit for this function, */ + /* to not interfere with bits with HW property "rs". */ + MODIFY_REG(ADCx->CR, + ADC_CR_BITS_PROPERTY_RS, + ADC_CR_JADSTART); +} + +/** + * @brief Stop ADC group injected conversion. + * @note On this STM32 series, setting of this feature is conditioned to + * ADC state: + * ADC must be enabled with conversion on going on group injected, + * without ADC disable command on going. + * @rmtoll CR JADSTP LL_ADC_INJ_StopConversion + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_StopConversion(ADC_TypeDef *ADCx) +{ + /* Note: Write register with some additional bits forced to state reset */ + /* instead of modifying only the selected bit for this function, */ + /* to not interfere with bits with HW property "rs". */ + MODIFY_REG(ADCx->CR, + ADC_CR_BITS_PROPERTY_RS, + ADC_CR_JADSTP); +} + +/** + * @brief Get ADC group injected conversion state. + * @rmtoll CR JADSTART LL_ADC_INJ_IsConversionOngoing + * @param ADCx ADC instance + * @retval 0: no conversion is on going on ADC group injected. + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_IsConversionOngoing(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR, ADC_CR_JADSTART) == (ADC_CR_JADSTART)); +} + +/** + * @brief Get ADC group injected command of conversion stop state + * @rmtoll CR JADSTP LL_ADC_INJ_IsStopConversionOngoing + * @param ADCx ADC instance + * @retval 0: no command of conversion stop is on going on ADC group injected. + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_IsStopConversionOngoing(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR, ADC_CR_JADSTP) == (ADC_CR_JADSTP)); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * all ADC configurations: all ADC resolutions and + * all oversampling increased data width (for devices + * with feature oversampling). + * @rmtoll JDR1 JDATA LL_ADC_INJ_ReadConversionData32\n + * JDR2 JDATA LL_ADC_INJ_ReadConversionData32\n + * JDR3 JDATA LL_ADC_INJ_ReadConversionData32\n + * JDR4 JDATA LL_ADC_INJ_ReadConversionData32 + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_ReadConversionData32(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JDRX_REGOFFSET_MASK)); + + return (uint32_t)(READ_BIT(*preg, + ADC_JDR1_JDATA) + ); +} + +/** + * @brief Get ADC group injected conversion data, range fit for + * ADC resolution 12 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_INJ_ReadConversionData32. + * @rmtoll JDR1 JDATA LL_ADC_INJ_ReadConversionData12\n + * JDR2 JDATA LL_ADC_INJ_ReadConversionData12\n + * JDR3 JDATA LL_ADC_INJ_ReadConversionData12\n + * JDR4 JDATA LL_ADC_INJ_ReadConversionData12 + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +__STATIC_INLINE uint16_t LL_ADC_INJ_ReadConversionData12(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JDRX_REGOFFSET_MASK)); + + return (uint16_t)(READ_BIT(*preg, + ADC_JDR1_JDATA) + ); +} + +/** + * @brief Get ADC group injected conversion data, range fit for + * ADC resolution 10 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_INJ_ReadConversionData32. + * @rmtoll JDR1 JDATA LL_ADC_INJ_ReadConversionData10\n + * JDR2 JDATA LL_ADC_INJ_ReadConversionData10\n + * JDR3 JDATA LL_ADC_INJ_ReadConversionData10\n + * JDR4 JDATA LL_ADC_INJ_ReadConversionData10 + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Value between Min_Data=0x000 and Max_Data=0x3FF + */ +__STATIC_INLINE uint16_t LL_ADC_INJ_ReadConversionData10(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JDRX_REGOFFSET_MASK)); + + return (uint16_t)(READ_BIT(*preg, + ADC_JDR1_JDATA) + ); +} + +/** + * @brief Get ADC group injected conversion data, range fit for + * ADC resolution 8 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_INJ_ReadConversionData32. + * @rmtoll JDR1 JDATA LL_ADC_INJ_ReadConversionData8\n + * JDR2 JDATA LL_ADC_INJ_ReadConversionData8\n + * JDR3 JDATA LL_ADC_INJ_ReadConversionData8\n + * JDR4 JDATA LL_ADC_INJ_ReadConversionData8 + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Value between Min_Data=0x00 and Max_Data=0xFF + */ +__STATIC_INLINE uint8_t LL_ADC_INJ_ReadConversionData8(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JDRX_REGOFFSET_MASK)); + + return (uint8_t)(READ_BIT(*preg, + ADC_JDR1_JDATA) + ); +} + +/** + * @brief Get ADC group injected conversion data, range fit for + * ADC resolution 6 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_INJ_ReadConversionData32. + * @rmtoll JDR1 JDATA LL_ADC_INJ_ReadConversionData6\n + * JDR2 JDATA LL_ADC_INJ_ReadConversionData6\n + * JDR3 JDATA LL_ADC_INJ_ReadConversionData6\n + * JDR4 JDATA LL_ADC_INJ_ReadConversionData6 + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Value between Min_Data=0x00 and Max_Data=0x3F + */ +__STATIC_INLINE uint8_t LL_ADC_INJ_ReadConversionData6(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JDRX_REGOFFSET_MASK)); + + return (uint8_t)(READ_BIT(*preg, + ADC_JDR1_JDATA) + ); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_FLAG_Management ADC flag management + * @{ + */ + +/** + * @brief Get flag ADC ready. + * @note On this STM32 series, flag LL_ADC_FLAG_ADRDY is raised when the ADC + * is enabled and when conversion clock is active. + * (not only core clock: this ADC has a dual clock domain) + * @rmtoll ISR ADRDY LL_ADC_IsActiveFlag_ADRDY + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_ADRDY(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_ADRDY) == (LL_ADC_FLAG_ADRDY)); +} + +/** + * @brief Get flag ADC group regular end of unitary conversion. + * @rmtoll ISR EOC LL_ADC_IsActiveFlag_EOC + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_EOC(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, ADC_ISR_EOC) == (ADC_ISR_EOC)); +} + +/** + * @brief Get flag ADC group regular end of sequence conversions. + * @rmtoll ISR EOS LL_ADC_IsActiveFlag_EOS + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_EOS(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_EOS) == (LL_ADC_FLAG_EOS)); +} + +/** + * @brief Get flag ADC group regular overrun. + * @rmtoll ISR OVR LL_ADC_IsActiveFlag_OVR + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_OVR(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_OVR) == (LL_ADC_FLAG_OVR)); +} + +/** + * @brief Get flag ADC group regular end of sampling phase. + * @rmtoll ISR EOSMP LL_ADC_IsActiveFlag_EOSMP + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_EOSMP(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_EOSMP) == (LL_ADC_FLAG_EOSMP)); +} + +/** + * @brief Get flag ADC group injected end of unitary conversion. + * @rmtoll ISR JEOC LL_ADC_IsActiveFlag_JEOC + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_JEOC(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_JEOC) == (LL_ADC_FLAG_JEOC)); +} + +/** + * @brief Get flag ADC group injected end of sequence conversions. + * @rmtoll ISR JEOS LL_ADC_IsActiveFlag_JEOS + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_JEOS(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_JEOS) == (LL_ADC_FLAG_JEOS)); +} + +/** + * @brief Get flag ADC group injected contexts queue overflow. + * @rmtoll ISR JQOVF LL_ADC_IsActiveFlag_JQOVF + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_JQOVF(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_JQOVF) == (LL_ADC_FLAG_JQOVF)); +} + +/** + * @brief Get flag ADC analog watchdog 1 flag + * @rmtoll ISR AWD1 LL_ADC_IsActiveFlag_AWD1 + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_AWD1(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_AWD1) == (LL_ADC_FLAG_AWD1)); +} + +/** + * @brief Get flag ADC analog watchdog 2. + * @rmtoll ISR AWD2 LL_ADC_IsActiveFlag_AWD2 + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_AWD2(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_AWD2) == (LL_ADC_FLAG_AWD2)); +} + +/** + * @brief Get flag ADC analog watchdog 3. + * @rmtoll ISR AWD3 LL_ADC_IsActiveFlag_AWD3 + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_AWD3(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->ISR, LL_ADC_FLAG_AWD3) == (LL_ADC_FLAG_AWD3)); +} + +/** + * @brief Clear flag ADC ready. + * @note On this STM32 series, flag LL_ADC_FLAG_ADRDY is raised when the ADC + * is enabled and when conversion clock is active. + * (not only core clock: this ADC has a dual clock domain) + * @rmtoll ISR ADRDY LL_ADC_ClearFlag_ADRDY + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_ADRDY(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_ADRDY); +} + +/** + * @brief Clear flag ADC group regular end of unitary conversion. + * @rmtoll ISR EOC LL_ADC_ClearFlag_EOC + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_EOC(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_EOC); +} + +/** + * @brief Clear flag ADC group regular end of sequence conversions. + * @rmtoll ISR EOS LL_ADC_ClearFlag_EOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_EOS(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_EOS); +} + +/** + * @brief Clear flag ADC group regular overrun. + * @rmtoll ISR OVR LL_ADC_ClearFlag_OVR + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_OVR(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_OVR); +} + +/** + * @brief Clear flag ADC group regular end of sampling phase. + * @rmtoll ISR EOSMP LL_ADC_ClearFlag_EOSMP + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_EOSMP(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_EOSMP); +} + +/** + * @brief Clear flag ADC group injected end of unitary conversion. + * @rmtoll ISR JEOC LL_ADC_ClearFlag_JEOC + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_JEOC(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_JEOC); +} + +/** + * @brief Clear flag ADC group injected end of sequence conversions. + * @rmtoll ISR JEOS LL_ADC_ClearFlag_JEOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_JEOS(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_JEOS); +} + +/** + * @brief Clear flag ADC group injected contexts queue overflow. + * @rmtoll ISR JQOVF LL_ADC_ClearFlag_JQOVF + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_JQOVF(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_JQOVF); +} + +/** + * @brief Clear flag ADC analog watchdog 1. + * @rmtoll ISR AWD1 LL_ADC_ClearFlag_AWD1 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_AWD1(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_AWD1); +} + +/** + * @brief Clear flag ADC analog watchdog 2. + * @rmtoll ISR AWD2 LL_ADC_ClearFlag_AWD2 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_AWD2(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_AWD2); +} + +/** + * @brief Clear flag ADC analog watchdog 3. + * @rmtoll ISR AWD3 LL_ADC_ClearFlag_AWD3 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_AWD3(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->ISR, LL_ADC_FLAG_AWD3); +} + +#if defined(ADC_MULTIMODE_SUPPORT) +/** + * @brief Get flag multimode ADC ready of the ADC master. + * @rmtoll CSR ADRDY_MST LL_ADC_IsActiveFlag_MST_ADRDY + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_ADRDY(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_ADRDY_MST) == (LL_ADC_FLAG_ADRDY_MST)); +} + +/** + * @brief Get flag multimode ADC ready of the ADC slave. + * @rmtoll CSR ADRDY_SLV LL_ADC_IsActiveFlag_SLV_ADRDY + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_ADRDY(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_ADRDY_SLV) == (LL_ADC_FLAG_ADRDY_SLV)); +} + +/** + * @brief Get flag multimode ADC group regular end of unitary conversion of the ADC master. + * @rmtoll CSR EOC_MST LL_ADC_IsActiveFlag_MST_EOC + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_EOC(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_EOC_SLV) == (LL_ADC_FLAG_EOC_SLV)); +} + +/** + * @brief Get flag multimode ADC group regular end of unitary conversion of the ADC slave. + * @rmtoll CSR EOC_SLV LL_ADC_IsActiveFlag_SLV_EOC + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_EOC(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_EOC_SLV) == (LL_ADC_FLAG_EOC_SLV)); +} + +/** + * @brief Get flag multimode ADC group regular end of sequence conversions of the ADC master. + * @rmtoll CSR EOS_MST LL_ADC_IsActiveFlag_MST_EOS + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_EOS(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_EOS_MST) == (LL_ADC_FLAG_EOS_MST)); +} + +/** + * @brief Get flag multimode ADC group regular end of sequence conversions of the ADC slave. + * @rmtoll CSR EOS_SLV LL_ADC_IsActiveFlag_SLV_EOS + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_EOS(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_EOS_SLV) == (LL_ADC_FLAG_EOS_SLV)); +} + +/** + * @brief Get flag multimode ADC group regular overrun of the ADC master. + * @rmtoll CSR OVR_MST LL_ADC_IsActiveFlag_MST_OVR + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_OVR(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_OVR_MST) == (LL_ADC_FLAG_OVR_MST)); +} + +/** + * @brief Get flag multimode ADC group regular overrun of the ADC slave. + * @rmtoll CSR OVR_SLV LL_ADC_IsActiveFlag_SLV_OVR + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_OVR(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_OVR_SLV) == (LL_ADC_FLAG_OVR_SLV)); +} + +/** + * @brief Get flag multimode ADC group regular end of sampling of the ADC master. + * @rmtoll CSR EOSMP_MST LL_ADC_IsActiveFlag_MST_EOSMP + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_EOSMP(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_EOSMP_MST) == (LL_ADC_FLAG_EOSMP_MST)); +} + +/** + * @brief Get flag multimode ADC group regular end of sampling of the ADC slave. + * @rmtoll CSR EOSMP_SLV LL_ADC_IsActiveFlag_SLV_EOSMP + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_EOSMP(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_EOSMP_SLV) == (LL_ADC_FLAG_EOSMP_SLV)); +} + +/** + * @brief Get flag multimode ADC group injected end of unitary conversion of the ADC master. + * @rmtoll CSR JEOC_MST LL_ADC_IsActiveFlag_MST_JEOC + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_JEOC(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_JEOC_MST) == (LL_ADC_FLAG_JEOC_MST)); +} + +/** + * @brief Get flag multimode ADC group injected end of unitary conversion of the ADC slave. + * @rmtoll CSR JEOC_SLV LL_ADC_IsActiveFlag_SLV_JEOC + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_JEOC(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_JEOC_SLV) == (LL_ADC_FLAG_JEOC_SLV)); +} + +/** + * @brief Get flag multimode ADC group injected end of sequence conversions of the ADC master. + * @rmtoll CSR JEOS_MST LL_ADC_IsActiveFlag_MST_JEOS + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_JEOS(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_JEOS_MST) == (LL_ADC_FLAG_JEOS_MST)); +} + +/** + * @brief Get flag multimode ADC group injected end of sequence conversions of the ADC slave. + * @rmtoll CSR JEOS_SLV LL_ADC_IsActiveFlag_SLV_JEOS + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_JEOS(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_JEOS_SLV) == (LL_ADC_FLAG_JEOS_SLV)); +} + +/** + * @brief Get flag multimode ADC group injected context queue overflow of the ADC master. + * @rmtoll CSR JQOVF_MST LL_ADC_IsActiveFlag_MST_JQOVF + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_JQOVF(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_JQOVF_MST) == (LL_ADC_FLAG_JQOVF_MST)); +} + +/** + * @brief Get flag multimode ADC group injected context queue overflow of the ADC slave. + * @rmtoll CSR JQOVF_SLV LL_ADC_IsActiveFlag_SLV_JQOVF + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_JQOVF(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_JQOVF_SLV) == (LL_ADC_FLAG_JQOVF_SLV)); +} + +/** + * @brief Get flag multimode ADC analog watchdog 1 of the ADC master. + * @rmtoll CSR AWD1_MST LL_ADC_IsActiveFlag_MST_AWD1 + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_AWD1(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_AWD1_MST) == (LL_ADC_FLAG_AWD1_MST)); +} + +/** + * @brief Get flag multimode analog watchdog 1 of the ADC slave. + * @rmtoll CSR AWD1_SLV LL_ADC_IsActiveFlag_SLV_AWD1 + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_AWD1(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_AWD1_SLV) == (LL_ADC_FLAG_AWD1_SLV)); +} + +/** + * @brief Get flag multimode ADC analog watchdog 2 of the ADC master. + * @rmtoll CSR AWD2_MST LL_ADC_IsActiveFlag_MST_AWD2 + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_AWD2(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_AWD2_MST) == (LL_ADC_FLAG_AWD2_MST)); +} + +/** + * @brief Get flag multimode ADC analog watchdog 2 of the ADC slave. + * @rmtoll CSR AWD2_SLV LL_ADC_IsActiveFlag_SLV_AWD2 + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_AWD2(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_AWD2_SLV) == (LL_ADC_FLAG_AWD2_SLV)); +} + +/** + * @brief Get flag multimode ADC analog watchdog 3 of the ADC master. + * @rmtoll CSR AWD3_MST LL_ADC_IsActiveFlag_MST_AWD3 + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_MST_AWD3(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_AWD3_MST) == (LL_ADC_FLAG_AWD3_MST)); +} + +/** + * @brief Get flag multimode ADC analog watchdog 3 of the ADC slave. + * @rmtoll CSR AWD3_SLV LL_ADC_IsActiveFlag_SLV_AWD3 + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_SLV_AWD3(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (READ_BIT(ADCxy_COMMON->CSR, LL_ADC_FLAG_AWD3_SLV) == (LL_ADC_FLAG_AWD3_SLV)); +} +#endif /* ADC_MULTIMODE_SUPPORT */ + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_IT_Management ADC IT management + * @{ + */ + +/** + * @brief Enable ADC ready. + * @rmtoll IER ADRDYIE LL_ADC_EnableIT_ADRDY + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_ADRDY(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_ADRDY); +} + +/** + * @brief Enable interruption ADC group regular end of unitary conversion. + * @rmtoll IER EOCIE LL_ADC_EnableIT_EOC + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_EOC(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_EOC); +} + +/** + * @brief Enable interruption ADC group regular end of sequence conversions. + * @rmtoll IER EOSIE LL_ADC_EnableIT_EOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_EOS(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_EOS); +} + +/** + * @brief Enable ADC group regular interruption overrun. + * @rmtoll IER OVRIE LL_ADC_EnableIT_OVR + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_OVR(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_OVR); +} + +/** + * @brief Enable interruption ADC group regular end of sampling. + * @rmtoll IER EOSMPIE LL_ADC_EnableIT_EOSMP + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_EOSMP(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_EOSMP); +} + +/** + * @brief Enable interruption ADC group injected end of unitary conversion. + * @rmtoll IER JEOCIE LL_ADC_EnableIT_JEOC + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_JEOC(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_JEOC); +} + +/** + * @brief Enable interruption ADC group injected end of sequence conversions. + * @rmtoll IER JEOSIE LL_ADC_EnableIT_JEOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_JEOS(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_JEOS); +} + +/** + * @brief Enable interruption ADC group injected context queue overflow. + * @rmtoll IER JQOVFIE LL_ADC_EnableIT_JQOVF + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_JQOVF(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_JQOVF); +} + +/** + * @brief Enable interruption ADC analog watchdog 1. + * @rmtoll IER AWD1IE LL_ADC_EnableIT_AWD1 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_AWD1(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_AWD1); +} + +/** + * @brief Enable interruption ADC analog watchdog 2. + * @rmtoll IER AWD2IE LL_ADC_EnableIT_AWD2 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_AWD2(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_AWD2); +} + +/** + * @brief Enable interruption ADC analog watchdog 3. + * @rmtoll IER AWD3IE LL_ADC_EnableIT_AWD3 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_AWD3(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->IER, LL_ADC_IT_AWD3); +} + +/** + * @brief Disable interruption ADC ready. + * @rmtoll IER ADRDYIE LL_ADC_DisableIT_ADRDY + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_ADRDY(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_ADRDY); +} + +/** + * @brief Disable interruption ADC group regular end of unitary conversion. + * @rmtoll IER EOCIE LL_ADC_DisableIT_EOC + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_EOC(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_EOC); +} + +/** + * @brief Disable interruption ADC group regular end of sequence conversions. + * @rmtoll IER EOSIE LL_ADC_DisableIT_EOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_EOS(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_EOS); +} + +/** + * @brief Disable interruption ADC group regular overrun. + * @rmtoll IER OVRIE LL_ADC_DisableIT_OVR + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_OVR(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_OVR); +} + +/** + * @brief Disable interruption ADC group regular end of sampling. + * @rmtoll IER EOSMPIE LL_ADC_DisableIT_EOSMP + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_EOSMP(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_EOSMP); +} + +/** + * @brief Disable interruption ADC group regular end of unitary conversion. + * @rmtoll IER JEOCIE LL_ADC_DisableIT_JEOC + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_JEOC(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_JEOC); +} + +/** + * @brief Disable interruption ADC group injected end of sequence conversions. + * @rmtoll IER JEOSIE LL_ADC_DisableIT_JEOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_JEOS(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_JEOS); +} + +/** + * @brief Disable interruption ADC group injected context queue overflow. + * @rmtoll IER JQOVFIE LL_ADC_DisableIT_JQOVF + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_JQOVF(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_JQOVF); +} + +/** + * @brief Disable interruption ADC analog watchdog 1. + * @rmtoll IER AWD1IE LL_ADC_DisableIT_AWD1 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_AWD1(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_AWD1); +} + +/** + * @brief Disable interruption ADC analog watchdog 2. + * @rmtoll IER AWD2IE LL_ADC_DisableIT_AWD2 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_AWD2(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_AWD2); +} + +/** + * @brief Disable interruption ADC analog watchdog 3. + * @rmtoll IER AWD3IE LL_ADC_DisableIT_AWD3 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_AWD3(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->IER, LL_ADC_IT_AWD3); +} + +/** + * @brief Get state of interruption ADC ready + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER ADRDYIE LL_ADC_IsEnabledIT_ADRDY + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_ADRDY(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_ADRDY) == (LL_ADC_IT_ADRDY)); +} + +/** + * @brief Get state of interruption ADC group regular end of unitary conversion + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER EOCIE LL_ADC_IsEnabledIT_EOC + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_EOC(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_EOC) == (LL_ADC_IT_EOC)); +} + +/** + * @brief Get state of interruption ADC group regular end of sequence conversions + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER EOSIE LL_ADC_IsEnabledIT_EOS + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_EOS(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_EOS) == (LL_ADC_IT_EOS)); +} + +/** + * @brief Get state of interruption ADC group regular overrun + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER OVRIE LL_ADC_IsEnabledIT_OVR + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_OVR(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_OVR) == (LL_ADC_IT_OVR)); +} + +/** + * @brief Get state of interruption ADC group regular end of sampling + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER EOSMPIE LL_ADC_IsEnabledIT_EOSMP + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_EOSMP(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_EOSMP) == (LL_ADC_IT_EOSMP)); +} + +/** + * @brief Get state of interruption ADC group injected end of unitary conversion + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER JEOCIE LL_ADC_IsEnabledIT_JEOC + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_JEOC(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_JEOC) == (LL_ADC_IT_JEOC)); +} + +/** + * @brief Get state of interruption ADC group injected end of sequence conversions + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER JEOSIE LL_ADC_IsEnabledIT_JEOS + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_JEOS(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_JEOS) == (LL_ADC_IT_JEOS)); +} + +/** + * @brief Get state of interruption ADC group injected context queue overflow interrupt state + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER JQOVFIE LL_ADC_IsEnabledIT_JQOVF + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_JQOVF(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_JQOVF) == (LL_ADC_IT_JQOVF)); +} + +/** + * @brief Get state of interruption ADC analog watchdog 1 + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER AWD1IE LL_ADC_IsEnabledIT_AWD1 + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_AWD1(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_AWD1) == (LL_ADC_IT_AWD1)); +} + +/** + * @brief Get state of interruption Get ADC analog watchdog 2 + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER AWD2IE LL_ADC_IsEnabledIT_AWD2 + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_AWD2(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_AWD2) == (LL_ADC_IT_AWD2)); +} + +/** + * @brief Get state of interruption Get ADC analog watchdog 3 + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll IER AWD3IE LL_ADC_IsEnabledIT_AWD3 + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_AWD3(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->IER, LL_ADC_IT_AWD3) == (LL_ADC_IT_AWD3)); +} + +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup ADC_LL_EF_Init Initialization and de-initialization functions + * @{ + */ + +/* Initialization of some features of ADC common parameters and multimode */ +ErrorStatus LL_ADC_CommonDeInit(ADC_Common_TypeDef *ADCxy_COMMON); +ErrorStatus LL_ADC_CommonInit(ADC_Common_TypeDef *ADCxy_COMMON, LL_ADC_CommonInitTypeDef *ADC_CommonInitStruct); +void LL_ADC_CommonStructInit(LL_ADC_CommonInitTypeDef *ADC_CommonInitStruct); + +/* De-initialization of ADC instance, ADC group regular and ADC group injected */ +/* (availability of ADC group injected depends on STM32 families) */ +ErrorStatus LL_ADC_DeInit(ADC_TypeDef *ADCx); + +/* Initialization of some features of ADC instance */ +ErrorStatus LL_ADC_Init(ADC_TypeDef *ADCx, LL_ADC_InitTypeDef *ADC_InitStruct); +void LL_ADC_StructInit(LL_ADC_InitTypeDef *ADC_InitStruct); + +/* Initialization of some features of ADC instance and ADC group regular */ +ErrorStatus LL_ADC_REG_Init(ADC_TypeDef *ADCx, LL_ADC_REG_InitTypeDef *ADC_REG_InitStruct); +void LL_ADC_REG_StructInit(LL_ADC_REG_InitTypeDef *ADC_REG_InitStruct); + +/* Initialization of some features of ADC instance and ADC group injected */ +ErrorStatus LL_ADC_INJ_Init(ADC_TypeDef *ADCx, LL_ADC_INJ_InitTypeDef *ADC_INJ_InitStruct); +void LL_ADC_INJ_StructInit(LL_ADC_INJ_InitTypeDef *ADC_INJ_InitStruct); + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* ADC1 || ADC2 || ADC3 || ADC4 */ + + +#endif /* STM32F301x8 || STM32F302x8 || STM32F302xC || STM32F302xE || STM32F303x8 || STM32F303xC || STM32F303xE || STM32F318xx || STM32F328xx || STM32F334x8 || STM32F358xx || STM32F398xx */ + +#if defined (ADC1_V2_5) + +#if defined (ADC1) + +/** @defgroup ADC_LL ADC + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup ADC_LL_Private_Constants ADC Private Constants + * @{ + */ + +/* Internal mask for ADC group regular sequencer: */ +/* To select into literal LL_ADC_REG_RANK_x the relevant bits for: */ +/* - sequencer register offset */ +/* - sequencer rank bits position into the selected register */ + +/* Internal register offset for ADC group regular sequencer configuration */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_SQR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_SQR2_REGOFFSET ((uint32_t)0x00000100U) +#define ADC_SQR3_REGOFFSET ((uint32_t)0x00000200U) +#define ADC_SQR4_REGOFFSET ((uint32_t)0x00000300U) + +#define ADC_REG_SQRX_REGOFFSET_MASK (ADC_SQR1_REGOFFSET | ADC_SQR2_REGOFFSET | ADC_SQR3_REGOFFSET | ADC_SQR4_REGOFFSET) +#define ADC_REG_RANK_ID_SQRX_MASK (ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0) + +/* Definition of ADC group regular sequencer bits information to be inserted */ +/* into ADC group regular sequencer ranks literals definition. */ +#define ADC_REG_RANK_1_SQRX_BITOFFSET_POS ((uint32_t) 0U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ1) */ +#define ADC_REG_RANK_2_SQRX_BITOFFSET_POS ((uint32_t) 5U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ2) */ +#define ADC_REG_RANK_3_SQRX_BITOFFSET_POS ((uint32_t)10U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ3) */ +#define ADC_REG_RANK_4_SQRX_BITOFFSET_POS ((uint32_t)15U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ4) */ +#define ADC_REG_RANK_5_SQRX_BITOFFSET_POS ((uint32_t)20U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ5) */ +#define ADC_REG_RANK_6_SQRX_BITOFFSET_POS ((uint32_t)25U) /* Value equivalent to POSITION_VAL(ADC_SQR3_SQ6) */ +#define ADC_REG_RANK_7_SQRX_BITOFFSET_POS ((uint32_t) 0U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ7) */ +#define ADC_REG_RANK_8_SQRX_BITOFFSET_POS ((uint32_t) 5U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ8) */ +#define ADC_REG_RANK_9_SQRX_BITOFFSET_POS ((uint32_t)10U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ9) */ +#define ADC_REG_RANK_10_SQRX_BITOFFSET_POS ((uint32_t)15U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ10) */ +#define ADC_REG_RANK_11_SQRX_BITOFFSET_POS ((uint32_t)20U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ11) */ +#define ADC_REG_RANK_12_SQRX_BITOFFSET_POS ((uint32_t)25U) /* Value equivalent to POSITION_VAL(ADC_SQR2_SQ12) */ +#define ADC_REG_RANK_13_SQRX_BITOFFSET_POS ((uint32_t) 0U) /* Value equivalent to POSITION_VAL(ADC_SQR1_SQ13) */ +#define ADC_REG_RANK_14_SQRX_BITOFFSET_POS ((uint32_t) 5U) /* Value equivalent to POSITION_VAL(ADC_SQR1_SQ14) */ +#define ADC_REG_RANK_15_SQRX_BITOFFSET_POS ((uint32_t)10U) /* Value equivalent to POSITION_VAL(ADC_SQR1_SQ15) */ +#define ADC_REG_RANK_16_SQRX_BITOFFSET_POS ((uint32_t)15U) /* Value equivalent to POSITION_VAL(ADC_SQR1_SQ16) */ + + + +/* Internal mask for ADC group injected sequencer: */ +/* To select into literal LL_ADC_INJ_RANK_x the relevant bits for: */ +/* - data register offset */ +/* - offset register offset */ +/* - sequencer rank bits position into the selected register */ + +/* Internal register offset for ADC group injected data register */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_JDR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_JDR2_REGOFFSET ((uint32_t)0x00000100U) +#define ADC_JDR3_REGOFFSET ((uint32_t)0x00000200U) +#define ADC_JDR4_REGOFFSET ((uint32_t)0x00000300U) + +/* Internal register offset for ADC group injected offset configuration */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_JOFR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_JOFR2_REGOFFSET ((uint32_t)0x00001000U) +#define ADC_JOFR3_REGOFFSET ((uint32_t)0x00002000U) +#define ADC_JOFR4_REGOFFSET ((uint32_t)0x00003000U) + +#define ADC_INJ_JDRX_REGOFFSET_MASK (ADC_JDR1_REGOFFSET | ADC_JDR2_REGOFFSET | ADC_JDR3_REGOFFSET | ADC_JDR4_REGOFFSET) +#define ADC_INJ_JOFRX_REGOFFSET_MASK (ADC_JOFR1_REGOFFSET | ADC_JOFR2_REGOFFSET | ADC_JOFR3_REGOFFSET | ADC_JOFR4_REGOFFSET) +#define ADC_INJ_RANK_ID_JSQR_MASK (ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0) + +/* Definition of ADC group injected sequencer bits information to be inserted */ +/* into ADC group injected sequencer ranks literals definition. */ +#define ADC_INJ_RANK_1_JSQR_BITOFFSET_POS ((uint32_t) 0U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JSQ1) */ +#define ADC_INJ_RANK_2_JSQR_BITOFFSET_POS ((uint32_t) 5U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JSQ2) */ +#define ADC_INJ_RANK_3_JSQR_BITOFFSET_POS ((uint32_t)10U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JSQ3) */ +#define ADC_INJ_RANK_4_JSQR_BITOFFSET_POS ((uint32_t)15U) /* Value equivalent to POSITION_VAL(ADC_JSQR_JSQ4) */ + + + +/* Internal mask for ADC channel: */ +/* To select into literal LL_ADC_CHANNEL_x the relevant bits for: */ +/* - channel identifier defined by number */ +/* - channel differentiation between external channels (connected to */ +/* GPIO pins) and internal channels (connected to internal paths) */ +/* - channel sampling time defined by SMPRx register offset */ +/* and SMPx bits positions into SMPRx register */ +#define ADC_CHANNEL_ID_NUMBER_MASK (ADC_CR1_AWDCH) +#define ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS ((uint32_t) 0U)/* Value equivalent to POSITION_VAL(ADC_CHANNEL_ID_NUMBER_MASK) */ +#define ADC_CHANNEL_ID_MASK (ADC_CHANNEL_ID_NUMBER_MASK | ADC_CHANNEL_ID_INTERNAL_CH_MASK) +/* Equivalent mask of ADC_CHANNEL_NUMBER_MASK aligned on register LSB (bit 0) */ +#define ADC_CHANNEL_ID_NUMBER_MASK_POSBIT0 ((uint32_t)0x0000001FU) /* Equivalent to shift: (ADC_CHANNEL_NUMBER_MASK >> POSITION_VAL(ADC_CHANNEL_NUMBER_MASK)) */ + +/* Channel differentiation between external and internal channels */ +#define ADC_CHANNEL_ID_INTERNAL_CH ((uint32_t)0x80000000U) /* Marker of internal channel */ +#define ADC_CHANNEL_ID_INTERNAL_CH_2 ((uint32_t)0x40000000U) /* Marker of internal channel for other ADC instances, in case of different ADC internal channels mapped on same channel number on different ADC instances */ +#define ADC_CHANNEL_ID_INTERNAL_CH_MASK (ADC_CHANNEL_ID_INTERNAL_CH | ADC_CHANNEL_ID_INTERNAL_CH_2) + +/* Internal register offset for ADC channel sampling time configuration */ +/* (offset placed into a spare area of literal definition) */ +#define ADC_SMPR1_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_SMPR2_REGOFFSET ((uint32_t)0x02000000U) +#define ADC_CHANNEL_SMPRX_REGOFFSET_MASK (ADC_SMPR1_REGOFFSET | ADC_SMPR2_REGOFFSET) + +#define ADC_CHANNEL_SMPx_BITOFFSET_MASK ((uint32_t)0x01F00000U) +#define ADC_CHANNEL_SMPx_BITOFFSET_POS ((uint32_t)20U) /* Value equivalent to POSITION_VAL(ADC_CHANNEL_SMPx_BITOFFSET_MASK) */ + +/* Definition of channels ID number information to be inserted into */ +/* channels literals definition. */ +#define ADC_CHANNEL_0_NUMBER ((uint32_t)0x00000000U) +#define ADC_CHANNEL_1_NUMBER ( ADC_CR1_AWDCH_0) +#define ADC_CHANNEL_2_NUMBER ( ADC_CR1_AWDCH_1 ) +#define ADC_CHANNEL_3_NUMBER ( ADC_CR1_AWDCH_1 | ADC_CR1_AWDCH_0) +#define ADC_CHANNEL_4_NUMBER ( ADC_CR1_AWDCH_2 ) +#define ADC_CHANNEL_5_NUMBER ( ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_0) +#define ADC_CHANNEL_6_NUMBER ( ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_1 ) +#define ADC_CHANNEL_7_NUMBER ( ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_1 | ADC_CR1_AWDCH_0) +#define ADC_CHANNEL_8_NUMBER ( ADC_CR1_AWDCH_3 ) +#define ADC_CHANNEL_9_NUMBER ( ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_0) +#define ADC_CHANNEL_10_NUMBER ( ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_1 ) +#define ADC_CHANNEL_11_NUMBER ( ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_1 | ADC_CR1_AWDCH_0) +#define ADC_CHANNEL_12_NUMBER ( ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_2 ) +#define ADC_CHANNEL_13_NUMBER ( ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_0) +#define ADC_CHANNEL_14_NUMBER ( ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_1 ) +#define ADC_CHANNEL_15_NUMBER ( ADC_CR1_AWDCH_3 | ADC_CR1_AWDCH_2 | ADC_CR1_AWDCH_1 | ADC_CR1_AWDCH_0) +#define ADC_CHANNEL_16_NUMBER (ADC_CR1_AWDCH_4 ) +#define ADC_CHANNEL_17_NUMBER (ADC_CR1_AWDCH_4 | ADC_CR1_AWDCH_0) + +/* Definition of channels sampling time information to be inserted into */ +/* channels literals definition. */ +#define ADC_CHANNEL_0_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t) 0U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP0) */ +#define ADC_CHANNEL_1_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t) 3U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP1) */ +#define ADC_CHANNEL_2_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t) 6U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP2) */ +#define ADC_CHANNEL_3_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t) 9U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP3) */ +#define ADC_CHANNEL_4_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)12U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP4) */ +#define ADC_CHANNEL_5_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)15U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP5) */ +#define ADC_CHANNEL_6_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)18U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP6) */ +#define ADC_CHANNEL_7_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)21U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP7) */ +#define ADC_CHANNEL_8_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)24U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP8) */ +#define ADC_CHANNEL_9_SMP (ADC_SMPR2_REGOFFSET | (((uint32_t)27U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR2_SMP9) */ +#define ADC_CHANNEL_10_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t) 0U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP10) */ +#define ADC_CHANNEL_11_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t) 3U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP11) */ +#define ADC_CHANNEL_12_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t) 6U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP12) */ +#define ADC_CHANNEL_13_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t) 9U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP13) */ +#define ADC_CHANNEL_14_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)12U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP14) */ +#define ADC_CHANNEL_15_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)15U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP15) */ +#define ADC_CHANNEL_16_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)18U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP16) */ +#define ADC_CHANNEL_17_SMP (ADC_SMPR1_REGOFFSET | (((uint32_t)21U) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) /* Value shifted is equivalent to POSITION_VAL(ADC_SMPR1_SMP17) */ + + +/* Internal mask for ADC analog watchdog: */ +/* To select into literals LL_ADC_AWD_CHANNELx_xxx the relevant bits for: */ +/* (concatenation of multiple bits used in different analog watchdogs, */ +/* (feature of several watchdogs not available on all STM32 families)). */ +/* - analog watchdog 1: monitored channel defined by number, */ +/* selection of ADC group (ADC groups regular and-or injected). */ + +/* Internal register offset for ADC analog watchdog channel configuration */ +#define ADC_AWD_CR1_REGOFFSET ((uint32_t)0x00000000U) + +#define ADC_AWD_CRX_REGOFFSET_MASK (ADC_AWD_CR1_REGOFFSET) + +#define ADC_AWD_CR1_CHANNEL_MASK (ADC_CR1_AWDCH | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) +#define ADC_AWD_CR_ALL_CHANNEL_MASK (ADC_AWD_CR1_CHANNEL_MASK) + +/* Internal register offset for ADC analog watchdog threshold configuration */ +#define ADC_AWD_TR1_HIGH_REGOFFSET ((uint32_t)0x00000000U) +#define ADC_AWD_TR1_LOW_REGOFFSET ((uint32_t)0x00000001U) +#define ADC_AWD_TRX_REGOFFSET_MASK (ADC_AWD_TR1_HIGH_REGOFFSET | ADC_AWD_TR1_LOW_REGOFFSET) + + +/* ADC registers bits positions */ +#define ADC_CR1_DUALMOD_BITOFFSET_POS ((uint32_t)16U) /* Value equivalent to POSITION_VAL(ADC_CR1_DUALMOD) */ + + +/* ADC internal channels related definitions */ +/* Internal voltage reference VrefInt */ +#define VREFINT_CAL_ADDR ((uint16_t*) ((uint32_t)0x1FFFF7BAU)) /* Internal voltage reference, address of parameter VREFINT_CAL: VrefInt ADC raw data acquired at temperature 30 DegC (tolerance: +-5 DegC), Vref+ = 3.3 V (tolerance: +-10 mV). */ +#define VREFINT_CAL_VREF ((uint32_t) 3300U) /* Analog voltage reference (Vref+) value with which temperature sensor has been calibrated in production (tolerance: +-10 mV) (unit: mV). */ +/* Temperature sensor */ +#define TEMPSENSOR_CAL1_ADDR ((uint16_t*) ((uint32_t)0x1FFFF7B8U)) /* Internal temperature sensor, address of parameter TS_CAL1: On STM32F37x, temperature sensor ADC raw data acquired at temperature 30 DegC (tolerance: +-5 DegC), Vref+ = 3.3 V (tolerance: +-10 mV). */ +#define TEMPSENSOR_CAL2_ADDR ((uint16_t*) ((uint32_t)0x1FFFF7C2U)) /* Internal temperature sensor, address of parameter TS_CAL2: On STM32F37x, temperature sensor ADC raw data acquired at temperature 110 DegC (tolerance: +-5 DegC), Vref+ = 3.3 V (tolerance: +-10 mV). */ +#define TEMPSENSOR_CAL1_TEMP (( int32_t) 30) /* Internal temperature sensor, temperature at which temperature sensor has been calibrated in production for data into TEMPSENSOR_CAL1_ADDR (tolerance: +-5 DegC) (unit: DegC). */ +#define TEMPSENSOR_CAL2_TEMP (( int32_t) 110) /* Internal temperature sensor, temperature at which temperature sensor has been calibrated in production for data into TEMPSENSOR_CAL2_ADDR (tolerance: +-5 DegC) (unit: DegC). */ +#define TEMPSENSOR_CAL_VREFANALOG ((uint32_t) 3300U) /* Analog voltage reference (Vref+) voltage with which temperature sensor has been calibrated in production (+-10 mV) (unit: mV). */ + + +/** + * @} + */ + + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup ADC_LL_Private_Macros ADC Private Macros + * @{ + */ + +/** + * @brief Driver macro reserved for internal use: isolate bits with the + * selected mask and shift them to the register LSB + * (shift mask on register position bit 0). + * @param __BITS__ Bits in register 32 bits + * @param __MASK__ Mask in register 32 bits + * @retval Bits in register 32 bits + */ +#define __ADC_MASK_SHIFT(__BITS__, __MASK__) \ + (((__BITS__) & (__MASK__)) >> POSITION_VAL((__MASK__))) + +/** + * @brief Driver macro reserved for internal use: set a pointer to + * a register from a register basis from which an offset + * is applied. + * @param __REG__ Register basis from which the offset is applied. + * @param __REG_OFFFSET__ Offset to be applied (unit: number of registers). + * @retval Pointer to register address + */ +#define __ADC_PTR_REG_OFFSET(__REG__, __REG_OFFFSET__) \ + ((uint32_t *)((uint32_t) ((uint32_t)(&(__REG__)) + ((__REG_OFFFSET__) << 2U)))) + +/** + * @} + */ + + +/* Exported types ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup ADC_LL_ES_INIT ADC Exported Init structure + * @{ + */ + +/** + * @brief Structure definition of some features of ADC instance. + * @note These parameters have an impact on ADC scope: ADC instance. + * Affects both group regular and group injected (availability + * of ADC group injected depends on STM32 families). + * Refer to corresponding unitary functions into + * @ref ADC_LL_EF_Configuration_ADC_Instance . + * @note The setting of these parameters by function @ref LL_ADC_Init() + * is conditioned to ADC state: + * ADC instance must be disabled. + * This condition is applied to all ADC features, for efficiency + * and compatibility over all STM32 families. However, the different + * features can be set under different ADC state conditions + * (setting possible with ADC enabled without conversion on going, + * ADC enabled with conversion on going, ...) + * Each feature can be updated afterwards with a unitary function + * and potentially with ADC in a different state than disabled, + * refer to description of each function for setting + * conditioned to ADC state. + */ +typedef struct +{ + uint32_t DataAlignment; /*!< Set ADC conversion data alignment. + This parameter can be a value of @ref ADC_LL_EC_DATA_ALIGN + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetDataAlignment(). */ + + uint32_t SequencersScanMode; /*!< Set ADC scan selection. + This parameter can be a value of @ref ADC_LL_EC_SCAN_SELECTION + + This feature can be modified afterwards using unitary function @ref LL_ADC_SetSequencersScanMode(). */ + +} LL_ADC_InitTypeDef; + +/** + * @brief Structure definition of some features of ADC group regular. + * @note These parameters have an impact on ADC scope: ADC group regular. + * Refer to corresponding unitary functions into + * @ref ADC_LL_EF_Configuration_ADC_Group_Regular + * (functions with prefix "REG"). + * @note The setting of these parameters by function @ref LL_ADC_REG_Init() + * is conditioned to ADC state: + * ADC instance must be disabled. + * This condition is applied to all ADC features, for efficiency + * and compatibility over all STM32 families. However, the different + * features can be set under different ADC state conditions + * (setting possible with ADC enabled without conversion on going, + * ADC enabled with conversion on going, ...) + * Each feature can be updated afterwards with a unitary function + * and potentially with ADC in a different state than disabled, + * refer to description of each function for setting + * conditioned to ADC state. + */ +typedef struct +{ + uint32_t TriggerSource; /*!< Set ADC group regular conversion trigger source: internal (SW start) or external from timer or external interrupt. + This parameter can be a value of @ref ADC_LL_EC_REG_TRIGGER_SOURCE + @note On this STM32 series, external trigger is set with trigger polarity: rising edge + (only trigger polarity available on this STM32 series). + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetTriggerSource(). */ + + uint32_t SequencerLength; /*!< Set ADC group regular sequencer length. + This parameter can be a value of @ref ADC_LL_EC_REG_SEQ_SCAN_LENGTH + @note This parameter is discarded if scan mode is disabled (refer to parameter 'ADC_SequencersScanMode'). + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetSequencerLength(). */ + + uint32_t SequencerDiscont; /*!< Set ADC group regular sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks. + This parameter can be a value of @ref ADC_LL_EC_REG_SEQ_DISCONT_MODE + @note This parameter has an effect only if group regular sequencer is enabled + (scan length of 2 ranks or more). + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetSequencerDiscont(). */ + + uint32_t ContinuousMode; /*!< Set ADC continuous conversion mode on ADC group regular, whether ADC conversions are performed in single mode (one conversion per trigger) or in continuous mode (after the first trigger, following conversions launched successively automatically). + This parameter can be a value of @ref ADC_LL_EC_REG_CONTINUOUS_MODE + Note: It is not possible to enable both ADC group regular continuous mode and discontinuous mode. + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetContinuousMode(). */ + + uint32_t DMATransfer; /*!< Set ADC group regular conversion data transfer: no transfer or transfer by DMA, and DMA requests mode. + This parameter can be a value of @ref ADC_LL_EC_REG_DMA_TRANSFER + + This feature can be modified afterwards using unitary function @ref LL_ADC_REG_SetDMATransfer(). */ + +} LL_ADC_REG_InitTypeDef; + +/** + * @brief Structure definition of some features of ADC group injected. + * @note These parameters have an impact on ADC scope: ADC group injected. + * Refer to corresponding unitary functions into + * @ref ADC_LL_EF_Configuration_ADC_Group_Regular + * (functions with prefix "INJ"). + * @note The setting of these parameters by function @ref LL_ADC_INJ_Init() + * is conditioned to ADC state: + * ADC instance must be disabled. + * This condition is applied to all ADC features, for efficiency + * and compatibility over all STM32 families. However, the different + * features can be set under different ADC state conditions + * (setting possible with ADC enabled without conversion on going, + * ADC enabled with conversion on going, ...) + * Each feature can be updated afterwards with a unitary function + * and potentially with ADC in a different state than disabled, + * refer to description of each function for setting + * conditioned to ADC state. + */ +typedef struct +{ + uint32_t TriggerSource; /*!< Set ADC group injected conversion trigger source: internal (SW start) or external from timer or external interrupt. + This parameter can be a value of @ref ADC_LL_EC_INJ_TRIGGER_SOURCE + @note On this STM32 series, external trigger is set with trigger polarity: rising edge + (only trigger polarity available on this STM32 series). + + This feature can be modified afterwards using unitary function @ref LL_ADC_INJ_SetTriggerSource(). */ + + uint32_t SequencerLength; /*!< Set ADC group injected sequencer length. + This parameter can be a value of @ref ADC_LL_EC_INJ_SEQ_SCAN_LENGTH + @note This parameter is discarded if scan mode is disabled (refer to parameter 'ADC_SequencersScanMode'). + + This feature can be modified afterwards using unitary function @ref LL_ADC_INJ_SetSequencerLength(). */ + + uint32_t SequencerDiscont; /*!< Set ADC group injected sequencer discontinuous mode: sequence subdivided and scan conversions interrupted every selected number of ranks. + This parameter can be a value of @ref ADC_LL_EC_INJ_SEQ_DISCONT_MODE + @note This parameter has an effect only if group injected sequencer is enabled + (scan length of 2 ranks or more). + + This feature can be modified afterwards using unitary function @ref LL_ADC_INJ_SetSequencerDiscont(). */ + + uint32_t TrigAuto; /*!< Set ADC group injected conversion trigger: independent or from ADC group regular. + This parameter can be a value of @ref ADC_LL_EC_INJ_TRIG_AUTO + Note: This parameter must be set to set to independent trigger if injected trigger source is set to an external trigger. + + This feature can be modified afterwards using unitary function @ref LL_ADC_INJ_SetTrigAuto(). */ + +} LL_ADC_INJ_InitTypeDef; + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup ADC_LL_Exported_Constants ADC Exported Constants + * @{ + */ + +/** @defgroup ADC_LL_EC_FLAG ADC flags + * @brief Flags defines which can be used with LL_ADC_ReadReg function + * @{ + */ +#define LL_ADC_FLAG_STRT ADC_SR_STRT /*!< ADC flag ADC group regular conversion start */ +#define LL_ADC_FLAG_EOS ADC_SR_EOC /*!< ADC flag ADC group regular end of sequence conversions (Note: on this STM32 series, there is no flag ADC group regular end of unitary conversion. Flag noted as "EOC" is corresponding to flag "EOS" in other STM32 families) */ +#define LL_ADC_FLAG_JSTRT ADC_SR_JSTRT /*!< ADC flag ADC group injected conversion start */ +#define LL_ADC_FLAG_JEOS ADC_SR_JEOC /*!< ADC flag ADC group injected end of sequence conversions (Note: on this STM32 series, there is no flag ADC group injected end of unitary conversion. Flag noted as "JEOC" is corresponding to flag "JEOS" in other STM32 families) */ +#define LL_ADC_FLAG_AWD1 ADC_SR_AWD /*!< ADC flag ADC analog watchdog 1 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_IT ADC interruptions for configuration (interruption enable or disable) + * @brief IT defines which can be used with LL_ADC_ReadReg and LL_ADC_WriteReg functions + * @{ + */ +#define LL_ADC_IT_EOS ADC_CR1_EOCIE /*!< ADC interruption ADC group regular end of sequence conversions (Note: on this STM32 series, there is no flag ADC group regular end of unitary conversion. Flag noted as "EOC" is corresponding to flag "EOS" in other STM32 families) */ +#define LL_ADC_IT_JEOS ADC_CR1_JEOCIE /*!< ADC interruption ADC group injected end of sequence conversions (Note: on this STM32 series, there is no flag ADC group injected end of unitary conversion. Flag noted as "JEOC" is corresponding to flag "JEOS" in other STM32 families) */ +#define LL_ADC_IT_AWD1 ADC_CR1_AWDIE /*!< ADC interruption ADC analog watchdog 1 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REGISTERS ADC registers compliant with specific purpose + * @{ + */ +/* List of ADC registers intended to be used (most commonly) with */ +/* DMA transfer. */ +/* Refer to function @ref LL_ADC_DMA_GetRegAddr(). */ +#define LL_ADC_DMA_REG_REGULAR_DATA ((uint32_t)0x00000000U) /* ADC group regular conversion data register (corresponding to register DR) to be used with ADC configured in independent mode. Without DMA transfer, register accessed by LL function @ref LL_ADC_REG_ReadConversionData32() and other functions @ref LL_ADC_REG_ReadConversionDatax() */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_COMMON_PATH_INTERNAL ADC common - Measurement path to internal channels + * @{ + */ +/* Note: Other measurement paths to internal channels may be available */ +/* (connections to other peripherals). */ +/* If they are not listed below, they do not require any specific */ +/* path enable. In this case, Access to measurement path is done */ +/* only by selecting the corresponding ADC internal channel. */ +#define LL_ADC_PATH_INTERNAL_NONE ((uint32_t)0x00000000U)/*!< ADC measurement paths all disabled */ +#define LL_ADC_PATH_INTERNAL_VREFINT (ADC_CR2_TSVREFE) /*!< ADC measurement path to internal channel VrefInt */ +#define LL_ADC_PATH_INTERNAL_TEMPSENSOR (ADC_CR2_TSVREFE) /*!< ADC measurement path to internal channel temperature sensor */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_RESOLUTION ADC instance - Resolution + * @{ + */ +#define LL_ADC_RESOLUTION_12B ((uint32_t)0x00000000U) /*!< ADC resolution 12 bits */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_DATA_ALIGN ADC instance - Data alignment + * @{ + */ +#define LL_ADC_DATA_ALIGN_RIGHT ((uint32_t)0x00000000U)/*!< ADC conversion data alignment: right aligned (alignment on data register LSB bit 0)*/ +#define LL_ADC_DATA_ALIGN_LEFT (ADC_CR2_ALIGN) /*!< ADC conversion data alignment: left aligned (alignment on data register MSB bit 15)*/ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_SCAN_SELECTION ADC instance - Scan selection + * @{ + */ +#define LL_ADC_SEQ_SCAN_DISABLE ((uint32_t)0x00000000U) /*!< ADC conversion is performed in unitary conversion mode (one channel converted, that defined in rank 1). Configuration of both groups regular and injected sequencers (sequence length, ...) is discarded: equivalent to length of 1 rank.*/ +#define LL_ADC_SEQ_SCAN_ENABLE ((uint32_t)ADC_CR1_SCAN) /*!< ADC conversions are performed in sequence conversions mode, according to configuration of both groups regular and injected sequencers (sequence length, ...). */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_GROUPS ADC instance - Groups + * @{ + */ +#define LL_ADC_GROUP_REGULAR ((uint32_t)0x00000001U) /*!< ADC group regular (available on all STM32 devices) */ +#define LL_ADC_GROUP_INJECTED ((uint32_t)0x00000002U) /*!< ADC group injected (not available on all STM32 devices)*/ +#define LL_ADC_GROUP_REGULAR_INJECTED ((uint32_t)0x00000003U) /*!< ADC both groups regular and injected */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_CHANNEL ADC instance - Channel number + * @{ + */ +#define LL_ADC_CHANNEL_0 (ADC_CHANNEL_0_NUMBER | ADC_CHANNEL_0_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN0 */ +#define LL_ADC_CHANNEL_1 (ADC_CHANNEL_1_NUMBER | ADC_CHANNEL_1_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN1 */ +#define LL_ADC_CHANNEL_2 (ADC_CHANNEL_2_NUMBER | ADC_CHANNEL_2_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN2 */ +#define LL_ADC_CHANNEL_3 (ADC_CHANNEL_3_NUMBER | ADC_CHANNEL_3_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN3 */ +#define LL_ADC_CHANNEL_4 (ADC_CHANNEL_4_NUMBER | ADC_CHANNEL_4_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN4 */ +#define LL_ADC_CHANNEL_5 (ADC_CHANNEL_5_NUMBER | ADC_CHANNEL_5_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN5 */ +#define LL_ADC_CHANNEL_6 (ADC_CHANNEL_6_NUMBER | ADC_CHANNEL_6_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN6 */ +#define LL_ADC_CHANNEL_7 (ADC_CHANNEL_7_NUMBER | ADC_CHANNEL_7_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN7 */ +#define LL_ADC_CHANNEL_8 (ADC_CHANNEL_8_NUMBER | ADC_CHANNEL_8_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN8 */ +#define LL_ADC_CHANNEL_9 (ADC_CHANNEL_9_NUMBER | ADC_CHANNEL_9_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN9 */ +#define LL_ADC_CHANNEL_10 (ADC_CHANNEL_10_NUMBER | ADC_CHANNEL_10_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN10 */ +#define LL_ADC_CHANNEL_11 (ADC_CHANNEL_11_NUMBER | ADC_CHANNEL_11_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN11 */ +#define LL_ADC_CHANNEL_12 (ADC_CHANNEL_12_NUMBER | ADC_CHANNEL_12_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN12 */ +#define LL_ADC_CHANNEL_13 (ADC_CHANNEL_13_NUMBER | ADC_CHANNEL_13_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN13 */ +#define LL_ADC_CHANNEL_14 (ADC_CHANNEL_14_NUMBER | ADC_CHANNEL_14_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN14 */ +#define LL_ADC_CHANNEL_15 (ADC_CHANNEL_15_NUMBER | ADC_CHANNEL_15_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN15 */ +#define LL_ADC_CHANNEL_16 (ADC_CHANNEL_16_NUMBER | ADC_CHANNEL_16_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN16 */ +#define LL_ADC_CHANNEL_17 (ADC_CHANNEL_17_NUMBER | ADC_CHANNEL_17_SMP) /*!< ADC external channel (channel connected to GPIO pin) ADCx_IN17 */ +#define LL_ADC_CHANNEL_VREFINT (LL_ADC_CHANNEL_17 | ADC_CHANNEL_ID_INTERNAL_CH) /*!< ADC internal channel connected to VrefInt: Internal voltage reference. On STM32F37x, ADC channel available only on ADC instance: ADC1. */ +#define LL_ADC_CHANNEL_TEMPSENSOR (LL_ADC_CHANNEL_16 | ADC_CHANNEL_ID_INTERNAL_CH) /*!< ADC internal channel connected to Temperature sensor. */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_TRIGGER_SOURCE ADC group regular - Trigger source + * @{ + */ +#define LL_ADC_REG_TRIG_SOFTWARE (ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_1 | ADC_CR2_EXTSEL_0) /*!< ADC group regular conversion trigger internal (SW start) */ +#define LL_ADC_REG_TRIG_EXT_TIM2_CH2 (ADC_CR2_EXTSEL_1 | ADC_CR2_EXTSEL_0) /*!< ADC group regular conversion trigger external from TIM2 CC2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM3_TRGO (ADC_CR2_EXTSEL_2) /*!< ADC group regular conversion trigger external from TIM3 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM4_CH2 (ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_0) /*!< ADC group regular conversion trigger external from TIM4 CC4. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM19_TRGO ((uint32_t)0x00000000U) /*!< ADC group regular conversion trigger external from TIM19 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM19_CH3 (ADC_CR2_EXTSEL_0) /*!< ADC group regular conversion trigger external from TIM19 CC3. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_TIM19_CH4 (ADC_CR2_EXTSEL_1) /*!< ADC group regular conversion trigger external from TIM19 CC4. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_REG_TRIG_EXT_EXTI_LINE11 (ADC_CR2_EXTSEL_2 | ADC_CR2_EXTSEL_1) /*!< ADC group regular conversion trigger external interrupt line 11. Trigger edge set to rising edge (default setting). */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_TRIGGER_EDGE ADC group regular - Trigger edge + * @{ + */ +#define LL_ADC_REG_TRIG_EXT_RISING ((uint32_t)0x00000000U) /*!< ADC group regular conversion trigger polarity set to rising edge */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_CONTINUOUS_MODE ADC group regular - Continuous mode +* @{ +*/ +#define LL_ADC_REG_CONV_SINGLE ((uint32_t)0x00000000U)/*!< ADC conversions are performed in single mode: one conversion per trigger */ +#define LL_ADC_REG_CONV_CONTINUOUS (ADC_CR2_CONT) /*!< ADC conversions are performed in continuous mode: after the first trigger, following conversions launched successively automatically */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_DMA_TRANSFER ADC group regular - DMA transfer + * @{ + */ +#define LL_ADC_REG_DMA_TRANSFER_NONE ((uint32_t)0x00000000U) /*!< ADC conversions are not transferred by DMA */ +#define LL_ADC_REG_DMA_TRANSFER_UNLIMITED (ADC_CR2_DMA) /*!< ADC conversions are transferred by DMA, in unlimited mode: DMA transfer requests are unlimited, whatever number of DMA data transferred (number of ADC conversions). This ADC mode is intended to be used with DMA mode circular. */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_SEQ_SCAN_LENGTH ADC group regular - Sequencer scan length + * @{ + */ +#define LL_ADC_REG_SEQ_SCAN_DISABLE ((uint32_t)0x00000000U) /*!< ADC group regular sequencer disable (equivalent to sequencer of 1 rank: ADC conversion on only 1 channel) */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_2RANKS ( ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 2 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_3RANKS ( ADC_SQR1_L_1 ) /*!< ADC group regular sequencer enable with 3 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_4RANKS ( ADC_SQR1_L_1 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 4 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_5RANKS ( ADC_SQR1_L_2 ) /*!< ADC group regular sequencer enable with 5 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_6RANKS ( ADC_SQR1_L_2 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 6 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_7RANKS ( ADC_SQR1_L_2 | ADC_SQR1_L_1 ) /*!< ADC group regular sequencer enable with 7 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_8RANKS ( ADC_SQR1_L_2 | ADC_SQR1_L_1 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 8 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_9RANKS (ADC_SQR1_L_3 ) /*!< ADC group regular sequencer enable with 9 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_10RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 10 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_11RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_1 ) /*!< ADC group regular sequencer enable with 11 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_12RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_1 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 12 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_13RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_2 ) /*!< ADC group regular sequencer enable with 13 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_14RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_2 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 14 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_15RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_2 | ADC_SQR1_L_1 ) /*!< ADC group regular sequencer enable with 15 ranks in the sequence */ +#define LL_ADC_REG_SEQ_SCAN_ENABLE_16RANKS (ADC_SQR1_L_3 | ADC_SQR1_L_2 | ADC_SQR1_L_1 | ADC_SQR1_L_0) /*!< ADC group regular sequencer enable with 16 ranks in the sequence */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_SEQ_DISCONT_MODE ADC group regular - Sequencer discontinuous mode + * @{ + */ +#define LL_ADC_REG_SEQ_DISCONT_DISABLE ((uint32_t)0x00000000U) /*!< ADC group regular sequencer discontinuous mode disable */ +#define LL_ADC_REG_SEQ_DISCONT_1RANK ( ADC_CR1_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every rank */ +#define LL_ADC_REG_SEQ_DISCONT_2RANKS ( ADC_CR1_DISCNUM_0 | ADC_CR1_DISCEN) /*!< ADC group regular sequencer discontinuous mode enabled with sequence interruption every 2 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_3RANKS ( ADC_CR1_DISCNUM_1 | ADC_CR1_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 3 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_4RANKS ( ADC_CR1_DISCNUM_1 | ADC_CR1_DISCNUM_0 | ADC_CR1_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 4 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_5RANKS (ADC_CR1_DISCNUM_2 | ADC_CR1_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 5 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_6RANKS (ADC_CR1_DISCNUM_2 | ADC_CR1_DISCNUM_0 | ADC_CR1_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 6 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_7RANKS (ADC_CR1_DISCNUM_2 | ADC_CR1_DISCNUM_1 | ADC_CR1_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 7 ranks */ +#define LL_ADC_REG_SEQ_DISCONT_8RANKS (ADC_CR1_DISCNUM_2 | ADC_CR1_DISCNUM_1 | ADC_CR1_DISCNUM_0 | ADC_CR1_DISCEN) /*!< ADC group regular sequencer discontinuous mode enable with sequence interruption every 8 ranks */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_REG_RANKS ADC group regular - Sequencer ranks + * @{ + */ +#define LL_ADC_REG_RANK_1 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_1_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 1 */ +#define LL_ADC_REG_RANK_2 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_2_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 2 */ +#define LL_ADC_REG_RANK_3 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_3_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 3 */ +#define LL_ADC_REG_RANK_4 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_4_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 4 */ +#define LL_ADC_REG_RANK_5 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_5_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 5 */ +#define LL_ADC_REG_RANK_6 (ADC_SQR3_REGOFFSET | ADC_REG_RANK_6_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 6 */ +#define LL_ADC_REG_RANK_7 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_7_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 7 */ +#define LL_ADC_REG_RANK_8 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_8_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 8 */ +#define LL_ADC_REG_RANK_9 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_9_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 9 */ +#define LL_ADC_REG_RANK_10 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_10_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 10 */ +#define LL_ADC_REG_RANK_11 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_11_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 11 */ +#define LL_ADC_REG_RANK_12 (ADC_SQR2_REGOFFSET | ADC_REG_RANK_12_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 12 */ +#define LL_ADC_REG_RANK_13 (ADC_SQR1_REGOFFSET | ADC_REG_RANK_13_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 13 */ +#define LL_ADC_REG_RANK_14 (ADC_SQR1_REGOFFSET | ADC_REG_RANK_14_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 14 */ +#define LL_ADC_REG_RANK_15 (ADC_SQR1_REGOFFSET | ADC_REG_RANK_15_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 15 */ +#define LL_ADC_REG_RANK_16 (ADC_SQR1_REGOFFSET | ADC_REG_RANK_16_SQRX_BITOFFSET_POS) /*!< ADC group regular sequencer rank 16 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_TRIGGER_SOURCE ADC group injected - Trigger source + * @{ + */ +#define LL_ADC_INJ_TRIG_SOFTWARE (ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0) /*!< ADC group injected conversion trigger internal (SW start) */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_TRGO (ADC_CR2_JEXTSEL_1) /*!< ADC group injected conversion trigger external from TIM2 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM2_CH1 (ADC_CR2_JEXTSEL_1 | ADC_CR2_JEXTSEL_0) /*!< ADC group injected conversion trigger external from TIM2 CC1. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM3_CH4 (ADC_CR2_JEXTSEL_2) /*!< ADC group injected conversion trigger external from TIM3 CC4. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM4_TRGO (ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_0) /*!< ADC group injected conversion trigger external from TIM4 TRGO. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM19_CH1 ((uint32_t)0x00000000U) /*!< ADC group injected conversion trigger external from TIM19 CC1. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_TIM19_CH2 (ADC_CR2_JEXTSEL_0) /*!< ADC group injected conversion trigger external from TIM19 CC2. Trigger edge set to rising edge (default setting). */ +#define LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 (ADC_CR2_JEXTSEL_2 | ADC_CR2_JEXTSEL_1) /*!< ADC group injected conversion trigger external interrupt line 15. Trigger edge set to rising edge (default setting). */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_TRIGGER_EDGE ADC group injected - Trigger edge + * @{ + */ +#define LL_ADC_INJ_TRIG_EXT_RISING ((uint32_t)0x00000000U) /*!< ADC group injected conversion trigger polarity set to rising edge */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_TRIG_AUTO ADC group injected - Automatic trigger mode +* @{ +*/ +#define LL_ADC_INJ_TRIG_INDEPENDENT ((uint32_t)0x00000000U)/*!< ADC group injected conversion trigger independent. Setting mandatory if ADC group injected injected trigger source is set to an external trigger. */ +#define LL_ADC_INJ_TRIG_FROM_GRP_REGULAR (ADC_CR1_JAUTO) /*!< ADC group injected conversion trigger from ADC group regular. Setting compliant only with group injected trigger source set to SW start, without any further action on ADC group injected conversion start or stop: in this case, ADC group injected is controlled only from ADC group regular. */ +/** + * @} + */ + + +/** @defgroup ADC_LL_EC_INJ_SEQ_SCAN_LENGTH ADC group injected - Sequencer scan length + * @{ + */ +#define LL_ADC_INJ_SEQ_SCAN_DISABLE ((uint32_t)0x00000000U) /*!< ADC group injected sequencer disable (equivalent to sequencer of 1 rank: ADC conversion on only 1 channel) */ +#define LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS ( ADC_JSQR_JL_0) /*!< ADC group injected sequencer enable with 2 ranks in the sequence */ +#define LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS (ADC_JSQR_JL_1 ) /*!< ADC group injected sequencer enable with 3 ranks in the sequence */ +#define LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS (ADC_JSQR_JL_1 | ADC_JSQR_JL_0) /*!< ADC group injected sequencer enable with 4 ranks in the sequence */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_SEQ_DISCONT_MODE ADC group injected - Sequencer discontinuous mode + * @{ + */ +#define LL_ADC_INJ_SEQ_DISCONT_DISABLE ((uint32_t)0x00000000U)/*!< ADC group injected sequencer discontinuous mode disable */ +#define LL_ADC_INJ_SEQ_DISCONT_1RANK (ADC_CR1_JDISCEN) /*!< ADC group injected sequencer discontinuous mode enable with sequence interruption every rank */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_INJ_RANKS ADC group injected - Sequencer ranks + * @{ + */ +#define LL_ADC_INJ_RANK_1 (ADC_JDR1_REGOFFSET | ADC_JOFR1_REGOFFSET | ADC_INJ_RANK_1_JSQR_BITOFFSET_POS) /*!< ADC group injected sequencer rank 1 */ +#define LL_ADC_INJ_RANK_2 (ADC_JDR2_REGOFFSET | ADC_JOFR2_REGOFFSET | ADC_INJ_RANK_2_JSQR_BITOFFSET_POS) /*!< ADC group injected sequencer rank 2 */ +#define LL_ADC_INJ_RANK_3 (ADC_JDR3_REGOFFSET | ADC_JOFR3_REGOFFSET | ADC_INJ_RANK_3_JSQR_BITOFFSET_POS) /*!< ADC group injected sequencer rank 3 */ +#define LL_ADC_INJ_RANK_4 (ADC_JDR4_REGOFFSET | ADC_JOFR4_REGOFFSET | ADC_INJ_RANK_4_JSQR_BITOFFSET_POS) /*!< ADC group injected sequencer rank 4 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_SAMPLINGTIME Channel - Sampling time + * @{ + */ +#define LL_ADC_SAMPLINGTIME_1CYCLE_5 ((uint32_t)0x00000000U) /*!< Sampling time 1.5 ADC clock cycle */ +#define LL_ADC_SAMPLINGTIME_7CYCLES_5 (ADC_SMPR2_SMP0_0) /*!< Sampling time 7.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_13CYCLES_5 (ADC_SMPR2_SMP0_1) /*!< Sampling time 13.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_28CYCLES_5 (ADC_SMPR2_SMP0_1 | ADC_SMPR2_SMP0_0) /*!< Sampling time 28.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_41CYCLES_5 (ADC_SMPR2_SMP0_2) /*!< Sampling time 41.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_55CYCLES_5 (ADC_SMPR2_SMP0_2 | ADC_SMPR2_SMP0_0) /*!< Sampling time 55.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_71CYCLES_5 (ADC_SMPR2_SMP0_2 | ADC_SMPR2_SMP0_1) /*!< Sampling time 71.5 ADC clock cycles */ +#define LL_ADC_SAMPLINGTIME_239CYCLES_5 (ADC_SMPR2_SMP0_2 | ADC_SMPR2_SMP0_1 | ADC_SMPR2_SMP0_0) /*!< Sampling time 239.5 ADC clock cycles */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_AWD_NUMBER Analog watchdog - Analog watchdog number + * @{ + */ +#define LL_ADC_AWD1 (ADC_AWD_CR1_CHANNEL_MASK | ADC_AWD_CR1_REGOFFSET) /*!< ADC analog watchdog number 1 */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_AWD_CHANNELS Analog watchdog - Monitored channels + * @{ + */ +#define LL_ADC_AWD_DISABLE ((uint32_t)0x00000000U) /*!< ADC analog watchdog monitoring disabled */ +#define LL_ADC_AWD_ALL_CHANNELS_REG ( ADC_CR1_AWDEN ) /*!< ADC analog watchdog monitoring of all channels, converted by group regular only */ +#define LL_ADC_AWD_ALL_CHANNELS_INJ ( ADC_CR1_JAWDEN ) /*!< ADC analog watchdog monitoring of all channels, converted by group injected only */ +#define LL_ADC_AWD_ALL_CHANNELS_REG_INJ ( ADC_CR1_JAWDEN | ADC_CR1_AWDEN ) /*!< ADC analog watchdog monitoring of all channels, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_0_REG ((LL_ADC_CHANNEL_0 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN0, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_0_INJ ((LL_ADC_CHANNEL_0 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN0, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_0_REG_INJ ((LL_ADC_CHANNEL_0 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN0, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_1_REG ((LL_ADC_CHANNEL_1 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN1, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_1_INJ ((LL_ADC_CHANNEL_1 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN1, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_1_REG_INJ ((LL_ADC_CHANNEL_1 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN1, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_2_REG ((LL_ADC_CHANNEL_2 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN2, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_2_INJ ((LL_ADC_CHANNEL_2 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN2, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_2_REG_INJ ((LL_ADC_CHANNEL_2 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN2, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_3_REG ((LL_ADC_CHANNEL_3 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN3, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_3_INJ ((LL_ADC_CHANNEL_3 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN3, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_3_REG_INJ ((LL_ADC_CHANNEL_3 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN3, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_4_REG ((LL_ADC_CHANNEL_4 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN4, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_4_INJ ((LL_ADC_CHANNEL_4 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN4, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_4_REG_INJ ((LL_ADC_CHANNEL_4 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN4, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_5_REG ((LL_ADC_CHANNEL_5 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN5, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_5_INJ ((LL_ADC_CHANNEL_5 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN5, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_5_REG_INJ ((LL_ADC_CHANNEL_5 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN5, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_6_REG ((LL_ADC_CHANNEL_6 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN6, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_6_INJ ((LL_ADC_CHANNEL_6 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN6, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_6_REG_INJ ((LL_ADC_CHANNEL_6 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN6, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_7_REG ((LL_ADC_CHANNEL_7 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN7, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_7_INJ ((LL_ADC_CHANNEL_7 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN7, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_7_REG_INJ ((LL_ADC_CHANNEL_7 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN7, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_8_REG ((LL_ADC_CHANNEL_8 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN8, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_8_INJ ((LL_ADC_CHANNEL_8 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN8, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_8_REG_INJ ((LL_ADC_CHANNEL_8 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN8, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_9_REG ((LL_ADC_CHANNEL_9 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN9, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_9_INJ ((LL_ADC_CHANNEL_9 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN9, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_9_REG_INJ ((LL_ADC_CHANNEL_9 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN9, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_10_REG ((LL_ADC_CHANNEL_10 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN10, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_10_INJ ((LL_ADC_CHANNEL_10 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN10, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_10_REG_INJ ((LL_ADC_CHANNEL_10 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN10, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_11_REG ((LL_ADC_CHANNEL_11 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN11, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_11_INJ ((LL_ADC_CHANNEL_11 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN11, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_11_REG_INJ ((LL_ADC_CHANNEL_11 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN11, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_12_REG ((LL_ADC_CHANNEL_12 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN12, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_12_INJ ((LL_ADC_CHANNEL_12 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN12, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_12_REG_INJ ((LL_ADC_CHANNEL_12 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN12, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_13_REG ((LL_ADC_CHANNEL_13 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN13, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_13_INJ ((LL_ADC_CHANNEL_13 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN13, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_13_REG_INJ ((LL_ADC_CHANNEL_13 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN13, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_14_REG ((LL_ADC_CHANNEL_14 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN14, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_14_INJ ((LL_ADC_CHANNEL_14 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN14, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_14_REG_INJ ((LL_ADC_CHANNEL_14 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN14, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_15_REG ((LL_ADC_CHANNEL_15 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN15, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_15_INJ ((LL_ADC_CHANNEL_15 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN15, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_15_REG_INJ ((LL_ADC_CHANNEL_15 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN15, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_16_REG ((LL_ADC_CHANNEL_16 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN16, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_16_INJ ((LL_ADC_CHANNEL_16 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN16, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_16_REG_INJ ((LL_ADC_CHANNEL_16 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN16, converted by either group regular or injected */ +#define LL_ADC_AWD_CHANNEL_17_REG ((LL_ADC_CHANNEL_17 & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN17, converted by group regular only */ +#define LL_ADC_AWD_CHANNEL_17_INJ ((LL_ADC_CHANNEL_17 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN17, converted by group injected only */ +#define LL_ADC_AWD_CHANNEL_17_REG_INJ ((LL_ADC_CHANNEL_17 & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC external channel (channel connected to GPIO pin) ADCx_IN17, converted by either group regular or injected */ +#define LL_ADC_AWD_CH_VREFINT_REG ((LL_ADC_CHANNEL_VREFINT & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to VrefInt: Internal voltage reference, converted by group regular only */ +#define LL_ADC_AWD_CH_VREFINT_INJ ((LL_ADC_CHANNEL_VREFINT & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to VrefInt: Internal voltage reference, converted by group injected only */ +#define LL_ADC_AWD_CH_VREFINT_REG_INJ ((LL_ADC_CHANNEL_VREFINT & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to VrefInt: Internal voltage reference, converted by either group regular or injected */ +#define LL_ADC_AWD_CH_TEMPSENSOR_REG ((LL_ADC_CHANNEL_TEMPSENSOR & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Temperature sensor, converted by group regular only */ +#define LL_ADC_AWD_CH_TEMPSENSOR_INJ ((LL_ADC_CHANNEL_TEMPSENSOR & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Temperature sensor, converted by group injected only */ +#define LL_ADC_AWD_CH_TEMPSENSOR_REG_INJ ((LL_ADC_CHANNEL_TEMPSENSOR & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) /*!< ADC analog watchdog monitoring of ADC internal channel connected to Temperature sensor, converted by either group regular or injected */ +/** + * @} + */ + +/** @defgroup ADC_LL_EC_AWD_THRESHOLDS Analog watchdog - Thresholds + * @{ + */ +#define LL_ADC_AWD_THRESHOLD_HIGH (ADC_AWD_TR1_HIGH_REGOFFSET) /*!< ADC analog watchdog threshold high */ +#define LL_ADC_AWD_THRESHOLD_LOW (ADC_AWD_TR1_LOW_REGOFFSET) /*!< ADC analog watchdog threshold low */ +/** + * @} + */ + + +/** @defgroup ADC_LL_EC_HW_DELAYS Definitions of ADC hardware constraints delays + * @note Only ADC IP HW delays are defined in ADC LL driver driver, + * not timeout values. + * For details on delays values, refer to descriptions in source code + * above each literal definition. + * @{ + */ + +/* Note: Only ADC IP HW delays are defined in ADC LL driver driver, */ +/* not timeout values. */ +/* Timeout values for ADC operations are dependent to device clock */ +/* configuration (system clock versus ADC clock), */ +/* and therefore must be defined in user application. */ +/* Indications for estimation of ADC timeout delays, for this */ +/* STM32 series: */ +/* - ADC enable time: maximum delay is 1us */ +/* (refer to device datasheet, parameter "tSTAB") */ +/* - ADC conversion time: duration depending on ADC clock and ADC */ +/* configuration. */ +/* (refer to device reference manual, section "Timing") */ + +/* Delay for temperature sensor stabilization time. */ +/* Literal set to maximum value (refer to device datasheet, */ +/* parameter "tSTART"). */ +/* Unit: us */ +#define LL_ADC_DELAY_TEMPSENSOR_STAB_US ((uint32_t) 10U) /*!< Delay for internal voltage reference stabilization time */ + +/* Delay required between ADC disable and ADC calibration start. */ +/* Note: On this STM32 series, before starting a calibration, */ +/* ADC must be disabled. */ +/* A minimum number of ADC clock cycles are required */ +/* between ADC disable state and calibration start. */ +/* Refer to literal @ref LL_ADC_DELAY_CALIB_ENABLE_ADC_CYCLES. */ +/* Wait time can be computed in user application by waiting for the */ +/* equivalent number of CPU cycles, by taking into account */ +/* ratio of CPU clock versus ADC clock prescalers. */ +/* Unit: ADC clock cycles. */ +#define LL_ADC_DELAY_DISABLE_CALIB_ADC_CYCLES ((uint32_t) 2U) /*!< Delay required between ADC disable and ADC calibration start */ + +/** + * @} + */ + +/** + * @} + */ + + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup ADC_LL_Exported_Macros ADC Exported Macros + * @{ + */ + +/** @defgroup ADC_LL_EM_WRITE_READ Common write and read registers Macros + * @{ + */ + +/** + * @brief Write a value in ADC register + * @param __INSTANCE__ ADC Instance + * @param __REG__ Register to be written + * @param __VALUE__ Value to be written in the register + * @retval None + */ +#define LL_ADC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) + +/** + * @brief Read a value in ADC register + * @param __INSTANCE__ ADC Instance + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_ADC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) +/** + * @} + */ + +/** @defgroup ADC_LL_EM_HELPER_MACRO ADC helper macro + * @{ + */ + +/** + * @brief Helper macro to get ADC channel number in decimal format + * from literals LL_ADC_CHANNEL_x. + * @note Example: + * __LL_ADC_CHANNEL_TO_DECIMAL_NB(LL_ADC_CHANNEL_4) + * will return decimal number "4". + * @note The input can be a value from functions where a channel + * number is returned, either defined with number + * or with bitfield (only one bit must be set). + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @retval Value between Min_Data=0 and Max_Data=18 + */ +#define __LL_ADC_CHANNEL_TO_DECIMAL_NB(__CHANNEL__) \ + (((__CHANNEL__) & ADC_CHANNEL_ID_NUMBER_MASK) >> ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) + +/** + * @brief Helper macro to get ADC channel in literal format LL_ADC_CHANNEL_x + * from number in decimal format. + * @note Example: + * __LL_ADC_DECIMAL_NB_TO_CHANNEL(4) + * will return a data equivalent to "LL_ADC_CHANNEL_4". + * @param __DECIMAL_NB__ Value between Min_Data=0 and Max_Data=18 + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1.\n + * (1) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + */ +#define __LL_ADC_DECIMAL_NB_TO_CHANNEL(__DECIMAL_NB__) \ + (((__DECIMAL_NB__) <= 9U) \ + ? ( \ + ((__DECIMAL_NB__) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) | \ + (ADC_SMPR2_REGOFFSET | (((uint32_t) (3U * (__DECIMAL_NB__))) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) \ + ) \ + : \ + ( \ + ((__DECIMAL_NB__) << ADC_CHANNEL_ID_NUMBER_BITOFFSET_POS) | \ + (ADC_SMPR1_REGOFFSET | (((uint32_t) (3U * ((__DECIMAL_NB__) - 10U))) << ADC_CHANNEL_SMPx_BITOFFSET_POS)) \ + ) \ + ) + +/** + * @brief Helper macro to determine whether the selected channel + * corresponds to literal definitions of driver. + * @note The different literal definitions of ADC channels are: + * - ADC internal channel: + * LL_ADC_CHANNEL_VREFINT, LL_ADC_CHANNEL_TEMPSENSOR, ... + * - ADC external channel (channel connected to a GPIO pin): + * LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ... + * @note The channel parameter must be a value defined from literal + * definition of a ADC internal channel (LL_ADC_CHANNEL_VREFINT, + * LL_ADC_CHANNEL_TEMPSENSOR, ...), + * ADC external channel (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...), + * must not be a value from functions where a channel number is + * returned from ADC registers, + * because internal and external channels share the same channel + * number in ADC registers. The differentiation is made only with + * parameters definitions of driver. + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @retval Value "0" if the channel corresponds to a parameter definition of a ADC external channel (channel connected to a GPIO pin) + * Value "1" if the channel corresponds to a parameter definition of a ADC internal channel + */ +#define __LL_ADC_IS_CHANNEL_INTERNAL(__CHANNEL__) \ + (((__CHANNEL__) & ADC_CHANNEL_ID_INTERNAL_CH_MASK) != 0U) + +/** + * @brief Helper macro to convert a channel defined from parameter + * definition of a ADC internal channel (LL_ADC_CHANNEL_VREFINT, + * LL_ADC_CHANNEL_TEMPSENSOR, ...), + * to its equivalent parameter definition of a ADC external channel + * (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...). + * @note The channel parameter can be, additionally to a value + * defined from parameter definition of a ADC internal channel + * (LL_ADC_CHANNEL_VREFINT, LL_ADC_CHANNEL_TEMPSENSOR, ...), + * a value defined from parameter definition of + * ADC external channel (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...) + * or a value from functions where a channel number is returned + * from ADC registers. + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + */ +#define __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(__CHANNEL__) \ + ((__CHANNEL__) & ~ADC_CHANNEL_ID_INTERNAL_CH_MASK) + +/** + * @brief Helper macro to determine whether the internal channel + * selected is available on the ADC instance selected. + * @note The channel parameter must be a value defined from parameter + * definition of a ADC internal channel (LL_ADC_CHANNEL_VREFINT, + * LL_ADC_CHANNEL_TEMPSENSOR, ...), + * must not be a value defined from parameter definition of + * ADC external channel (LL_ADC_CHANNEL_1, LL_ADC_CHANNEL_2, ...) + * or a value from functions where a channel number is + * returned from ADC registers, + * because internal and external channels share the same channel + * number in ADC registers. The differentiation is made only with + * parameters definitions of driver. + * @param __ADC_INSTANCE__ ADC instance + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @retval Value "0" if the internal channel selected is not available on the ADC instance selected. + * Value "1" if the internal channel selected is available on the ADC instance selected. + */ +#define __LL_ADC_IS_CHANNEL_INTERNAL_AVAILABLE(__ADC_INSTANCE__, __CHANNEL__) \ + (((__ADC_INSTANCE__) == ADC1) \ + ? ( \ + ((__CHANNEL__) == LL_ADC_CHANNEL_VREFINT) || \ + ((__CHANNEL__) == LL_ADC_CHANNEL_TEMPSENSOR) \ + ) \ + : \ + (0U) \ + ) + +/** + * @brief Helper macro to define ADC analog watchdog parameter: + * define a single channel to monitor with analog watchdog + * from sequencer channel and groups definition. + * @note To be used with function @ref LL_ADC_SetAnalogWDMonitChannels(). + * Example: + * LL_ADC_SetAnalogWDMonitChannels( + * ADC1, LL_ADC_AWD1, + * __LL_ADC_ANALOGWD_CHANNEL_GROUP(LL_ADC_CHANNEL4, LL_ADC_GROUP_REGULAR)) + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1.\n + * (1) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + * @param __GROUP__ This parameter can be one of the following values: + * @arg @ref LL_ADC_GROUP_REGULAR + * @arg @ref LL_ADC_GROUP_INJECTED + * @arg @ref LL_ADC_GROUP_REGULAR_INJECTED + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_AWD_DISABLE + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_INJ + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG + * @arg @ref LL_ADC_AWD_CHANNEL_0_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG + * @arg @ref LL_ADC_AWD_CHANNEL_1_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG + * @arg @ref LL_ADC_AWD_CHANNEL_2_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG + * @arg @ref LL_ADC_AWD_CHANNEL_3_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG + * @arg @ref LL_ADC_AWD_CHANNEL_4_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG + * @arg @ref LL_ADC_AWD_CHANNEL_5_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG + * @arg @ref LL_ADC_AWD_CHANNEL_6_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG + * @arg @ref LL_ADC_AWD_CHANNEL_7_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG + * @arg @ref LL_ADC_AWD_CHANNEL_8_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG + * @arg @ref LL_ADC_AWD_CHANNEL_9_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG + * @arg @ref LL_ADC_AWD_CHANNEL_10_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG + * @arg @ref LL_ADC_AWD_CHANNEL_11_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG + * @arg @ref LL_ADC_AWD_CHANNEL_12_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG + * @arg @ref LL_ADC_AWD_CHANNEL_13_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG + * @arg @ref LL_ADC_AWD_CHANNEL_14_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG + * @arg @ref LL_ADC_AWD_CHANNEL_15_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG + * @arg @ref LL_ADC_AWD_CHANNEL_16_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG + * @arg @ref LL_ADC_AWD_CHANNEL_17_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG_INJ + * @arg @ref LL_ADC_AWD_CH_VREFINT_REG (1) + * @arg @ref LL_ADC_AWD_CH_VREFINT_INJ (1) + * @arg @ref LL_ADC_AWD_CH_VREFINT_REG_INJ (1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_REG (1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_INJ (1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_REG_INJ (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + */ +#define __LL_ADC_ANALOGWD_CHANNEL_GROUP(__CHANNEL__, __GROUP__) \ + (((__GROUP__) == LL_ADC_GROUP_REGULAR) \ + ? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) \ + : \ + ((__GROUP__) == LL_ADC_GROUP_INJECTED) \ + ? (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL) \ + : \ + (((__CHANNEL__) & ADC_CHANNEL_ID_MASK) | ADC_CR1_JAWDEN | ADC_CR1_AWDEN | ADC_CR1_AWDSGL) \ + ) + +/** + * @brief Helper macro to set the value of ADC analog watchdog threshold high + * or low in function of ADC resolution, when ADC resolution is + * different of 12 bits. + * @note To be used with function @ref LL_ADC_SetAnalogWDThresholds(). + * Example, with a ADC resolution of 8 bits, to set the value of + * analog watchdog threshold high (on 8 bits): + * LL_ADC_SetAnalogWDThresholds + * (< ADCx param >, + * __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION(LL_ADC_RESOLUTION_8B, ) + * ); + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @param __AWD_THRESHOLD__ Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +/* Note: On this STM32 series, ADC is fixed to resolution 12 bits. */ +/* This macro has been kept anyway for compatibility with other */ +/* STM32 families featuring different ADC resolutions. */ +#define __LL_ADC_ANALOGWD_SET_THRESHOLD_RESOLUTION(__ADC_RESOLUTION__, __AWD_THRESHOLD__) \ + ((__AWD_THRESHOLD__) << (0U)) + +/** + * @brief Helper macro to get the value of ADC analog watchdog threshold high + * or low in function of ADC resolution, when ADC resolution is + * different of 12 bits. + * @note To be used with function @ref LL_ADC_GetAnalogWDThresholds(). + * Example, with a ADC resolution of 8 bits, to get the value of + * analog watchdog threshold high (on 8 bits): + * < threshold_value_6_bits > = __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION + * (LL_ADC_RESOLUTION_8B, + * LL_ADC_GetAnalogWDThresholds(, LL_ADC_AWD_THRESHOLD_HIGH) + * ); + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @param __AWD_THRESHOLD_12_BITS__ Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +/* Note: On this STM32 series, ADC is fixed to resolution 12 bits. */ +/* This macro has been kept anyway for compatibility with other */ +/* STM32 families featuring different ADC resolutions. */ +#define __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION(__ADC_RESOLUTION__, __AWD_THRESHOLD_12_BITS__) \ + (__AWD_THRESHOLD_12_BITS__) + +/** + * @brief Helper macro to select the ADC common instance + * to which is belonging the selected ADC instance. + * @note ADC common register instance can be used for: + * - Set parameters common to several ADC instances + * - Multimode (for devices with several ADC instances) + * Refer to functions having argument "ADCxy_COMMON" as parameter. + * @note On STM32F37x, there is no common ADC instance. + * However, ADC instance ADC1 has a role of common ADC instance + * (equivalence with other STM32 families featuring several + * ADC instances). + * @param __ADCx__ ADC instance + * @retval ADC common register instance + */ +#define __LL_ADC_COMMON_INSTANCE(__ADCx__) \ + (ADC1_COMMON) + +/** + * @brief Helper macro to check if all ADC instances sharing the same + * ADC common instance are disabled. + * @note This check is required by functions with setting conditioned to + * ADC state: + * All ADC instances of the ADC common group must be disabled. + * Refer to functions having argument "ADCxy_COMMON" as parameter. + * @note On devices with only 1 ADC common instance, parameter of this macro + * is useless and can be ignored (parameter kept for compatibility + * with devices featuring several ADC common instances). + * @note On STM32F37x, there is no common ADC instance. + * However, ADC instance ADC1 has a role of common ADC instance + * (equivalence with other STM32 families featuring several + * ADC instances). + * @param __ADCXY_COMMON__ ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval Value "0" All ADC instances sharing the same ADC common instance + * are disabled. + * Value "1" At least one ADC instance sharing the same ADC common instance + * is enabled + */ +#define __LL_ADC_IS_ENABLED_ALL_COMMON_INSTANCE(__ADCXY_COMMON__) \ + LL_ADC_IsEnabled(ADC1) + +/** + * @brief Helper macro to define the ADC conversion data full-scale digital + * value corresponding to the selected ADC resolution. + * @note ADC conversion data full-scale corresponds to voltage range + * determined by analog voltage references Vref+ and Vref- + * (refer to reference manual). + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @retval ADC conversion data equivalent voltage value (unit: mVolt) + */ +#define __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__) \ + ((uint32_t)0xFFFU) + +/** + * @brief Helper macro to convert the ADC conversion data from + * a resolution to another resolution. + * @note On STM32F37x, the only ADC resolution available is 12 bits. + * This macro has been kept for compatibility purpose over other + * STM32 families. + * @param __DATA__ ADC conversion data to be converted + * @param __ADC_RESOLUTION_CURRENT__ Resolution of to the data to be converted + * This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @param __ADC_RESOLUTION_TARGET__ Resolution of the data after conversion + * This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @retval ADC conversion data to the requested resolution + */ +#define __LL_ADC_CONVERT_DATA_RESOLUTION(__DATA__,\ + __ADC_RESOLUTION_CURRENT__,\ + __ADC_RESOLUTION_TARGET__) \ + (((__DATA__) \ + << ((__ADC_RESOLUTION_CURRENT__) >> (0U))) \ + >> ((__ADC_RESOLUTION_TARGET__) >> (0U)) \ + ) + +/** + * @brief Helper macro to calculate the voltage (unit: mVolt) + * corresponding to a ADC conversion data (unit: digital value). + * @note Analog reference voltage (Vref+) must be either known from + * user board environment or can be calculated using ADC measurement + * and ADC helper macro @ref __LL_ADC_CALC_VREFANALOG_VOLTAGE(). + * @param __VREFANALOG_VOLTAGE__ Analog reference voltage (unit: mV) + * @param __ADC_DATA__ ADC conversion data (resolution 12 bits) + * (unit: digital value). + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @retval ADC conversion data equivalent voltage value (unit: mVolt) + */ +#define __LL_ADC_CALC_DATA_TO_VOLTAGE(__VREFANALOG_VOLTAGE__,\ + __ADC_DATA__,\ + __ADC_RESOLUTION__) \ + ((__ADC_DATA__) * (__VREFANALOG_VOLTAGE__) \ + / __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__) \ + ) + + +/** + * @brief Helper macro to calculate analog reference voltage (Vref+) + * (unit: mVolt) from ADC conversion data of internal voltage + * reference VrefInt. + * @note Computation is using VrefInt calibration value + * stored in system memory for each device during production. + * @note This voltage depends on user board environment: voltage level + * connected to pin Vref+. + * On devices with small package, the pin Vref+ is not present + * and internally bonded to pin Vdda. + * @note On this STM32 series, calibration data of internal voltage reference + * VrefInt corresponds to a resolution of 12 bits, + * this is the recommended ADC resolution to convert voltage of + * internal voltage reference VrefInt. + * On STM32F37x, the only ADC resolution available is 12 bits. + * The parameter of ADC resolution is kept for compatibility purpose + * over other STM32 families. + * @param __VREFINT_ADC_DATA__ ADC conversion data (resolution 12 bits) + * of internal voltage reference VrefInt (unit: digital value). + * @param __ADC_RESOLUTION__ This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @retval Analog reference voltage (unit: mV) + */ +#define __LL_ADC_CALC_VREFANALOG_VOLTAGE(__VREFINT_ADC_DATA__,\ + __ADC_RESOLUTION__) \ + (((uint32_t)(*VREFINT_CAL_ADDR) * VREFINT_CAL_VREF) \ + / __LL_ADC_CONVERT_DATA_RESOLUTION((__VREFINT_ADC_DATA__), \ + (__ADC_RESOLUTION__), \ + LL_ADC_RESOLUTION_12B) \ + ) + +/** + * @brief Helper macro to calculate the temperature (unit: degree Celsius) + * from ADC conversion data of internal temperature sensor. + * @note Computation is using temperature sensor calibration values + * stored in system memory for each device during production. + * @note Calculation formula: + * Temperature = ((TS_ADC_DATA - TS_CAL1) + * * (TS_CAL2_TEMP - TS_CAL1_TEMP)) + * / (TS_CAL2 - TS_CAL1) + TS_CAL1_TEMP + * with TS_ADC_DATA = temperature sensor raw data measured by ADC + * Avg_Slope = (TS_CAL2 - TS_CAL1) + * / (TS_CAL2_TEMP - TS_CAL1_TEMP) + * TS_CAL1 = equivalent TS_ADC_DATA at temperature + * TEMP_DEGC_CAL1 (calibrated in factory) + * TS_CAL2 = equivalent TS_ADC_DATA at temperature + * TEMP_DEGC_CAL2 (calibrated in factory) + * Caution: Calculation relevancy under reserve that calibration + * parameters are correct (address and data). + * To calculate temperature using temperature sensor + * datasheet typical values (generic values less, therefore + * less accurate than calibrated values), + * use helper macro @ref __LL_ADC_CALC_TEMPERATURE_TYP_PARAMS(). + * @note As calculation input, the analog reference voltage (Vref+) must be + * defined as it impacts the ADC LSB equivalent voltage. + * @note Analog reference voltage (Vref+) must be either known from + * user board environment or can be calculated using ADC measurement + * and ADC helper macro @ref __LL_ADC_CALC_VREFANALOG_VOLTAGE(). + * @note On this STM32 series, calibration data of temperature sensor + * corresponds to a resolution of 12 bits, + * this is the recommended ADC resolution to convert voltage of + * temperature sensor. + * On STM32F37x, the only ADC resolution available is 12 bits. + * The parameter of ADC resolution is kept for compatibility purpose + * over other STM32 families. + * @param __VREFANALOG_VOLTAGE__ Analog reference voltage (unit: mV) + * @param __TEMPSENSOR_ADC_DATA__ ADC conversion data of internal + * temperature sensor (unit: digital value). + * @param __ADC_RESOLUTION__ ADC resolution at which internal temperature + * sensor voltage has been measured. + * This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @retval Temperature (unit: degree Celsius) + */ +#define __LL_ADC_CALC_TEMPERATURE(__VREFANALOG_VOLTAGE__,\ + __TEMPSENSOR_ADC_DATA__,\ + __ADC_RESOLUTION__) \ + (((( ((int32_t)((__LL_ADC_CONVERT_DATA_RESOLUTION((__TEMPSENSOR_ADC_DATA__), \ + (__ADC_RESOLUTION__), \ + LL_ADC_RESOLUTION_12B) \ + * (__VREFANALOG_VOLTAGE__)) \ + / TEMPSENSOR_CAL_VREFANALOG) \ + - (int32_t) *TEMPSENSOR_CAL1_ADDR) \ + ) * (int32_t)(TEMPSENSOR_CAL2_TEMP - TEMPSENSOR_CAL1_TEMP) \ + ) / (int32_t)((int32_t)*TEMPSENSOR_CAL2_ADDR - (int32_t)*TEMPSENSOR_CAL1_ADDR) \ + ) + TEMPSENSOR_CAL1_TEMP \ + ) + +/** + * @brief Helper macro to calculate the temperature (unit: degree Celsius) + * from ADC conversion data of internal temperature sensor. + * @note Computation is using temperature sensor typical values + * (refer to device datasheet). + * @note Calculation formula: + * Temperature = (TS_TYP_CALx_VOLT(uV) - TS_ADC_DATA * Conversion_uV) + * / Avg_Slope + CALx_TEMP + * with TS_ADC_DATA = temperature sensor raw data measured by ADC + * (unit: digital value) + * Avg_Slope = temperature sensor slope + * (unit: uV/Degree Celsius) + * TS_TYP_CALx_VOLT = temperature sensor digital value at + * temperature CALx_TEMP (unit: mV) + * Caution: Calculation relevancy under reserve the temperature sensor + * of the current device has characteristics in line with + * datasheet typical values. + * If temperature sensor calibration values are available on + * on this device (presence of macro __LL_ADC_CALC_TEMPERATURE()), + * temperature calculation will be more accurate using + * helper macro @ref __LL_ADC_CALC_TEMPERATURE(). + * @note As calculation input, the analog reference voltage (Vref+) must be + * defined as it impacts the ADC LSB equivalent voltage. + * @note Analog reference voltage (Vref+) must be either known from + * user board environment or can be calculated using ADC measurement + * and ADC helper macro @ref __LL_ADC_CALC_VREFANALOG_VOLTAGE(). + * @note ADC measurement data must correspond to a resolution of 12bits + * (full scale digital value 4095). If not the case, the data must be + * preliminarily rescaled to an equivalent resolution of 12 bits. + * @param __TEMPSENSOR_TYP_AVGSLOPE__ Device datasheet data: Temperature sensor slope typical value (unit: uV/DegCelsius). + * On STM32F37x, refer to device datasheet parameter "Avg_Slope". + * @param __TEMPSENSOR_TYP_CALX_V__ Device datasheet data: Temperature sensor voltage typical value (at temperature and Vref+ defined in parameters below) (unit: mV). + * On STM32F37x, refer to device datasheet parameter "V25". + * @param __TEMPSENSOR_CALX_TEMP__ Device datasheet data: Temperature at which temperature sensor voltage (see parameter above) is corresponding (unit: degC) + * @param __VREFANALOG_VOLTAGE__ Analog voltage reference (Vref+) voltage (unit: mV) + * @param __TEMPSENSOR_ADC_DATA__ ADC conversion data of internal temperature sensor (unit: digital value). + * @param __ADC_RESOLUTION__ ADC resolution at which internal temperature sensor voltage has been measured. + * This parameter can be one of the following values: + * @arg @ref LL_ADC_RESOLUTION_12B + * @retval Temperature (unit: degree Celsius) + */ +#define __LL_ADC_CALC_TEMPERATURE_TYP_PARAMS(__TEMPSENSOR_TYP_AVGSLOPE__,\ + __TEMPSENSOR_TYP_CALX_V__,\ + __TEMPSENSOR_CALX_TEMP__,\ + __VREFANALOG_VOLTAGE__,\ + __TEMPSENSOR_ADC_DATA__,\ + __ADC_RESOLUTION__) \ + ((( ( \ + (int32_t)(((__TEMPSENSOR_TYP_CALX_V__)) \ + * 1000) \ + - \ + (int32_t)((((__TEMPSENSOR_ADC_DATA__) * (__VREFANALOG_VOLTAGE__)) \ + / __LL_ADC_DIGITAL_SCALE(__ADC_RESOLUTION__)) \ + * 1000) \ + ) \ + ) / (__TEMPSENSOR_TYP_AVGSLOPE__) \ + ) + (__TEMPSENSOR_CALX_TEMP__) \ + ) + +/** + * @} + */ + +/** + * @} + */ + + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup ADC_LL_Exported_Functions ADC Exported Functions + * @{ + */ + +/** @defgroup ADC_LL_EF_DMA_Management ADC DMA management + * @{ + */ +/* Note: LL ADC functions to set DMA transfer are located into sections of */ +/* configuration of ADC instance, groups and multimode (if available): */ +/* @ref LL_ADC_REG_SetDMATransfer(), ... */ + +/** + * @brief Function to help to configure DMA transfer from ADC: retrieve the + * ADC register address from ADC instance and a list of ADC registers + * intended to be used (most commonly) with DMA transfer. + * @note These ADC registers are data registers: + * when ADC conversion data is available in ADC data registers, + * ADC generates a DMA transfer request. + * @note This macro is intended to be used with LL DMA driver, refer to + * function "LL_DMA_ConfigAddresses()". + * Example: + * LL_DMA_ConfigAddresses(DMA1, + * LL_DMA_CHANNEL_1, + * LL_ADC_DMA_GetRegAddr(ADC1, LL_ADC_DMA_REG_REGULAR_DATA), + * (uint32_t)&< array or variable >, + * LL_DMA_DIRECTION_PERIPH_TO_MEMORY); + * @note For devices with several ADC: in multimode, some devices + * use a different data register outside of ADC instance scope + * (common data register). This macro manages this register difference, + * only ADC instance has to be set as parameter. + * @rmtoll DR DATA LL_ADC_DMA_GetRegAddr + * @param ADCx ADC instance + * @param Register This parameter can be one of the following values: + * @arg @ref LL_ADC_DMA_REG_REGULAR_DATA + * @retval ADC register address + */ +__STATIC_INLINE uint32_t LL_ADC_DMA_GetRegAddr(ADC_TypeDef *ADCx, uint32_t Register) +{ + /* Prevent unused argument compilation warning */ + (void)Register; + + /* Retrieve address of register DR */ + return (uint32_t)&(ADCx->DR); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Common Configuration of ADC hierarchical scope: common to several ADC instances + * @{ + */ + +/** + * @brief Set parameter common to several ADC: measurement path to internal + * channels (VrefInt, temperature sensor, ...). + * @note One or several values can be selected. + * Example: (LL_ADC_PATH_INTERNAL_VREFINT | + * LL_ADC_PATH_INTERNAL_TEMPSENSOR) + * @note Stabilization time of measurement path to internal channel: + * After enabling internal paths, before starting ADC conversion, + * a delay is required for internal voltage reference and + * temperature sensor stabilization time. + * Refer to device datasheet. + * Refer to literal @ref LL_ADC_DELAY_TEMPSENSOR_STAB_US. + * @note ADC internal channel sampling time constraint: + * For ADC conversion of internal channels, + * a sampling time minimum value is required. + * Refer to device datasheet. + * @rmtoll CR2 TSVREFE LL_ADC_SetCommonPathInternalCh + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @param PathInternal This parameter can be a combination of the following values: + * @arg @ref LL_ADC_PATH_INTERNAL_NONE + * @arg @ref LL_ADC_PATH_INTERNAL_VREFINT + * @arg @ref LL_ADC_PATH_INTERNAL_TEMPSENSOR + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetCommonPathInternalCh(ADC_Common_TypeDef *ADCxy_COMMON, uint32_t PathInternal) +{ + MODIFY_REG(ADCxy_COMMON->CR2, (ADC_CR2_TSVREFE), PathInternal); +} + +/** + * @brief Get parameter common to several ADC: measurement path to internal + * channels (VrefInt, temperature sensor, ...). + * @note One or several values can be selected. + * Example: (LL_ADC_PATH_INTERNAL_VREFINT | + * LL_ADC_PATH_INTERNAL_TEMPSENSOR) + * @rmtoll CR2 TSVREFE LL_ADC_GetCommonPathInternalCh + * @param ADCxy_COMMON ADC common instance + * (can be set directly from CMSIS definition or by using helper macro @ref __LL_ADC_COMMON_INSTANCE() ) + * @retval Returned value can be a combination of the following values: + * @arg @ref LL_ADC_PATH_INTERNAL_NONE + * @arg @ref LL_ADC_PATH_INTERNAL_VREFINT + * @arg @ref LL_ADC_PATH_INTERNAL_TEMPSENSOR + */ +__STATIC_INLINE uint32_t LL_ADC_GetCommonPathInternalCh(ADC_Common_TypeDef *ADCxy_COMMON) +{ + return (uint32_t)(READ_BIT(ADCxy_COMMON->CR2, ADC_CR2_TSVREFE)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Instance Configuration of ADC hierarchical scope: ADC instance + * @{ + */ + +/** + * @brief Set ADC conversion data alignment. + * @note Refer to reference manual for alignments formats + * dependencies to ADC resolutions. + * @rmtoll CR2 ALIGN LL_ADC_SetDataAlignment + * @param ADCx ADC instance + * @param DataAlignment This parameter can be one of the following values: + * @arg @ref LL_ADC_DATA_ALIGN_RIGHT + * @arg @ref LL_ADC_DATA_ALIGN_LEFT + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetDataAlignment(ADC_TypeDef *ADCx, uint32_t DataAlignment) +{ + MODIFY_REG(ADCx->CR2, ADC_CR2_ALIGN, DataAlignment); +} + +/** + * @brief Get ADC conversion data alignment. + * @note Refer to reference manual for alignments formats + * dependencies to ADC resolutions. + * @rmtoll CR2 ALIGN LL_ADC_SetDataAlignment + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_DATA_ALIGN_RIGHT + * @arg @ref LL_ADC_DATA_ALIGN_LEFT + */ +__STATIC_INLINE uint32_t LL_ADC_GetDataAlignment(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR2, ADC_CR2_ALIGN)); +} + +/** + * @brief Set ADC sequencers scan mode, for all ADC groups + * (group regular, group injected). + * @note According to sequencers scan mode : + * - If disabled: ADC conversion is performed in unitary conversion + * mode (one channel converted, that defined in rank 1). + * Configuration of sequencers of all ADC groups + * (sequencer scan length, ...) is discarded: equivalent to + * scan length of 1 rank. + * - If enabled: ADC conversions are performed in sequence conversions + * mode, according to configuration of sequencers of + * each ADC group (sequencer scan length, ...). + * Refer to function @ref LL_ADC_REG_SetSequencerLength() + * and to function @ref LL_ADC_INJ_SetSequencerLength(). + * @rmtoll CR1 SCAN LL_ADC_SetSequencersScanMode + * @param ADCx ADC instance + * @param ScanMode This parameter can be one of the following values: + * @arg @ref LL_ADC_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_SEQ_SCAN_ENABLE + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetSequencersScanMode(ADC_TypeDef *ADCx, uint32_t ScanMode) +{ + MODIFY_REG(ADCx->CR1, ADC_CR1_SCAN, ScanMode); +} + +/** + * @brief Get ADC sequencers scan mode, for all ADC groups + * (group regular, group injected). + * @note According to sequencers scan mode : + * - If disabled: ADC conversion is performed in unitary conversion + * mode (one channel converted, that defined in rank 1). + * Configuration of sequencers of all ADC groups + * (sequencer scan length, ...) is discarded: equivalent to + * scan length of 1 rank. + * - If enabled: ADC conversions are performed in sequence conversions + * mode, according to configuration of sequencers of + * each ADC group (sequencer scan length, ...). + * Refer to function @ref LL_ADC_REG_SetSequencerLength() + * and to function @ref LL_ADC_INJ_SetSequencerLength(). + * @rmtoll CR1 SCAN LL_ADC_GetSequencersScanMode + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_SEQ_SCAN_ENABLE + */ +__STATIC_INLINE uint32_t LL_ADC_GetSequencersScanMode(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR1, ADC_CR1_SCAN)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Group_Regular Configuration of ADC hierarchical scope: group regular + * @{ + */ + +/** + * @brief Set ADC group regular conversion trigger source: + * internal (SW start) or external from timer or external interrupt. + * @note On this STM32 series, external trigger is set with trigger polarity: + * rising edge (only trigger polarity available on this STM32 series). + * @note Availability of parameters of trigger sources from timer + * depends on timers availability on the selected device. + * @rmtoll CR2 EXTSEL LL_ADC_REG_SetTriggerSource + * @param ADCx ADC instance + * @param TriggerSource This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_TRIG_SOFTWARE + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_CH2 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_TRGO + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_CH2 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM19_TRGO + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM19_CH3 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM19_CH4 + * @arg @ref LL_ADC_REG_TRIG_EXT_EXTI_LINE11 + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetTriggerSource(ADC_TypeDef *ADCx, uint32_t TriggerSource) +{ +/* Note: On this STM32 series, ADC group regular external trigger edge */ +/* is used to perform a ADC conversion start. */ +/* This function does not set external trigger edge. */ +/* This feature is set using function */ +/* @ref LL_ADC_REG_StartConversionExtTrig(). */ + MODIFY_REG(ADCx->CR2, ADC_CR2_EXTSEL, (TriggerSource & ADC_CR2_EXTSEL)); +} + +/** + * @brief Get ADC group regular conversion trigger source: + * internal (SW start) or external from timer or external interrupt. + * @note To determine whether group regular trigger source is + * internal (SW start) or external, without detail + * of which peripheral is selected as external trigger, + * (equivalent to + * "if(LL_ADC_REG_GetTriggerSource(ADC1) == LL_ADC_REG_TRIG_SOFTWARE)") + * use function @ref LL_ADC_REG_IsTriggerSourceSWStart. + * @note Availability of parameters of trigger sources from timer + * depends on timers availability on the selected device. + * @rmtoll CR2 EXTSEL LL_ADC_REG_GetTriggerSource + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_TRIG_SOFTWARE + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM2_CH2 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM3_TRGO + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM4_CH2 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM19_TRGO + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM19_CH3 + * @arg @ref LL_ADC_REG_TRIG_EXT_TIM19_CH4 + * @arg @ref LL_ADC_REG_TRIG_EXT_EXTI_LINE11 + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetTriggerSource(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR2, ADC_CR2_EXTSEL)); +} + +/** + * @brief Get ADC group regular conversion trigger source internal (SW start) + or external. + * @note In case of group regular trigger source set to external trigger, + * to determine which peripheral is selected as external trigger, + * use function @ref LL_ADC_REG_GetTriggerSource(). + * @rmtoll CR2 EXTSEL LL_ADC_REG_IsTriggerSourceSWStart + * @param ADCx ADC instance + * @retval Value "0" trigger source external trigger + * Value "1" trigger source SW start. + */ +__STATIC_INLINE uint32_t LL_ADC_REG_IsTriggerSourceSWStart(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR2, ADC_CR2_EXTSEL) == (LL_ADC_REG_TRIG_SOFTWARE)); +} + + +/** + * @brief Set ADC group regular sequencer length and scan direction. + * @note Description of ADC group regular sequencer features: + * - For devices with sequencer fully configurable + * (function "LL_ADC_REG_SetSequencerRanks()" available): + * sequencer length and each rank affectation to a channel + * are configurable. + * This function performs configuration of: + * - Sequence length: Number of ranks in the scan sequence. + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from rank 1 to rank n). + * Sequencer ranks are selected using + * function "LL_ADC_REG_SetSequencerRanks()". + * - For devices with sequencer not fully configurable + * (function "LL_ADC_REG_SetSequencerChannels()" available): + * sequencer length and each rank affectation to a channel + * are defined by channel number. + * This function performs configuration of: + * - Sequence length: Number of ranks in the scan sequence is + * defined by number of channels set in the sequence, + * rank of each channel is fixed by channel HW number. + * (channel 0 fixed on rank 0, channel 1 fixed on rank1, ...). + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from lowest channel number to + * highest channel number). + * Sequencer ranks are selected using + * function "LL_ADC_REG_SetSequencerChannels()". + * @note On this STM32 series, group regular sequencer configuration + * is conditioned to ADC instance sequencer mode. + * If ADC instance sequencer mode is disabled, sequencers of + * all groups (group regular, group injected) can be configured + * but their execution is disabled (limited to rank 1). + * Refer to function @ref LL_ADC_SetSequencersScanMode(). + * @note Sequencer disabled is equivalent to sequencer of 1 rank: + * ADC conversion on only 1 channel. + * @rmtoll SQR1 L LL_ADC_REG_SetSequencerLength + * @param ADCx ADC instance + * @param SequencerNbRanks This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_4RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_5RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_6RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_7RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_8RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_9RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_10RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_11RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_12RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_13RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_14RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_15RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_16RANKS + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetSequencerLength(ADC_TypeDef *ADCx, uint32_t SequencerNbRanks) +{ + MODIFY_REG(ADCx->SQR1, ADC_SQR1_L, SequencerNbRanks); +} + +/** + * @brief Get ADC group regular sequencer length and scan direction. + * @note Description of ADC group regular sequencer features: + * - For devices with sequencer fully configurable + * (function "LL_ADC_REG_SetSequencerRanks()" available): + * sequencer length and each rank affectation to a channel + * are configurable. + * This function retrieves: + * - Sequence length: Number of ranks in the scan sequence. + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from rank 1 to rank n). + * Sequencer ranks are selected using + * function "LL_ADC_REG_SetSequencerRanks()". + * - For devices with sequencer not fully configurable + * (function "LL_ADC_REG_SetSequencerChannels()" available): + * sequencer length and each rank affectation to a channel + * are defined by channel number. + * This function retrieves: + * - Sequence length: Number of ranks in the scan sequence is + * defined by number of channels set in the sequence, + * rank of each channel is fixed by channel HW number. + * (channel 0 fixed on rank 0, channel 1 fixed on rank1, ...). + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from lowest channel number to + * highest channel number). + * Sequencer ranks are selected using + * function "LL_ADC_REG_SetSequencerChannels()". + * @note On this STM32 series, group regular sequencer configuration + * is conditioned to ADC instance sequencer mode. + * If ADC instance sequencer mode is disabled, sequencers of + * all groups (group regular, group injected) can be configured + * but their execution is disabled (limited to rank 1). + * Refer to function @ref LL_ADC_SetSequencersScanMode(). + * @note Sequencer disabled is equivalent to sequencer of 1 rank: + * ADC conversion on only 1 channel. + * @rmtoll SQR1 L LL_ADC_REG_SetSequencerLength + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_4RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_5RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_6RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_7RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_8RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_9RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_10RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_11RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_12RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_13RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_14RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_15RANKS + * @arg @ref LL_ADC_REG_SEQ_SCAN_ENABLE_16RANKS + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetSequencerLength(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->SQR1, ADC_SQR1_L)); +} + +/** + * @brief Set ADC group regular sequencer discontinuous mode: + * sequence subdivided and scan conversions interrupted every selected + * number of ranks. + * @note It is not possible to enable both ADC group regular + * continuous mode and sequencer discontinuous mode. + * @note It is not possible to enable both ADC auto-injected mode + * and ADC group regular sequencer discontinuous mode. + * @rmtoll CR1 DISCEN LL_ADC_REG_SetSequencerDiscont\n + * CR1 DISCNUM LL_ADC_REG_SetSequencerDiscont + * @param ADCx ADC instance + * @param SeqDiscont This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_SEQ_DISCONT_DISABLE + * @arg @ref LL_ADC_REG_SEQ_DISCONT_1RANK + * @arg @ref LL_ADC_REG_SEQ_DISCONT_2RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_3RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_4RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_5RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_6RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_7RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_8RANKS + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetSequencerDiscont(ADC_TypeDef *ADCx, uint32_t SeqDiscont) +{ + MODIFY_REG(ADCx->CR1, ADC_CR1_DISCEN | ADC_CR1_DISCNUM, SeqDiscont); +} + +/** + * @brief Get ADC group regular sequencer discontinuous mode: + * sequence subdivided and scan conversions interrupted every selected + * number of ranks. + * @rmtoll CR1 DISCEN LL_ADC_REG_GetSequencerDiscont\n + * CR1 DISCNUM LL_ADC_REG_GetSequencerDiscont + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_SEQ_DISCONT_DISABLE + * @arg @ref LL_ADC_REG_SEQ_DISCONT_1RANK + * @arg @ref LL_ADC_REG_SEQ_DISCONT_2RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_3RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_4RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_5RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_6RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_7RANKS + * @arg @ref LL_ADC_REG_SEQ_DISCONT_8RANKS + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetSequencerDiscont(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR1, ADC_CR1_DISCEN | ADC_CR1_DISCNUM)); +} + +/** + * @brief Set ADC group regular sequence: channel on the selected + * scan sequence rank. + * @note This function performs configuration of: + * - Channels ordering into each rank of scan sequence: + * whatever channel can be placed into whatever rank. + * @note On this STM32 series, ADC group regular sequencer is + * fully configurable: sequencer length and each rank + * affectation to a channel are configurable. + * Refer to description of function @ref LL_ADC_REG_SetSequencerLength(). + * @note Depending on devices and packages, some channels may not be available. + * Refer to device datasheet for channels availability. + * @note On this STM32 series, to measure internal channels (VrefInt, + * TempSensor, ...), measurement paths to internal channels must be + * enabled separately. + * This can be done using function @ref LL_ADC_SetCommonPathInternalCh(). + * @rmtoll SQR3 SQ1 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ2 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ3 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ4 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ5 LL_ADC_REG_SetSequencerRanks\n + * SQR3 SQ6 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ7 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ8 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ9 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ10 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ11 LL_ADC_REG_SetSequencerRanks\n + * SQR2 SQ12 LL_ADC_REG_SetSequencerRanks\n + * SQR1 SQ13 LL_ADC_REG_SetSequencerRanks\n + * SQR1 SQ14 LL_ADC_REG_SetSequencerRanks\n + * SQR1 SQ15 LL_ADC_REG_SetSequencerRanks\n + * SQR1 SQ16 LL_ADC_REG_SetSequencerRanks + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_RANK_1 + * @arg @ref LL_ADC_REG_RANK_2 + * @arg @ref LL_ADC_REG_RANK_3 + * @arg @ref LL_ADC_REG_RANK_4 + * @arg @ref LL_ADC_REG_RANK_5 + * @arg @ref LL_ADC_REG_RANK_6 + * @arg @ref LL_ADC_REG_RANK_7 + * @arg @ref LL_ADC_REG_RANK_8 + * @arg @ref LL_ADC_REG_RANK_9 + * @arg @ref LL_ADC_REG_RANK_10 + * @arg @ref LL_ADC_REG_RANK_11 + * @arg @ref LL_ADC_REG_RANK_12 + * @arg @ref LL_ADC_REG_RANK_13 + * @arg @ref LL_ADC_REG_RANK_14 + * @arg @ref LL_ADC_REG_RANK_15 + * @arg @ref LL_ADC_REG_RANK_16 + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank, uint32_t Channel) +{ + /* Set bits with content of parameter "Channel" with bits position */ + /* in register and register position depending on parameter "Rank". */ + /* Parameters "Rank" and "Channel" are used with masks because containing */ + /* other bits reserved for other purpose. */ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SQR1, __ADC_MASK_SHIFT(Rank, ADC_REG_SQRX_REGOFFSET_MASK)); + + MODIFY_REG(*preg, + ADC_CHANNEL_ID_NUMBER_MASK << (Rank & ADC_REG_RANK_ID_SQRX_MASK), + (Channel & ADC_CHANNEL_ID_NUMBER_MASK) << (Rank & ADC_REG_RANK_ID_SQRX_MASK)); +} + +/** + * @brief Get ADC group regular sequence: channel on the selected + * scan sequence rank. + * @note On this STM32 series, ADC group regular sequencer is + * fully configurable: sequencer length and each rank + * affectation to a channel are configurable. + * Refer to description of function @ref LL_ADC_REG_SetSequencerLength(). + * @note Depending on devices and packages, some channels may not be available. + * Refer to device datasheet for channels availability. + * @note Usage of the returned channel number: + * - To reinject this channel into another function LL_ADC_xxx: + * the returned channel number is only partly formatted on definition + * of literals LL_ADC_CHANNEL_x. Therefore, it has to be compared + * with parts of literals LL_ADC_CHANNEL_x or using + * helper macro @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Then the selected literal LL_ADC_CHANNEL_x can be used + * as parameter for another function. + * - To get the channel number in decimal format: + * process the returned value with the helper macro + * @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * @rmtoll SQR3 SQ1 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ2 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ3 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ4 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ5 LL_ADC_REG_GetSequencerRanks\n + * SQR3 SQ6 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ7 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ8 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ9 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ10 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ11 LL_ADC_REG_GetSequencerRanks\n + * SQR2 SQ12 LL_ADC_REG_GetSequencerRanks\n + * SQR1 SQ13 LL_ADC_REG_GetSequencerRanks\n + * SQR1 SQ14 LL_ADC_REG_GetSequencerRanks\n + * SQR1 SQ15 LL_ADC_REG_GetSequencerRanks\n + * SQR1 SQ16 LL_ADC_REG_GetSequencerRanks + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_RANK_1 + * @arg @ref LL_ADC_REG_RANK_2 + * @arg @ref LL_ADC_REG_RANK_3 + * @arg @ref LL_ADC_REG_RANK_4 + * @arg @ref LL_ADC_REG_RANK_5 + * @arg @ref LL_ADC_REG_RANK_6 + * @arg @ref LL_ADC_REG_RANK_7 + * @arg @ref LL_ADC_REG_RANK_8 + * @arg @ref LL_ADC_REG_RANK_9 + * @arg @ref LL_ADC_REG_RANK_10 + * @arg @ref LL_ADC_REG_RANK_11 + * @arg @ref LL_ADC_REG_RANK_12 + * @arg @ref LL_ADC_REG_RANK_13 + * @arg @ref LL_ADC_REG_RANK_14 + * @arg @ref LL_ADC_REG_RANK_15 + * @arg @ref LL_ADC_REG_RANK_16 + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1.\n + * (1) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SQR1, __ADC_MASK_SHIFT(Rank, ADC_REG_SQRX_REGOFFSET_MASK)); + + return (uint32_t) (READ_BIT(*preg, + ADC_CHANNEL_ID_NUMBER_MASK << (Rank & ADC_REG_RANK_ID_SQRX_MASK)) + >> (Rank & ADC_REG_RANK_ID_SQRX_MASK) + ); +} + +/** + * @brief Set ADC continuous conversion mode on ADC group regular. + * @note Description of ADC continuous conversion mode: + * - single mode: one conversion per trigger + * - continuous mode: after the first trigger, following + * conversions launched successively automatically. + * @note It is not possible to enable both ADC group regular + * continuous mode and sequencer discontinuous mode. + * @rmtoll CR2 CONT LL_ADC_REG_SetContinuousMode + * @param ADCx ADC instance + * @param Continuous This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_CONV_SINGLE + * @arg @ref LL_ADC_REG_CONV_CONTINUOUS + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetContinuousMode(ADC_TypeDef *ADCx, uint32_t Continuous) +{ + MODIFY_REG(ADCx->CR2, ADC_CR2_CONT, Continuous); +} + +/** + * @brief Get ADC continuous conversion mode on ADC group regular. + * @note Description of ADC continuous conversion mode: + * - single mode: one conversion per trigger + * - continuous mode: after the first trigger, following + * conversions launched successively automatically. + * @rmtoll CR2 CONT LL_ADC_REG_GetContinuousMode + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_CONV_SINGLE + * @arg @ref LL_ADC_REG_CONV_CONTINUOUS + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetContinuousMode(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR2, ADC_CR2_CONT)); +} + +/** + * @brief Set ADC group regular conversion data transfer: no transfer or + * transfer by DMA, and DMA requests mode. + * @note If transfer by DMA selected, specifies the DMA requests + * mode: + * - Limited mode (One shot mode): DMA transfer requests are stopped + * when number of DMA data transfers (number of + * ADC conversions) is reached. + * This ADC mode is intended to be used with DMA mode non-circular. + * - Unlimited mode: DMA transfer requests are unlimited, + * whatever number of DMA data transfers (number of + * ADC conversions). + * This ADC mode is intended to be used with DMA mode circular. + * @note If ADC DMA requests mode is set to unlimited and DMA is set to + * mode non-circular: + * when DMA transfers size will be reached, DMA will stop transfers of + * ADC conversions data ADC will raise an overrun error + * (overrun flag and interruption if enabled). + * @note To configure DMA source address (peripheral address), + * use function @ref LL_ADC_DMA_GetRegAddr(). + * @rmtoll CR2 DMA LL_ADC_REG_SetDMATransfer + * @param ADCx ADC instance + * @param DMATransfer This parameter can be one of the following values: + * @arg @ref LL_ADC_REG_DMA_TRANSFER_NONE + * @arg @ref LL_ADC_REG_DMA_TRANSFER_UNLIMITED + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_SetDMATransfer(ADC_TypeDef *ADCx, uint32_t DMATransfer) +{ + MODIFY_REG(ADCx->CR2, ADC_CR2_DMA, DMATransfer); +} + +/** + * @brief Get ADC group regular conversion data transfer: no transfer or + * transfer by DMA, and DMA requests mode. + * @note If transfer by DMA selected, specifies the DMA requests + * mode: + * - Limited mode (One shot mode): DMA transfer requests are stopped + * when number of DMA data transfers (number of + * ADC conversions) is reached. + * This ADC mode is intended to be used with DMA mode non-circular. + * - Unlimited mode: DMA transfer requests are unlimited, + * whatever number of DMA data transfers (number of + * ADC conversions). + * This ADC mode is intended to be used with DMA mode circular. + * @note If ADC DMA requests mode is set to unlimited and DMA is set to + * mode non-circular: + * when DMA transfers size will be reached, DMA will stop transfers of + * ADC conversions data ADC will raise an overrun error + * (overrun flag and interruption if enabled). + * @note To configure DMA source address (peripheral address), + * use function @ref LL_ADC_DMA_GetRegAddr(). + * @rmtoll CR2 DMA LL_ADC_REG_GetDMATransfer + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_REG_DMA_TRANSFER_NONE + * @arg @ref LL_ADC_REG_DMA_TRANSFER_UNLIMITED + */ +__STATIC_INLINE uint32_t LL_ADC_REG_GetDMATransfer(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR2, ADC_CR2_DMA)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_Group_Injected Configuration of ADC hierarchical scope: group injected + * @{ + */ + +/** + * @brief Set ADC group injected conversion trigger source: + * internal (SW start) or external from timer or external interrupt. + * @note On this STM32 series, external trigger is set with trigger polarity: + * rising edge (only trigger polarity available on this STM32 series). + * @note Availability of parameters of trigger sources from timer + * depends on timers availability on the selected device. + * @rmtoll CR2 JEXTSEL LL_ADC_INJ_SetTriggerSource + * @param ADCx ADC instance + * @param TriggerSource This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_SOFTWARE + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_CH1 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH4 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM19_CH1 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM19_CH2 + * @arg @ref LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetTriggerSource(ADC_TypeDef *ADCx, uint32_t TriggerSource) +{ +/* Note: On this STM32 series, ADC group injected external trigger edge */ +/* is used to perform a ADC conversion start. */ +/* This function does not set external trigger edge. */ +/* This feature is set using function */ +/* @ref LL_ADC_INJ_StartConversionExtTrig(). */ + MODIFY_REG(ADCx->CR2, ADC_CR2_JEXTSEL, (TriggerSource & ADC_CR2_JEXTSEL)); +} + +/** + * @brief Get ADC group injected conversion trigger source: + * internal (SW start) or external from timer or external interrupt. + * @note To determine whether group injected trigger source is + * internal (SW start) or external, without detail + * of which peripheral is selected as external trigger, + * (equivalent to + * "if(LL_ADC_INJ_GetTriggerSource(ADC1) == LL_ADC_INJ_TRIG_SOFTWARE)") + * use function @ref LL_ADC_INJ_IsTriggerSourceSWStart. + * @note Availability of parameters of trigger sources from timer + * depends on timers availability on the selected device. + * @rmtoll CR2 JEXTSEL LL_ADC_INJ_GetTriggerSource + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_SOFTWARE + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM2_CH1 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM3_CH4 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM4_TRGO + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM19_CH1 + * @arg @ref LL_ADC_INJ_TRIG_EXT_TIM19_CH2 + * @arg @ref LL_ADC_INJ_TRIG_EXT_EXTI_LINE15 + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetTriggerSource(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR2, ADC_CR2_JEXTSEL)); +} + +/** + * @brief Get ADC group injected conversion trigger source internal (SW start) + or external + * @note In case of group injected trigger source set to external trigger, + * to determine which peripheral is selected as external trigger, + * use function @ref LL_ADC_INJ_GetTriggerSource. + * @rmtoll CR2 JEXTSEL LL_ADC_INJ_IsTriggerSourceSWStart + * @param ADCx ADC instance + * @retval Value "0" trigger source external trigger + * Value "1" trigger source SW start. + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_IsTriggerSourceSWStart(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR2, ADC_CR2_JEXTSEL) == LL_ADC_INJ_TRIG_SOFTWARE); +} + +/** + * @brief Set ADC group injected sequencer length and scan direction. + * @note This function performs configuration of: + * - Sequence length: Number of ranks in the scan sequence. + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from rank 1 to rank n). + * @note On this STM32 series, group injected sequencer configuration + * is conditioned to ADC instance sequencer mode. + * If ADC instance sequencer mode is disabled, sequencers of + * all groups (group regular, group injected) can be configured + * but their execution is disabled (limited to rank 1). + * Refer to function @ref LL_ADC_SetSequencersScanMode(). + * @note Sequencer disabled is equivalent to sequencer of 1 rank: + * ADC conversion on only 1 channel. + * @rmtoll JSQR JL LL_ADC_INJ_SetSequencerLength + * @param ADCx ADC instance + * @param SequencerNbRanks This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetSequencerLength(ADC_TypeDef *ADCx, uint32_t SequencerNbRanks) +{ + MODIFY_REG(ADCx->JSQR, ADC_JSQR_JL, SequencerNbRanks); +} + +/** + * @brief Get ADC group injected sequencer length and scan direction. + * @note This function retrieves: + * - Sequence length: Number of ranks in the scan sequence. + * - Sequence direction: Unless specified in parameters, sequencer + * scan direction is forward (from rank 1 to rank n). + * @note On this STM32 series, group injected sequencer configuration + * is conditioned to ADC instance sequencer mode. + * If ADC instance sequencer mode is disabled, sequencers of + * all groups (group regular, group injected) can be configured + * but their execution is disabled (limited to rank 1). + * Refer to function @ref LL_ADC_SetSequencersScanMode(). + * @note Sequencer disabled is equivalent to sequencer of 1 rank: + * ADC conversion on only 1 channel. + * @rmtoll JSQR JL LL_ADC_INJ_GetSequencerLength + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_SCAN_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_2RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_3RANKS + * @arg @ref LL_ADC_INJ_SEQ_SCAN_ENABLE_4RANKS + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerLength(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->JSQR, ADC_JSQR_JL)); +} + +/** + * @brief Set ADC group injected sequencer discontinuous mode: + * sequence subdivided and scan conversions interrupted every selected + * number of ranks. + * @note It is not possible to enable both ADC group injected + * auto-injected mode and sequencer discontinuous mode. + * @rmtoll CR1 DISCEN LL_ADC_INJ_SetSequencerDiscont + * @param ADCx ADC instance + * @param SeqDiscont This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_DISCONT_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_DISCONT_1RANK + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetSequencerDiscont(ADC_TypeDef *ADCx, uint32_t SeqDiscont) +{ + MODIFY_REG(ADCx->CR1, ADC_CR1_JDISCEN, SeqDiscont); +} + +/** + * @brief Get ADC group injected sequencer discontinuous mode: + * sequence subdivided and scan conversions interrupted every selected + * number of ranks. + * @rmtoll CR1 DISCEN LL_ADC_REG_GetSequencerDiscont + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_SEQ_DISCONT_DISABLE + * @arg @ref LL_ADC_INJ_SEQ_DISCONT_1RANK + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerDiscont(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR1, ADC_CR1_JDISCEN)); +} + +/** + * @brief Set ADC group injected sequence: channel on the selected + * sequence rank. + * @note Depending on devices and packages, some channels may not be available. + * Refer to device datasheet for channels availability. + * @note On this STM32 series, to measure internal channels (VrefInt, + * TempSensor, ...), measurement paths to internal channels must be + * enabled separately. + * This can be done using function @ref LL_ADC_SetCommonPathInternalCh(). + * @rmtoll JSQR JSQ1 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ2 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ3 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ4 LL_ADC_INJ_SetSequencerRanks + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank, uint32_t Channel) +{ + /* Set bits with content of parameter "Channel" with bits position */ + /* in register depending on parameter "Rank". */ + /* Parameters "Rank" and "Channel" are used with masks because containing */ + /* other bits reserved for other purpose. */ + MODIFY_REG(ADCx->JSQR, + ADC_CHANNEL_ID_NUMBER_MASK << (Rank & ADC_INJ_RANK_ID_JSQR_MASK), + (Channel & ADC_CHANNEL_ID_NUMBER_MASK) << (Rank & ADC_INJ_RANK_ID_JSQR_MASK)); +} + +/** + * @brief Get ADC group injected sequence: channel on the selected + * sequence rank. + * @note Depending on devices and packages, some channels may not be available. + * Refer to device datasheet for channels availability. + * @note Usage of the returned channel number: + * - To reinject this channel into another function LL_ADC_xxx: + * the returned channel number is only partly formatted on definition + * of literals LL_ADC_CHANNEL_x. Therefore, it has to be compared + * with parts of literals LL_ADC_CHANNEL_x or using + * helper macro @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Then the selected literal LL_ADC_CHANNEL_x can be used + * as parameter for another function. + * - To get the channel number in decimal format: + * process the returned value with the helper macro + * @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * @rmtoll JSQR JSQ1 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ2 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ3 LL_ADC_INJ_SetSequencerRanks\n + * JSQR JSQ4 LL_ADC_INJ_SetSequencerRanks + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1.\n + * (1) For ADC channel read back from ADC register, + * comparison with internal channel parameter to be done + * using helper macro @ref __LL_ADC_CHANNEL_INTERNAL_TO_EXTERNAL(). + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetSequencerRanks(ADC_TypeDef *ADCx, uint32_t Rank) +{ + return (uint32_t)(READ_BIT(ADCx->JSQR, + ADC_CHANNEL_ID_NUMBER_MASK << (Rank & ADC_INJ_RANK_ID_JSQR_MASK)) + >> (Rank & ADC_INJ_RANK_ID_JSQR_MASK) + ); +} + +/** + * @brief Set ADC group injected conversion trigger: + * independent or from ADC group regular. + * @note This mode can be used to extend number of data registers + * updated after one ADC conversion trigger and with data + * permanently kept (not erased by successive conversions of scan of + * ADC sequencer ranks), up to 5 data registers: + * 1 data register on ADC group regular, 4 data registers + * on ADC group injected. + * @note If ADC group injected injected trigger source is set to an + * external trigger, this feature must be must be set to + * independent trigger. + * ADC group injected automatic trigger is compliant only with + * group injected trigger source set to SW start, without any + * further action on ADC group injected conversion start or stop: + * in this case, ADC group injected is controlled only + * from ADC group regular. + * @note It is not possible to enable both ADC group injected + * auto-injected mode and sequencer discontinuous mode. + * @rmtoll CR1 JAUTO LL_ADC_INJ_SetTrigAuto + * @param ADCx ADC instance + * @param TrigAuto This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_INDEPENDENT + * @arg @ref LL_ADC_INJ_TRIG_FROM_GRP_REGULAR + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetTrigAuto(ADC_TypeDef *ADCx, uint32_t TrigAuto) +{ + MODIFY_REG(ADCx->CR1, ADC_CR1_JAUTO, TrigAuto); +} + +/** + * @brief Get ADC group injected conversion trigger: + * independent or from ADC group regular. + * @rmtoll CR1 JAUTO LL_ADC_INJ_GetTrigAuto + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_INJ_TRIG_INDEPENDENT + * @arg @ref LL_ADC_INJ_TRIG_FROM_GRP_REGULAR + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetTrigAuto(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR1, ADC_CR1_JAUTO)); +} + +/** + * @brief Set ADC group injected offset. + * @note It sets: + * - ADC group injected rank to which the offset programmed + * will be applied + * - Offset level (offset to be subtracted from the raw + * converted data). + * Caution: Offset format is dependent to ADC resolution: + * offset has to be left-aligned on bit 11, the LSB (right bits) + * are set to 0. + * @note Offset cannot be enabled or disabled. + * To emulate offset disabled, set an offset value equal to 0. + * @rmtoll JOFR1 JOFFSET1 LL_ADC_INJ_SetOffset\n + * JOFR2 JOFFSET2 LL_ADC_INJ_SetOffset\n + * JOFR3 JOFFSET3 LL_ADC_INJ_SetOffset\n + * JOFR4 JOFFSET4 LL_ADC_INJ_SetOffset + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @param OffsetLevel Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_SetOffset(ADC_TypeDef *ADCx, uint32_t Rank, uint32_t OffsetLevel) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JOFR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JOFRX_REGOFFSET_MASK)); + + MODIFY_REG(*preg, + ADC_JOFR1_JOFFSET1, + OffsetLevel); +} + +/** + * @brief Get ADC group injected offset. + * @note It gives offset level (offset to be subtracted from the raw converted data). + * Caution: Offset format is dependent to ADC resolution: + * offset has to be left-aligned on bit 11, the LSB (right bits) + * are set to 0. + * @rmtoll JOFR1 JOFFSET1 LL_ADC_INJ_GetOffset\n + * JOFR2 JOFFSET2 LL_ADC_INJ_GetOffset\n + * JOFR3 JOFFSET3 LL_ADC_INJ_GetOffset\n + * JOFR4 JOFFSET4 LL_ADC_INJ_GetOffset + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_GetOffset(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JOFR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JOFRX_REGOFFSET_MASK)); + + return (uint32_t)(READ_BIT(*preg, + ADC_JOFR1_JOFFSET1) + ); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_Channels Configuration of ADC hierarchical scope: channels + * @{ + */ + +/** + * @brief Set sampling time of the selected ADC channel + * Unit: ADC clock cycles. + * @note On this device, sampling time is on channel scope: independently + * of channel mapped on ADC group regular or injected. + * @note In case of internal channel (VrefInt, TempSensor, ...) to be + * converted: + * sampling time constraints must be respected (sampling time can be + * adjusted in function of ADC clock frequency and sampling time + * setting). + * Refer to device datasheet for timings values (parameters TS_vrefint, + * TS_temp, ...). + * @note Conversion time is the addition of sampling time and processing time. + * Refer to reference manual for ADC processing time of + * this STM32 series. + * @note In case of ADC conversion of internal channel (VrefInt, + * temperature sensor, ...), a sampling time minimum value + * is required. + * Refer to device datasheet. + * @rmtoll SMPR1 SMP17 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP16 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP15 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP14 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP13 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP12 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP11 LL_ADC_SetChannelSamplingTime\n + * SMPR1 SMP10 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP9 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP8 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP7 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP6 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP5 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP4 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP3 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP2 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP1 LL_ADC_SetChannelSamplingTime\n + * SMPR2 SMP0 LL_ADC_SetChannelSamplingTime + * @param ADCx ADC instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @param SamplingTime This parameter can be one of the following values: + * @arg @ref LL_ADC_SAMPLINGTIME_1CYCLE_5 + * @arg @ref LL_ADC_SAMPLINGTIME_7CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_13CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_28CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_41CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_55CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_71CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_239CYCLES_5 + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetChannelSamplingTime(ADC_TypeDef *ADCx, uint32_t Channel, uint32_t SamplingTime) +{ + /* Set bits with content of parameter "SamplingTime" with bits position */ + /* in register and register position depending on parameter "Channel". */ + /* Parameter "Channel" is used with masks because containing */ + /* other bits reserved for other purpose. */ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SMPR1, __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPRX_REGOFFSET_MASK)); + + MODIFY_REG(*preg, + ADC_SMPR2_SMP0 << __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPx_BITOFFSET_MASK), + SamplingTime << __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPx_BITOFFSET_MASK)); +} + +/** + * @brief Get sampling time of the selected ADC channel + * Unit: ADC clock cycles. + * @note On this device, sampling time is on channel scope: independently + * of channel mapped on ADC group regular or injected. + * @note Conversion time is the addition of sampling time and processing time. + * Refer to reference manual for ADC processing time of + * this STM32 series. + * @rmtoll SMPR1 SMP17 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP16 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP15 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP14 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP13 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP12 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP11 LL_ADC_GetChannelSamplingTime\n + * SMPR1 SMP10 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP9 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP8 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP7 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP6 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP5 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP4 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP3 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP2 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP1 LL_ADC_GetChannelSamplingTime\n + * SMPR2 SMP0 LL_ADC_GetChannelSamplingTime + * @param ADCx ADC instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_ADC_CHANNEL_0 + * @arg @ref LL_ADC_CHANNEL_1 + * @arg @ref LL_ADC_CHANNEL_2 + * @arg @ref LL_ADC_CHANNEL_3 + * @arg @ref LL_ADC_CHANNEL_4 + * @arg @ref LL_ADC_CHANNEL_5 + * @arg @ref LL_ADC_CHANNEL_6 + * @arg @ref LL_ADC_CHANNEL_7 + * @arg @ref LL_ADC_CHANNEL_8 + * @arg @ref LL_ADC_CHANNEL_9 + * @arg @ref LL_ADC_CHANNEL_10 + * @arg @ref LL_ADC_CHANNEL_11 + * @arg @ref LL_ADC_CHANNEL_12 + * @arg @ref LL_ADC_CHANNEL_13 + * @arg @ref LL_ADC_CHANNEL_14 + * @arg @ref LL_ADC_CHANNEL_15 + * @arg @ref LL_ADC_CHANNEL_16 + * @arg @ref LL_ADC_CHANNEL_17 + * @arg @ref LL_ADC_CHANNEL_VREFINT (1) + * @arg @ref LL_ADC_CHANNEL_TEMPSENSOR (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_SAMPLINGTIME_1CYCLE_5 + * @arg @ref LL_ADC_SAMPLINGTIME_7CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_13CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_28CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_41CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_55CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_71CYCLES_5 + * @arg @ref LL_ADC_SAMPLINGTIME_239CYCLES_5 + */ +__STATIC_INLINE uint32_t LL_ADC_GetChannelSamplingTime(ADC_TypeDef *ADCx, uint32_t Channel) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->SMPR1, __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPRX_REGOFFSET_MASK)); + + return (uint32_t)(READ_BIT(*preg, + ADC_SMPR2_SMP0 << __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPx_BITOFFSET_MASK)) + >> __ADC_MASK_SHIFT(Channel, ADC_CHANNEL_SMPx_BITOFFSET_MASK) + ); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Configuration_ADC_AnalogWatchdog Configuration of ADC transversal scope: analog watchdog + * @{ + */ + +/** + * @brief Set ADC analog watchdog monitored channels: + * a single channel or all channels, + * on ADC groups regular and-or injected. + * @note Once monitored channels are selected, analog watchdog + * is enabled. + * @note In case of need to define a single channel to monitor + * with analog watchdog from sequencer channel definition, + * use helper macro @ref __LL_ADC_ANALOGWD_CHANNEL_GROUP(). + * @note On this STM32 series, there is only 1 kind of analog watchdog + * instance: + * - AWD standard (instance AWD1): + * - channels monitored: can monitor 1 channel or all channels. + * - groups monitored: ADC groups regular and-or injected. + * - resolution: resolution is not limited (corresponds to + * ADC resolution configured). + * @rmtoll CR1 AWD1CH LL_ADC_SetAnalogWDMonitChannels\n + * CR1 AWD1SGL LL_ADC_SetAnalogWDMonitChannels\n + * CR1 AWD1EN LL_ADC_SetAnalogWDMonitChannels + * @param ADCx ADC instance + * @param AWDChannelGroup This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD_DISABLE + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_INJ + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG + * @arg @ref LL_ADC_AWD_CHANNEL_0_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG + * @arg @ref LL_ADC_AWD_CHANNEL_1_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG + * @arg @ref LL_ADC_AWD_CHANNEL_2_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG + * @arg @ref LL_ADC_AWD_CHANNEL_3_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG + * @arg @ref LL_ADC_AWD_CHANNEL_4_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG + * @arg @ref LL_ADC_AWD_CHANNEL_5_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG + * @arg @ref LL_ADC_AWD_CHANNEL_6_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG + * @arg @ref LL_ADC_AWD_CHANNEL_7_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG + * @arg @ref LL_ADC_AWD_CHANNEL_8_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG + * @arg @ref LL_ADC_AWD_CHANNEL_9_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG + * @arg @ref LL_ADC_AWD_CHANNEL_10_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG + * @arg @ref LL_ADC_AWD_CHANNEL_11_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG + * @arg @ref LL_ADC_AWD_CHANNEL_12_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG + * @arg @ref LL_ADC_AWD_CHANNEL_13_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG + * @arg @ref LL_ADC_AWD_CHANNEL_14_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG + * @arg @ref LL_ADC_AWD_CHANNEL_15_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG + * @arg @ref LL_ADC_AWD_CHANNEL_16_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG + * @arg @ref LL_ADC_AWD_CHANNEL_17_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG_INJ + * @arg @ref LL_ADC_AWD_CH_VREFINT_REG (1) + * @arg @ref LL_ADC_AWD_CH_VREFINT_INJ (1) + * @arg @ref LL_ADC_AWD_CH_VREFINT_REG_INJ (1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_REG (1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_INJ (1) + * @arg @ref LL_ADC_AWD_CH_TEMPSENSOR_REG_INJ (1) + * + * (1) On STM32F37x, parameter available only on ADC instance: ADC1. + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetAnalogWDMonitChannels(ADC_TypeDef *ADCx, uint32_t AWDChannelGroup) +{ + MODIFY_REG(ADCx->CR1, + (ADC_CR1_AWDEN | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL | ADC_CR1_AWDCH), + AWDChannelGroup); +} + +/** + * @brief Get ADC analog watchdog monitored channel. + * @note Usage of the returned channel number: + * - To reinject this channel into another function LL_ADC_xxx: + * the returned channel number is only partly formatted on definition + * of literals LL_ADC_CHANNEL_x. Therefore, it has to be compared + * with parts of literals LL_ADC_CHANNEL_x or using + * helper macro @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Then the selected literal LL_ADC_CHANNEL_x can be used + * as parameter for another function. + * - To get the channel number in decimal format: + * process the returned value with the helper macro + * @ref __LL_ADC_CHANNEL_TO_DECIMAL_NB(). + * Applicable only when the analog watchdog is set to monitor + * one channel. + * @note On this STM32 series, there is only 1 kind of analog watchdog + * instance: + * - AWD standard (instance AWD1): + * - channels monitored: can monitor 1 channel or all channels. + * - groups monitored: ADC groups regular and-or injected. + * - resolution: resolution is not limited (corresponds to + * ADC resolution configured). + * @rmtoll CR1 AWD1CH LL_ADC_GetAnalogWDMonitChannels\n + * CR1 AWD1SGL LL_ADC_GetAnalogWDMonitChannels\n + * CR1 AWD1EN LL_ADC_GetAnalogWDMonitChannels + * @param ADCx ADC instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_ADC_AWD_DISABLE + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_INJ + * @arg @ref LL_ADC_AWD_ALL_CHANNELS_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG + * @arg @ref LL_ADC_AWD_CHANNEL_0_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_0_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG + * @arg @ref LL_ADC_AWD_CHANNEL_1_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_1_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG + * @arg @ref LL_ADC_AWD_CHANNEL_2_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_2_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG + * @arg @ref LL_ADC_AWD_CHANNEL_3_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_3_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG + * @arg @ref LL_ADC_AWD_CHANNEL_4_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_4_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG + * @arg @ref LL_ADC_AWD_CHANNEL_5_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_5_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG + * @arg @ref LL_ADC_AWD_CHANNEL_6_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_6_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG + * @arg @ref LL_ADC_AWD_CHANNEL_7_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_7_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG + * @arg @ref LL_ADC_AWD_CHANNEL_8_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_8_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG + * @arg @ref LL_ADC_AWD_CHANNEL_9_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_9_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG + * @arg @ref LL_ADC_AWD_CHANNEL_10_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_10_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG + * @arg @ref LL_ADC_AWD_CHANNEL_11_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_11_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG + * @arg @ref LL_ADC_AWD_CHANNEL_12_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_12_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG + * @arg @ref LL_ADC_AWD_CHANNEL_13_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_13_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG + * @arg @ref LL_ADC_AWD_CHANNEL_14_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_14_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG + * @arg @ref LL_ADC_AWD_CHANNEL_15_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_15_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG + * @arg @ref LL_ADC_AWD_CHANNEL_16_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_16_REG_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG + * @arg @ref LL_ADC_AWD_CHANNEL_17_INJ + * @arg @ref LL_ADC_AWD_CHANNEL_17_REG_INJ + */ +__STATIC_INLINE uint32_t LL_ADC_GetAnalogWDMonitChannels(ADC_TypeDef *ADCx) +{ + return (uint32_t)(READ_BIT(ADCx->CR1, (ADC_CR1_AWDEN | ADC_CR1_JAWDEN | ADC_CR1_AWDSGL | ADC_CR1_AWDCH))); +} + +/** + * @brief Set ADC analog watchdog threshold value of threshold + * high or low. + * @note On this STM32 series, there is only 1 kind of analog watchdog + * instance: + * - AWD standard (instance AWD1): + * - channels monitored: can monitor 1 channel or all channels. + * - groups monitored: ADC groups regular and-or injected. + * - resolution: resolution is not limited (corresponds to + * ADC resolution configured). + * @rmtoll HTR HT LL_ADC_SetAnalogWDThresholds\n + * LTR LT LL_ADC_SetAnalogWDThresholds + * @param ADCx ADC instance + * @param AWDThresholdsHighLow This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD_THRESHOLD_HIGH + * @arg @ref LL_ADC_AWD_THRESHOLD_LOW + * @param AWDThresholdValue Value between Min_Data=0x000 and Max_Data=0xFFF + * @retval None + */ +__STATIC_INLINE void LL_ADC_SetAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDThresholdsHighLow, uint32_t AWDThresholdValue) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->HTR, AWDThresholdsHighLow); + + MODIFY_REG(*preg, + ADC_HTR_HT, + AWDThresholdValue); +} + +/** + * @brief Get ADC analog watchdog threshold value of threshold high or + * threshold low. + * @note In case of ADC resolution different of 12 bits, + * analog watchdog thresholds data require a specific shift. + * Use helper macro @ref __LL_ADC_ANALOGWD_GET_THRESHOLD_RESOLUTION(). + * @rmtoll HTR HT LL_ADC_GetAnalogWDThresholds\n + * LTR LT LL_ADC_GetAnalogWDThresholds + * @param ADCx ADC instance + * @param AWDThresholdsHighLow This parameter can be one of the following values: + * @arg @ref LL_ADC_AWD_THRESHOLD_HIGH + * @arg @ref LL_ADC_AWD_THRESHOLD_LOW + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF +*/ +__STATIC_INLINE uint32_t LL_ADC_GetAnalogWDThresholds(ADC_TypeDef *ADCx, uint32_t AWDThresholdsHighLow) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->HTR, AWDThresholdsHighLow); + + return (uint32_t)(READ_BIT(*preg, ADC_HTR_HT)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Operation_ADC_Instance Operation on ADC hierarchical scope: ADC instance + * @{ + */ + +/** + * @brief Enable the selected ADC instance. + * @note On this STM32 series, after ADC enable, a delay for + * ADC internal analog stabilization is required before performing a + * ADC conversion start. + * Refer to device datasheet, parameter tSTAB. + * @rmtoll CR2 ADON LL_ADC_Enable + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_Enable(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->CR2, ADC_CR2_ADON); +} + +/** + * @brief Disable the selected ADC instance. + * @rmtoll CR2 ADON LL_ADC_Disable + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_Disable(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->CR2, ADC_CR2_ADON); +} + +/** + * @brief Get the selected ADC instance enable state. + * @rmtoll CR2 ADON LL_ADC_IsEnabled + * @param ADCx ADC instance + * @retval 0: ADC is disabled, 1: ADC is enabled. + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabled(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR2, ADC_CR2_ADON) == (ADC_CR2_ADON)); +} + +/** + * @brief Start ADC calibration in the mode single-ended + * or differential (for devices with differential mode available). + * @note On this STM32 series, before starting a calibration, + * ADC must be disabled. + * A minimum number of ADC clock cycles are required + * between ADC disable state and calibration start. + * Refer to literal @ref LL_ADC_DELAY_DISABLE_CALIB_ADC_CYCLES. + * @note On this STM32 series, hardware prerequisite before starting a calibration: + the ADC must have been in power-on state for at least + two ADC clock cycles. + * @rmtoll CR2 CAL LL_ADC_StartCalibration + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_StartCalibration(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->CR2, ADC_CR2_CAL); +} + +/** + * @brief Get ADC calibration state. + * @rmtoll CR2 CAL LL_ADC_IsCalibrationOnGoing + * @param ADCx ADC instance + * @retval 0: calibration complete, 1: calibration in progress. + */ +__STATIC_INLINE uint32_t LL_ADC_IsCalibrationOnGoing(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR2, ADC_CR2_CAL) == (ADC_CR2_CAL)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Operation_ADC_Group_Regular Operation on ADC hierarchical scope: group regular + * @{ + */ + +/** + * @brief Start ADC group regular conversion. + * @note On this STM32 series, this function is relevant for both + * internal trigger (SW start) and external trigger: + * - If ADC trigger has been set to software start, ADC conversion + * starts immediately. + * - If ADC trigger has been set to external trigger, ADC conversion + * will start at next trigger event (on the selected trigger edge) + * following the ADC start conversion command. + * @rmtoll CR2 EXTTRIG LL_ADC_REG_StartConversion + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_StartConversion(ADC_TypeDef *ADCx) +{ + /* Note: Set bit ADC_CR2_SWSTART for case of trigger source set to */ + /* SW start. In case of external trigger selected, this bit */ + /* has no effect. */ + SET_BIT(ADCx->CR2, (ADC_CR2_SWSTART | ADC_CR2_EXTTRIG)); +} + +/** + * @brief Stop ADC group regular conversion from external trigger. + * @note No more ADC conversion will start at next trigger event + * following the ADC stop conversion command. + * If a conversion is on-going, it will be completed. + * @note On this STM32 series, there is no specific command + * to stop a conversion on-going or to stop ADC converting + * in continuous mode. These actions can be performed + * using function @ref LL_ADC_Disable(). + * @rmtoll CR2 EXTSEL LL_ADC_REG_StopConversionExtTrig + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_REG_StopConversionExtTrig(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->CR2, ADC_CR2_EXTSEL); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * all ADC configurations: all ADC resolutions and + * all oversampling increased data width (for devices + * with feature oversampling). + * @rmtoll DR RDATA LL_ADC_REG_ReadConversionData32 + * @param ADCx ADC instance + * @retval Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_ADC_REG_ReadConversionData32(ADC_TypeDef *ADCx) +{ + return (uint16_t)(READ_BIT(ADCx->DR, ADC_DR_DATA)); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * ADC resolution 12 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_REG_ReadConversionData32. + * @rmtoll DR RDATA LL_ADC_REG_ReadConversionData12 + * @param ADCx ADC instance + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +__STATIC_INLINE uint16_t LL_ADC_REG_ReadConversionData12(ADC_TypeDef *ADCx) +{ + return (uint16_t)(READ_BIT(ADCx->DR, ADC_DR_DATA)); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_Operation_ADC_Group_Injected Operation on ADC hierarchical scope: group injected + * @{ + */ + +/** + * @brief Start ADC group injected conversion. + * @note On this STM32 series, this function is relevant for both + * internal trigger (SW start) and external trigger: + * - If ADC trigger has been set to software start, ADC conversion + * starts immediately. + * - If ADC trigger has been set to external trigger, ADC conversion + * will start at next trigger event (on the selected trigger edge) + * following the ADC start conversion command. + * @rmtoll CR2 JEXTTRIG LL_ADC_REG_StartConversion + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_StartConversion(ADC_TypeDef *ADCx) +{ + /* Note: Set bit ADC_CR2_JSWSTART for case of trigger source set to */ + /* SW start. In case of external trigger selected, this bit */ + /* has no effect. */ + SET_BIT(ADCx->CR2, (ADC_CR2_JSWSTART | ADC_CR2_JEXTTRIG)); +} + +/** + * @brief Stop ADC group injected conversion from external trigger. + * @note No more ADC conversion will start at next trigger event + * following the ADC stop conversion command. + * If a conversion is on-going, it will be completed. + * @note On this STM32 series, there is no specific command + * to stop a conversion on-going or to stop ADC converting + * in continuous mode. These actions can be performed + * using function @ref LL_ADC_Disable(). + * @rmtoll CR2 JEXTSEL LL_ADC_INJ_StopConversionExtTrig + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_INJ_StopConversionExtTrig(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->CR2, ADC_CR2_JEXTSEL); +} + +/** + * @brief Get ADC group regular conversion data, range fit for + * all ADC configurations: all ADC resolutions and + * all oversampling increased data width (for devices + * with feature oversampling). + * @rmtoll JDR1 JDATA LL_ADC_INJ_ReadConversionData32\n + * JDR2 JDATA LL_ADC_INJ_ReadConversionData32\n + * JDR3 JDATA LL_ADC_INJ_ReadConversionData32\n + * JDR4 JDATA LL_ADC_INJ_ReadConversionData32 + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Value between Min_Data=0x00000000 and Max_Data=0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_ADC_INJ_ReadConversionData32(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JDRX_REGOFFSET_MASK)); + + return (uint32_t)(READ_BIT(*preg, + ADC_JDR1_JDATA) + ); +} + +/** + * @brief Get ADC group injected conversion data, range fit for + * ADC resolution 12 bits. + * @note For devices with feature oversampling: Oversampling + * can increase data width, function for extended range + * may be needed: @ref LL_ADC_INJ_ReadConversionData32. + * @rmtoll JDR1 JDATA LL_ADC_INJ_ReadConversionData12\n + * JDR2 JDATA LL_ADC_INJ_ReadConversionData12\n + * JDR3 JDATA LL_ADC_INJ_ReadConversionData12\n + * JDR4 JDATA LL_ADC_INJ_ReadConversionData12 + * @param ADCx ADC instance + * @param Rank This parameter can be one of the following values: + * @arg @ref LL_ADC_INJ_RANK_1 + * @arg @ref LL_ADC_INJ_RANK_2 + * @arg @ref LL_ADC_INJ_RANK_3 + * @arg @ref LL_ADC_INJ_RANK_4 + * @retval Value between Min_Data=0x000 and Max_Data=0xFFF + */ +__STATIC_INLINE uint16_t LL_ADC_INJ_ReadConversionData12(ADC_TypeDef *ADCx, uint32_t Rank) +{ + __IO uint32_t *preg = __ADC_PTR_REG_OFFSET(ADCx->JDR1, __ADC_MASK_SHIFT(Rank, ADC_INJ_JDRX_REGOFFSET_MASK)); + + return (uint16_t)(READ_BIT(*preg, + ADC_JDR1_JDATA) + ); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_FLAG_Management ADC flag management + * @{ + */ + +/** + * @brief Get flag ADC group regular end of sequence conversions. + * @rmtoll SR EOC LL_ADC_IsActiveFlag_EOS + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_EOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group regular */ + /* end of unitary conversion. */ + /* Flag noted as "EOC" is corresponding to flag "EOS" */ + /* in other STM32 families). */ + return (READ_BIT(ADCx->SR, LL_ADC_FLAG_EOS) == (LL_ADC_FLAG_EOS)); +} + + +/** + * @brief Get flag ADC group injected end of sequence conversions. + * @rmtoll SR JEOC LL_ADC_IsActiveFlag_JEOS + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_JEOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group injected */ + /* end of unitary conversion. */ + /* Flag noted as "JEOC" is corresponding to flag "JEOS" */ + /* in other STM32 families). */ + return (READ_BIT(ADCx->SR, LL_ADC_FLAG_JEOS) == (LL_ADC_FLAG_JEOS)); +} + +/** + * @brief Get flag ADC analog watchdog 1 flag + * @rmtoll SR AWD LL_ADC_IsActiveFlag_AWD1 + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsActiveFlag_AWD1(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->SR, LL_ADC_FLAG_AWD1) == (LL_ADC_FLAG_AWD1)); +} + +/** + * @brief Clear flag ADC group regular end of sequence conversions. + * @rmtoll SR EOC LL_ADC_ClearFlag_EOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_EOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group regular */ + /* end of unitary conversion. */ + /* Flag noted as "EOC" is corresponding to flag "EOS" */ + /* in other STM32 families). */ + WRITE_REG(ADCx->SR, ~LL_ADC_FLAG_EOS); +} + + +/** + * @brief Clear flag ADC group injected end of sequence conversions. + * @rmtoll SR JEOC LL_ADC_ClearFlag_JEOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_JEOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group injected */ + /* end of unitary conversion. */ + /* Flag noted as "JEOC" is corresponding to flag "JEOS" */ + /* in other STM32 families). */ + WRITE_REG(ADCx->SR, ~LL_ADC_FLAG_JEOS); +} + +/** + * @brief Clear flag ADC analog watchdog 1. + * @rmtoll SR AWD LL_ADC_ClearFlag_AWD1 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_ClearFlag_AWD1(ADC_TypeDef *ADCx) +{ + WRITE_REG(ADCx->SR, ~LL_ADC_FLAG_AWD1); +} + +/** + * @} + */ + +/** @defgroup ADC_LL_EF_IT_Management ADC IT management + * @{ + */ + +/** + * @brief Enable interruption ADC group regular end of sequence conversions. + * @rmtoll CR1 EOCIE LL_ADC_EnableIT_EOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_EOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group regular */ + /* end of unitary conversion. */ + /* Flag noted as "EOC" is corresponding to flag "EOS" */ + /* in other STM32 families). */ + SET_BIT(ADCx->CR1, ADC_CR1_EOCIE); +} + + +/** + * @brief Enable interruption ADC group injected end of sequence conversions. + * @rmtoll CR1 JEOCIE LL_ADC_EnableIT_JEOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_JEOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group injected */ + /* end of unitary conversion. */ + /* Flag noted as "JEOC" is corresponding to flag "JEOS" */ + /* in other STM32 families). */ + SET_BIT(ADCx->CR1, LL_ADC_IT_JEOS); +} + +/** + * @brief Enable interruption ADC analog watchdog 1. + * @rmtoll CR1 AWDIE LL_ADC_EnableIT_AWD1 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_EnableIT_AWD1(ADC_TypeDef *ADCx) +{ + SET_BIT(ADCx->CR1, LL_ADC_IT_AWD1); +} + +/** + * @brief Disable interruption ADC group regular end of sequence conversions. + * @rmtoll CR1 EOCIE LL_ADC_DisableIT_EOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_EOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group regular */ + /* end of unitary conversion. */ + /* Flag noted as "EOC" is corresponding to flag "EOS" */ + /* in other STM32 families). */ + CLEAR_BIT(ADCx->CR1, ADC_CR1_EOCIE); +} + + +/** + * @brief Disable interruption ADC group injected end of sequence conversions. + * @rmtoll CR1 JEOCIE LL_ADC_EnableIT_JEOS + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_JEOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group injected */ + /* end of unitary conversion. */ + /* Flag noted as "JEOC" is corresponding to flag "JEOS" */ + /* in other STM32 families). */ + CLEAR_BIT(ADCx->CR1, LL_ADC_IT_JEOS); +} + +/** + * @brief Disable interruption ADC analog watchdog 1. + * @rmtoll CR1 AWDIE LL_ADC_EnableIT_AWD1 + * @param ADCx ADC instance + * @retval None + */ +__STATIC_INLINE void LL_ADC_DisableIT_AWD1(ADC_TypeDef *ADCx) +{ + CLEAR_BIT(ADCx->CR1, LL_ADC_IT_AWD1); +} + +/** + * @brief Get state of interruption ADC group regular end of sequence conversions + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll CR1 EOCIE LL_ADC_IsEnabledIT_EOS + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_EOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group regular */ + /* end of unitary conversion. */ + /* Flag noted as "EOC" is corresponding to flag "EOS" */ + /* in other STM32 families). */ + return (READ_BIT(ADCx->CR1, LL_ADC_IT_EOS) == (LL_ADC_IT_EOS)); +} + + +/** + * @brief Get state of interruption ADC group injected end of sequence conversions + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll CR1 JEOCIE LL_ADC_EnableIT_JEOS + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_JEOS(ADC_TypeDef *ADCx) +{ + /* Note: on this STM32 series, there is no flag ADC group injected */ + /* end of unitary conversion. */ + /* Flag noted as "JEOC" is corresponding to flag "JEOS" */ + /* in other STM32 families). */ + return (READ_BIT(ADCx->CR1, LL_ADC_IT_JEOS) == (LL_ADC_IT_JEOS)); +} + +/** + * @brief Get state of interruption ADC analog watchdog 1 + * (0: interrupt disabled, 1: interrupt enabled). + * @rmtoll CR1 AWDIE LL_ADC_EnableIT_AWD1 + * @param ADCx ADC instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_ADC_IsEnabledIT_AWD1(ADC_TypeDef *ADCx) +{ + return (READ_BIT(ADCx->CR1, LL_ADC_IT_AWD1) == (LL_ADC_IT_AWD1)); +} + +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup ADC_LL_EF_Init Initialization and de-initialization functions + * @{ + */ + +/* Initialization of some features of ADC common parameters and multimode */ +/* Note: On STM32F37x ADC, there is no ADC common initialization */ +/* function. */ +ErrorStatus LL_ADC_CommonDeInit(ADC_Common_TypeDef *ADCxy_COMMON); + +/* De-initialization of ADC instance, ADC group regular and ADC group injected */ +/* (availability of ADC group injected depends on STM32 families) */ +ErrorStatus LL_ADC_DeInit(ADC_TypeDef *ADCx); + +/* Initialization of some features of ADC instance */ +ErrorStatus LL_ADC_Init(ADC_TypeDef *ADCx, LL_ADC_InitTypeDef *ADC_InitStruct); +void LL_ADC_StructInit(LL_ADC_InitTypeDef *ADC_InitStruct); + +/* Initialization of some features of ADC instance and ADC group regular */ +ErrorStatus LL_ADC_REG_Init(ADC_TypeDef *ADCx, LL_ADC_REG_InitTypeDef *ADC_REG_InitStruct); +void LL_ADC_REG_StructInit(LL_ADC_REG_InitTypeDef *ADC_REG_InitStruct); + +/* Initialization of some features of ADC instance and ADC group injected */ +ErrorStatus LL_ADC_INJ_Init(ADC_TypeDef *ADCx, LL_ADC_INJ_InitTypeDef *ADC_INJ_InitStruct); +void LL_ADC_INJ_StructInit(LL_ADC_INJ_InitTypeDef *ADC_INJ_InitStruct); + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* ADC1 */ + + +#endif /* STM32F373xC || STM32F378xx */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_ADC_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_bus.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_bus.h new file mode 100644 index 0000000..92e1407 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_bus.h @@ -0,0 +1,1060 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_bus.h + * @author MCD Application Team + * @brief Header file of BUS LL module. + + @verbatim + ##### RCC Limitations ##### + ============================================================================== + [..] + A delay between an RCC peripheral clock enable and the effective peripheral + enabling should be taken into account in order to manage the peripheral read/write + from/to registers. + (+) This delay depends on the peripheral mapping. + (++) AHB & APB peripherals, 1 dummy read is necessary + + [..] + Workarounds: + (#) For AHB & APB peripherals, a dummy read to the peripheral register has been + inserted in each LL_{BUS}_GRP{x}_EnableClock() function. + + @endverbatim + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_BUS_H +#define __STM32F3xx_LL_BUS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined(RCC) + +/** @defgroup BUS_LL BUS + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ + +/* Private macros ------------------------------------------------------------*/ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup BUS_LL_Exported_Constants BUS Exported Constants + * @{ + */ + +/** @defgroup BUS_LL_EC_AHB1_GRP1_PERIPH AHB1 GRP1 PERIPH + * @{ + */ +#define LL_AHB1_GRP1_PERIPH_ALL (uint32_t)0xFFFFFFFFU +#define LL_AHB1_GRP1_PERIPH_DMA1 RCC_AHBENR_DMA1EN +#if defined(DMA2) +#define LL_AHB1_GRP1_PERIPH_DMA2 RCC_AHBENR_DMA2EN +#endif /*DMA2*/ +#define LL_AHB1_GRP1_PERIPH_SRAM RCC_AHBENR_SRAMEN +#define LL_AHB1_GRP1_PERIPH_FLASH RCC_AHBENR_FLITFEN +#if defined(FMC_Bank1) +#define LL_AHB1_GRP1_PERIPH_FMC RCC_AHBENR_FMCEN +#endif /*FMC_Bank1*/ +#define LL_AHB1_GRP1_PERIPH_CRC RCC_AHBENR_CRCEN +#if defined(GPIOH) +#define LL_AHB1_GRP1_PERIPH_GPIOH RCC_AHBENR_GPIOHEN +#endif /*GPIOH*/ +#define LL_AHB1_GRP1_PERIPH_GPIOA RCC_AHBENR_GPIOAEN +#define LL_AHB1_GRP1_PERIPH_GPIOB RCC_AHBENR_GPIOBEN +#define LL_AHB1_GRP1_PERIPH_GPIOC RCC_AHBENR_GPIOCEN +#define LL_AHB1_GRP1_PERIPH_GPIOD RCC_AHBENR_GPIODEN +#if defined(GPIOE) +#define LL_AHB1_GRP1_PERIPH_GPIOE RCC_AHBENR_GPIOEEN +#endif /*GPIOE*/ +#define LL_AHB1_GRP1_PERIPH_GPIOF RCC_AHBENR_GPIOFEN +#if defined(GPIOG) +#define LL_AHB1_GRP1_PERIPH_GPIOG RCC_AHBENR_GPIOGEN +#endif /*GPIOH*/ +#define LL_AHB1_GRP1_PERIPH_TSC RCC_AHBENR_TSCEN +#if defined(RCC_AHBENR_ADC1EN) +#define LL_AHB1_GRP1_PERIPH_ADC1 RCC_AHBENR_ADC1EN +#endif /*RCC_AHBENR_ADC1EN*/ +#if defined(ADC1_2_COMMON) +#define LL_AHB1_GRP1_PERIPH_ADC12 RCC_AHBENR_ADC12EN +#endif /*ADC1_2_COMMON*/ +#if defined(ADC3_4_COMMON) +#define LL_AHB1_GRP1_PERIPH_ADC34 RCC_AHBENR_ADC34EN +#endif /*ADC3_4_COMMON*/ +/** + * @} + */ + +/** @defgroup BUS_LL_EC_APB1_GRP1_PERIPH APB1 GRP1 PERIPH + * @{ + */ +#define LL_APB1_GRP1_PERIPH_ALL (uint32_t)0xFFFFFFFFU +#define LL_APB1_GRP1_PERIPH_TIM2 RCC_APB1ENR_TIM2EN +#if defined(TIM3) +#define LL_APB1_GRP1_PERIPH_TIM3 RCC_APB1ENR_TIM3EN +#endif /*TIM3*/ +#if defined(TIM4) +#define LL_APB1_GRP1_PERIPH_TIM4 RCC_APB1ENR_TIM4EN +#endif /*TIM4*/ +#if defined(TIM5) +#define LL_APB1_GRP1_PERIPH_TIM5 RCC_APB1ENR_TIM5EN +#endif /*TIM5*/ +#define LL_APB1_GRP1_PERIPH_TIM6 RCC_APB1ENR_TIM6EN +#if defined(TIM7) +#define LL_APB1_GRP1_PERIPH_TIM7 RCC_APB1ENR_TIM7EN +#endif /*TIM7*/ +#if defined(TIM12) +#define LL_APB1_GRP1_PERIPH_TIM12 RCC_APB1ENR_TIM12EN +#endif /*TIM12*/ +#if defined(TIM13) +#define LL_APB1_GRP1_PERIPH_TIM13 RCC_APB1ENR_TIM13EN +#endif /*TIM13*/ +#if defined(TIM14) +#define LL_APB1_GRP1_PERIPH_TIM14 RCC_APB1ENR_TIM14EN +#endif /*TIM14*/ +#if defined(TIM18) +#define LL_APB1_GRP1_PERIPH_TIM18 RCC_APB1ENR_TIM18EN +#endif /*TIM18*/ +#define LL_APB1_GRP1_PERIPH_WWDG RCC_APB1ENR_WWDGEN +#if defined(SPI2) +#define LL_APB1_GRP1_PERIPH_SPI2 RCC_APB1ENR_SPI2EN +#endif /*SPI2*/ +#if defined(SPI3) +#define LL_APB1_GRP1_PERIPH_SPI3 RCC_APB1ENR_SPI3EN +#endif /*SPI3*/ +#define LL_APB1_GRP1_PERIPH_USART2 RCC_APB1ENR_USART2EN +#define LL_APB1_GRP1_PERIPH_USART3 RCC_APB1ENR_USART3EN +#if defined(UART4) +#define LL_APB1_GRP1_PERIPH_UART4 RCC_APB1ENR_UART4EN +#endif /*UART4*/ +#if defined(UART5) +#define LL_APB1_GRP1_PERIPH_UART5 RCC_APB1ENR_UART5EN +#endif /*UART5*/ +#define LL_APB1_GRP1_PERIPH_I2C1 RCC_APB1ENR_I2C1EN +#if defined(I2C2) +#define LL_APB1_GRP1_PERIPH_I2C2 RCC_APB1ENR_I2C2EN +#endif /*I2C2*/ +#if defined(USB) +#define LL_APB1_GRP1_PERIPH_USB RCC_APB1ENR_USBEN +#endif /*USB*/ +#if defined(CAN) +#define LL_APB1_GRP1_PERIPH_CAN RCC_APB1ENR_CANEN +#endif /*CAN*/ +#if defined(DAC2) +#define LL_APB1_GRP1_PERIPH_DAC2 RCC_APB1ENR_DAC2EN +#endif /*DAC2*/ +#define LL_APB1_GRP1_PERIPH_PWR RCC_APB1ENR_PWREN +#define LL_APB1_GRP1_PERIPH_DAC1 RCC_APB1ENR_DAC1EN +#if defined(CEC) +#define LL_APB1_GRP1_PERIPH_CEC RCC_APB1ENR_CECEN +#endif /*CEC*/ +#if defined(I2C3) +#define LL_APB1_GRP1_PERIPH_I2C3 RCC_APB1ENR_I2C3EN +#endif /*I2C3*/ +/** + * @} + */ + +/** @defgroup BUS_LL_EC_APB2_GRP1_PERIPH APB2 GRP1 PERIPH + * @{ + */ +#define LL_APB2_GRP1_PERIPH_ALL (uint32_t)0xFFFFFFFFU +#define LL_APB2_GRP1_PERIPH_SYSCFG RCC_APB2ENR_SYSCFGEN +#if defined(RCC_APB2ENR_ADC1EN) +#define LL_APB2_GRP1_PERIPH_ADC1 RCC_APB2ENR_ADC1EN +#endif /*RCC_APB2ENR_ADC1EN*/ +#if defined(TIM1) +#define LL_APB2_GRP1_PERIPH_TIM1 RCC_APB2ENR_TIM1EN +#endif /*TIM1*/ +#if defined(SPI1) +#define LL_APB2_GRP1_PERIPH_SPI1 RCC_APB2ENR_SPI1EN +#endif /*SPI1*/ +#if defined(TIM8) +#define LL_APB2_GRP1_PERIPH_TIM8 RCC_APB2ENR_TIM8EN +#endif /*TIM8*/ +#define LL_APB2_GRP1_PERIPH_USART1 RCC_APB2ENR_USART1EN +#if defined(SPI4) +#define LL_APB2_GRP1_PERIPH_SPI4 RCC_APB2ENR_SPI4EN +#endif /*SPI4*/ +#define LL_APB2_GRP1_PERIPH_TIM15 RCC_APB2ENR_TIM15EN +#define LL_APB2_GRP1_PERIPH_TIM16 RCC_APB2ENR_TIM16EN +#define LL_APB2_GRP1_PERIPH_TIM17 RCC_APB2ENR_TIM17EN +#if defined(TIM19) +#define LL_APB2_GRP1_PERIPH_TIM19 RCC_APB2ENR_TIM19EN +#endif /*TIM19*/ +#if defined(TIM20) +#define LL_APB2_GRP1_PERIPH_TIM20 RCC_APB2ENR_TIM20EN +#endif /*TIM20*/ +#if defined(HRTIM1) +#define LL_APB2_GRP1_PERIPH_HRTIM1 RCC_APB2ENR_HRTIM1EN +#endif /*HRTIM1*/ +#if defined(SDADC1) +#define LL_APB2_GRP1_PERIPH_SDADC1 RCC_APB2ENR_SDADC1EN +#endif /*SDADC1*/ +#if defined(SDADC2) +#define LL_APB2_GRP1_PERIPH_SDADC2 RCC_APB2ENR_SDADC2EN +#endif /*SDADC2*/ +#if defined(SDADC3) +#define LL_APB2_GRP1_PERIPH_SDADC3 RCC_APB2ENR_SDADC3EN +#endif /*SDADC3*/ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup BUS_LL_Exported_Functions BUS Exported Functions + * @{ + */ + +/** @defgroup BUS_LL_EF_AHB1 AHB1 + * @{ + */ + +/** + * @brief Enable AHB1 peripherals clock. + * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_EnableClock\n + * AHBENR DMA2EN LL_AHB1_GRP1_EnableClock\n + * AHBENR SRAMEN LL_AHB1_GRP1_EnableClock\n + * AHBENR FLITFEN LL_AHB1_GRP1_EnableClock\n + * AHBENR FMCEN LL_AHB1_GRP1_EnableClock\n + * AHBENR CRCEN LL_AHB1_GRP1_EnableClock\n + * AHBENR GPIOHEN LL_AHB1_GRP1_EnableClock\n + * AHBENR GPIOAEN LL_AHB1_GRP1_EnableClock\n + * AHBENR GPIOBEN LL_AHB1_GRP1_EnableClock\n + * AHBENR GPIOCEN LL_AHB1_GRP1_EnableClock\n + * AHBENR GPIODEN LL_AHB1_GRP1_EnableClock\n + * AHBENR GPIOEEN LL_AHB1_GRP1_EnableClock\n + * AHBENR GPIOFEN LL_AHB1_GRP1_EnableClock\n + * AHBENR GPIOGEN LL_AHB1_GRP1_EnableClock\n + * AHBENR TSCEN LL_AHB1_GRP1_EnableClock\n + * AHBENR ADC1EN LL_AHB1_GRP1_EnableClock\n + * AHBENR ADC12EN LL_AHB1_GRP1_EnableClock\n + * AHBENR ADC34EN LL_AHB1_GRP1_EnableClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1 + * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM + * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH + * @arg @ref LL_AHB1_GRP1_PERIPH_FMC (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_CRC + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOH (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOG (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_TSC + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC12 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC34 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_AHB1_GRP1_EnableClock(uint32_t Periphs) +{ + __IO uint32_t tmpreg; + SET_BIT(RCC->AHBENR, Periphs); + /* Delay after an RCC peripheral clock enabling */ + tmpreg = READ_BIT(RCC->AHBENR, Periphs); + (void)tmpreg; +} + +/** + * @brief Check if AHB1 peripheral clock is enabled or not + * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR DMA2EN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR SRAMEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR FLITFEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR FMCEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR CRCEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR GPIOHEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR GPIOAEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR GPIOBEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR GPIOCEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR GPIODEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR GPIOEEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR GPIOFEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR GPIOGEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR TSCEN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR ADC1EN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR ADC12EN LL_AHB1_GRP1_IsEnabledClock\n + * AHBENR ADC34EN LL_AHB1_GRP1_IsEnabledClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1 + * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM + * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH + * @arg @ref LL_AHB1_GRP1_PERIPH_FMC (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_CRC + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOH (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOG (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_TSC + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC12 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC34 (*) + * + * (*) value not defined in all devices. + * @retval State of Periphs (1 or 0). +*/ +__STATIC_INLINE uint32_t LL_AHB1_GRP1_IsEnabledClock(uint32_t Periphs) +{ + return (READ_BIT(RCC->AHBENR, Periphs) == Periphs); +} + +/** + * @brief Disable AHB1 peripherals clock. + * @rmtoll AHBENR DMA1EN LL_AHB1_GRP1_DisableClock\n + * AHBENR DMA2EN LL_AHB1_GRP1_DisableClock\n + * AHBENR SRAMEN LL_AHB1_GRP1_DisableClock\n + * AHBENR FLITFEN LL_AHB1_GRP1_DisableClock\n + * AHBENR FMCEN LL_AHB1_GRP1_DisableClock\n + * AHBENR CRCEN LL_AHB1_GRP1_DisableClock\n + * AHBENR GPIOHEN LL_AHB1_GRP1_DisableClock\n + * AHBENR GPIOAEN LL_AHB1_GRP1_DisableClock\n + * AHBENR GPIOBEN LL_AHB1_GRP1_DisableClock\n + * AHBENR GPIOCEN LL_AHB1_GRP1_DisableClock\n + * AHBENR GPIODEN LL_AHB1_GRP1_DisableClock\n + * AHBENR GPIOEEN LL_AHB1_GRP1_DisableClock\n + * AHBENR GPIOFEN LL_AHB1_GRP1_DisableClock\n + * AHBENR GPIOGEN LL_AHB1_GRP1_DisableClock\n + * AHBENR TSCEN LL_AHB1_GRP1_DisableClock\n + * AHBENR ADC1EN LL_AHB1_GRP1_DisableClock\n + * AHBENR ADC12EN LL_AHB1_GRP1_DisableClock\n + * AHBENR ADC34EN LL_AHB1_GRP1_DisableClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_AHB1_GRP1_PERIPH_DMA1 + * @arg @ref LL_AHB1_GRP1_PERIPH_DMA2 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_SRAM + * @arg @ref LL_AHB1_GRP1_PERIPH_FLASH + * @arg @ref LL_AHB1_GRP1_PERIPH_FMC (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_CRC + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOH (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOG (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_TSC + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC12 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC34 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_AHB1_GRP1_DisableClock(uint32_t Periphs) +{ + CLEAR_BIT(RCC->AHBENR, Periphs); +} + +/** + * @brief Force AHB1 peripherals reset. + * @rmtoll AHBRSTR FMCRST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR GPIOHRST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR GPIOARST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR GPIOBRST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR GPIOCRST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR GPIODRST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR GPIOERST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR GPIOFRST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR GPIOGRST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR TSCRST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR ADC1RST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR ADC12RST LL_AHB1_GRP1_ForceReset\n + * AHBRSTR ADC34RST LL_AHB1_GRP1_ForceReset + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_AHB1_GRP1_PERIPH_ALL + * @arg @ref LL_AHB1_GRP1_PERIPH_FMC (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOH (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOG (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_TSC + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC12 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC34 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_AHB1_GRP1_ForceReset(uint32_t Periphs) +{ + SET_BIT(RCC->AHBRSTR, Periphs); +} + +/** + * @brief Release AHB1 peripherals reset. + * @rmtoll AHBRSTR FMCRST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR GPIOHRST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR GPIOARST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR GPIOBRST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR GPIOCRST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR GPIODRST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR GPIOERST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR GPIOFRST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR GPIOGRST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR TSCRST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR ADC1RST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR ADC12RST LL_AHB1_GRP1_ReleaseReset\n + * AHBRSTR ADC34RST LL_AHB1_GRP1_ReleaseReset + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_AHB1_GRP1_PERIPH_ALL + * @arg @ref LL_AHB1_GRP1_PERIPH_FMC (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOH (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOA + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOB + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOC + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOD + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOE (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOF + * @arg @ref LL_AHB1_GRP1_PERIPH_GPIOG (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_TSC + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC12 (*) + * @arg @ref LL_AHB1_GRP1_PERIPH_ADC34 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_AHB1_GRP1_ReleaseReset(uint32_t Periphs) +{ + CLEAR_BIT(RCC->AHBRSTR, Periphs); +} + +/** + * @} + */ + +/** @defgroup BUS_LL_EF_APB1 APB1 + * @{ + */ + +/** + * @brief Enable APB1 peripherals clock. + * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM3EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM4EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM5EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM6EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM7EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM12EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM13EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM14EN LL_APB1_GRP1_EnableClock\n + * APB1ENR TIM18EN LL_APB1_GRP1_EnableClock\n + * APB1ENR WWDGEN LL_APB1_GRP1_EnableClock\n + * APB1ENR SPI2EN LL_APB1_GRP1_EnableClock\n + * APB1ENR SPI3EN LL_APB1_GRP1_EnableClock\n + * APB1ENR USART2EN LL_APB1_GRP1_EnableClock\n + * APB1ENR USART3EN LL_APB1_GRP1_EnableClock\n + * APB1ENR UART4EN LL_APB1_GRP1_EnableClock\n + * APB1ENR UART5EN LL_APB1_GRP1_EnableClock\n + * APB1ENR I2C1EN LL_APB1_GRP1_EnableClock\n + * APB1ENR I2C2EN LL_APB1_GRP1_EnableClock\n + * APB1ENR USBEN LL_APB1_GRP1_EnableClock\n + * APB1ENR CANEN LL_APB1_GRP1_EnableClock\n + * APB1ENR DAC2EN LL_APB1_GRP1_EnableClock\n + * APB1ENR PWREN LL_APB1_GRP1_EnableClock\n + * APB1ENR DAC1EN LL_APB1_GRP1_EnableClock\n + * APB1ENR CECEN LL_APB1_GRP1_EnableClock\n + * APB1ENR I2C3EN LL_APB1_GRP1_EnableClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM18 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_WWDG + * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USART2 + * @arg @ref LL_APB1_GRP1_PERIPH_USART3 + * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C1 + * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USB (*) + * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*) + * @arg @ref LL_APB1_GRP1_PERIPH_DAC2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_PWR + * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 + * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_APB1_GRP1_EnableClock(uint32_t Periphs) +{ + __IO uint32_t tmpreg; + SET_BIT(RCC->APB1ENR, Periphs); + /* Delay after an RCC peripheral clock enabling */ + tmpreg = READ_BIT(RCC->APB1ENR, Periphs); + (void)tmpreg; +} + +/** + * @brief Check if APB1 peripheral clock is enabled or not + * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM3EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM4EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM5EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM6EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM7EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM12EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM13EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM14EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR TIM18EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR WWDGEN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR SPI2EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR SPI3EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR USART2EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR USART3EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR UART4EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR UART5EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR I2C1EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR I2C2EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR USBEN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR CANEN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR DAC2EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR PWREN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR DAC1EN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR CECEN LL_APB1_GRP1_IsEnabledClock\n + * APB1ENR I2C3EN LL_APB1_GRP1_IsEnabledClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM18 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_WWDG + * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USART2 + * @arg @ref LL_APB1_GRP1_PERIPH_USART3 + * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C1 + * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USB (*) + * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*) + * @arg @ref LL_APB1_GRP1_PERIPH_DAC2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_PWR + * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 + * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*) + * + * (*) value not defined in all devices. + * @retval State of Periphs (1 or 0). +*/ +__STATIC_INLINE uint32_t LL_APB1_GRP1_IsEnabledClock(uint32_t Periphs) +{ + return (READ_BIT(RCC->APB1ENR, Periphs) == Periphs); +} + +/** + * @brief Disable APB1 peripherals clock. + * @rmtoll APB1ENR TIM2EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM3EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM4EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM5EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM6EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM7EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM12EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM13EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM14EN LL_APB1_GRP1_DisableClock\n + * APB1ENR TIM18EN LL_APB1_GRP1_DisableClock\n + * APB1ENR WWDGEN LL_APB1_GRP1_DisableClock\n + * APB1ENR SPI2EN LL_APB1_GRP1_DisableClock\n + * APB1ENR SPI3EN LL_APB1_GRP1_DisableClock\n + * APB1ENR USART2EN LL_APB1_GRP1_DisableClock\n + * APB1ENR USART3EN LL_APB1_GRP1_DisableClock\n + * APB1ENR UART4EN LL_APB1_GRP1_DisableClock\n + * APB1ENR UART5EN LL_APB1_GRP1_DisableClock\n + * APB1ENR I2C1EN LL_APB1_GRP1_DisableClock\n + * APB1ENR I2C2EN LL_APB1_GRP1_DisableClock\n + * APB1ENR USBEN LL_APB1_GRP1_DisableClock\n + * APB1ENR CANEN LL_APB1_GRP1_DisableClock\n + * APB1ENR DAC2EN LL_APB1_GRP1_DisableClock\n + * APB1ENR PWREN LL_APB1_GRP1_DisableClock\n + * APB1ENR DAC1EN LL_APB1_GRP1_DisableClock\n + * APB1ENR CECEN LL_APB1_GRP1_DisableClock\n + * APB1ENR I2C3EN LL_APB1_GRP1_DisableClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM18 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_WWDG + * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USART2 + * @arg @ref LL_APB1_GRP1_PERIPH_USART3 + * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C1 + * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USB (*) + * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*) + * @arg @ref LL_APB1_GRP1_PERIPH_DAC2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_PWR + * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 + * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_APB1_GRP1_DisableClock(uint32_t Periphs) +{ + CLEAR_BIT(RCC->APB1ENR, Periphs); +} + +/** + * @brief Force APB1 peripherals reset. + * @rmtoll APB1RSTR TIM2RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM3RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM4RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM5RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM6RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM7RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM12RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM13RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM14RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR TIM18RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR WWDGRST LL_APB1_GRP1_ForceReset\n + * APB1RSTR SPI2RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR SPI3RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR USART2RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR USART3RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR UART4RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR UART5RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR I2C1RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR I2C2RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR USBRST LL_APB1_GRP1_ForceReset\n + * APB1RSTR CANRST LL_APB1_GRP1_ForceReset\n + * APB1RSTR DAC2RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR PWRRST LL_APB1_GRP1_ForceReset\n + * APB1RSTR DAC1RST LL_APB1_GRP1_ForceReset\n + * APB1RSTR CECRST LL_APB1_GRP1_ForceReset\n + * APB1RSTR I2C3RST LL_APB1_GRP1_ForceReset + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB1_GRP1_PERIPH_ALL + * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM18 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_WWDG + * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USART2 + * @arg @ref LL_APB1_GRP1_PERIPH_USART3 + * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C1 + * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USB (*) + * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*) + * @arg @ref LL_APB1_GRP1_PERIPH_DAC2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_PWR + * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 + * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_APB1_GRP1_ForceReset(uint32_t Periphs) +{ + SET_BIT(RCC->APB1RSTR, Periphs); +} + +/** + * @brief Release APB1 peripherals reset. + * @rmtoll APB1RSTR TIM2RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM3RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM4RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM5RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM6RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM7RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM12RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM13RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM14RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR TIM18RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR WWDGRST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR SPI2RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR SPI3RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR USART2RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR USART3RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR UART4RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR UART5RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR I2C1RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR I2C2RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR USBRST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR CANRST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR DAC2RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR PWRRST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR DAC1RST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR CECRST LL_APB1_GRP1_ReleaseReset\n + * APB1RSTR I2C3RST LL_APB1_GRP1_ReleaseReset + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB1_GRP1_PERIPH_ALL + * @arg @ref LL_APB1_GRP1_PERIPH_TIM2 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM6 + * @arg @ref LL_APB1_GRP1_PERIPH_TIM7 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM12 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM13 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM14 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_TIM18 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_WWDG + * @arg @ref LL_APB1_GRP1_PERIPH_SPI2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_SPI3 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USART2 + * @arg @ref LL_APB1_GRP1_PERIPH_USART3 + * @arg @ref LL_APB1_GRP1_PERIPH_UART4 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_UART5 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C1 + * @arg @ref LL_APB1_GRP1_PERIPH_I2C2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_USB (*) + * @arg @ref LL_APB1_GRP1_PERIPH_CAN (*) + * @arg @ref LL_APB1_GRP1_PERIPH_DAC2 (*) + * @arg @ref LL_APB1_GRP1_PERIPH_PWR + * @arg @ref LL_APB1_GRP1_PERIPH_DAC1 + * @arg @ref LL_APB1_GRP1_PERIPH_CEC (*) + * @arg @ref LL_APB1_GRP1_PERIPH_I2C3 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_APB1_GRP1_ReleaseReset(uint32_t Periphs) +{ + CLEAR_BIT(RCC->APB1RSTR, Periphs); +} + +/** + * @} + */ + +/** @defgroup BUS_LL_EF_APB2 APB2 + * @{ + */ + +/** + * @brief Enable APB2 peripherals clock. + * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_EnableClock\n + * APB2ENR ADC1EN LL_APB2_GRP1_EnableClock\n + * APB2ENR TIM1EN LL_APB2_GRP1_EnableClock\n + * APB2ENR SPI1EN LL_APB2_GRP1_EnableClock\n + * APB2ENR TIM8EN LL_APB2_GRP1_EnableClock\n + * APB2ENR USART1EN LL_APB2_GRP1_EnableClock\n + * APB2ENR SPI4EN LL_APB2_GRP1_EnableClock\n + * APB2ENR TIM15EN LL_APB2_GRP1_EnableClock\n + * APB2ENR TIM16EN LL_APB2_GRP1_EnableClock\n + * APB2ENR TIM17EN LL_APB2_GRP1_EnableClock\n + * APB2ENR TIM19EN LL_APB2_GRP1_EnableClock\n + * APB2ENR TIM20EN LL_APB2_GRP1_EnableClock\n + * APB2ENR HRTIM1EN LL_APB2_GRP1_EnableClock\n + * APB2ENR SDADC1EN LL_APB2_GRP1_EnableClock\n + * APB2ENR SDADC2EN LL_APB2_GRP1_EnableClock\n + * APB2ENR SDADC3EN LL_APB2_GRP1_EnableClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG + * @arg @ref LL_APB2_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SPI1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_USART1 + * @arg @ref LL_APB2_GRP1_PERIPH_SPI4 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM16 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM19 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM20 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_HRTIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC2 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC3 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_APB2_GRP1_EnableClock(uint32_t Periphs) +{ + __IO uint32_t tmpreg; + SET_BIT(RCC->APB2ENR, Periphs); + /* Delay after an RCC peripheral clock enabling */ + tmpreg = READ_BIT(RCC->APB2ENR, Periphs); + (void)tmpreg; +} + +/** + * @brief Check if APB2 peripheral clock is enabled or not + * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR ADC1EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR TIM1EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR SPI1EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR TIM8EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR USART1EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR SPI4EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR TIM15EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR TIM16EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR TIM17EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR TIM19EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR TIM20EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR HRTIM1EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR SDADC1EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR SDADC2EN LL_APB2_GRP1_IsEnabledClock\n + * APB2ENR SDADC3EN LL_APB2_GRP1_IsEnabledClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG + * @arg @ref LL_APB2_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SPI1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_USART1 + * @arg @ref LL_APB2_GRP1_PERIPH_SPI4 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM16 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM19 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM20 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_HRTIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC2 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC3 (*) + * + * (*) value not defined in all devices. + * @retval State of Periphs (1 or 0). +*/ +__STATIC_INLINE uint32_t LL_APB2_GRP1_IsEnabledClock(uint32_t Periphs) +{ + return (READ_BIT(RCC->APB2ENR, Periphs) == Periphs); +} + +/** + * @brief Disable APB2 peripherals clock. + * @rmtoll APB2ENR SYSCFGEN LL_APB2_GRP1_DisableClock\n + * APB2ENR ADC1EN LL_APB2_GRP1_DisableClock\n + * APB2ENR TIM1EN LL_APB2_GRP1_DisableClock\n + * APB2ENR SPI1EN LL_APB2_GRP1_DisableClock\n + * APB2ENR TIM8EN LL_APB2_GRP1_DisableClock\n + * APB2ENR USART1EN LL_APB2_GRP1_DisableClock\n + * APB2ENR SPI4EN LL_APB2_GRP1_DisableClock\n + * APB2ENR TIM15EN LL_APB2_GRP1_DisableClock\n + * APB2ENR TIM16EN LL_APB2_GRP1_DisableClock\n + * APB2ENR TIM17EN LL_APB2_GRP1_DisableClock\n + * APB2ENR TIM19EN LL_APB2_GRP1_DisableClock\n + * APB2ENR TIM20EN LL_APB2_GRP1_DisableClock\n + * APB2ENR HRTIM1EN LL_APB2_GRP1_DisableClock\n + * APB2ENR SDADC1EN LL_APB2_GRP1_DisableClock\n + * APB2ENR SDADC2EN LL_APB2_GRP1_DisableClock\n + * APB2ENR SDADC3EN LL_APB2_GRP1_DisableClock + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG + * @arg @ref LL_APB2_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SPI1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_USART1 + * @arg @ref LL_APB2_GRP1_PERIPH_SPI4 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM16 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM19 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM20 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_HRTIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC2 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC3 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_APB2_GRP1_DisableClock(uint32_t Periphs) +{ + CLEAR_BIT(RCC->APB2ENR, Periphs); +} + +/** + * @brief Force APB2 peripherals reset. + * @rmtoll APB2RSTR SYSCFGRST LL_APB2_GRP1_ForceReset\n + * APB2RSTR ADC1RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR TIM1RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR SPI1RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR TIM8RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR USART1RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR SPI4RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR TIM15RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR TIM16RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR TIM17RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR TIM19RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR TIM20RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR HRTIM1RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR SDADC1RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR SDADC2RST LL_APB2_GRP1_ForceReset\n + * APB2RSTR SDADC3RST LL_APB2_GRP1_ForceReset + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB2_GRP1_PERIPH_ALL + * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG + * @arg @ref LL_APB2_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SPI1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_USART1 + * @arg @ref LL_APB2_GRP1_PERIPH_SPI4 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM16 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM19 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM20 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_HRTIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC2 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC3 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_APB2_GRP1_ForceReset(uint32_t Periphs) +{ + SET_BIT(RCC->APB2RSTR, Periphs); +} + +/** + * @brief Release APB2 peripherals reset. + * @rmtoll APB2RSTR SYSCFGRST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR ADC1RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR TIM1RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR SPI1RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR TIM8RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR USART1RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR SPI4RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR TIM15RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR TIM16RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR TIM17RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR TIM19RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR TIM20RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR HRTIM1RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR SDADC1RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR SDADC2RST LL_APB2_GRP1_ReleaseReset\n + * APB2RSTR SDADC3RST LL_APB2_GRP1_ReleaseReset + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_APB2_GRP1_PERIPH_ALL + * @arg @ref LL_APB2_GRP1_PERIPH_SYSCFG + * @arg @ref LL_APB2_GRP1_PERIPH_ADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SPI1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM8 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_USART1 + * @arg @ref LL_APB2_GRP1_PERIPH_SPI4 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM15 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM16 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM17 + * @arg @ref LL_APB2_GRP1_PERIPH_TIM19 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_TIM20 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_HRTIM1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC1 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC2 (*) + * @arg @ref LL_APB2_GRP1_PERIPH_SDADC3 (*) + * + * (*) value not defined in all devices. + * @retval None +*/ +__STATIC_INLINE void LL_APB2_GRP1_ReleaseReset(uint32_t Periphs) +{ + CLEAR_BIT(RCC->APB2RSTR, Periphs); +} + +/** + * @} + */ + + +/** + * @} + */ + +/** + * @} + */ + +#endif /* defined(RCC) */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_BUS_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_cortex.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_cortex.h new file mode 100644 index 0000000..a16dc62 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_cortex.h @@ -0,0 +1,638 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_cortex.h + * @author MCD Application Team + * @brief Header file of CORTEX LL module. + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + The LL CORTEX driver contains a set of generic APIs that can be + used by user: + (+) SYSTICK configuration used by LL_mDelay and LL_Init1msTick + functions + (+) Low power mode configuration (SCB register of Cortex-MCU) + (+) MPU API to configure and enable regions + (MPU services provided only on some devices) + (+) API to access to MCU info (CPUID register) + (+) API to enable fault handler (SHCSR accesses) + + @endverbatim + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_CORTEX_H +#define __STM32F3xx_LL_CORTEX_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +/** @defgroup CORTEX_LL CORTEX + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ + +/* Private macros ------------------------------------------------------------*/ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup CORTEX_LL_Exported_Constants CORTEX Exported Constants + * @{ + */ + +/** @defgroup CORTEX_LL_EC_CLKSOURCE_HCLK SYSTICK Clock Source + * @{ + */ +#define LL_SYSTICK_CLKSOURCE_HCLK_DIV8 0x00000000U /*!< AHB clock divided by 8 selected as SysTick clock source.*/ +#define LL_SYSTICK_CLKSOURCE_HCLK SysTick_CTRL_CLKSOURCE_Msk /*!< AHB clock selected as SysTick clock source. */ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_FAULT Handler Fault type + * @{ + */ +#define LL_HANDLER_FAULT_USG SCB_SHCSR_USGFAULTENA_Msk /*!< Usage fault */ +#define LL_HANDLER_FAULT_BUS SCB_SHCSR_BUSFAULTENA_Msk /*!< Bus fault */ +#define LL_HANDLER_FAULT_MEM SCB_SHCSR_MEMFAULTENA_Msk /*!< Memory management fault */ +/** + * @} + */ + +#if __MPU_PRESENT + +/** @defgroup CORTEX_LL_EC_CTRL_HFNMI_PRIVDEF MPU Control + * @{ + */ +#define LL_MPU_CTRL_HFNMI_PRIVDEF_NONE 0x00000000U /*!< Disable NMI and privileged SW access */ +#define LL_MPU_CTRL_HARDFAULT_NMI MPU_CTRL_HFNMIENA_Msk /*!< Enables the operation of MPU during hard fault, NMI, and FAULTMASK handlers */ +#define LL_MPU_CTRL_PRIVILEGED_DEFAULT MPU_CTRL_PRIVDEFENA_Msk /*!< Enable privileged software access to default memory map */ +#define LL_MPU_CTRL_HFNMI_PRIVDEF (MPU_CTRL_HFNMIENA_Msk | MPU_CTRL_PRIVDEFENA_Msk) /*!< Enable NMI and privileged SW access */ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_REGION MPU Region Number + * @{ + */ +#define LL_MPU_REGION_NUMBER0 0x00U /*!< REGION Number 0 */ +#define LL_MPU_REGION_NUMBER1 0x01U /*!< REGION Number 1 */ +#define LL_MPU_REGION_NUMBER2 0x02U /*!< REGION Number 2 */ +#define LL_MPU_REGION_NUMBER3 0x03U /*!< REGION Number 3 */ +#define LL_MPU_REGION_NUMBER4 0x04U /*!< REGION Number 4 */ +#define LL_MPU_REGION_NUMBER5 0x05U /*!< REGION Number 5 */ +#define LL_MPU_REGION_NUMBER6 0x06U /*!< REGION Number 6 */ +#define LL_MPU_REGION_NUMBER7 0x07U /*!< REGION Number 7 */ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_REGION_SIZE MPU Region Size + * @{ + */ +#define LL_MPU_REGION_SIZE_32B (0x04U << MPU_RASR_SIZE_Pos) /*!< 32B Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_64B (0x05U << MPU_RASR_SIZE_Pos) /*!< 64B Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_128B (0x06U << MPU_RASR_SIZE_Pos) /*!< 128B Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_256B (0x07U << MPU_RASR_SIZE_Pos) /*!< 256B Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_512B (0x08U << MPU_RASR_SIZE_Pos) /*!< 512B Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_1KB (0x09U << MPU_RASR_SIZE_Pos) /*!< 1KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_2KB (0x0AU << MPU_RASR_SIZE_Pos) /*!< 2KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_4KB (0x0BU << MPU_RASR_SIZE_Pos) /*!< 4KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_8KB (0x0CU << MPU_RASR_SIZE_Pos) /*!< 8KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_16KB (0x0DU << MPU_RASR_SIZE_Pos) /*!< 16KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_32KB (0x0EU << MPU_RASR_SIZE_Pos) /*!< 32KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_64KB (0x0FU << MPU_RASR_SIZE_Pos) /*!< 64KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_128KB (0x10U << MPU_RASR_SIZE_Pos) /*!< 128KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_256KB (0x11U << MPU_RASR_SIZE_Pos) /*!< 256KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_512KB (0x12U << MPU_RASR_SIZE_Pos) /*!< 512KB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_1MB (0x13U << MPU_RASR_SIZE_Pos) /*!< 1MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_2MB (0x14U << MPU_RASR_SIZE_Pos) /*!< 2MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_4MB (0x15U << MPU_RASR_SIZE_Pos) /*!< 4MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_8MB (0x16U << MPU_RASR_SIZE_Pos) /*!< 8MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_16MB (0x17U << MPU_RASR_SIZE_Pos) /*!< 16MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_32MB (0x18U << MPU_RASR_SIZE_Pos) /*!< 32MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_64MB (0x19U << MPU_RASR_SIZE_Pos) /*!< 64MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_128MB (0x1AU << MPU_RASR_SIZE_Pos) /*!< 128MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_256MB (0x1BU << MPU_RASR_SIZE_Pos) /*!< 256MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_512MB (0x1CU << MPU_RASR_SIZE_Pos) /*!< 512MB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_1GB (0x1DU << MPU_RASR_SIZE_Pos) /*!< 1GB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_2GB (0x1EU << MPU_RASR_SIZE_Pos) /*!< 2GB Size of the MPU protection region */ +#define LL_MPU_REGION_SIZE_4GB (0x1FU << MPU_RASR_SIZE_Pos) /*!< 4GB Size of the MPU protection region */ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_REGION_PRIVILEDGES MPU Region Privileges + * @{ + */ +#define LL_MPU_REGION_NO_ACCESS (0x00U << MPU_RASR_AP_Pos) /*!< No access*/ +#define LL_MPU_REGION_PRIV_RW (0x01U << MPU_RASR_AP_Pos) /*!< RW privileged (privileged access only)*/ +#define LL_MPU_REGION_PRIV_RW_URO (0x02U << MPU_RASR_AP_Pos) /*!< RW privileged - RO user (Write in a user program generates a fault) */ +#define LL_MPU_REGION_FULL_ACCESS (0x03U << MPU_RASR_AP_Pos) /*!< RW privileged & user (Full access) */ +#define LL_MPU_REGION_PRIV_RO (0x05U << MPU_RASR_AP_Pos) /*!< RO privileged (privileged read only)*/ +#define LL_MPU_REGION_PRIV_RO_URO (0x06U << MPU_RASR_AP_Pos) /*!< RO privileged & user (read only) */ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_TEX MPU TEX Level + * @{ + */ +#define LL_MPU_TEX_LEVEL0 (0x00U << MPU_RASR_TEX_Pos) /*!< b000 for TEX bits */ +#define LL_MPU_TEX_LEVEL1 (0x01U << MPU_RASR_TEX_Pos) /*!< b001 for TEX bits */ +#define LL_MPU_TEX_LEVEL2 (0x02U << MPU_RASR_TEX_Pos) /*!< b010 for TEX bits */ +#define LL_MPU_TEX_LEVEL4 (0x04U << MPU_RASR_TEX_Pos) /*!< b100 for TEX bits */ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_INSTRUCTION_ACCESS MPU Instruction Access + * @{ + */ +#define LL_MPU_INSTRUCTION_ACCESS_ENABLE 0x00U /*!< Instruction fetches enabled */ +#define LL_MPU_INSTRUCTION_ACCESS_DISABLE MPU_RASR_XN_Msk /*!< Instruction fetches disabled*/ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_SHAREABLE_ACCESS MPU Shareable Access + * @{ + */ +#define LL_MPU_ACCESS_SHAREABLE MPU_RASR_S_Msk /*!< Shareable memory attribute */ +#define LL_MPU_ACCESS_NOT_SHAREABLE 0x00U /*!< Not Shareable memory attribute */ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_CACHEABLE_ACCESS MPU Cacheable Access + * @{ + */ +#define LL_MPU_ACCESS_CACHEABLE MPU_RASR_C_Msk /*!< Cacheable memory attribute */ +#define LL_MPU_ACCESS_NOT_CACHEABLE 0x00U /*!< Not Cacheable memory attribute */ +/** + * @} + */ + +/** @defgroup CORTEX_LL_EC_BUFFERABLE_ACCESS MPU Bufferable Access + * @{ + */ +#define LL_MPU_ACCESS_BUFFERABLE MPU_RASR_B_Msk /*!< Bufferable memory attribute */ +#define LL_MPU_ACCESS_NOT_BUFFERABLE 0x00U /*!< Not Bufferable memory attribute */ +/** + * @} + */ +#endif /* __MPU_PRESENT */ +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup CORTEX_LL_Exported_Functions CORTEX Exported Functions + * @{ + */ + +/** @defgroup CORTEX_LL_EF_SYSTICK SYSTICK + * @{ + */ + +/** + * @brief This function checks if the Systick counter flag is active or not. + * @note It can be used in timeout function on application side. + * @rmtoll STK_CTRL COUNTFLAG LL_SYSTICK_IsActiveCounterFlag + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSTICK_IsActiveCounterFlag(void) +{ + return ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == (SysTick_CTRL_COUNTFLAG_Msk)); +} + +/** + * @brief Configures the SysTick clock source + * @rmtoll STK_CTRL CLKSOURCE LL_SYSTICK_SetClkSource + * @param Source This parameter can be one of the following values: + * @arg @ref LL_SYSTICK_CLKSOURCE_HCLK_DIV8 + * @arg @ref LL_SYSTICK_CLKSOURCE_HCLK + * @retval None + */ +__STATIC_INLINE void LL_SYSTICK_SetClkSource(uint32_t Source) +{ + if (Source == LL_SYSTICK_CLKSOURCE_HCLK) + { + SET_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK); + } + else + { + CLEAR_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK); + } +} + +/** + * @brief Get the SysTick clock source + * @rmtoll STK_CTRL CLKSOURCE LL_SYSTICK_GetClkSource + * @retval Returned value can be one of the following values: + * @arg @ref LL_SYSTICK_CLKSOURCE_HCLK_DIV8 + * @arg @ref LL_SYSTICK_CLKSOURCE_HCLK + */ +__STATIC_INLINE uint32_t LL_SYSTICK_GetClkSource(void) +{ + return READ_BIT(SysTick->CTRL, LL_SYSTICK_CLKSOURCE_HCLK); +} + +/** + * @brief Enable SysTick exception request + * @rmtoll STK_CTRL TICKINT LL_SYSTICK_EnableIT + * @retval None + */ +__STATIC_INLINE void LL_SYSTICK_EnableIT(void) +{ + SET_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk); +} + +/** + * @brief Disable SysTick exception request + * @rmtoll STK_CTRL TICKINT LL_SYSTICK_DisableIT + * @retval None + */ +__STATIC_INLINE void LL_SYSTICK_DisableIT(void) +{ + CLEAR_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk); +} + +/** + * @brief Checks if the SYSTICK interrupt is enabled or disabled. + * @rmtoll STK_CTRL TICKINT LL_SYSTICK_IsEnabledIT + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSTICK_IsEnabledIT(void) +{ + return (READ_BIT(SysTick->CTRL, SysTick_CTRL_TICKINT_Msk) == (SysTick_CTRL_TICKINT_Msk)); +} + +/** + * @} + */ + +/** @defgroup CORTEX_LL_EF_LOW_POWER_MODE LOW POWER MODE + * @{ + */ + +/** + * @brief Processor uses sleep as its low power mode + * @rmtoll SCB_SCR SLEEPDEEP LL_LPM_EnableSleep + * @retval None + */ +__STATIC_INLINE void LL_LPM_EnableSleep(void) +{ + /* Clear SLEEPDEEP bit of Cortex System Control Register */ + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk)); +} + +/** + * @brief Processor uses deep sleep as its low power mode + * @rmtoll SCB_SCR SLEEPDEEP LL_LPM_EnableDeepSleep + * @retval None + */ +__STATIC_INLINE void LL_LPM_EnableDeepSleep(void) +{ + /* Set SLEEPDEEP bit of Cortex System Control Register */ + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk)); +} + +/** + * @brief Configures sleep-on-exit when returning from Handler mode to Thread mode. + * @note Setting this bit to 1 enables an interrupt-driven application to avoid returning to an + * empty main application. + * @rmtoll SCB_SCR SLEEPONEXIT LL_LPM_EnableSleepOnExit + * @retval None + */ +__STATIC_INLINE void LL_LPM_EnableSleepOnExit(void) +{ + /* Set SLEEPONEXIT bit of Cortex System Control Register */ + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk)); +} + +/** + * @brief Do not sleep when returning to Thread mode. + * @rmtoll SCB_SCR SLEEPONEXIT LL_LPM_DisableSleepOnExit + * @retval None + */ +__STATIC_INLINE void LL_LPM_DisableSleepOnExit(void) +{ + /* Clear SLEEPONEXIT bit of Cortex System Control Register */ + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk)); +} + +/** + * @brief Enabled events and all interrupts, including disabled interrupts, can wakeup the + * processor. + * @rmtoll SCB_SCR SEVEONPEND LL_LPM_EnableEventOnPend + * @retval None + */ +__STATIC_INLINE void LL_LPM_EnableEventOnPend(void) +{ + /* Set SEVEONPEND bit of Cortex System Control Register */ + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk)); +} + +/** + * @brief Only enabled interrupts or events can wakeup the processor, disabled interrupts are + * excluded + * @rmtoll SCB_SCR SEVEONPEND LL_LPM_DisableEventOnPend + * @retval None + */ +__STATIC_INLINE void LL_LPM_DisableEventOnPend(void) +{ + /* Clear SEVEONPEND bit of Cortex System Control Register */ + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk)); +} + +/** + * @} + */ + +/** @defgroup CORTEX_LL_EF_HANDLER HANDLER + * @{ + */ + +/** + * @brief Enable a fault in System handler control register (SHCSR) + * @rmtoll SCB_SHCSR MEMFAULTENA LL_HANDLER_EnableFault + * @param Fault This parameter can be a combination of the following values: + * @arg @ref LL_HANDLER_FAULT_USG + * @arg @ref LL_HANDLER_FAULT_BUS + * @arg @ref LL_HANDLER_FAULT_MEM + * @retval None + */ +__STATIC_INLINE void LL_HANDLER_EnableFault(uint32_t Fault) +{ + /* Enable the system handler fault */ + SET_BIT(SCB->SHCSR, Fault); +} + +/** + * @brief Disable a fault in System handler control register (SHCSR) + * @rmtoll SCB_SHCSR MEMFAULTENA LL_HANDLER_DisableFault + * @param Fault This parameter can be a combination of the following values: + * @arg @ref LL_HANDLER_FAULT_USG + * @arg @ref LL_HANDLER_FAULT_BUS + * @arg @ref LL_HANDLER_FAULT_MEM + * @retval None + */ +__STATIC_INLINE void LL_HANDLER_DisableFault(uint32_t Fault) +{ + /* Disable the system handler fault */ + CLEAR_BIT(SCB->SHCSR, Fault); +} + +/** + * @} + */ + +/** @defgroup CORTEX_LL_EF_MCU_INFO MCU INFO + * @{ + */ + +/** + * @brief Get Implementer code + * @rmtoll SCB_CPUID IMPLEMENTER LL_CPUID_GetImplementer + * @retval Value should be equal to 0x41 for ARM + */ +__STATIC_INLINE uint32_t LL_CPUID_GetImplementer(void) +{ + return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_IMPLEMENTER_Msk) >> SCB_CPUID_IMPLEMENTER_Pos); +} + +/** + * @brief Get Variant number (The r value in the rnpn product revision identifier) + * @rmtoll SCB_CPUID VARIANT LL_CPUID_GetVariant + * @retval Value between 0 and 255 (0x0: revision 0) + */ +__STATIC_INLINE uint32_t LL_CPUID_GetVariant(void) +{ + return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_VARIANT_Msk) >> SCB_CPUID_VARIANT_Pos); +} + +/** + * @brief Get Constant number + * @rmtoll SCB_CPUID ARCHITECTURE LL_CPUID_GetConstant + * @retval Value should be equal to 0xF for Cortex-M4 devices + */ +__STATIC_INLINE uint32_t LL_CPUID_GetConstant(void) +{ + return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_ARCHITECTURE_Msk) >> SCB_CPUID_ARCHITECTURE_Pos); +} + +/** + * @brief Get Part number + * @rmtoll SCB_CPUID PARTNO LL_CPUID_GetParNo + * @retval Value should be equal to 0xC24 for Cortex-M4 + */ +__STATIC_INLINE uint32_t LL_CPUID_GetParNo(void) +{ + return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_PARTNO_Msk) >> SCB_CPUID_PARTNO_Pos); +} + +/** + * @brief Get Revision number (The p value in the rnpn product revision identifier, indicates patch release) + * @rmtoll SCB_CPUID REVISION LL_CPUID_GetRevision + * @retval Value between 0 and 255 (0x1: patch 1) + */ +__STATIC_INLINE uint32_t LL_CPUID_GetRevision(void) +{ + return (uint32_t)(READ_BIT(SCB->CPUID, SCB_CPUID_REVISION_Msk) >> SCB_CPUID_REVISION_Pos); +} + +/** + * @} + */ + +#if __MPU_PRESENT +/** @defgroup CORTEX_LL_EF_MPU MPU + * @{ + */ + +/** + * @brief Enable MPU with input options + * @rmtoll MPU_CTRL ENABLE LL_MPU_Enable + * @param Options This parameter can be one of the following values: + * @arg @ref LL_MPU_CTRL_HFNMI_PRIVDEF_NONE + * @arg @ref LL_MPU_CTRL_HARDFAULT_NMI + * @arg @ref LL_MPU_CTRL_PRIVILEGED_DEFAULT + * @arg @ref LL_MPU_CTRL_HFNMI_PRIVDEF + * @retval None + */ +__STATIC_INLINE void LL_MPU_Enable(uint32_t Options) +{ + /* Enable the MPU*/ + WRITE_REG(MPU->CTRL, (MPU_CTRL_ENABLE_Msk | Options)); + /* Ensure MPU settings take effects */ + __DSB(); + /* Sequence instruction fetches using update settings */ + __ISB(); +} + +/** + * @brief Disable MPU + * @rmtoll MPU_CTRL ENABLE LL_MPU_Disable + * @retval None + */ +__STATIC_INLINE void LL_MPU_Disable(void) +{ + /* Make sure outstanding transfers are done */ + __DMB(); + /* Disable MPU*/ + WRITE_REG(MPU->CTRL, 0U); +} + +/** + * @brief Check if MPU is enabled or not + * @rmtoll MPU_CTRL ENABLE LL_MPU_IsEnabled + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_MPU_IsEnabled(void) +{ + return (READ_BIT(MPU->CTRL, MPU_CTRL_ENABLE_Msk) == (MPU_CTRL_ENABLE_Msk)); +} + +/** + * @brief Enable a MPU region + * @rmtoll MPU_RASR ENABLE LL_MPU_EnableRegion + * @param Region This parameter can be one of the following values: + * @arg @ref LL_MPU_REGION_NUMBER0 + * @arg @ref LL_MPU_REGION_NUMBER1 + * @arg @ref LL_MPU_REGION_NUMBER2 + * @arg @ref LL_MPU_REGION_NUMBER3 + * @arg @ref LL_MPU_REGION_NUMBER4 + * @arg @ref LL_MPU_REGION_NUMBER5 + * @arg @ref LL_MPU_REGION_NUMBER6 + * @arg @ref LL_MPU_REGION_NUMBER7 + * @retval None + */ +__STATIC_INLINE void LL_MPU_EnableRegion(uint32_t Region) +{ + /* Set Region number */ + WRITE_REG(MPU->RNR, Region); + /* Enable the MPU region */ + SET_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk); +} + +/** + * @brief Configure and enable a region + * @rmtoll MPU_RNR REGION LL_MPU_ConfigRegion\n + * MPU_RBAR REGION LL_MPU_ConfigRegion\n + * MPU_RBAR ADDR LL_MPU_ConfigRegion\n + * MPU_RASR XN LL_MPU_ConfigRegion\n + * MPU_RASR AP LL_MPU_ConfigRegion\n + * MPU_RASR S LL_MPU_ConfigRegion\n + * MPU_RASR C LL_MPU_ConfigRegion\n + * MPU_RASR B LL_MPU_ConfigRegion\n + * MPU_RASR SIZE LL_MPU_ConfigRegion + * @param Region This parameter can be one of the following values: + * @arg @ref LL_MPU_REGION_NUMBER0 + * @arg @ref LL_MPU_REGION_NUMBER1 + * @arg @ref LL_MPU_REGION_NUMBER2 + * @arg @ref LL_MPU_REGION_NUMBER3 + * @arg @ref LL_MPU_REGION_NUMBER4 + * @arg @ref LL_MPU_REGION_NUMBER5 + * @arg @ref LL_MPU_REGION_NUMBER6 + * @arg @ref LL_MPU_REGION_NUMBER7 + * @param Address Value of region base address + * @param SubRegionDisable Sub-region disable value between Min_Data = 0x00 and Max_Data = 0xFF + * @param Attributes This parameter can be a combination of the following values: + * @arg @ref LL_MPU_REGION_SIZE_32B or @ref LL_MPU_REGION_SIZE_64B or @ref LL_MPU_REGION_SIZE_128B or @ref LL_MPU_REGION_SIZE_256B or @ref LL_MPU_REGION_SIZE_512B + * or @ref LL_MPU_REGION_SIZE_1KB or @ref LL_MPU_REGION_SIZE_2KB or @ref LL_MPU_REGION_SIZE_4KB or @ref LL_MPU_REGION_SIZE_8KB or @ref LL_MPU_REGION_SIZE_16KB + * or @ref LL_MPU_REGION_SIZE_32KB or @ref LL_MPU_REGION_SIZE_64KB or @ref LL_MPU_REGION_SIZE_128KB or @ref LL_MPU_REGION_SIZE_256KB or @ref LL_MPU_REGION_SIZE_512KB + * or @ref LL_MPU_REGION_SIZE_1MB or @ref LL_MPU_REGION_SIZE_2MB or @ref LL_MPU_REGION_SIZE_4MB or @ref LL_MPU_REGION_SIZE_8MB or @ref LL_MPU_REGION_SIZE_16MB + * or @ref LL_MPU_REGION_SIZE_32MB or @ref LL_MPU_REGION_SIZE_64MB or @ref LL_MPU_REGION_SIZE_128MB or @ref LL_MPU_REGION_SIZE_256MB or @ref LL_MPU_REGION_SIZE_512MB + * or @ref LL_MPU_REGION_SIZE_1GB or @ref LL_MPU_REGION_SIZE_2GB or @ref LL_MPU_REGION_SIZE_4GB + * @arg @ref LL_MPU_REGION_NO_ACCESS or @ref LL_MPU_REGION_PRIV_RW or @ref LL_MPU_REGION_PRIV_RW_URO or @ref LL_MPU_REGION_FULL_ACCESS + * or @ref LL_MPU_REGION_PRIV_RO or @ref LL_MPU_REGION_PRIV_RO_URO + * @arg @ref LL_MPU_TEX_LEVEL0 or @ref LL_MPU_TEX_LEVEL1 or @ref LL_MPU_TEX_LEVEL2 or @ref LL_MPU_TEX_LEVEL4 + * @arg @ref LL_MPU_INSTRUCTION_ACCESS_ENABLE or @ref LL_MPU_INSTRUCTION_ACCESS_DISABLE + * @arg @ref LL_MPU_ACCESS_SHAREABLE or @ref LL_MPU_ACCESS_NOT_SHAREABLE + * @arg @ref LL_MPU_ACCESS_CACHEABLE or @ref LL_MPU_ACCESS_NOT_CACHEABLE + * @arg @ref LL_MPU_ACCESS_BUFFERABLE or @ref LL_MPU_ACCESS_NOT_BUFFERABLE + * @retval None + */ +__STATIC_INLINE void LL_MPU_ConfigRegion(uint32_t Region, uint32_t SubRegionDisable, uint32_t Address, uint32_t Attributes) +{ + /* Set Region number */ + WRITE_REG(MPU->RNR, Region); + /* Set base address */ + WRITE_REG(MPU->RBAR, (Address & 0xFFFFFFE0U)); + /* Configure MPU */ + WRITE_REG(MPU->RASR, (MPU_RASR_ENABLE_Msk | Attributes | SubRegionDisable << MPU_RASR_SRD_Pos)); +} + +/** + * @brief Disable a region + * @rmtoll MPU_RNR REGION LL_MPU_DisableRegion\n + * MPU_RASR ENABLE LL_MPU_DisableRegion + * @param Region This parameter can be one of the following values: + * @arg @ref LL_MPU_REGION_NUMBER0 + * @arg @ref LL_MPU_REGION_NUMBER1 + * @arg @ref LL_MPU_REGION_NUMBER2 + * @arg @ref LL_MPU_REGION_NUMBER3 + * @arg @ref LL_MPU_REGION_NUMBER4 + * @arg @ref LL_MPU_REGION_NUMBER5 + * @arg @ref LL_MPU_REGION_NUMBER6 + * @arg @ref LL_MPU_REGION_NUMBER7 + * @retval None + */ +__STATIC_INLINE void LL_MPU_DisableRegion(uint32_t Region) +{ + /* Set Region number */ + WRITE_REG(MPU->RNR, Region); + /* Disable the MPU region */ + CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk); +} + +/** + * @} + */ + +#endif /* __MPU_PRESENT */ +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_CORTEX_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_dma.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_dma.h new file mode 100644 index 0000000..b770c2b --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_dma.h @@ -0,0 +1,1994 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_dma.h + * @author MCD Application Team + * @brief Header file of DMA LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_DMA_H +#define __STM32F3xx_LL_DMA_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined (DMA1) || defined (DMA2) + +/** @defgroup DMA_LL DMA + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/** @defgroup DMA_LL_Private_Variables DMA Private Variables + * @{ + */ +/* Array used to get the DMA channel register offset versus channel index LL_DMA_CHANNEL_x */ +static const uint8_t CHANNEL_OFFSET_TAB[] = +{ + (uint8_t)(DMA1_Channel1_BASE - DMA1_BASE), + (uint8_t)(DMA1_Channel2_BASE - DMA1_BASE), + (uint8_t)(DMA1_Channel3_BASE - DMA1_BASE), + (uint8_t)(DMA1_Channel4_BASE - DMA1_BASE), + (uint8_t)(DMA1_Channel5_BASE - DMA1_BASE), + (uint8_t)(DMA1_Channel6_BASE - DMA1_BASE), + (uint8_t)(DMA1_Channel7_BASE - DMA1_BASE) +}; +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup DMA_LL_Private_Macros DMA Private Macros + * @{ + */ +/** + * @} + */ +#endif /*USE_FULL_LL_DRIVER*/ + +/* Exported types ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup DMA_LL_ES_INIT DMA Exported Init structure + * @{ + */ +typedef struct +{ + uint32_t PeriphOrM2MSrcAddress; /*!< Specifies the peripheral base address for DMA transfer + or as Source base address in case of memory to memory transfer direction. + + This parameter must be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF. */ + + uint32_t MemoryOrM2MDstAddress; /*!< Specifies the memory base address for DMA transfer + or as Destination base address in case of memory to memory transfer direction. + + This parameter must be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF. */ + + uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral, + from memory to memory or from peripheral to memory. + This parameter can be a value of @ref DMA_LL_EC_DIRECTION + + This feature can be modified afterwards using unitary function @ref LL_DMA_SetDataTransferDirection(). */ + + uint32_t Mode; /*!< Specifies the normal or circular operation mode. + This parameter can be a value of @ref DMA_LL_EC_MODE + @note: The circular buffer mode cannot be used if the memory to memory + data transfer direction is configured on the selected Channel + + This feature can be modified afterwards using unitary function @ref LL_DMA_SetMode(). */ + + uint32_t PeriphOrM2MSrcIncMode; /*!< Specifies whether the Peripheral address or Source address in case of memory to memory transfer direction + is incremented or not. + This parameter can be a value of @ref DMA_LL_EC_PERIPH + + This feature can be modified afterwards using unitary function @ref LL_DMA_SetPeriphIncMode(). */ + + uint32_t MemoryOrM2MDstIncMode; /*!< Specifies whether the Memory address or Destination address in case of memory to memory transfer direction + is incremented or not. + This parameter can be a value of @ref DMA_LL_EC_MEMORY + + This feature can be modified afterwards using unitary function @ref LL_DMA_SetMemoryIncMode(). */ + + uint32_t PeriphOrM2MSrcDataSize; /*!< Specifies the Peripheral data size alignment or Source data size alignment (byte, half word, word) + in case of memory to memory transfer direction. + This parameter can be a value of @ref DMA_LL_EC_PDATAALIGN + + This feature can be modified afterwards using unitary function @ref LL_DMA_SetPeriphSize(). */ + + uint32_t MemoryOrM2MDstDataSize; /*!< Specifies the Memory data size alignment or Destination data size alignment (byte, half word, word) + in case of memory to memory transfer direction. + This parameter can be a value of @ref DMA_LL_EC_MDATAALIGN + + This feature can be modified afterwards using unitary function @ref LL_DMA_SetMemorySize(). */ + + uint32_t NbData; /*!< Specifies the number of data to transfer, in data unit. + The data unit is equal to the source buffer configuration set in PeripheralSize + or MemorySize parameters depending in the transfer direction. + This parameter must be a value between Min_Data = 0 and Max_Data = 0x0000FFFF + + This feature can be modified afterwards using unitary function @ref LL_DMA_SetDataLength(). */ + + uint32_t Priority; /*!< Specifies the channel priority level. + This parameter can be a value of @ref DMA_LL_EC_PRIORITY + + This feature can be modified afterwards using unitary function @ref LL_DMA_SetChannelPriorityLevel(). */ + +} LL_DMA_InitTypeDef; +/** + * @} + */ +#endif /*USE_FULL_LL_DRIVER*/ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup DMA_LL_Exported_Constants DMA Exported Constants + * @{ + */ +/** @defgroup DMA_LL_EC_CLEAR_FLAG Clear Flags Defines + * @brief Flags defines which can be used with LL_DMA_WriteReg function + * @{ + */ +#define LL_DMA_IFCR_CGIF1 DMA_IFCR_CGIF1 /*!< Channel 1 global flag */ +#define LL_DMA_IFCR_CTCIF1 DMA_IFCR_CTCIF1 /*!< Channel 1 transfer complete flag */ +#define LL_DMA_IFCR_CHTIF1 DMA_IFCR_CHTIF1 /*!< Channel 1 half transfer flag */ +#define LL_DMA_IFCR_CTEIF1 DMA_IFCR_CTEIF1 /*!< Channel 1 transfer error flag */ +#define LL_DMA_IFCR_CGIF2 DMA_IFCR_CGIF2 /*!< Channel 2 global flag */ +#define LL_DMA_IFCR_CTCIF2 DMA_IFCR_CTCIF2 /*!< Channel 2 transfer complete flag */ +#define LL_DMA_IFCR_CHTIF2 DMA_IFCR_CHTIF2 /*!< Channel 2 half transfer flag */ +#define LL_DMA_IFCR_CTEIF2 DMA_IFCR_CTEIF2 /*!< Channel 2 transfer error flag */ +#define LL_DMA_IFCR_CGIF3 DMA_IFCR_CGIF3 /*!< Channel 3 global flag */ +#define LL_DMA_IFCR_CTCIF3 DMA_IFCR_CTCIF3 /*!< Channel 3 transfer complete flag */ +#define LL_DMA_IFCR_CHTIF3 DMA_IFCR_CHTIF3 /*!< Channel 3 half transfer flag */ +#define LL_DMA_IFCR_CTEIF3 DMA_IFCR_CTEIF3 /*!< Channel 3 transfer error flag */ +#define LL_DMA_IFCR_CGIF4 DMA_IFCR_CGIF4 /*!< Channel 4 global flag */ +#define LL_DMA_IFCR_CTCIF4 DMA_IFCR_CTCIF4 /*!< Channel 4 transfer complete flag */ +#define LL_DMA_IFCR_CHTIF4 DMA_IFCR_CHTIF4 /*!< Channel 4 half transfer flag */ +#define LL_DMA_IFCR_CTEIF4 DMA_IFCR_CTEIF4 /*!< Channel 4 transfer error flag */ +#define LL_DMA_IFCR_CGIF5 DMA_IFCR_CGIF5 /*!< Channel 5 global flag */ +#define LL_DMA_IFCR_CTCIF5 DMA_IFCR_CTCIF5 /*!< Channel 5 transfer complete flag */ +#define LL_DMA_IFCR_CHTIF5 DMA_IFCR_CHTIF5 /*!< Channel 5 half transfer flag */ +#define LL_DMA_IFCR_CTEIF5 DMA_IFCR_CTEIF5 /*!< Channel 5 transfer error flag */ +#define LL_DMA_IFCR_CGIF6 DMA_IFCR_CGIF6 /*!< Channel 6 global flag */ +#define LL_DMA_IFCR_CTCIF6 DMA_IFCR_CTCIF6 /*!< Channel 6 transfer complete flag */ +#define LL_DMA_IFCR_CHTIF6 DMA_IFCR_CHTIF6 /*!< Channel 6 half transfer flag */ +#define LL_DMA_IFCR_CTEIF6 DMA_IFCR_CTEIF6 /*!< Channel 6 transfer error flag */ +#define LL_DMA_IFCR_CGIF7 DMA_IFCR_CGIF7 /*!< Channel 7 global flag */ +#define LL_DMA_IFCR_CTCIF7 DMA_IFCR_CTCIF7 /*!< Channel 7 transfer complete flag */ +#define LL_DMA_IFCR_CHTIF7 DMA_IFCR_CHTIF7 /*!< Channel 7 half transfer flag */ +#define LL_DMA_IFCR_CTEIF7 DMA_IFCR_CTEIF7 /*!< Channel 7 transfer error flag */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_GET_FLAG Get Flags Defines + * @brief Flags defines which can be used with LL_DMA_ReadReg function + * @{ + */ +#define LL_DMA_ISR_GIF1 DMA_ISR_GIF1 /*!< Channel 1 global flag */ +#define LL_DMA_ISR_TCIF1 DMA_ISR_TCIF1 /*!< Channel 1 transfer complete flag */ +#define LL_DMA_ISR_HTIF1 DMA_ISR_HTIF1 /*!< Channel 1 half transfer flag */ +#define LL_DMA_ISR_TEIF1 DMA_ISR_TEIF1 /*!< Channel 1 transfer error flag */ +#define LL_DMA_ISR_GIF2 DMA_ISR_GIF2 /*!< Channel 2 global flag */ +#define LL_DMA_ISR_TCIF2 DMA_ISR_TCIF2 /*!< Channel 2 transfer complete flag */ +#define LL_DMA_ISR_HTIF2 DMA_ISR_HTIF2 /*!< Channel 2 half transfer flag */ +#define LL_DMA_ISR_TEIF2 DMA_ISR_TEIF2 /*!< Channel 2 transfer error flag */ +#define LL_DMA_ISR_GIF3 DMA_ISR_GIF3 /*!< Channel 3 global flag */ +#define LL_DMA_ISR_TCIF3 DMA_ISR_TCIF3 /*!< Channel 3 transfer complete flag */ +#define LL_DMA_ISR_HTIF3 DMA_ISR_HTIF3 /*!< Channel 3 half transfer flag */ +#define LL_DMA_ISR_TEIF3 DMA_ISR_TEIF3 /*!< Channel 3 transfer error flag */ +#define LL_DMA_ISR_GIF4 DMA_ISR_GIF4 /*!< Channel 4 global flag */ +#define LL_DMA_ISR_TCIF4 DMA_ISR_TCIF4 /*!< Channel 4 transfer complete flag */ +#define LL_DMA_ISR_HTIF4 DMA_ISR_HTIF4 /*!< Channel 4 half transfer flag */ +#define LL_DMA_ISR_TEIF4 DMA_ISR_TEIF4 /*!< Channel 4 transfer error flag */ +#define LL_DMA_ISR_GIF5 DMA_ISR_GIF5 /*!< Channel 5 global flag */ +#define LL_DMA_ISR_TCIF5 DMA_ISR_TCIF5 /*!< Channel 5 transfer complete flag */ +#define LL_DMA_ISR_HTIF5 DMA_ISR_HTIF5 /*!< Channel 5 half transfer flag */ +#define LL_DMA_ISR_TEIF5 DMA_ISR_TEIF5 /*!< Channel 5 transfer error flag */ +#define LL_DMA_ISR_GIF6 DMA_ISR_GIF6 /*!< Channel 6 global flag */ +#define LL_DMA_ISR_TCIF6 DMA_ISR_TCIF6 /*!< Channel 6 transfer complete flag */ +#define LL_DMA_ISR_HTIF6 DMA_ISR_HTIF6 /*!< Channel 6 half transfer flag */ +#define LL_DMA_ISR_TEIF6 DMA_ISR_TEIF6 /*!< Channel 6 transfer error flag */ +#define LL_DMA_ISR_GIF7 DMA_ISR_GIF7 /*!< Channel 7 global flag */ +#define LL_DMA_ISR_TCIF7 DMA_ISR_TCIF7 /*!< Channel 7 transfer complete flag */ +#define LL_DMA_ISR_HTIF7 DMA_ISR_HTIF7 /*!< Channel 7 half transfer flag */ +#define LL_DMA_ISR_TEIF7 DMA_ISR_TEIF7 /*!< Channel 7 transfer error flag */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_IT IT Defines + * @brief IT defines which can be used with LL_DMA_ReadReg and LL_DMA_WriteReg functions + * @{ + */ +#define LL_DMA_CCR_TCIE DMA_CCR_TCIE /*!< Transfer complete interrupt */ +#define LL_DMA_CCR_HTIE DMA_CCR_HTIE /*!< Half Transfer interrupt */ +#define LL_DMA_CCR_TEIE DMA_CCR_TEIE /*!< Transfer error interrupt */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_CHANNEL CHANNEL + * @{ + */ +#define LL_DMA_CHANNEL_1 0x00000001U /*!< DMA Channel 1 */ +#define LL_DMA_CHANNEL_2 0x00000002U /*!< DMA Channel 2 */ +#define LL_DMA_CHANNEL_3 0x00000003U /*!< DMA Channel 3 */ +#define LL_DMA_CHANNEL_4 0x00000004U /*!< DMA Channel 4 */ +#define LL_DMA_CHANNEL_5 0x00000005U /*!< DMA Channel 5 */ +#define LL_DMA_CHANNEL_6 0x00000006U /*!< DMA Channel 6 */ +#define LL_DMA_CHANNEL_7 0x00000007U /*!< DMA Channel 7 */ +#if defined(USE_FULL_LL_DRIVER) +#define LL_DMA_CHANNEL_ALL 0xFFFF0000U /*!< DMA Channel all (used only for function @ref LL_DMA_DeInit(). */ +#endif /*USE_FULL_LL_DRIVER*/ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_DIRECTION Transfer Direction + * @{ + */ +#define LL_DMA_DIRECTION_PERIPH_TO_MEMORY 0x00000000U /*!< Peripheral to memory direction */ +#define LL_DMA_DIRECTION_MEMORY_TO_PERIPH DMA_CCR_DIR /*!< Memory to peripheral direction */ +#define LL_DMA_DIRECTION_MEMORY_TO_MEMORY DMA_CCR_MEM2MEM /*!< Memory to memory direction */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_MODE Transfer mode + * @{ + */ +#define LL_DMA_MODE_NORMAL 0x00000000U /*!< Normal Mode */ +#define LL_DMA_MODE_CIRCULAR DMA_CCR_CIRC /*!< Circular Mode */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_PERIPH Peripheral increment mode + * @{ + */ +#define LL_DMA_PERIPH_INCREMENT DMA_CCR_PINC /*!< Peripheral increment mode Enable */ +#define LL_DMA_PERIPH_NOINCREMENT 0x00000000U /*!< Peripheral increment mode Disable */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_MEMORY Memory increment mode + * @{ + */ +#define LL_DMA_MEMORY_INCREMENT DMA_CCR_MINC /*!< Memory increment mode Enable */ +#define LL_DMA_MEMORY_NOINCREMENT 0x00000000U /*!< Memory increment mode Disable */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_PDATAALIGN Peripheral data alignment + * @{ + */ +#define LL_DMA_PDATAALIGN_BYTE 0x00000000U /*!< Peripheral data alignment : Byte */ +#define LL_DMA_PDATAALIGN_HALFWORD DMA_CCR_PSIZE_0 /*!< Peripheral data alignment : HalfWord */ +#define LL_DMA_PDATAALIGN_WORD DMA_CCR_PSIZE_1 /*!< Peripheral data alignment : Word */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_MDATAALIGN Memory data alignment + * @{ + */ +#define LL_DMA_MDATAALIGN_BYTE 0x00000000U /*!< Memory data alignment : Byte */ +#define LL_DMA_MDATAALIGN_HALFWORD DMA_CCR_MSIZE_0 /*!< Memory data alignment : HalfWord */ +#define LL_DMA_MDATAALIGN_WORD DMA_CCR_MSIZE_1 /*!< Memory data alignment : Word */ +/** + * @} + */ + +/** @defgroup DMA_LL_EC_PRIORITY Transfer Priority level + * @{ + */ +#define LL_DMA_PRIORITY_LOW 0x00000000U /*!< Priority level : Low */ +#define LL_DMA_PRIORITY_MEDIUM DMA_CCR_PL_0 /*!< Priority level : Medium */ +#define LL_DMA_PRIORITY_HIGH DMA_CCR_PL_1 /*!< Priority level : High */ +#define LL_DMA_PRIORITY_VERYHIGH DMA_CCR_PL /*!< Priority level : Very_High */ +/** + * @} + */ + + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup DMA_LL_Exported_Macros DMA Exported Macros + * @{ + */ + +/** @defgroup DMA_LL_EM_WRITE_READ Common Write and read registers macros + * @{ + */ +/** + * @brief Write a value in DMA register + * @param __INSTANCE__ DMA Instance + * @param __REG__ Register to be written + * @param __VALUE__ Value to be written in the register + * @retval None + */ +#define LL_DMA_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) + +/** + * @brief Read a value in DMA register + * @param __INSTANCE__ DMA Instance + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_DMA_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) +/** + * @} + */ + +/** @defgroup DMA_LL_EM_CONVERT_DMAxCHANNELy Convert DMAxChannely + * @{ + */ +/** + * @brief Convert DMAx_Channely into DMAx + * @param __CHANNEL_INSTANCE__ DMAx_Channely + * @retval DMAx + */ +#if defined(DMA2) +#define __LL_DMA_GET_INSTANCE(__CHANNEL_INSTANCE__) \ +(((uint32_t)(__CHANNEL_INSTANCE__) > ((uint32_t)DMA1_Channel7)) ? DMA2 : DMA1) +#else +#define __LL_DMA_GET_INSTANCE(__CHANNEL_INSTANCE__) (DMA1) +#endif + +/** + * @brief Convert DMAx_Channely into LL_DMA_CHANNEL_y + * @param __CHANNEL_INSTANCE__ DMAx_Channely + * @retval LL_DMA_CHANNEL_y + */ +#if defined (DMA2) +#if defined (DMA2_Channel6) && defined (DMA2_Channel7) +#define __LL_DMA_GET_CHANNEL(__CHANNEL_INSTANCE__) \ +(((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel1)) ? LL_DMA_CHANNEL_1 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel1)) ? LL_DMA_CHANNEL_1 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel2)) ? LL_DMA_CHANNEL_2 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel2)) ? LL_DMA_CHANNEL_2 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel3)) ? LL_DMA_CHANNEL_3 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel3)) ? LL_DMA_CHANNEL_3 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel4)) ? LL_DMA_CHANNEL_4 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel4)) ? LL_DMA_CHANNEL_4 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel5)) ? LL_DMA_CHANNEL_5 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel5)) ? LL_DMA_CHANNEL_5 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel6)) ? LL_DMA_CHANNEL_6 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel6)) ? LL_DMA_CHANNEL_6 : \ + LL_DMA_CHANNEL_7) +#else +#define __LL_DMA_GET_CHANNEL(__CHANNEL_INSTANCE__) \ +(((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel1)) ? LL_DMA_CHANNEL_1 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel1)) ? LL_DMA_CHANNEL_1 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel2)) ? LL_DMA_CHANNEL_2 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel2)) ? LL_DMA_CHANNEL_2 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel3)) ? LL_DMA_CHANNEL_3 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel3)) ? LL_DMA_CHANNEL_3 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel4)) ? LL_DMA_CHANNEL_4 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel4)) ? LL_DMA_CHANNEL_4 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel5)) ? LL_DMA_CHANNEL_5 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA2_Channel5)) ? LL_DMA_CHANNEL_5 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel6)) ? LL_DMA_CHANNEL_6 : \ + LL_DMA_CHANNEL_7) +#endif +#else +#define __LL_DMA_GET_CHANNEL(__CHANNEL_INSTANCE__) \ +(((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel1)) ? LL_DMA_CHANNEL_1 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel2)) ? LL_DMA_CHANNEL_2 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel3)) ? LL_DMA_CHANNEL_3 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel4)) ? LL_DMA_CHANNEL_4 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel5)) ? LL_DMA_CHANNEL_5 : \ + ((uint32_t)(__CHANNEL_INSTANCE__) == ((uint32_t)DMA1_Channel6)) ? LL_DMA_CHANNEL_6 : \ + LL_DMA_CHANNEL_7) +#endif + +/** + * @brief Convert DMA Instance DMAx and LL_DMA_CHANNEL_y into DMAx_Channely + * @param __DMA_INSTANCE__ DMAx + * @param __CHANNEL__ LL_DMA_CHANNEL_y + * @retval DMAx_Channely + */ +#if defined (DMA2) +#if defined (DMA2_Channel6) && defined (DMA2_Channel7) +#define __LL_DMA_GET_CHANNEL_INSTANCE(__DMA_INSTANCE__, __CHANNEL__) \ +((((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_1))) ? DMA1_Channel1 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_1))) ? DMA2_Channel1 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_2))) ? DMA1_Channel2 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_2))) ? DMA2_Channel2 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_3))) ? DMA1_Channel3 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_3))) ? DMA2_Channel3 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_4))) ? DMA1_Channel4 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_4))) ? DMA2_Channel4 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_5))) ? DMA1_Channel5 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_5))) ? DMA2_Channel5 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_6))) ? DMA1_Channel6 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_6))) ? DMA2_Channel6 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_7))) ? DMA1_Channel7 : \ + DMA2_Channel7) +#else +#define __LL_DMA_GET_CHANNEL_INSTANCE(__DMA_INSTANCE__, __CHANNEL__) \ +((((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_1))) ? DMA1_Channel1 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_1))) ? DMA2_Channel1 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_2))) ? DMA1_Channel2 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_2))) ? DMA2_Channel2 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_3))) ? DMA1_Channel3 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_3))) ? DMA2_Channel3 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_4))) ? DMA1_Channel4 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_4))) ? DMA2_Channel4 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_5))) ? DMA1_Channel5 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_5))) ? DMA2_Channel5 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_6))) ? DMA1_Channel6 : \ + DMA1_Channel7) +#endif +#else +#define __LL_DMA_GET_CHANNEL_INSTANCE(__DMA_INSTANCE__, __CHANNEL__) \ +((((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_1))) ? DMA1_Channel1 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_2))) ? DMA1_Channel2 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_3))) ? DMA1_Channel3 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_4))) ? DMA1_Channel4 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_5))) ? DMA1_Channel5 : \ + (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__CHANNEL__) == ((uint32_t)LL_DMA_CHANNEL_6))) ? DMA1_Channel6 : \ + DMA1_Channel7) +#endif + +/** + * @} + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup DMA_LL_Exported_Functions DMA Exported Functions + * @{ + */ + +/** @defgroup DMA_LL_EF_Configuration Configuration + * @{ + */ +/** + * @brief Enable DMA channel. + * @rmtoll CCR EN LL_DMA_EnableChannel + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval None + */ +__STATIC_INLINE void LL_DMA_EnableChannel(DMA_TypeDef *DMAx, uint32_t Channel) +{ + SET_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_EN); +} + +/** + * @brief Disable DMA channel. + * @rmtoll CCR EN LL_DMA_DisableChannel + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval None + */ +__STATIC_INLINE void LL_DMA_DisableChannel(DMA_TypeDef *DMAx, uint32_t Channel) +{ + CLEAR_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_EN); +} + +/** + * @brief Check if DMA channel is enabled or disabled. + * @rmtoll CCR EN LL_DMA_IsEnabledChannel + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsEnabledChannel(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_EN) == (DMA_CCR_EN)); +} + +/** + * @brief Configure all parameters link to DMA transfer. + * @rmtoll CCR DIR LL_DMA_ConfigTransfer\n + * CCR MEM2MEM LL_DMA_ConfigTransfer\n + * CCR CIRC LL_DMA_ConfigTransfer\n + * CCR PINC LL_DMA_ConfigTransfer\n + * CCR MINC LL_DMA_ConfigTransfer\n + * CCR PSIZE LL_DMA_ConfigTransfer\n + * CCR MSIZE LL_DMA_ConfigTransfer\n + * CCR PL LL_DMA_ConfigTransfer + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param Configuration This parameter must be a combination of all the following values: + * @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY or @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH or @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY + * @arg @ref LL_DMA_MODE_NORMAL or @ref LL_DMA_MODE_CIRCULAR + * @arg @ref LL_DMA_PERIPH_INCREMENT or @ref LL_DMA_PERIPH_NOINCREMENT + * @arg @ref LL_DMA_MEMORY_INCREMENT or @ref LL_DMA_MEMORY_NOINCREMENT + * @arg @ref LL_DMA_PDATAALIGN_BYTE or @ref LL_DMA_PDATAALIGN_HALFWORD or @ref LL_DMA_PDATAALIGN_WORD + * @arg @ref LL_DMA_MDATAALIGN_BYTE or @ref LL_DMA_MDATAALIGN_HALFWORD or @ref LL_DMA_MDATAALIGN_WORD + * @arg @ref LL_DMA_PRIORITY_LOW or @ref LL_DMA_PRIORITY_MEDIUM or @ref LL_DMA_PRIORITY_HIGH or @ref LL_DMA_PRIORITY_VERYHIGH + * @retval None + */ +__STATIC_INLINE void LL_DMA_ConfigTransfer(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t Configuration) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_DIR | DMA_CCR_MEM2MEM | DMA_CCR_CIRC | DMA_CCR_PINC | DMA_CCR_MINC | DMA_CCR_PSIZE | DMA_CCR_MSIZE | DMA_CCR_PL, + Configuration); +} + +/** + * @brief Set Data transfer direction (read from peripheral or from memory). + * @rmtoll CCR DIR LL_DMA_SetDataTransferDirection\n + * CCR MEM2MEM LL_DMA_SetDataTransferDirection + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param Direction This parameter can be one of the following values: + * @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY + * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH + * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetDataTransferDirection(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t Direction) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_DIR | DMA_CCR_MEM2MEM, Direction); +} + +/** + * @brief Get Data transfer direction (read from peripheral or from memory). + * @rmtoll CCR DIR LL_DMA_GetDataTransferDirection\n + * CCR MEM2MEM LL_DMA_GetDataTransferDirection + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Returned value can be one of the following values: + * @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY + * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH + * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY + */ +__STATIC_INLINE uint32_t LL_DMA_GetDataTransferDirection(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_DIR | DMA_CCR_MEM2MEM)); +} + +/** + * @brief Set DMA mode circular or normal. + * @note The circular buffer mode cannot be used if the memory-to-memory + * data transfer is configured on the selected Channel. + * @rmtoll CCR CIRC LL_DMA_SetMode + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param Mode This parameter can be one of the following values: + * @arg @ref LL_DMA_MODE_NORMAL + * @arg @ref LL_DMA_MODE_CIRCULAR + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetMode(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t Mode) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_CIRC, + Mode); +} + +/** + * @brief Get DMA mode circular or normal. + * @rmtoll CCR CIRC LL_DMA_GetMode + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Returned value can be one of the following values: + * @arg @ref LL_DMA_MODE_NORMAL + * @arg @ref LL_DMA_MODE_CIRCULAR + */ +__STATIC_INLINE uint32_t LL_DMA_GetMode(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_CIRC)); +} + +/** + * @brief Set Peripheral increment mode. + * @rmtoll CCR PINC LL_DMA_SetPeriphIncMode + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param PeriphOrM2MSrcIncMode This parameter can be one of the following values: + * @arg @ref LL_DMA_PERIPH_INCREMENT + * @arg @ref LL_DMA_PERIPH_NOINCREMENT + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetPeriphIncMode(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t PeriphOrM2MSrcIncMode) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_PINC, + PeriphOrM2MSrcIncMode); +} + +/** + * @brief Get Peripheral increment mode. + * @rmtoll CCR PINC LL_DMA_GetPeriphIncMode + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Returned value can be one of the following values: + * @arg @ref LL_DMA_PERIPH_INCREMENT + * @arg @ref LL_DMA_PERIPH_NOINCREMENT + */ +__STATIC_INLINE uint32_t LL_DMA_GetPeriphIncMode(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_PINC)); +} + +/** + * @brief Set Memory increment mode. + * @rmtoll CCR MINC LL_DMA_SetMemoryIncMode + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param MemoryOrM2MDstIncMode This parameter can be one of the following values: + * @arg @ref LL_DMA_MEMORY_INCREMENT + * @arg @ref LL_DMA_MEMORY_NOINCREMENT + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetMemoryIncMode(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryOrM2MDstIncMode) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_MINC, + MemoryOrM2MDstIncMode); +} + +/** + * @brief Get Memory increment mode. + * @rmtoll CCR MINC LL_DMA_GetMemoryIncMode + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Returned value can be one of the following values: + * @arg @ref LL_DMA_MEMORY_INCREMENT + * @arg @ref LL_DMA_MEMORY_NOINCREMENT + */ +__STATIC_INLINE uint32_t LL_DMA_GetMemoryIncMode(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_MINC)); +} + +/** + * @brief Set Peripheral size. + * @rmtoll CCR PSIZE LL_DMA_SetPeriphSize + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param PeriphOrM2MSrcDataSize This parameter can be one of the following values: + * @arg @ref LL_DMA_PDATAALIGN_BYTE + * @arg @ref LL_DMA_PDATAALIGN_HALFWORD + * @arg @ref LL_DMA_PDATAALIGN_WORD + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetPeriphSize(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t PeriphOrM2MSrcDataSize) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_PSIZE, + PeriphOrM2MSrcDataSize); +} + +/** + * @brief Get Peripheral size. + * @rmtoll CCR PSIZE LL_DMA_GetPeriphSize + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Returned value can be one of the following values: + * @arg @ref LL_DMA_PDATAALIGN_BYTE + * @arg @ref LL_DMA_PDATAALIGN_HALFWORD + * @arg @ref LL_DMA_PDATAALIGN_WORD + */ +__STATIC_INLINE uint32_t LL_DMA_GetPeriphSize(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_PSIZE)); +} + +/** + * @brief Set Memory size. + * @rmtoll CCR MSIZE LL_DMA_SetMemorySize + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param MemoryOrM2MDstDataSize This parameter can be one of the following values: + * @arg @ref LL_DMA_MDATAALIGN_BYTE + * @arg @ref LL_DMA_MDATAALIGN_HALFWORD + * @arg @ref LL_DMA_MDATAALIGN_WORD + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetMemorySize(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryOrM2MDstDataSize) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_MSIZE, + MemoryOrM2MDstDataSize); +} + +/** + * @brief Get Memory size. + * @rmtoll CCR MSIZE LL_DMA_GetMemorySize + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Returned value can be one of the following values: + * @arg @ref LL_DMA_MDATAALIGN_BYTE + * @arg @ref LL_DMA_MDATAALIGN_HALFWORD + * @arg @ref LL_DMA_MDATAALIGN_WORD + */ +__STATIC_INLINE uint32_t LL_DMA_GetMemorySize(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_MSIZE)); +} + +/** + * @brief Set Channel priority level. + * @rmtoll CCR PL LL_DMA_SetChannelPriorityLevel + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param Priority This parameter can be one of the following values: + * @arg @ref LL_DMA_PRIORITY_LOW + * @arg @ref LL_DMA_PRIORITY_MEDIUM + * @arg @ref LL_DMA_PRIORITY_HIGH + * @arg @ref LL_DMA_PRIORITY_VERYHIGH + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetChannelPriorityLevel(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t Priority) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_PL, + Priority); +} + +/** + * @brief Get Channel priority level. + * @rmtoll CCR PL LL_DMA_GetChannelPriorityLevel + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Returned value can be one of the following values: + * @arg @ref LL_DMA_PRIORITY_LOW + * @arg @ref LL_DMA_PRIORITY_MEDIUM + * @arg @ref LL_DMA_PRIORITY_HIGH + * @arg @ref LL_DMA_PRIORITY_VERYHIGH + */ +__STATIC_INLINE uint32_t LL_DMA_GetChannelPriorityLevel(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_PL)); +} + +/** + * @brief Set Number of data to transfer. + * @note This action has no effect if + * channel is enabled. + * @rmtoll CNDTR NDT LL_DMA_SetDataLength + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param NbData Between Min_Data = 0 and Max_Data = 0x0000FFFF + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetDataLength(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t NbData) +{ + MODIFY_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CNDTR, + DMA_CNDTR_NDT, NbData); +} + +/** + * @brief Get Number of data to transfer. + * @note Once the channel is enabled, the return value indicate the + * remaining bytes to be transmitted. + * @rmtoll CNDTR NDT LL_DMA_GetDataLength + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_DMA_GetDataLength(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CNDTR, + DMA_CNDTR_NDT)); +} + +/** + * @brief Configure the Source and Destination addresses. + * @note This API must not be called when the DMA channel is enabled. + * @note Each IP using DMA provides an API to get directly the register address (LL_PPP_DMA_GetRegAddr). + * @rmtoll CPAR PA LL_DMA_ConfigAddresses\n + * CMAR MA LL_DMA_ConfigAddresses + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param SrcAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + * @param DstAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + * @param Direction This parameter can be one of the following values: + * @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY + * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH + * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY + * @retval None + */ +__STATIC_INLINE void LL_DMA_ConfigAddresses(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t SrcAddress, + uint32_t DstAddress, uint32_t Direction) +{ + /* Direction Memory to Periph */ + if (Direction == LL_DMA_DIRECTION_MEMORY_TO_PERIPH) + { + WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR, SrcAddress); + WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR, DstAddress); + } + /* Direction Periph to Memory and Memory to Memory */ + else + { + WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR, SrcAddress); + WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR, DstAddress); + } +} + +/** + * @brief Set the Memory address. + * @note Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only. + * @note This API must not be called when the DMA channel is enabled. + * @rmtoll CMAR MA LL_DMA_SetMemoryAddress + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param MemoryAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetMemoryAddress(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryAddress) +{ + WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR, MemoryAddress); +} + +/** + * @brief Set the Peripheral address. + * @note Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only. + * @note This API must not be called when the DMA channel is enabled. + * @rmtoll CPAR PA LL_DMA_SetPeriphAddress + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param PeriphAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetPeriphAddress(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t PeriphAddress) +{ + WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR, PeriphAddress); +} + +/** + * @brief Get Memory address. + * @note Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only. + * @rmtoll CMAR MA LL_DMA_GetMemoryAddress + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_DMA_GetMemoryAddress(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR)); +} + +/** + * @brief Get Peripheral address. + * @note Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only. + * @rmtoll CPAR PA LL_DMA_GetPeriphAddress + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_DMA_GetPeriphAddress(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR)); +} + +/** + * @brief Set the Memory to Memory Source address. + * @note Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only. + * @note This API must not be called when the DMA channel is enabled. + * @rmtoll CPAR PA LL_DMA_SetM2MSrcAddress + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param MemoryAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetM2MSrcAddress(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryAddress) +{ + WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR, MemoryAddress); +} + +/** + * @brief Set the Memory to Memory Destination address. + * @note Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only. + * @note This API must not be called when the DMA channel is enabled. + * @rmtoll CMAR MA LL_DMA_SetM2MDstAddress + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @param MemoryAddress Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + * @retval None + */ +__STATIC_INLINE void LL_DMA_SetM2MDstAddress(DMA_TypeDef *DMAx, uint32_t Channel, uint32_t MemoryAddress) +{ + WRITE_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR, MemoryAddress); +} + +/** + * @brief Get the Memory to Memory Source address. + * @note Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only. + * @rmtoll CPAR PA LL_DMA_GetM2MSrcAddress + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_DMA_GetM2MSrcAddress(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CPAR)); +} + +/** + * @brief Get the Memory to Memory Destination address. + * @note Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only. + * @rmtoll CMAR MA LL_DMA_GetM2MDstAddress + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval Between Min_Data = 0 and Max_Data = 0xFFFFFFFF + */ +__STATIC_INLINE uint32_t LL_DMA_GetM2MDstAddress(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_REG(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CMAR)); +} + + +/** + * @} + */ + +/** @defgroup DMA_LL_EF_FLAG_Management FLAG_Management + * @{ + */ + +/** + * @brief Get Channel 1 global interrupt flag. + * @rmtoll ISR GIF1 LL_DMA_IsActiveFlag_GI1 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI1(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_GIF1) == (DMA_ISR_GIF1)); +} + +/** + * @brief Get Channel 2 global interrupt flag. + * @rmtoll ISR GIF2 LL_DMA_IsActiveFlag_GI2 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI2(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_GIF2) == (DMA_ISR_GIF2)); +} + +/** + * @brief Get Channel 3 global interrupt flag. + * @rmtoll ISR GIF3 LL_DMA_IsActiveFlag_GI3 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI3(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_GIF3) == (DMA_ISR_GIF3)); +} + +/** + * @brief Get Channel 4 global interrupt flag. + * @rmtoll ISR GIF4 LL_DMA_IsActiveFlag_GI4 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI4(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_GIF4) == (DMA_ISR_GIF4)); +} + +/** + * @brief Get Channel 5 global interrupt flag. + * @rmtoll ISR GIF5 LL_DMA_IsActiveFlag_GI5 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI5(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_GIF5) == (DMA_ISR_GIF5)); +} + +/** + * @brief Get Channel 6 global interrupt flag. + * @rmtoll ISR GIF6 LL_DMA_IsActiveFlag_GI6 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI6(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_GIF6) == (DMA_ISR_GIF6)); +} + +/** + * @brief Get Channel 7 global interrupt flag. + * @rmtoll ISR GIF7 LL_DMA_IsActiveFlag_GI7 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_GI7(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_GIF7) == (DMA_ISR_GIF7)); +} + +/** + * @brief Get Channel 1 transfer complete flag. + * @rmtoll ISR TCIF1 LL_DMA_IsActiveFlag_TC1 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC1(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF1) == (DMA_ISR_TCIF1)); +} + +/** + * @brief Get Channel 2 transfer complete flag. + * @rmtoll ISR TCIF2 LL_DMA_IsActiveFlag_TC2 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC2(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF2) == (DMA_ISR_TCIF2)); +} + +/** + * @brief Get Channel 3 transfer complete flag. + * @rmtoll ISR TCIF3 LL_DMA_IsActiveFlag_TC3 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC3(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF3) == (DMA_ISR_TCIF3)); +} + +/** + * @brief Get Channel 4 transfer complete flag. + * @rmtoll ISR TCIF4 LL_DMA_IsActiveFlag_TC4 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC4(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF4) == (DMA_ISR_TCIF4)); +} + +/** + * @brief Get Channel 5 transfer complete flag. + * @rmtoll ISR TCIF5 LL_DMA_IsActiveFlag_TC5 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC5(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF5) == (DMA_ISR_TCIF5)); +} + +/** + * @brief Get Channel 6 transfer complete flag. + * @rmtoll ISR TCIF6 LL_DMA_IsActiveFlag_TC6 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC6(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF6) == (DMA_ISR_TCIF6)); +} + +/** + * @brief Get Channel 7 transfer complete flag. + * @rmtoll ISR TCIF7 LL_DMA_IsActiveFlag_TC7 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC7(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TCIF7) == (DMA_ISR_TCIF7)); +} + +/** + * @brief Get Channel 1 half transfer flag. + * @rmtoll ISR HTIF1 LL_DMA_IsActiveFlag_HT1 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT1(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF1) == (DMA_ISR_HTIF1)); +} + +/** + * @brief Get Channel 2 half transfer flag. + * @rmtoll ISR HTIF2 LL_DMA_IsActiveFlag_HT2 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT2(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF2) == (DMA_ISR_HTIF2)); +} + +/** + * @brief Get Channel 3 half transfer flag. + * @rmtoll ISR HTIF3 LL_DMA_IsActiveFlag_HT3 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT3(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF3) == (DMA_ISR_HTIF3)); +} + +/** + * @brief Get Channel 4 half transfer flag. + * @rmtoll ISR HTIF4 LL_DMA_IsActiveFlag_HT4 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT4(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF4) == (DMA_ISR_HTIF4)); +} + +/** + * @brief Get Channel 5 half transfer flag. + * @rmtoll ISR HTIF5 LL_DMA_IsActiveFlag_HT5 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT5(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF5) == (DMA_ISR_HTIF5)); +} + +/** + * @brief Get Channel 6 half transfer flag. + * @rmtoll ISR HTIF6 LL_DMA_IsActiveFlag_HT6 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT6(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF6) == (DMA_ISR_HTIF6)); +} + +/** + * @brief Get Channel 7 half transfer flag. + * @rmtoll ISR HTIF7 LL_DMA_IsActiveFlag_HT7 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT7(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_HTIF7) == (DMA_ISR_HTIF7)); +} + +/** + * @brief Get Channel 1 transfer error flag. + * @rmtoll ISR TEIF1 LL_DMA_IsActiveFlag_TE1 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE1(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF1) == (DMA_ISR_TEIF1)); +} + +/** + * @brief Get Channel 2 transfer error flag. + * @rmtoll ISR TEIF2 LL_DMA_IsActiveFlag_TE2 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE2(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF2) == (DMA_ISR_TEIF2)); +} + +/** + * @brief Get Channel 3 transfer error flag. + * @rmtoll ISR TEIF3 LL_DMA_IsActiveFlag_TE3 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE3(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF3) == (DMA_ISR_TEIF3)); +} + +/** + * @brief Get Channel 4 transfer error flag. + * @rmtoll ISR TEIF4 LL_DMA_IsActiveFlag_TE4 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE4(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF4) == (DMA_ISR_TEIF4)); +} + +/** + * @brief Get Channel 5 transfer error flag. + * @rmtoll ISR TEIF5 LL_DMA_IsActiveFlag_TE5 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE5(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF5) == (DMA_ISR_TEIF5)); +} + +/** + * @brief Get Channel 6 transfer error flag. + * @rmtoll ISR TEIF6 LL_DMA_IsActiveFlag_TE6 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE6(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF6) == (DMA_ISR_TEIF6)); +} + +/** + * @brief Get Channel 7 transfer error flag. + * @rmtoll ISR TEIF7 LL_DMA_IsActiveFlag_TE7 + * @param DMAx DMAx Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE7(DMA_TypeDef *DMAx) +{ + return (READ_BIT(DMAx->ISR, DMA_ISR_TEIF7) == (DMA_ISR_TEIF7)); +} + +/** + * @brief Clear Channel 1 global interrupt flag. + * @rmtoll IFCR CGIF1 LL_DMA_ClearFlag_GI1 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_GI1(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF1); +} + +/** + * @brief Clear Channel 2 global interrupt flag. + * @rmtoll IFCR CGIF2 LL_DMA_ClearFlag_GI2 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_GI2(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF2); +} + +/** + * @brief Clear Channel 3 global interrupt flag. + * @rmtoll IFCR CGIF3 LL_DMA_ClearFlag_GI3 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_GI3(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF3); +} + +/** + * @brief Clear Channel 4 global interrupt flag. + * @rmtoll IFCR CGIF4 LL_DMA_ClearFlag_GI4 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_GI4(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF4); +} + +/** + * @brief Clear Channel 5 global interrupt flag. + * @rmtoll IFCR CGIF5 LL_DMA_ClearFlag_GI5 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_GI5(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF5); +} + +/** + * @brief Clear Channel 6 global interrupt flag. + * @rmtoll IFCR CGIF6 LL_DMA_ClearFlag_GI6 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_GI6(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF6); +} + +/** + * @brief Clear Channel 7 global interrupt flag. + * @rmtoll IFCR CGIF7 LL_DMA_ClearFlag_GI7 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_GI7(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CGIF7); +} + +/** + * @brief Clear Channel 1 transfer complete flag. + * @rmtoll IFCR CTCIF1 LL_DMA_ClearFlag_TC1 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TC1(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF1); +} + +/** + * @brief Clear Channel 2 transfer complete flag. + * @rmtoll IFCR CTCIF2 LL_DMA_ClearFlag_TC2 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TC2(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF2); +} + +/** + * @brief Clear Channel 3 transfer complete flag. + * @rmtoll IFCR CTCIF3 LL_DMA_ClearFlag_TC3 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TC3(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF3); +} + +/** + * @brief Clear Channel 4 transfer complete flag. + * @rmtoll IFCR CTCIF4 LL_DMA_ClearFlag_TC4 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TC4(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF4); +} + +/** + * @brief Clear Channel 5 transfer complete flag. + * @rmtoll IFCR CTCIF5 LL_DMA_ClearFlag_TC5 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TC5(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF5); +} + +/** + * @brief Clear Channel 6 transfer complete flag. + * @rmtoll IFCR CTCIF6 LL_DMA_ClearFlag_TC6 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TC6(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF6); +} + +/** + * @brief Clear Channel 7 transfer complete flag. + * @rmtoll IFCR CTCIF7 LL_DMA_ClearFlag_TC7 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TC7(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTCIF7); +} + +/** + * @brief Clear Channel 1 half transfer flag. + * @rmtoll IFCR CHTIF1 LL_DMA_ClearFlag_HT1 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_HT1(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF1); +} + +/** + * @brief Clear Channel 2 half transfer flag. + * @rmtoll IFCR CHTIF2 LL_DMA_ClearFlag_HT2 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_HT2(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF2); +} + +/** + * @brief Clear Channel 3 half transfer flag. + * @rmtoll IFCR CHTIF3 LL_DMA_ClearFlag_HT3 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_HT3(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF3); +} + +/** + * @brief Clear Channel 4 half transfer flag. + * @rmtoll IFCR CHTIF4 LL_DMA_ClearFlag_HT4 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_HT4(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF4); +} + +/** + * @brief Clear Channel 5 half transfer flag. + * @rmtoll IFCR CHTIF5 LL_DMA_ClearFlag_HT5 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_HT5(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF5); +} + +/** + * @brief Clear Channel 6 half transfer flag. + * @rmtoll IFCR CHTIF6 LL_DMA_ClearFlag_HT6 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_HT6(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF6); +} + +/** + * @brief Clear Channel 7 half transfer flag. + * @rmtoll IFCR CHTIF7 LL_DMA_ClearFlag_HT7 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_HT7(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CHTIF7); +} + +/** + * @brief Clear Channel 1 transfer error flag. + * @rmtoll IFCR CTEIF1 LL_DMA_ClearFlag_TE1 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TE1(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF1); +} + +/** + * @brief Clear Channel 2 transfer error flag. + * @rmtoll IFCR CTEIF2 LL_DMA_ClearFlag_TE2 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TE2(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF2); +} + +/** + * @brief Clear Channel 3 transfer error flag. + * @rmtoll IFCR CTEIF3 LL_DMA_ClearFlag_TE3 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TE3(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF3); +} + +/** + * @brief Clear Channel 4 transfer error flag. + * @rmtoll IFCR CTEIF4 LL_DMA_ClearFlag_TE4 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TE4(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF4); +} + +/** + * @brief Clear Channel 5 transfer error flag. + * @rmtoll IFCR CTEIF5 LL_DMA_ClearFlag_TE5 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TE5(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF5); +} + +/** + * @brief Clear Channel 6 transfer error flag. + * @rmtoll IFCR CTEIF6 LL_DMA_ClearFlag_TE6 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TE6(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF6); +} + +/** + * @brief Clear Channel 7 transfer error flag. + * @rmtoll IFCR CTEIF7 LL_DMA_ClearFlag_TE7 + * @param DMAx DMAx Instance + * @retval None + */ +__STATIC_INLINE void LL_DMA_ClearFlag_TE7(DMA_TypeDef *DMAx) +{ + WRITE_REG(DMAx->IFCR, DMA_IFCR_CTEIF7); +} + +/** + * @} + */ + +/** @defgroup DMA_LL_EF_IT_Management IT_Management + * @{ + */ +/** + * @brief Enable Transfer complete interrupt. + * @rmtoll CCR TCIE LL_DMA_EnableIT_TC + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval None + */ +__STATIC_INLINE void LL_DMA_EnableIT_TC(DMA_TypeDef *DMAx, uint32_t Channel) +{ + SET_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_TCIE); +} + +/** + * @brief Enable Half transfer interrupt. + * @rmtoll CCR HTIE LL_DMA_EnableIT_HT + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval None + */ +__STATIC_INLINE void LL_DMA_EnableIT_HT(DMA_TypeDef *DMAx, uint32_t Channel) +{ + SET_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_HTIE); +} + +/** + * @brief Enable Transfer error interrupt. + * @rmtoll CCR TEIE LL_DMA_EnableIT_TE + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval None + */ +__STATIC_INLINE void LL_DMA_EnableIT_TE(DMA_TypeDef *DMAx, uint32_t Channel) +{ + SET_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_TEIE); +} + +/** + * @brief Disable Transfer complete interrupt. + * @rmtoll CCR TCIE LL_DMA_DisableIT_TC + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval None + */ +__STATIC_INLINE void LL_DMA_DisableIT_TC(DMA_TypeDef *DMAx, uint32_t Channel) +{ + CLEAR_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_TCIE); +} + +/** + * @brief Disable Half transfer interrupt. + * @rmtoll CCR HTIE LL_DMA_DisableIT_HT + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval None + */ +__STATIC_INLINE void LL_DMA_DisableIT_HT(DMA_TypeDef *DMAx, uint32_t Channel) +{ + CLEAR_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_HTIE); +} + +/** + * @brief Disable Transfer error interrupt. + * @rmtoll CCR TEIE LL_DMA_DisableIT_TE + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval None + */ +__STATIC_INLINE void LL_DMA_DisableIT_TE(DMA_TypeDef *DMAx, uint32_t Channel) +{ + CLEAR_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, DMA_CCR_TEIE); +} + +/** + * @brief Check if Transfer complete Interrupt is enabled. + * @rmtoll CCR TCIE LL_DMA_IsEnabledIT_TC + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_TC(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_TCIE) == (DMA_CCR_TCIE)); +} + +/** + * @brief Check if Half transfer Interrupt is enabled. + * @rmtoll CCR HTIE LL_DMA_IsEnabledIT_HT + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_HT(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_HTIE) == (DMA_CCR_HTIE)); +} + +/** + * @brief Check if Transfer error Interrupt is enabled. + * @rmtoll CCR TEIE LL_DMA_IsEnabledIT_TE + * @param DMAx DMAx Instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_DMA_CHANNEL_1 + * @arg @ref LL_DMA_CHANNEL_2 + * @arg @ref LL_DMA_CHANNEL_3 + * @arg @ref LL_DMA_CHANNEL_4 + * @arg @ref LL_DMA_CHANNEL_5 + * @arg @ref LL_DMA_CHANNEL_6 + * @arg @ref LL_DMA_CHANNEL_7 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_TE(DMA_TypeDef *DMAx, uint32_t Channel) +{ + return (READ_BIT(((DMA_Channel_TypeDef *)((uint32_t)((uint32_t)DMAx + CHANNEL_OFFSET_TAB[Channel - 1U])))->CCR, + DMA_CCR_TEIE) == (DMA_CCR_TEIE)); +} + +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup DMA_LL_EF_Init Initialization and de-initialization functions + * @{ + */ + +uint32_t LL_DMA_Init(DMA_TypeDef *DMAx, uint32_t Channel, LL_DMA_InitTypeDef *DMA_InitStruct); +uint32_t LL_DMA_DeInit(DMA_TypeDef *DMAx, uint32_t Channel); +void LL_DMA_StructInit(LL_DMA_InitTypeDef *DMA_InitStruct); + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* DMA1 || DMA2 */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_DMA_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_exti.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_exti.h new file mode 100644 index 0000000..59ed70f --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_exti.h @@ -0,0 +1,1381 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_exti.h + * @author MCD Application Team + * @brief Header file of EXTI LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_EXTI_H +#define __STM32F3xx_LL_EXTI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined (EXTI) + +/** @defgroup EXTI_LL EXTI + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private Macros ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup EXTI_LL_Private_Macros EXTI Private Macros + * @{ + */ +/** + * @} + */ +#endif /*USE_FULL_LL_DRIVER*/ +/* Exported types ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup EXTI_LL_ES_INIT EXTI Exported Init structure + * @{ + */ +typedef struct +{ + + uint32_t Line_0_31; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 0 to 31 + This parameter can be any combination of @ref EXTI_LL_EC_LINE */ +#if defined(EXTI_32_63_SUPPORT) + + uint32_t Line_32_63; /*!< Specifies the EXTI lines to be enabled or disabled for Lines in range 32 to 63 + This parameter can be any combination of @ref EXTI_LL_EC_LINE */ +#endif + + FunctionalState LineCommand; /*!< Specifies the new state of the selected EXTI lines. + This parameter can be set either to ENABLE or DISABLE */ + + uint8_t Mode; /*!< Specifies the mode for the EXTI lines. + This parameter can be a value of @ref EXTI_LL_EC_MODE. */ + + uint8_t Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines. + This parameter can be a value of @ref EXTI_LL_EC_TRIGGER. */ +} LL_EXTI_InitTypeDef; + +/** + * @} + */ +#endif /*USE_FULL_LL_DRIVER*/ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup EXTI_LL_Exported_Constants EXTI Exported Constants + * @{ + */ + +/** @defgroup EXTI_LL_EC_LINE LINE + * @{ + */ +#define LL_EXTI_LINE_0 EXTI_IMR_IM0 /*!< Extended line 0 */ +#define LL_EXTI_LINE_1 EXTI_IMR_IM1 /*!< Extended line 1 */ +#define LL_EXTI_LINE_2 EXTI_IMR_IM2 /*!< Extended line 2 */ +#define LL_EXTI_LINE_3 EXTI_IMR_IM3 /*!< Extended line 3 */ +#define LL_EXTI_LINE_4 EXTI_IMR_IM4 /*!< Extended line 4 */ +#define LL_EXTI_LINE_5 EXTI_IMR_IM5 /*!< Extended line 5 */ +#define LL_EXTI_LINE_6 EXTI_IMR_IM6 /*!< Extended line 6 */ +#define LL_EXTI_LINE_7 EXTI_IMR_IM7 /*!< Extended line 7 */ +#define LL_EXTI_LINE_8 EXTI_IMR_IM8 /*!< Extended line 8 */ +#define LL_EXTI_LINE_9 EXTI_IMR_IM9 /*!< Extended line 9 */ +#define LL_EXTI_LINE_10 EXTI_IMR_IM10 /*!< Extended line 10 */ +#define LL_EXTI_LINE_11 EXTI_IMR_IM11 /*!< Extended line 11 */ +#define LL_EXTI_LINE_12 EXTI_IMR_IM12 /*!< Extended line 12 */ +#define LL_EXTI_LINE_13 EXTI_IMR_IM13 /*!< Extended line 13 */ +#define LL_EXTI_LINE_14 EXTI_IMR_IM14 /*!< Extended line 14 */ +#define LL_EXTI_LINE_15 EXTI_IMR_IM15 /*!< Extended line 15 */ +#if defined(EXTI_IMR_IM16) +#define LL_EXTI_LINE_16 EXTI_IMR_IM16 /*!< Extended line 16 */ +#endif +#define LL_EXTI_LINE_17 EXTI_IMR_IM17 /*!< Extended line 17 */ +#if defined(EXTI_IMR_IM18) +#define LL_EXTI_LINE_18 EXTI_IMR_IM18 /*!< Extended line 18 */ +#endif +#define LL_EXTI_LINE_19 EXTI_IMR_IM19 /*!< Extended line 19 */ +#if defined(EXTI_IMR_IM20) +#define LL_EXTI_LINE_20 EXTI_IMR_IM20 /*!< Extended line 20 */ +#endif +#if defined(EXTI_IMR_IM21) +#define LL_EXTI_LINE_21 EXTI_IMR_IM21 /*!< Extended line 21 */ +#endif +#if defined(EXTI_IMR_IM22) +#define LL_EXTI_LINE_22 EXTI_IMR_IM22 /*!< Extended line 22 */ +#endif +#define LL_EXTI_LINE_23 EXTI_IMR_IM23 /*!< Extended line 23 */ +#if defined(EXTI_IMR_IM24) +#define LL_EXTI_LINE_24 EXTI_IMR_IM24 /*!< Extended line 24 */ +#endif +#if defined(EXTI_IMR_IM25) +#define LL_EXTI_LINE_25 EXTI_IMR_IM25 /*!< Extended line 25 */ +#endif +#if defined(EXTI_IMR_IM26) +#define LL_EXTI_LINE_26 EXTI_IMR_IM26 /*!< Extended line 26 */ +#endif +#if defined(EXTI_IMR_IM27) +#define LL_EXTI_LINE_27 EXTI_IMR_IM27 /*!< Extended line 27 */ +#endif +#if defined(EXTI_IMR_IM28) +#define LL_EXTI_LINE_28 EXTI_IMR_IM28 /*!< Extended line 28 */ +#endif +#if defined(EXTI_IMR_IM29) +#define LL_EXTI_LINE_29 EXTI_IMR_IM29 /*!< Extended line 29 */ +#endif +#if defined(EXTI_IMR_IM30) +#define LL_EXTI_LINE_30 EXTI_IMR_IM30 /*!< Extended line 30 */ +#endif +#if defined(EXTI_IMR_IM31) +#define LL_EXTI_LINE_31 EXTI_IMR_IM31 /*!< Extended line 31 */ +#endif +#define LL_EXTI_LINE_ALL_0_31 EXTI_IMR_IM /*!< All Extended line not reserved*/ + +#if defined(EXTI_32_63_SUPPORT) +#define LL_EXTI_LINE_32 EXTI_IMR2_IM32 /*!< Extended line 32 */ +#if defined(EXTI_IMR2_IM33) +#define LL_EXTI_LINE_33 EXTI_IMR2_IM33 /*!< Extended line 33 */ +#endif +#if defined(EXTI_IMR2_IM34) +#define LL_EXTI_LINE_34 EXTI_IMR2_IM34 /*!< Extended line 34 */ +#endif +#if defined(EXTI_IMR2_IM35) +#define LL_EXTI_LINE_35 EXTI_IMR2_IM35 /*!< Extended line 35 */ +#endif +#if defined(EXTI_IMR2_IM36) +#define LL_EXTI_LINE_36 EXTI_IMR2_IM36 /*!< Extended line 36 */ +#endif +#if defined(EXTI_IMR2_IM37) +#define LL_EXTI_LINE_37 EXTI_IMR2_IM37 /*!< Extended line 37 */ +#endif +#if defined(EXTI_IMR2_IM38) +#define LL_EXTI_LINE_38 EXTI_IMR2_IM38 /*!< Extended line 38 */ +#endif +#if defined(EXTI_IMR2_IM39) +#define LL_EXTI_LINE_39 EXTI_IMR2_IM39 /*!< Extended line 39 */ +#endif +#if defined(EXTI_IMR2_IM40) +#define LL_EXTI_LINE_40 EXTI_IMR2_IM40 /*!< Extended line 40 */ +#endif +#define LL_EXTI_LINE_ALL_32_63 EXTI_IMR2_IM /*!< All Extended line not reserved*/ + +#endif + +#define LL_EXTI_LINE_ALL (0xFFFFFFFFU) /*!< All Extended line */ + +#if defined(USE_FULL_LL_DRIVER) +#define LL_EXTI_LINE_NONE (0x00000000U) /*!< None Extended line */ +#endif /*USE_FULL_LL_DRIVER*/ + +/** + * @} + */ +#if defined(USE_FULL_LL_DRIVER) + +/** @defgroup EXTI_LL_EC_MODE Mode + * @{ + */ +#define LL_EXTI_MODE_IT ((uint8_t)0x00U) /*!< Interrupt Mode */ +#define LL_EXTI_MODE_EVENT ((uint8_t)0x01U) /*!< Event Mode */ +#define LL_EXTI_MODE_IT_EVENT ((uint8_t)0x02U) /*!< Interrupt & Event Mode */ +/** + * @} + */ + +/** @defgroup EXTI_LL_EC_TRIGGER Edge Trigger + * @{ + */ +#define LL_EXTI_TRIGGER_NONE ((uint8_t)0x00U) /*!< No Trigger Mode */ +#define LL_EXTI_TRIGGER_RISING ((uint8_t)0x01U) /*!< Trigger Rising Mode */ +#define LL_EXTI_TRIGGER_FALLING ((uint8_t)0x02U) /*!< Trigger Falling Mode */ +#define LL_EXTI_TRIGGER_RISING_FALLING ((uint8_t)0x03U) /*!< Trigger Rising & Falling Mode */ + +/** + * @} + */ + + +#endif /*USE_FULL_LL_DRIVER*/ + + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup EXTI_LL_Exported_Macros EXTI Exported Macros + * @{ + */ + +/** @defgroup EXTI_LL_EM_WRITE_READ Common Write and read registers Macros + * @{ + */ + +/** + * @brief Write a value in EXTI register + * @param __REG__ Register to be written + * @param __VALUE__ Value to be written in the register + * @retval None + */ +#define LL_EXTI_WriteReg(__REG__, __VALUE__) WRITE_REG(EXTI->__REG__, (__VALUE__)) + +/** + * @brief Read a value in EXTI register + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_EXTI_ReadReg(__REG__) READ_REG(EXTI->__REG__) +/** + * @} + */ + + +/** + * @} + */ + + + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup EXTI_LL_Exported_Functions EXTI Exported Functions + * @{ + */ +/** @defgroup EXTI_LL_EF_IT_Management IT_Management + * @{ + */ + +/** + * @brief Enable ExtiLine Interrupt request for Lines in range 0 to 31 + * @note The reset value for the direct or internal lines (see RM) + * is set to 1 in order to enable the interrupt by default. + * Bits are set automatically at Power on. + * @rmtoll IMR IMx LL_EXTI_EnableIT_0_31 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_17 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_23 + * @arg @ref LL_EXTI_LINE_24 + * @arg @ref LL_EXTI_LINE_25 + * @arg @ref LL_EXTI_LINE_26 + * @arg @ref LL_EXTI_LINE_27 + * @arg @ref LL_EXTI_LINE_28 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @arg @ref LL_EXTI_LINE_ALL_0_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_EnableIT_0_31(uint32_t ExtiLine) +{ + SET_BIT(EXTI->IMR, ExtiLine); +} +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Enable ExtiLine Interrupt request for Lines in range 32 to 63 + * @note The reset value for the direct lines (lines from 32 to 34, line + * 39) is set to 1 in order to enable the interrupt by default. + * Bits are set automatically at Power on. + * @rmtoll IMR2 IMx LL_EXTI_EnableIT_32_63 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_32 + * @arg @ref LL_EXTI_LINE_33 + * @arg @ref LL_EXTI_LINE_34 + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @arg @ref LL_EXTI_LINE_39 + * @arg @ref LL_EXTI_LINE_ALL_32_63 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_EnableIT_32_63(uint32_t ExtiLine) +{ + SET_BIT(EXTI->IMR2, ExtiLine); +} +#endif + +/** + * @brief Disable ExtiLine Interrupt request for Lines in range 0 to 31 + * @note The reset value for the direct or internal lines (see RM) + * is set to 1 in order to enable the interrupt by default. + * Bits are set automatically at Power on. + * @rmtoll IMR IMx LL_EXTI_DisableIT_0_31 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_17 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_23 + * @arg @ref LL_EXTI_LINE_24 + * @arg @ref LL_EXTI_LINE_25 + * @arg @ref LL_EXTI_LINE_26 + * @arg @ref LL_EXTI_LINE_27 + * @arg @ref LL_EXTI_LINE_28 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @arg @ref LL_EXTI_LINE_ALL_0_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_DisableIT_0_31(uint32_t ExtiLine) +{ + CLEAR_BIT(EXTI->IMR, ExtiLine); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Disable ExtiLine Interrupt request for Lines in range 32 to 63 + * @note The reset value for the direct lines (lines from 32 to 34, line + * 39) is set to 1 in order to enable the interrupt by default. + * Bits are set automatically at Power on. + * @rmtoll IMR2 IMx LL_EXTI_DisableIT_32_63 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_32 + * @arg @ref LL_EXTI_LINE_33 + * @arg @ref LL_EXTI_LINE_34 + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @arg @ref LL_EXTI_LINE_39 + * @arg @ref LL_EXTI_LINE_ALL_32_63 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_DisableIT_32_63(uint32_t ExtiLine) +{ + CLEAR_BIT(EXTI->IMR2, ExtiLine); +} +#endif + +/** + * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 0 to 31 + * @note The reset value for the direct or internal lines (see RM) + * is set to 1 in order to enable the interrupt by default. + * Bits are set automatically at Power on. + * @rmtoll IMR IMx LL_EXTI_IsEnabledIT_0_31 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_17 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_23 + * @arg @ref LL_EXTI_LINE_24 + * @arg @ref LL_EXTI_LINE_25 + * @arg @ref LL_EXTI_LINE_26 + * @arg @ref LL_EXTI_LINE_27 + * @arg @ref LL_EXTI_LINE_28 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @arg @ref LL_EXTI_LINE_ALL_0_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_0_31(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->IMR, ExtiLine) == (ExtiLine)); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Indicate if ExtiLine Interrupt request is enabled for Lines in range 32 to 63 + * @note The reset value for the direct lines (lines from 32 to 34, line + * 39) is set to 1 in order to enable the interrupt by default. + * Bits are set automatically at Power on. + * @rmtoll IMR2 IMx LL_EXTI_IsEnabledIT_32_63 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_32 + * @arg @ref LL_EXTI_LINE_33 + * @arg @ref LL_EXTI_LINE_34 + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @arg @ref LL_EXTI_LINE_39 + * @arg @ref LL_EXTI_LINE_ALL_32_63 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsEnabledIT_32_63(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->IMR2, ExtiLine) == (ExtiLine)); +} +#endif + +/** + * @} + */ + +/** @defgroup EXTI_LL_EF_Event_Management Event_Management + * @{ + */ + +/** + * @brief Enable ExtiLine Event request for Lines in range 0 to 31 + * @rmtoll EMR EMx LL_EXTI_EnableEvent_0_31 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_17 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_23 + * @arg @ref LL_EXTI_LINE_24 + * @arg @ref LL_EXTI_LINE_25 + * @arg @ref LL_EXTI_LINE_26 + * @arg @ref LL_EXTI_LINE_27 + * @arg @ref LL_EXTI_LINE_28 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @arg @ref LL_EXTI_LINE_ALL_0_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_EnableEvent_0_31(uint32_t ExtiLine) +{ + SET_BIT(EXTI->EMR, ExtiLine); + +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Enable ExtiLine Event request for Lines in range 32 to 63 + * @rmtoll EMR2 EMx LL_EXTI_EnableEvent_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_32 + * @arg @ref LL_EXTI_LINE_33 + * @arg @ref LL_EXTI_LINE_34 + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @arg @ref LL_EXTI_LINE_39 + * @arg @ref LL_EXTI_LINE_ALL_32_63 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_EnableEvent_32_63(uint32_t ExtiLine) +{ + SET_BIT(EXTI->EMR2, ExtiLine); +} +#endif + +/** + * @brief Disable ExtiLine Event request for Lines in range 0 to 31 + * @rmtoll EMR EMx LL_EXTI_DisableEvent_0_31 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_17 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_23 + * @arg @ref LL_EXTI_LINE_24 + * @arg @ref LL_EXTI_LINE_25 + * @arg @ref LL_EXTI_LINE_26 + * @arg @ref LL_EXTI_LINE_27 + * @arg @ref LL_EXTI_LINE_28 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @arg @ref LL_EXTI_LINE_ALL_0_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_DisableEvent_0_31(uint32_t ExtiLine) +{ + CLEAR_BIT(EXTI->EMR, ExtiLine); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Disable ExtiLine Event request for Lines in range 32 to 63 + * @rmtoll EMR2 EMx LL_EXTI_DisableEvent_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_32 + * @arg @ref LL_EXTI_LINE_33 + * @arg @ref LL_EXTI_LINE_34 + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @arg @ref LL_EXTI_LINE_39 + * @arg @ref LL_EXTI_LINE_ALL_32_63 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_DisableEvent_32_63(uint32_t ExtiLine) +{ + CLEAR_BIT(EXTI->EMR2, ExtiLine); +} +#endif + +/** + * @brief Indicate if ExtiLine Event request is enabled for Lines in range 0 to 31 + * @rmtoll EMR EMx LL_EXTI_IsEnabledEvent_0_31 + * @param ExtiLine This parameter can be one of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_17 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_23 + * @arg @ref LL_EXTI_LINE_24 + * @arg @ref LL_EXTI_LINE_25 + * @arg @ref LL_EXTI_LINE_26 + * @arg @ref LL_EXTI_LINE_27 + * @arg @ref LL_EXTI_LINE_28 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @arg @ref LL_EXTI_LINE_ALL_0_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_0_31(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->EMR, ExtiLine) == (ExtiLine)); + +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Indicate if ExtiLine Event request is enabled for Lines in range 32 to 63 + * @rmtoll EMR2 EMx LL_EXTI_IsEnabledEvent_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_32 + * @arg @ref LL_EXTI_LINE_33 + * @arg @ref LL_EXTI_LINE_34 + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @arg @ref LL_EXTI_LINE_39 + * @arg @ref LL_EXTI_LINE_ALL_32_63 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsEnabledEvent_32_63(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->EMR2, ExtiLine) == (ExtiLine)); +} +#endif + +/** + * @} + */ + +/** @defgroup EXTI_LL_EF_Rising_Trigger_Management Rising_Trigger_Management + * @{ + */ + +/** + * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 0 to 31 + * @note The configurable wakeup lines are edge-triggered. No glitch must be + * generated on these lines. If a rising edge on a configurable interrupt + * line occurs during a write operation in the EXTI_RTSR register, the + * pending bit is not set. + * Rising and falling edge triggers can be set for + * the same interrupt line. In this case, both generate a trigger + * condition. + * @rmtoll RTSR RTx LL_EXTI_EnableRisingTrig_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_EnableRisingTrig_0_31(uint32_t ExtiLine) +{ + SET_BIT(EXTI->RTSR, ExtiLine); + +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Enable ExtiLine Rising Edge Trigger for Lines in range 32 to 63 + * @note The configurable wakeup lines are edge-triggered. No glitch must be + * generated on these lines. If a rising edge on a configurable interrupt + * line occurs during a write operation in the EXTI_RTSR register, the + * pending bit is not set.Rising and falling edge triggers can be set for + * the same interrupt line. In this case, both generate a trigger + * condition. + * @rmtoll RTSR2 RTx LL_EXTI_EnableRisingTrig_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_EnableRisingTrig_32_63(uint32_t ExtiLine) +{ + SET_BIT(EXTI->RTSR2, ExtiLine); +} +#endif + +/** + * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 0 to 31 + * @note The configurable wakeup lines are edge-triggered. No glitch must be + * generated on these lines. If a rising edge on a configurable interrupt + * line occurs during a write operation in the EXTI_RTSR register, the + * pending bit is not set. + * Rising and falling edge triggers can be set for + * the same interrupt line. In this case, both generate a trigger + * condition. + * @rmtoll RTSR RTx LL_EXTI_DisableRisingTrig_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_DisableRisingTrig_0_31(uint32_t ExtiLine) +{ + CLEAR_BIT(EXTI->RTSR, ExtiLine); + +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Disable ExtiLine Rising Edge Trigger for Lines in range 32 to 63 + * @note The configurable wakeup lines are edge-triggered. No glitch must be + * generated on these lines. If a rising edge on a configurable interrupt + * line occurs during a write operation in the EXTI_RTSR register, the + * pending bit is not set. + * Rising and falling edge triggers can be set for + * the same interrupt line. In this case, both generate a trigger + * condition. + * @rmtoll RTSR2 RTx LL_EXTI_DisableRisingTrig_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_DisableRisingTrig_32_63(uint32_t ExtiLine) +{ + CLEAR_BIT(EXTI->RTSR2, ExtiLine); +} +#endif + +/** + * @brief Check if rising edge trigger is enabled for Lines in range 0 to 31 + * @rmtoll RTSR RTx LL_EXTI_IsEnabledRisingTrig_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_0_31(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->RTSR, ExtiLine) == (ExtiLine)); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Check if rising edge trigger is enabled for Lines in range 32 to 63 + * @rmtoll RTSR2 RTx LL_EXTI_IsEnabledRisingTrig_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsEnabledRisingTrig_32_63(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->RTSR2, ExtiLine) == (ExtiLine)); +} +#endif + +/** + * @} + */ + +/** @defgroup EXTI_LL_EF_Falling_Trigger_Management Falling_Trigger_Management + * @{ + */ + +/** + * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 0 to 31 + * @note The configurable wakeup lines are edge-triggered. No glitch must be + * generated on these lines. If a falling edge on a configurable interrupt + * line occurs during a write operation in the EXTI_FTSR register, the + * pending bit is not set. + * Rising and falling edge triggers can be set for + * the same interrupt line. In this case, both generate a trigger + * condition. + * @rmtoll FTSR FTx LL_EXTI_EnableFallingTrig_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_EnableFallingTrig_0_31(uint32_t ExtiLine) +{ + SET_BIT(EXTI->FTSR, ExtiLine); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Enable ExtiLine Falling Edge Trigger for Lines in range 32 to 63 + * @note The configurable wakeup lines are edge-triggered. No glitch must be + * generated on these lines. If a Falling edge on a configurable interrupt + * line occurs during a write operation in the EXTI_FTSR register, the + * pending bit is not set. + * Rising and falling edge triggers can be set for + * the same interrupt line. In this case, both generate a trigger + * condition. + * @rmtoll FTSR2 FTx LL_EXTI_EnableFallingTrig_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_EnableFallingTrig_32_63(uint32_t ExtiLine) +{ + SET_BIT(EXTI->FTSR2, ExtiLine); +} +#endif + +/** + * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 0 to 31 + * @note The configurable wakeup lines are edge-triggered. No glitch must be + * generated on these lines. If a Falling edge on a configurable interrupt + * line occurs during a write operation in the EXTI_FTSR register, the + * pending bit is not set. + * Rising and falling edge triggers can be set for the same interrupt line. + * In this case, both generate a trigger condition. + * @rmtoll FTSR FTx LL_EXTI_DisableFallingTrig_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_DisableFallingTrig_0_31(uint32_t ExtiLine) +{ + CLEAR_BIT(EXTI->FTSR, ExtiLine); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Disable ExtiLine Falling Edge Trigger for Lines in range 32 to 63 + * @note The configurable wakeup lines are edge-triggered. No glitch must be + * generated on these lines. If a Falling edge on a configurable interrupt + * line occurs during a write operation in the EXTI_FTSR register, the + * pending bit is not set. + * Rising and falling edge triggers can be set for the same interrupt line. + * In this case, both generate a trigger condition. + * @rmtoll FTSR2 FTx LL_EXTI_DisableFallingTrig_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_DisableFallingTrig_32_63(uint32_t ExtiLine) +{ + CLEAR_BIT(EXTI->FTSR2, ExtiLine); +} +#endif + +/** + * @brief Check if falling edge trigger is enabled for Lines in range 0 to 31 + * @rmtoll FTSR FTx LL_EXTI_IsEnabledFallingTrig_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_0_31(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->FTSR, ExtiLine) == (ExtiLine)); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Check if falling edge trigger is enabled for Lines in range 32 to 63 + * @rmtoll FTSR2 FTx LL_EXTI_IsEnabledFallingTrig_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsEnabledFallingTrig_32_63(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->FTSR2, ExtiLine) == (ExtiLine)); +} +#endif + +/** + * @} + */ + +/** @defgroup EXTI_LL_EF_Software_Interrupt_Management Software_Interrupt_Management + * @{ + */ + +/** + * @brief Generate a software Interrupt Event for Lines in range 0 to 31 + * @note If the interrupt is enabled on this line in the EXTI_IMR, writing a 1 to + * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR + * resulting in an interrupt request generation. + * This bit is cleared by clearing the corresponding bit in the EXTI_PR + * register (by writing a 1 into the bit) + * @rmtoll SWIER SWIx LL_EXTI_GenerateSWI_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_GenerateSWI_0_31(uint32_t ExtiLine) +{ + SET_BIT(EXTI->SWIER, ExtiLine); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Generate a software Interrupt Event for Lines in range 32 to 63 + * @note If the interrupt is enabled on this line in the EXTI_IMR2, writing a 1 to + * this bit when it is at '0' sets the corresponding pending bit in EXTI_PR2 + * resulting in an interrupt request generation. + * This bit is cleared by clearing the corresponding bit in the EXTI_PR2 + * register (by writing a 1 into the bit) + * @rmtoll SWIER2 SWIx LL_EXTI_GenerateSWI_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_GenerateSWI_32_63(uint32_t ExtiLine) +{ + SET_BIT(EXTI->SWIER2, ExtiLine); +} +#endif + +/** + * @} + */ + +/** @defgroup EXTI_LL_EF_Flag_Management Flag_Management + * @{ + */ + +/** + * @brief Check if the ExtLine Flag is set or not for Lines in range 0 to 31 + * @note This bit is set when the selected edge event arrives on the interrupt + * line. This bit is cleared by writing a 1 to the bit. + * @rmtoll PR PIFx LL_EXTI_IsActiveFlag_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_0_31(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->PR, ExtiLine) == (ExtiLine)); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Check if the ExtLine Flag is set or not for Lines in range 32 to 63 + * @note This bit is set when the selected edge event arrives on the interrupt + * line. This bit is cleared by writing a 1 to the bit. + * @rmtoll PR2 PIFx LL_EXTI_IsActiveFlag_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_EXTI_IsActiveFlag_32_63(uint32_t ExtiLine) +{ + return (READ_BIT(EXTI->PR2, ExtiLine) == (ExtiLine)); +} +#endif + +/** + * @brief Read ExtLine Combination Flag for Lines in range 0 to 31 + * @note This bit is set when the selected edge event arrives on the interrupt + * line. This bit is cleared by writing a 1 to the bit. + * @rmtoll PR PIFx LL_EXTI_ReadFlag_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval @note This bit is set when the selected edge event arrives on the interrupt + */ +__STATIC_INLINE uint32_t LL_EXTI_ReadFlag_0_31(uint32_t ExtiLine) +{ + return (uint32_t)(READ_BIT(EXTI->PR, ExtiLine)); +} + +#if defined(EXTI_32_63_SUPPORT) + +/** + * @brief Read ExtLine Combination Flag for Lines in range 32 to 63 + * @note This bit is set when the selected edge event arrives on the interrupt + * line. This bit is cleared by writing a 1 to the bit. + * @rmtoll PR2 PIFx LL_EXTI_ReadFlag_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval @note This bit is set when the selected edge event arrives on the interrupt + */ +__STATIC_INLINE uint32_t LL_EXTI_ReadFlag_32_63(uint32_t ExtiLine) +{ + return (uint32_t)(READ_BIT(EXTI->PR2, ExtiLine)); +} +#endif + +/** + * @brief Clear ExtLine Flags for Lines in range 0 to 31 + * @note This bit is set when the selected edge event arrives on the interrupt + * line. This bit is cleared by writing a 1 to the bit. + * @rmtoll PR PIFx LL_EXTI_ClearFlag_0_31 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_0 + * @arg @ref LL_EXTI_LINE_1 + * @arg @ref LL_EXTI_LINE_2 + * @arg @ref LL_EXTI_LINE_3 + * @arg @ref LL_EXTI_LINE_4 + * @arg @ref LL_EXTI_LINE_5 + * @arg @ref LL_EXTI_LINE_6 + * @arg @ref LL_EXTI_LINE_7 + * @arg @ref LL_EXTI_LINE_8 + * @arg @ref LL_EXTI_LINE_9 + * @arg @ref LL_EXTI_LINE_10 + * @arg @ref LL_EXTI_LINE_11 + * @arg @ref LL_EXTI_LINE_12 + * @arg @ref LL_EXTI_LINE_13 + * @arg @ref LL_EXTI_LINE_14 + * @arg @ref LL_EXTI_LINE_15 + * @arg @ref LL_EXTI_LINE_16 + * @arg @ref LL_EXTI_LINE_18 + * @arg @ref LL_EXTI_LINE_19 + * @arg @ref LL_EXTI_LINE_20 + * @arg @ref LL_EXTI_LINE_21 + * @arg @ref LL_EXTI_LINE_22 + * @arg @ref LL_EXTI_LINE_29 + * @arg @ref LL_EXTI_LINE_30 + * @arg @ref LL_EXTI_LINE_31 + * @note Please check each device line mapping for EXTI Line availability + * @retval None + */ +__STATIC_INLINE void LL_EXTI_ClearFlag_0_31(uint32_t ExtiLine) +{ + WRITE_REG(EXTI->PR, ExtiLine); +} + +#if defined(EXTI_32_63_SUPPORT) +/** + * @brief Clear ExtLine Flags for Lines in range 32 to 63 + * @note This bit is set when the selected edge event arrives on the interrupt + * line. This bit is cleared by writing a 1 to the bit. + * @rmtoll PR2 PIFx LL_EXTI_ClearFlag_32_63 + * @param ExtiLine This parameter can be a combination of the following values: + * @arg @ref LL_EXTI_LINE_35 + * @arg @ref LL_EXTI_LINE_36 + * @arg @ref LL_EXTI_LINE_37 + * @arg @ref LL_EXTI_LINE_38 + * @retval None + */ +__STATIC_INLINE void LL_EXTI_ClearFlag_32_63(uint32_t ExtiLine) +{ + WRITE_REG(EXTI->PR2, ExtiLine); +} +#endif + +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup EXTI_LL_EF_Init Initialization and de-initialization functions + * @{ + */ + +uint32_t LL_EXTI_Init(LL_EXTI_InitTypeDef *EXTI_InitStruct); +uint32_t LL_EXTI_DeInit(void); +void LL_EXTI_StructInit(LL_EXTI_InitTypeDef *EXTI_InitStruct); + + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* EXTI */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_EXTI_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_gpio.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_gpio.h new file mode 100644 index 0000000..3de5970 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_gpio.h @@ -0,0 +1,978 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_gpio.h + * @author MCD Application Team + * @brief Header file of GPIO LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_GPIO_H +#define __STM32F3xx_LL_GPIO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH) + +/** @defgroup GPIO_LL GPIO + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup GPIO_LL_Private_Macros GPIO Private Macros + * @{ + */ + +/** + * @} + */ +#endif /*USE_FULL_LL_DRIVER*/ + +/* Exported types ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup GPIO_LL_ES_INIT GPIO Exported Init structures + * @{ + */ + +/** + * @brief LL GPIO Init Structure definition + */ +typedef struct +{ + uint32_t Pin; /*!< Specifies the GPIO pins to be configured. + This parameter can be any value of @ref GPIO_LL_EC_PIN */ + + uint32_t Mode; /*!< Specifies the operating mode for the selected pins. + This parameter can be a value of @ref GPIO_LL_EC_MODE. + + GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinMode().*/ + + uint32_t Speed; /*!< Specifies the speed for the selected pins. + This parameter can be a value of @ref GPIO_LL_EC_SPEED. + + GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinSpeed().*/ + + uint32_t OutputType; /*!< Specifies the operating output type for the selected pins. + This parameter can be a value of @ref GPIO_LL_EC_OUTPUT. + + GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinOutputType().*/ + + uint32_t Pull; /*!< Specifies the operating Pull-up/Pull down for the selected pins. + This parameter can be a value of @ref GPIO_LL_EC_PULL. + + GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinPull().*/ + + uint32_t Alternate; /*!< Specifies the Peripheral to be connected to the selected pins. + This parameter can be a value of @ref GPIO_LL_EC_AF. + + GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetAFPin_0_7() and LL_GPIO_SetAFPin_8_15().*/ +} LL_GPIO_InitTypeDef; + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup GPIO_LL_Exported_Constants GPIO Exported Constants + * @{ + */ + +/** @defgroup GPIO_LL_EC_PIN PIN + * @{ + */ +#define LL_GPIO_PIN_0 GPIO_BSRR_BS_0 /*!< Select pin 0 */ +#define LL_GPIO_PIN_1 GPIO_BSRR_BS_1 /*!< Select pin 1 */ +#define LL_GPIO_PIN_2 GPIO_BSRR_BS_2 /*!< Select pin 2 */ +#define LL_GPIO_PIN_3 GPIO_BSRR_BS_3 /*!< Select pin 3 */ +#define LL_GPIO_PIN_4 GPIO_BSRR_BS_4 /*!< Select pin 4 */ +#define LL_GPIO_PIN_5 GPIO_BSRR_BS_5 /*!< Select pin 5 */ +#define LL_GPIO_PIN_6 GPIO_BSRR_BS_6 /*!< Select pin 6 */ +#define LL_GPIO_PIN_7 GPIO_BSRR_BS_7 /*!< Select pin 7 */ +#define LL_GPIO_PIN_8 GPIO_BSRR_BS_8 /*!< Select pin 8 */ +#define LL_GPIO_PIN_9 GPIO_BSRR_BS_9 /*!< Select pin 9 */ +#define LL_GPIO_PIN_10 GPIO_BSRR_BS_10 /*!< Select pin 10 */ +#define LL_GPIO_PIN_11 GPIO_BSRR_BS_11 /*!< Select pin 11 */ +#define LL_GPIO_PIN_12 GPIO_BSRR_BS_12 /*!< Select pin 12 */ +#define LL_GPIO_PIN_13 GPIO_BSRR_BS_13 /*!< Select pin 13 */ +#define LL_GPIO_PIN_14 GPIO_BSRR_BS_14 /*!< Select pin 14 */ +#define LL_GPIO_PIN_15 GPIO_BSRR_BS_15 /*!< Select pin 15 */ +#define LL_GPIO_PIN_ALL (GPIO_BSRR_BS_0 | GPIO_BSRR_BS_1 | GPIO_BSRR_BS_2 | \ + GPIO_BSRR_BS_3 | GPIO_BSRR_BS_4 | GPIO_BSRR_BS_5 | \ + GPIO_BSRR_BS_6 | GPIO_BSRR_BS_7 | GPIO_BSRR_BS_8 | \ + GPIO_BSRR_BS_9 | GPIO_BSRR_BS_10 | GPIO_BSRR_BS_11 | \ + GPIO_BSRR_BS_12 | GPIO_BSRR_BS_13 | GPIO_BSRR_BS_14 | \ + GPIO_BSRR_BS_15) /*!< Select all pins */ +/** + * @} + */ + +/** @defgroup GPIO_LL_EC_MODE Mode + * @{ + */ +#define LL_GPIO_MODE_INPUT (0x00000000U) /*!< Select input mode */ +#define LL_GPIO_MODE_OUTPUT GPIO_MODER_MODER0_0 /*!< Select output mode */ +#define LL_GPIO_MODE_ALTERNATE GPIO_MODER_MODER0_1 /*!< Select alternate function mode */ +#define LL_GPIO_MODE_ANALOG GPIO_MODER_MODER0 /*!< Select analog mode */ +/** + * @} + */ + +/** @defgroup GPIO_LL_EC_OUTPUT Output Type + * @{ + */ +#define LL_GPIO_OUTPUT_PUSHPULL (0x00000000U) /*!< Select push-pull as output type */ +#define LL_GPIO_OUTPUT_OPENDRAIN GPIO_OTYPER_OT_0 /*!< Select open-drain as output type */ +/** + * @} + */ + +/** @defgroup GPIO_LL_EC_SPEED Output Speed + * @{ + */ +#define LL_GPIO_SPEED_FREQ_LOW (0x00000000U) /*!< Select I/O low output speed */ +#define LL_GPIO_SPEED_FREQ_MEDIUM GPIO_OSPEEDER_OSPEEDR0_0 /*!< Select I/O medium output speed */ +#define LL_GPIO_SPEED_FREQ_HIGH GPIO_OSPEEDER_OSPEEDR0 /*!< Select I/O high output speed */ +/** + * @} + */ + +/** @defgroup GPIO_LL_EC_PULL Pull Up Pull Down + * @{ + */ +#define LL_GPIO_PULL_NO (0x00000000U) /*!< Select I/O no pull */ +#define LL_GPIO_PULL_UP GPIO_PUPDR_PUPDR0_0 /*!< Select I/O pull up */ +#define LL_GPIO_PULL_DOWN GPIO_PUPDR_PUPDR0_1 /*!< Select I/O pull down */ +/** + * @} + */ + +/** @defgroup GPIO_LL_EC_AF Alternate Function + * @{ + */ +#define LL_GPIO_AF_0 (0x0000000U) /*!< Select alternate function 0 */ +#define LL_GPIO_AF_1 (0x0000001U) /*!< Select alternate function 1 */ +#define LL_GPIO_AF_2 (0x0000002U) /*!< Select alternate function 2 */ +#define LL_GPIO_AF_3 (0x0000003U) /*!< Select alternate function 3 */ +#define LL_GPIO_AF_4 (0x0000004U) /*!< Select alternate function 4 */ +#define LL_GPIO_AF_5 (0x0000005U) /*!< Select alternate function 5 */ +#define LL_GPIO_AF_6 (0x0000006U) /*!< Select alternate function 6 */ +#define LL_GPIO_AF_7 (0x0000007U) /*!< Select alternate function 7 */ +#define LL_GPIO_AF_8 (0x0000008U) /*!< Select alternate function 8 */ +#define LL_GPIO_AF_9 (0x0000009U) /*!< Select alternate function 9 */ +#define LL_GPIO_AF_10 (0x000000AU) /*!< Select alternate function 10 */ +#define LL_GPIO_AF_11 (0x000000BU) /*!< Select alternate function 11 */ +#define LL_GPIO_AF_12 (0x000000CU) /*!< Select alternate function 12 */ +#define LL_GPIO_AF_13 (0x000000DU) /*!< Select alternate function 13 */ +#define LL_GPIO_AF_14 (0x000000EU) /*!< Select alternate function 14 */ +#define LL_GPIO_AF_15 (0x000000FU) /*!< Select alternate function 15 */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup GPIO_LL_Exported_Macros GPIO Exported Macros + * @{ + */ + +/** @defgroup GPIO_LL_EM_WRITE_READ Common Write and read registers Macros + * @{ + */ + +/** + * @brief Write a value in GPIO register + * @param __INSTANCE__ GPIO Instance + * @param __REG__ Register to be written + * @param __VALUE__ Value to be written in the register + * @retval None + */ +#define LL_GPIO_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) + +/** + * @brief Read a value in GPIO register + * @param __INSTANCE__ GPIO Instance + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_GPIO_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) +/** + * @} + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup GPIO_LL_Exported_Functions GPIO Exported Functions + * @{ + */ + +/** @defgroup GPIO_LL_EF_Port_Configuration Port Configuration + * @{ + */ + +/** + * @brief Configure gpio mode for a dedicated pin on dedicated port. + * @note I/O mode can be Input mode, General purpose output, Alternate function mode or Analog. + * @note Warning: only one pin can be passed as parameter. + * @rmtoll MODER MODEy LL_GPIO_SetPinMode + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @param Mode This parameter can be one of the following values: + * @arg @ref LL_GPIO_MODE_INPUT + * @arg @ref LL_GPIO_MODE_OUTPUT + * @arg @ref LL_GPIO_MODE_ALTERNATE + * @arg @ref LL_GPIO_MODE_ANALOG + * @retval None + */ +__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode) +{ + MODIFY_REG(GPIOx->MODER, (GPIO_MODER_MODER0 << (POSITION_VAL(Pin) * 2U)), (Mode << (POSITION_VAL(Pin) * 2U))); +} + +/** + * @brief Return gpio mode for a dedicated pin on dedicated port. + * @note I/O mode can be Input mode, General purpose output, Alternate function mode or Analog. + * @note Warning: only one pin can be passed as parameter. + * @rmtoll MODER MODEy LL_GPIO_GetPinMode + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @retval Returned value can be one of the following values: + * @arg @ref LL_GPIO_MODE_INPUT + * @arg @ref LL_GPIO_MODE_OUTPUT + * @arg @ref LL_GPIO_MODE_ALTERNATE + * @arg @ref LL_GPIO_MODE_ANALOG + */ +__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin) +{ + return (uint32_t)(READ_BIT(GPIOx->MODER, + (GPIO_MODER_MODER0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U)); +} + +/** + * @brief Configure gpio output type for several pins on dedicated port. + * @note Output type as to be set when gpio pin is in output or + * alternate modes. Possible type are Push-pull or Open-drain. + * @rmtoll OTYPER OTy LL_GPIO_SetPinOutputType + * @param GPIOx GPIO Port + * @param PinMask This parameter can be a combination of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @param OutputType This parameter can be one of the following values: + * @arg @ref LL_GPIO_OUTPUT_PUSHPULL + * @arg @ref LL_GPIO_OUTPUT_OPENDRAIN + * @retval None + */ +__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t PinMask, uint32_t OutputType) +{ + MODIFY_REG(GPIOx->OTYPER, PinMask, (PinMask * OutputType)); +} + +/** + * @brief Return gpio output type for several pins on dedicated port. + * @note Output type as to be set when gpio pin is in output or + * alternate modes. Possible type are Push-pull or Open-drain. + * @note Warning: only one pin can be passed as parameter. + * @rmtoll OTYPER OTy LL_GPIO_GetPinOutputType + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @retval Returned value can be one of the following values: + * @arg @ref LL_GPIO_OUTPUT_PUSHPULL + * @arg @ref LL_GPIO_OUTPUT_OPENDRAIN + */ +__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin) +{ + return (uint32_t)(READ_BIT(GPIOx->OTYPER, Pin) >> POSITION_VAL(Pin)); +} + +/** + * @brief Configure gpio speed for a dedicated pin on dedicated port. + * @note I/O speed can be Low, Medium, Fast or High speed. + * @note Warning: only one pin can be passed as parameter. + * @note Refer to datasheet for frequency specifications and the power + * supply and load conditions for each speed. + * @rmtoll OSPEEDR OSPEEDy LL_GPIO_SetPinSpeed + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @param Speed This parameter can be one of the following values: + * @arg @ref LL_GPIO_SPEED_FREQ_LOW + * @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM + * @arg @ref LL_GPIO_SPEED_FREQ_HIGH + * @retval None + */ +__STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed) +{ + MODIFY_REG(GPIOx->OSPEEDR, (GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U)), + (Speed << (POSITION_VAL(Pin) * 2U))); +} + +/** + * @brief Return gpio speed for a dedicated pin on dedicated port. + * @note I/O speed can be Low, Medium, Fast or High speed. + * @note Warning: only one pin can be passed as parameter. + * @note Refer to datasheet for frequency specifications and the power + * supply and load conditions for each speed. + * @rmtoll OSPEEDR OSPEEDy LL_GPIO_GetPinSpeed + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @retval Returned value can be one of the following values: + * @arg @ref LL_GPIO_SPEED_FREQ_LOW + * @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM + * @arg @ref LL_GPIO_SPEED_FREQ_HIGH + */ +__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin) +{ + return (uint32_t)(READ_BIT(GPIOx->OSPEEDR, + (GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U)); +} + +/** + * @brief Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port. + * @note Warning: only one pin can be passed as parameter. + * @rmtoll PUPDR PUPDy LL_GPIO_SetPinPull + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @param Pull This parameter can be one of the following values: + * @arg @ref LL_GPIO_PULL_NO + * @arg @ref LL_GPIO_PULL_UP + * @arg @ref LL_GPIO_PULL_DOWN + * @retval None + */ +__STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull) +{ + MODIFY_REG(GPIOx->PUPDR, (GPIO_PUPDR_PUPDR0 << (POSITION_VAL(Pin) * 2U)), (Pull << (POSITION_VAL(Pin) * 2U))); +} + +/** + * @brief Return gpio pull-up or pull-down for a dedicated pin on a dedicated port + * @note Warning: only one pin can be passed as parameter. + * @rmtoll PUPDR PUPDy LL_GPIO_GetPinPull + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @retval Returned value can be one of the following values: + * @arg @ref LL_GPIO_PULL_NO + * @arg @ref LL_GPIO_PULL_UP + * @arg @ref LL_GPIO_PULL_DOWN + */ +__STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin) +{ + return (uint32_t)(READ_BIT(GPIOx->PUPDR, + (GPIO_PUPDR_PUPDR0 << (POSITION_VAL(Pin) * 2U))) >> (POSITION_VAL(Pin) * 2U)); +} + +/** + * @brief Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port. + * @note Possible values are from AF0 to AF15 depending on target. + * @note Warning: only one pin can be passed as parameter. + * @rmtoll AFRL AFSELy LL_GPIO_SetAFPin_0_7 + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @param Alternate This parameter can be one of the following values: + * @arg @ref LL_GPIO_AF_0 + * @arg @ref LL_GPIO_AF_1 + * @arg @ref LL_GPIO_AF_2 + * @arg @ref LL_GPIO_AF_3 + * @arg @ref LL_GPIO_AF_4 + * @arg @ref LL_GPIO_AF_5 + * @arg @ref LL_GPIO_AF_6 + * @arg @ref LL_GPIO_AF_7 + * @arg @ref LL_GPIO_AF_8 + * @arg @ref LL_GPIO_AF_9 + * @arg @ref LL_GPIO_AF_10 + * @arg @ref LL_GPIO_AF_11 + * @arg @ref LL_GPIO_AF_12 + * @arg @ref LL_GPIO_AF_13 + * @arg @ref LL_GPIO_AF_14 + * @arg @ref LL_GPIO_AF_15 + * @retval None + */ +__STATIC_INLINE void LL_GPIO_SetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate) +{ + MODIFY_REG(GPIOx->AFR[0], (GPIO_AFRL_AFRL0 << (POSITION_VAL(Pin) * 4U)), + (Alternate << (POSITION_VAL(Pin) * 4U))); +} + +/** + * @brief Return gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port. + * @rmtoll AFRL AFSELy LL_GPIO_GetAFPin_0_7 + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @retval Returned value can be one of the following values: + * @arg @ref LL_GPIO_AF_0 + * @arg @ref LL_GPIO_AF_1 + * @arg @ref LL_GPIO_AF_2 + * @arg @ref LL_GPIO_AF_3 + * @arg @ref LL_GPIO_AF_4 + * @arg @ref LL_GPIO_AF_5 + * @arg @ref LL_GPIO_AF_6 + * @arg @ref LL_GPIO_AF_7 + * @arg @ref LL_GPIO_AF_8 + * @arg @ref LL_GPIO_AF_9 + * @arg @ref LL_GPIO_AF_10 + * @arg @ref LL_GPIO_AF_11 + * @arg @ref LL_GPIO_AF_12 + * @arg @ref LL_GPIO_AF_13 + * @arg @ref LL_GPIO_AF_14 + * @arg @ref LL_GPIO_AF_15 + */ +__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin) +{ + return (uint32_t)(READ_BIT(GPIOx->AFR[0], + (GPIO_AFRL_AFRL0 << (POSITION_VAL(Pin) * 4U))) >> (POSITION_VAL(Pin) * 4U)); +} + +/** + * @brief Configure gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port. + * @note Possible values are from AF0 to AF15 depending on target. + * @note Warning: only one pin can be passed as parameter. + * @rmtoll AFRH AFSELy LL_GPIO_SetAFPin_8_15 + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @param Alternate This parameter can be one of the following values: + * @arg @ref LL_GPIO_AF_0 + * @arg @ref LL_GPIO_AF_1 + * @arg @ref LL_GPIO_AF_2 + * @arg @ref LL_GPIO_AF_3 + * @arg @ref LL_GPIO_AF_4 + * @arg @ref LL_GPIO_AF_5 + * @arg @ref LL_GPIO_AF_6 + * @arg @ref LL_GPIO_AF_7 + * @arg @ref LL_GPIO_AF_8 + * @arg @ref LL_GPIO_AF_9 + * @arg @ref LL_GPIO_AF_10 + * @arg @ref LL_GPIO_AF_11 + * @arg @ref LL_GPIO_AF_12 + * @arg @ref LL_GPIO_AF_13 + * @arg @ref LL_GPIO_AF_14 + * @arg @ref LL_GPIO_AF_15 + * @retval None + */ +__STATIC_INLINE void LL_GPIO_SetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate) +{ + MODIFY_REG(GPIOx->AFR[1], (GPIO_AFRH_AFRH0 << (POSITION_VAL(Pin >> 8U) * 4U)), + (Alternate << (POSITION_VAL(Pin >> 8U) * 4U))); +} + +/** + * @brief Return gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port. + * @note Possible values are from AF0 to AF15 depending on target. + * @rmtoll AFRH AFSELy LL_GPIO_GetAFPin_8_15 + * @param GPIOx GPIO Port + * @param Pin This parameter can be one of the following values: + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @retval Returned value can be one of the following values: + * @arg @ref LL_GPIO_AF_0 + * @arg @ref LL_GPIO_AF_1 + * @arg @ref LL_GPIO_AF_2 + * @arg @ref LL_GPIO_AF_3 + * @arg @ref LL_GPIO_AF_4 + * @arg @ref LL_GPIO_AF_5 + * @arg @ref LL_GPIO_AF_6 + * @arg @ref LL_GPIO_AF_7 + * @arg @ref LL_GPIO_AF_8 + * @arg @ref LL_GPIO_AF_9 + * @arg @ref LL_GPIO_AF_10 + * @arg @ref LL_GPIO_AF_11 + * @arg @ref LL_GPIO_AF_12 + * @arg @ref LL_GPIO_AF_13 + * @arg @ref LL_GPIO_AF_14 + * @arg @ref LL_GPIO_AF_15 + */ +__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin) +{ + return (uint32_t)(READ_BIT(GPIOx->AFR[1], + (GPIO_AFRH_AFRH0 << (POSITION_VAL(Pin >> 8U) * 4U))) >> (POSITION_VAL(Pin >> 8U) * 4U)); +} + + +/** + * @brief Lock configuration of several pins for a dedicated port. + * @note When the lock sequence has been applied on a port bit, the + * value of this port bit can no longer be modified until the + * next reset. + * @note Each lock bit freezes a specific configuration register + * (control and alternate function registers). + * @rmtoll LCKR LCKK LL_GPIO_LockPin + * @param GPIOx GPIO Port + * @param PinMask This parameter can be a combination of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @retval None + */ +__STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask) +{ + __IO uint32_t temp; + WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask); + WRITE_REG(GPIOx->LCKR, PinMask); + WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask); + temp = READ_REG(GPIOx->LCKR); + (void) temp; +} + +/** + * @brief Return 1 if all pins passed as parameter, of a dedicated port, are locked. else Return 0. + * @rmtoll LCKR LCKy LL_GPIO_IsPinLocked + * @param GPIOx GPIO Port + * @param PinMask This parameter can be a combination of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked(GPIO_TypeDef *GPIOx, uint32_t PinMask) +{ + return (READ_BIT(GPIOx->LCKR, PinMask) == (PinMask)); +} + +/** + * @brief Return 1 if one of the pin of a dedicated port is locked. else return 0. + * @rmtoll LCKR LCKK LL_GPIO_IsAnyPinLocked + * @param GPIOx GPIO Port + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked(GPIO_TypeDef *GPIOx) +{ + return (READ_BIT(GPIOx->LCKR, GPIO_LCKR_LCKK) == (GPIO_LCKR_LCKK)); +} + +/** + * @} + */ + +/** @defgroup GPIO_LL_EF_Data_Access Data Access + * @{ + */ + +/** + * @brief Return full input data register value for a dedicated port. + * @rmtoll IDR IDy LL_GPIO_ReadInputPort + * @param GPIOx GPIO Port + * @retval Input data register value of port + */ +__STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx) +{ + return (uint32_t)(READ_REG(GPIOx->IDR)); +} + +/** + * @brief Return if input data level for several pins of dedicated port is high or low. + * @rmtoll IDR IDy LL_GPIO_IsInputPinSet + * @param GPIOx GPIO Port + * @param PinMask This parameter can be a combination of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask) +{ + return (READ_BIT(GPIOx->IDR, PinMask) == (PinMask)); +} + +/** + * @brief Write output data register for the port. + * @rmtoll ODR ODy LL_GPIO_WriteOutputPort + * @param GPIOx GPIO Port + * @param PortValue Level value for each pin of the port + * @retval None + */ +__STATIC_INLINE void LL_GPIO_WriteOutputPort(GPIO_TypeDef *GPIOx, uint32_t PortValue) +{ + WRITE_REG(GPIOx->ODR, PortValue); +} + +/** + * @brief Return full output data register value for a dedicated port. + * @rmtoll ODR ODy LL_GPIO_ReadOutputPort + * @param GPIOx GPIO Port + * @retval Output data register value of port + */ +__STATIC_INLINE uint32_t LL_GPIO_ReadOutputPort(GPIO_TypeDef *GPIOx) +{ + return (uint32_t)(READ_REG(GPIOx->ODR)); +} + +/** + * @brief Return if input data level for several pins of dedicated port is high or low. + * @rmtoll ODR ODy LL_GPIO_IsOutputPinSet + * @param GPIOx GPIO Port + * @param PinMask This parameter can be a combination of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask) +{ + return (READ_BIT(GPIOx->ODR, PinMask) == (PinMask)); +} + +/** + * @brief Set several pins to high level on dedicated gpio port. + * @rmtoll BSRR BSy LL_GPIO_SetOutputPin + * @param GPIOx GPIO Port + * @param PinMask This parameter can be a combination of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @retval None + */ +__STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask) +{ + WRITE_REG(GPIOx->BSRR, PinMask); +} + +/** + * @brief Set several pins to low level on dedicated gpio port. + * @rmtoll BRR BRy LL_GPIO_ResetOutputPin + * @param GPIOx GPIO Port + * @param PinMask This parameter can be a combination of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @retval None + */ +__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask) +{ + WRITE_REG(GPIOx->BRR, PinMask); +} + +/** + * @brief Toggle data value for several pin of dedicated port. + * @rmtoll ODR ODy LL_GPIO_TogglePin + * @param GPIOx GPIO Port + * @param PinMask This parameter can be a combination of the following values: + * @arg @ref LL_GPIO_PIN_0 + * @arg @ref LL_GPIO_PIN_1 + * @arg @ref LL_GPIO_PIN_2 + * @arg @ref LL_GPIO_PIN_3 + * @arg @ref LL_GPIO_PIN_4 + * @arg @ref LL_GPIO_PIN_5 + * @arg @ref LL_GPIO_PIN_6 + * @arg @ref LL_GPIO_PIN_7 + * @arg @ref LL_GPIO_PIN_8 + * @arg @ref LL_GPIO_PIN_9 + * @arg @ref LL_GPIO_PIN_10 + * @arg @ref LL_GPIO_PIN_11 + * @arg @ref LL_GPIO_PIN_12 + * @arg @ref LL_GPIO_PIN_13 + * @arg @ref LL_GPIO_PIN_14 + * @arg @ref LL_GPIO_PIN_15 + * @arg @ref LL_GPIO_PIN_ALL + * @retval None + */ +__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask) +{ + uint32_t odr = READ_REG(GPIOx->ODR); + WRITE_REG(GPIOx->BSRR, ((odr & PinMask) << 16u) | (~odr & PinMask)); +} + +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup GPIO_LL_EF_Init Initialization and de-initialization functions + * @{ + */ + +ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx); +ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct); +void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct); + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH) */ +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_GPIO_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_pwr.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_pwr.h new file mode 100644 index 0000000..cb6d23f --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_pwr.h @@ -0,0 +1,551 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_pwr.h + * @author MCD Application Team + * @brief Header file of PWR LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_PWR_H +#define __STM32F3xx_LL_PWR_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined(PWR) + +/** @defgroup PWR_LL PWR + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup PWR_LL_Exported_Constants PWR Exported Constants + * @{ + */ + +/** @defgroup PWR_LL_EC_CLEAR_FLAG Clear Flags Defines + * @brief Flags defines which can be used with LL_PWR_WriteReg function + * @{ + */ +#define LL_PWR_CR_CSBF PWR_CR_CSBF /*!< Clear standby flag */ +#define LL_PWR_CR_CWUF PWR_CR_CWUF /*!< Clear wakeup flag */ +/** + * @} + */ + +/** @defgroup PWR_LL_EC_GET_FLAG Get Flags Defines + * @brief Flags defines which can be used with LL_PWR_ReadReg function + * @{ + */ +#define LL_PWR_CSR_WUF PWR_CSR_WUF /*!< Wakeup flag */ +#define LL_PWR_CSR_SBF PWR_CSR_SBF /*!< Standby flag */ +#if defined(PWR_PVD_SUPPORT) +#define LL_PWR_CSR_PVDO PWR_CSR_PVDO /*!< Power voltage detector output flag */ +#endif /* PWR_PVD_SUPPORT */ +#if defined(PWR_CSR_VREFINTRDYF) +#define LL_PWR_CSR_VREFINTRDYF PWR_CSR_VREFINTRDYF /*!< VREFINT ready flag */ +#endif /* PWR_CSR_VREFINTRDYF */ +#define LL_PWR_CSR_EWUP1 PWR_CSR_EWUP1 /*!< Enable WKUP pin 1 */ +#define LL_PWR_CSR_EWUP2 PWR_CSR_EWUP2 /*!< Enable WKUP pin 2 */ +#if defined(PWR_CSR_EWUP3) +#define LL_PWR_CSR_EWUP3 PWR_CSR_EWUP3 /*!< Enable WKUP pin 3 */ +#endif /* PWR_CSR_EWUP3 */ +/** + * @} + */ + + +/** @defgroup PWR_LL_EC_MODE_PWR Mode Power + * @{ + */ +#define LL_PWR_MODE_STOP_MAINREGU 0x00000000U /*!< Enter Stop mode when the CPU enters deepsleep */ +#define LL_PWR_MODE_STOP_LPREGU (PWR_CR_LPDS) /*!< Enter Stop mode (with low power Regulator ON) when the CPU enters deepsleep */ +#define LL_PWR_MODE_STANDBY (PWR_CR_PDDS) /*!< Enter Standby mode when the CPU enters deepsleep */ +/** + * @} + */ + +#if defined(PWR_CR_LPDS) +/** @defgroup PWR_LL_EC_REGU_MODE_DS_MODE Regulator Mode In Deep Sleep Mode + * @{ + */ +#define LL_PWR_REGU_DSMODE_MAIN 0x00000000U /*!< Voltage Regulator in main mode during deepsleep mode */ +#define LL_PWR_REGU_DSMODE_LOW_POWER (PWR_CR_LPDS) /*!< Voltage Regulator in low-power mode during deepsleep mode */ +/** + * @} + */ +#endif /* PWR_CR_LPDS */ + +#if defined(PWR_PVD_SUPPORT) +/** @defgroup PWR_LL_EC_PVDLEVEL Power Voltage Detector Level + * @{ + */ +#define LL_PWR_PVDLEVEL_0 (PWR_CR_PLS_LEV0) /*!< Voltage threshold detected by PVD 2.2 V */ +#define LL_PWR_PVDLEVEL_1 (PWR_CR_PLS_LEV1) /*!< Voltage threshold detected by PVD 2.3 V */ +#define LL_PWR_PVDLEVEL_2 (PWR_CR_PLS_LEV2) /*!< Voltage threshold detected by PVD 2.4 V */ +#define LL_PWR_PVDLEVEL_3 (PWR_CR_PLS_LEV3) /*!< Voltage threshold detected by PVD 2.5 V */ +#define LL_PWR_PVDLEVEL_4 (PWR_CR_PLS_LEV4) /*!< Voltage threshold detected by PVD 2.6 V */ +#define LL_PWR_PVDLEVEL_5 (PWR_CR_PLS_LEV5) /*!< Voltage threshold detected by PVD 2.7 V */ +#define LL_PWR_PVDLEVEL_6 (PWR_CR_PLS_LEV6) /*!< Voltage threshold detected by PVD 2.8 V */ +#define LL_PWR_PVDLEVEL_7 (PWR_CR_PLS_LEV7) /*!< Voltage threshold detected by PVD 2.9 V */ +/** + * @} + */ +#endif /* PWR_PVD_SUPPORT */ +/** @defgroup PWR_LL_EC_WAKEUP_PIN Wakeup Pins + * @{ + */ +#define LL_PWR_WAKEUP_PIN1 (PWR_CSR_EWUP1) /*!< WKUP pin 1 : PA0 */ +#define LL_PWR_WAKEUP_PIN2 (PWR_CSR_EWUP2) /*!< WKUP pin 2 : PC13 */ +#if defined(PWR_CSR_EWUP3) +#define LL_PWR_WAKEUP_PIN3 (PWR_CSR_EWUP3) /*!< WKUP pin 3 : PE6 or PA2 according to device */ +#endif /* PWR_CSR_EWUP3 */ +/** + * @} + */ + +/** @defgroup PWR_LL_EC_SDADC_ANALOG_X SDADC Analogx + * @{ + */ +#if defined(SDADC1) +#define LL_PWR_SDADC_ANALOG1 (PWR_CR_ENSD1) /*!< Enable SDADC1 */ +#endif /* SDADC1 */ +#if defined(SDADC2) +#define LL_PWR_SDADC_ANALOG2 (PWR_CR_ENSD2) /*!< Enable SDADC2 */ +#endif /* SDADC2 */ +#if defined(SDADC3) +#define LL_PWR_SDADC_ANALOG3 (PWR_CR_ENSD3) /*!< Enable SDADC3 */ +#endif /* SDADC3 */ +/** + * @} + */ +/** + * @} + */ + + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup PWR_LL_Exported_Macros PWR Exported Macros + * @{ + */ + +/** @defgroup PWR_LL_EM_WRITE_READ Common write and read registers Macros + * @{ + */ + +/** + * @brief Write a value in PWR register + * @param __REG__ Register to be written + * @param __VALUE__ Value to be written in the register + * @retval None + */ +#define LL_PWR_WriteReg(__REG__, __VALUE__) WRITE_REG(PWR->__REG__, (__VALUE__)) + +/** + * @brief Read a value in PWR register + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_PWR_ReadReg(__REG__) READ_REG(PWR->__REG__) +/** + * @} + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup PWR_LL_Exported_Functions PWR Exported Functions + * @{ + */ + +/** @defgroup PWR_LL_EF_Configuration Configuration + * @{ + */ +/** + * @brief Enables the SDADC peripheral functionality + * @rmtoll CR ENSD1 LL_PWR_EnableSDADC\n + * CR ENSD2 LL_PWR_EnableSDADC\n + * CR ENSD3 LL_PWR_EnableSDADC + * @param Analogx This parameter can be a combination of the following values: + * @arg @ref LL_PWR_SDADC_ANALOG1 + * @arg @ref LL_PWR_SDADC_ANALOG2 + * @arg @ref LL_PWR_SDADC_ANALOG3 + * @retval None + */ +__STATIC_INLINE void LL_PWR_EnableSDADC(uint32_t Analogx) +{ + SET_BIT(PWR->CR, Analogx); +} + +/** + * @brief Disables the SDADC peripheral functionality + * @rmtoll CR ENSD1 LL_PWR_EnableSDADC\n + * CR ENSD2 LL_PWR_EnableSDADC\n + * CR ENSD3 LL_PWR_EnableSDADC + * @param Analogx This parameter can be a combination of the following values: + * @arg @ref LL_PWR_SDADC_ANALOG1 + * @arg @ref LL_PWR_SDADC_ANALOG2 + * @arg @ref LL_PWR_SDADC_ANALOG3 + * @retval None + */ +__STATIC_INLINE void LL_PWR_DisableSDADC(uint32_t Analogx) +{ + CLEAR_BIT(PWR->CR, Analogx); +} + +/** + * @brief Check if SDADCx has been enabled or not + * @rmtoll CR ENSD1 LL_PWR_IsEnabledSDADC\n + * CR ENSD2 LL_PWR_IsEnabledSDADC\n + * CR ENSD3 LL_PWR_IsEnabledSDADC + * @param Analogx This parameter can be a combination of the following values: + * @arg @ref LL_PWR_SDADC_ANALOG1 + * @arg @ref LL_PWR_SDADC_ANALOG2 + * @arg @ref LL_PWR_SDADC_ANALOG3 + * @retval None + */ +__STATIC_INLINE uint32_t LL_PWR_IsEnabledSDADC(uint32_t Analogx) +{ + return (READ_BIT(PWR->CR, Analogx) == (Analogx)); +} + +/** + * @brief Enable access to the backup domain + * @rmtoll CR DBP LL_PWR_EnableBkUpAccess + * @retval None + */ +__STATIC_INLINE void LL_PWR_EnableBkUpAccess(void) +{ + SET_BIT(PWR->CR, PWR_CR_DBP); +} + +/** + * @brief Disable access to the backup domain + * @rmtoll CR DBP LL_PWR_DisableBkUpAccess + * @retval None + */ +__STATIC_INLINE void LL_PWR_DisableBkUpAccess(void) +{ + CLEAR_BIT(PWR->CR, PWR_CR_DBP); +} + +/** + * @brief Check if the backup domain is enabled + * @rmtoll CR DBP LL_PWR_IsEnabledBkUpAccess + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_PWR_IsEnabledBkUpAccess(void) +{ + return (READ_BIT(PWR->CR, PWR_CR_DBP) == (PWR_CR_DBP)); +} + +#if defined(PWR_CR_LPDS) +/** + * @brief Set voltage Regulator mode during deep sleep mode + * @rmtoll CR LPDS LL_PWR_SetRegulModeDS + * @param RegulMode This parameter can be one of the following values: + * @arg @ref LL_PWR_REGU_DSMODE_MAIN + * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER + * @retval None + */ +__STATIC_INLINE void LL_PWR_SetRegulModeDS(uint32_t RegulMode) +{ + MODIFY_REG(PWR->CR, PWR_CR_LPDS, RegulMode); +} + +/** + * @brief Get voltage Regulator mode during deep sleep mode + * @rmtoll CR LPDS LL_PWR_GetRegulModeDS + * @retval Returned value can be one of the following values: + * @arg @ref LL_PWR_REGU_DSMODE_MAIN + * @arg @ref LL_PWR_REGU_DSMODE_LOW_POWER + */ +__STATIC_INLINE uint32_t LL_PWR_GetRegulModeDS(void) +{ + return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_LPDS)); +} +#endif /* PWR_CR_LPDS */ + +/** + * @brief Set Power Down mode when CPU enters deepsleep + * @rmtoll CR PDDS LL_PWR_SetPowerMode\n + * @rmtoll CR LPDS LL_PWR_SetPowerMode + * @param PDMode This parameter can be one of the following values: + * @arg @ref LL_PWR_MODE_STOP_MAINREGU + * @arg @ref LL_PWR_MODE_STOP_LPREGU + * @arg @ref LL_PWR_MODE_STANDBY + * @retval None + */ +__STATIC_INLINE void LL_PWR_SetPowerMode(uint32_t PDMode) +{ + MODIFY_REG(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS), PDMode); +} + +/** + * @brief Get Power Down mode when CPU enters deepsleep + * @rmtoll CR PDDS LL_PWR_GetPowerMode\n + * @rmtoll CR LPDS LL_PWR_GetPowerMode + * @retval Returned value can be one of the following values: + * @arg @ref LL_PWR_MODE_STOP_MAINREGU + * @arg @ref LL_PWR_MODE_STOP_LPREGU + * @arg @ref LL_PWR_MODE_STANDBY + */ +__STATIC_INLINE uint32_t LL_PWR_GetPowerMode(void) +{ + return (uint32_t)(READ_BIT(PWR->CR, (PWR_CR_PDDS| PWR_CR_LPDS))); +} + +#if defined(PWR_PVD_SUPPORT) +/** + * @brief Configure the voltage threshold detected by the Power Voltage Detector + * @rmtoll CR PLS LL_PWR_SetPVDLevel + * @param PVDLevel This parameter can be one of the following values: + * @arg @ref LL_PWR_PVDLEVEL_0 + * @arg @ref LL_PWR_PVDLEVEL_1 + * @arg @ref LL_PWR_PVDLEVEL_2 + * @arg @ref LL_PWR_PVDLEVEL_3 + * @arg @ref LL_PWR_PVDLEVEL_4 + * @arg @ref LL_PWR_PVDLEVEL_5 + * @arg @ref LL_PWR_PVDLEVEL_6 + * @arg @ref LL_PWR_PVDLEVEL_7 + * @retval None + */ +__STATIC_INLINE void LL_PWR_SetPVDLevel(uint32_t PVDLevel) +{ + MODIFY_REG(PWR->CR, PWR_CR_PLS, PVDLevel); +} + +/** + * @brief Get the voltage threshold detection + * @rmtoll CR PLS LL_PWR_GetPVDLevel + * @retval Returned value can be one of the following values: + * @arg @ref LL_PWR_PVDLEVEL_0 + * @arg @ref LL_PWR_PVDLEVEL_1 + * @arg @ref LL_PWR_PVDLEVEL_2 + * @arg @ref LL_PWR_PVDLEVEL_3 + * @arg @ref LL_PWR_PVDLEVEL_4 + * @arg @ref LL_PWR_PVDLEVEL_5 + * @arg @ref LL_PWR_PVDLEVEL_6 + * @arg @ref LL_PWR_PVDLEVEL_7 + */ +__STATIC_INLINE uint32_t LL_PWR_GetPVDLevel(void) +{ + return (uint32_t)(READ_BIT(PWR->CR, PWR_CR_PLS)); +} + +/** + * @brief Enable Power Voltage Detector + * @rmtoll CR PVDE LL_PWR_EnablePVD + * @retval None + */ +__STATIC_INLINE void LL_PWR_EnablePVD(void) +{ + SET_BIT(PWR->CR, PWR_CR_PVDE); +} + +/** + * @brief Disable Power Voltage Detector + * @rmtoll CR PVDE LL_PWR_DisablePVD + * @retval None + */ +__STATIC_INLINE void LL_PWR_DisablePVD(void) +{ + CLEAR_BIT(PWR->CR, PWR_CR_PVDE); +} + +/** + * @brief Check if Power Voltage Detector is enabled + * @rmtoll CR PVDE LL_PWR_IsEnabledPVD + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_PWR_IsEnabledPVD(void) +{ + return (READ_BIT(PWR->CR, PWR_CR_PVDE) == (PWR_CR_PVDE)); +} +#endif /* PWR_PVD_SUPPORT */ + +/** + * @brief Enable the WakeUp PINx functionality + * @rmtoll CSR EWUP1 LL_PWR_EnableWakeUpPin\n + * @rmtoll CSR EWUP2 LL_PWR_EnableWakeUpPin\n + * @rmtoll CSR EWUP3 LL_PWR_EnableWakeUpPin + * @param WakeUpPin This parameter can be one of the following values: + * @arg @ref LL_PWR_WAKEUP_PIN1 + * @arg @ref LL_PWR_WAKEUP_PIN2 + * @arg @ref LL_PWR_WAKEUP_PIN3 (*) + * + * (*) not available on all devices + * @retval None + */ +__STATIC_INLINE void LL_PWR_EnableWakeUpPin(uint32_t WakeUpPin) +{ + SET_BIT(PWR->CSR, WakeUpPin); +} + +/** + * @brief Disable the WakeUp PINx functionality + * @rmtoll CSR EWUP1 LL_PWR_DisableWakeUpPin\n + * @rmtoll CSR EWUP2 LL_PWR_DisableWakeUpPin\n + * @rmtoll CSR EWUP3 LL_PWR_DisableWakeUpPin + * @param WakeUpPin This parameter can be one of the following values: + * @arg @ref LL_PWR_WAKEUP_PIN1 + * @arg @ref LL_PWR_WAKEUP_PIN2 + * @arg @ref LL_PWR_WAKEUP_PIN3 (*) + * + * (*) not available on all devices + * @retval None + */ +__STATIC_INLINE void LL_PWR_DisableWakeUpPin(uint32_t WakeUpPin) +{ + CLEAR_BIT(PWR->CSR, WakeUpPin); +} + +/** + * @brief Check if the WakeUp PINx functionality is enabled + * @rmtoll CSR EWUP1 LL_PWR_IsEnabledWakeUpPin\n + * @rmtoll CSR EWUP2 LL_PWR_IsEnabledWakeUpPin\n + * @rmtoll CSR EWUP3 LL_PWR_IsEnabledWakeUpPin + * @param WakeUpPin This parameter can be one of the following values: + * @arg @ref LL_PWR_WAKEUP_PIN1 + * @arg @ref LL_PWR_WAKEUP_PIN2 + * @arg @ref LL_PWR_WAKEUP_PIN3 (*) + * + * (*) not available on all devices + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_PWR_IsEnabledWakeUpPin(uint32_t WakeUpPin) +{ + return (READ_BIT(PWR->CSR, WakeUpPin) == (WakeUpPin)); +} + + +/** + * @} + */ + +/** @defgroup PWR_LL_EF_FLAG_Management FLAG_Management + * @{ + */ + +/** + * @brief Get Wake-up Flag + * @rmtoll CSR WUF LL_PWR_IsActiveFlag_WU + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_WU(void) +{ + return (READ_BIT(PWR->CSR, PWR_CSR_WUF) == (PWR_CSR_WUF)); +} + +/** + * @brief Get Standby Flag + * @rmtoll CSR SBF LL_PWR_IsActiveFlag_SB + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_SB(void) +{ + return (READ_BIT(PWR->CSR, PWR_CSR_SBF) == (PWR_CSR_SBF)); +} + +#if defined(PWR_PVD_SUPPORT) +/** + * @brief Indicate whether VDD voltage is below the selected PVD threshold + * @rmtoll CSR PVDO LL_PWR_IsActiveFlag_PVDO + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_PVDO(void) +{ + return (READ_BIT(PWR->CSR, PWR_CSR_PVDO) == (PWR_CSR_PVDO)); +} +#endif /* PWR_PVD_SUPPORT */ + +#if defined(PWR_CSR_VREFINTRDYF) +/** + * @brief Get Internal Reference VrefInt Flag + * @rmtoll CSR VREFINTRDYF LL_PWR_IsActiveFlag_VREFINTRDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_PWR_IsActiveFlag_VREFINTRDY(void) +{ + return (READ_BIT(PWR->CSR, PWR_CSR_VREFINTRDYF) == (PWR_CSR_VREFINTRDYF)); +} +#endif /* PWR_CSR_VREFINTRDYF */ +/** + * @brief Clear Standby Flag + * @rmtoll CR CSBF LL_PWR_ClearFlag_SB + * @retval None + */ +__STATIC_INLINE void LL_PWR_ClearFlag_SB(void) +{ + SET_BIT(PWR->CR, PWR_CR_CSBF); +} + +/** + * @brief Clear Wake-up Flags + * @rmtoll CR CWUF LL_PWR_ClearFlag_WU + * @retval None + */ +__STATIC_INLINE void LL_PWR_ClearFlag_WU(void) +{ + SET_BIT(PWR->CR, PWR_CR_CWUF); +} + +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup PWR_LL_EF_Init De-initialization function + * @{ + */ +ErrorStatus LL_PWR_DeInit(void); +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* defined(PWR) */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_PWR_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_rcc.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_rcc.h new file mode 100644 index 0000000..4fbff15 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_rcc.h @@ -0,0 +1,2839 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_rcc.h + * @author MCD Application Team + * @brief Header file of RCC LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_RCC_H +#define __STM32F3xx_LL_RCC_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined(RCC) + +/** @defgroup RCC_LL RCC + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private constants ---------------------------------------------------------*/ +/** @defgroup RCC_LL_Private_Constants RCC Private Constants + * @{ + */ +/* Defines used for the bit position in the register and perform offsets*/ +#define RCC_POSITION_HPRE (uint32_t)POSITION_VAL(RCC_CFGR_HPRE) /*!< field position in register RCC_CFGR */ +#define RCC_POSITION_PPRE1 (uint32_t)POSITION_VAL(RCC_CFGR_PPRE1) /*!< field position in register RCC_CFGR */ +#define RCC_POSITION_PPRE2 (uint32_t)POSITION_VAL(RCC_CFGR_PPRE2) /*!< field position in register RCC_CFGR */ +#define RCC_POSITION_HSICAL (uint32_t)POSITION_VAL(RCC_CR_HSICAL) /*!< field position in register RCC_CR */ +#define RCC_POSITION_HSITRIM (uint32_t)POSITION_VAL(RCC_CR_HSITRIM) /*!< field position in register RCC_CR */ +#define RCC_POSITION_PLLMUL (uint32_t)POSITION_VAL(RCC_CFGR_PLLMUL) /*!< field position in register RCC_CFGR */ +#define RCC_POSITION_USART1SW (uint32_t)0U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_USART2SW (uint32_t)16U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_USART3SW (uint32_t)18U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_TIM1SW (uint32_t)8U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_TIM8SW (uint32_t)9U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_TIM15SW (uint32_t)10U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_TIM16SW (uint32_t)11U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_TIM17SW (uint32_t)13U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_TIM20SW (uint32_t)15U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_TIM2SW (uint32_t)24U /*!< field position in register RCC_CFGR3 */ +#define RCC_POSITION_TIM34SW (uint32_t)25U /*!< field position in register RCC_CFGR3 */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup RCC_LL_Private_Macros RCC Private Macros + * @{ + */ +/** + * @} + */ +#endif /*USE_FULL_LL_DRIVER*/ +/* Exported types ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup RCC_LL_Exported_Types RCC Exported Types + * @{ + */ + +/** @defgroup LL_ES_CLOCK_FREQ Clocks Frequency Structure + * @{ + */ + +/** + * @brief RCC Clocks Frequency Structure + */ +typedef struct +{ + uint32_t SYSCLK_Frequency; /*!< SYSCLK clock frequency */ + uint32_t HCLK_Frequency; /*!< HCLK clock frequency */ + uint32_t PCLK1_Frequency; /*!< PCLK1 clock frequency */ + uint32_t PCLK2_Frequency; /*!< PCLK2 clock frequency */ +} LL_RCC_ClocksTypeDef; + +/** + * @} + */ + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup RCC_LL_Exported_Constants RCC Exported Constants + * @{ + */ + +/** @defgroup RCC_LL_EC_OSC_VALUES Oscillator Values adaptation + * @brief Defines used to adapt values of different oscillators + * @note These values could be modified in the user environment according to + * HW set-up. + * @{ + */ +#if !defined (HSE_VALUE) +#define HSE_VALUE 8000000U /*!< Value of the HSE oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSI_VALUE) +#define HSI_VALUE 8000000U /*!< Value of the HSI oscillator in Hz */ +#endif /* HSI_VALUE */ + +#if !defined (LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the LSE oscillator in Hz */ +#endif /* LSE_VALUE */ + +#if !defined (LSI_VALUE) +#define LSI_VALUE 40000U /*!< Value of the LSI oscillator in Hz */ +#endif /* LSI_VALUE */ + +#if !defined (EXTERNAL_CLOCK_VALUE) +#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the I2S_CKIN external oscillator in Hz */ +#endif /* EXTERNAL_CLOCK_VALUE */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_CLEAR_FLAG Clear Flags Defines + * @brief Flags defines which can be used with LL_RCC_WriteReg function + * @{ + */ +#define LL_RCC_CIR_LSIRDYC RCC_CIR_LSIRDYC /*!< LSI Ready Interrupt Clear */ +#define LL_RCC_CIR_LSERDYC RCC_CIR_LSERDYC /*!< LSE Ready Interrupt Clear */ +#define LL_RCC_CIR_HSIRDYC RCC_CIR_HSIRDYC /*!< HSI Ready Interrupt Clear */ +#define LL_RCC_CIR_HSERDYC RCC_CIR_HSERDYC /*!< HSE Ready Interrupt Clear */ +#define LL_RCC_CIR_PLLRDYC RCC_CIR_PLLRDYC /*!< PLL Ready Interrupt Clear */ +#define LL_RCC_CIR_CSSC RCC_CIR_CSSC /*!< Clock Security System Interrupt Clear */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_GET_FLAG Get Flags Defines + * @brief Flags defines which can be used with LL_RCC_ReadReg function + * @{ + */ +#define LL_RCC_CIR_LSIRDYF RCC_CIR_LSIRDYF /*!< LSI Ready Interrupt flag */ +#define LL_RCC_CIR_LSERDYF RCC_CIR_LSERDYF /*!< LSE Ready Interrupt flag */ +#define LL_RCC_CIR_HSIRDYF RCC_CIR_HSIRDYF /*!< HSI Ready Interrupt flag */ +#define LL_RCC_CIR_HSERDYF RCC_CIR_HSERDYF /*!< HSE Ready Interrupt flag */ +#define LL_RCC_CFGR_MCOF RCC_CFGR_MCOF /*!< MCO flag */ +#define LL_RCC_CIR_PLLRDYF RCC_CIR_PLLRDYF /*!< PLL Ready Interrupt flag */ +#define LL_RCC_CIR_CSSF RCC_CIR_CSSF /*!< Clock Security System Interrupt flag */ +#define LL_RCC_CSR_OBLRSTF RCC_CSR_OBLRSTF /*!< OBL reset flag */ +#define LL_RCC_CSR_PINRSTF RCC_CSR_PINRSTF /*!< PIN reset flag */ +#define LL_RCC_CSR_PORRSTF RCC_CSR_PORRSTF /*!< POR/PDR reset flag */ +#define LL_RCC_CSR_SFTRSTF RCC_CSR_SFTRSTF /*!< Software Reset flag */ +#define LL_RCC_CSR_IWDGRSTF RCC_CSR_IWDGRSTF /*!< Independent Watchdog reset flag */ +#define LL_RCC_CSR_WWDGRSTF RCC_CSR_WWDGRSTF /*!< Window watchdog reset flag */ +#define LL_RCC_CSR_LPWRRSTF RCC_CSR_LPWRRSTF /*!< Low-Power reset flag */ +#if defined(RCC_CSR_V18PWRRSTF) +#define LL_RCC_CSR_V18PWRRSTF RCC_CSR_V18PWRRSTF /*!< Reset flag of the 1.8 V domain. */ +#endif /* RCC_CSR_V18PWRRSTF */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_IT IT Defines + * @brief IT defines which can be used with LL_RCC_ReadReg and LL_RCC_WriteReg functions + * @{ + */ +#define LL_RCC_CIR_LSIRDYIE RCC_CIR_LSIRDYIE /*!< LSI Ready Interrupt Enable */ +#define LL_RCC_CIR_LSERDYIE RCC_CIR_LSERDYIE /*!< LSE Ready Interrupt Enable */ +#define LL_RCC_CIR_HSIRDYIE RCC_CIR_HSIRDYIE /*!< HSI Ready Interrupt Enable */ +#define LL_RCC_CIR_HSERDYIE RCC_CIR_HSERDYIE /*!< HSE Ready Interrupt Enable */ +#define LL_RCC_CIR_PLLRDYIE RCC_CIR_PLLRDYIE /*!< PLL Ready Interrupt Enable */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_LSEDRIVE LSE oscillator drive capability + * @{ + */ +#define LL_RCC_LSEDRIVE_LOW ((uint32_t)0x00000000U) /*!< Xtal mode lower driving capability */ +#define LL_RCC_LSEDRIVE_MEDIUMLOW RCC_BDCR_LSEDRV_1 /*!< Xtal mode medium low driving capability */ +#define LL_RCC_LSEDRIVE_MEDIUMHIGH RCC_BDCR_LSEDRV_0 /*!< Xtal mode medium high driving capability */ +#define LL_RCC_LSEDRIVE_HIGH RCC_BDCR_LSEDRV /*!< Xtal mode higher driving capability */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_SYS_CLKSOURCE System clock switch + * @{ + */ +#define LL_RCC_SYS_CLKSOURCE_HSI RCC_CFGR_SW_HSI /*!< HSI selection as system clock */ +#define LL_RCC_SYS_CLKSOURCE_HSE RCC_CFGR_SW_HSE /*!< HSE selection as system clock */ +#define LL_RCC_SYS_CLKSOURCE_PLL RCC_CFGR_SW_PLL /*!< PLL selection as system clock */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_SYS_CLKSOURCE_STATUS System clock switch status + * @{ + */ +#define LL_RCC_SYS_CLKSOURCE_STATUS_HSI RCC_CFGR_SWS_HSI /*!< HSI used as system clock */ +#define LL_RCC_SYS_CLKSOURCE_STATUS_HSE RCC_CFGR_SWS_HSE /*!< HSE used as system clock */ +#define LL_RCC_SYS_CLKSOURCE_STATUS_PLL RCC_CFGR_SWS_PLL /*!< PLL used as system clock */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_SYSCLK_DIV AHB prescaler + * @{ + */ +#define LL_RCC_SYSCLK_DIV_1 RCC_CFGR_HPRE_DIV1 /*!< SYSCLK not divided */ +#define LL_RCC_SYSCLK_DIV_2 RCC_CFGR_HPRE_DIV2 /*!< SYSCLK divided by 2 */ +#define LL_RCC_SYSCLK_DIV_4 RCC_CFGR_HPRE_DIV4 /*!< SYSCLK divided by 4 */ +#define LL_RCC_SYSCLK_DIV_8 RCC_CFGR_HPRE_DIV8 /*!< SYSCLK divided by 8 */ +#define LL_RCC_SYSCLK_DIV_16 RCC_CFGR_HPRE_DIV16 /*!< SYSCLK divided by 16 */ +#define LL_RCC_SYSCLK_DIV_64 RCC_CFGR_HPRE_DIV64 /*!< SYSCLK divided by 64 */ +#define LL_RCC_SYSCLK_DIV_128 RCC_CFGR_HPRE_DIV128 /*!< SYSCLK divided by 128 */ +#define LL_RCC_SYSCLK_DIV_256 RCC_CFGR_HPRE_DIV256 /*!< SYSCLK divided by 256 */ +#define LL_RCC_SYSCLK_DIV_512 RCC_CFGR_HPRE_DIV512 /*!< SYSCLK divided by 512 */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_APB1_DIV APB low-speed prescaler (APB1) + * @{ + */ +#define LL_RCC_APB1_DIV_1 RCC_CFGR_PPRE1_DIV1 /*!< HCLK not divided */ +#define LL_RCC_APB1_DIV_2 RCC_CFGR_PPRE1_DIV2 /*!< HCLK divided by 2 */ +#define LL_RCC_APB1_DIV_4 RCC_CFGR_PPRE1_DIV4 /*!< HCLK divided by 4 */ +#define LL_RCC_APB1_DIV_8 RCC_CFGR_PPRE1_DIV8 /*!< HCLK divided by 8 */ +#define LL_RCC_APB1_DIV_16 RCC_CFGR_PPRE1_DIV16 /*!< HCLK divided by 16 */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_APB2_DIV APB high-speed prescaler (APB2) + * @{ + */ +#define LL_RCC_APB2_DIV_1 RCC_CFGR_PPRE2_DIV1 /*!< HCLK not divided */ +#define LL_RCC_APB2_DIV_2 RCC_CFGR_PPRE2_DIV2 /*!< HCLK divided by 2 */ +#define LL_RCC_APB2_DIV_4 RCC_CFGR_PPRE2_DIV4 /*!< HCLK divided by 4 */ +#define LL_RCC_APB2_DIV_8 RCC_CFGR_PPRE2_DIV8 /*!< HCLK divided by 8 */ +#define LL_RCC_APB2_DIV_16 RCC_CFGR_PPRE2_DIV16 /*!< HCLK divided by 16 */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_MCO1SOURCE MCO1 SOURCE selection + * @{ + */ +#define LL_RCC_MCO1SOURCE_NOCLOCK RCC_CFGR_MCOSEL_NOCLOCK /*!< MCO output disabled, no clock on MCO */ +#define LL_RCC_MCO1SOURCE_SYSCLK RCC_CFGR_MCOSEL_SYSCLK /*!< SYSCLK selection as MCO source */ +#define LL_RCC_MCO1SOURCE_HSI RCC_CFGR_MCOSEL_HSI /*!< HSI selection as MCO source */ +#define LL_RCC_MCO1SOURCE_HSE RCC_CFGR_MCOSEL_HSE /*!< HSE selection as MCO source */ +#define LL_RCC_MCO1SOURCE_LSI RCC_CFGR_MCOSEL_LSI /*!< LSI selection as MCO source */ +#define LL_RCC_MCO1SOURCE_LSE RCC_CFGR_MCOSEL_LSE /*!< LSE selection as MCO source */ +#define LL_RCC_MCO1SOURCE_PLLCLK_DIV_2 RCC_CFGR_MCOSEL_PLL_DIV2 /*!< PLL clock divided by 2*/ +#if defined(RCC_CFGR_PLLNODIV) +#define LL_RCC_MCO1SOURCE_PLLCLK (RCC_CFGR_MCOSEL_PLL_DIV2 | RCC_CFGR_PLLNODIV) /*!< PLL clock selected*/ +#endif /* RCC_CFGR_PLLNODIV */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_MCO1_DIV MCO1 prescaler + * @{ + */ +#define LL_RCC_MCO1_DIV_1 ((uint32_t)0x00000000U)/*!< MCO Clock divided by 1 */ +#if defined(RCC_CFGR_MCOPRE) +#define LL_RCC_MCO1_DIV_2 RCC_CFGR_MCOPRE_DIV2 /*!< MCO Clock divided by 2 */ +#define LL_RCC_MCO1_DIV_4 RCC_CFGR_MCOPRE_DIV4 /*!< MCO Clock divided by 4 */ +#define LL_RCC_MCO1_DIV_8 RCC_CFGR_MCOPRE_DIV8 /*!< MCO Clock divided by 8 */ +#define LL_RCC_MCO1_DIV_16 RCC_CFGR_MCOPRE_DIV16 /*!< MCO Clock divided by 16 */ +#define LL_RCC_MCO1_DIV_32 RCC_CFGR_MCOPRE_DIV32 /*!< MCO Clock divided by 32 */ +#define LL_RCC_MCO1_DIV_64 RCC_CFGR_MCOPRE_DIV64 /*!< MCO Clock divided by 64 */ +#define LL_RCC_MCO1_DIV_128 RCC_CFGR_MCOPRE_DIV128 /*!< MCO Clock divided by 128 */ +#endif /* RCC_CFGR_MCOPRE */ +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup RCC_LL_EC_PERIPH_FREQUENCY Peripheral clock frequency + * @{ + */ +#define LL_RCC_PERIPH_FREQUENCY_NO 0x00000000U /*!< No clock enabled for the peripheral */ +#define LL_RCC_PERIPH_FREQUENCY_NA 0xFFFFFFFFU /*!< Frequency cannot be provided as external clock */ +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** @defgroup RCC_LL_EC_USART1_CLKSOURCE Peripheral USART clock source selection + * @{ + */ +#if defined(RCC_CFGR3_USART1SW_PCLK1) +#define LL_RCC_USART1_CLKSOURCE_PCLK1 (uint32_t)((RCC_POSITION_USART1SW << 24U) | RCC_CFGR3_USART1SW_PCLK1) /*!< PCLK1 clock used as USART1 clock source */ +#else +#define LL_RCC_USART1_CLKSOURCE_PCLK2 (uint32_t)((RCC_POSITION_USART1SW << 24U) | RCC_CFGR3_USART1SW_PCLK2) /*!< PCLK2 clock used as USART1 clock source */ +#endif /*RCC_CFGR3_USART1SW_PCLK1*/ +#define LL_RCC_USART1_CLKSOURCE_SYSCLK (uint32_t)((RCC_POSITION_USART1SW << 24U) | RCC_CFGR3_USART1SW_SYSCLK) /*!< System clock selected as USART1 clock source */ +#define LL_RCC_USART1_CLKSOURCE_LSE (uint32_t)((RCC_POSITION_USART1SW << 24U) | RCC_CFGR3_USART1SW_LSE) /*!< LSE oscillator clock used as USART1 clock source */ +#define LL_RCC_USART1_CLKSOURCE_HSI (uint32_t)((RCC_POSITION_USART1SW << 24U) | RCC_CFGR3_USART1SW_HSI) /*!< HSI oscillator clock used as USART1 clock source */ +#if defined(RCC_CFGR3_USART2SW) +#define LL_RCC_USART2_CLKSOURCE_PCLK1 (uint32_t)((RCC_POSITION_USART2SW << 24U) | RCC_CFGR3_USART2SW_PCLK) /*!< PCLK1 clock used as USART2 clock source */ +#define LL_RCC_USART2_CLKSOURCE_SYSCLK (uint32_t)((RCC_POSITION_USART2SW << 24U) | RCC_CFGR3_USART2SW_SYSCLK) /*!< System clock selected as USART2 clock source */ +#define LL_RCC_USART2_CLKSOURCE_LSE (uint32_t)((RCC_POSITION_USART2SW << 24U) | RCC_CFGR3_USART2SW_LSE) /*!< LSE oscillator clock used as USART2 clock source */ +#define LL_RCC_USART2_CLKSOURCE_HSI (uint32_t)((RCC_POSITION_USART2SW << 24U) | RCC_CFGR3_USART2SW_HSI) /*!< HSI oscillator clock used as USART2 clock source */ +#endif /* RCC_CFGR3_USART2SW */ +#if defined(RCC_CFGR3_USART3SW) +#define LL_RCC_USART3_CLKSOURCE_PCLK1 (uint32_t)((RCC_POSITION_USART3SW << 24U) | RCC_CFGR3_USART3SW_PCLK) /*!< PCLK1 clock used as USART3 clock source */ +#define LL_RCC_USART3_CLKSOURCE_SYSCLK (uint32_t)((RCC_POSITION_USART3SW << 24U) | RCC_CFGR3_USART3SW_SYSCLK) /*!< System clock selected as USART3 clock source */ +#define LL_RCC_USART3_CLKSOURCE_LSE (uint32_t)((RCC_POSITION_USART3SW << 24U) | RCC_CFGR3_USART3SW_LSE) /*!< LSE oscillator clock used as USART3 clock source */ +#define LL_RCC_USART3_CLKSOURCE_HSI (uint32_t)((RCC_POSITION_USART3SW << 24U) | RCC_CFGR3_USART3SW_HSI) /*!< HSI oscillator clock used as USART3 clock source */ +#endif /* RCC_CFGR3_USART3SW */ +/** + * @} + */ + +#if defined(RCC_CFGR3_UART4SW) || defined(RCC_CFGR3_UART5SW) +/** @defgroup RCC_LL_EC_UART4_CLKSOURCE Peripheral UART clock source selection + * @{ + */ +#define LL_RCC_UART4_CLKSOURCE_PCLK1 (uint32_t)((RCC_CFGR3_UART4SW >> 8U) | RCC_CFGR3_UART4SW_PCLK) /*!< PCLK1 clock used as UART4 clock source */ +#define LL_RCC_UART4_CLKSOURCE_SYSCLK (uint32_t)((RCC_CFGR3_UART4SW >> 8U) | RCC_CFGR3_UART4SW_SYSCLK) /*!< System clock selected as UART4 clock source */ +#define LL_RCC_UART4_CLKSOURCE_LSE (uint32_t)((RCC_CFGR3_UART4SW >> 8U) | RCC_CFGR3_UART4SW_LSE) /*!< LSE oscillator clock used as UART4 clock source */ +#define LL_RCC_UART4_CLKSOURCE_HSI (uint32_t)((RCC_CFGR3_UART4SW >> 8U) | RCC_CFGR3_UART4SW_HSI) /*!< HSI oscillator clock used as UART4 clock source */ +#define LL_RCC_UART5_CLKSOURCE_PCLK1 (uint32_t)((RCC_CFGR3_UART5SW >> 8U) | RCC_CFGR3_UART5SW_PCLK) /*!< PCLK1 clock used as UART5 clock source */ +#define LL_RCC_UART5_CLKSOURCE_SYSCLK (uint32_t)((RCC_CFGR3_UART5SW >> 8U) | RCC_CFGR3_UART5SW_SYSCLK) /*!< System clock selected as UART5 clock source */ +#define LL_RCC_UART5_CLKSOURCE_LSE (uint32_t)((RCC_CFGR3_UART5SW >> 8U) | RCC_CFGR3_UART5SW_LSE) /*!< LSE oscillator clock used as UART5 clock source */ +#define LL_RCC_UART5_CLKSOURCE_HSI (uint32_t)((RCC_CFGR3_UART5SW >> 8U) | RCC_CFGR3_UART5SW_HSI) /*!< HSI oscillator clock used as UART5 clock source */ +/** + * @} + */ + +#endif /* RCC_CFGR3_UART4SW || RCC_CFGR3_UART5SW */ + +/** @defgroup RCC_LL_EC_I2C1_CLKSOURCE Peripheral I2C clock source selection + * @{ + */ +#define LL_RCC_I2C1_CLKSOURCE_HSI (uint32_t)((RCC_CFGR3_I2C1SW << 24U) | RCC_CFGR3_I2C1SW_HSI) /*!< HSI oscillator clock used as I2C1 clock source */ +#define LL_RCC_I2C1_CLKSOURCE_SYSCLK (uint32_t)((RCC_CFGR3_I2C1SW << 24U) | RCC_CFGR3_I2C1SW_SYSCLK) /*!< System clock selected as I2C1 clock source */ +#if defined(RCC_CFGR3_I2C2SW) +#define LL_RCC_I2C2_CLKSOURCE_HSI (uint32_t)((RCC_CFGR3_I2C2SW << 24U) | RCC_CFGR3_I2C2SW_HSI) /*!< HSI oscillator clock used as I2C2 clock source */ +#define LL_RCC_I2C2_CLKSOURCE_SYSCLK (uint32_t)((RCC_CFGR3_I2C2SW << 24U) | RCC_CFGR3_I2C2SW_SYSCLK) /*!< System clock selected as I2C2 clock source */ +#endif /*RCC_CFGR3_I2C2SW*/ +#if defined(RCC_CFGR3_I2C3SW) +#define LL_RCC_I2C3_CLKSOURCE_HSI (uint32_t)((RCC_CFGR3_I2C3SW << 24U) | RCC_CFGR3_I2C3SW_HSI) /*!< HSI oscillator clock used as I2C3 clock source */ +#define LL_RCC_I2C3_CLKSOURCE_SYSCLK (uint32_t)((RCC_CFGR3_I2C3SW << 24U) | RCC_CFGR3_I2C3SW_SYSCLK) /*!< System clock selected as I2C3 clock source */ +#endif /*RCC_CFGR3_I2C3SW*/ +/** + * @} + */ + +#if defined(RCC_CFGR_I2SSRC) +/** @defgroup RCC_LL_EC_I2S_CLKSOURCE Peripheral I2S clock source selection + * @{ + */ +#define LL_RCC_I2S_CLKSOURCE_SYSCLK RCC_CFGR_I2SSRC_SYSCLK /*!< System clock selected as I2S clock source */ +#define LL_RCC_I2S_CLKSOURCE_PIN RCC_CFGR_I2SSRC_EXT /*!< External clock selected as I2S clock source */ +/** + * @} + */ + +#endif /* RCC_CFGR_I2SSRC */ + +#if defined(RCC_CFGR3_TIMSW) +/** @defgroup RCC_LL_EC_TIM1_CLKSOURCE Peripheral TIM clock source selection + * @{ + */ +#define LL_RCC_TIM1_CLKSOURCE_PCLK2 (uint32_t)(((RCC_POSITION_TIM1SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM1SW_PCLK2) /*!< PCLK2 used as TIM1 clock source */ +#define LL_RCC_TIM1_CLKSOURCE_PLL (uint32_t)(((RCC_POSITION_TIM1SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM1SW_PLL) /*!< PLL clock used as TIM1 clock source */ +#if defined(RCC_CFGR3_TIM8SW) +#define LL_RCC_TIM8_CLKSOURCE_PCLK2 (uint32_t)(((RCC_POSITION_TIM8SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM8SW_PCLK2) /*!< PCLK2 used as TIM8 clock source */ +#define LL_RCC_TIM8_CLKSOURCE_PLL (uint32_t)(((RCC_POSITION_TIM8SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM8SW_PLL) /*!< PLL clock used as TIM8 clock source */ +#endif /*RCC_CFGR3_TIM8SW*/ +#if defined(RCC_CFGR3_TIM15SW) +#define LL_RCC_TIM15_CLKSOURCE_PCLK2 (uint32_t)(((RCC_POSITION_TIM15SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM15SW_PCLK2) /*!< PCLK2 used as TIM15 clock source */ +#define LL_RCC_TIM15_CLKSOURCE_PLL (uint32_t)(((RCC_POSITION_TIM15SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM15SW_PLL) /*!< PLL clock used as TIM15 clock source */ +#endif /*RCC_CFGR3_TIM15SW*/ +#if defined(RCC_CFGR3_TIM16SW) +#define LL_RCC_TIM16_CLKSOURCE_PCLK2 (uint32_t)(((RCC_POSITION_TIM16SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM16SW_PCLK2) /*!< PCLK2 used as TIM16 clock source */ +#define LL_RCC_TIM16_CLKSOURCE_PLL (uint32_t)(((RCC_POSITION_TIM16SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM16SW_PLL) /*!< PLL clock used as TIM16 clock source */ +#endif /*RCC_CFGR3_TIM16SW*/ +#if defined(RCC_CFGR3_TIM17SW) +#define LL_RCC_TIM17_CLKSOURCE_PCLK2 (uint32_t)(((RCC_POSITION_TIM17SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM17SW_PCLK2) /*!< PCLK2 used as TIM17 clock source */ +#define LL_RCC_TIM17_CLKSOURCE_PLL (uint32_t)(((RCC_POSITION_TIM17SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM17SW_PLL) /*!< PLL clock used as TIM17 clock source */ +#endif /*RCC_CFGR3_TIM17SW*/ +#if defined(RCC_CFGR3_TIM20SW) +#define LL_RCC_TIM20_CLKSOURCE_PCLK2 (uint32_t)(((RCC_POSITION_TIM20SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM20SW_PCLK2) /*!< PCLK2 used as TIM20 clock source */ +#define LL_RCC_TIM20_CLKSOURCE_PLL (uint32_t)(((RCC_POSITION_TIM20SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM20SW_PLL) /*!< PLL clock used as TIM20 clock source */ +#endif /*RCC_CFGR3_TIM20SW*/ +#if defined(RCC_CFGR3_TIM2SW) +#define LL_RCC_TIM2_CLKSOURCE_PCLK1 (uint32_t)(((RCC_POSITION_TIM2SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM2SW_PCLK1) /*!< PCLK1 used as TIM2 clock source */ +#define LL_RCC_TIM2_CLKSOURCE_PLL (uint32_t)(((RCC_POSITION_TIM2SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM2SW_PLL) /*!< PLL clock used as TIM2 clock source */ +#endif /*RCC_CFGR3_TIM2SW*/ +#if defined(RCC_CFGR3_TIM34SW) +#define LL_RCC_TIM34_CLKSOURCE_PCLK1 (uint32_t)(((RCC_POSITION_TIM34SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM34SW_PCLK1) /*!< PCLK1 used as TIM3/4 clock source */ +#define LL_RCC_TIM34_CLKSOURCE_PLL (uint32_t)(((RCC_POSITION_TIM34SW - RCC_POSITION_TIM1SW) << 27U) | RCC_CFGR3_TIM34SW_PLL) /*!< PLL clock used as TIM3/4 clock source */ +#endif /*RCC_CFGR3_TIM34SW*/ +/** + * @} + */ + +#endif /* RCC_CFGR3_TIMSW */ + +#if defined(HRTIM1) +/** @defgroup RCC_LL_EC_HRTIM1_CLKSOURCE Peripheral HRTIM1 clock source selection + * @{ + */ +#define LL_RCC_HRTIM1_CLKSOURCE_PCLK2 RCC_CFGR3_HRTIM1SW_PCLK2 /*!< PCLK2 used as HRTIM1 clock source */ +#define LL_RCC_HRTIM1_CLKSOURCE_PLL RCC_CFGR3_HRTIM1SW_PLL /*!< PLL clock used as HRTIM1 clock source */ +/** + * @} + */ + +#endif /* HRTIM1 */ + +#if defined(CEC) +/** @defgroup RCC_LL_EC_CEC_CLKSOURCE Peripheral CEC clock source selection + * @{ + */ +#define LL_RCC_CEC_CLKSOURCE_HSI_DIV244 RCC_CFGR3_CECSW_HSI_DIV244 /*!< HSI clock divided by 244 selected as HDMI CEC entry clock source */ +#define LL_RCC_CEC_CLKSOURCE_LSE RCC_CFGR3_CECSW_LSE /*!< LSE clock selected as HDMI CEC entry clock source */ +/** + * @} + */ + +#endif /* CEC */ + +#if defined(USB) +/** @defgroup RCC_LL_EC_USB_CLKSOURCE Peripheral USB clock source selection + * @{ + */ +#define LL_RCC_USB_CLKSOURCE_PLL RCC_CFGR_USBPRE_DIV1 /*!< USB prescaler is PLL clock divided by 1 */ +#define LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5 RCC_CFGR_USBPRE_DIV1_5 /*!< USB prescaler is PLL clock divided by 1.5 */ +/** + * @} + */ + +#endif /* USB */ + +#if defined(RCC_CFGR_ADCPRE) +/** @defgroup RCC_LL_EC_ADC_CLKSOURCE Peripheral ADC clock source selection + * @{ + */ +#define LL_RCC_ADC_CLKSRC_PCLK2_DIV_2 RCC_CFGR_ADCPRE_DIV2 /*!< ADC prescaler PCLK divided by 2 */ +#define LL_RCC_ADC_CLKSRC_PCLK2_DIV_4 RCC_CFGR_ADCPRE_DIV4 /*!< ADC prescaler PCLK divided by 4 */ +#define LL_RCC_ADC_CLKSRC_PCLK2_DIV_6 RCC_CFGR_ADCPRE_DIV6 /*!< ADC prescaler PCLK divided by 6 */ +#define LL_RCC_ADC_CLKSRC_PCLK2_DIV_8 RCC_CFGR_ADCPRE_DIV8 /*!< ADC prescaler PCLK divided by 8 */ +/** + * @} + */ + +#elif defined(RCC_CFGR2_ADC1PRES) +/** @defgroup RCC_LL_EC_ADC1_CLKSOURCE Peripheral ADC clock source selection + * @{ + */ +#define LL_RCC_ADC1_CLKSRC_HCLK RCC_CFGR2_ADC1PRES_NO /*!< ADC1 clock disabled, ADC1 can use AHB clock */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_1 RCC_CFGR2_ADC1PRES_DIV1 /*!< ADC1 PLL clock divided by 1 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_2 RCC_CFGR2_ADC1PRES_DIV2 /*!< ADC1 PLL clock divided by 2 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_4 RCC_CFGR2_ADC1PRES_DIV4 /*!< ADC1 PLL clock divided by 4 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_6 RCC_CFGR2_ADC1PRES_DIV6 /*!< ADC1 PLL clock divided by 6 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_8 RCC_CFGR2_ADC1PRES_DIV8 /*!< ADC1 PLL clock divided by 8 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_10 RCC_CFGR2_ADC1PRES_DIV10 /*!< ADC1 PLL clock divided by 10 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_12 RCC_CFGR2_ADC1PRES_DIV12 /*!< ADC1 PLL clock divided by 12 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_16 RCC_CFGR2_ADC1PRES_DIV16 /*!< ADC1 PLL clock divided by 16 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_32 RCC_CFGR2_ADC1PRES_DIV32 /*!< ADC1 PLL clock divided by 32 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_64 RCC_CFGR2_ADC1PRES_DIV64 /*!< ADC1 PLL clock divided by 64 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_128 RCC_CFGR2_ADC1PRES_DIV128 /*!< ADC1 PLL clock divided by 128 */ +#define LL_RCC_ADC1_CLKSRC_PLL_DIV_256 RCC_CFGR2_ADC1PRES_DIV256 /*!< ADC1 PLL clock divided by 256 */ +/** + * @} + */ + +#elif defined(RCC_CFGR2_ADCPRE12) || defined(RCC_CFGR2_ADCPRE34) +#if defined(RCC_CFGR2_ADCPRE12) && defined(RCC_CFGR2_ADCPRE34) +/** @defgroup RCC_LL_EC_ADC12_CLKSOURCE Peripheral ADC12 clock source selection + * @{ + */ +#define LL_RCC_ADC12_CLKSRC_HCLK (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_NO) /*!< ADC12 clock disabled, ADC12 can use AHB clock */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_1 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV1) /*!< ADC12 PLL clock divided by 1 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_2 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV2) /*!< ADC12 PLL clock divided by 2 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_4 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV4) /*!< ADC12 PLL clock divided by 4 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_6 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV6) /*!< ADC12 PLL clock divided by 6 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_8 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV8) /*!< ADC12 PLL clock divided by 8 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_10 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV10) /*!< ADC12 PLL clock divided by 10 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_12 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV12) /*!< ADC12 PLL clock divided by 12 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_16 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV16) /*!< ADC12 PLL clock divided by 16 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_32 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV32) /*!< ADC12 PLL clock divided by 32 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_64 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV64) /*!< ADC12 PLL clock divided by 64 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_128 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV128) /*!< ADC12 PLL clock divided by 128 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_256 (uint32_t)((RCC_CFGR2_ADCPRE12 << 16U) | RCC_CFGR2_ADCPRE12_DIV256) /*!< ADC12 PLL clock divided by 256 */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_ADC34_CLKSOURCE Peripheral ADC34 clock source selection + * @{ + */ +#define LL_RCC_ADC34_CLKSRC_HCLK (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_NO) /*!< ADC34 clock disabled, ADC34 can use AHB clock */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_1 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV1) /*!< ADC34 PLL clock divided by 1 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_2 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV2) /*!< ADC34 PLL clock divided by 2 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_4 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV4) /*!< ADC34 PLL clock divided by 4 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_6 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV6) /*!< ADC34 PLL clock divided by 6 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_8 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV8) /*!< ADC34 PLL clock divided by 8 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_10 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV10) /*!< ADC34 PLL clock divided by 10 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_12 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV12) /*!< ADC34 PLL clock divided by 12 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_16 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV16) /*!< ADC34 PLL clock divided by 16 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_32 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV32) /*!< ADC34 PLL clock divided by 32 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_64 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV64) /*!< ADC34 PLL clock divided by 64 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_128 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV128) /*!< ADC34 PLL clock divided by 128 */ +#define LL_RCC_ADC34_CLKSRC_PLL_DIV_256 (uint32_t)((RCC_CFGR2_ADCPRE34 << 16U) | RCC_CFGR2_ADCPRE34_DIV256) /*!< ADC34 PLL clock divided by 256 */ +/** + * @} + */ + +#else +/** @defgroup RCC_LL_EC_ADC12_CLKSOURCE Peripheral ADC clock source selection + * @{ + */ +#define LL_RCC_ADC12_CLKSRC_HCLK RCC_CFGR2_ADCPRE12_NO /*!< ADC12 clock disabled, ADC12 can use AHB clock */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_1 RCC_CFGR2_ADCPRE12_DIV1 /*!< ADC12 PLL clock divided by 1 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_2 RCC_CFGR2_ADCPRE12_DIV2 /*!< ADC12 PLL clock divided by 2 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_4 RCC_CFGR2_ADCPRE12_DIV4 /*!< ADC12 PLL clock divided by 4 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_6 RCC_CFGR2_ADCPRE12_DIV6 /*!< ADC12 PLL clock divided by 6 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_8 RCC_CFGR2_ADCPRE12_DIV8 /*!< ADC12 PLL clock divided by 8 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_10 RCC_CFGR2_ADCPRE12_DIV10 /*!< ADC12 PLL clock divided by 10 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_12 RCC_CFGR2_ADCPRE12_DIV12 /*!< ADC12 PLL clock divided by 12 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_16 RCC_CFGR2_ADCPRE12_DIV16 /*!< ADC12 PLL clock divided by 16 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_32 RCC_CFGR2_ADCPRE12_DIV32 /*!< ADC12 PLL clock divided by 32 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_64 RCC_CFGR2_ADCPRE12_DIV64 /*!< ADC12 PLL clock divided by 64 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_128 RCC_CFGR2_ADCPRE12_DIV128 /*!< ADC12 PLL clock divided by 128 */ +#define LL_RCC_ADC12_CLKSRC_PLL_DIV_256 RCC_CFGR2_ADCPRE12_DIV256 /*!< ADC12 PLL clock divided by 256 */ +/** + * @} + */ + +#endif /* RCC_CFGR2_ADCPRE12 && RCC_CFGR2_ADCPRE34 */ + +#endif /* RCC_CFGR_ADCPRE */ + +#if defined(RCC_CFGR_SDPRE) +/** @defgroup RCC_LL_EC_SDADC_CLKSOURCE_SYSCLK Peripheral SDADC clock source selection + * @{ + */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_1 RCC_CFGR_SDPRE_DIV1 /*!< SDADC CLK not divided */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_2 RCC_CFGR_SDPRE_DIV2 /*!< SDADC CLK divided by 2 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_4 RCC_CFGR_SDPRE_DIV4 /*!< SDADC CLK divided by 4 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_6 RCC_CFGR_SDPRE_DIV6 /*!< SDADC CLK divided by 6 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_8 RCC_CFGR_SDPRE_DIV8 /*!< SDADC CLK divided by 8 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_10 RCC_CFGR_SDPRE_DIV10 /*!< SDADC CLK divided by 10 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_12 RCC_CFGR_SDPRE_DIV12 /*!< SDADC CLK divided by 12 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_14 RCC_CFGR_SDPRE_DIV14 /*!< SDADC CLK divided by 14 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_16 RCC_CFGR_SDPRE_DIV16 /*!< SDADC CLK divided by 16 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_20 RCC_CFGR_SDPRE_DIV20 /*!< SDADC CLK divided by 20 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_24 RCC_CFGR_SDPRE_DIV24 /*!< SDADC CLK divided by 24 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_28 RCC_CFGR_SDPRE_DIV28 /*!< SDADC CLK divided by 28 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_32 RCC_CFGR_SDPRE_DIV32 /*!< SDADC CLK divided by 32 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_36 RCC_CFGR_SDPRE_DIV36 /*!< SDADC CLK divided by 36 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_40 RCC_CFGR_SDPRE_DIV40 /*!< SDADC CLK divided by 40 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_44 RCC_CFGR_SDPRE_DIV44 /*!< SDADC CLK divided by 44 */ +#define LL_RCC_SDADC_CLKSRC_SYS_DIV_48 RCC_CFGR_SDPRE_DIV48 /*!< SDADC CLK divided by 48 */ +/** + * @} + */ + +#endif /* RCC_CFGR_SDPRE */ + +/** @defgroup RCC_LL_EC_USART Peripheral USART get clock source + * @{ + */ +#define LL_RCC_USART1_CLKSOURCE RCC_POSITION_USART1SW /*!< USART1 Clock source selection */ +#if defined(RCC_CFGR3_USART2SW) +#define LL_RCC_USART2_CLKSOURCE RCC_POSITION_USART2SW /*!< USART2 Clock source selection */ +#endif /* RCC_CFGR3_USART2SW */ +#if defined(RCC_CFGR3_USART3SW) +#define LL_RCC_USART3_CLKSOURCE RCC_POSITION_USART3SW /*!< USART3 Clock source selection */ +#endif /* RCC_CFGR3_USART3SW */ +/** + * @} + */ + +#if defined(RCC_CFGR3_UART4SW) || defined(RCC_CFGR3_UART5SW) +/** @defgroup RCC_LL_EC_UART Peripheral UART get clock source + * @{ + */ +#define LL_RCC_UART4_CLKSOURCE RCC_CFGR3_UART4SW /*!< UART4 Clock source selection */ +#define LL_RCC_UART5_CLKSOURCE RCC_CFGR3_UART5SW /*!< UART5 Clock source selection */ +/** + * @} + */ + +#endif /* RCC_CFGR3_UART4SW || RCC_CFGR3_UART5SW */ + +/** @defgroup RCC_LL_EC_I2C Peripheral I2C get clock source + * @{ + */ +#define LL_RCC_I2C1_CLKSOURCE RCC_CFGR3_I2C1SW /*!< I2C1 Clock source selection */ +#if defined(RCC_CFGR3_I2C2SW) +#define LL_RCC_I2C2_CLKSOURCE RCC_CFGR3_I2C2SW /*!< I2C2 Clock source selection */ +#endif /*RCC_CFGR3_I2C2SW*/ +#if defined(RCC_CFGR3_I2C3SW) +#define LL_RCC_I2C3_CLKSOURCE RCC_CFGR3_I2C3SW /*!< I2C3 Clock source selection */ +#endif /*RCC_CFGR3_I2C3SW*/ +/** + * @} + */ + +#if defined(RCC_CFGR_I2SSRC) +/** @defgroup RCC_LL_EC_I2S Peripheral I2S get clock source + * @{ + */ +#define LL_RCC_I2S_CLKSOURCE RCC_CFGR_I2SSRC /*!< I2S Clock source selection */ +/** + * @} + */ + +#endif /* RCC_CFGR_I2SSRC */ + +#if defined(RCC_CFGR3_TIMSW) +/** @defgroup RCC_LL_EC_TIM TIMx Peripheral TIM get clock source + * @{ + */ +#define LL_RCC_TIM1_CLKSOURCE (RCC_POSITION_TIM1SW - RCC_POSITION_TIM1SW) /*!< TIM1 Clock source selection */ +#if defined(RCC_CFGR3_TIM2SW) +#define LL_RCC_TIM2_CLKSOURCE (RCC_POSITION_TIM2SW - RCC_POSITION_TIM1SW) /*!< TIM2 Clock source selection */ +#endif /*RCC_CFGR3_TIM2SW*/ +#if defined(RCC_CFGR3_TIM8SW) +#define LL_RCC_TIM8_CLKSOURCE (RCC_POSITION_TIM8SW - RCC_POSITION_TIM1SW) /*!< TIM8 Clock source selection */ +#endif /*RCC_CFGR3_TIM8SW*/ +#if defined(RCC_CFGR3_TIM15SW) +#define LL_RCC_TIM15_CLKSOURCE (RCC_POSITION_TIM15SW - RCC_POSITION_TIM1SW) /*!< TIM15 Clock source selection */ +#endif /*RCC_CFGR3_TIM15SW*/ +#if defined(RCC_CFGR3_TIM16SW) +#define LL_RCC_TIM16_CLKSOURCE (RCC_POSITION_TIM16SW - RCC_POSITION_TIM1SW) /*!< TIM16 Clock source selection */ +#endif /*RCC_CFGR3_TIM16SW*/ +#if defined(RCC_CFGR3_TIM17SW) +#define LL_RCC_TIM17_CLKSOURCE (RCC_POSITION_TIM17SW - RCC_POSITION_TIM1SW) /*!< TIM17 Clock source selection */ +#endif /*RCC_CFGR3_TIM17SW*/ +#if defined(RCC_CFGR3_TIM20SW) +#define LL_RCC_TIM20_CLKSOURCE (RCC_POSITION_TIM20SW - RCC_POSITION_TIM1SW) /*!< TIM20 Clock source selection */ +#endif /*RCC_CFGR3_TIM20SW*/ +#if defined(RCC_CFGR3_TIM34SW) +#define LL_RCC_TIM34_CLKSOURCE (RCC_POSITION_TIM34SW - RCC_POSITION_TIM1SW) /*!< TIM3/4 Clock source selection */ +#endif /*RCC_CFGR3_TIM34SW*/ +/** + * @} + */ + +#endif /* RCC_CFGR3_TIMSW */ + +#if defined(HRTIM1) +/** @defgroup RCC_LL_EC_HRTIM1 Peripheral HRTIM1 get clock source + * @{ + */ +#define LL_RCC_HRTIM1_CLKSOURCE RCC_CFGR3_HRTIM1SW /*!< HRTIM1 Clock source selection */ +/** + * @} + */ + +#endif /* HRTIM1 */ + +#if defined(CEC) +/** @defgroup RCC_LL_EC_CEC Peripheral CEC get clock source + * @{ + */ +#define LL_RCC_CEC_CLKSOURCE RCC_CFGR3_CECSW /*!< CEC Clock source selection */ +/** + * @} + */ + +#endif /* CEC */ + +#if defined(USB) +/** @defgroup RCC_LL_EC_USB Peripheral USB get clock source + * @{ + */ +#define LL_RCC_USB_CLKSOURCE RCC_CFGR_USBPRE /*!< USB Clock source selection */ +/** + * @} + */ + +#endif /* USB */ + +#if defined(RCC_CFGR_ADCPRE) +/** @defgroup RCC_LL_EC_ADC Peripheral ADC get clock source + * @{ + */ +#define LL_RCC_ADC_CLKSOURCE RCC_CFGR_ADCPRE /*!< ADC Clock source selection */ +/** + * @} + */ + +#endif /* RCC_CFGR_ADCPRE */ + +#if defined(RCC_CFGR2_ADC1PRES) || defined(RCC_CFGR2_ADCPRE12) || defined(RCC_CFGR2_ADCPRE34) +/** @defgroup RCC_LL_EC_ADCXX Peripheral ADC get clock source + * @{ + */ +#if defined(RCC_CFGR2_ADC1PRES) +#define LL_RCC_ADC1_CLKSOURCE RCC_CFGR2_ADC1PRES /*!< ADC1 Clock source selection */ +#else +#define LL_RCC_ADC12_CLKSOURCE RCC_CFGR2_ADCPRE12 /*!< ADC12 Clock source selection */ +#if defined(RCC_CFGR2_ADCPRE34) +#define LL_RCC_ADC34_CLKSOURCE RCC_CFGR2_ADCPRE34 /*!< ADC34 Clock source selection */ +#endif /*RCC_CFGR2_ADCPRE34*/ +#endif /*RCC_CFGR2_ADC1PRES*/ +/** + * @} + */ + +#endif /* RCC_CFGR2_ADC1PRES || RCC_CFGR2_ADCPRE12 || RCC_CFGR2_ADCPRE34 */ + +#if defined(RCC_CFGR_SDPRE) +/** @defgroup RCC_LL_EC_SDADC Peripheral SDADC get clock source + * @{ + */ +#define LL_RCC_SDADC_CLKSOURCE RCC_CFGR_SDPRE /*!< SDADC Clock source selection */ +/** + * @} + */ + +#endif /* RCC_CFGR_SDPRE */ + + +/** @defgroup RCC_LL_EC_RTC_CLKSOURCE RTC clock source selection + * @{ + */ +#define LL_RCC_RTC_CLKSOURCE_NONE 0x00000000U /*!< No clock used as RTC clock */ +#define LL_RCC_RTC_CLKSOURCE_LSE RCC_BDCR_RTCSEL_0 /*!< LSE oscillator clock used as RTC clock */ +#define LL_RCC_RTC_CLKSOURCE_LSI RCC_BDCR_RTCSEL_1 /*!< LSI oscillator clock used as RTC clock */ +#define LL_RCC_RTC_CLKSOURCE_HSE_DIV32 RCC_BDCR_RTCSEL /*!< HSE oscillator clock divided by 32 used as RTC clock */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_PLL_MUL PLL Multiplicator factor + * @{ + */ +#define LL_RCC_PLL_MUL_2 RCC_CFGR_PLLMUL2 /*!< PLL input clock*2 */ +#define LL_RCC_PLL_MUL_3 RCC_CFGR_PLLMUL3 /*!< PLL input clock*3 */ +#define LL_RCC_PLL_MUL_4 RCC_CFGR_PLLMUL4 /*!< PLL input clock*4 */ +#define LL_RCC_PLL_MUL_5 RCC_CFGR_PLLMUL5 /*!< PLL input clock*5 */ +#define LL_RCC_PLL_MUL_6 RCC_CFGR_PLLMUL6 /*!< PLL input clock*6 */ +#define LL_RCC_PLL_MUL_7 RCC_CFGR_PLLMUL7 /*!< PLL input clock*7 */ +#define LL_RCC_PLL_MUL_8 RCC_CFGR_PLLMUL8 /*!< PLL input clock*8 */ +#define LL_RCC_PLL_MUL_9 RCC_CFGR_PLLMUL9 /*!< PLL input clock*9 */ +#define LL_RCC_PLL_MUL_10 RCC_CFGR_PLLMUL10 /*!< PLL input clock*10 */ +#define LL_RCC_PLL_MUL_11 RCC_CFGR_PLLMUL11 /*!< PLL input clock*11 */ +#define LL_RCC_PLL_MUL_12 RCC_CFGR_PLLMUL12 /*!< PLL input clock*12 */ +#define LL_RCC_PLL_MUL_13 RCC_CFGR_PLLMUL13 /*!< PLL input clock*13 */ +#define LL_RCC_PLL_MUL_14 RCC_CFGR_PLLMUL14 /*!< PLL input clock*14 */ +#define LL_RCC_PLL_MUL_15 RCC_CFGR_PLLMUL15 /*!< PLL input clock*15 */ +#define LL_RCC_PLL_MUL_16 RCC_CFGR_PLLMUL16 /*!< PLL input clock*16 */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_PLLSOURCE PLL SOURCE + * @{ + */ +#define LL_RCC_PLLSOURCE_NONE 0x00000000U /*!< No clock selected as main PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE RCC_CFGR_PLLSRC_HSE_PREDIV /*!< HSE/PREDIV clock selected as PLL entry clock source */ +#if defined(RCC_PLLSRC_PREDIV1_SUPPORT) +#define LL_RCC_PLLSOURCE_HSI RCC_CFGR_PLLSRC_HSI_PREDIV /*!< HSI/PREDIV clock selected as PLL entry clock source */ +#else +#define LL_RCC_PLLSOURCE_HSI_DIV_2 RCC_CFGR_PLLSRC_HSI_DIV2 /*!< HSI clock divided by 2 selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_1 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV1) /*!< HSE clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_2 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV2) /*!< HSE/2 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_3 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV3) /*!< HSE/3 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_4 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV4) /*!< HSE/4 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_5 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV5) /*!< HSE/5 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_6 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV6) /*!< HSE/6 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_7 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV7) /*!< HSE/7 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_8 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV8) /*!< HSE/8 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_9 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV9) /*!< HSE/9 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_10 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV10) /*!< HSE/10 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_11 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV11) /*!< HSE/11 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_12 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV12) /*!< HSE/12 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_13 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV13) /*!< HSE/13 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_14 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV14) /*!< HSE/14 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_15 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV15) /*!< HSE/15 clock selected as PLL entry clock source */ +#define LL_RCC_PLLSOURCE_HSE_DIV_16 (RCC_CFGR_PLLSRC_HSE_PREDIV | RCC_CFGR2_PREDIV_DIV16) /*!< HSE/16 clock selected as PLL entry clock source */ +#endif /* RCC_PLLSRC_PREDIV1_SUPPORT */ +/** + * @} + */ + +/** @defgroup RCC_LL_EC_PREDIV_DIV PREDIV Division factor + * @{ + */ +#define LL_RCC_PREDIV_DIV_1 RCC_CFGR2_PREDIV_DIV1 /*!< PREDIV input clock not divided */ +#define LL_RCC_PREDIV_DIV_2 RCC_CFGR2_PREDIV_DIV2 /*!< PREDIV input clock divided by 2 */ +#define LL_RCC_PREDIV_DIV_3 RCC_CFGR2_PREDIV_DIV3 /*!< PREDIV input clock divided by 3 */ +#define LL_RCC_PREDIV_DIV_4 RCC_CFGR2_PREDIV_DIV4 /*!< PREDIV input clock divided by 4 */ +#define LL_RCC_PREDIV_DIV_5 RCC_CFGR2_PREDIV_DIV5 /*!< PREDIV input clock divided by 5 */ +#define LL_RCC_PREDIV_DIV_6 RCC_CFGR2_PREDIV_DIV6 /*!< PREDIV input clock divided by 6 */ +#define LL_RCC_PREDIV_DIV_7 RCC_CFGR2_PREDIV_DIV7 /*!< PREDIV input clock divided by 7 */ +#define LL_RCC_PREDIV_DIV_8 RCC_CFGR2_PREDIV_DIV8 /*!< PREDIV input clock divided by 8 */ +#define LL_RCC_PREDIV_DIV_9 RCC_CFGR2_PREDIV_DIV9 /*!< PREDIV input clock divided by 9 */ +#define LL_RCC_PREDIV_DIV_10 RCC_CFGR2_PREDIV_DIV10 /*!< PREDIV input clock divided by 10 */ +#define LL_RCC_PREDIV_DIV_11 RCC_CFGR2_PREDIV_DIV11 /*!< PREDIV input clock divided by 11 */ +#define LL_RCC_PREDIV_DIV_12 RCC_CFGR2_PREDIV_DIV12 /*!< PREDIV input clock divided by 12 */ +#define LL_RCC_PREDIV_DIV_13 RCC_CFGR2_PREDIV_DIV13 /*!< PREDIV input clock divided by 13 */ +#define LL_RCC_PREDIV_DIV_14 RCC_CFGR2_PREDIV_DIV14 /*!< PREDIV input clock divided by 14 */ +#define LL_RCC_PREDIV_DIV_15 RCC_CFGR2_PREDIV_DIV15 /*!< PREDIV input clock divided by 15 */ +#define LL_RCC_PREDIV_DIV_16 RCC_CFGR2_PREDIV_DIV16 /*!< PREDIV input clock divided by 16 */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup RCC_LL_Exported_Macros RCC Exported Macros + * @{ + */ + +/** @defgroup RCC_LL_EM_WRITE_READ Common Write and read registers Macros + * @{ + */ + +/** + * @brief Write a value in RCC register + * @param __REG__ Register to be written + * @param __VALUE__ Value to be written in the register + * @retval None + */ +#define LL_RCC_WriteReg(__REG__, __VALUE__) WRITE_REG(RCC->__REG__, (__VALUE__)) + +/** + * @brief Read a value in RCC register + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_RCC_ReadReg(__REG__) READ_REG(RCC->__REG__) +/** + * @} + */ + +/** @defgroup RCC_LL_EM_CALC_FREQ Calculate frequencies + * @{ + */ + +#if defined(RCC_PLLSRC_PREDIV1_SUPPORT) +/** + * @brief Helper macro to calculate the PLLCLK frequency + * @note ex: @ref __LL_RCC_CALC_PLLCLK_FREQ (HSE_VALUE, @ref LL_RCC_PLL_GetMultiplicator() + * , @ref LL_RCC_PLL_GetPrediv()); + * @param __INPUTFREQ__ PLL Input frequency (based on HSE/HSI) + * @param __PLLMUL__ This parameter can be one of the following values: + * @arg @ref LL_RCC_PLL_MUL_2 + * @arg @ref LL_RCC_PLL_MUL_3 + * @arg @ref LL_RCC_PLL_MUL_4 + * @arg @ref LL_RCC_PLL_MUL_5 + * @arg @ref LL_RCC_PLL_MUL_6 + * @arg @ref LL_RCC_PLL_MUL_7 + * @arg @ref LL_RCC_PLL_MUL_8 + * @arg @ref LL_RCC_PLL_MUL_9 + * @arg @ref LL_RCC_PLL_MUL_10 + * @arg @ref LL_RCC_PLL_MUL_11 + * @arg @ref LL_RCC_PLL_MUL_12 + * @arg @ref LL_RCC_PLL_MUL_13 + * @arg @ref LL_RCC_PLL_MUL_14 + * @arg @ref LL_RCC_PLL_MUL_15 + * @arg @ref LL_RCC_PLL_MUL_16 + * @param __PLLPREDIV__ This parameter can be one of the following values: + * @arg @ref LL_RCC_PREDIV_DIV_1 + * @arg @ref LL_RCC_PREDIV_DIV_2 + * @arg @ref LL_RCC_PREDIV_DIV_3 + * @arg @ref LL_RCC_PREDIV_DIV_4 + * @arg @ref LL_RCC_PREDIV_DIV_5 + * @arg @ref LL_RCC_PREDIV_DIV_6 + * @arg @ref LL_RCC_PREDIV_DIV_7 + * @arg @ref LL_RCC_PREDIV_DIV_8 + * @arg @ref LL_RCC_PREDIV_DIV_9 + * @arg @ref LL_RCC_PREDIV_DIV_10 + * @arg @ref LL_RCC_PREDIV_DIV_11 + * @arg @ref LL_RCC_PREDIV_DIV_12 + * @arg @ref LL_RCC_PREDIV_DIV_13 + * @arg @ref LL_RCC_PREDIV_DIV_14 + * @arg @ref LL_RCC_PREDIV_DIV_15 + * @arg @ref LL_RCC_PREDIV_DIV_16 + * @retval PLL clock frequency (in Hz) + */ +#define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLMUL__, __PLLPREDIV__) \ + (((__INPUTFREQ__) / ((((__PLLPREDIV__) & RCC_CFGR2_PREDIV) + 1U))) * ((((__PLLMUL__) & RCC_CFGR_PLLMUL) >> RCC_POSITION_PLLMUL) + 2U)) + +#else +/** + * @brief Helper macro to calculate the PLLCLK frequency + * @note ex: @ref __LL_RCC_CALC_PLLCLK_FREQ (HSE_VALUE / (@ref LL_RCC_PLL_GetPrediv () + 1), @ref LL_RCC_PLL_GetMultiplicator()); + * @param __INPUTFREQ__ PLL Input frequency (based on HSE div Prediv / HSI div 2) + * @param __PLLMUL__ This parameter can be one of the following values: + * @arg @ref LL_RCC_PLL_MUL_2 + * @arg @ref LL_RCC_PLL_MUL_3 + * @arg @ref LL_RCC_PLL_MUL_4 + * @arg @ref LL_RCC_PLL_MUL_5 + * @arg @ref LL_RCC_PLL_MUL_6 + * @arg @ref LL_RCC_PLL_MUL_7 + * @arg @ref LL_RCC_PLL_MUL_8 + * @arg @ref LL_RCC_PLL_MUL_9 + * @arg @ref LL_RCC_PLL_MUL_10 + * @arg @ref LL_RCC_PLL_MUL_11 + * @arg @ref LL_RCC_PLL_MUL_12 + * @arg @ref LL_RCC_PLL_MUL_13 + * @arg @ref LL_RCC_PLL_MUL_14 + * @arg @ref LL_RCC_PLL_MUL_15 + * @arg @ref LL_RCC_PLL_MUL_16 + * @retval PLL clock frequency (in Hz) + */ +#define __LL_RCC_CALC_PLLCLK_FREQ(__INPUTFREQ__, __PLLMUL__) \ + ((__INPUTFREQ__) * ((((__PLLMUL__) & RCC_CFGR_PLLMUL) >> RCC_POSITION_PLLMUL) + 2U)) +#endif /* RCC_PLLSRC_PREDIV1_SUPPORT */ +/** + * @brief Helper macro to calculate the HCLK frequency + * @note: __AHBPRESCALER__ be retrieved by @ref LL_RCC_GetAHBPrescaler + * ex: __LL_RCC_CALC_HCLK_FREQ(LL_RCC_GetAHBPrescaler()) + * @param __SYSCLKFREQ__ SYSCLK frequency (based on HSE/HSI/PLLCLK) + * @param __AHBPRESCALER__ This parameter can be one of the following values: + * @arg @ref LL_RCC_SYSCLK_DIV_1 + * @arg @ref LL_RCC_SYSCLK_DIV_2 + * @arg @ref LL_RCC_SYSCLK_DIV_4 + * @arg @ref LL_RCC_SYSCLK_DIV_8 + * @arg @ref LL_RCC_SYSCLK_DIV_16 + * @arg @ref LL_RCC_SYSCLK_DIV_64 + * @arg @ref LL_RCC_SYSCLK_DIV_128 + * @arg @ref LL_RCC_SYSCLK_DIV_256 + * @arg @ref LL_RCC_SYSCLK_DIV_512 + * @retval HCLK clock frequency (in Hz) + */ +#define __LL_RCC_CALC_HCLK_FREQ(__SYSCLKFREQ__, __AHBPRESCALER__) ((__SYSCLKFREQ__) >> AHBPrescTable[((__AHBPRESCALER__) & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos]) + +/** + * @brief Helper macro to calculate the PCLK1 frequency (ABP1) + * @note: __APB1PRESCALER__ be retrieved by @ref LL_RCC_GetAPB1Prescaler + * ex: __LL_RCC_CALC_PCLK1_FREQ(LL_RCC_GetAPB1Prescaler()) + * @param __HCLKFREQ__ HCLK frequency + * @param __APB1PRESCALER__: This parameter can be one of the following values: + * @arg @ref LL_RCC_APB1_DIV_1 + * @arg @ref LL_RCC_APB1_DIV_2 + * @arg @ref LL_RCC_APB1_DIV_4 + * @arg @ref LL_RCC_APB1_DIV_8 + * @arg @ref LL_RCC_APB1_DIV_16 + * @retval PCLK1 clock frequency (in Hz) + */ +#define __LL_RCC_CALC_PCLK1_FREQ(__HCLKFREQ__, __APB1PRESCALER__) ((__HCLKFREQ__) >> APBPrescTable[(__APB1PRESCALER__) >> RCC_CFGR_PPRE1_Pos]) + +/** + * @brief Helper macro to calculate the PCLK2 frequency (ABP2) + * @note: __APB2PRESCALER__ be retrieved by @ref LL_RCC_GetAPB2Prescaler + * ex: __LL_RCC_CALC_PCLK2_FREQ(LL_RCC_GetAPB2Prescaler()) + * @param __HCLKFREQ__ HCLK frequency + * @param __APB2PRESCALER__: This parameter can be one of the following values: + * @arg @ref LL_RCC_APB2_DIV_1 + * @arg @ref LL_RCC_APB2_DIV_2 + * @arg @ref LL_RCC_APB2_DIV_4 + * @arg @ref LL_RCC_APB2_DIV_8 + * @arg @ref LL_RCC_APB2_DIV_16 + * @retval PCLK2 clock frequency (in Hz) + */ +#define __LL_RCC_CALC_PCLK2_FREQ(__HCLKFREQ__, __APB2PRESCALER__) ((__HCLKFREQ__) >> APBPrescTable[(__APB2PRESCALER__) >> RCC_CFGR_PPRE2_Pos]) + +/** + * @} + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup RCC_LL_Exported_Functions RCC Exported Functions + * @{ + */ + +/** @defgroup RCC_LL_EF_HSE HSE + * @{ + */ + +/** + * @brief Enable the Clock Security System. + * @rmtoll CR CSSON LL_RCC_HSE_EnableCSS + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSE_EnableCSS(void) +{ + SET_BIT(RCC->CR, RCC_CR_CSSON); +} + +/** + * @brief Disable the Clock Security System. + * @note Cannot be disabled in HSE is ready (only by hardware) + * @rmtoll CR CSSON LL_RCC_HSE_DisableCSS + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSE_DisableCSS(void) +{ + CLEAR_BIT(RCC->CR, RCC_CR_CSSON); +} + +/** + * @brief Enable HSE external oscillator (HSE Bypass) + * @rmtoll CR HSEBYP LL_RCC_HSE_EnableBypass + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSE_EnableBypass(void) +{ + SET_BIT(RCC->CR, RCC_CR_HSEBYP); +} + +/** + * @brief Disable HSE external oscillator (HSE Bypass) + * @rmtoll CR HSEBYP LL_RCC_HSE_DisableBypass + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSE_DisableBypass(void) +{ + CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); +} + +/** + * @brief Enable HSE crystal oscillator (HSE ON) + * @rmtoll CR HSEON LL_RCC_HSE_Enable + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSE_Enable(void) +{ + SET_BIT(RCC->CR, RCC_CR_HSEON); +} + +/** + * @brief Disable HSE crystal oscillator (HSE ON) + * @rmtoll CR HSEON LL_RCC_HSE_Disable + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSE_Disable(void) +{ + CLEAR_BIT(RCC->CR, RCC_CR_HSEON); +} + +/** + * @brief Check if HSE oscillator Ready + * @rmtoll CR HSERDY LL_RCC_HSE_IsReady + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_HSE_IsReady(void) +{ + return (READ_BIT(RCC->CR, RCC_CR_HSERDY) == (RCC_CR_HSERDY)); +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_HSI HSI + * @{ + */ + +/** + * @brief Enable HSI oscillator + * @rmtoll CR HSION LL_RCC_HSI_Enable + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSI_Enable(void) +{ + SET_BIT(RCC->CR, RCC_CR_HSION); +} + +/** + * @brief Disable HSI oscillator + * @rmtoll CR HSION LL_RCC_HSI_Disable + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSI_Disable(void) +{ + CLEAR_BIT(RCC->CR, RCC_CR_HSION); +} + +/** + * @brief Check if HSI clock is ready + * @rmtoll CR HSIRDY LL_RCC_HSI_IsReady + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_HSI_IsReady(void) +{ + return (READ_BIT(RCC->CR, RCC_CR_HSIRDY) == (RCC_CR_HSIRDY)); +} + +/** + * @brief Get HSI Calibration value + * @note When HSITRIM is written, HSICAL is updated with the sum of + * HSITRIM and the factory trim value + * @rmtoll CR HSICAL LL_RCC_HSI_GetCalibration + * @retval Between Min_Data = 0x00 and Max_Data = 0xFF + */ +__STATIC_INLINE uint32_t LL_RCC_HSI_GetCalibration(void) +{ + return (uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSICAL) >> RCC_CR_HSICAL_Pos); +} + +/** + * @brief Set HSI Calibration trimming + * @note user-programmable trimming value that is added to the HSICAL + * @note Default value is 16, which, when added to the HSICAL value, + * should trim the HSI to 16 MHz +/- 1 % + * @rmtoll CR HSITRIM LL_RCC_HSI_SetCalibTrimming + * @param Value between Min_Data = 0x00 and Max_Data = 0x1F + * @retval None + */ +__STATIC_INLINE void LL_RCC_HSI_SetCalibTrimming(uint32_t Value) +{ + MODIFY_REG(RCC->CR, RCC_CR_HSITRIM, Value << RCC_CR_HSITRIM_Pos); +} + +/** + * @brief Get HSI Calibration trimming + * @rmtoll CR HSITRIM LL_RCC_HSI_GetCalibTrimming + * @retval Between Min_Data = 0x00 and Max_Data = 0x1F + */ +__STATIC_INLINE uint32_t LL_RCC_HSI_GetCalibTrimming(void) +{ + return (uint32_t)(READ_BIT(RCC->CR, RCC_CR_HSITRIM) >> RCC_CR_HSITRIM_Pos); +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_LSE LSE + * @{ + */ + +/** + * @brief Enable Low Speed External (LSE) crystal. + * @rmtoll BDCR LSEON LL_RCC_LSE_Enable + * @retval None + */ +__STATIC_INLINE void LL_RCC_LSE_Enable(void) +{ + SET_BIT(RCC->BDCR, RCC_BDCR_LSEON); +} + +/** + * @brief Disable Low Speed External (LSE) crystal. + * @rmtoll BDCR LSEON LL_RCC_LSE_Disable + * @retval None + */ +__STATIC_INLINE void LL_RCC_LSE_Disable(void) +{ + CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEON); +} + +/** + * @brief Enable external clock source (LSE bypass). + * @rmtoll BDCR LSEBYP LL_RCC_LSE_EnableBypass + * @retval None + */ +__STATIC_INLINE void LL_RCC_LSE_EnableBypass(void) +{ + SET_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); +} + +/** + * @brief Disable external clock source (LSE bypass). + * @rmtoll BDCR LSEBYP LL_RCC_LSE_DisableBypass + * @retval None + */ +__STATIC_INLINE void LL_RCC_LSE_DisableBypass(void) +{ + CLEAR_BIT(RCC->BDCR, RCC_BDCR_LSEBYP); +} + +/** + * @brief Set LSE oscillator drive capability + * @note The oscillator is in Xtal mode when it is not in bypass mode. + * @rmtoll BDCR LSEDRV LL_RCC_LSE_SetDriveCapability + * @param LSEDrive This parameter can be one of the following values: + * @arg @ref LL_RCC_LSEDRIVE_LOW + * @arg @ref LL_RCC_LSEDRIVE_MEDIUMLOW + * @arg @ref LL_RCC_LSEDRIVE_MEDIUMHIGH + * @arg @ref LL_RCC_LSEDRIVE_HIGH + * @retval None + */ +__STATIC_INLINE void LL_RCC_LSE_SetDriveCapability(uint32_t LSEDrive) +{ + MODIFY_REG(RCC->BDCR, RCC_BDCR_LSEDRV, LSEDrive); +} + +/** + * @brief Get LSE oscillator drive capability + * @rmtoll BDCR LSEDRV LL_RCC_LSE_GetDriveCapability + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_LSEDRIVE_LOW + * @arg @ref LL_RCC_LSEDRIVE_MEDIUMLOW + * @arg @ref LL_RCC_LSEDRIVE_MEDIUMHIGH + * @arg @ref LL_RCC_LSEDRIVE_HIGH + */ +__STATIC_INLINE uint32_t LL_RCC_LSE_GetDriveCapability(void) +{ + return (uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_LSEDRV)); +} + +/** + * @brief Check if LSE oscillator Ready + * @rmtoll BDCR LSERDY LL_RCC_LSE_IsReady + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_LSE_IsReady(void) +{ + return (READ_BIT(RCC->BDCR, RCC_BDCR_LSERDY) == (RCC_BDCR_LSERDY)); +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_LSI LSI + * @{ + */ + +/** + * @brief Enable LSI Oscillator + * @rmtoll CSR LSION LL_RCC_LSI_Enable + * @retval None + */ +__STATIC_INLINE void LL_RCC_LSI_Enable(void) +{ + SET_BIT(RCC->CSR, RCC_CSR_LSION); +} + +/** + * @brief Disable LSI Oscillator + * @rmtoll CSR LSION LL_RCC_LSI_Disable + * @retval None + */ +__STATIC_INLINE void LL_RCC_LSI_Disable(void) +{ + CLEAR_BIT(RCC->CSR, RCC_CSR_LSION); +} + +/** + * @brief Check if LSI is Ready + * @rmtoll CSR LSIRDY LL_RCC_LSI_IsReady + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_LSI_IsReady(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_LSIRDY) == (RCC_CSR_LSIRDY)); +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_System System + * @{ + */ + +/** + * @brief Configure the system clock source + * @rmtoll CFGR SW LL_RCC_SetSysClkSource + * @param Source This parameter can be one of the following values: + * @arg @ref LL_RCC_SYS_CLKSOURCE_HSI + * @arg @ref LL_RCC_SYS_CLKSOURCE_HSE + * @arg @ref LL_RCC_SYS_CLKSOURCE_PLL + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetSysClkSource(uint32_t Source) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_SW, Source); +} + +/** + * @brief Get the system clock source + * @rmtoll CFGR SWS LL_RCC_GetSysClkSource + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSI + * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_HSE + * @arg @ref LL_RCC_SYS_CLKSOURCE_STATUS_PLL + */ +__STATIC_INLINE uint32_t LL_RCC_GetSysClkSource(void) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_SWS)); +} + +/** + * @brief Set AHB prescaler + * @rmtoll CFGR HPRE LL_RCC_SetAHBPrescaler + * @param Prescaler This parameter can be one of the following values: + * @arg @ref LL_RCC_SYSCLK_DIV_1 + * @arg @ref LL_RCC_SYSCLK_DIV_2 + * @arg @ref LL_RCC_SYSCLK_DIV_4 + * @arg @ref LL_RCC_SYSCLK_DIV_8 + * @arg @ref LL_RCC_SYSCLK_DIV_16 + * @arg @ref LL_RCC_SYSCLK_DIV_64 + * @arg @ref LL_RCC_SYSCLK_DIV_128 + * @arg @ref LL_RCC_SYSCLK_DIV_256 + * @arg @ref LL_RCC_SYSCLK_DIV_512 + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetAHBPrescaler(uint32_t Prescaler) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, Prescaler); +} + +/** + * @brief Set APB1 prescaler + * @rmtoll CFGR PPRE1 LL_RCC_SetAPB1Prescaler + * @param Prescaler This parameter can be one of the following values: + * @arg @ref LL_RCC_APB1_DIV_1 + * @arg @ref LL_RCC_APB1_DIV_2 + * @arg @ref LL_RCC_APB1_DIV_4 + * @arg @ref LL_RCC_APB1_DIV_8 + * @arg @ref LL_RCC_APB1_DIV_16 + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetAPB1Prescaler(uint32_t Prescaler) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, Prescaler); +} + +/** + * @brief Set APB2 prescaler + * @rmtoll CFGR PPRE2 LL_RCC_SetAPB2Prescaler + * @param Prescaler This parameter can be one of the following values: + * @arg @ref LL_RCC_APB2_DIV_1 + * @arg @ref LL_RCC_APB2_DIV_2 + * @arg @ref LL_RCC_APB2_DIV_4 + * @arg @ref LL_RCC_APB2_DIV_8 + * @arg @ref LL_RCC_APB2_DIV_16 + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetAPB2Prescaler(uint32_t Prescaler) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, Prescaler); +} + +/** + * @brief Get AHB prescaler + * @rmtoll CFGR HPRE LL_RCC_GetAHBPrescaler + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_SYSCLK_DIV_1 + * @arg @ref LL_RCC_SYSCLK_DIV_2 + * @arg @ref LL_RCC_SYSCLK_DIV_4 + * @arg @ref LL_RCC_SYSCLK_DIV_8 + * @arg @ref LL_RCC_SYSCLK_DIV_16 + * @arg @ref LL_RCC_SYSCLK_DIV_64 + * @arg @ref LL_RCC_SYSCLK_DIV_128 + * @arg @ref LL_RCC_SYSCLK_DIV_256 + * @arg @ref LL_RCC_SYSCLK_DIV_512 + */ +__STATIC_INLINE uint32_t LL_RCC_GetAHBPrescaler(void) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_HPRE)); +} + +/** + * @brief Get APB1 prescaler + * @rmtoll CFGR PPRE1 LL_RCC_GetAPB1Prescaler + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_APB1_DIV_1 + * @arg @ref LL_RCC_APB1_DIV_2 + * @arg @ref LL_RCC_APB1_DIV_4 + * @arg @ref LL_RCC_APB1_DIV_8 + * @arg @ref LL_RCC_APB1_DIV_16 + */ +__STATIC_INLINE uint32_t LL_RCC_GetAPB1Prescaler(void) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PPRE1)); +} + +/** + * @brief Get APB2 prescaler + * @rmtoll CFGR PPRE2 LL_RCC_GetAPB2Prescaler + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_APB2_DIV_1 + * @arg @ref LL_RCC_APB2_DIV_2 + * @arg @ref LL_RCC_APB2_DIV_4 + * @arg @ref LL_RCC_APB2_DIV_8 + * @arg @ref LL_RCC_APB2_DIV_16 + */ +__STATIC_INLINE uint32_t LL_RCC_GetAPB2Prescaler(void) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PPRE2)); +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_MCO MCO + * @{ + */ + +/** + * @brief Configure MCOx + * @rmtoll CFGR MCO LL_RCC_ConfigMCO\n + * CFGR MCOPRE LL_RCC_ConfigMCO\n + * CFGR PLLNODIV LL_RCC_ConfigMCO + * @param MCOxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_MCO1SOURCE_NOCLOCK + * @arg @ref LL_RCC_MCO1SOURCE_SYSCLK + * @arg @ref LL_RCC_MCO1SOURCE_HSI + * @arg @ref LL_RCC_MCO1SOURCE_HSE + * @arg @ref LL_RCC_MCO1SOURCE_LSI + * @arg @ref LL_RCC_MCO1SOURCE_LSE + * @arg @ref LL_RCC_MCO1SOURCE_PLLCLK (*) + * @arg @ref LL_RCC_MCO1SOURCE_PLLCLK_DIV_2 + * + * (*) value not defined in all devices + * @param MCOxPrescaler This parameter can be one of the following values: + * @arg @ref LL_RCC_MCO1_DIV_1 + * @arg @ref LL_RCC_MCO1_DIV_2 (*) + * @arg @ref LL_RCC_MCO1_DIV_4 (*) + * @arg @ref LL_RCC_MCO1_DIV_8 (*) + * @arg @ref LL_RCC_MCO1_DIV_16 (*) + * @arg @ref LL_RCC_MCO1_DIV_32 (*) + * @arg @ref LL_RCC_MCO1_DIV_64 (*) + * @arg @ref LL_RCC_MCO1_DIV_128 (*) + * + * (*) value not defined in all devices + * @retval None + */ +__STATIC_INLINE void LL_RCC_ConfigMCO(uint32_t MCOxSource, uint32_t MCOxPrescaler) +{ +#if defined(RCC_CFGR_MCOPRE) +#if defined(RCC_CFGR_PLLNODIV) + MODIFY_REG(RCC->CFGR, RCC_CFGR_MCOSEL | RCC_CFGR_MCOPRE | RCC_CFGR_PLLNODIV, MCOxSource | MCOxPrescaler); +#else + MODIFY_REG(RCC->CFGR, RCC_CFGR_MCOSEL | RCC_CFGR_MCOPRE, MCOxSource | MCOxPrescaler); +#endif /* RCC_CFGR_PLLNODIV */ +#else + MODIFY_REG(RCC->CFGR, RCC_CFGR_MCOSEL, MCOxSource); +#endif /* RCC_CFGR_MCOPRE */ +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_Peripheral_Clock_Source Peripheral Clock Source + * @{ + */ + +/** + * @brief Configure USARTx clock source + * @rmtoll CFGR3 USART1SW LL_RCC_SetUSARTClockSource\n + * CFGR3 USART2SW LL_RCC_SetUSARTClockSource\n + * CFGR3 USART3SW LL_RCC_SetUSARTClockSource + * @param USARTxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_USART1_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_USART1_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_USART1_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_USART1_CLKSOURCE_LSE + * @arg @ref LL_RCC_USART1_CLKSOURCE_HSI + * @arg @ref LL_RCC_USART2_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_USART2_CLKSOURCE_SYSCLK (*) + * @arg @ref LL_RCC_USART2_CLKSOURCE_LSE (*) + * @arg @ref LL_RCC_USART2_CLKSOURCE_HSI (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE_SYSCLK (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE_LSE (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE_HSI (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetUSARTClockSource(uint32_t USARTxSource) +{ + MODIFY_REG(RCC->CFGR3, (RCC_CFGR3_USART1SW << ((USARTxSource & 0xFF000000U) >> 24U)), (USARTxSource & 0x00FFFFFFU)); +} + +#if defined(RCC_CFGR3_UART4SW) || defined(RCC_CFGR3_UART5SW) +/** + * @brief Configure UARTx clock source + * @rmtoll CFGR3 UART4SW LL_RCC_SetUARTClockSource\n + * CFGR3 UART5SW LL_RCC_SetUARTClockSource + * @param UARTxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_UART4_CLKSOURCE_PCLK1 + * @arg @ref LL_RCC_UART4_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_UART4_CLKSOURCE_LSE + * @arg @ref LL_RCC_UART4_CLKSOURCE_HSI + * @arg @ref LL_RCC_UART5_CLKSOURCE_PCLK1 + * @arg @ref LL_RCC_UART5_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_UART5_CLKSOURCE_LSE + * @arg @ref LL_RCC_UART5_CLKSOURCE_HSI + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetUARTClockSource(uint32_t UARTxSource) +{ + MODIFY_REG(RCC->CFGR3, ((UARTxSource & 0x0000FFFFU) << 8U), (UARTxSource & (RCC_CFGR3_UART4SW | RCC_CFGR3_UART5SW))); +} +#endif /* RCC_CFGR3_UART4SW || RCC_CFGR3_UART5SW */ + +/** + * @brief Configure I2Cx clock source + * @rmtoll CFGR3 I2C1SW LL_RCC_SetI2CClockSource\n + * CFGR3 I2C2SW LL_RCC_SetI2CClockSource\n + * CFGR3 I2C3SW LL_RCC_SetI2CClockSource + * @param I2CxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_I2C1_CLKSOURCE_HSI + * @arg @ref LL_RCC_I2C1_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_I2C2_CLKSOURCE_HSI (*) + * @arg @ref LL_RCC_I2C2_CLKSOURCE_SYSCLK (*) + * @arg @ref LL_RCC_I2C3_CLKSOURCE_HSI (*) + * @arg @ref LL_RCC_I2C3_CLKSOURCE_SYSCLK (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetI2CClockSource(uint32_t I2CxSource) +{ + MODIFY_REG(RCC->CFGR3, ((I2CxSource & 0xFF000000U) >> 24U), (I2CxSource & 0x00FFFFFFU)); +} + +#if defined(RCC_CFGR_I2SSRC) +/** + * @brief Configure I2Sx clock source + * @rmtoll CFGR I2SSRC LL_RCC_SetI2SClockSource + * @param I2SxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_I2S_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_I2S_CLKSOURCE_PIN + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetI2SClockSource(uint32_t I2SxSource) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_I2SSRC, I2SxSource); +} +#endif /* RCC_CFGR_I2SSRC */ + +#if defined(RCC_CFGR3_TIMSW) +/** + * @brief Configure TIMx clock source + * @rmtoll CFGR3 TIM1SW LL_RCC_SetTIMClockSource\n + * CFGR3 TIM8SW LL_RCC_SetTIMClockSource\n + * CFGR3 TIM15SW LL_RCC_SetTIMClockSource\n + * CFGR3 TIM16SW LL_RCC_SetTIMClockSource\n + * CFGR3 TIM17SW LL_RCC_SetTIMClockSource\n + * CFGR3 TIM20SW LL_RCC_SetTIMClockSource\n + * CFGR3 TIM2SW LL_RCC_SetTIMClockSource\n + * CFGR3 TIM34SW LL_RCC_SetTIMClockSource + * @param TIMxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_TIM1_CLKSOURCE_PCLK2 + * @arg @ref LL_RCC_TIM1_CLKSOURCE_PLL + * @arg @ref LL_RCC_TIM8_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM8_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM15_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM15_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM16_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM16_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM17_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM17_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM20_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM20_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM2_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_TIM2_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM34_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_TIM34_CLKSOURCE_PLL (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetTIMClockSource(uint32_t TIMxSource) +{ + MODIFY_REG(RCC->CFGR3, (RCC_CFGR3_TIM1SW << (TIMxSource >> 27U)), (TIMxSource & 0x03FFFFFFU)); +} +#endif /* RCC_CFGR3_TIMSW */ + +#if defined(HRTIM1) +/** + * @brief Configure HRTIMx clock source + * @rmtoll CFGR3 HRTIMSW LL_RCC_SetHRTIMClockSource + * @param HRTIMxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_HRTIM1_CLKSOURCE_PCLK2 + * @arg @ref LL_RCC_HRTIM1_CLKSOURCE_PLL + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetHRTIMClockSource(uint32_t HRTIMxSource) +{ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_HRTIMSW, HRTIMxSource); +} +#endif /* HRTIM1 */ + +#if defined(CEC) +/** + * @brief Configure CEC clock source + * @rmtoll CFGR3 CECSW LL_RCC_SetCECClockSource + * @param CECxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_CEC_CLKSOURCE_HSI_DIV244 + * @arg @ref LL_RCC_CEC_CLKSOURCE_LSE + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetCECClockSource(uint32_t CECxSource) +{ + MODIFY_REG(RCC->CFGR3, RCC_CFGR3_CECSW, CECxSource); +} +#endif /* CEC */ + +#if defined(USB) +/** + * @brief Configure USB clock source + * @rmtoll CFGR USBPRE LL_RCC_SetUSBClockSource + * @param USBxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_USB_CLKSOURCE_PLL + * @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5 + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetUSBClockSource(uint32_t USBxSource) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_USBPRE, USBxSource); +} +#endif /* USB */ + +#if defined(RCC_CFGR_ADCPRE) +/** + * @brief Configure ADC clock source + * @rmtoll CFGR ADCPRE LL_RCC_SetADCClockSource + * @param ADCxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_2 + * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_4 + * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_6 + * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_8 + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetADCClockSource(uint32_t ADCxSource) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_ADCPRE, ADCxSource); +} + +#elif defined(RCC_CFGR2_ADC1PRES) +/** + * @brief Configure ADC clock source + * @rmtoll CFGR2 ADC1PRES LL_RCC_SetADCClockSource + * @param ADCxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_ADC1_CLKSRC_HCLK + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_1 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_2 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_4 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_6 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_8 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_10 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_12 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_16 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_32 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_64 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_128 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_256 + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetADCClockSource(uint32_t ADCxSource) +{ + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_ADC1PRES, ADCxSource); +} + +#elif defined(RCC_CFGR2_ADCPRE12) || defined(RCC_CFGR2_ADCPRE34) +/** + * @brief Configure ADC clock source + * @rmtoll CFGR2 ADCPRE12 LL_RCC_SetADCClockSource\n + * CFGR2 ADCPRE34 LL_RCC_SetADCClockSource + * @param ADCxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_ADC12_CLKSRC_HCLK + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_1 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_2 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_4 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_6 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_8 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_10 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_12 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_16 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_32 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_64 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_128 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_256 + * @arg @ref LL_RCC_ADC34_CLKSRC_HCLK (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_1 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_2 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_4 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_6 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_8 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_10 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_12 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_16 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_32 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_64 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_128 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_256 (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetADCClockSource(uint32_t ADCxSource) +{ +#if defined(RCC_CFGR2_ADCPRE34) + MODIFY_REG(RCC->CFGR2, (ADCxSource >> 16U), (ADCxSource & 0x0000FFFFU)); +#else + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_ADCPRE12, ADCxSource); +#endif /* RCC_CFGR2_ADCPRE34 */ +} +#endif /* RCC_CFGR_ADCPRE */ + +#if defined(RCC_CFGR_SDPRE) +/** + * @brief Configure SDADCx clock source + * @rmtoll CFGR SDPRE LL_RCC_SetSDADCClockSource + * @param SDADCxSource This parameter can be one of the following values: + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_1 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_2 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_4 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_6 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_8 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_10 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_12 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_14 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_16 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_20 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_24 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_28 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_32 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_36 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_40 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_44 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_48 + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetSDADCClockSource(uint32_t SDADCxSource) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_SDPRE, SDADCxSource); +} +#endif /* RCC_CFGR_SDPRE */ + +/** + * @brief Get USARTx clock source + * @rmtoll CFGR3 USART1SW LL_RCC_GetUSARTClockSource\n + * CFGR3 USART2SW LL_RCC_GetUSARTClockSource\n + * CFGR3 USART3SW LL_RCC_GetUSARTClockSource + * @param USARTx This parameter can be one of the following values: + * @arg @ref LL_RCC_USART1_CLKSOURCE + * @arg @ref LL_RCC_USART2_CLKSOURCE (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE (*) + * + * (*) value not defined in all devices. + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_USART1_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_USART1_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_USART1_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_USART1_CLKSOURCE_LSE + * @arg @ref LL_RCC_USART1_CLKSOURCE_HSI + * @arg @ref LL_RCC_USART2_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_USART2_CLKSOURCE_SYSCLK (*) + * @arg @ref LL_RCC_USART2_CLKSOURCE_LSE (*) + * @arg @ref LL_RCC_USART2_CLKSOURCE_HSI (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE_SYSCLK (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE_LSE (*) + * @arg @ref LL_RCC_USART3_CLKSOURCE_HSI (*) + * + * (*) value not defined in all devices. + */ +__STATIC_INLINE uint32_t LL_RCC_GetUSARTClockSource(uint32_t USARTx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR3, (RCC_CFGR3_USART1SW << USARTx)) | (USARTx << 24U)); +} + +#if defined(RCC_CFGR3_UART4SW) || defined(RCC_CFGR3_UART5SW) +/** + * @brief Get UARTx clock source + * @rmtoll CFGR3 UART4SW LL_RCC_GetUARTClockSource\n + * CFGR3 UART5SW LL_RCC_GetUARTClockSource + * @param UARTx This parameter can be one of the following values: + * @arg @ref LL_RCC_UART4_CLKSOURCE + * @arg @ref LL_RCC_UART5_CLKSOURCE + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_UART4_CLKSOURCE_PCLK1 + * @arg @ref LL_RCC_UART4_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_UART4_CLKSOURCE_LSE + * @arg @ref LL_RCC_UART4_CLKSOURCE_HSI + * @arg @ref LL_RCC_UART5_CLKSOURCE_PCLK1 + * @arg @ref LL_RCC_UART5_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_UART5_CLKSOURCE_LSE + * @arg @ref LL_RCC_UART5_CLKSOURCE_HSI + */ +__STATIC_INLINE uint32_t LL_RCC_GetUARTClockSource(uint32_t UARTx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR3, UARTx) | (UARTx >> 8U)); +} +#endif /* RCC_CFGR3_UART4SW || RCC_CFGR3_UART5SW */ + +/** + * @brief Get I2Cx clock source + * @rmtoll CFGR3 I2C1SW LL_RCC_GetI2CClockSource\n + * CFGR3 I2C2SW LL_RCC_GetI2CClockSource\n + * CFGR3 I2C3SW LL_RCC_GetI2CClockSource + * @param I2Cx This parameter can be one of the following values: + * @arg @ref LL_RCC_I2C1_CLKSOURCE + * @arg @ref LL_RCC_I2C2_CLKSOURCE (*) + * @arg @ref LL_RCC_I2C3_CLKSOURCE (*) + * + * (*) value not defined in all devices. + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_I2C1_CLKSOURCE_HSI + * @arg @ref LL_RCC_I2C1_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_I2C2_CLKSOURCE_HSI (*) + * @arg @ref LL_RCC_I2C2_CLKSOURCE_SYSCLK (*) + * @arg @ref LL_RCC_I2C3_CLKSOURCE_HSI (*) + * @arg @ref LL_RCC_I2C3_CLKSOURCE_SYSCLK (*) + * + * (*) value not defined in all devices. + */ +__STATIC_INLINE uint32_t LL_RCC_GetI2CClockSource(uint32_t I2Cx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR3, I2Cx) | (I2Cx << 24U)); +} + +#if defined(RCC_CFGR_I2SSRC) +/** + * @brief Get I2Sx clock source + * @rmtoll CFGR I2SSRC LL_RCC_GetI2SClockSource + * @param I2Sx This parameter can be one of the following values: + * @arg @ref LL_RCC_I2S_CLKSOURCE + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_I2S_CLKSOURCE_SYSCLK + * @arg @ref LL_RCC_I2S_CLKSOURCE_PIN + */ +__STATIC_INLINE uint32_t LL_RCC_GetI2SClockSource(uint32_t I2Sx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, I2Sx)); +} +#endif /* RCC_CFGR_I2SSRC */ + +#if defined(RCC_CFGR3_TIMSW) +/** + * @brief Get TIMx clock source + * @rmtoll CFGR3 TIM1SW LL_RCC_GetTIMClockSource\n + * CFGR3 TIM8SW LL_RCC_GetTIMClockSource\n + * CFGR3 TIM15SW LL_RCC_GetTIMClockSource\n + * CFGR3 TIM16SW LL_RCC_GetTIMClockSource\n + * CFGR3 TIM17SW LL_RCC_GetTIMClockSource\n + * CFGR3 TIM20SW LL_RCC_GetTIMClockSource\n + * CFGR3 TIM2SW LL_RCC_GetTIMClockSource\n + * CFGR3 TIM34SW LL_RCC_GetTIMClockSource + * @param TIMx This parameter can be one of the following values: + * @arg @ref LL_RCC_TIM1_CLKSOURCE + * @arg @ref LL_RCC_TIM2_CLKSOURCE (*) + * @arg @ref LL_RCC_TIM8_CLKSOURCE (*) + * @arg @ref LL_RCC_TIM15_CLKSOURCE (*) + * @arg @ref LL_RCC_TIM16_CLKSOURCE (*) + * @arg @ref LL_RCC_TIM17_CLKSOURCE (*) + * @arg @ref LL_RCC_TIM20_CLKSOURCE (*) + * @arg @ref LL_RCC_TIM34_CLKSOURCE (*) + * + * (*) value not defined in all devices. + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_TIM1_CLKSOURCE_PCLK2 + * @arg @ref LL_RCC_TIM1_CLKSOURCE_PLL + * @arg @ref LL_RCC_TIM8_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM8_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM15_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM15_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM16_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM16_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM17_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM17_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM20_CLKSOURCE_PCLK2 (*) + * @arg @ref LL_RCC_TIM20_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM2_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_TIM2_CLKSOURCE_PLL (*) + * @arg @ref LL_RCC_TIM34_CLKSOURCE_PCLK1 (*) + * @arg @ref LL_RCC_TIM34_CLKSOURCE_PLL (*) + * + * (*) value not defined in all devices. + */ +__STATIC_INLINE uint32_t LL_RCC_GetTIMClockSource(uint32_t TIMx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR3, (RCC_CFGR3_TIM1SW << TIMx)) | (TIMx << 27U)); +} +#endif /* RCC_CFGR3_TIMSW */ + +#if defined(HRTIM1) +/** + * @brief Get HRTIMx clock source + * @rmtoll CFGR3 HRTIMSW LL_RCC_GetHRTIMClockSource + * @param HRTIMx This parameter can be one of the following values: + * @arg @ref LL_RCC_HRTIM1_CLKSOURCE + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_HRTIM1_CLKSOURCE_PCLK2 + * @arg @ref LL_RCC_HRTIM1_CLKSOURCE_PLL + */ +__STATIC_INLINE uint32_t LL_RCC_GetHRTIMClockSource(uint32_t HRTIMx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR3, HRTIMx)); +} +#endif /* HRTIM1 */ + +#if defined(CEC) +/** + * @brief Get CEC clock source + * @rmtoll CFGR3 CECSW LL_RCC_GetCECClockSource + * @param CECx This parameter can be one of the following values: + * @arg @ref LL_RCC_CEC_CLKSOURCE + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_CEC_CLKSOURCE_HSI_DIV244 + * @arg @ref LL_RCC_CEC_CLKSOURCE_LSE + */ +__STATIC_INLINE uint32_t LL_RCC_GetCECClockSource(uint32_t CECx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR3, CECx)); +} +#endif /* CEC */ + +#if defined(USB) +/** + * @brief Get USBx clock source + * @rmtoll CFGR USBPRE LL_RCC_GetUSBClockSource + * @param USBx This parameter can be one of the following values: + * @arg @ref LL_RCC_USB_CLKSOURCE + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_USB_CLKSOURCE_PLL + * @arg @ref LL_RCC_USB_CLKSOURCE_PLL_DIV_1_5 + */ +__STATIC_INLINE uint32_t LL_RCC_GetUSBClockSource(uint32_t USBx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, USBx)); +} +#endif /* USB */ + +#if defined(RCC_CFGR_ADCPRE) +/** + * @brief Get ADCx clock source + * @rmtoll CFGR ADCPRE LL_RCC_GetADCClockSource + * @param ADCx This parameter can be one of the following values: + * @arg @ref LL_RCC_ADC_CLKSOURCE + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_2 + * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_4 + * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_6 + * @arg @ref LL_RCC_ADC_CLKSRC_PCLK2_DIV_8 + */ +__STATIC_INLINE uint32_t LL_RCC_GetADCClockSource(uint32_t ADCx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, ADCx)); +} + +#elif defined(RCC_CFGR2_ADC1PRES) +/** + * @brief Get ADCx clock source + * @rmtoll CFGR2 ADC1PRES LL_RCC_GetADCClockSource + * @param ADCx This parameter can be one of the following values: + * @arg @ref LL_RCC_ADC1_CLKSOURCE + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_ADC1_CLKSRC_HCLK + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_1 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_2 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_4 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_6 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_8 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_10 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_12 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_16 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_32 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_64 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_128 + * @arg @ref LL_RCC_ADC1_CLKSRC_PLL_DIV_256 + */ +__STATIC_INLINE uint32_t LL_RCC_GetADCClockSource(uint32_t ADCx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR2, ADCx)); +} + +#elif defined(RCC_CFGR2_ADCPRE12) || defined(RCC_CFGR2_ADCPRE34) +/** + * @brief Get ADCx clock source + * @rmtoll CFGR2 ADCPRE12 LL_RCC_GetADCClockSource\n + * CFGR2 ADCPRE34 LL_RCC_GetADCClockSource + * @param ADCx This parameter can be one of the following values: + * @arg @ref LL_RCC_ADC12_CLKSOURCE + * @arg @ref LL_RCC_ADC34_CLKSOURCE (*) + * + * (*) value not defined in all devices. + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_ADC12_CLKSRC_HCLK + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_1 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_2 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_4 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_6 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_8 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_10 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_12 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_16 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_32 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_64 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_128 + * @arg @ref LL_RCC_ADC12_CLKSRC_PLL_DIV_256 + * @arg @ref LL_RCC_ADC34_CLKSRC_HCLK (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_1 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_2 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_4 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_6 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_8 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_10 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_12 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_16 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_32 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_64 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_128 (*) + * @arg @ref LL_RCC_ADC34_CLKSRC_PLL_DIV_256 (*) + * + * (*) value not defined in all devices. + */ +__STATIC_INLINE uint32_t LL_RCC_GetADCClockSource(uint32_t ADCx) +{ +#if defined(RCC_CFGR2_ADCPRE34) + return (uint32_t)(READ_BIT(RCC->CFGR2, ADCx) | (ADCx << 16U)); +#else + return (uint32_t)(READ_BIT(RCC->CFGR2, ADCx)); +#endif /*RCC_CFGR2_ADCPRE34*/ +} +#endif /* RCC_CFGR_ADCPRE */ + +#if defined(RCC_CFGR_SDPRE) +/** + * @brief Get SDADCx clock source + * @rmtoll CFGR SDPRE LL_RCC_GetSDADCClockSource + * @param SDADCx This parameter can be one of the following values: + * @arg @ref LL_RCC_SDADC_CLKSOURCE + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_1 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_2 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_4 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_6 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_8 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_10 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_12 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_14 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_16 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_20 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_24 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_28 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_32 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_36 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_40 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_44 + * @arg @ref LL_RCC_SDADC_CLKSRC_SYS_DIV_48 + */ +__STATIC_INLINE uint32_t LL_RCC_GetSDADCClockSource(uint32_t SDADCx) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, SDADCx)); +} +#endif /* RCC_CFGR_SDPRE */ + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_RTC RTC + * @{ + */ + +/** + * @brief Set RTC Clock Source + * @note Once the RTC clock source has been selected, it cannot be changed any more unless + * the Backup domain is reset. The BDRST bit can be used to reset them. + * @rmtoll BDCR RTCSEL LL_RCC_SetRTCClockSource + * @param Source This parameter can be one of the following values: + * @arg @ref LL_RCC_RTC_CLKSOURCE_NONE + * @arg @ref LL_RCC_RTC_CLKSOURCE_LSE + * @arg @ref LL_RCC_RTC_CLKSOURCE_LSI + * @arg @ref LL_RCC_RTC_CLKSOURCE_HSE_DIV32 + * @retval None + */ +__STATIC_INLINE void LL_RCC_SetRTCClockSource(uint32_t Source) +{ + MODIFY_REG(RCC->BDCR, RCC_BDCR_RTCSEL, Source); +} + +/** + * @brief Get RTC Clock Source + * @rmtoll BDCR RTCSEL LL_RCC_GetRTCClockSource + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_RTC_CLKSOURCE_NONE + * @arg @ref LL_RCC_RTC_CLKSOURCE_LSE + * @arg @ref LL_RCC_RTC_CLKSOURCE_LSI + * @arg @ref LL_RCC_RTC_CLKSOURCE_HSE_DIV32 + */ +__STATIC_INLINE uint32_t LL_RCC_GetRTCClockSource(void) +{ + return (uint32_t)(READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL)); +} + +/** + * @brief Enable RTC + * @rmtoll BDCR RTCEN LL_RCC_EnableRTC + * @retval None + */ +__STATIC_INLINE void LL_RCC_EnableRTC(void) +{ + SET_BIT(RCC->BDCR, RCC_BDCR_RTCEN); +} + +/** + * @brief Disable RTC + * @rmtoll BDCR RTCEN LL_RCC_DisableRTC + * @retval None + */ +__STATIC_INLINE void LL_RCC_DisableRTC(void) +{ + CLEAR_BIT(RCC->BDCR, RCC_BDCR_RTCEN); +} + +/** + * @brief Check if RTC has been enabled or not + * @rmtoll BDCR RTCEN LL_RCC_IsEnabledRTC + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsEnabledRTC(void) +{ + return (READ_BIT(RCC->BDCR, RCC_BDCR_RTCEN) == (RCC_BDCR_RTCEN)); +} + +/** + * @brief Force the Backup domain reset + * @rmtoll BDCR BDRST LL_RCC_ForceBackupDomainReset + * @retval None + */ +__STATIC_INLINE void LL_RCC_ForceBackupDomainReset(void) +{ + SET_BIT(RCC->BDCR, RCC_BDCR_BDRST); +} + +/** + * @brief Release the Backup domain reset + * @rmtoll BDCR BDRST LL_RCC_ReleaseBackupDomainReset + * @retval None + */ +__STATIC_INLINE void LL_RCC_ReleaseBackupDomainReset(void) +{ + CLEAR_BIT(RCC->BDCR, RCC_BDCR_BDRST); +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_PLL PLL + * @{ + */ + +/** + * @brief Enable PLL + * @rmtoll CR PLLON LL_RCC_PLL_Enable + * @retval None + */ +__STATIC_INLINE void LL_RCC_PLL_Enable(void) +{ + SET_BIT(RCC->CR, RCC_CR_PLLON); +} + +/** + * @brief Disable PLL + * @note Cannot be disabled if the PLL clock is used as the system clock + * @rmtoll CR PLLON LL_RCC_PLL_Disable + * @retval None + */ +__STATIC_INLINE void LL_RCC_PLL_Disable(void) +{ + CLEAR_BIT(RCC->CR, RCC_CR_PLLON); +} + +/** + * @brief Check if PLL Ready + * @rmtoll CR PLLRDY LL_RCC_PLL_IsReady + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_PLL_IsReady(void) +{ + return (READ_BIT(RCC->CR, RCC_CR_PLLRDY) == (RCC_CR_PLLRDY)); +} + +#if defined(RCC_PLLSRC_PREDIV1_SUPPORT) +/** + * @brief Configure PLL used for SYSCLK Domain + * @rmtoll CFGR PLLSRC LL_RCC_PLL_ConfigDomain_SYS\n + * CFGR PLLMUL LL_RCC_PLL_ConfigDomain_SYS\n + * CFGR2 PREDIV LL_RCC_PLL_ConfigDomain_SYS + * @param Source This parameter can be one of the following values: + * @arg @ref LL_RCC_PLLSOURCE_HSI + * @arg @ref LL_RCC_PLLSOURCE_HSE + * @param PLLMul This parameter can be one of the following values: + * @arg @ref LL_RCC_PLL_MUL_2 + * @arg @ref LL_RCC_PLL_MUL_3 + * @arg @ref LL_RCC_PLL_MUL_4 + * @arg @ref LL_RCC_PLL_MUL_5 + * @arg @ref LL_RCC_PLL_MUL_6 + * @arg @ref LL_RCC_PLL_MUL_7 + * @arg @ref LL_RCC_PLL_MUL_8 + * @arg @ref LL_RCC_PLL_MUL_9 + * @arg @ref LL_RCC_PLL_MUL_10 + * @arg @ref LL_RCC_PLL_MUL_11 + * @arg @ref LL_RCC_PLL_MUL_12 + * @arg @ref LL_RCC_PLL_MUL_13 + * @arg @ref LL_RCC_PLL_MUL_14 + * @arg @ref LL_RCC_PLL_MUL_15 + * @arg @ref LL_RCC_PLL_MUL_16 + * @param PLLDiv This parameter can be one of the following values: + * @arg @ref LL_RCC_PREDIV_DIV_1 + * @arg @ref LL_RCC_PREDIV_DIV_2 + * @arg @ref LL_RCC_PREDIV_DIV_3 + * @arg @ref LL_RCC_PREDIV_DIV_4 + * @arg @ref LL_RCC_PREDIV_DIV_5 + * @arg @ref LL_RCC_PREDIV_DIV_6 + * @arg @ref LL_RCC_PREDIV_DIV_7 + * @arg @ref LL_RCC_PREDIV_DIV_8 + * @arg @ref LL_RCC_PREDIV_DIV_9 + * @arg @ref LL_RCC_PREDIV_DIV_10 + * @arg @ref LL_RCC_PREDIV_DIV_11 + * @arg @ref LL_RCC_PREDIV_DIV_12 + * @arg @ref LL_RCC_PREDIV_DIV_13 + * @arg @ref LL_RCC_PREDIV_DIV_14 + * @arg @ref LL_RCC_PREDIV_DIV_15 + * @arg @ref LL_RCC_PREDIV_DIV_16 + * @retval None + */ +__STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLMul, uint32_t PLLDiv) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_PLLSRC | RCC_CFGR_PLLMUL, Source | PLLMul); + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV, PLLDiv); +} + +#else + +/** + * @brief Configure PLL used for SYSCLK Domain + * @rmtoll CFGR PLLSRC LL_RCC_PLL_ConfigDomain_SYS\n + * CFGR PLLMUL LL_RCC_PLL_ConfigDomain_SYS\n + * CFGR2 PREDIV LL_RCC_PLL_ConfigDomain_SYS + * @param Source This parameter can be one of the following values: + * @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_1 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_2 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_3 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_4 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_5 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_6 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_7 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_8 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_9 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_10 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_11 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_12 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_13 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_14 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_15 + * @arg @ref LL_RCC_PLLSOURCE_HSE_DIV_16 + * @param PLLMul This parameter can be one of the following values: + * @arg @ref LL_RCC_PLL_MUL_2 + * @arg @ref LL_RCC_PLL_MUL_3 + * @arg @ref LL_RCC_PLL_MUL_4 + * @arg @ref LL_RCC_PLL_MUL_5 + * @arg @ref LL_RCC_PLL_MUL_6 + * @arg @ref LL_RCC_PLL_MUL_7 + * @arg @ref LL_RCC_PLL_MUL_8 + * @arg @ref LL_RCC_PLL_MUL_9 + * @arg @ref LL_RCC_PLL_MUL_10 + * @arg @ref LL_RCC_PLL_MUL_11 + * @arg @ref LL_RCC_PLL_MUL_12 + * @arg @ref LL_RCC_PLL_MUL_13 + * @arg @ref LL_RCC_PLL_MUL_14 + * @arg @ref LL_RCC_PLL_MUL_15 + * @arg @ref LL_RCC_PLL_MUL_16 + * @retval None + */ +__STATIC_INLINE void LL_RCC_PLL_ConfigDomain_SYS(uint32_t Source, uint32_t PLLMul) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_PLLSRC | RCC_CFGR_PLLMUL, (Source & RCC_CFGR_PLLSRC) | PLLMul); + MODIFY_REG(RCC->CFGR2, RCC_CFGR2_PREDIV, (Source & RCC_CFGR2_PREDIV)); +} +#endif /* RCC_PLLSRC_PREDIV1_SUPPORT */ + +/** + * @brief Configure PLL clock source + * @rmtoll CFGR PLLSRC LL_RCC_PLL_SetMainSource + * @param PLLSource This parameter can be one of the following values: + * @arg @ref LL_RCC_PLLSOURCE_NONE + * @arg @ref LL_RCC_PLLSOURCE_HSI (*) + * @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2 (*) + * @arg @ref LL_RCC_PLLSOURCE_HSE + * @arg @ref LL_RCC_PLLSOURCE_HSI48 (*) + * + * (*) value not defined in all devices + * @retval None + */ +__STATIC_INLINE void LL_RCC_PLL_SetMainSource(uint32_t PLLSource) +{ + MODIFY_REG(RCC->CFGR, RCC_CFGR_PLLSRC, PLLSource); +} + +/** + * @brief Get the oscillator used as PLL clock source. + * @rmtoll CFGR PLLSRC LL_RCC_PLL_GetMainSource + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_PLLSOURCE_NONE + * @arg @ref LL_RCC_PLLSOURCE_HSI (*) + * @arg @ref LL_RCC_PLLSOURCE_HSI_DIV_2 (*) + * @arg @ref LL_RCC_PLLSOURCE_HSE + * + * (*) value not defined in all devices + */ +__STATIC_INLINE uint32_t LL_RCC_PLL_GetMainSource(void) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLSRC)); +} + +/** + * @brief Get PLL multiplication Factor + * @rmtoll CFGR PLLMUL LL_RCC_PLL_GetMultiplicator + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_PLL_MUL_2 + * @arg @ref LL_RCC_PLL_MUL_3 + * @arg @ref LL_RCC_PLL_MUL_4 + * @arg @ref LL_RCC_PLL_MUL_5 + * @arg @ref LL_RCC_PLL_MUL_6 + * @arg @ref LL_RCC_PLL_MUL_7 + * @arg @ref LL_RCC_PLL_MUL_8 + * @arg @ref LL_RCC_PLL_MUL_9 + * @arg @ref LL_RCC_PLL_MUL_10 + * @arg @ref LL_RCC_PLL_MUL_11 + * @arg @ref LL_RCC_PLL_MUL_12 + * @arg @ref LL_RCC_PLL_MUL_13 + * @arg @ref LL_RCC_PLL_MUL_14 + * @arg @ref LL_RCC_PLL_MUL_15 + * @arg @ref LL_RCC_PLL_MUL_16 + */ +__STATIC_INLINE uint32_t LL_RCC_PLL_GetMultiplicator(void) +{ + return (uint32_t)(READ_BIT(RCC->CFGR, RCC_CFGR_PLLMUL)); +} + +/** + * @brief Get PREDIV division factor for the main PLL + * @note They can be written only when the PLL is disabled + * @rmtoll CFGR2 PREDIV LL_RCC_PLL_GetPrediv + * @retval Returned value can be one of the following values: + * @arg @ref LL_RCC_PREDIV_DIV_1 + * @arg @ref LL_RCC_PREDIV_DIV_2 + * @arg @ref LL_RCC_PREDIV_DIV_3 + * @arg @ref LL_RCC_PREDIV_DIV_4 + * @arg @ref LL_RCC_PREDIV_DIV_5 + * @arg @ref LL_RCC_PREDIV_DIV_6 + * @arg @ref LL_RCC_PREDIV_DIV_7 + * @arg @ref LL_RCC_PREDIV_DIV_8 + * @arg @ref LL_RCC_PREDIV_DIV_9 + * @arg @ref LL_RCC_PREDIV_DIV_10 + * @arg @ref LL_RCC_PREDIV_DIV_11 + * @arg @ref LL_RCC_PREDIV_DIV_12 + * @arg @ref LL_RCC_PREDIV_DIV_13 + * @arg @ref LL_RCC_PREDIV_DIV_14 + * @arg @ref LL_RCC_PREDIV_DIV_15 + * @arg @ref LL_RCC_PREDIV_DIV_16 + */ +__STATIC_INLINE uint32_t LL_RCC_PLL_GetPrediv(void) +{ + return (uint32_t)(READ_BIT(RCC->CFGR2, RCC_CFGR2_PREDIV)); +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_FLAG_Management FLAG Management + * @{ + */ + +/** + * @brief Clear LSI ready interrupt flag + * @rmtoll CIR LSIRDYC LL_RCC_ClearFlag_LSIRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_ClearFlag_LSIRDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_LSIRDYC); +} + +/** + * @brief Clear LSE ready interrupt flag + * @rmtoll CIR LSERDYC LL_RCC_ClearFlag_LSERDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_ClearFlag_LSERDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_LSERDYC); +} + +/** + * @brief Clear HSI ready interrupt flag + * @rmtoll CIR HSIRDYC LL_RCC_ClearFlag_HSIRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_ClearFlag_HSIRDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_HSIRDYC); +} + +/** + * @brief Clear HSE ready interrupt flag + * @rmtoll CIR HSERDYC LL_RCC_ClearFlag_HSERDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_ClearFlag_HSERDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_HSERDYC); +} + +/** + * @brief Clear PLL ready interrupt flag + * @rmtoll CIR PLLRDYC LL_RCC_ClearFlag_PLLRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_ClearFlag_PLLRDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_PLLRDYC); +} + +/** + * @brief Clear Clock security system interrupt flag + * @rmtoll CIR CSSC LL_RCC_ClearFlag_HSECSS + * @retval None + */ +__STATIC_INLINE void LL_RCC_ClearFlag_HSECSS(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_CSSC); +} + +/** + * @brief Check if LSI ready interrupt occurred or not + * @rmtoll CIR LSIRDYF LL_RCC_IsActiveFlag_LSIRDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSIRDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_LSIRDYF) == (RCC_CIR_LSIRDYF)); +} + +/** + * @brief Check if LSE ready interrupt occurred or not + * @rmtoll CIR LSERDYF LL_RCC_IsActiveFlag_LSERDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LSERDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_LSERDYF) == (RCC_CIR_LSERDYF)); +} + +/** + * @brief Check if HSI ready interrupt occurred or not + * @rmtoll CIR HSIRDYF LL_RCC_IsActiveFlag_HSIRDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSIRDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_HSIRDYF) == (RCC_CIR_HSIRDYF)); +} + +/** + * @brief Check if HSE ready interrupt occurred or not + * @rmtoll CIR HSERDYF LL_RCC_IsActiveFlag_HSERDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSERDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_HSERDYF) == (RCC_CIR_HSERDYF)); +} + +#if defined(RCC_CFGR_MCOF) +/** + * @brief Check if switch to new MCO source is effective or not + * @rmtoll CFGR MCOF LL_RCC_IsActiveFlag_MCO1 + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_MCO1(void) +{ + return (READ_BIT(RCC->CFGR, RCC_CFGR_MCOF) == (RCC_CFGR_MCOF)); +} +#endif /* RCC_CFGR_MCOF */ + +/** + * @brief Check if PLL ready interrupt occurred or not + * @rmtoll CIR PLLRDYF LL_RCC_IsActiveFlag_PLLRDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PLLRDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_PLLRDYF) == (RCC_CIR_PLLRDYF)); +} + +/** + * @brief Check if Clock security system interrupt occurred or not + * @rmtoll CIR CSSF LL_RCC_IsActiveFlag_HSECSS + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_HSECSS(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_CSSF) == (RCC_CIR_CSSF)); +} + +/** + * @brief Check if RCC flag Independent Watchdog reset is set or not. + * @rmtoll CSR IWDGRSTF LL_RCC_IsActiveFlag_IWDGRST + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_IWDGRST(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_IWDGRSTF) == (RCC_CSR_IWDGRSTF)); +} + +/** + * @brief Check if RCC flag Low Power reset is set or not. + * @rmtoll CSR LPWRRSTF LL_RCC_IsActiveFlag_LPWRRST + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_LPWRRST(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_LPWRRSTF) == (RCC_CSR_LPWRRSTF)); +} + +/** + * @brief Check if RCC flag is set or not. + * @rmtoll CSR OBLRSTF LL_RCC_IsActiveFlag_OBLRST + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_OBLRST(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_OBLRSTF) == (RCC_CSR_OBLRSTF)); +} + +/** + * @brief Check if RCC flag Pin reset is set or not. + * @rmtoll CSR PINRSTF LL_RCC_IsActiveFlag_PINRST + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PINRST(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_PINRSTF) == (RCC_CSR_PINRSTF)); +} + +/** + * @brief Check if RCC flag POR/PDR reset is set or not. + * @rmtoll CSR PORRSTF LL_RCC_IsActiveFlag_PORRST + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_PORRST(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_PORRSTF) == (RCC_CSR_PORRSTF)); +} + +/** + * @brief Check if RCC flag Software reset is set or not. + * @rmtoll CSR SFTRSTF LL_RCC_IsActiveFlag_SFTRST + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_SFTRST(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_SFTRSTF) == (RCC_CSR_SFTRSTF)); +} + +/** + * @brief Check if RCC flag Window Watchdog reset is set or not. + * @rmtoll CSR WWDGRSTF LL_RCC_IsActiveFlag_WWDGRST + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_WWDGRST(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_WWDGRSTF) == (RCC_CSR_WWDGRSTF)); +} + +#if defined(RCC_CSR_V18PWRRSTF) +/** + * @brief Check if RCC Reset flag of the 1.8 V domain is set or not. + * @rmtoll CSR V18PWRRSTF LL_RCC_IsActiveFlag_V18PWRRST + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsActiveFlag_V18PWRRST(void) +{ + return (READ_BIT(RCC->CSR, RCC_CSR_V18PWRRSTF) == (RCC_CSR_V18PWRRSTF)); +} +#endif /* RCC_CSR_V18PWRRSTF */ + +/** + * @brief Set RMVF bit to clear the reset flags. + * @rmtoll CSR RMVF LL_RCC_ClearResetFlags + * @retval None + */ +__STATIC_INLINE void LL_RCC_ClearResetFlags(void) +{ + SET_BIT(RCC->CSR, RCC_CSR_RMVF); +} + +/** + * @} + */ + +/** @defgroup RCC_LL_EF_IT_Management IT Management + * @{ + */ + +/** + * @brief Enable LSI ready interrupt + * @rmtoll CIR LSIRDYIE LL_RCC_EnableIT_LSIRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_EnableIT_LSIRDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_LSIRDYIE); +} + +/** + * @brief Enable LSE ready interrupt + * @rmtoll CIR LSERDYIE LL_RCC_EnableIT_LSERDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_EnableIT_LSERDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_LSERDYIE); +} + +/** + * @brief Enable HSI ready interrupt + * @rmtoll CIR HSIRDYIE LL_RCC_EnableIT_HSIRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_EnableIT_HSIRDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_HSIRDYIE); +} + +/** + * @brief Enable HSE ready interrupt + * @rmtoll CIR HSERDYIE LL_RCC_EnableIT_HSERDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_EnableIT_HSERDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_HSERDYIE); +} + +/** + * @brief Enable PLL ready interrupt + * @rmtoll CIR PLLRDYIE LL_RCC_EnableIT_PLLRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_EnableIT_PLLRDY(void) +{ + SET_BIT(RCC->CIR, RCC_CIR_PLLRDYIE); +} + +/** + * @brief Disable LSI ready interrupt + * @rmtoll CIR LSIRDYIE LL_RCC_DisableIT_LSIRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_DisableIT_LSIRDY(void) +{ + CLEAR_BIT(RCC->CIR, RCC_CIR_LSIRDYIE); +} + +/** + * @brief Disable LSE ready interrupt + * @rmtoll CIR LSERDYIE LL_RCC_DisableIT_LSERDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_DisableIT_LSERDY(void) +{ + CLEAR_BIT(RCC->CIR, RCC_CIR_LSERDYIE); +} + +/** + * @brief Disable HSI ready interrupt + * @rmtoll CIR HSIRDYIE LL_RCC_DisableIT_HSIRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_DisableIT_HSIRDY(void) +{ + CLEAR_BIT(RCC->CIR, RCC_CIR_HSIRDYIE); +} + +/** + * @brief Disable HSE ready interrupt + * @rmtoll CIR HSERDYIE LL_RCC_DisableIT_HSERDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_DisableIT_HSERDY(void) +{ + CLEAR_BIT(RCC->CIR, RCC_CIR_HSERDYIE); +} + +/** + * @brief Disable PLL ready interrupt + * @rmtoll CIR PLLRDYIE LL_RCC_DisableIT_PLLRDY + * @retval None + */ +__STATIC_INLINE void LL_RCC_DisableIT_PLLRDY(void) +{ + CLEAR_BIT(RCC->CIR, RCC_CIR_PLLRDYIE); +} + +/** + * @brief Checks if LSI ready interrupt source is enabled or disabled. + * @rmtoll CIR LSIRDYIE LL_RCC_IsEnabledIT_LSIRDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_LSIRDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_LSIRDYIE) == (RCC_CIR_LSIRDYIE)); +} + +/** + * @brief Checks if LSE ready interrupt source is enabled or disabled. + * @rmtoll CIR LSERDYIE LL_RCC_IsEnabledIT_LSERDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_LSERDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_LSERDYIE) == (RCC_CIR_LSERDYIE)); +} + +/** + * @brief Checks if HSI ready interrupt source is enabled or disabled. + * @rmtoll CIR HSIRDYIE LL_RCC_IsEnabledIT_HSIRDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSIRDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_HSIRDYIE) == (RCC_CIR_HSIRDYIE)); +} + +/** + * @brief Checks if HSE ready interrupt source is enabled or disabled. + * @rmtoll CIR HSERDYIE LL_RCC_IsEnabledIT_HSERDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_HSERDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_HSERDYIE) == (RCC_CIR_HSERDYIE)); +} + +/** + * @brief Checks if PLL ready interrupt source is enabled or disabled. + * @rmtoll CIR PLLRDYIE LL_RCC_IsEnabledIT_PLLRDY + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_RCC_IsEnabledIT_PLLRDY(void) +{ + return (READ_BIT(RCC->CIR, RCC_CIR_PLLRDYIE) == (RCC_CIR_PLLRDYIE)); +} + +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup RCC_LL_EF_Init De-initialization function + * @{ + */ +ErrorStatus LL_RCC_DeInit(void); +/** + * @} + */ + +/** @defgroup RCC_LL_EF_Get_Freq Get system and peripherals clocks frequency functions + * @{ + */ +void LL_RCC_GetSystemClocksFreq(LL_RCC_ClocksTypeDef *RCC_Clocks); +uint32_t LL_RCC_GetUSARTClockFreq(uint32_t USARTxSource); +#if defined(UART4) || defined(UART5) +uint32_t LL_RCC_GetUARTClockFreq(uint32_t UARTxSource); +#endif /* UART4 || UART5 */ +uint32_t LL_RCC_GetI2CClockFreq(uint32_t I2CxSource); +#if defined(RCC_CFGR_I2SSRC) +uint32_t LL_RCC_GetI2SClockFreq(uint32_t I2SxSource); +#endif /* RCC_CFGR_I2SSRC */ +#if defined(USB_OTG_FS) || defined(USB) +uint32_t LL_RCC_GetUSBClockFreq(uint32_t USBxSource); +#endif /* USB_OTG_FS || USB */ +#if (defined(RCC_CFGR_ADCPRE) || defined(RCC_CFGR2_ADC1PRES) || defined(RCC_CFGR2_ADCPRE12) || defined(RCC_CFGR2_ADCPRE34)) +uint32_t LL_RCC_GetADCClockFreq(uint32_t ADCxSource); +#endif /*RCC_CFGR_ADCPRE || RCC_CFGR2_ADC1PRES || RCC_CFGR2_ADCPRE12 || RCC_CFGR2_ADCPRE34 */ +#if defined(RCC_CFGR_SDPRE) +uint32_t LL_RCC_GetSDADCClockFreq(uint32_t SDADCxSource); +#endif /*RCC_CFGR_SDPRE */ +#if defined(CEC) +uint32_t LL_RCC_GetCECClockFreq(uint32_t CECxSource); +#endif /* CEC */ +#if defined(RCC_CFGR3_TIMSW) +uint32_t LL_RCC_GetTIMClockFreq(uint32_t TIMxSource); +#endif /*RCC_CFGR3_TIMSW*/ +uint32_t LL_RCC_GetHRTIMClockFreq(uint32_t HRTIMxSource); +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* RCC */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_RCC_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_system.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_system.h new file mode 100644 index 0000000..52daf8c --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_system.h @@ -0,0 +1,1725 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_system.h + * @author MCD Application Team + * @brief Header file of SYSTEM LL module. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + The LL SYSTEM driver contains a set of generic APIs that can be + used by user: + (+) Some of the FLASH features need to be handled in the SYSTEM file. + (+) Access to DBGCMU registers + (+) Access to SYSCFG registers + + @endverbatim + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_SYSTEM_H +#define __STM32F3xx_LL_SYSTEM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined (FLASH) || defined (SYSCFG) || defined (DBGMCU) + +/** @defgroup SYSTEM_LL SYSTEM + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup SYSTEM_LL_Private_Constants SYSTEM Private Constants + * @{ + */ + +/* Offset used to access to SYSCFG_CFGR1 and SYSCFG_CFGR3 registers */ +#define SYSCFG_OFFSET_CFGR1 0x00000000U +#define SYSCFG_OFFSET_CFGR3 0x00000050U + +/* Mask used for TIM breaks functions */ +#if defined(SYSCFG_CFGR2_PVD_LOCK) && defined(SYSCFG_CFGR2_SRAM_PARITY_LOCK) +#define SYSCFG_MASK_TIM_BREAK (SYSCFG_CFGR2_LOCKUP_LOCK | SYSCFG_CFGR2_SRAM_PARITY_LOCK | SYSCFG_CFGR2_PVD_LOCK) +#elif defined(SYSCFG_CFGR2_PVD_LOCK) && !defined(SYSCFG_CFGR2_SRAM_PARITY_LOCK) +#define SYSCFG_MASK_TIM_BREAK (SYSCFG_CFGR2_LOCKUP_LOCK | SYSCFG_CFGR2_PVD_LOCK) +#elif !defined(SYSCFG_CFGR2_PVD_LOCK) && defined(SYSCFG_CFGR2_SRAM_PARITY_LOCK) +#define SYSCFG_MASK_TIM_BREAK (SYSCFG_CFGR2_LOCKUP_LOCK | SYSCFG_CFGR2_SRAM_PARITY_LOCK) +#else +#define SYSCFG_MASK_TIM_BREAK (SYSCFG_CFGR2_LOCKUP_LOCK) +#endif /* SYSCFG_CFGR2_PVD_LOCK && SYSCFG_CFGR2_SRAM_PARITY_LOCK */ + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/** @defgroup SYSTEM_LL_Exported_Constants SYSTEM Exported Constants + * @{ + */ + +/** @defgroup SYSTEM_LL_EC_REMAP SYSCFG REMAP + * @{ + */ +#define LL_SYSCFG_REMAP_FLASH (uint32_t)0x00000000 /* Main Flash memory mapped at 0x00000000 */ +#define LL_SYSCFG_REMAP_SYSTEMFLASH SYSCFG_CFGR1_MEM_MODE_0 /* System Flash memory mapped at 0x00000000 */ +#define LL_SYSCFG_REMAP_SRAM (SYSCFG_CFGR1_MEM_MODE_1 | SYSCFG_CFGR1_MEM_MODE_0) /* Embedded SRAM mapped at 0x00000000 */ +#if defined(FMC_BANK1) +#define LL_SYSCFG_REMAP_FMC SYSCFG_CFGR1_MEM_MODE_2 /*CFGR1, SYSCFG_CFGR1_MEM_MODE, Memory); +} + +/** + * @brief Get memory mapping at address 0x00000000 + * @rmtoll SYSCFG_CFGR1 MEM_MODE LL_SYSCFG_GetRemapMemory + * @retval Returned value can be one of the following values: + * @arg @ref LL_SYSCFG_REMAP_FLASH + * @arg @ref LL_SYSCFG_REMAP_SYSTEMFLASH + * @arg @ref LL_SYSCFG_REMAP_SRAM + * @arg @ref LL_SYSCFG_REMAP_FMC (*) + * + * (*) value not defined in all devices. + */ +__STATIC_INLINE uint32_t LL_SYSCFG_GetRemapMemory(void) +{ + return (uint32_t)(READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_MEM_MODE)); +} + +#if defined(SYSCFG_CFGR3_SPI1_RX_DMA_RMP) +/** + * @brief Set DMA request remapping bits for SPI + * @rmtoll SYSCFG_CFGR3 SPI1_RX_DMA_RMP LL_SYSCFG_SetRemapDMA_SPI\n + * SYSCFG_CFGR3 SPI1_TX_DMA_RMP LL_SYSCFG_SetRemapDMA_SPI + * @param Remap This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_SPI1RX_RMP_DMA1_CH2 + * @arg @ref LL_SYSCFG_SPI1RX_RMP_DMA1_CH4 + * @arg @ref LL_SYSCFG_SPI1RX_RMP_DMA1_CH6 + * @arg @ref LL_SYSCFG_SPI1TX_RMP_DMA1_CH3 + * @arg @ref LL_SYSCFG_SPI1TX_RMP_DMA1_CH5 + * @arg @ref LL_SYSCFG_SPI1TX_RMP_DMA1_CH7 + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetRemapDMA_SPI(uint32_t Remap) +{ + MODIFY_REG(SYSCFG->CFGR3, (Remap >> 16U), (Remap & 0x0000FFFF)); +} +#endif /* SYSCFG_CFGR3_SPI1_RX_DMA_RMP */ + +#if defined(SYSCFG_CFGR3_I2C1_RX_DMA_RMP) +/** + * @brief Set DMA request remapping bits for I2C + * @rmtoll SYSCFG_CFGR3 I2C1_RX_DMA_RMP LL_SYSCFG_SetRemapDMA_I2C\n + * SYSCFG_CFGR3 I2C1_TX_DMA_RMP LL_SYSCFG_SetRemapDMA_I2C + * @param Remap This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_I2C1RX_RMP_DMA1_CH7 + * @arg @ref LL_SYSCFG_I2C1RX_RMP_DMA1_CH3 + * @arg @ref LL_SYSCFG_I2C1RX_RMP_DMA1_CH5 + * @arg @ref LL_SYSCFG_I2C1TX_RMP_DMA1_CH6 + * @arg @ref LL_SYSCFG_I2C1TX_RMP_DMA1_CH2 + * @arg @ref LL_SYSCFG_I2C1TX_RMP_DMA1_CH4 + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetRemapDMA_I2C(uint32_t Remap) +{ + MODIFY_REG(SYSCFG->CFGR3, (Remap >> 16U), (Remap & 0x0000FFFF)); +} +#endif /* SYSCFG_CFGR3_I2C1_RX_DMA_RMP */ + +#if defined(SYSCFG_CFGR1_ADC24_DMA_RMP) || defined(SYSCFG_CFGR3_ADC2_DMA_RMP) +/** + * @brief Set DMA request remapping bits for ADC + * @rmtoll SYSCFG_CFGR1 ADC24_DMA_RMP LL_SYSCFG_SetRemapDMA_ADC\n + * SYSCFG_CFGR3 ADC2_DMA_RMP LL_SYSCFG_SetRemapDMA_ADC + * @param Remap This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_ADC24_RMP_DMA2_CH12 (*) + * @arg @ref LL_SYSCFG_ADC24_RMP_DMA2_CH34 (*) + * @arg @ref LL_SYSCFG_ADC2_RMP_DMA1_CH2 (*) + * @arg @ref LL_SYSCFG_ADC2_RMP_DMA1_CH4 (*) + * @arg @ref LL_SYSCFG_ADC2_RMP_DMA2 (*) + * @arg @ref LL_SYSCFG_ADC2_RMP_DMA1 (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetRemapDMA_ADC(uint32_t Remap) +{ + __IO uint32_t *reg = (__IO uint32_t *)(uint32_t)(SYSCFG_BASE + (Remap >> 24U)); + MODIFY_REG(*reg, (Remap & 0x00FF0000U) >> 8U, (Remap & 0x0000FFFFU)); +} +#endif /* SYSCFG_CFGR1_ADC24_DMA_RMP || SYSCFG_CFGR3_ADC2_DMA_RMP */ + +/** + * @brief Set DMA request remapping bits for DAC + * @rmtoll SYSCFG_CFGR1 TIM6DAC1Ch1_DMA_RMP LL_SYSCFG_SetRemapDMA_DAC\n + * SYSCFG_CFGR1 DAC2Ch1_DMA_RMP LL_SYSCFG_SetRemapDMA_DAC + * @param Remap This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_DAC1_CH1_RMP_DMA2_CH3 + * @arg @ref LL_SYSCFG_DAC1_CH1_RMP_DMA1_CH3 + * @arg @ref LL_SYSCFG_DAC1_OUT2_RMP_DMA2_CH4 (*) + * @arg @ref LL_SYSCFG_DAC1_OUT2_RMP_DMA1_CH4 (*) + * @arg @ref LL_SYSCFG_DAC2_OUT1_RMP_DMA2_CH5 (*) + * @arg @ref LL_SYSCFG_DAC2_OUT1_RMP_DMA1_CH5 (*) + * @arg @ref LL_SYSCFG_DAC2_CH1_RMP_NO (*) + * @arg @ref LL_SYSCFG_DAC2_CH1_RMP_DMA1_CH5 (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetRemapDMA_DAC(uint32_t Remap) +{ + MODIFY_REG(SYSCFG->CFGR1, (Remap & 0x00FF0000U) >> 8U, (Remap & 0x0000FF00U)); +} + +/** + * @brief Set DMA request remapping bits for TIM + * @rmtoll SYSCFG_CFGR1 TIM16_DMA_RMP LL_SYSCFG_SetRemapDMA_TIM\n + * SYSCFG_CFGR1 TIM17_DMA_RMP LL_SYSCFG_SetRemapDMA_TIM\n + * SYSCFG_CFGR1 TIM6DAC1Ch1_DMA_RMP LL_SYSCFG_SetRemapDMA_TIM\n + * SYSCFG_CFGR1 TIM7DAC1Ch2_DMA_RMP LL_SYSCFG_SetRemapDMA_TIM\n + * SYSCFG_CFGR1 TIM18DAC2Ch1_DMA_RMP LL_SYSCFG_SetRemapDMA_TIM + * @param Remap This parameter can be a combination of the following values: + * @arg @ref LL_SYSCFG_TIM16_RMP_DMA1_CH3 or @ref LL_SYSCFG_TIM16_RMP_DMA1_CH6 + * @arg @ref LL_SYSCFG_TIM17_RMP_DMA1_CH1 or @ref LL_SYSCFG_TIM17_RMP_DMA1_CH7 + * @arg @ref LL_SYSCFG_TIM6_RMP_DMA2_CH3 or @ref LL_SYSCFG_TIM6_RMP_DMA1_CH3 + * @arg @ref LL_SYSCFG_TIM7_RMP_DMA2_CH4 or @ref LL_SYSCFG_TIM7_RMP_DMA1_CH4 (*) + * @arg @ref LL_SYSCFG_TIM18_RMP_DMA2_CH5 or @ref LL_SYSCFG_TIM18_RMP_DMA1_CH5 (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetRemapDMA_TIM(uint32_t Remap) +{ + MODIFY_REG(SYSCFG->CFGR1, (Remap & 0x00FF0000U) >> 8U, (Remap & 0x0000FF00U)); +} + +#if defined(SYSCFG_CFGR1_TIM1_ITR3_RMP) || defined(SYSCFG_CFGR1_ENCODER_MODE) +/** + * @brief Set Timer input remap + * @rmtoll SYSCFG_CFGR1 TIM1_ITR3_RMP LL_SYSCFG_SetRemapInput_TIM\n + * SYSCFG_CFGR1 ENCODER_MODE LL_SYSCFG_SetRemapInput_TIM + * @param Remap This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_TIM1_ITR3_RMP_TIM4_TRGO (*) + * @arg @ref LL_SYSCFG_TIM1_ITR3_RMP_TIM17_OC (*) + * @arg @ref LL_SYSCFG_TIM15_ENCODEMODE_NOREDIRECTION (*) + * @arg @ref LL_SYSCFG_TIM15_ENCODEMODE_TIM2 (*) + * @arg @ref LL_SYSCFG_TIM15_ENCODEMODE_TIM3 (*) + * @arg @ref LL_SYSCFG_TIM15_ENCODEMODE_TIM4 (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetRemapInput_TIM(uint32_t Remap) +{ + MODIFY_REG(SYSCFG->CFGR1, (Remap & 0xFF00FF00U) >> 8U, (Remap & 0x00FF00FFU)); +} +#endif /* SYSCFG_CFGR1_TIM1_ITR3_RMP || SYSCFG_CFGR1_ENCODER_MODE */ + +#if defined(SYSCFG_CFGR4_ADC12_EXT2_RMP) +/** + * @brief Set ADC Trigger remap + * @rmtoll SYSCFG_CFGR4 ADC12_EXT2_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC12_EXT3_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC12_EXT5_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC12_EXT13_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC12_EXT15_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC12_JEXT3_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC12_JEXT6_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC12_JEXT13_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC34_EXT5_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC34_EXT6_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC34_EXT15_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC34_JEXT5_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC34_JEXT11_RMP LL_SYSCFG_SetRemapTrigger_ADC\n + * SYSCFG_CFGR4 ADC34_JEXT14_RMP LL_SYSCFG_SetRemapTrigger_ADC + * @param Remap This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_ADC12_EXT2_RMP_TIM1_CC3 + * @arg @ref LL_SYSCFG_ADC12_EXT2_RMP_TIM20_TRGO + * @arg @ref LL_SYSCFG_ADC12_EXT3_RMP_TIM2_CC2 + * @arg @ref LL_SYSCFG_ADC12_EXT3_RMP_TIM20_TRGO2 + * @arg @ref LL_SYSCFG_ADC12_EXT5_RMP_TIM4_CC4 + * @arg @ref LL_SYSCFG_ADC12_EXT5_RMP_TIM20_CC1 + * @arg @ref LL_SYSCFG_ADC12_EXT13_RMP_TIM6_TRGO + * @arg @ref LL_SYSCFG_ADC12_EXT13_RMP_TIM20_CC2 + * @arg @ref LL_SYSCFG_ADC12_EXT15_RMP_TIM3_CC4 + * @arg @ref LL_SYSCFG_ADC12_EXT15_RMP_TIM20_CC3 + * @arg @ref LL_SYSCFG_ADC12_JEXT3_RMP_TIM2_CC1 + * @arg @ref LL_SYSCFG_ADC12_JEXT3_RMP_TIM20_TRGO + * @arg @ref LL_SYSCFG_ADC12_JEXT6_RMP_EXTI_LINE_15 + * @arg @ref LL_SYSCFG_ADC12_JEXT6_RMP_TIM20_TRGO2 + * @arg @ref LL_SYSCFG_ADC12_JEXT13_RMP_TIM3_CC1 + * @arg @ref LL_SYSCFG_ADC12_JEXT13_RMP_TIM20_CC4 + * @arg @ref LL_SYSCFG_ADC34_EXT5_RMP_EXTI_LINE_2 + * @arg @ref LL_SYSCFG_ADC34_EXT5_RMP_TIM20_TRGO + * @arg @ref LL_SYSCFG_ADC34_EXT6_RMP_TIM4_CC1 + * @arg @ref LL_SYSCFG_ADC34_EXT6_RMP_TIM20_TRGO2 + * @arg @ref LL_SYSCFG_ADC34_EXT15_RMP_TIM2_CC1 + * @arg @ref LL_SYSCFG_ADC34_EXT15_RMP_TIM20_CC1 + * @arg @ref LL_SYSCFG_ADC34_JEXT5_RMP_TIM4_CC3 + * @arg @ref LL_SYSCFG_ADC34_JEXT5_RMP_TIM20_TRGO + * @arg @ref LL_SYSCFG_ADC34_JEXT11_RMP_TIM1_CC3 + * @arg @ref LL_SYSCFG_ADC34_JEXT11_RMP_TIM20_TRGO2 + * @arg @ref LL_SYSCFG_ADC34_JEXT14_RMP_TIM7_TRGO + * @arg @ref LL_SYSCFG_ADC34_JEXT14_RMP_TIM20_CC2 + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetRemapTrigger_ADC(uint32_t Remap) +{ + MODIFY_REG(SYSCFG->CFGR4, (Remap & 0xFFFF0000U) >> 16U, (Remap & 0x0000FFFFU)); +} +#endif /* SYSCFG_CFGR4_ADC12_EXT2_RMP */ + +#if defined(SYSCFG_CFGR1_DAC1_TRIG1_RMP) || defined(SYSCFG_CFGR3_TRIGGER_RMP) +/** + * @brief Set DAC Trigger remap + * @rmtoll SYSCFG_CFGR1 DAC1_TRIG1_RMP LL_SYSCFG_SetRemapTrigger_DAC\n + * SYSCFG_CFGR3 DAC1_TRG3_RMP LL_SYSCFG_SetRemapTrigger_DAC\n + * SYSCFG_CFGR3 DAC1_TRG5_RMP LL_SYSCFG_SetRemapTrigger_DAC + * @param Remap This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_DAC1_TRIG1_RMP_TIM8_TRGO (*) + * @arg @ref LL_SYSCFG_DAC1_TRIG1_RMP_TIM3_TRGO (*) + * @arg @ref LL_SYSCFG_DAC1_TRIG3_RMP_TIM15_TRGO (*) + * @arg @ref LL_SYSCFG_DAC1_TRIG3_RMP_HRTIM1_DAC1_TRIG1 (*) + * @arg @ref LL_SYSCFG_DAC1_TRIG5_RMP_NO (*) + * @arg @ref LL_SYSCFG_DAC1_TRIG5_RMP_HRTIM1_DAC1_TRIG2 (*) + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetRemapTrigger_DAC(uint32_t Remap) +{ + __IO uint32_t *reg = (__IO uint32_t *)(uint32_t)(SYSCFG_BASE + (Remap >> 24U)); + MODIFY_REG(*reg, (Remap & 0x00F00F00U) >> 4U, (Remap & 0x000F00F0U)); +} +#endif /* SYSCFG_CFGR1_DAC1_TRIG1_RMP || SYSCFG_CFGR3_TRIGGER_RMP */ + +#if defined(SYSCFG_CFGR1_USB_IT_RMP) +/** + * @brief Enable USB interrupt remap + * @note Remap the USB interrupts (USB_HP, USB_LP and USB_WKUP) on interrupt lines 74, 75 and 76 + * respectively + * @rmtoll SYSCFG_CFGR1 USB_IT_RMP LL_SYSCFG_EnableRemapIT_USB + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableRemapIT_USB(void) +{ + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_USB_IT_RMP); +} + +/** + * @brief Disable USB interrupt remap + * @rmtoll SYSCFG_CFGR1 USB_IT_RMP LL_SYSCFG_DisableRemapIT_USB + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableRemapIT_USB(void) +{ + CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_USB_IT_RMP); +} +#endif /* SYSCFG_CFGR1_USB_IT_RMP */ + +#if defined(SYSCFG_CFGR1_VBAT) +/** + * @brief Enable VBAT monitoring (to enable the power switch to deliver VBAT voltage on ADC channel 18 input) + * @rmtoll SYSCFG_CFGR1 VBAT LL_SYSCFG_EnableVBATMonitoring + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableVBATMonitoring(void) +{ + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_VBAT); +} + +/** + * @brief Disable VBAT monitoring + * @rmtoll SYSCFG_CFGR1 VBAT LL_SYSCFG_DisableVBATMonitoring + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableVBATMonitoring(void) +{ + CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_VBAT); +} +#endif /* SYSCFG_CFGR1_VBAT */ + +/** + * @brief Enable the I2C fast mode plus driving capability. + * @rmtoll SYSCFG_CFGR1 I2C_PB6_FMP LL_SYSCFG_EnableFastModePlus\n + * SYSCFG_CFGR1 I2C_PB7_FMP LL_SYSCFG_EnableFastModePlus\n + * SYSCFG_CFGR1 I2C_PB8_FMP LL_SYSCFG_EnableFastModePlus\n + * SYSCFG_CFGR1 I2C_PB9_FMP LL_SYSCFG_EnableFastModePlus\n + * SYSCFG_CFGR1 I2C1_FMP LL_SYSCFG_EnableFastModePlus\n + * SYSCFG_CFGR1 I2C2_FMP LL_SYSCFG_EnableFastModePlus\n + * SYSCFG_CFGR1 I2C3_FMP LL_SYSCFG_EnableFastModePlus + * @param ConfigFastModePlus This parameter can be a combination of the following values: + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 (*) + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableFastModePlus(uint32_t ConfigFastModePlus) +{ + SET_BIT(SYSCFG->CFGR1, ConfigFastModePlus); +} + +/** + * @brief Disable the I2C fast mode plus driving capability. + * @rmtoll SYSCFG_CFGR1 I2C_PB6_FMP LL_SYSCFG_DisableFastModePlus\n + * SYSCFG_CFGR1 I2C_PB7_FMP LL_SYSCFG_DisableFastModePlus\n + * SYSCFG_CFGR1 I2C_PB8_FMP LL_SYSCFG_DisableFastModePlus\n + * SYSCFG_CFGR1 I2C_PB9_FMP LL_SYSCFG_DisableFastModePlus\n + * SYSCFG_CFGR1 I2C1_FMP LL_SYSCFG_DisableFastModePlus\n + * SYSCFG_CFGR1 I2C2_FMP LL_SYSCFG_DisableFastModePlus\n + * SYSCFG_CFGR1 I2C3_FMP LL_SYSCFG_DisableFastModePlus + * @param ConfigFastModePlus This parameter can be a combination of the following values: + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB6 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB7 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB8 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_PB9 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C1 + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C2 (*) + * @arg @ref LL_SYSCFG_I2C_FASTMODEPLUS_I2C3 (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableFastModePlus(uint32_t ConfigFastModePlus) +{ + CLEAR_BIT(SYSCFG->CFGR1, ConfigFastModePlus); +} + +/** + * @brief Enable Floating Point Unit Invalid operation Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_0 LL_SYSCFG_EnableIT_FPU_IOC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_IOC(void) +{ + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_0); +} + +/** + * @brief Enable Floating Point Unit Divide-by-zero Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_1 LL_SYSCFG_EnableIT_FPU_DZC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_DZC(void) +{ + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_1); +} + +/** + * @brief Enable Floating Point Unit Underflow Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_2 LL_SYSCFG_EnableIT_FPU_UFC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_UFC(void) +{ + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_2); +} + +/** + * @brief Enable Floating Point Unit Overflow Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_3 LL_SYSCFG_EnableIT_FPU_OFC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_OFC(void) +{ + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_3); +} + +/** + * @brief Enable Floating Point Unit Input denormal Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_4 LL_SYSCFG_EnableIT_FPU_IDC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_IDC(void) +{ + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_4); +} + +/** + * @brief Enable Floating Point Unit Inexact Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_5 LL_SYSCFG_EnableIT_FPU_IXC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableIT_FPU_IXC(void) +{ + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_5); +} + +/** + * @brief Disable Floating Point Unit Invalid operation Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_0 LL_SYSCFG_DisableIT_FPU_IOC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_IOC(void) +{ + CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_0); +} + +/** + * @brief Disable Floating Point Unit Divide-by-zero Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_1 LL_SYSCFG_DisableIT_FPU_DZC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_DZC(void) +{ + CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_1); +} + +/** + * @brief Disable Floating Point Unit Underflow Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_2 LL_SYSCFG_DisableIT_FPU_UFC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_UFC(void) +{ + CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_2); +} + +/** + * @brief Disable Floating Point Unit Overflow Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_3 LL_SYSCFG_DisableIT_FPU_OFC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_OFC(void) +{ + CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_3); +} + +/** + * @brief Disable Floating Point Unit Input denormal Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_4 LL_SYSCFG_DisableIT_FPU_IDC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_IDC(void) +{ + CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_4); +} + +/** + * @brief Disable Floating Point Unit Inexact Interrupt + * @rmtoll SYSCFG_CFGR1 FPU_IE_5 LL_SYSCFG_DisableIT_FPU_IXC + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableIT_FPU_IXC(void) +{ + CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_5); +} + +/** + * @brief Check if Floating Point Unit Invalid operation Interrupt source is enabled or disabled. + * @rmtoll SYSCFG_CFGR1 FPU_IE_0 LL_SYSCFG_IsEnabledIT_FPU_IOC + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_IOC(void) +{ + return (READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_0) == (SYSCFG_CFGR1_FPU_IE_0)); +} + +/** + * @brief Check if Floating Point Unit Divide-by-zero Interrupt source is enabled or disabled. + * @rmtoll SYSCFG_CFGR1 FPU_IE_1 LL_SYSCFG_IsEnabledIT_FPU_DZC + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_DZC(void) +{ + return (READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_1) == (SYSCFG_CFGR1_FPU_IE_1)); +} + +/** + * @brief Check if Floating Point Unit Underflow Interrupt source is enabled or disabled. + * @rmtoll SYSCFG_CFGR1 FPU_IE_2 LL_SYSCFG_IsEnabledIT_FPU_UFC + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_UFC(void) +{ + return (READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_2) == (SYSCFG_CFGR1_FPU_IE_2)); +} + +/** + * @brief Check if Floating Point Unit Overflow Interrupt source is enabled or disabled. + * @rmtoll SYSCFG_CFGR1 FPU_IE_3 LL_SYSCFG_IsEnabledIT_FPU_OFC + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_OFC(void) +{ + return (READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_3) == (SYSCFG_CFGR1_FPU_IE_3)); +} + +/** + * @brief Check if Floating Point Unit Input denormal Interrupt source is enabled or disabled. + * @rmtoll SYSCFG_CFGR1 FPU_IE_4 LL_SYSCFG_IsEnabledIT_FPU_IDC + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_IDC(void) +{ + return (READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_4) == (SYSCFG_CFGR1_FPU_IE_4)); +} + +/** + * @brief Check if Floating Point Unit Inexact Interrupt source is enabled or disabled. + * @rmtoll SYSCFG_CFGR1 FPU_IE_5 LL_SYSCFG_IsEnabledIT_FPU_IXC + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSCFG_IsEnabledIT_FPU_IXC(void) +{ + return (READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_FPU_IE_5) == (SYSCFG_CFGR1_FPU_IE_5)); +} + +/** + * @brief Configure source input for the EXTI external interrupt. + * @rmtoll SYSCFG_EXTICR1 EXTI0 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI1 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI2 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI3 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI4 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI5 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI6 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI7 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI8 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI9 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI10 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI11 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI12 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI13 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI14 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR1 EXTI15 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI0 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI1 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI2 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI3 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI4 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI5 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI6 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI7 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI8 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI9 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI10 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI11 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI12 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI13 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI14 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR2 EXTI15 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI0 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI1 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI2 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI3 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI4 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI5 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI6 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI7 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI8 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI9 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI10 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI11 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI12 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI13 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI14 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR3 EXTI15 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI0 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI1 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI2 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI3 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI4 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI5 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI6 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI7 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI8 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI9 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI10 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI11 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI12 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI13 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI14 LL_SYSCFG_SetEXTISource\n + * SYSCFG_EXTICR4 EXTI15 LL_SYSCFG_SetEXTISource + * @param Port This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_EXTI_PORTA + * @arg @ref LL_SYSCFG_EXTI_PORTB + * @arg @ref LL_SYSCFG_EXTI_PORTC + * @arg @ref LL_SYSCFG_EXTI_PORTD + * @arg @ref LL_SYSCFG_EXTI_PORTE (*) + * @arg @ref LL_SYSCFG_EXTI_PORTF + * @arg @ref LL_SYSCFG_EXTI_PORTG (*) + * @arg @ref LL_SYSCFG_EXTI_PORTH (*) + * + * (*) value not defined in all devices. + * @param Line This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_EXTI_LINE0 + * @arg @ref LL_SYSCFG_EXTI_LINE1 + * @arg @ref LL_SYSCFG_EXTI_LINE2 + * @arg @ref LL_SYSCFG_EXTI_LINE3 + * @arg @ref LL_SYSCFG_EXTI_LINE4 + * @arg @ref LL_SYSCFG_EXTI_LINE5 + * @arg @ref LL_SYSCFG_EXTI_LINE6 + * @arg @ref LL_SYSCFG_EXTI_LINE7 + * @arg @ref LL_SYSCFG_EXTI_LINE8 + * @arg @ref LL_SYSCFG_EXTI_LINE9 + * @arg @ref LL_SYSCFG_EXTI_LINE10 + * @arg @ref LL_SYSCFG_EXTI_LINE11 + * @arg @ref LL_SYSCFG_EXTI_LINE12 + * @arg @ref LL_SYSCFG_EXTI_LINE13 + * @arg @ref LL_SYSCFG_EXTI_LINE14 + * @arg @ref LL_SYSCFG_EXTI_LINE15 + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetEXTISource(uint32_t Port, uint32_t Line) +{ + MODIFY_REG(SYSCFG->EXTICR[Line & 0x3U], (Line >> 16U), Port << POSITION_VAL((Line >> 16U))); +} + +/** + * @brief Get the configured defined for specific EXTI Line + * @rmtoll SYSCFG_EXTICR1 EXTI0 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI1 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI2 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI3 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI4 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI5 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI6 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI7 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI8 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI9 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI10 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI11 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI12 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI13 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI14 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR1 EXTI15 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI0 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI1 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI2 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI3 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI4 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI5 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI6 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI7 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI8 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI9 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI10 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI11 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI12 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI13 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI14 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR2 EXTI15 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI0 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI1 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI2 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI3 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI4 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI5 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI6 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI7 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI8 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI9 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI10 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI11 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI12 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI13 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI14 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR3 EXTI15 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI0 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI1 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI2 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI3 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI4 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI5 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI6 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI7 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI8 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI9 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI10 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI11 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI12 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI13 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI14 LL_SYSCFG_GetEXTISource\n + * SYSCFG_EXTICR4 EXTI15 LL_SYSCFG_GetEXTISource + * @param Line This parameter can be one of the following values: + * @arg @ref LL_SYSCFG_EXTI_LINE0 + * @arg @ref LL_SYSCFG_EXTI_LINE1 + * @arg @ref LL_SYSCFG_EXTI_LINE2 + * @arg @ref LL_SYSCFG_EXTI_LINE3 + * @arg @ref LL_SYSCFG_EXTI_LINE4 + * @arg @ref LL_SYSCFG_EXTI_LINE5 + * @arg @ref LL_SYSCFG_EXTI_LINE6 + * @arg @ref LL_SYSCFG_EXTI_LINE7 + * @arg @ref LL_SYSCFG_EXTI_LINE8 + * @arg @ref LL_SYSCFG_EXTI_LINE9 + * @arg @ref LL_SYSCFG_EXTI_LINE10 + * @arg @ref LL_SYSCFG_EXTI_LINE11 + * @arg @ref LL_SYSCFG_EXTI_LINE12 + * @arg @ref LL_SYSCFG_EXTI_LINE13 + * @arg @ref LL_SYSCFG_EXTI_LINE14 + * @arg @ref LL_SYSCFG_EXTI_LINE15 + * @retval Returned value can be one of the following values: + * @arg @ref LL_SYSCFG_EXTI_PORTA + * @arg @ref LL_SYSCFG_EXTI_PORTB + * @arg @ref LL_SYSCFG_EXTI_PORTC + * @arg @ref LL_SYSCFG_EXTI_PORTD + * @arg @ref LL_SYSCFG_EXTI_PORTE (*) + * @arg @ref LL_SYSCFG_EXTI_PORTF + * @arg @ref LL_SYSCFG_EXTI_PORTG (*) + * @arg @ref LL_SYSCFG_EXTI_PORTH (*) + * + * (*) value not defined in all devices. + */ +__STATIC_INLINE uint32_t LL_SYSCFG_GetEXTISource(uint32_t Line) +{ + return (uint32_t)(READ_BIT(SYSCFG->EXTICR[Line & 0x3U], (Line >> 16U)) >> POSITION_VAL(Line >> 16U)); +} + +/** + * @brief Set connections to TIMx Break inputs + * @rmtoll SYSCFG_CFGR2 LOCKUP_LOCK LL_SYSCFG_SetTIMBreakInputs\n + * SYSCFG_CFGR2 SRAM_PARITY_LOCK LL_SYSCFG_SetTIMBreakInputs\n + * SYSCFG_CFGR2 PVD_LOCK LL_SYSCFG_SetTIMBreakInputs + * @param Break This parameter can be a combination of the following values: + * @arg @ref LL_SYSCFG_TIMBREAK_PVD (*) + * @arg @ref LL_SYSCFG_TIMBREAK_SRAM_PARITY (*) + * @arg @ref LL_SYSCFG_TIMBREAK_LOCKUP + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_SetTIMBreakInputs(uint32_t Break) +{ + MODIFY_REG(SYSCFG->CFGR2, SYSCFG_MASK_TIM_BREAK, Break); +} + +/** + * @brief Get connections to TIMx Break inputs + * @rmtoll SYSCFG_CFGR2 LOCKUP_LOCK LL_SYSCFG_GetTIMBreakInputs\n + * SYSCFG_CFGR2 SRAM_PARITY_LOCK LL_SYSCFG_GetTIMBreakInputs\n + * SYSCFG_CFGR2 PVD_LOCK LL_SYSCFG_GetTIMBreakInputs + * @retval Returned value can be can be a combination of the following values: + * @arg @ref LL_SYSCFG_TIMBREAK_PVD (*) + * @arg @ref LL_SYSCFG_TIMBREAK_SRAM_PARITY (*) + * @arg @ref LL_SYSCFG_TIMBREAK_LOCKUP + * + * (*) value not defined in all devices. + */ +__STATIC_INLINE uint32_t LL_SYSCFG_GetTIMBreakInputs(void) +{ + return (uint32_t)(READ_BIT(SYSCFG->CFGR2, SYSCFG_MASK_TIM_BREAK)); +} + +#if defined(SYSCFG_CFGR2_BYP_ADDR_PAR) +/** + * @brief Disable RAM Parity Check Disable + * @rmtoll SYSCFG_CFGR2 BYP_ADDR_PAR LL_SYSCFG_DisableSRAMParityCheck + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_DisableSRAMParityCheck(void) +{ + SET_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_BYP_ADDR_PAR); +} +#endif /* SYSCFG_CFGR2_BYP_ADDR_PAR */ + +#if defined(SYSCFG_CFGR2_SRAM_PE) +/** + * @brief Check if SRAM parity error detected + * @rmtoll SYSCFG_CFGR2 SRAM_PE LL_SYSCFG_IsActiveFlag_SP + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_SYSCFG_IsActiveFlag_SP(void) +{ + return (READ_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_SRAM_PE) == (SYSCFG_CFGR2_SRAM_PE)); +} + +/** + * @brief Clear SRAM parity error flag + * @rmtoll SYSCFG_CFGR2 SRAM_PE LL_SYSCFG_ClearFlag_SP + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_ClearFlag_SP(void) +{ + SET_BIT(SYSCFG->CFGR2, SYSCFG_CFGR2_SRAM_PE); +} +#endif /* SYSCFG_CFGR2_SRAM_PE */ + +#if defined(SYSCFG_RCR_PAGE0) +/** + * @brief Enable CCM SRAM page write protection + * @note Write protection is cleared only by a system reset + * @rmtoll SYSCFG_RCR PAGE0 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE1 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE2 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE3 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE4 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE5 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE6 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE7 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE8 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE9 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE10 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE11 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE12 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE13 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE14 LL_SYSCFG_EnableCCM_SRAMPageWRP\n + * SYSCFG_RCR PAGE15 LL_SYSCFG_EnableCCM_SRAMPageWRP + * @param PageWRP This parameter can be a combination of the following values: + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE0 + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE1 + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE2 + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE3 + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE4 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE5 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE6 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE7 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE8 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE9 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE10 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE11 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE12 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE13 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE14 (*) + * @arg @ref LL_SYSCFG_CCMSRAMWRP_PAGE15 (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_SYSCFG_EnableCCM_SRAMPageWRP(uint32_t PageWRP) +{ + SET_BIT(SYSCFG->RCR, PageWRP); +} +#endif /* SYSCFG_RCR_PAGE0 */ + +/** + * @} + */ + +/** @defgroup SYSTEM_LL_EF_DBGMCU DBGMCU + * @{ + */ + +/** + * @brief Return the device identifier + * @note For STM32F303xC, STM32F358xx and STM32F302xC devices, the device ID is 0x422 + * @note For STM32F373xx and STM32F378xx devices, the device ID is 0x432 + * @note For STM32F303x8, STM32F334xx and STM32F328xx devices, the device ID is 0x438. + * @note For STM32F302x8, STM32F301x8 and STM32F318xx devices, the device ID is 0x439 + * @note For STM32F303xE, STM32F398xx and STM32F302xE devices, the device ID is 0x446 + * @rmtoll DBGMCU_IDCODE DEV_ID LL_DBGMCU_GetDeviceID + * @retval Values between Min_Data=0x00 and Max_Data=0xFFF + */ +__STATIC_INLINE uint32_t LL_DBGMCU_GetDeviceID(void) +{ + return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_DEV_ID)); +} + +/** + * @brief Return the device revision identifier + * @note This field indicates the revision of the device. + * @rmtoll DBGMCU_IDCODE REV_ID LL_DBGMCU_GetRevisionID + * @retval Values between Min_Data=0x00 and Max_Data=0xFFFF + */ +__STATIC_INLINE uint32_t LL_DBGMCU_GetRevisionID(void) +{ + return (uint32_t)(READ_BIT(DBGMCU->IDCODE, DBGMCU_IDCODE_REV_ID) >> DBGMCU_IDCODE_REV_ID_Pos); +} + +/** + * @brief Enable the Debug Module during SLEEP mode + * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_EnableDBGSleepMode + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_EnableDBGSleepMode(void) +{ + SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP); +} + +/** + * @brief Disable the Debug Module during SLEEP mode + * @rmtoll DBGMCU_CR DBG_SLEEP LL_DBGMCU_DisableDBGSleepMode + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_DisableDBGSleepMode(void) +{ + CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP); +} + +/** + * @brief Enable the Debug Module during STOP mode + * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_EnableDBGStopMode + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_EnableDBGStopMode(void) +{ + SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP); +} + +/** + * @brief Disable the Debug Module during STOP mode + * @rmtoll DBGMCU_CR DBG_STOP LL_DBGMCU_DisableDBGStopMode + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_DisableDBGStopMode(void) +{ + CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP); +} + +/** + * @brief Enable the Debug Module during STANDBY mode + * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_EnableDBGStandbyMode + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_EnableDBGStandbyMode(void) +{ + SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); +} + +/** + * @brief Disable the Debug Module during STANDBY mode + * @rmtoll DBGMCU_CR DBG_STANDBY LL_DBGMCU_DisableDBGStandbyMode + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_DisableDBGStandbyMode(void) +{ + CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); +} + +/** + * @brief Set Trace pin assignment control + * @rmtoll DBGMCU_CR TRACE_IOEN LL_DBGMCU_SetTracePinAssignment\n + * DBGMCU_CR TRACE_MODE LL_DBGMCU_SetTracePinAssignment + * @param PinAssignment This parameter can be one of the following values: + * @arg @ref LL_DBGMCU_TRACE_NONE + * @arg @ref LL_DBGMCU_TRACE_ASYNCH + * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE1 + * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE2 + * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE4 + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_SetTracePinAssignment(uint32_t PinAssignment) +{ + MODIFY_REG(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE, PinAssignment); +} + +/** + * @brief Get Trace pin assignment control + * @rmtoll DBGMCU_CR TRACE_IOEN LL_DBGMCU_GetTracePinAssignment\n + * DBGMCU_CR TRACE_MODE LL_DBGMCU_GetTracePinAssignment + * @retval Returned value can be one of the following values: + * @arg @ref LL_DBGMCU_TRACE_NONE + * @arg @ref LL_DBGMCU_TRACE_ASYNCH + * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE1 + * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE2 + * @arg @ref LL_DBGMCU_TRACE_SYNCH_SIZE4 + */ +__STATIC_INLINE uint32_t LL_DBGMCU_GetTracePinAssignment(void) +{ + return (uint32_t)(READ_BIT(DBGMCU->CR, DBGMCU_CR_TRACE_IOEN | DBGMCU_CR_TRACE_MODE)); +} + +/** + * @brief Freeze APB1 peripherals (group1 peripherals) + * @rmtoll APB1_FZ DBG_TIM2_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM3_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM4_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM5_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM6_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM7_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM12_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM13_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM14_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_TIM18_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_RTC_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_WWDG_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_IWDG_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_I2C1_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_I2C2_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_I2C3_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_FreezePeriph\n + * APB1_FZ DBG_CAN_STOP LL_DBGMCU_APB1_GRP1_FreezePeriph + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM18_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_CAN_STOP (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_APB1_GRP1_FreezePeriph(uint32_t Periphs) +{ + SET_BIT(DBGMCU->APB1FZ, Periphs); +} + +/** + * @brief Unfreeze APB1 peripherals (group1 peripherals) + * @rmtoll APB1_FZ DBG_TIM2_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM3_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM4_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM5_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM6_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM7_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM12_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM13_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM14_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_TIM18_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_RTC_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_WWDG_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_IWDG_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_I2C1_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_I2C2_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_I2C3_SMBUS_TIMEOUT LL_DBGMCU_APB1_GRP1_UnFreezePeriph\n + * APB1_FZ DBG_CAN_STOP LL_DBGMCU_APB1_GRP1_UnFreezePeriph + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM2_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM3_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM4_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM5_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM6_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM7_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM12_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM13_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM14_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_TIM18_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_RTC_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_WWDG_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_IWDG_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_I2C1_STOP + * @arg @ref LL_DBGMCU_APB1_GRP1_I2C2_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_I2C3_STOP (*) + * @arg @ref LL_DBGMCU_APB1_GRP1_CAN_STOP (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_APB1_GRP1_UnFreezePeriph(uint32_t Periphs) +{ + CLEAR_BIT(DBGMCU->APB1FZ, Periphs); +} + +/** + * @brief Freeze APB2 peripherals + * @rmtoll APB2_FZ DBG_TIM1_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n + * APB2_FZ DBG_TIM8_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n + * APB2_FZ DBG_TIM15_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n + * APB2_FZ DBG_TIM16_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n + * APB2_FZ DBG_TIM17_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n + * APB2_FZ DBG_TIM19_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n + * APB2_FZ DBG_TIM20_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph\n + * APB2_FZ DBG_HRTIM1_STOP LL_DBGMCU_APB2_GRP1_FreezePeriph + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP (*) + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP (*) + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM15_STOP + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM16_STOP + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM17_STOP + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM19_STOP (*) + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM20_STOP (*) + * @arg @ref LL_DBGMCU_APB2_GRP1_HRTIM1_STOP (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_APB2_GRP1_FreezePeriph(uint32_t Periphs) +{ + SET_BIT(DBGMCU->APB2FZ, Periphs); +} + +/** + * @brief Unfreeze APB2 peripherals + * @rmtoll APB2_FZ DBG_TIM1_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n + * APB2_FZ DBG_TIM8_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n + * APB2_FZ DBG_TIM15_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n + * APB2_FZ DBG_TIM16_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n + * APB2_FZ DBG_TIM17_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n + * APB2_FZ DBG_TIM19_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n + * APB2_FZ DBG_TIM20_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph\n + * APB2_FZ DBG_HRTIM1_STOP LL_DBGMCU_APB2_GRP1_UnFreezePeriph + * @param Periphs This parameter can be a combination of the following values: + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM1_STOP (*) + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM8_STOP (*) + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM15_STOP + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM16_STOP + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM17_STOP + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM19_STOP (*) + * @arg @ref LL_DBGMCU_APB2_GRP1_TIM20_STOP (*) + * @arg @ref LL_DBGMCU_APB2_GRP1_HRTIM1_STOP (*) + * + * (*) value not defined in all devices. + * @retval None + */ +__STATIC_INLINE void LL_DBGMCU_APB2_GRP1_UnFreezePeriph(uint32_t Periphs) +{ + CLEAR_BIT(DBGMCU->APB2FZ, Periphs); +} + +/** + * @} + */ + +/** @defgroup SYSTEM_LL_EF_FLASH FLASH + * @{ + */ + +/** + * @brief Set FLASH Latency + * @rmtoll FLASH_ACR LATENCY LL_FLASH_SetLatency + * @param Latency This parameter can be one of the following values: + * @arg @ref LL_FLASH_LATENCY_0 + * @arg @ref LL_FLASH_LATENCY_1 + * @arg @ref LL_FLASH_LATENCY_2 + * @retval None + */ +__STATIC_INLINE void LL_FLASH_SetLatency(uint32_t Latency) +{ + MODIFY_REG(FLASH->ACR, FLASH_ACR_LATENCY, Latency); +} + +/** + * @brief Get FLASH Latency + * @rmtoll FLASH_ACR LATENCY LL_FLASH_GetLatency + * @retval Returned value can be one of the following values: + * @arg @ref LL_FLASH_LATENCY_0 + * @arg @ref LL_FLASH_LATENCY_1 + * @arg @ref LL_FLASH_LATENCY_2 + */ +__STATIC_INLINE uint32_t LL_FLASH_GetLatency(void) +{ + return (uint32_t)(READ_BIT(FLASH->ACR, FLASH_ACR_LATENCY)); +} + +/** + * @brief Enable Prefetch + * @rmtoll FLASH_ACR PRFTBE LL_FLASH_EnablePrefetch + * @retval None + */ +__STATIC_INLINE void LL_FLASH_EnablePrefetch(void) +{ + SET_BIT(FLASH->ACR, FLASH_ACR_PRFTBE ); +} + +/** + * @brief Disable Prefetch + * @rmtoll FLASH_ACR PRFTBE LL_FLASH_DisablePrefetch + * @retval None + */ +__STATIC_INLINE void LL_FLASH_DisablePrefetch(void) +{ + CLEAR_BIT(FLASH->ACR, FLASH_ACR_PRFTBE ); +} + +/** + * @brief Check if Prefetch buffer is enabled + * @rmtoll FLASH_ACR PRFTBS LL_FLASH_IsPrefetchEnabled + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_FLASH_IsPrefetchEnabled(void) +{ + return (READ_BIT(FLASH->ACR, FLASH_ACR_PRFTBS) == (FLASH_ACR_PRFTBS)); +} + +#if defined(FLASH_ACR_HLFCYA) +/** + * @brief Enable Flash Half Cycle Access + * @rmtoll FLASH_ACR HLFCYA LL_FLASH_EnableHalfCycleAccess + * @retval None + */ +__STATIC_INLINE void LL_FLASH_EnableHalfCycleAccess(void) +{ + SET_BIT(FLASH->ACR, FLASH_ACR_HLFCYA); +} + +/** + * @brief Disable Flash Half Cycle Access + * @rmtoll FLASH_ACR HLFCYA LL_FLASH_DisableHalfCycleAccess + * @retval None + */ +__STATIC_INLINE void LL_FLASH_DisableHalfCycleAccess(void) +{ + CLEAR_BIT(FLASH->ACR, FLASH_ACR_HLFCYA); +} + +/** + * @brief Check if Flash Half Cycle Access is enabled or not + * @rmtoll FLASH_ACR HLFCYA LL_FLASH_IsHalfCycleAccessEnabled + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_FLASH_IsHalfCycleAccessEnabled(void) +{ + return (READ_BIT(FLASH->ACR, FLASH_ACR_HLFCYA) == (FLASH_ACR_HLFCYA)); +} +#endif /* FLASH_ACR_HLFCYA */ + + + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* defined (FLASH) || defined (SYSCFG) || defined (DBGMCU) */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_SYSTEM_H */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h new file mode 100644 index 0000000..9ffea64 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_tim.h @@ -0,0 +1,5061 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_tim.h + * @author MCD Application Team + * @brief Header file of TIM LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_TIM_H +#define __STM32F3xx_LL_TIM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined (TIM1) || defined (TIM2) || defined (TIM3) || defined (TIM4) || defined (TIM5) || defined (TIM6) || defined (TIM7) || defined (TIM8) || defined (TIM12) || defined (TIM13) || defined (TIM14) || defined (TIM15) || defined (TIM16) || defined (TIM17) || defined (TIM18) || defined (TIM19) || defined (TIM20) + +/** @defgroup TIM_LL TIM + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/** @defgroup TIM_LL_Private_Variables TIM Private Variables + * @{ + */ +static const uint8_t OFFSET_TAB_CCMRx[] = +{ + 0x00U, /* 0: TIMx_CH1 */ + 0x00U, /* 1: TIMx_CH1N */ + 0x00U, /* 2: TIMx_CH2 */ + 0x00U, /* 3: TIMx_CH2N */ + 0x04U, /* 4: TIMx_CH3 */ + 0x04U, /* 5: TIMx_CH3N */ + 0x04U, /* 6: TIMx_CH4 */ + 0x3CU, /* 7: TIMx_CH5 */ + 0x3CU /* 8: TIMx_CH6 */ +}; + +static const uint8_t SHIFT_TAB_OCxx[] = +{ + 0U, /* 0: OC1M, OC1FE, OC1PE */ + 0U, /* 1: - NA */ + 8U, /* 2: OC2M, OC2FE, OC2PE */ + 0U, /* 3: - NA */ + 0U, /* 4: OC3M, OC3FE, OC3PE */ + 0U, /* 5: - NA */ + 8U, /* 6: OC4M, OC4FE, OC4PE */ + 0U, /* 7: OC5M, OC5FE, OC5PE */ + 8U /* 8: OC6M, OC6FE, OC6PE */ +}; + +static const uint8_t SHIFT_TAB_ICxx[] = +{ + 0U, /* 0: CC1S, IC1PSC, IC1F */ + 0U, /* 1: - NA */ + 8U, /* 2: CC2S, IC2PSC, IC2F */ + 0U, /* 3: - NA */ + 0U, /* 4: CC3S, IC3PSC, IC3F */ + 0U, /* 5: - NA */ + 8U, /* 6: CC4S, IC4PSC, IC4F */ + 0U, /* 7: - NA */ + 0U /* 8: - NA */ +}; + +static const uint8_t SHIFT_TAB_CCxP[] = +{ + 0U, /* 0: CC1P */ + 2U, /* 1: CC1NP */ + 4U, /* 2: CC2P */ + 6U, /* 3: CC2NP */ + 8U, /* 4: CC3P */ + 10U, /* 5: CC3NP */ + 12U, /* 6: CC4P */ + 16U, /* 7: CC5P */ + 20U /* 8: CC6P */ +}; + +static const uint8_t SHIFT_TAB_OISx[] = +{ + 0U, /* 0: OIS1 */ + 1U, /* 1: OIS1N */ + 2U, /* 2: OIS2 */ + 3U, /* 3: OIS2N */ + 4U, /* 4: OIS3 */ + 5U, /* 5: OIS3N */ + 6U, /* 6: OIS4 */ + 8U, /* 7: OIS5 */ + 10U /* 8: OIS6 */ +}; +/** + * @} + */ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup TIM_LL_Private_Constants TIM Private Constants + * @{ + */ + + +#define TIMx_OR_RMP_SHIFT 16U +#define TIMx_OR_RMP_MASK 0x0000FFFFU +#if defined(TIM1) +#define TIM1_OR_RMP_MASK (TIM1_OR_ETR_RMP << TIMx_OR_RMP_SHIFT) +#endif /* TIM1 */ +#if defined (TIM8) +#define TIM8_OR_RMP_MASK (TIM8_OR_ETR_RMP << TIMx_OR_RMP_SHIFT) +#endif /* TIM8 */ +#if defined(TIM14) +#define TIM14_OR_RMP_MASK (TIM14_OR_TI1_RMP << TIMx_OR_RMP_SHIFT) +#endif /* TIM14 */ +#if defined(TIM16) +#define TIM16_OR_RMP_MASK (TIM16_OR_TI1_RMP << TIMx_OR_RMP_SHIFT) +#endif /* TIM16 */ +#if defined(TIM20) +#define TIM20_OR_RMP_MASK (TIM20_OR_ETR_RMP << TIMx_OR_RMP_SHIFT) +#endif /* TIM20 */ + +/* Mask used to set the TDG[x:0] of the DTG bits of the TIMx_BDTR register */ +#define DT_DELAY_1 ((uint8_t)0x7F) +#define DT_DELAY_2 ((uint8_t)0x3F) +#define DT_DELAY_3 ((uint8_t)0x1F) +#define DT_DELAY_4 ((uint8_t)0x1F) + +/* Mask used to set the DTG[7:5] bits of the DTG bits of the TIMx_BDTR register */ +#define DT_RANGE_1 ((uint8_t)0x00) +#define DT_RANGE_2 ((uint8_t)0x80) +#define DT_RANGE_3 ((uint8_t)0xC0) +#define DT_RANGE_4 ((uint8_t)0xE0) + + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup TIM_LL_Private_Macros TIM Private Macros + * @{ + */ +/** @brief Convert channel id into channel index. + * @param __CHANNEL__ This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH1N + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH2N + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH3N + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval none + */ +#if defined(TIM_CCR5_CCR5) +#define TIM_GET_CHANNEL_INDEX( __CHANNEL__) \ + (((__CHANNEL__) == LL_TIM_CHANNEL_CH1) ? 0U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH1N) ? 1U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH2) ? 2U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH2N) ? 3U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH3) ? 4U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH3N) ? 5U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH4) ? 6U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH5) ? 7U : 8U) +#else +#define TIM_GET_CHANNEL_INDEX( __CHANNEL__) \ + (((__CHANNEL__) == LL_TIM_CHANNEL_CH1) ? 0U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH1N) ? 1U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH2) ? 2U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH2N) ? 3U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH3) ? 4U :\ + ((__CHANNEL__) == LL_TIM_CHANNEL_CH3N) ? 5U : 6U) +#endif + +/** @brief Calculate the deadtime sampling period(in ps). + * @param __TIMCLK__ timer input clock frequency (in Hz). + * @param __CKD__ This parameter can be one of the following values: + * @arg @ref LL_TIM_CLOCKDIVISION_DIV1 + * @arg @ref LL_TIM_CLOCKDIVISION_DIV2 + * @arg @ref LL_TIM_CLOCKDIVISION_DIV4 + * @retval none + */ +#define TIM_CALC_DTS(__TIMCLK__, __CKD__) \ + (((__CKD__) == LL_TIM_CLOCKDIVISION_DIV1) ? ((uint64_t)1000000000000U/(__TIMCLK__)) : \ + ((__CKD__) == LL_TIM_CLOCKDIVISION_DIV2) ? ((uint64_t)1000000000000U/((__TIMCLK__) >> 1U)) : \ + ((uint64_t)1000000000000U/((__TIMCLK__) >> 2U))) +/** + * @} + */ + + +/* Exported types ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup TIM_LL_ES_INIT TIM Exported Init structure + * @{ + */ + +/** + * @brief TIM Time Base configuration structure definition. + */ +typedef struct +{ + uint16_t Prescaler; /*!< Specifies the prescaler value used to divide the TIM clock. + This parameter can be a number between Min_Data=0x0000 and Max_Data=0xFFFF. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_SetPrescaler().*/ + + uint32_t CounterMode; /*!< Specifies the counter mode. + This parameter can be a value of @ref TIM_LL_EC_COUNTERMODE. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_SetCounterMode().*/ + + uint32_t Autoreload; /*!< Specifies the auto reload value to be loaded into the active + Auto-Reload Register at the next update event. + This parameter must be a number between Min_Data=0x0000 and Max_Data=0xFFFF. + Some timer instances may support 32 bits counters. In that case this parameter must + be a number between 0x0000 and 0xFFFFFFFF. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_SetAutoReload().*/ + + uint32_t ClockDivision; /*!< Specifies the clock division. + This parameter can be a value of @ref TIM_LL_EC_CLOCKDIVISION. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_SetClockDivision().*/ + + uint32_t RepetitionCounter; /*!< Specifies the repetition counter value. Each time the RCR downcounter + reaches zero, an update event is generated and counting restarts + from the RCR value (N). + This means in PWM mode that (N+1) corresponds to: + - the number of PWM periods in edge-aligned mode + - the number of half PWM period in center-aligned mode + GP timers: this parameter must be a number between Min_Data = 0x00 and + Max_Data = 0xFF. + Advanced timers: this parameter must be a number between Min_Data = 0x0000 and + Max_Data = 0xFFFF. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_SetRepetitionCounter().*/ +} LL_TIM_InitTypeDef; + +/** + * @brief TIM Output Compare configuration structure definition. + */ +typedef struct +{ + uint32_t OCMode; /*!< Specifies the output mode. + This parameter can be a value of @ref TIM_LL_EC_OCMODE. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_OC_SetMode().*/ + + uint32_t OCState; /*!< Specifies the TIM Output Compare state. + This parameter can be a value of @ref TIM_LL_EC_OCSTATE. + + This feature can be modified afterwards using unitary functions + @ref LL_TIM_CC_EnableChannel() or @ref LL_TIM_CC_DisableChannel().*/ + + uint32_t OCNState; /*!< Specifies the TIM complementary Output Compare state. + This parameter can be a value of @ref TIM_LL_EC_OCSTATE. + + This feature can be modified afterwards using unitary functions + @ref LL_TIM_CC_EnableChannel() or @ref LL_TIM_CC_DisableChannel().*/ + + uint32_t CompareValue; /*!< Specifies the Compare value to be loaded into the Capture Compare Register. + This parameter can be a number between Min_Data=0x0000 and Max_Data=0xFFFF. + + This feature can be modified afterwards using unitary function + LL_TIM_OC_SetCompareCHx (x=1..6).*/ + + uint32_t OCPolarity; /*!< Specifies the output polarity. + This parameter can be a value of @ref TIM_LL_EC_OCPOLARITY. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_OC_SetPolarity().*/ + + uint32_t OCNPolarity; /*!< Specifies the complementary output polarity. + This parameter can be a value of @ref TIM_LL_EC_OCPOLARITY. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_OC_SetPolarity().*/ + + + uint32_t OCIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state. + This parameter can be a value of @ref TIM_LL_EC_OCIDLESTATE. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_OC_SetIdleState().*/ + + uint32_t OCNIdleState; /*!< Specifies the TIM Output Compare pin state during Idle state. + This parameter can be a value of @ref TIM_LL_EC_OCIDLESTATE. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_OC_SetIdleState().*/ +} LL_TIM_OC_InitTypeDef; + +/** + * @brief TIM Input Capture configuration structure definition. + */ + +typedef struct +{ + + uint32_t ICPolarity; /*!< Specifies the active edge of the input signal. + This parameter can be a value of @ref TIM_LL_EC_IC_POLARITY. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetPolarity().*/ + + uint32_t ICActiveInput; /*!< Specifies the input. + This parameter can be a value of @ref TIM_LL_EC_ACTIVEINPUT. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetActiveInput().*/ + + uint32_t ICPrescaler; /*!< Specifies the Input Capture Prescaler. + This parameter can be a value of @ref TIM_LL_EC_ICPSC. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetPrescaler().*/ + + uint32_t ICFilter; /*!< Specifies the input capture filter. + This parameter can be a value of @ref TIM_LL_EC_IC_FILTER. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetFilter().*/ +} LL_TIM_IC_InitTypeDef; + + +/** + * @brief TIM Encoder interface configuration structure definition. + */ +typedef struct +{ + uint32_t EncoderMode; /*!< Specifies the encoder resolution (x2 or x4). + This parameter can be a value of @ref TIM_LL_EC_ENCODERMODE. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_SetEncoderMode().*/ + + uint32_t IC1Polarity; /*!< Specifies the active edge of TI1 input. + This parameter can be a value of @ref TIM_LL_EC_IC_POLARITY. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetPolarity().*/ + + uint32_t IC1ActiveInput; /*!< Specifies the TI1 input source + This parameter can be a value of @ref TIM_LL_EC_ACTIVEINPUT. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetActiveInput().*/ + + uint32_t IC1Prescaler; /*!< Specifies the TI1 input prescaler value. + This parameter can be a value of @ref TIM_LL_EC_ICPSC. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetPrescaler().*/ + + uint32_t IC1Filter; /*!< Specifies the TI1 input filter. + This parameter can be a value of @ref TIM_LL_EC_IC_FILTER. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetFilter().*/ + + uint32_t IC2Polarity; /*!< Specifies the active edge of TI2 input. + This parameter can be a value of @ref TIM_LL_EC_IC_POLARITY. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetPolarity().*/ + + uint32_t IC2ActiveInput; /*!< Specifies the TI2 input source + This parameter can be a value of @ref TIM_LL_EC_ACTIVEINPUT. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetActiveInput().*/ + + uint32_t IC2Prescaler; /*!< Specifies the TI2 input prescaler value. + This parameter can be a value of @ref TIM_LL_EC_ICPSC. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetPrescaler().*/ + + uint32_t IC2Filter; /*!< Specifies the TI2 input filter. + This parameter can be a value of @ref TIM_LL_EC_IC_FILTER. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetFilter().*/ + +} LL_TIM_ENCODER_InitTypeDef; + +/** + * @brief TIM Hall sensor interface configuration structure definition. + */ +typedef struct +{ + + uint32_t IC1Polarity; /*!< Specifies the active edge of TI1 input. + This parameter can be a value of @ref TIM_LL_EC_IC_POLARITY. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetPolarity().*/ + + uint32_t IC1Prescaler; /*!< Specifies the TI1 input prescaler value. + Prescaler must be set to get a maximum counter period longer than the + time interval between 2 consecutive changes on the Hall inputs. + This parameter can be a value of @ref TIM_LL_EC_ICPSC. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetPrescaler().*/ + + uint32_t IC1Filter; /*!< Specifies the TI1 input filter. + This parameter can be a value of + @ref TIM_LL_EC_IC_FILTER. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_IC_SetFilter().*/ + + uint32_t CommutationDelay; /*!< Specifies the compare value to be loaded into the Capture Compare Register. + A positive pulse (TRGO event) is generated with a programmable delay every time + a change occurs on the Hall inputs. + This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_OC_SetCompareCH2().*/ +} LL_TIM_HALLSENSOR_InitTypeDef; + +/** + * @brief BDTR (Break and Dead Time) structure definition + */ +typedef struct +{ + uint32_t OSSRState; /*!< Specifies the Off-State selection used in Run mode. + This parameter can be a value of @ref TIM_LL_EC_OSSR + + This feature can be modified afterwards using unitary function + @ref LL_TIM_SetOffStates() + + @note This bit-field cannot be modified as long as LOCK level 2 has been + programmed. */ + + uint32_t OSSIState; /*!< Specifies the Off-State used in Idle state. + This parameter can be a value of @ref TIM_LL_EC_OSSI + + This feature can be modified afterwards using unitary function + @ref LL_TIM_SetOffStates() + + @note This bit-field cannot be modified as long as LOCK level 2 has been + programmed. */ + + uint32_t LockLevel; /*!< Specifies the LOCK level parameters. + This parameter can be a value of @ref TIM_LL_EC_LOCKLEVEL + + @note The LOCK bits can be written only once after the reset. Once the TIMx_BDTR + register has been written, their content is frozen until the next reset.*/ + + uint8_t DeadTime; /*!< Specifies the delay time between the switching-off and the + switching-on of the outputs. + This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF. + + This feature can be modified afterwards using unitary function + @ref LL_TIM_OC_SetDeadTime() + + @note This bit-field can not be modified as long as LOCK level 1, 2 or 3 has been + programmed. */ + + uint16_t BreakState; /*!< Specifies whether the TIM Break input is enabled or not. + This parameter can be a value of @ref TIM_LL_EC_BREAK_ENABLE + + This feature can be modified afterwards using unitary functions + @ref LL_TIM_EnableBRK() or @ref LL_TIM_DisableBRK() + + @note This bit-field can not be modified as long as LOCK level 1 has been + programmed. */ + + uint32_t BreakPolarity; /*!< Specifies the TIM Break Input pin polarity. + This parameter can be a value of @ref TIM_LL_EC_BREAK_POLARITY + + This feature can be modified afterwards using unitary function + @ref LL_TIM_ConfigBRK() + + @note This bit-field can not be modified as long as LOCK level 1 has been + programmed. */ + +#if defined(TIM_BDTR_BKF) + uint32_t BreakFilter; /*!< Specifies the TIM Break Filter. + This parameter can be a value of @ref TIM_LL_EC_BREAK_FILTER + + This feature can be modified afterwards using unitary function + @ref LL_TIM_ConfigBRK() + + @note This bit-field can not be modified as long as LOCK level 1 has been + programmed. */ + +#endif /* TIM_BDTR_BKF */ +#if defined(TIM_BDTR_BK2E) + uint32_t Break2State; /*!< Specifies whether the TIM Break2 input is enabled or not. + This parameter can be a value of @ref TIM_LL_EC_BREAK2_ENABLE + + This feature can be modified afterwards using unitary functions + @ref LL_TIM_EnableBRK2() or @ref LL_TIM_DisableBRK2() + + @note This bit-field can not be modified as long as LOCK level 1 has been + programmed. */ + + uint32_t Break2Polarity; /*!< Specifies the TIM Break2 Input pin polarity. + This parameter can be a value of @ref TIM_LL_EC_BREAK2_POLARITY + + This feature can be modified afterwards using unitary function + @ref LL_TIM_ConfigBRK2() + + @note This bit-field can not be modified as long as LOCK level 1 has been + programmed. */ + + uint32_t Break2Filter; /*!< Specifies the TIM Break2 Filter. + This parameter can be a value of @ref TIM_LL_EC_BREAK2_FILTER + + This feature can be modified afterwards using unitary function + @ref LL_TIM_ConfigBRK2() + + @note This bit-field can not be modified as long as LOCK level 1 has been + programmed. */ + +#endif /* TIM_BDTR_BK2E */ + uint32_t AutomaticOutput; /*!< Specifies whether the TIM Automatic Output feature is enabled or not. + This parameter can be a value of @ref TIM_LL_EC_AUTOMATICOUTPUT_ENABLE + + This feature can be modified afterwards using unitary functions + @ref LL_TIM_EnableAutomaticOutput() or @ref LL_TIM_DisableAutomaticOutput() + + @note This bit-field can not be modified as long as LOCK level 1 has been + programmed. */ +} LL_TIM_BDTR_InitTypeDef; + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup TIM_LL_Exported_Constants TIM Exported Constants + * @{ + */ + +/** @defgroup TIM_LL_EC_GET_FLAG Get Flags Defines + * @brief Flags defines which can be used with LL_TIM_ReadReg function. + * @{ + */ +#define LL_TIM_SR_UIF TIM_SR_UIF /*!< Update interrupt flag */ +#define LL_TIM_SR_CC1IF TIM_SR_CC1IF /*!< Capture/compare 1 interrupt flag */ +#define LL_TIM_SR_CC2IF TIM_SR_CC2IF /*!< Capture/compare 2 interrupt flag */ +#define LL_TIM_SR_CC3IF TIM_SR_CC3IF /*!< Capture/compare 3 interrupt flag */ +#define LL_TIM_SR_CC4IF TIM_SR_CC4IF /*!< Capture/compare 4 interrupt flag */ +#if defined(TIM_CCMR1_OC1M_3) +#define LL_TIM_SR_CC5IF TIM_SR_CC5IF /*!< Capture/compare 5 interrupt flag */ +#define LL_TIM_SR_CC6IF TIM_SR_CC6IF /*!< Capture/compare 6 interrupt flag */ +#endif /* TIM_CCMR1_OC1M_3 */ +#define LL_TIM_SR_COMIF TIM_SR_COMIF /*!< COM interrupt flag */ +#define LL_TIM_SR_TIF TIM_SR_TIF /*!< Trigger interrupt flag */ +#define LL_TIM_SR_BIF TIM_SR_BIF /*!< Break interrupt flag */ +#define LL_TIM_SR_B2IF TIM_SR_B2IF /*!< Second break interrupt flag */ +#define LL_TIM_SR_CC1OF TIM_SR_CC1OF /*!< Capture/Compare 1 overcapture flag */ +#define LL_TIM_SR_CC2OF TIM_SR_CC2OF /*!< Capture/Compare 2 overcapture flag */ +#define LL_TIM_SR_CC3OF TIM_SR_CC3OF /*!< Capture/Compare 3 overcapture flag */ +#define LL_TIM_SR_CC4OF TIM_SR_CC4OF /*!< Capture/Compare 4 overcapture flag */ +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup TIM_LL_EC_BREAK_ENABLE Break Enable + * @{ + */ +#define LL_TIM_BREAK_DISABLE 0x00000000U /*!< Break function disabled */ +#define LL_TIM_BREAK_ENABLE TIM_BDTR_BKE /*!< Break function enabled */ +/** + * @} + */ +#if defined(TIM_BDTR_BK2E) + +/** @defgroup TIM_LL_EC_BREAK2_ENABLE Break2 Enable + * @{ + */ +#define LL_TIM_BREAK2_DISABLE 0x00000000U /*!< Break2 function disabled */ +#define LL_TIM_BREAK2_ENABLE TIM_BDTR_BK2E /*!< Break2 function enabled */ +/** + * @} + */ +#endif /* TIM_BDTR_BK2E */ + +/** @defgroup TIM_LL_EC_AUTOMATICOUTPUT_ENABLE Automatic output enable + * @{ + */ +#define LL_TIM_AUTOMATICOUTPUT_DISABLE 0x00000000U /*!< MOE can be set only by software */ +#define LL_TIM_AUTOMATICOUTPUT_ENABLE TIM_BDTR_AOE /*!< MOE can be set by software or automatically at the next update event */ +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** @defgroup TIM_LL_EC_IT IT Defines + * @brief IT defines which can be used with LL_TIM_ReadReg and LL_TIM_WriteReg functions. + * @{ + */ +#define LL_TIM_DIER_UIE TIM_DIER_UIE /*!< Update interrupt enable */ +#define LL_TIM_DIER_CC1IE TIM_DIER_CC1IE /*!< Capture/compare 1 interrupt enable */ +#define LL_TIM_DIER_CC2IE TIM_DIER_CC2IE /*!< Capture/compare 2 interrupt enable */ +#define LL_TIM_DIER_CC3IE TIM_DIER_CC3IE /*!< Capture/compare 3 interrupt enable */ +#define LL_TIM_DIER_CC4IE TIM_DIER_CC4IE /*!< Capture/compare 4 interrupt enable */ +#define LL_TIM_DIER_COMIE TIM_DIER_COMIE /*!< COM interrupt enable */ +#define LL_TIM_DIER_TIE TIM_DIER_TIE /*!< Trigger interrupt enable */ +#define LL_TIM_DIER_BIE TIM_DIER_BIE /*!< Break interrupt enable */ +/** + * @} + */ + +/** @defgroup TIM_LL_EC_UPDATESOURCE Update Source + * @{ + */ +#define LL_TIM_UPDATESOURCE_REGULAR 0x00000000U /*!< Counter overflow/underflow, Setting the UG bit or Update generation through the slave mode controller generates an update request */ +#define LL_TIM_UPDATESOURCE_COUNTER TIM_CR1_URS /*!< Only counter overflow/underflow generates an update request */ +/** + * @} + */ + +/** @defgroup TIM_LL_EC_ONEPULSEMODE One Pulse Mode + * @{ + */ +#define LL_TIM_ONEPULSEMODE_SINGLE TIM_CR1_OPM /*!< Counter stops counting at the next update event */ +#define LL_TIM_ONEPULSEMODE_REPETITIVE 0x00000000U /*!< Counter is not stopped at update event */ +/** + * @} + */ + +/** @defgroup TIM_LL_EC_COUNTERMODE Counter Mode + * @{ + */ +#define LL_TIM_COUNTERMODE_UP 0x00000000U /*!TIMx_CCRy else active.*/ +#define LL_TIM_OCMODE_PWM2 (TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0) /*!TIMx_CCRy else inactive*/ +#if defined(TIM_CCMR1_OC1M_3) +#define LL_TIM_OCMODE_RETRIG_OPM1 TIM_CCMR1_OC1M_3 /*!__REG__, (__VALUE__)) + +/** + * @brief Read a value in TIM register. + * @param __INSTANCE__ TIM Instance + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_TIM_ReadReg(__INSTANCE__, __REG__) READ_REG((__INSTANCE__)->__REG__) +/** + * @} + */ + +/** + * @brief HELPER macro retrieving the UIFCPY flag from the counter value. + * @note ex: @ref __LL_TIM_GETFLAG_UIFCPY (@ref LL_TIM_GetCounter ()); + * @note Relevant only if UIF flag remapping has been enabled (UIF status bit is copied + * to TIMx_CNT register bit 31) + * @param __CNT__ Counter value + * @retval UIF status bit + */ +#define __LL_TIM_GETFLAG_UIFCPY(__CNT__) \ + (READ_BIT((__CNT__), TIM_CNT_UIFCPY) >> TIM_CNT_UIFCPY_Pos) + +/** + * @brief HELPER macro calculating DTG[0:7] in the TIMx_BDTR register to achieve the requested dead time duration. + * @note ex: @ref __LL_TIM_CALC_DEADTIME (80000000, @ref LL_TIM_GetClockDivision (), 120); + * @param __TIMCLK__ timer input clock frequency (in Hz) + * @param __CKD__ This parameter can be one of the following values: + * @arg @ref LL_TIM_CLOCKDIVISION_DIV1 + * @arg @ref LL_TIM_CLOCKDIVISION_DIV2 + * @arg @ref LL_TIM_CLOCKDIVISION_DIV4 + * @param __DT__ deadtime duration (in ns) + * @retval DTG[0:7] + */ +#define __LL_TIM_CALC_DEADTIME(__TIMCLK__, __CKD__, __DT__) \ + ( (((uint64_t)((__DT__)*1000U)) < ((DT_DELAY_1+1U) * TIM_CALC_DTS((__TIMCLK__), (__CKD__)))) ? \ + (uint8_t)(((uint64_t)((__DT__)*1000U) / TIM_CALC_DTS((__TIMCLK__), (__CKD__))) & DT_DELAY_1) : \ + (((uint64_t)((__DT__)*1000U)) < ((64U + (DT_DELAY_2+1U)) * 2U * TIM_CALC_DTS((__TIMCLK__), (__CKD__)))) ? \ + (uint8_t)(DT_RANGE_2 | ((uint8_t)((uint8_t)((((uint64_t)((__DT__)*1000U))/ TIM_CALC_DTS((__TIMCLK__), \ + (__CKD__))) >> 1U) - (uint8_t) 64) & DT_DELAY_2)) :\ + (((uint64_t)((__DT__)*1000U)) < ((32U + (DT_DELAY_3+1U)) * 8U * TIM_CALC_DTS((__TIMCLK__), (__CKD__)))) ? \ + (uint8_t)(DT_RANGE_3 | ((uint8_t)((uint8_t)(((((uint64_t)(__DT__)*1000U))/ TIM_CALC_DTS((__TIMCLK__), \ + (__CKD__))) >> 3U) - (uint8_t) 32) & DT_DELAY_3)) :\ + (((uint64_t)((__DT__)*1000U)) < ((32U + (DT_DELAY_4+1U)) * 16U * TIM_CALC_DTS((__TIMCLK__), (__CKD__)))) ? \ + (uint8_t)(DT_RANGE_4 | ((uint8_t)((uint8_t)(((((uint64_t)(__DT__)*1000U))/ TIM_CALC_DTS((__TIMCLK__), \ + (__CKD__))) >> 4U) - (uint8_t) 32) & DT_DELAY_4)) :\ + 0U) + +/** + * @brief HELPER macro calculating the prescaler value to achieve the required counter clock frequency. + * @note ex: @ref __LL_TIM_CALC_PSC (80000000, 1000000); + * @param __TIMCLK__ timer input clock frequency (in Hz) + * @param __CNTCLK__ counter clock frequency (in Hz) + * @retval Prescaler value (between Min_Data=0 and Max_Data=65535) + */ +#define __LL_TIM_CALC_PSC(__TIMCLK__, __CNTCLK__) \ + (((__TIMCLK__) >= (__CNTCLK__)) ? (uint32_t)((((__TIMCLK__) + (__CNTCLK__)/2U)/(__CNTCLK__)) - 1U) : 0U) + +/** + * @brief HELPER macro calculating the auto-reload value to achieve the required output signal frequency. + * @note ex: @ref __LL_TIM_CALC_ARR (1000000, @ref LL_TIM_GetPrescaler (), 10000); + * @param __TIMCLK__ timer input clock frequency (in Hz) + * @param __PSC__ prescaler + * @param __FREQ__ output signal frequency (in Hz) + * @retval Auto-reload value (between Min_Data=0 and Max_Data=65535) + */ +#define __LL_TIM_CALC_ARR(__TIMCLK__, __PSC__, __FREQ__) \ + ((((__TIMCLK__)/((__PSC__) + 1U)) >= (__FREQ__)) ? (((__TIMCLK__)/((__FREQ__) * ((__PSC__) + 1U))) - 1U) : 0U) + +/** + * @brief HELPER macro calculating the compare value required to achieve the required timer output compare + * active/inactive delay. + * @note ex: @ref __LL_TIM_CALC_DELAY (1000000, @ref LL_TIM_GetPrescaler (), 10); + * @param __TIMCLK__ timer input clock frequency (in Hz) + * @param __PSC__ prescaler + * @param __DELAY__ timer output compare active/inactive delay (in us) + * @retval Compare value (between Min_Data=0 and Max_Data=65535) + */ +#define __LL_TIM_CALC_DELAY(__TIMCLK__, __PSC__, __DELAY__) \ + ((uint32_t)(((uint64_t)(__TIMCLK__) * (uint64_t)(__DELAY__)) \ + / ((uint64_t)1000000U * (uint64_t)((__PSC__) + 1U)))) + +/** + * @brief HELPER macro calculating the auto-reload value to achieve the required pulse duration + * (when the timer operates in one pulse mode). + * @note ex: @ref __LL_TIM_CALC_PULSE (1000000, @ref LL_TIM_GetPrescaler (), 10, 20); + * @param __TIMCLK__ timer input clock frequency (in Hz) + * @param __PSC__ prescaler + * @param __DELAY__ timer output compare active/inactive delay (in us) + * @param __PULSE__ pulse duration (in us) + * @retval Auto-reload value (between Min_Data=0 and Max_Data=65535) + */ +#define __LL_TIM_CALC_PULSE(__TIMCLK__, __PSC__, __DELAY__, __PULSE__) \ + ((uint32_t)(__LL_TIM_CALC_DELAY((__TIMCLK__), (__PSC__), (__PULSE__)) \ + + __LL_TIM_CALC_DELAY((__TIMCLK__), (__PSC__), (__DELAY__)))) + +/** + * @brief HELPER macro retrieving the ratio of the input capture prescaler + * @note ex: @ref __LL_TIM_GET_ICPSC_RATIO (@ref LL_TIM_IC_GetPrescaler ()); + * @param __ICPSC__ This parameter can be one of the following values: + * @arg @ref LL_TIM_ICPSC_DIV1 + * @arg @ref LL_TIM_ICPSC_DIV2 + * @arg @ref LL_TIM_ICPSC_DIV4 + * @arg @ref LL_TIM_ICPSC_DIV8 + * @retval Input capture prescaler ratio (1, 2, 4 or 8) + */ +#define __LL_TIM_GET_ICPSC_RATIO(__ICPSC__) \ + ((uint32_t)(0x01U << (((__ICPSC__) >> 16U) >> TIM_CCMR1_IC1PSC_Pos))) + + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup TIM_LL_Exported_Functions TIM Exported Functions + * @{ + */ + +/** @defgroup TIM_LL_EF_Time_Base Time Base configuration + * @{ + */ +/** + * @brief Enable timer counter. + * @rmtoll CR1 CEN LL_TIM_EnableCounter + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableCounter(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->CR1, TIM_CR1_CEN); +} + +/** + * @brief Disable timer counter. + * @rmtoll CR1 CEN LL_TIM_DisableCounter + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableCounter(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->CR1, TIM_CR1_CEN); +} + +/** + * @brief Indicates whether the timer counter is enabled. + * @rmtoll CR1 CEN LL_TIM_IsEnabledCounter + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledCounter(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->CR1, TIM_CR1_CEN) == (TIM_CR1_CEN)) ? 1UL : 0UL); +} + +/** + * @brief Enable update event generation. + * @rmtoll CR1 UDIS LL_TIM_EnableUpdateEvent + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableUpdateEvent(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->CR1, TIM_CR1_UDIS); +} + +/** + * @brief Disable update event generation. + * @rmtoll CR1 UDIS LL_TIM_DisableUpdateEvent + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableUpdateEvent(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->CR1, TIM_CR1_UDIS); +} + +/** + * @brief Indicates whether update event generation is enabled. + * @rmtoll CR1 UDIS LL_TIM_IsEnabledUpdateEvent + * @param TIMx Timer instance + * @retval Inverted state of bit (0 or 1). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledUpdateEvent(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->CR1, TIM_CR1_UDIS) == (uint32_t)RESET) ? 1UL : 0UL); +} + +/** + * @brief Set update event source + * @note Update event source set to LL_TIM_UPDATESOURCE_REGULAR: any of the following events + * generate an update interrupt or DMA request if enabled: + * - Counter overflow/underflow + * - Setting the UG bit + * - Update generation through the slave mode controller + * @note Update event source set to LL_TIM_UPDATESOURCE_COUNTER: only counter + * overflow/underflow generates an update interrupt or DMA request if enabled. + * @rmtoll CR1 URS LL_TIM_SetUpdateSource + * @param TIMx Timer instance + * @param UpdateSource This parameter can be one of the following values: + * @arg @ref LL_TIM_UPDATESOURCE_REGULAR + * @arg @ref LL_TIM_UPDATESOURCE_COUNTER + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetUpdateSource(TIM_TypeDef *TIMx, uint32_t UpdateSource) +{ + MODIFY_REG(TIMx->CR1, TIM_CR1_URS, UpdateSource); +} + +/** + * @brief Get actual event update source + * @rmtoll CR1 URS LL_TIM_GetUpdateSource + * @param TIMx Timer instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_UPDATESOURCE_REGULAR + * @arg @ref LL_TIM_UPDATESOURCE_COUNTER + */ +__STATIC_INLINE uint32_t LL_TIM_GetUpdateSource(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_BIT(TIMx->CR1, TIM_CR1_URS)); +} + +/** + * @brief Set one pulse mode (one shot v.s. repetitive). + * @rmtoll CR1 OPM LL_TIM_SetOnePulseMode + * @param TIMx Timer instance + * @param OnePulseMode This parameter can be one of the following values: + * @arg @ref LL_TIM_ONEPULSEMODE_SINGLE + * @arg @ref LL_TIM_ONEPULSEMODE_REPETITIVE + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetOnePulseMode(TIM_TypeDef *TIMx, uint32_t OnePulseMode) +{ + MODIFY_REG(TIMx->CR1, TIM_CR1_OPM, OnePulseMode); +} + +/** + * @brief Get actual one pulse mode. + * @rmtoll CR1 OPM LL_TIM_GetOnePulseMode + * @param TIMx Timer instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_ONEPULSEMODE_SINGLE + * @arg @ref LL_TIM_ONEPULSEMODE_REPETITIVE + */ +__STATIC_INLINE uint32_t LL_TIM_GetOnePulseMode(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_BIT(TIMx->CR1, TIM_CR1_OPM)); +} + +/** + * @brief Set the timer counter counting mode. + * @note Macro IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to + * check whether or not the counter mode selection feature is supported + * by a timer instance. + * @note Switching from Center Aligned counter mode to Edge counter mode (or reverse) + * requires a timer reset to avoid unexpected direction + * due to DIR bit readonly in center aligned mode. + * @rmtoll CR1 DIR LL_TIM_SetCounterMode\n + * CR1 CMS LL_TIM_SetCounterMode + * @param TIMx Timer instance + * @param CounterMode This parameter can be one of the following values: + * @arg @ref LL_TIM_COUNTERMODE_UP + * @arg @ref LL_TIM_COUNTERMODE_DOWN + * @arg @ref LL_TIM_COUNTERMODE_CENTER_UP + * @arg @ref LL_TIM_COUNTERMODE_CENTER_DOWN + * @arg @ref LL_TIM_COUNTERMODE_CENTER_UP_DOWN + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetCounterMode(TIM_TypeDef *TIMx, uint32_t CounterMode) +{ + MODIFY_REG(TIMx->CR1, (TIM_CR1_DIR | TIM_CR1_CMS), CounterMode); +} + +/** + * @brief Get actual counter mode. + * @note Macro IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx) can be used to + * check whether or not the counter mode selection feature is supported + * by a timer instance. + * @rmtoll CR1 DIR LL_TIM_GetCounterMode\n + * CR1 CMS LL_TIM_GetCounterMode + * @param TIMx Timer instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_COUNTERMODE_UP + * @arg @ref LL_TIM_COUNTERMODE_DOWN + * @arg @ref LL_TIM_COUNTERMODE_CENTER_UP + * @arg @ref LL_TIM_COUNTERMODE_CENTER_DOWN + * @arg @ref LL_TIM_COUNTERMODE_CENTER_UP_DOWN + */ +__STATIC_INLINE uint32_t LL_TIM_GetCounterMode(const TIM_TypeDef *TIMx) +{ + uint32_t counter_mode; + + counter_mode = (uint32_t)(READ_BIT(TIMx->CR1, TIM_CR1_CMS)); + + if (counter_mode == 0U) + { + counter_mode = (uint32_t)(READ_BIT(TIMx->CR1, TIM_CR1_DIR)); + } + + return counter_mode; +} + +/** + * @brief Enable auto-reload (ARR) preload. + * @rmtoll CR1 ARPE LL_TIM_EnableARRPreload + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableARRPreload(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->CR1, TIM_CR1_ARPE); +} + +/** + * @brief Disable auto-reload (ARR) preload. + * @rmtoll CR1 ARPE LL_TIM_DisableARRPreload + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableARRPreload(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->CR1, TIM_CR1_ARPE); +} + +/** + * @brief Indicates whether auto-reload (ARR) preload is enabled. + * @rmtoll CR1 ARPE LL_TIM_IsEnabledARRPreload + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledARRPreload(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->CR1, TIM_CR1_ARPE) == (TIM_CR1_ARPE)) ? 1UL : 0UL); +} + +/** + * @brief Set the division ratio between the timer clock and the sampling clock used by the dead-time generators + * (when supported) and the digital filters. + * @note Macro IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx) can be used to check + * whether or not the clock division feature is supported by the timer + * instance. + * @rmtoll CR1 CKD LL_TIM_SetClockDivision + * @param TIMx Timer instance + * @param ClockDivision This parameter can be one of the following values: + * @arg @ref LL_TIM_CLOCKDIVISION_DIV1 + * @arg @ref LL_TIM_CLOCKDIVISION_DIV2 + * @arg @ref LL_TIM_CLOCKDIVISION_DIV4 + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetClockDivision(TIM_TypeDef *TIMx, uint32_t ClockDivision) +{ + MODIFY_REG(TIMx->CR1, TIM_CR1_CKD, ClockDivision); +} + +/** + * @brief Get the actual division ratio between the timer clock and the sampling clock used by the dead-time + * generators (when supported) and the digital filters. + * @note Macro IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx) can be used to check + * whether or not the clock division feature is supported by the timer + * instance. + * @rmtoll CR1 CKD LL_TIM_GetClockDivision + * @param TIMx Timer instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_CLOCKDIVISION_DIV1 + * @arg @ref LL_TIM_CLOCKDIVISION_DIV2 + * @arg @ref LL_TIM_CLOCKDIVISION_DIV4 + */ +__STATIC_INLINE uint32_t LL_TIM_GetClockDivision(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_BIT(TIMx->CR1, TIM_CR1_CKD)); +} + +/** + * @brief Set the counter value. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @rmtoll CNT CNT LL_TIM_SetCounter + * @param TIMx Timer instance + * @param Counter Counter value (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF) + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetCounter(TIM_TypeDef *TIMx, uint32_t Counter) +{ + WRITE_REG(TIMx->CNT, Counter); +} + +/** + * @brief Get the counter value. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @rmtoll CNT CNT LL_TIM_GetCounter + * @param TIMx Timer instance + * @retval Counter value (between Min_Data=0 and Max_Data=0xFFFF or 0xFFFFFFFF) + */ +__STATIC_INLINE uint32_t LL_TIM_GetCounter(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CNT)); +} + +/** + * @brief Get the current direction of the counter + * @rmtoll CR1 DIR LL_TIM_GetDirection + * @param TIMx Timer instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_COUNTERDIRECTION_UP + * @arg @ref LL_TIM_COUNTERDIRECTION_DOWN + */ +__STATIC_INLINE uint32_t LL_TIM_GetDirection(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_BIT(TIMx->CR1, TIM_CR1_DIR)); +} + +/** + * @brief Set the prescaler value. + * @note The counter clock frequency CK_CNT is equal to fCK_PSC / (PSC[15:0] + 1). + * @note The prescaler can be changed on the fly as this control register is buffered. The new + * prescaler ratio is taken into account at the next update event. + * @note Helper macro @ref __LL_TIM_CALC_PSC can be used to calculate the Prescaler parameter + * @rmtoll PSC PSC LL_TIM_SetPrescaler + * @param TIMx Timer instance + * @param Prescaler between Min_Data=0 and Max_Data=65535 + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetPrescaler(TIM_TypeDef *TIMx, uint32_t Prescaler) +{ + WRITE_REG(TIMx->PSC, Prescaler); +} + +/** + * @brief Get the prescaler value. + * @rmtoll PSC PSC LL_TIM_GetPrescaler + * @param TIMx Timer instance + * @retval Prescaler value between Min_Data=0 and Max_Data=65535 + */ +__STATIC_INLINE uint32_t LL_TIM_GetPrescaler(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->PSC)); +} + +/** + * @brief Set the auto-reload value. + * @note The counter is blocked while the auto-reload value is null. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Helper macro @ref __LL_TIM_CALC_ARR can be used to calculate the AutoReload parameter + * @rmtoll ARR ARR LL_TIM_SetAutoReload + * @param TIMx Timer instance + * @param AutoReload between Min_Data=0 and Max_Data=65535 + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetAutoReload(TIM_TypeDef *TIMx, uint32_t AutoReload) +{ + WRITE_REG(TIMx->ARR, AutoReload); +} + +/** + * @brief Get the auto-reload value. + * @rmtoll ARR ARR LL_TIM_GetAutoReload + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @param TIMx Timer instance + * @retval Auto-reload value + */ +__STATIC_INLINE uint32_t LL_TIM_GetAutoReload(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->ARR)); +} + +/** + * @brief Set the repetition counter value. + * @note For advanced timer instances RepetitionCounter can be up to 65535 except for STM32F373xC and STM32F378xx devices. + * @note Macro IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a repetition counter. + * @rmtoll RCR REP LL_TIM_SetRepetitionCounter + * @param TIMx Timer instance + * @param RepetitionCounter between Min_Data=0 and Max_Data=255 or 65535 for advanced timer. + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetRepetitionCounter(TIM_TypeDef *TIMx, uint32_t RepetitionCounter) +{ + WRITE_REG(TIMx->RCR, RepetitionCounter); +} + +/** + * @brief Get the repetition counter value. + * @note Macro IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a repetition counter. + * @rmtoll RCR REP LL_TIM_GetRepetitionCounter + * @param TIMx Timer instance + * @retval Repetition counter value + */ +__STATIC_INLINE uint32_t LL_TIM_GetRepetitionCounter(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->RCR)); +} + +#if defined(TIM_CR1_UIFREMAP) +/** + * @brief Force a continuous copy of the update interrupt flag (UIF) into the timer counter register (bit 31). + * @note This allows both the counter value and a potential roll-over condition signalled by the UIFCPY flag to be read + * in an atomic way. + * @rmtoll CR1 UIFREMAP LL_TIM_EnableUIFRemap + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableUIFRemap(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->CR1, TIM_CR1_UIFREMAP); +} + +/** + * @brief Disable update interrupt flag (UIF) remapping. + * @rmtoll CR1 UIFREMAP LL_TIM_DisableUIFRemap + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableUIFRemap(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->CR1, TIM_CR1_UIFREMAP); +} + +/** + * @brief Indicate whether update interrupt flag (UIF) copy is set. + * @param Counter Counter value + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveUIFCPY(const uint32_t Counter) +{ + return (((Counter & TIM_CNT_UIFCPY) == (TIM_CNT_UIFCPY)) ? 1UL : 0UL); +} + +#endif /* TIM_CR1_UIFREMAP */ +/** + * @} + */ + +/** @defgroup TIM_LL_EF_Capture_Compare Capture Compare configuration + * @{ + */ +/** + * @brief Enable the capture/compare control bits (CCxE, CCxNE and OCxM) preload. + * @note CCxE, CCxNE and OCxM bits are preloaded, after having been written, + * they are updated only when a commutation event (COM) occurs. + * @note Only on channels that have a complementary output. + * @note Macro IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check + * whether or not a timer instance is able to generate a commutation event. + * @rmtoll CR2 CCPC LL_TIM_CC_EnablePreload + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_CC_EnablePreload(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->CR2, TIM_CR2_CCPC); +} + +/** + * @brief Disable the capture/compare control bits (CCxE, CCxNE and OCxM) preload. + * @note Macro IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check + * whether or not a timer instance is able to generate a commutation event. + * @rmtoll CR2 CCPC LL_TIM_CC_DisablePreload + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_CC_DisablePreload(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->CR2, TIM_CR2_CCPC); +} + +/** + * @brief Set the updated source of the capture/compare control bits (CCxE, CCxNE and OCxM). + * @note Macro IS_TIM_COMMUTATION_EVENT_INSTANCE(TIMx) can be used to check + * whether or not a timer instance is able to generate a commutation event. + * @rmtoll CR2 CCUS LL_TIM_CC_SetUpdate + * @param TIMx Timer instance + * @param CCUpdateSource This parameter can be one of the following values: + * @arg @ref LL_TIM_CCUPDATESOURCE_COMG_ONLY + * @arg @ref LL_TIM_CCUPDATESOURCE_COMG_AND_TRGI + * @retval None + */ +__STATIC_INLINE void LL_TIM_CC_SetUpdate(TIM_TypeDef *TIMx, uint32_t CCUpdateSource) +{ + MODIFY_REG(TIMx->CR2, TIM_CR2_CCUS, CCUpdateSource); +} + +/** + * @brief Set the trigger of the capture/compare DMA request. + * @rmtoll CR2 CCDS LL_TIM_CC_SetDMAReqTrigger + * @param TIMx Timer instance + * @param DMAReqTrigger This parameter can be one of the following values: + * @arg @ref LL_TIM_CCDMAREQUEST_CC + * @arg @ref LL_TIM_CCDMAREQUEST_UPDATE + * @retval None + */ +__STATIC_INLINE void LL_TIM_CC_SetDMAReqTrigger(TIM_TypeDef *TIMx, uint32_t DMAReqTrigger) +{ + MODIFY_REG(TIMx->CR2, TIM_CR2_CCDS, DMAReqTrigger); +} + +/** + * @brief Get actual trigger of the capture/compare DMA request. + * @rmtoll CR2 CCDS LL_TIM_CC_GetDMAReqTrigger + * @param TIMx Timer instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_CCDMAREQUEST_CC + * @arg @ref LL_TIM_CCDMAREQUEST_UPDATE + */ +__STATIC_INLINE uint32_t LL_TIM_CC_GetDMAReqTrigger(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_BIT(TIMx->CR2, TIM_CR2_CCDS)); +} + +/** + * @brief Set the lock level to freeze the + * configuration of several capture/compare parameters. + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * the lock mechanism is supported by a timer instance. + * @rmtoll BDTR LOCK LL_TIM_CC_SetLockLevel + * @param TIMx Timer instance + * @param LockLevel This parameter can be one of the following values: + * @arg @ref LL_TIM_LOCKLEVEL_OFF + * @arg @ref LL_TIM_LOCKLEVEL_1 + * @arg @ref LL_TIM_LOCKLEVEL_2 + * @arg @ref LL_TIM_LOCKLEVEL_3 + * @retval None + */ +__STATIC_INLINE void LL_TIM_CC_SetLockLevel(TIM_TypeDef *TIMx, uint32_t LockLevel) +{ + MODIFY_REG(TIMx->BDTR, TIM_BDTR_LOCK, LockLevel); +} + +/** + * @brief Enable capture/compare channels. + * @rmtoll CCER CC1E LL_TIM_CC_EnableChannel\n + * CCER CC1NE LL_TIM_CC_EnableChannel\n + * CCER CC2E LL_TIM_CC_EnableChannel\n + * CCER CC2NE LL_TIM_CC_EnableChannel\n + * CCER CC3E LL_TIM_CC_EnableChannel\n + * CCER CC3NE LL_TIM_CC_EnableChannel\n + * CCER CC4E LL_TIM_CC_EnableChannel\n + * CCER CC5E LL_TIM_CC_EnableChannel\n + * CCER CC6E LL_TIM_CC_EnableChannel + * @param TIMx Timer instance + * @param Channels This parameter can be a combination of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH1N + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH2N + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH3N + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_CC_EnableChannel(TIM_TypeDef *TIMx, uint32_t Channels) +{ + SET_BIT(TIMx->CCER, Channels); +} + +/** + * @brief Disable capture/compare channels. + * @rmtoll CCER CC1E LL_TIM_CC_DisableChannel\n + * CCER CC1NE LL_TIM_CC_DisableChannel\n + * CCER CC2E LL_TIM_CC_DisableChannel\n + * CCER CC2NE LL_TIM_CC_DisableChannel\n + * CCER CC3E LL_TIM_CC_DisableChannel\n + * CCER CC3NE LL_TIM_CC_DisableChannel\n + * CCER CC4E LL_TIM_CC_DisableChannel\n + * CCER CC5E LL_TIM_CC_DisableChannel\n + * CCER CC6E LL_TIM_CC_DisableChannel + * @param TIMx Timer instance + * @param Channels This parameter can be a combination of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH1N + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH2N + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH3N + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_CC_DisableChannel(TIM_TypeDef *TIMx, uint32_t Channels) +{ + CLEAR_BIT(TIMx->CCER, Channels); +} + +/** + * @brief Indicate whether channel(s) is(are) enabled. + * @rmtoll CCER CC1E LL_TIM_CC_IsEnabledChannel\n + * CCER CC1NE LL_TIM_CC_IsEnabledChannel\n + * CCER CC2E LL_TIM_CC_IsEnabledChannel\n + * CCER CC2NE LL_TIM_CC_IsEnabledChannel\n + * CCER CC3E LL_TIM_CC_IsEnabledChannel\n + * CCER CC3NE LL_TIM_CC_IsEnabledChannel\n + * CCER CC4E LL_TIM_CC_IsEnabledChannel\n + * CCER CC5E LL_TIM_CC_IsEnabledChannel\n + * CCER CC6E LL_TIM_CC_IsEnabledChannel + * @param TIMx Timer instance + * @param Channels This parameter can be a combination of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH1N + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH2N + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH3N + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_CC_IsEnabledChannel(const TIM_TypeDef *TIMx, uint32_t Channels) +{ + return ((READ_BIT(TIMx->CCER, Channels) == (Channels)) ? 1UL : 0UL); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_Output_Channel Output channel configuration + * @{ + */ +/** + * @brief Configure an output channel. + * @rmtoll CCMR1 CC1S LL_TIM_OC_ConfigOutput\n + * CCMR1 CC2S LL_TIM_OC_ConfigOutput\n + * CCMR2 CC3S LL_TIM_OC_ConfigOutput\n + * CCMR2 CC4S LL_TIM_OC_ConfigOutput\n + * @if STM32F334x8 + * CCMR3 CC5S LL_TIM_OC_ConfigOutput\n + * CCMR3 CC6S LL_TIM_OC_ConfigOutput\n + * @elseif STM32F303xC + * CCMR3 CC5S LL_TIM_OC_ConfigOutput\n + * CCMR3 CC6S LL_TIM_OC_ConfigOutput\n + * @elseif STM32F302x8 + * CCMR3 CC5S LL_TIM_OC_ConfigOutput\n + * CCMR3 CC6S LL_TIM_OC_ConfigOutput\n + * @endif + * CCER CC1P LL_TIM_OC_ConfigOutput\n + * CCER CC2P LL_TIM_OC_ConfigOutput\n + * CCER CC3P LL_TIM_OC_ConfigOutput\n + * CCER CC4P LL_TIM_OC_ConfigOutput\n + * CCER CC5P LL_TIM_OC_ConfigOutput\n + * CCER CC6P LL_TIM_OC_ConfigOutput\n + * CR2 OIS1 LL_TIM_OC_ConfigOutput\n + * CR2 OIS2 LL_TIM_OC_ConfigOutput\n + * CR2 OIS3 LL_TIM_OC_ConfigOutput\n + * CR2 OIS4 LL_TIM_OC_ConfigOutput\n + * CR2 OIS5 LL_TIM_OC_ConfigOutput\n + * CR2 OIS6 LL_TIM_OC_ConfigOutput + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @param Configuration This parameter must be a combination of all the following values: + * @arg @ref LL_TIM_OCPOLARITY_HIGH or @ref LL_TIM_OCPOLARITY_LOW + * @arg @ref LL_TIM_OCIDLESTATE_LOW or @ref LL_TIM_OCIDLESTATE_HIGH + * @note CH3 CH4 CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_ConfigOutput(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t Configuration) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + CLEAR_BIT(*pReg, (TIM_CCMR1_CC1S << SHIFT_TAB_OCxx[iChannel])); + MODIFY_REG(TIMx->CCER, (TIM_CCER_CC1P << SHIFT_TAB_CCxP[iChannel]), + (Configuration & TIM_CCER_CC1P) << SHIFT_TAB_CCxP[iChannel]); + MODIFY_REG(TIMx->CR2, (TIM_CR2_OIS1 << SHIFT_TAB_OISx[iChannel]), + (Configuration & TIM_CR2_OIS1) << SHIFT_TAB_OISx[iChannel]); +} + +/** + * @brief Define the behavior of the output reference signal OCxREF from which + * OCx and OCxN (when relevant) are derived. + * @rmtoll CCMR1 OC1M LL_TIM_OC_SetMode\n + * CCMR1 OC2M LL_TIM_OC_SetMode\n + * CCMR2 OC3M LL_TIM_OC_SetMode\n + * CCMR2 OC4M LL_TIM_OC_SetMode\n + * @if STM32F334x8 + * CCMR3 OC5M LL_TIM_OC_SetMode\n + * CCMR3 OC6M LL_TIM_OC_SetMode + * @elseif STM32F303xC + * CCMR3 OC5M LL_TIM_OC_SetMode\n + * CCMR3 OC6M LL_TIM_OC_SetMode + * @elseif STM32F302x8 + * CCMR3 OC5M LL_TIM_OC_SetMode\n + * CCMR3 OC6M LL_TIM_OC_SetMode + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @param Mode This parameter can be one of the following values: + * @arg @ref LL_TIM_OCMODE_FROZEN + * @arg @ref LL_TIM_OCMODE_ACTIVE + * @arg @ref LL_TIM_OCMODE_INACTIVE + * @arg @ref LL_TIM_OCMODE_TOGGLE + * @arg @ref LL_TIM_OCMODE_FORCED_INACTIVE + * @arg @ref LL_TIM_OCMODE_FORCED_ACTIVE + * @arg @ref LL_TIM_OCMODE_PWM1 + * @arg @ref LL_TIM_OCMODE_PWM2 + * @arg @ref LL_TIM_OCMODE_RETRIG_OPM1 + * @arg @ref LL_TIM_OCMODE_RETRIG_OPM2 + * @arg @ref LL_TIM_OCMODE_COMBINED_PWM1 + * @arg @ref LL_TIM_OCMODE_COMBINED_PWM2 + * @arg @ref LL_TIM_OCMODE_ASSYMETRIC_PWM1 + * @arg @ref LL_TIM_OCMODE_ASSYMETRIC_PWM2 + * @note The following OC modes are not available on all F3 devices : + * - LL_TIM_OCMODE_RETRIG_OPM1 + * - LL_TIM_OCMODE_RETRIG_OPM2 + * - LL_TIM_OCMODE_COMBINED_PWM1 + * - LL_TIM_OCMODE_COMBINED_PWM2 + * - LL_TIM_OCMODE_ASSYMETRIC_PWM1 + * - LL_TIM_OCMODE_ASSYMETRIC_PWM2 + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetMode(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t Mode) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + MODIFY_REG(*pReg, ((TIM_CCMR1_OC1M | TIM_CCMR1_CC1S) << SHIFT_TAB_OCxx[iChannel]), Mode << SHIFT_TAB_OCxx[iChannel]); +} + +/** + * @brief Get the output compare mode of an output channel. + * @rmtoll CCMR1 OC1M LL_TIM_OC_GetMode\n + * CCMR1 OC2M LL_TIM_OC_GetMode\n + * CCMR2 OC3M LL_TIM_OC_GetMode\n + * CCMR2 OC4M LL_TIM_OC_GetMode\n + * @if STM32F334x8 + * CCMR3 OC5M LL_TIM_OC_GetMode\n + * CCMR3 OC6M LL_TIM_OC_GetMode + * @elseif STM32F303xC + * CCMR3 OC5M LL_TIM_OC_GetMode\n + * CCMR3 OC6M LL_TIM_OC_GetMode + * @elseif STM32F302x8 + * CCMR3 OC5M LL_TIM_OC_GetMode\n + * CCMR3 OC6M LL_TIM_OC_GetMode + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note The following OC modes are not available on all F3 devices : + * - LL_TIM_OCMODE_RETRIG_OPM1 + * - LL_TIM_OCMODE_RETRIG_OPM2 + * - LL_TIM_OCMODE_COMBINED_PWM1 + * - LL_TIM_OCMODE_COMBINED_PWM2 + * - LL_TIM_OCMODE_ASSYMETRIC_PWM1 + * - LL_TIM_OCMODE_ASSYMETRIC_PWM2 + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_OCMODE_FROZEN + * @arg @ref LL_TIM_OCMODE_ACTIVE + * @arg @ref LL_TIM_OCMODE_INACTIVE + * @arg @ref LL_TIM_OCMODE_TOGGLE + * @arg @ref LL_TIM_OCMODE_FORCED_INACTIVE + * @arg @ref LL_TIM_OCMODE_FORCED_ACTIVE + * @arg @ref LL_TIM_OCMODE_PWM1 + * @arg @ref LL_TIM_OCMODE_PWM2 + * @arg @ref LL_TIM_OCMODE_RETRIG_OPM1 + * @arg @ref LL_TIM_OCMODE_RETRIG_OPM2 + * @arg @ref LL_TIM_OCMODE_COMBINED_PWM1 + * @arg @ref LL_TIM_OCMODE_COMBINED_PWM2 + * @arg @ref LL_TIM_OCMODE_ASSYMETRIC_PWM1 + * @arg @ref LL_TIM_OCMODE_ASSYMETRIC_PWM2 + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetMode(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + return (READ_BIT(*pReg, ((TIM_CCMR1_OC1M | TIM_CCMR1_CC1S) << SHIFT_TAB_OCxx[iChannel])) >> SHIFT_TAB_OCxx[iChannel]); +} + +/** + * @brief Set the polarity of an output channel. + * @rmtoll CCER CC1P LL_TIM_OC_SetPolarity\n + * CCER CC1NP LL_TIM_OC_SetPolarity\n + * CCER CC2P LL_TIM_OC_SetPolarity\n + * CCER CC2NP LL_TIM_OC_SetPolarity\n + * CCER CC3P LL_TIM_OC_SetPolarity\n + * CCER CC3NP LL_TIM_OC_SetPolarity\n + * CCER CC4P LL_TIM_OC_SetPolarity\n + * CCER CC5P LL_TIM_OC_SetPolarity\n + * CCER CC6P LL_TIM_OC_SetPolarity + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH1N + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH2N + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH3N + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @param Polarity This parameter can be one of the following values: + * @arg @ref LL_TIM_OCPOLARITY_HIGH + * @arg @ref LL_TIM_OCPOLARITY_LOW + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetPolarity(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t Polarity) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + MODIFY_REG(TIMx->CCER, (TIM_CCER_CC1P << SHIFT_TAB_CCxP[iChannel]), Polarity << SHIFT_TAB_CCxP[iChannel]); +} + +/** + * @brief Get the polarity of an output channel. + * @rmtoll CCER CC1P LL_TIM_OC_GetPolarity\n + * CCER CC1NP LL_TIM_OC_GetPolarity\n + * CCER CC2P LL_TIM_OC_GetPolarity\n + * CCER CC2NP LL_TIM_OC_GetPolarity\n + * CCER CC3P LL_TIM_OC_GetPolarity\n + * CCER CC3NP LL_TIM_OC_GetPolarity\n + * CCER CC4P LL_TIM_OC_GetPolarity\n + * CCER CC5P LL_TIM_OC_GetPolarity\n + * CCER CC6P LL_TIM_OC_GetPolarity + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH1N + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH2N + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH3N + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_OCPOLARITY_HIGH + * @arg @ref LL_TIM_OCPOLARITY_LOW + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetPolarity(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + return (READ_BIT(TIMx->CCER, (TIM_CCER_CC1P << SHIFT_TAB_CCxP[iChannel])) >> SHIFT_TAB_CCxP[iChannel]); +} + +/** + * @brief Set the IDLE state of an output channel + * @note This function is significant only for the timer instances + * supporting the break feature. Macro IS_TIM_BREAK_INSTANCE(TIMx) + * can be used to check whether or not a timer instance provides + * a break input. + * @rmtoll CR2 OIS1 LL_TIM_OC_SetIdleState\n + * CR2 OIS2N LL_TIM_OC_SetIdleState\n + * CR2 OIS2 LL_TIM_OC_SetIdleState\n + * CR2 OIS2N LL_TIM_OC_SetIdleState\n + * CR2 OIS3 LL_TIM_OC_SetIdleState\n + * CR2 OIS3N LL_TIM_OC_SetIdleState\n + * CR2 OIS4 LL_TIM_OC_SetIdleState\n + * CR2 OIS5 LL_TIM_OC_SetIdleState\n + * CR2 OIS6 LL_TIM_OC_SetIdleState + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH1N + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH2N + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH3N + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @param IdleState This parameter can be one of the following values: + * @arg @ref LL_TIM_OCIDLESTATE_LOW + * @arg @ref LL_TIM_OCIDLESTATE_HIGH + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetIdleState(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t IdleState) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + MODIFY_REG(TIMx->CR2, (TIM_CR2_OIS1 << SHIFT_TAB_OISx[iChannel]), IdleState << SHIFT_TAB_OISx[iChannel]); +} + +/** + * @brief Get the IDLE state of an output channel + * @rmtoll CR2 OIS1 LL_TIM_OC_GetIdleState\n + * CR2 OIS2N LL_TIM_OC_GetIdleState\n + * CR2 OIS2 LL_TIM_OC_GetIdleState\n + * CR2 OIS2N LL_TIM_OC_GetIdleState\n + * CR2 OIS3 LL_TIM_OC_GetIdleState\n + * CR2 OIS3N LL_TIM_OC_GetIdleState\n + * CR2 OIS4 LL_TIM_OC_GetIdleState\n + * CR2 OIS5 LL_TIM_OC_GetIdleState\n + * CR2 OIS6 LL_TIM_OC_GetIdleState + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH1N + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH2N + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH3N + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_OCIDLESTATE_LOW + * @arg @ref LL_TIM_OCIDLESTATE_HIGH + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetIdleState(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + return (READ_BIT(TIMx->CR2, (TIM_CR2_OIS1 << SHIFT_TAB_OISx[iChannel])) >> SHIFT_TAB_OISx[iChannel]); +} + +/** + * @brief Enable fast mode for the output channel. + * @note Acts only if the channel is configured in PWM1 or PWM2 mode. + * @rmtoll CCMR1 OC1FE LL_TIM_OC_EnableFast\n + * CCMR1 OC2FE LL_TIM_OC_EnableFast\n + * CCMR2 OC3FE LL_TIM_OC_EnableFast\n + * CCMR2 OC4FE LL_TIM_OC_EnableFast\n + * @if STM32F334x8 + * CCMR3 OC5FE LL_TIM_OC_EnableFast\n + * CCMR3 OC6FE LL_TIM_OC_EnableFast + * @elseif STM32F303xC + * CCMR3 OC5FE LL_TIM_OC_EnableFast\n + * CCMR3 OC6FE LL_TIM_OC_EnableFast + * @elseif STM32F302x8 + * CCMR3 OC5FE LL_TIM_OC_EnableFast\n + * CCMR3 OC6FE LL_TIM_OC_EnableFast + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5FE and OC6FE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_EnableFast(TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + SET_BIT(*pReg, (TIM_CCMR1_OC1FE << SHIFT_TAB_OCxx[iChannel])); + +} + +/** + * @brief Disable fast mode for the output channel. + * @rmtoll CCMR1 OC1FE LL_TIM_OC_DisableFast\n + * CCMR1 OC2FE LL_TIM_OC_DisableFast\n + * CCMR2 OC3FE LL_TIM_OC_DisableFast\n + * CCMR2 OC4FE LL_TIM_OC_DisableFast\n + * @if STM32F334x8 + * CCMR3 OC5FE LL_TIM_OC_DisableFast\n + * CCMR3 OC6FE LL_TIM_OC_DisableFast + * @elseif STM32F303xC + * CCMR3 OC5FE LL_TIM_OC_DisableFast\n + * CCMR3 OC6FE LL_TIM_OC_DisableFast + * @elseif STM32F302x8 + * CCMR3 OC5FE LL_TIM_OC_DisableFast\n + * CCMR3 OC6FE LL_TIM_OC_DisableFast + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5FE and OC6FE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_DisableFast(TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + CLEAR_BIT(*pReg, (TIM_CCMR1_OC1FE << SHIFT_TAB_OCxx[iChannel])); + +} + +/** + * @brief Indicates whether fast mode is enabled for the output channel. + * @rmtoll CCMR1 OC1FE LL_TIM_OC_IsEnabledFast\n + * CCMR1 OC2FE LL_TIM_OC_IsEnabledFast\n + * CCMR2 OC3FE LL_TIM_OC_IsEnabledFast\n + * CCMR2 OC4FE LL_TIM_OC_IsEnabledFast\n + * @if STM32F334x8 + * CCMR3 OC5FE LL_TIM_OC_IsEnabledFast\n + * CCMR3 OC6FE LL_TIM_OC_IsEnabledFast + * @elseif STM32F303xC + * CCMR3 OC5FE LL_TIM_OC_IsEnabledFast\n + * CCMR3 OC6FE LL_TIM_OC_IsEnabledFast + * @elseif STM32F302x8 + * CCMR3 OC5FE LL_TIM_OC_DisableFast\n + * CCMR3 OC6FE LL_TIM_OC_DisableFast + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5FE and OC6FE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_OC_IsEnabledFast(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + uint32_t bitfield = TIM_CCMR1_OC1FE << SHIFT_TAB_OCxx[iChannel]; + return ((READ_BIT(*pReg, bitfield) == bitfield) ? 1UL : 0UL); +} + +/** + * @brief Enable compare register (TIMx_CCRx) preload for the output channel. + * @rmtoll CCMR1 OC1PE LL_TIM_OC_EnablePreload\n + * CCMR1 OC2PE LL_TIM_OC_EnablePreload\n + * CCMR2 OC3PE LL_TIM_OC_EnablePreload\n + * CCMR2 OC4PE LL_TIM_OC_EnablePreload\n + * @if STM32F334x8 + * CCMR3 OC5PE LL_TIM_OC_EnablePreload\n + * CCMR3 OC6PE LL_TIM_OC_EnablePreload + * @elseif STM32F303xC + * CCMR3 OC5PE LL_TIM_OC_EnablePreload\n + * CCMR3 OC6PE LL_TIM_OC_EnablePreload + * @elseif STM32F302x8 + * CCMR3 OC5PE LL_TIM_OC_EnablePreload\n + * CCMR3 OC6PE LL_TIM_OC_EnablePreload + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5PE and OC6PE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_EnablePreload(TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + SET_BIT(*pReg, (TIM_CCMR1_OC1PE << SHIFT_TAB_OCxx[iChannel])); +} + +/** + * @brief Disable compare register (TIMx_CCRx) preload for the output channel. + * @rmtoll CCMR1 OC1PE LL_TIM_OC_DisablePreload\n + * CCMR1 OC2PE LL_TIM_OC_DisablePreload\n + * CCMR2 OC3PE LL_TIM_OC_DisablePreload\n + * CCMR2 OC4PE LL_TIM_OC_DisablePreload\n + * @if STM32F334x8 + * CCMR3 OC5PE LL_TIM_OC_DisablePreload\n + * CCMR3 OC6PE LL_TIM_OC_DisablePreload + * @elseif STM32F303xC + * CCMR3 OC5PE LL_TIM_OC_DisablePreload\n + * CCMR3 OC6PE LL_TIM_OC_DisablePreload + * @elseif STM32F302x8 + * CCMR3 OC5PE LL_TIM_OC_DisablePreload\n + * CCMR3 OC6PE LL_TIM_OC_DisablePreload + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5PE and OC6PE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_DisablePreload(TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + CLEAR_BIT(*pReg, (TIM_CCMR1_OC1PE << SHIFT_TAB_OCxx[iChannel])); +} + +/** + * @brief Indicates whether compare register (TIMx_CCRx) preload is enabled for the output channel. + * @rmtoll CCMR1 OC1PE LL_TIM_OC_IsEnabledPreload\n + * CCMR1 OC2PE LL_TIM_OC_IsEnabledPreload\n + * CCMR2 OC3PE LL_TIM_OC_IsEnabledPreload\n + * CCMR2 OC4PE LL_TIM_OC_IsEnabledPreload\n + * @if STM32F334x8 + * CCMR3 OC5PE LL_TIM_OC_IsEnabledPreload\n + * CCMR3 OC6PE LL_TIM_OC_IsEnabledPreload + * @elseif STM32F303xC + * CCMR3 OC5PE LL_TIM_OC_IsEnabledPreload\n + * CCMR3 OC6PE LL_TIM_OC_IsEnabledPreload + * @elseif STM32F302x8 + * CCMR3 OC5PE LL_TIM_OC_IsEnabledPreload\n + * CCMR3 OC6PE LL_TIM_OC_IsEnabledPreload + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5PE and OC6PE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_OC_IsEnabledPreload(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + uint32_t bitfield = TIM_CCMR1_OC1PE << SHIFT_TAB_OCxx[iChannel]; + return ((READ_BIT(*pReg, bitfield) == bitfield) ? 1UL : 0UL); +} + +/** + * @brief Enable clearing the output channel on an external event. + * @note This function can only be used in Output compare and PWM modes. It does not work in Forced mode. + * @note Macro IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether + * or not a timer instance can clear the OCxREF signal on an external event. + * @rmtoll CCMR1 OC1CE LL_TIM_OC_EnableClear\n + * CCMR1 OC2CE LL_TIM_OC_EnableClear\n + * CCMR2 OC3CE LL_TIM_OC_EnableClear\n + * CCMR2 OC4CE LL_TIM_OC_EnableClear\n + * @if STM32F334x8 + * CCMR3 OC5CE LL_TIM_OC_EnableClear\n + * CCMR3 OC6CE LL_TIM_OC_EnableClear + * @elseif STM32F303xC + * CCMR3 OC5CE LL_TIM_OC_EnableClear\n + * CCMR3 OC6CE LL_TIM_OC_EnableClear + * @elseif STM32F302x8 + * CCMR3 OC5CE LL_TIM_OC_EnableClear\n + * CCMR3 OC6CE LL_TIM_OC_EnableClear + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5CE and OC6CE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_EnableClear(TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + SET_BIT(*pReg, (TIM_CCMR1_OC1CE << SHIFT_TAB_OCxx[iChannel])); +} + +/** + * @brief Disable clearing the output channel on an external event. + * @note Macro IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether + * or not a timer instance can clear the OCxREF signal on an external event. + * @rmtoll CCMR1 OC1CE LL_TIM_OC_DisableClear\n + * CCMR1 OC2CE LL_TIM_OC_DisableClear\n + * CCMR2 OC3CE LL_TIM_OC_DisableClear\n + * CCMR2 OC4CE LL_TIM_OC_DisableClear\n + * @if STM32F334x8 + * CCMR3 OC5CE LL_TIM_OC_DisableClear\n + * CCMR3 OC6CE LL_TIM_OC_DisableClear + * @elseif STM32F303xC + * CCMR3 OC5CE LL_TIM_OC_DisableClear\n + * CCMR3 OC6CE LL_TIM_OC_DisableClear + * @elseif STM32F302x8 + * CCMR3 OC5CE LL_TIM_OC_DisableClear\n + * CCMR3 OC6CE LL_TIM_OC_DisableClear + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5CE and OC6CE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_DisableClear(TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + CLEAR_BIT(*pReg, (TIM_CCMR1_OC1CE << SHIFT_TAB_OCxx[iChannel])); +} + +/** + * @brief Indicates clearing the output channel on an external event is enabled for the output channel. + * @note This function enables clearing the output channel on an external event. + * @note This function can only be used in Output compare and PWM modes. It does not work in Forced mode. + * @note Macro IS_TIM_OCXREF_CLEAR_INSTANCE(TIMx) can be used to check whether + * or not a timer instance can clear the OCxREF signal on an external event. + * @rmtoll CCMR1 OC1CE LL_TIM_OC_IsEnabledClear\n + * CCMR1 OC2CE LL_TIM_OC_IsEnabledClear\n + * CCMR2 OC3CE LL_TIM_OC_IsEnabledClear\n + * CCMR2 OC4CE LL_TIM_OC_IsEnabledClear\n + * @if STM32F334x8 + * CCMR3 OC5CE LL_TIM_OC_IsEnabledClear\n + * CCMR3 OC6CE LL_TIM_OC_IsEnabledClear + * @elseif STM32F303xC + * CCMR3 OC5CE LL_TIM_OC_IsEnabledClear\n + * CCMR3 OC6CE LL_TIM_OC_IsEnabledClear + * @elseif STM32F302x8 + * CCMR3 OC5CE LL_TIM_OC_IsEnabledClear\n + * CCMR3 OC6CE LL_TIM_OC_IsEnabledClear + * @endif + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @arg @ref LL_TIM_CHANNEL_CH5 + * @arg @ref LL_TIM_CHANNEL_CH6 + * @note OC5CE and OC6CE are not available for all F3 devices + * @note CH5 and CH6 channels are not available for all F3 devices + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_OC_IsEnabledClear(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + uint32_t bitfield = TIM_CCMR1_OC1CE << SHIFT_TAB_OCxx[iChannel]; + return ((READ_BIT(*pReg, bitfield) == bitfield) ? 1UL : 0UL); +} + +/** + * @brief Set the dead-time delay (delay inserted between the rising edge of the OCxREF signal and the rising edge of + * the Ocx and OCxN signals). + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * dead-time insertion feature is supported by a timer instance. + * @note Helper macro @ref __LL_TIM_CALC_DEADTIME can be used to calculate the DeadTime parameter + * @rmtoll BDTR DTG LL_TIM_OC_SetDeadTime + * @param TIMx Timer instance + * @param DeadTime between Min_Data=0 and Max_Data=255 + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetDeadTime(TIM_TypeDef *TIMx, uint32_t DeadTime) +{ + MODIFY_REG(TIMx->BDTR, TIM_BDTR_DTG, DeadTime); +} + +/** + * @brief Set compare value for output channel 1 (TIMx_CCR1). + * @note In 32-bit timer implementations compare value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not + * output channel 1 is supported by a timer instance. + * @rmtoll CCR1 CCR1 LL_TIM_OC_SetCompareCH1 + * @param TIMx Timer instance + * @param CompareValue between Min_Data=0 and Max_Data=65535 + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetCompareCH1(TIM_TypeDef *TIMx, uint32_t CompareValue) +{ + WRITE_REG(TIMx->CCR1, CompareValue); +} + +/** + * @brief Set compare value for output channel 2 (TIMx_CCR2). + * @note In 32-bit timer implementations compare value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not + * output channel 2 is supported by a timer instance. + * @rmtoll CCR2 CCR2 LL_TIM_OC_SetCompareCH2 + * @param TIMx Timer instance + * @param CompareValue between Min_Data=0 and Max_Data=65535 + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetCompareCH2(TIM_TypeDef *TIMx, uint32_t CompareValue) +{ + WRITE_REG(TIMx->CCR2, CompareValue); +} + +/** + * @brief Set compare value for output channel 3 (TIMx_CCR3). + * @note In 32-bit timer implementations compare value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not + * output channel is supported by a timer instance. + * @rmtoll CCR3 CCR3 LL_TIM_OC_SetCompareCH3 + * @param TIMx Timer instance + * @param CompareValue between Min_Data=0 and Max_Data=65535 + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetCompareCH3(TIM_TypeDef *TIMx, uint32_t CompareValue) +{ + WRITE_REG(TIMx->CCR3, CompareValue); +} + +/** + * @brief Set compare value for output channel 4 (TIMx_CCR4). + * @note In 32-bit timer implementations compare value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not + * output channel 4 is supported by a timer instance. + * @rmtoll CCR4 CCR4 LL_TIM_OC_SetCompareCH4 + * @param TIMx Timer instance + * @param CompareValue between Min_Data=0 and Max_Data=65535 + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetCompareCH4(TIM_TypeDef *TIMx, uint32_t CompareValue) +{ + WRITE_REG(TIMx->CCR4, CompareValue); +} + +#if defined(TIM_CCR5_CCR5) +/** + * @brief Set compare value for output channel 5 (TIMx_CCR5). + * @note Macro IS_TIM_CC5_INSTANCE(TIMx) can be used to check whether or not + * output channel 5 is supported by a timer instance. + * @if STM32F334x8 + * @rmtoll CCR5 CCR5 LL_TIM_OC_SetCompareCH5 + * @elseif STM32F303xC + * @rmtoll CCR5 CCR5 LL_TIM_OC_SetCompareCH5 + * @elseif STM32F302x8 + * @rmtoll CCR5 CCR5 LL_TIM_OC_SetCompareCH5 + * @endif + * @param TIMx Timer instance + * @param CompareValue between Min_Data=0 and Max_Data=65535 + * @note CH5 channel is not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetCompareCH5(TIM_TypeDef *TIMx, uint32_t CompareValue) +{ + MODIFY_REG(TIMx->CCR5, TIM_CCR5_CCR5, CompareValue); +} + +#endif /* TIM_CCR5_CCR5 */ +#if defined(TIM_CCR6_CCR6) +/** + * @brief Set compare value for output channel 6 (TIMx_CCR6). + * @note Macro IS_TIM_CC6_INSTANCE(TIMx) can be used to check whether or not + * output channel 6 is supported by a timer instance. + * @if STM32F344x8 + * @rmtoll CCR6 CCR6 LL_TIM_OC_SetCompareCH6 + * @elseif STM32F303xC + * CCR6 CCR6 LL_TIM_OC_SetCompareCH6 + * @elseif STM32F302x8 + * CCR6 CCR6 LL_TIM_OC_SetCompareCH6 + * @endif + * @param TIMx Timer instance + * @param CompareValue between Min_Data=0 and Max_Data=65535 + * @note CH6 channel is not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_OC_SetCompareCH6(TIM_TypeDef *TIMx, uint32_t CompareValue) +{ + WRITE_REG(TIMx->CCR6, CompareValue); +} + +#endif /* TIM_CCR6_CCR6 */ +/** + * @brief Get compare value (TIMx_CCR1) set for output channel 1. + * @note In 32-bit timer implementations returned compare value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not + * output channel 1 is supported by a timer instance. + * @rmtoll CCR1 CCR1 LL_TIM_OC_GetCompareCH1 + * @param TIMx Timer instance + * @retval CompareValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH1(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR1)); +} + +/** + * @brief Get compare value (TIMx_CCR2) set for output channel 2. + * @note In 32-bit timer implementations returned compare value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not + * output channel 2 is supported by a timer instance. + * @rmtoll CCR2 CCR2 LL_TIM_OC_GetCompareCH2 + * @param TIMx Timer instance + * @retval CompareValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH2(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR2)); +} + +/** + * @brief Get compare value (TIMx_CCR3) set for output channel 3. + * @note In 32-bit timer implementations returned compare value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not + * output channel 3 is supported by a timer instance. + * @rmtoll CCR3 CCR3 LL_TIM_OC_GetCompareCH3 + * @param TIMx Timer instance + * @retval CompareValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH3(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR3)); +} + +/** + * @brief Get compare value (TIMx_CCR4) set for output channel 4. + * @note In 32-bit timer implementations returned compare value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not + * output channel 4 is supported by a timer instance. + * @rmtoll CCR4 CCR4 LL_TIM_OC_GetCompareCH4 + * @param TIMx Timer instance + * @retval CompareValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH4(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR4)); +} + +#if defined(TIM_CCR5_CCR5) +/** + * @brief Get compare value (TIMx_CCR5) set for output channel 5. + * @note Macro IS_TIM_CC5_INSTANCE(TIMx) can be used to check whether or not + * output channel 5 is supported by a timer instance. + * @if STM32F334x8 + * @rmtoll CCR5 CCR5 LL_TIM_OC_GetCompareCH5 + * @elseif STM32F303xC + * CCR5 CCR5 LL_TIM_OC_GetCompareCH5 + * @elseif STM32F302x8 + * CCR5 CCR5 LL_TIM_OC_GetCompareCH5 + * @endif + * @param TIMx Timer instance + * @note CH5 channel is not available for all F3 devices + * @retval CompareValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH5(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_BIT(TIMx->CCR5, TIM_CCR5_CCR5)); +} + +#endif /* TIM_CCR5_CCR5 */ +#if defined(TIM_CCR6_CCR6) +/** + * @brief Get compare value (TIMx_CCR6) set for output channel 6. + * @note Macro IS_TIM_CC6_INSTANCE(TIMx) can be used to check whether or not + * output channel 6 is supported by a timer instance. + * @if STM32F334x8 + * @rmtoll CCR6 CCR6 LL_TIM_OC_GetCompareCH6 + * @elseif STM32F303xC + * CCR6 CCR6 LL_TIM_OC_GetCompareCH6 + * @elseif STM32F302x8 + * CCR6 CCR6 LL_TIM_OC_GetCompareCH6 + * @endif + * @param TIMx Timer instance + * @note CH6 channel is not available for all F3 devices + * @retval CompareValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_OC_GetCompareCH6(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR6)); +} + +#endif /* TIM_CCR6_CCR6 */ +#if defined(TIM_CCR5_CCR5) +/** + * @brief Select on which reference signal the OC5REF is combined to. + * @note Macro IS_TIM_COMBINED3PHASEPWM_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports the combined 3-phase PWM mode. + * @if STM32F334x8 + * @rmtoll CCR5 GC5C3 LL_TIM_SetCH5CombinedChannels\n + * CCR5 GC5C2 LL_TIM_SetCH5CombinedChannels\n + * CCR5 GC5C1 LL_TIM_SetCH5CombinedChannels + * @elseif STM32F303xC + * CCR5 GC5C3 LL_TIM_SetCH5CombinedChannels\n + * CCR5 GC5C2 LL_TIM_SetCH5CombinedChannels\n + * CCR5 GC5C1 LL_TIM_SetCH5CombinedChannels + * @elseif STM32F302x8 + * CCR5 GC5C3 LL_TIM_SetCH5CombinedChannels\n + * CCR5 GC5C2 LL_TIM_SetCH5CombinedChannels\n + * CCR5 GC5C1 LL_TIM_SetCH5CombinedChannels + * @endif + * @param TIMx Timer instance + * @param GroupCH5 This parameter can be a combination of the following values: + * @arg @ref LL_TIM_GROUPCH5_NONE + * @arg @ref LL_TIM_GROUPCH5_OC1REFC + * @arg @ref LL_TIM_GROUPCH5_OC2REFC + * @arg @ref LL_TIM_GROUPCH5_OC3REFC + * @note CH5 channel is not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetCH5CombinedChannels(TIM_TypeDef *TIMx, uint32_t GroupCH5) +{ + MODIFY_REG(TIMx->CCR5, (TIM_CCR5_GC5C3 | TIM_CCR5_GC5C2 | TIM_CCR5_GC5C1), GroupCH5); +} + +#endif /* TIM_CCR5_CCR5 */ +/** + * @} + */ + +/** @defgroup TIM_LL_EF_Input_Channel Input channel configuration + * @{ + */ +/** + * @brief Configure input channel. + * @rmtoll CCMR1 CC1S LL_TIM_IC_Config\n + * CCMR1 IC1PSC LL_TIM_IC_Config\n + * CCMR1 IC1F LL_TIM_IC_Config\n + * CCMR1 CC2S LL_TIM_IC_Config\n + * CCMR1 IC2PSC LL_TIM_IC_Config\n + * CCMR1 IC2F LL_TIM_IC_Config\n + * CCMR2 CC3S LL_TIM_IC_Config\n + * CCMR2 IC3PSC LL_TIM_IC_Config\n + * CCMR2 IC3F LL_TIM_IC_Config\n + * CCMR2 CC4S LL_TIM_IC_Config\n + * CCMR2 IC4PSC LL_TIM_IC_Config\n + * CCMR2 IC4F LL_TIM_IC_Config\n + * CCER CC1P LL_TIM_IC_Config\n + * CCER CC1NP LL_TIM_IC_Config\n + * CCER CC2P LL_TIM_IC_Config\n + * CCER CC2NP LL_TIM_IC_Config\n + * CCER CC3P LL_TIM_IC_Config\n + * CCER CC3NP LL_TIM_IC_Config\n + * CCER CC4P LL_TIM_IC_Config\n + * CCER CC4NP LL_TIM_IC_Config + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @param Configuration This parameter must be a combination of all the following values: + * @arg @ref LL_TIM_ACTIVEINPUT_DIRECTTI or @ref LL_TIM_ACTIVEINPUT_INDIRECTTI or @ref LL_TIM_ACTIVEINPUT_TRC + * @arg @ref LL_TIM_ICPSC_DIV1 or ... or @ref LL_TIM_ICPSC_DIV8 + * @arg @ref LL_TIM_IC_FILTER_FDIV1 or ... or @ref LL_TIM_IC_FILTER_FDIV32_N8 + * @arg @ref LL_TIM_IC_POLARITY_RISING or @ref LL_TIM_IC_POLARITY_FALLING or @ref LL_TIM_IC_POLARITY_BOTHEDGE + * @retval None + */ +__STATIC_INLINE void LL_TIM_IC_Config(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t Configuration) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + MODIFY_REG(*pReg, ((TIM_CCMR1_IC1F | TIM_CCMR1_IC1PSC | TIM_CCMR1_CC1S) << SHIFT_TAB_ICxx[iChannel]), + ((Configuration >> 16U) & (TIM_CCMR1_IC1F | TIM_CCMR1_IC1PSC | TIM_CCMR1_CC1S)) \ + << SHIFT_TAB_ICxx[iChannel]); + MODIFY_REG(TIMx->CCER, ((TIM_CCER_CC1NP | TIM_CCER_CC1P) << SHIFT_TAB_CCxP[iChannel]), + (Configuration & (TIM_CCER_CC1NP | TIM_CCER_CC1P)) << SHIFT_TAB_CCxP[iChannel]); +} + +/** + * @brief Set the active input. + * @rmtoll CCMR1 CC1S LL_TIM_IC_SetActiveInput\n + * CCMR1 CC2S LL_TIM_IC_SetActiveInput\n + * CCMR2 CC3S LL_TIM_IC_SetActiveInput\n + * CCMR2 CC4S LL_TIM_IC_SetActiveInput + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @param ICActiveInput This parameter can be one of the following values: + * @arg @ref LL_TIM_ACTIVEINPUT_DIRECTTI + * @arg @ref LL_TIM_ACTIVEINPUT_INDIRECTTI + * @arg @ref LL_TIM_ACTIVEINPUT_TRC + * @retval None + */ +__STATIC_INLINE void LL_TIM_IC_SetActiveInput(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ICActiveInput) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + MODIFY_REG(*pReg, ((TIM_CCMR1_CC1S) << SHIFT_TAB_ICxx[iChannel]), (ICActiveInput >> 16U) << SHIFT_TAB_ICxx[iChannel]); +} + +/** + * @brief Get the current active input. + * @rmtoll CCMR1 CC1S LL_TIM_IC_GetActiveInput\n + * CCMR1 CC2S LL_TIM_IC_GetActiveInput\n + * CCMR2 CC3S LL_TIM_IC_GetActiveInput\n + * CCMR2 CC4S LL_TIM_IC_GetActiveInput + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_ACTIVEINPUT_DIRECTTI + * @arg @ref LL_TIM_ACTIVEINPUT_INDIRECTTI + * @arg @ref LL_TIM_ACTIVEINPUT_TRC + */ +__STATIC_INLINE uint32_t LL_TIM_IC_GetActiveInput(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + return ((READ_BIT(*pReg, ((TIM_CCMR1_CC1S) << SHIFT_TAB_ICxx[iChannel])) >> SHIFT_TAB_ICxx[iChannel]) << 16U); +} + +/** + * @brief Set the prescaler of input channel. + * @rmtoll CCMR1 IC1PSC LL_TIM_IC_SetPrescaler\n + * CCMR1 IC2PSC LL_TIM_IC_SetPrescaler\n + * CCMR2 IC3PSC LL_TIM_IC_SetPrescaler\n + * CCMR2 IC4PSC LL_TIM_IC_SetPrescaler + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @param ICPrescaler This parameter can be one of the following values: + * @arg @ref LL_TIM_ICPSC_DIV1 + * @arg @ref LL_TIM_ICPSC_DIV2 + * @arg @ref LL_TIM_ICPSC_DIV4 + * @arg @ref LL_TIM_ICPSC_DIV8 + * @retval None + */ +__STATIC_INLINE void LL_TIM_IC_SetPrescaler(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ICPrescaler) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + MODIFY_REG(*pReg, ((TIM_CCMR1_IC1PSC) << SHIFT_TAB_ICxx[iChannel]), (ICPrescaler >> 16U) << SHIFT_TAB_ICxx[iChannel]); +} + +/** + * @brief Get the current prescaler value acting on an input channel. + * @rmtoll CCMR1 IC1PSC LL_TIM_IC_GetPrescaler\n + * CCMR1 IC2PSC LL_TIM_IC_GetPrescaler\n + * CCMR2 IC3PSC LL_TIM_IC_GetPrescaler\n + * CCMR2 IC4PSC LL_TIM_IC_GetPrescaler + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_ICPSC_DIV1 + * @arg @ref LL_TIM_ICPSC_DIV2 + * @arg @ref LL_TIM_ICPSC_DIV4 + * @arg @ref LL_TIM_ICPSC_DIV8 + */ +__STATIC_INLINE uint32_t LL_TIM_IC_GetPrescaler(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + return ((READ_BIT(*pReg, ((TIM_CCMR1_IC1PSC) << SHIFT_TAB_ICxx[iChannel])) >> SHIFT_TAB_ICxx[iChannel]) << 16U); +} + +/** + * @brief Set the input filter duration. + * @rmtoll CCMR1 IC1F LL_TIM_IC_SetFilter\n + * CCMR1 IC2F LL_TIM_IC_SetFilter\n + * CCMR2 IC3F LL_TIM_IC_SetFilter\n + * CCMR2 IC4F LL_TIM_IC_SetFilter + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @param ICFilter This parameter can be one of the following values: + * @arg @ref LL_TIM_IC_FILTER_FDIV1 + * @arg @ref LL_TIM_IC_FILTER_FDIV1_N2 + * @arg @ref LL_TIM_IC_FILTER_FDIV1_N4 + * @arg @ref LL_TIM_IC_FILTER_FDIV1_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV2_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV2_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV4_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV4_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV8_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV8_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV16_N5 + * @arg @ref LL_TIM_IC_FILTER_FDIV16_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV16_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV32_N5 + * @arg @ref LL_TIM_IC_FILTER_FDIV32_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV32_N8 + * @retval None + */ +__STATIC_INLINE void LL_TIM_IC_SetFilter(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ICFilter) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + MODIFY_REG(*pReg, ((TIM_CCMR1_IC1F) << SHIFT_TAB_ICxx[iChannel]), (ICFilter >> 16U) << SHIFT_TAB_ICxx[iChannel]); +} + +/** + * @brief Get the input filter duration. + * @rmtoll CCMR1 IC1F LL_TIM_IC_GetFilter\n + * CCMR1 IC2F LL_TIM_IC_GetFilter\n + * CCMR2 IC3F LL_TIM_IC_GetFilter\n + * CCMR2 IC4F LL_TIM_IC_GetFilter + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_IC_FILTER_FDIV1 + * @arg @ref LL_TIM_IC_FILTER_FDIV1_N2 + * @arg @ref LL_TIM_IC_FILTER_FDIV1_N4 + * @arg @ref LL_TIM_IC_FILTER_FDIV1_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV2_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV2_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV4_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV4_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV8_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV8_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV16_N5 + * @arg @ref LL_TIM_IC_FILTER_FDIV16_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV16_N8 + * @arg @ref LL_TIM_IC_FILTER_FDIV32_N5 + * @arg @ref LL_TIM_IC_FILTER_FDIV32_N6 + * @arg @ref LL_TIM_IC_FILTER_FDIV32_N8 + */ +__STATIC_INLINE uint32_t LL_TIM_IC_GetFilter(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + const __IO uint32_t *pReg = (__IO uint32_t *)((uint32_t)((uint32_t)(&TIMx->CCMR1) + OFFSET_TAB_CCMRx[iChannel])); + return ((READ_BIT(*pReg, ((TIM_CCMR1_IC1F) << SHIFT_TAB_ICxx[iChannel])) >> SHIFT_TAB_ICxx[iChannel]) << 16U); +} + +/** + * @brief Set the input channel polarity. + * @rmtoll CCER CC1P LL_TIM_IC_SetPolarity\n + * CCER CC1NP LL_TIM_IC_SetPolarity\n + * CCER CC2P LL_TIM_IC_SetPolarity\n + * CCER CC2NP LL_TIM_IC_SetPolarity\n + * CCER CC3P LL_TIM_IC_SetPolarity\n + * CCER CC3NP LL_TIM_IC_SetPolarity\n + * CCER CC4P LL_TIM_IC_SetPolarity\n + * CCER CC4NP LL_TIM_IC_SetPolarity + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @param ICPolarity This parameter can be one of the following values: + * @arg @ref LL_TIM_IC_POLARITY_RISING + * @arg @ref LL_TIM_IC_POLARITY_FALLING + * @arg @ref LL_TIM_IC_POLARITY_BOTHEDGE + * @retval None + */ +__STATIC_INLINE void LL_TIM_IC_SetPolarity(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ICPolarity) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + MODIFY_REG(TIMx->CCER, ((TIM_CCER_CC1NP | TIM_CCER_CC1P) << SHIFT_TAB_CCxP[iChannel]), + ICPolarity << SHIFT_TAB_CCxP[iChannel]); +} + +/** + * @brief Get the current input channel polarity. + * @rmtoll CCER CC1P LL_TIM_IC_GetPolarity\n + * CCER CC1NP LL_TIM_IC_GetPolarity\n + * CCER CC2P LL_TIM_IC_GetPolarity\n + * CCER CC2NP LL_TIM_IC_GetPolarity\n + * CCER CC3P LL_TIM_IC_GetPolarity\n + * CCER CC3NP LL_TIM_IC_GetPolarity\n + * CCER CC4P LL_TIM_IC_GetPolarity\n + * CCER CC4NP LL_TIM_IC_GetPolarity + * @param TIMx Timer instance + * @param Channel This parameter can be one of the following values: + * @arg @ref LL_TIM_CHANNEL_CH1 + * @arg @ref LL_TIM_CHANNEL_CH2 + * @arg @ref LL_TIM_CHANNEL_CH3 + * @arg @ref LL_TIM_CHANNEL_CH4 + * @retval Returned value can be one of the following values: + * @arg @ref LL_TIM_IC_POLARITY_RISING + * @arg @ref LL_TIM_IC_POLARITY_FALLING + * @arg @ref LL_TIM_IC_POLARITY_BOTHEDGE + */ +__STATIC_INLINE uint32_t LL_TIM_IC_GetPolarity(const TIM_TypeDef *TIMx, uint32_t Channel) +{ + uint8_t iChannel = TIM_GET_CHANNEL_INDEX(Channel); + return (READ_BIT(TIMx->CCER, ((TIM_CCER_CC1NP | TIM_CCER_CC1P) << SHIFT_TAB_CCxP[iChannel])) >> + SHIFT_TAB_CCxP[iChannel]); +} + +/** + * @brief Connect the TIMx_CH1, CH2 and CH3 pins to the TI1 input (XOR combination). + * @note Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides an XOR input. + * @rmtoll CR2 TI1S LL_TIM_IC_EnableXORCombination + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_IC_EnableXORCombination(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->CR2, TIM_CR2_TI1S); +} + +/** + * @brief Disconnect the TIMx_CH1, CH2 and CH3 pins from the TI1 input. + * @note Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides an XOR input. + * @rmtoll CR2 TI1S LL_TIM_IC_DisableXORCombination + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_IC_DisableXORCombination(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->CR2, TIM_CR2_TI1S); +} + +/** + * @brief Indicates whether the TIMx_CH1, CH2 and CH3 pins are connectected to the TI1 input. + * @note Macro IS_TIM_XOR_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides an XOR input. + * @rmtoll CR2 TI1S LL_TIM_IC_IsEnabledXORCombination + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IC_IsEnabledXORCombination(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->CR2, TIM_CR2_TI1S) == (TIM_CR2_TI1S)) ? 1UL : 0UL); +} + +/** + * @brief Get captured value for input channel 1. + * @note In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC1_INSTANCE(TIMx) can be used to check whether or not + * input channel 1 is supported by a timer instance. + * @rmtoll CCR1 CCR1 LL_TIM_IC_GetCaptureCH1 + * @param TIMx Timer instance + * @retval CapturedValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH1(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR1)); +} + +/** + * @brief Get captured value for input channel 2. + * @note In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC2_INSTANCE(TIMx) can be used to check whether or not + * input channel 2 is supported by a timer instance. + * @rmtoll CCR2 CCR2 LL_TIM_IC_GetCaptureCH2 + * @param TIMx Timer instance + * @retval CapturedValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH2(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR2)); +} + +/** + * @brief Get captured value for input channel 3. + * @note In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC3_INSTANCE(TIMx) can be used to check whether or not + * input channel 3 is supported by a timer instance. + * @rmtoll CCR3 CCR3 LL_TIM_IC_GetCaptureCH3 + * @param TIMx Timer instance + * @retval CapturedValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH3(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR3)); +} + +/** + * @brief Get captured value for input channel 4. + * @note In 32-bit timer implementations returned captured value can be between 0x00000000 and 0xFFFFFFFF. + * @note Macro IS_TIM_32B_COUNTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports a 32 bits counter. + * @note Macro IS_TIM_CC4_INSTANCE(TIMx) can be used to check whether or not + * input channel 4 is supported by a timer instance. + * @rmtoll CCR4 CCR4 LL_TIM_IC_GetCaptureCH4 + * @param TIMx Timer instance + * @retval CapturedValue (between Min_Data=0 and Max_Data=65535) + */ +__STATIC_INLINE uint32_t LL_TIM_IC_GetCaptureCH4(const TIM_TypeDef *TIMx) +{ + return (uint32_t)(READ_REG(TIMx->CCR4)); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_Clock_Selection Counter clock selection + * @{ + */ +/** + * @brief Enable external clock mode 2. + * @note When external clock mode 2 is enabled the counter is clocked by any active edge on the ETRF signal. + * @note Macro IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports external clock mode2. + * @rmtoll SMCR ECE LL_TIM_EnableExternalClock + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableExternalClock(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->SMCR, TIM_SMCR_ECE); +} + +/** + * @brief Disable external clock mode 2. + * @note Macro IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports external clock mode2. + * @rmtoll SMCR ECE LL_TIM_DisableExternalClock + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableExternalClock(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->SMCR, TIM_SMCR_ECE); +} + +/** + * @brief Indicate whether external clock mode 2 is enabled. + * @note Macro IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports external clock mode2. + * @rmtoll SMCR ECE LL_TIM_IsEnabledExternalClock + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledExternalClock(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SMCR, TIM_SMCR_ECE) == (TIM_SMCR_ECE)) ? 1UL : 0UL); +} + +/** + * @brief Set the clock source of the counter clock. + * @note when selected clock source is external clock mode 1, the timer input + * the external clock is applied is selected by calling the @ref LL_TIM_SetTriggerInput() + * function. This timer input must be configured by calling + * the @ref LL_TIM_IC_Config() function. + * @note Macro IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports external clock mode1. + * @note Macro IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports external clock mode2. + * @rmtoll SMCR SMS LL_TIM_SetClockSource\n + * SMCR ECE LL_TIM_SetClockSource + * @param TIMx Timer instance + * @param ClockSource This parameter can be one of the following values: + * @arg @ref LL_TIM_CLOCKSOURCE_INTERNAL + * @arg @ref LL_TIM_CLOCKSOURCE_EXT_MODE1 + * @arg @ref LL_TIM_CLOCKSOURCE_EXT_MODE2 + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetClockSource(TIM_TypeDef *TIMx, uint32_t ClockSource) +{ + MODIFY_REG(TIMx->SMCR, TIM_SMCR_SMS | TIM_SMCR_ECE, ClockSource); +} + +/** + * @brief Set the encoder interface mode. + * @note Macro IS_TIM_ENCODER_INTERFACE_INSTANCE(TIMx) can be used to check + * whether or not a timer instance supports the encoder mode. + * @rmtoll SMCR SMS LL_TIM_SetEncoderMode + * @param TIMx Timer instance + * @param EncoderMode This parameter can be one of the following values: + * @arg @ref LL_TIM_ENCODERMODE_X2_TI1 + * @arg @ref LL_TIM_ENCODERMODE_X2_TI2 + * @arg @ref LL_TIM_ENCODERMODE_X4_TI12 + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetEncoderMode(TIM_TypeDef *TIMx, uint32_t EncoderMode) +{ + MODIFY_REG(TIMx->SMCR, TIM_SMCR_SMS, EncoderMode); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_Timer_Synchronization Timer synchronisation configuration + * @{ + */ +/** + * @brief Set the trigger output (TRGO) used for timer synchronization . + * @note Macro IS_TIM_MASTER_INSTANCE(TIMx) can be used to check + * whether or not a timer instance can operate as a master timer. + * @rmtoll CR2 MMS LL_TIM_SetTriggerOutput + * @param TIMx Timer instance + * @param TimerSynchronization This parameter can be one of the following values: + * @arg @ref LL_TIM_TRGO_RESET + * @arg @ref LL_TIM_TRGO_ENABLE + * @arg @ref LL_TIM_TRGO_UPDATE + * @arg @ref LL_TIM_TRGO_CC1IF + * @arg @ref LL_TIM_TRGO_OC1REF + * @arg @ref LL_TIM_TRGO_OC2REF + * @arg @ref LL_TIM_TRGO_OC3REF + * @arg @ref LL_TIM_TRGO_OC4REF + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetTriggerOutput(TIM_TypeDef *TIMx, uint32_t TimerSynchronization) +{ + MODIFY_REG(TIMx->CR2, TIM_CR2_MMS, TimerSynchronization); +} + +#if defined(TIM_CR2_MMS2) +/** + * @brief Set the trigger output 2 (TRGO2) used for ADC synchronization . + * @note Macro IS_TIM_TRGO2_INSTANCE(TIMx) can be used to check + * whether or not a timer instance can be used for ADC synchronization. + * @rmtoll CR2 MMS2 LL_TIM_SetTriggerOutput2 + * @param TIMx Timer Instance + * @param ADCSynchronization This parameter can be one of the following values: + * @arg @ref LL_TIM_TRGO2_RESET + * @arg @ref LL_TIM_TRGO2_ENABLE + * @arg @ref LL_TIM_TRGO2_UPDATE + * @arg @ref LL_TIM_TRGO2_CC1F + * @arg @ref LL_TIM_TRGO2_OC1 + * @arg @ref LL_TIM_TRGO2_OC2 + * @arg @ref LL_TIM_TRGO2_OC3 + * @arg @ref LL_TIM_TRGO2_OC4 + * @arg @ref LL_TIM_TRGO2_OC5 + * @arg @ref LL_TIM_TRGO2_OC6 + * @arg @ref LL_TIM_TRGO2_OC4_RISINGFALLING + * @arg @ref LL_TIM_TRGO2_OC6_RISINGFALLING + * @arg @ref LL_TIM_TRGO2_OC4_RISING_OC6_RISING + * @arg @ref LL_TIM_TRGO2_OC4_RISING_OC6_FALLING + * @arg @ref LL_TIM_TRGO2_OC5_RISING_OC6_RISING + * @arg @ref LL_TIM_TRGO2_OC5_RISING_OC6_FALLING + * @note OC5 and OC6 are not available for all F3 devices + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetTriggerOutput2(TIM_TypeDef *TIMx, uint32_t ADCSynchronization) +{ + MODIFY_REG(TIMx->CR2, TIM_CR2_MMS2, ADCSynchronization); +} + +#endif /* TIM_CR2_MMS2 */ +/** + * @brief Set the synchronization mode of a slave timer. + * @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not + * a timer instance can operate as a slave timer. + * @rmtoll SMCR SMS LL_TIM_SetSlaveMode + * @param TIMx Timer instance + * @param SlaveMode This parameter can be one of the following values: + * @arg @ref LL_TIM_SLAVEMODE_DISABLED + * @arg @ref LL_TIM_SLAVEMODE_RESET + * @arg @ref LL_TIM_SLAVEMODE_GATED + * @arg @ref LL_TIM_SLAVEMODE_TRIGGER + * @arg @ref LL_TIM_SLAVEMODE_COMBINED_RESETTRIGGER + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetSlaveMode(TIM_TypeDef *TIMx, uint32_t SlaveMode) +{ + MODIFY_REG(TIMx->SMCR, TIM_SMCR_SMS, SlaveMode); +} + +/** + * @brief Set the selects the trigger input to be used to synchronize the counter. + * @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not + * a timer instance can operate as a slave timer. + * @rmtoll SMCR TS LL_TIM_SetTriggerInput + * @param TIMx Timer instance + * @param TriggerInput This parameter can be one of the following values: + * @arg @ref LL_TIM_TS_ITR0 + * @arg @ref LL_TIM_TS_ITR1 + * @arg @ref LL_TIM_TS_ITR2 + * @arg @ref LL_TIM_TS_ITR3 + * @arg @ref LL_TIM_TS_TI1F_ED + * @arg @ref LL_TIM_TS_TI1FP1 + * @arg @ref LL_TIM_TS_TI2FP2 + * @arg @ref LL_TIM_TS_ETRF + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetTriggerInput(TIM_TypeDef *TIMx, uint32_t TriggerInput) +{ + MODIFY_REG(TIMx->SMCR, TIM_SMCR_TS, TriggerInput); +} + +/** + * @brief Enable the Master/Slave mode. + * @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not + * a timer instance can operate as a slave timer. + * @rmtoll SMCR MSM LL_TIM_EnableMasterSlaveMode + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableMasterSlaveMode(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->SMCR, TIM_SMCR_MSM); +} + +/** + * @brief Disable the Master/Slave mode. + * @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not + * a timer instance can operate as a slave timer. + * @rmtoll SMCR MSM LL_TIM_DisableMasterSlaveMode + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableMasterSlaveMode(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->SMCR, TIM_SMCR_MSM); +} + +/** + * @brief Indicates whether the Master/Slave mode is enabled. + * @note Macro IS_TIM_SLAVE_INSTANCE(TIMx) can be used to check whether or not + * a timer instance can operate as a slave timer. + * @rmtoll SMCR MSM LL_TIM_IsEnabledMasterSlaveMode + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledMasterSlaveMode(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SMCR, TIM_SMCR_MSM) == (TIM_SMCR_MSM)) ? 1UL : 0UL); +} + +/** + * @brief Configure the external trigger (ETR) input. + * @note Macro IS_TIM_ETR_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides an external trigger input. + * @rmtoll SMCR ETP LL_TIM_ConfigETR\n + * SMCR ETPS LL_TIM_ConfigETR\n + * SMCR ETF LL_TIM_ConfigETR + * @param TIMx Timer instance + * @param ETRPolarity This parameter can be one of the following values: + * @arg @ref LL_TIM_ETR_POLARITY_NONINVERTED + * @arg @ref LL_TIM_ETR_POLARITY_INVERTED + * @param ETRPrescaler This parameter can be one of the following values: + * @arg @ref LL_TIM_ETR_PRESCALER_DIV1 + * @arg @ref LL_TIM_ETR_PRESCALER_DIV2 + * @arg @ref LL_TIM_ETR_PRESCALER_DIV4 + * @arg @ref LL_TIM_ETR_PRESCALER_DIV8 + * @param ETRFilter This parameter can be one of the following values: + * @arg @ref LL_TIM_ETR_FILTER_FDIV1 + * @arg @ref LL_TIM_ETR_FILTER_FDIV1_N2 + * @arg @ref LL_TIM_ETR_FILTER_FDIV1_N4 + * @arg @ref LL_TIM_ETR_FILTER_FDIV1_N8 + * @arg @ref LL_TIM_ETR_FILTER_FDIV2_N6 + * @arg @ref LL_TIM_ETR_FILTER_FDIV2_N8 + * @arg @ref LL_TIM_ETR_FILTER_FDIV4_N6 + * @arg @ref LL_TIM_ETR_FILTER_FDIV4_N8 + * @arg @ref LL_TIM_ETR_FILTER_FDIV8_N6 + * @arg @ref LL_TIM_ETR_FILTER_FDIV8_N8 + * @arg @ref LL_TIM_ETR_FILTER_FDIV16_N5 + * @arg @ref LL_TIM_ETR_FILTER_FDIV16_N6 + * @arg @ref LL_TIM_ETR_FILTER_FDIV16_N8 + * @arg @ref LL_TIM_ETR_FILTER_FDIV32_N5 + * @arg @ref LL_TIM_ETR_FILTER_FDIV32_N6 + * @arg @ref LL_TIM_ETR_FILTER_FDIV32_N8 + * @retval None + */ +__STATIC_INLINE void LL_TIM_ConfigETR(TIM_TypeDef *TIMx, uint32_t ETRPolarity, uint32_t ETRPrescaler, + uint32_t ETRFilter) +{ + MODIFY_REG(TIMx->SMCR, TIM_SMCR_ETP | TIM_SMCR_ETPS | TIM_SMCR_ETF, ETRPolarity | ETRPrescaler | ETRFilter); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_Break_Function Break function configuration + * @{ + */ +/** + * @brief Enable the break function. + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR BKE LL_TIM_EnableBRK + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableBRK(TIM_TypeDef *TIMx) +{ +#if defined(TIM_IP_V2_1) + __IO uint32_t tmpreg; +#endif /* TIM_IP_V2_1 */ + SET_BIT(TIMx->BDTR, TIM_BDTR_BKE); +#if defined(TIM_IP_V2_1) + /* Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective. */ + tmpreg = READ_REG(TIMx->BDTR); + (void)(tmpreg); +#endif /* TIM_IP_V2_1 */ +} + +/** + * @brief Disable the break function. + * @rmtoll BDTR BKE LL_TIM_DisableBRK + * @param TIMx Timer instance + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableBRK(TIM_TypeDef *TIMx) +{ +#if defined(TIM_IP_V2_1) + __IO uint32_t tmpreg; +#endif /* TIM_IP_V2_1 */ + CLEAR_BIT(TIMx->BDTR, TIM_BDTR_BKE); +#if defined(TIM_IP_V2_1) + /* Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective. */ + tmpreg = READ_REG(TIMx->BDTR); + (void)(tmpreg); +#endif /* TIM_IP_V2_1 */ +} + +#if defined(TIM_BDTR_BKF) +/** + * @brief Configure the break input. + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR BKP LL_TIM_ConfigBRK\n + * BDTR BKF LL_TIM_ConfigBRK + * @param TIMx Timer instance + * @param BreakPolarity This parameter can be one of the following values: + * @arg @ref LL_TIM_BREAK_POLARITY_LOW + * @arg @ref LL_TIM_BREAK_POLARITY_HIGH + * @param BreakFilter This parameter can be one of the following values: + * @arg @ref LL_TIM_BREAK_FILTER_FDIV1 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV1_N2 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV1_N4 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV1_N8 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV2_N6 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV2_N8 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV4_N6 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV4_N8 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV8_N6 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV8_N8 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV16_N5 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV16_N6 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV16_N8 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV32_N5 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV32_N6 + * @arg @ref LL_TIM_BREAK_FILTER_FDIV32_N8 + * @retval None + */ +__STATIC_INLINE void LL_TIM_ConfigBRK(TIM_TypeDef *TIMx, uint32_t BreakPolarity, + uint32_t BreakFilter) +{ +#if defined(TIM_IP_V2_1) + __IO uint32_t tmpreg; +#endif /* TIM_IP_V2_1 */ + MODIFY_REG(TIMx->BDTR, TIM_BDTR_BKP | TIM_BDTR_BKF, BreakPolarity | BreakFilter); +#if defined(TIM_IP_V2_1) + /* Note: Any write operation to BKP bit takes a delay of 1 APB clock cycle to become effective. */ + tmpreg = READ_REG(TIMx->BDTR); + (void)(tmpreg); +#endif /* TIM_IP_V2_1 */ +} + +#else +/** + * @brief Configure the break input. + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR BKP LL_TIM_ConfigBRK + * @param TIMx Timer instance + * @param BreakPolarity This parameter can be one of the following values: + * @arg @ref LL_TIM_BREAK_POLARITY_LOW + * @arg @ref LL_TIM_BREAK_POLARITY_HIGH + * @retval None + */ +__STATIC_INLINE void LL_TIM_ConfigBRK(TIM_TypeDef *TIMx, uint32_t BreakPolarity) +{ +#if defined(TIM_IP_V2_1) + __IO uint32_t tmpreg; +#endif /* TIM_IP_V2_1 */ + MODIFY_REG(TIMx->BDTR, TIM_BDTR_BKP, BreakPolarity); +#if defined(TIM_IP_V2_1) + /* Note: Any write operation to BKP bit takes a delay of 1 APB clock cycle to become effective. */ + tmpreg = READ_REG(TIMx->BDTR); + (void)(tmpreg); +#endif /* TIM_IP_V2_1 */ +} + +#endif /* TIM_BDTR_BKF */ +#if defined(TIM_BDTR_BK2E) +/** + * @brief Enable the break 2 function. + * @note Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a second break input. + * @rmtoll BDTR BK2E LL_TIM_EnableBRK2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableBRK2(TIM_TypeDef *TIMx) +{ +#if defined(TIM_IP_V2_1) + __IO uint32_t tmpreg; +#endif /* TIM_IP_V2_1 */ + SET_BIT(TIMx->BDTR, TIM_BDTR_BK2E); +#if defined(TIM_IP_V2_1) + /* Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective. */ + tmpreg = READ_REG(TIMx->BDTR); + (void)(tmpreg); +#endif /* TIM_IP_V2_1 */ +} + +/** + * @brief Disable the break 2 function. + * @note Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a second break input. + * @rmtoll BDTR BK2E LL_TIM_DisableBRK2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableBRK2(TIM_TypeDef *TIMx) +{ +#if defined(TIM_IP_V2_1) + __IO uint32_t tmpreg; +#endif /* TIM_IP_V2_1 */ + CLEAR_BIT(TIMx->BDTR, TIM_BDTR_BK2E); +#if defined(TIM_IP_V2_1) + /* Note: Any write operation to this bit takes a delay of 1 APB clock cycle to become effective. */ + tmpreg = READ_REG(TIMx->BDTR); + (void)(tmpreg); +#endif /* TIM_IP_V2_1 */ +} + +/** + * @brief Configure the break 2 input. + * @note Macro IS_TIM_BKIN2_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a second break input. + * @rmtoll BDTR BK2P LL_TIM_ConfigBRK2\n + * BDTR BK2F LL_TIM_ConfigBRK2 + * @param TIMx Timer instance + * @param Break2Polarity This parameter can be one of the following values: + * @arg @ref LL_TIM_BREAK2_POLARITY_LOW + * @arg @ref LL_TIM_BREAK2_POLARITY_HIGH + * @param Break2Filter This parameter can be one of the following values: + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV1 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV1_N2 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV1_N4 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV1_N8 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV2_N6 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV2_N8 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV4_N6 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV4_N8 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV8_N6 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV8_N8 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV16_N5 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV16_N6 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV16_N8 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV32_N5 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV32_N6 + * @arg @ref LL_TIM_BREAK2_FILTER_FDIV32_N8 + * @retval None + */ +__STATIC_INLINE void LL_TIM_ConfigBRK2(TIM_TypeDef *TIMx, uint32_t Break2Polarity, uint32_t Break2Filter) +{ + MODIFY_REG(TIMx->BDTR, TIM_BDTR_BK2P | TIM_BDTR_BK2F, Break2Polarity | Break2Filter); +} + +#endif /* TIM_BDTR_BK2E */ +/** + * @brief Select the outputs off state (enabled v.s. disabled) in Idle and Run modes. + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR OSSI LL_TIM_SetOffStates\n + * BDTR OSSR LL_TIM_SetOffStates + * @param TIMx Timer instance + * @param OffStateIdle This parameter can be one of the following values: + * @arg @ref LL_TIM_OSSI_DISABLE + * @arg @ref LL_TIM_OSSI_ENABLE + * @param OffStateRun This parameter can be one of the following values: + * @arg @ref LL_TIM_OSSR_DISABLE + * @arg @ref LL_TIM_OSSR_ENABLE + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetOffStates(TIM_TypeDef *TIMx, uint32_t OffStateIdle, uint32_t OffStateRun) +{ + MODIFY_REG(TIMx->BDTR, TIM_BDTR_OSSI | TIM_BDTR_OSSR, OffStateIdle | OffStateRun); +} + +/** + * @brief Enable automatic output (MOE can be set by software or automatically when a break input is active). + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR AOE LL_TIM_EnableAutomaticOutput + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableAutomaticOutput(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->BDTR, TIM_BDTR_AOE); +} + +/** + * @brief Disable automatic output (MOE can be set only by software). + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR AOE LL_TIM_DisableAutomaticOutput + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableAutomaticOutput(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->BDTR, TIM_BDTR_AOE); +} + +/** + * @brief Indicate whether automatic output is enabled. + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR AOE LL_TIM_IsEnabledAutomaticOutput + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledAutomaticOutput(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->BDTR, TIM_BDTR_AOE) == (TIM_BDTR_AOE)) ? 1UL : 0UL); +} + +/** + * @brief Enable the outputs (set the MOE bit in TIMx_BDTR register). + * @note The MOE bit in TIMx_BDTR register allows to enable /disable the outputs by + * software and is reset in case of break or break2 event + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR MOE LL_TIM_EnableAllOutputs + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableAllOutputs(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->BDTR, TIM_BDTR_MOE); +} + +/** + * @brief Disable the outputs (reset the MOE bit in TIMx_BDTR register). + * @note The MOE bit in TIMx_BDTR register allows to enable /disable the outputs by + * software and is reset in case of break or break2 event. + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR MOE LL_TIM_DisableAllOutputs + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableAllOutputs(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->BDTR, TIM_BDTR_MOE); +} + +/** + * @brief Indicates whether outputs are enabled. + * @note Macro IS_TIM_BREAK_INSTANCE(TIMx) can be used to check whether or not + * a timer instance provides a break input. + * @rmtoll BDTR MOE LL_TIM_IsEnabledAllOutputs + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledAllOutputs(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->BDTR, TIM_BDTR_MOE) == (TIM_BDTR_MOE)) ? 1UL : 0UL); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_DMA_Burst_Mode DMA burst mode configuration + * @{ + */ +/** + * @brief Configures the timer DMA burst feature. + * @note Macro IS_TIM_DMABURST_INSTANCE(TIMx) can be used to check whether or + * not a timer instance supports the DMA burst mode. + * @rmtoll DCR DBL LL_TIM_ConfigDMABurst\n + * DCR DBA LL_TIM_ConfigDMABurst + * @param TIMx Timer instance + * @param DMABurstBaseAddress This parameter can be one of the following values: + * @arg @ref LL_TIM_DMABURST_BASEADDR_CR1 + * @arg @ref LL_TIM_DMABURST_BASEADDR_CR2 + * @arg @ref LL_TIM_DMABURST_BASEADDR_SMCR + * @arg @ref LL_TIM_DMABURST_BASEADDR_DIER + * @arg @ref LL_TIM_DMABURST_BASEADDR_SR + * @arg @ref LL_TIM_DMABURST_BASEADDR_EGR + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCMR1 + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCMR2 + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCER + * @arg @ref LL_TIM_DMABURST_BASEADDR_CNT + * @arg @ref LL_TIM_DMABURST_BASEADDR_PSC + * @arg @ref LL_TIM_DMABURST_BASEADDR_ARR + * @arg @ref LL_TIM_DMABURST_BASEADDR_RCR + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCR1 + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCR2 + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCR3 + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCR4 + * @arg @ref LL_TIM_DMABURST_BASEADDR_BDTR + * @arg @ref LL_TIM_DMABURST_BASEADDR_OR + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCMR3 (*) + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCR5 (*) + * @arg @ref LL_TIM_DMABURST_BASEADDR_CCR6 (*) + * (*) value not defined in all devices + * @param DMABurstLength This parameter can be one of the following values: + * @arg @ref LL_TIM_DMABURST_LENGTH_1TRANSFER + * @arg @ref LL_TIM_DMABURST_LENGTH_2TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_3TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_4TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_5TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_6TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_7TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_8TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_9TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_10TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_11TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_12TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_13TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_14TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_15TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_16TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_17TRANSFERS + * @arg @ref LL_TIM_DMABURST_LENGTH_18TRANSFERS + * @retval None + */ +__STATIC_INLINE void LL_TIM_ConfigDMABurst(TIM_TypeDef *TIMx, uint32_t DMABurstBaseAddress, uint32_t DMABurstLength) +{ + MODIFY_REG(TIMx->DCR, (TIM_DCR_DBL | TIM_DCR_DBA), (DMABurstBaseAddress | DMABurstLength)); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_Timer_Inputs_Remapping Timer input remapping + * @{ + */ +/** + * @brief Remap TIM inputs (input channel, internal/external triggers). + * @note Macro IS_TIM_REMAP_INSTANCE(TIMx) can be used to check whether or not + * a some timer inputs can be remapped. + * @if STM32F334x8 + * @rmtoll TIM1_OR ETR_RMP LL_TIM_SetRemap\n + * TIM16_OR TI1_RMP LL_TIM_SetRemap\n + * @elseif STM32F302x8 + * @rmtoll TIM1_OR ETR_RMP LL_TIM_SetRemap\n + * TIM16_OR TI1_RMP LL_TIM_SetRemap\n + * @elseif STM32F303xC + * @rmtoll TIM1_OR ETR_RMP LL_TIM_SetRemap\n + * TIM8_OR ETR_RMP LL_TIM_SetRemap\n + * TIM20_OR ETR_RMP LL_TIM_SetRemap\n + * @elseif STM32F373xC + * @rmtoll TIM14_OR TI1_RMP LL_TIM_SetRemap + * @endif + * @param TIMx Timer instance + * @param Remap Remap params depends on the TIMx. Description available only + * in CHM version of the User Manual (not in .pdf). + * Otherwise see Reference Manual description of OR registers. + * + * Below description summarizes "Timer Instance" and "Remap" param combinations: + * + * TIM1: any combination of ETR_RMP where (**) + * + * . . ETR_RMP can be one of the following values + * @arg @ref LL_TIM_TIM1_ETR_ADC1_RMP_NC + * @arg @ref LL_TIM_TIM1_ETR_ADC1_RMP_AWD1 (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC1_RMP_AWD2 (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC1_RMP_AWD3 (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC2_RMP_NC (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC2_RMP_AWD1 (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC2_RMP_AWD2 (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC2_RMP_AWD3 (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC3_RMP_NC (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC3_RMP_AWD1 (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC3_RMP_AWD2 (*) + * @arg @ref LL_TIM_TIM1_ETR_ADC3_RMP_AWD3 (*) + * + * TIM8: any combination of ETR_RMP where (**) + * + * . . ETR_RMP can be one of the following values + * @arg @ref LL_TIM_TIM8_ETR_ADC2_RMP_NC (*) + * @arg @ref LL_TIM_TIM8_ETR_ADC2_RMP_AWD1 (*) + * @arg @ref LL_TIM_TIM8_ETR_ADC2_RMP_AWD2 (*) + * @arg @ref LL_TIM_TIM8_ETR_ADC2_RMP_AWD3 (*) + * @arg @ref LL_TIM_TIM8_ETR_ADC3_RMP_NC (*) + * @arg @ref LL_TIM_TIM8_ETR_ADC3_RMP_AWD1 (*) + * @arg @ref LL_TIM_TIM8_ETR_ADC3_RMP_AWD2 (*) + * @arg @ref LL_TIM_TIM8_ETR_ADC3_RMP_AWD3 (*) + * + * TIM14: any combination of TI1_RMP where (**) + * + * . . TI1_RMP can be one of the following values + * @arg @ref LL_TIM_TIM14_TI1_RMP_GPIO (*) + * @arg @ref LL_TIM_TIM14_TI1_RMP_RTC_CLK (*) + * @arg @ref LL_TIM_TIM14_TI1_RMP_HSE (*) + * @arg @ref LL_TIM_TIM14_TI1_RMP_MCO (*) + * + * TIM16: any combination of TI1_RMP where (**) + * + * . . TI1_RMP can be one of the following values + * @arg @ref LL_TIM_TIM16_TI1_RMP_GPIO (*) + * @arg @ref LL_TIM_TIM16_TI1_RMP_LSI (*) + * @arg @ref LL_TIM_TIM16_TI1_RMP_LSE (*) + * @arg @ref LL_TIM_TIM16_TI1_RMP_RTC (*) + * + * TIM20: any combination of ETR_RMP where (**) + * + * . . ETR_RMP can be one of the following values + * @arg @ref LL_TIM_TIM20_ETR_ADC3_RMP_NC (*) + * @arg @ref LL_TIM_TIM20_ETR_ADC3_RMP_AWD1 (*) + * @arg @ref LL_TIM_TIM20_ETR_ADC3_RMP_AWD2 (*) + * @arg @ref LL_TIM_TIM20_ETR_ADC3_RMP_AWD3 (*) + * @arg @ref LL_TIM_TIM20_ETR_ADC4_RMP_NC (*) + * @arg @ref LL_TIM_TIM20_ETR_ADC4_RMP_AWD1 (*) + * @arg @ref LL_TIM_TIM20_ETR_ADC4_RMP_AWD2 (*) + * @arg @ref LL_TIM_TIM20_ETR_ADC4_RMP_AWD3 (*) + * + * (*) Value not defined in all devices. \n + * (**) Register not available in all devices. + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetRemap(TIM_TypeDef *TIMx, uint32_t Remap) +{ + MODIFY_REG(TIMx->OR, (Remap >> TIMx_OR_RMP_SHIFT), (Remap & TIMx_OR_RMP_MASK)); +} + +/** + * @} + */ +#if defined(TIM_SMCR_OCCS) + +/** @defgroup TIM_LL_EF_OCREF_Clear OCREF_Clear_Management + * @{ + */ +/** + * @brief Set the OCREF clear input source + * @note The OCxREF signal of a given channel can be cleared when a high level is applied on the OCREF_CLR_INPUT + * @note This function can only be used in Output compare and PWM modes. + * @rmtoll SMCR OCCS LL_TIM_SetOCRefClearInputSource + * @param TIMx Timer instance + * @param OCRefClearInputSource This parameter can be one of the following values: + * @arg @ref LL_TIM_OCREF_CLR_INT_OCREF_CLR + * @arg @ref LL_TIM_OCREF_CLR_INT_ETR + * @retval None + */ +__STATIC_INLINE void LL_TIM_SetOCRefClearInputSource(TIM_TypeDef *TIMx, uint32_t OCRefClearInputSource) +{ + MODIFY_REG(TIMx->SMCR, TIM_SMCR_OCCS, OCRefClearInputSource); +} +/** + * @} + */ +#endif /* TIM_SMCR_OCCS */ + +/** @defgroup TIM_LL_EF_FLAG_Management FLAG-Management + * @{ + */ +/** + * @brief Clear the update interrupt flag (UIF). + * @rmtoll SR UIF LL_TIM_ClearFlag_UPDATE + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_UPDATE(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_UIF)); +} + +/** + * @brief Indicate whether update interrupt flag (UIF) is set (update interrupt is pending). + * @rmtoll SR UIF LL_TIM_IsActiveFlag_UPDATE + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_UPDATE(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_UIF) == (TIM_SR_UIF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the Capture/Compare 1 interrupt flag (CC1F). + * @rmtoll SR CC1IF LL_TIM_ClearFlag_CC1 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC1(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC1IF)); +} + +/** + * @brief Indicate whether Capture/Compare 1 interrupt flag (CC1F) is set (Capture/Compare 1 interrupt is pending). + * @rmtoll SR CC1IF LL_TIM_IsActiveFlag_CC1 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC1(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC1IF) == (TIM_SR_CC1IF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the Capture/Compare 2 interrupt flag (CC2F). + * @rmtoll SR CC2IF LL_TIM_ClearFlag_CC2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC2(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC2IF)); +} + +/** + * @brief Indicate whether Capture/Compare 2 interrupt flag (CC2F) is set (Capture/Compare 2 interrupt is pending). + * @rmtoll SR CC2IF LL_TIM_IsActiveFlag_CC2 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC2(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC2IF) == (TIM_SR_CC2IF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the Capture/Compare 3 interrupt flag (CC3F). + * @rmtoll SR CC3IF LL_TIM_ClearFlag_CC3 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC3(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC3IF)); +} + +/** + * @brief Indicate whether Capture/Compare 3 interrupt flag (CC3F) is set (Capture/Compare 3 interrupt is pending). + * @rmtoll SR CC3IF LL_TIM_IsActiveFlag_CC3 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC3(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC3IF) == (TIM_SR_CC3IF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the Capture/Compare 4 interrupt flag (CC4F). + * @rmtoll SR CC4IF LL_TIM_ClearFlag_CC4 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC4(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC4IF)); +} + +/** + * @brief Indicate whether Capture/Compare 4 interrupt flag (CC4F) is set (Capture/Compare 4 interrupt is pending). + * @rmtoll SR CC4IF LL_TIM_IsActiveFlag_CC4 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC4(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC4IF) == (TIM_SR_CC4IF)) ? 1UL : 0UL); +} + +#if defined (TIM_SR_CC5IF) +/** + * @brief Clear the Capture/Compare 5 interrupt flag (CC5F). + * @rmtoll SR CC5IF LL_TIM_ClearFlag_CC5 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC5(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC5IF)); +} + +/** + * @brief Indicate whether Capture/Compare 5 interrupt flag (CC5F) is set (Capture/Compare 5 interrupt is pending). + * @rmtoll SR CC5IF LL_TIM_IsActiveFlag_CC5 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC5(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC5IF) == (TIM_SR_CC5IF)) ? 1UL : 0UL); +} + +#endif /* TIM_SR_CC5IF */ +#if defined (TIM_SR_CC6IF) +/** + * @brief Clear the Capture/Compare 6 interrupt flag (CC6F). + * @rmtoll SR CC6IF LL_TIM_ClearFlag_CC6 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC6(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC6IF)); +} + +/** + * @brief Indicate whether Capture/Compare 6 interrupt flag (CC6F) is set (Capture/Compare 6 interrupt is pending). + * @rmtoll SR CC6IF LL_TIM_IsActiveFlag_CC6 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC6(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC6IF) == (TIM_SR_CC6IF)) ? 1UL : 0UL); +} + +#endif /* TIM_SR_CC6IF */ +/** + * @brief Clear the commutation interrupt flag (COMIF). + * @rmtoll SR COMIF LL_TIM_ClearFlag_COM + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_COM(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_COMIF)); +} + +/** + * @brief Indicate whether commutation interrupt flag (COMIF) is set (commutation interrupt is pending). + * @rmtoll SR COMIF LL_TIM_IsActiveFlag_COM + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_COM(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_COMIF) == (TIM_SR_COMIF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the trigger interrupt flag (TIF). + * @rmtoll SR TIF LL_TIM_ClearFlag_TRIG + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_TRIG(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_TIF)); +} + +/** + * @brief Indicate whether trigger interrupt flag (TIF) is set (trigger interrupt is pending). + * @rmtoll SR TIF LL_TIM_IsActiveFlag_TRIG + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_TRIG(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_TIF) == (TIM_SR_TIF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the break interrupt flag (BIF). + * @rmtoll SR BIF LL_TIM_ClearFlag_BRK + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_BRK(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_BIF)); +} + +/** + * @brief Indicate whether break interrupt flag (BIF) is set (break interrupt is pending). + * @rmtoll SR BIF LL_TIM_IsActiveFlag_BRK + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_BRK(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_BIF) == (TIM_SR_BIF)) ? 1UL : 0UL); +} + +#if defined(TIM_SR_B2IF) +/** + * @brief Clear the break 2 interrupt flag (B2IF). + * @rmtoll SR B2IF LL_TIM_ClearFlag_BRK2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_BRK2(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_B2IF)); +} + +/** + * @brief Indicate whether break 2 interrupt flag (B2IF) is set (break 2 interrupt is pending). + * @rmtoll SR B2IF LL_TIM_IsActiveFlag_BRK2 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_BRK2(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_B2IF) == (TIM_SR_B2IF)) ? 1UL : 0UL); +} + +#endif /* TIM_SR_B2IF */ +/** + * @brief Clear the Capture/Compare 1 over-capture interrupt flag (CC1OF). + * @rmtoll SR CC1OF LL_TIM_ClearFlag_CC1OVR + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC1OVR(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC1OF)); +} + +/** + * @brief Indicate whether Capture/Compare 1 over-capture interrupt flag (CC1OF) is set + * (Capture/Compare 1 interrupt is pending). + * @rmtoll SR CC1OF LL_TIM_IsActiveFlag_CC1OVR + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC1OVR(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC1OF) == (TIM_SR_CC1OF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the Capture/Compare 2 over-capture interrupt flag (CC2OF). + * @rmtoll SR CC2OF LL_TIM_ClearFlag_CC2OVR + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC2OVR(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC2OF)); +} + +/** + * @brief Indicate whether Capture/Compare 2 over-capture interrupt flag (CC2OF) is set + * (Capture/Compare 2 over-capture interrupt is pending). + * @rmtoll SR CC2OF LL_TIM_IsActiveFlag_CC2OVR + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC2OVR(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC2OF) == (TIM_SR_CC2OF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the Capture/Compare 3 over-capture interrupt flag (CC3OF). + * @rmtoll SR CC3OF LL_TIM_ClearFlag_CC3OVR + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC3OVR(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC3OF)); +} + +/** + * @brief Indicate whether Capture/Compare 3 over-capture interrupt flag (CC3OF) is set + * (Capture/Compare 3 over-capture interrupt is pending). + * @rmtoll SR CC3OF LL_TIM_IsActiveFlag_CC3OVR + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC3OVR(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC3OF) == (TIM_SR_CC3OF)) ? 1UL : 0UL); +} + +/** + * @brief Clear the Capture/Compare 4 over-capture interrupt flag (CC4OF). + * @rmtoll SR CC4OF LL_TIM_ClearFlag_CC4OVR + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_ClearFlag_CC4OVR(TIM_TypeDef *TIMx) +{ + WRITE_REG(TIMx->SR, ~(TIM_SR_CC4OF)); +} + +/** + * @brief Indicate whether Capture/Compare 4 over-capture interrupt flag (CC4OF) is set + * (Capture/Compare 4 over-capture interrupt is pending). + * @rmtoll SR CC4OF LL_TIM_IsActiveFlag_CC4OVR + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsActiveFlag_CC4OVR(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->SR, TIM_SR_CC4OF) == (TIM_SR_CC4OF)) ? 1UL : 0UL); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_IT_Management IT-Management + * @{ + */ +/** + * @brief Enable update interrupt (UIE). + * @rmtoll DIER UIE LL_TIM_EnableIT_UPDATE + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableIT_UPDATE(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_UIE); +} + +/** + * @brief Disable update interrupt (UIE). + * @rmtoll DIER UIE LL_TIM_DisableIT_UPDATE + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableIT_UPDATE(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_UIE); +} + +/** + * @brief Indicates whether the update interrupt (UIE) is enabled. + * @rmtoll DIER UIE LL_TIM_IsEnabledIT_UPDATE + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledIT_UPDATE(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_UIE) == (TIM_DIER_UIE)) ? 1UL : 0UL); +} + +/** + * @brief Enable capture/compare 1 interrupt (CC1IE). + * @rmtoll DIER CC1IE LL_TIM_EnableIT_CC1 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableIT_CC1(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_CC1IE); +} + +/** + * @brief Disable capture/compare 1 interrupt (CC1IE). + * @rmtoll DIER CC1IE LL_TIM_DisableIT_CC1 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableIT_CC1(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_CC1IE); +} + +/** + * @brief Indicates whether the capture/compare 1 interrupt (CC1IE) is enabled. + * @rmtoll DIER CC1IE LL_TIM_IsEnabledIT_CC1 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledIT_CC1(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_CC1IE) == (TIM_DIER_CC1IE)) ? 1UL : 0UL); +} + +/** + * @brief Enable capture/compare 2 interrupt (CC2IE). + * @rmtoll DIER CC2IE LL_TIM_EnableIT_CC2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableIT_CC2(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_CC2IE); +} + +/** + * @brief Disable capture/compare 2 interrupt (CC2IE). + * @rmtoll DIER CC2IE LL_TIM_DisableIT_CC2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableIT_CC2(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_CC2IE); +} + +/** + * @brief Indicates whether the capture/compare 2 interrupt (CC2IE) is enabled. + * @rmtoll DIER CC2IE LL_TIM_IsEnabledIT_CC2 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledIT_CC2(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_CC2IE) == (TIM_DIER_CC2IE)) ? 1UL : 0UL); +} + +/** + * @brief Enable capture/compare 3 interrupt (CC3IE). + * @rmtoll DIER CC3IE LL_TIM_EnableIT_CC3 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableIT_CC3(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_CC3IE); +} + +/** + * @brief Disable capture/compare 3 interrupt (CC3IE). + * @rmtoll DIER CC3IE LL_TIM_DisableIT_CC3 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableIT_CC3(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_CC3IE); +} + +/** + * @brief Indicates whether the capture/compare 3 interrupt (CC3IE) is enabled. + * @rmtoll DIER CC3IE LL_TIM_IsEnabledIT_CC3 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledIT_CC3(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_CC3IE) == (TIM_DIER_CC3IE)) ? 1UL : 0UL); +} + +/** + * @brief Enable capture/compare 4 interrupt (CC4IE). + * @rmtoll DIER CC4IE LL_TIM_EnableIT_CC4 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableIT_CC4(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_CC4IE); +} + +/** + * @brief Disable capture/compare 4 interrupt (CC4IE). + * @rmtoll DIER CC4IE LL_TIM_DisableIT_CC4 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableIT_CC4(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_CC4IE); +} + +/** + * @brief Indicates whether the capture/compare 4 interrupt (CC4IE) is enabled. + * @rmtoll DIER CC4IE LL_TIM_IsEnabledIT_CC4 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledIT_CC4(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_CC4IE) == (TIM_DIER_CC4IE)) ? 1UL : 0UL); +} + +/** + * @brief Enable commutation interrupt (COMIE). + * @rmtoll DIER COMIE LL_TIM_EnableIT_COM + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableIT_COM(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_COMIE); +} + +/** + * @brief Disable commutation interrupt (COMIE). + * @rmtoll DIER COMIE LL_TIM_DisableIT_COM + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableIT_COM(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_COMIE); +} + +/** + * @brief Indicates whether the commutation interrupt (COMIE) is enabled. + * @rmtoll DIER COMIE LL_TIM_IsEnabledIT_COM + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledIT_COM(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_COMIE) == (TIM_DIER_COMIE)) ? 1UL : 0UL); +} + +/** + * @brief Enable trigger interrupt (TIE). + * @rmtoll DIER TIE LL_TIM_EnableIT_TRIG + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableIT_TRIG(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_TIE); +} + +/** + * @brief Disable trigger interrupt (TIE). + * @rmtoll DIER TIE LL_TIM_DisableIT_TRIG + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableIT_TRIG(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_TIE); +} + +/** + * @brief Indicates whether the trigger interrupt (TIE) is enabled. + * @rmtoll DIER TIE LL_TIM_IsEnabledIT_TRIG + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledIT_TRIG(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_TIE) == (TIM_DIER_TIE)) ? 1UL : 0UL); +} + +/** + * @brief Enable break interrupt (BIE). + * @rmtoll DIER BIE LL_TIM_EnableIT_BRK + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableIT_BRK(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_BIE); +} + +/** + * @brief Disable break interrupt (BIE). + * @rmtoll DIER BIE LL_TIM_DisableIT_BRK + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableIT_BRK(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_BIE); +} + +/** + * @brief Indicates whether the break interrupt (BIE) is enabled. + * @rmtoll DIER BIE LL_TIM_IsEnabledIT_BRK + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledIT_BRK(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_BIE) == (TIM_DIER_BIE)) ? 1UL : 0UL); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_DMA_Management DMA Management + * @{ + */ +/** + * @brief Enable update DMA request (UDE). + * @rmtoll DIER UDE LL_TIM_EnableDMAReq_UPDATE + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableDMAReq_UPDATE(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_UDE); +} + +/** + * @brief Disable update DMA request (UDE). + * @rmtoll DIER UDE LL_TIM_DisableDMAReq_UPDATE + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableDMAReq_UPDATE(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_UDE); +} + +/** + * @brief Indicates whether the update DMA request (UDE) is enabled. + * @rmtoll DIER UDE LL_TIM_IsEnabledDMAReq_UPDATE + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledDMAReq_UPDATE(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_UDE) == (TIM_DIER_UDE)) ? 1UL : 0UL); +} + +/** + * @brief Enable capture/compare 1 DMA request (CC1DE). + * @rmtoll DIER CC1DE LL_TIM_EnableDMAReq_CC1 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableDMAReq_CC1(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_CC1DE); +} + +/** + * @brief Disable capture/compare 1 DMA request (CC1DE). + * @rmtoll DIER CC1DE LL_TIM_DisableDMAReq_CC1 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableDMAReq_CC1(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_CC1DE); +} + +/** + * @brief Indicates whether the capture/compare 1 DMA request (CC1DE) is enabled. + * @rmtoll DIER CC1DE LL_TIM_IsEnabledDMAReq_CC1 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledDMAReq_CC1(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_CC1DE) == (TIM_DIER_CC1DE)) ? 1UL : 0UL); +} + +/** + * @brief Enable capture/compare 2 DMA request (CC2DE). + * @rmtoll DIER CC2DE LL_TIM_EnableDMAReq_CC2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableDMAReq_CC2(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_CC2DE); +} + +/** + * @brief Disable capture/compare 2 DMA request (CC2DE). + * @rmtoll DIER CC2DE LL_TIM_DisableDMAReq_CC2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableDMAReq_CC2(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_CC2DE); +} + +/** + * @brief Indicates whether the capture/compare 2 DMA request (CC2DE) is enabled. + * @rmtoll DIER CC2DE LL_TIM_IsEnabledDMAReq_CC2 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledDMAReq_CC2(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_CC2DE) == (TIM_DIER_CC2DE)) ? 1UL : 0UL); +} + +/** + * @brief Enable capture/compare 3 DMA request (CC3DE). + * @rmtoll DIER CC3DE LL_TIM_EnableDMAReq_CC3 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableDMAReq_CC3(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_CC3DE); +} + +/** + * @brief Disable capture/compare 3 DMA request (CC3DE). + * @rmtoll DIER CC3DE LL_TIM_DisableDMAReq_CC3 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableDMAReq_CC3(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_CC3DE); +} + +/** + * @brief Indicates whether the capture/compare 3 DMA request (CC3DE) is enabled. + * @rmtoll DIER CC3DE LL_TIM_IsEnabledDMAReq_CC3 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledDMAReq_CC3(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_CC3DE) == (TIM_DIER_CC3DE)) ? 1UL : 0UL); +} + +/** + * @brief Enable capture/compare 4 DMA request (CC4DE). + * @rmtoll DIER CC4DE LL_TIM_EnableDMAReq_CC4 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableDMAReq_CC4(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_CC4DE); +} + +/** + * @brief Disable capture/compare 4 DMA request (CC4DE). + * @rmtoll DIER CC4DE LL_TIM_DisableDMAReq_CC4 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableDMAReq_CC4(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_CC4DE); +} + +/** + * @brief Indicates whether the capture/compare 4 DMA request (CC4DE) is enabled. + * @rmtoll DIER CC4DE LL_TIM_IsEnabledDMAReq_CC4 + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledDMAReq_CC4(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_CC4DE) == (TIM_DIER_CC4DE)) ? 1UL : 0UL); +} + +/** + * @brief Enable commutation DMA request (COMDE). + * @rmtoll DIER COMDE LL_TIM_EnableDMAReq_COM + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableDMAReq_COM(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_COMDE); +} + +/** + * @brief Disable commutation DMA request (COMDE). + * @rmtoll DIER COMDE LL_TIM_DisableDMAReq_COM + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableDMAReq_COM(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_COMDE); +} + +/** + * @brief Indicates whether the commutation DMA request (COMDE) is enabled. + * @rmtoll DIER COMDE LL_TIM_IsEnabledDMAReq_COM + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledDMAReq_COM(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_COMDE) == (TIM_DIER_COMDE)) ? 1UL : 0UL); +} + +/** + * @brief Enable trigger interrupt (TDE). + * @rmtoll DIER TDE LL_TIM_EnableDMAReq_TRIG + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_EnableDMAReq_TRIG(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->DIER, TIM_DIER_TDE); +} + +/** + * @brief Disable trigger interrupt (TDE). + * @rmtoll DIER TDE LL_TIM_DisableDMAReq_TRIG + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_DisableDMAReq_TRIG(TIM_TypeDef *TIMx) +{ + CLEAR_BIT(TIMx->DIER, TIM_DIER_TDE); +} + +/** + * @brief Indicates whether the trigger interrupt (TDE) is enabled. + * @rmtoll DIER TDE LL_TIM_IsEnabledDMAReq_TRIG + * @param TIMx Timer instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_TIM_IsEnabledDMAReq_TRIG(const TIM_TypeDef *TIMx) +{ + return ((READ_BIT(TIMx->DIER, TIM_DIER_TDE) == (TIM_DIER_TDE)) ? 1UL : 0UL); +} + +/** + * @} + */ + +/** @defgroup TIM_LL_EF_EVENT_Management EVENT-Management + * @{ + */ +/** + * @brief Generate an update event. + * @rmtoll EGR UG LL_TIM_GenerateEvent_UPDATE + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_UPDATE(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_UG); +} + +/** + * @brief Generate Capture/Compare 1 event. + * @rmtoll EGR CC1G LL_TIM_GenerateEvent_CC1 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_CC1(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_CC1G); +} + +/** + * @brief Generate Capture/Compare 2 event. + * @rmtoll EGR CC2G LL_TIM_GenerateEvent_CC2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_CC2(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_CC2G); +} + +/** + * @brief Generate Capture/Compare 3 event. + * @rmtoll EGR CC3G LL_TIM_GenerateEvent_CC3 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_CC3(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_CC3G); +} + +/** + * @brief Generate Capture/Compare 4 event. + * @rmtoll EGR CC4G LL_TIM_GenerateEvent_CC4 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_CC4(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_CC4G); +} + +/** + * @brief Generate commutation event. + * @rmtoll EGR COMG LL_TIM_GenerateEvent_COM + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_COM(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_COMG); +} + +/** + * @brief Generate trigger event. + * @rmtoll EGR TG LL_TIM_GenerateEvent_TRIG + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_TRIG(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_TG); +} + +/** + * @brief Generate break event. + * @rmtoll EGR BG LL_TIM_GenerateEvent_BRK + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_BRK(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_BG); +} + +#if defined(TIM_EGR_B2G) +/** + * @brief Generate break 2 event. + * @rmtoll EGR B2G LL_TIM_GenerateEvent_BRK2 + * @param TIMx Timer instance + * @retval None + */ +__STATIC_INLINE void LL_TIM_GenerateEvent_BRK2(TIM_TypeDef *TIMx) +{ + SET_BIT(TIMx->EGR, TIM_EGR_B2G); +} + +#endif /* TIM_EGR_B2G */ +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup TIM_LL_EF_Init Initialisation and deinitialisation functions + * @{ + */ + +ErrorStatus LL_TIM_DeInit(const TIM_TypeDef *TIMx); +void LL_TIM_StructInit(LL_TIM_InitTypeDef *TIM_InitStruct); +ErrorStatus LL_TIM_Init(TIM_TypeDef *TIMx, const LL_TIM_InitTypeDef *TIM_InitStruct); +void LL_TIM_OC_StructInit(LL_TIM_OC_InitTypeDef *TIM_OC_InitStruct); +ErrorStatus LL_TIM_OC_Init(TIM_TypeDef *TIMx, uint32_t Channel, const LL_TIM_OC_InitTypeDef *TIM_OC_InitStruct); +void LL_TIM_IC_StructInit(LL_TIM_IC_InitTypeDef *TIM_ICInitStruct); +ErrorStatus LL_TIM_IC_Init(TIM_TypeDef *TIMx, uint32_t Channel, const LL_TIM_IC_InitTypeDef *TIM_IC_InitStruct); +void LL_TIM_ENCODER_StructInit(LL_TIM_ENCODER_InitTypeDef *TIM_EncoderInitStruct); +ErrorStatus LL_TIM_ENCODER_Init(TIM_TypeDef *TIMx, const LL_TIM_ENCODER_InitTypeDef *TIM_EncoderInitStruct); +void LL_TIM_HALLSENSOR_StructInit(LL_TIM_HALLSENSOR_InitTypeDef *TIM_HallSensorInitStruct); +ErrorStatus LL_TIM_HALLSENSOR_Init(TIM_TypeDef *TIMx, const LL_TIM_HALLSENSOR_InitTypeDef *TIM_HallSensorInitStruct); +void LL_TIM_BDTR_StructInit(LL_TIM_BDTR_InitTypeDef *TIM_BDTRInitStruct); +ErrorStatus LL_TIM_BDTR_Init(TIM_TypeDef *TIMx, const LL_TIM_BDTR_InitTypeDef *TIM_BDTRInitStruct); +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* TIM1 || TIM2 || TIM3 || TIM4 || TIM5 || TIM6 || TIM7 || TIM8 || TIM12 || TIM13 || TIM14 || TIM15 || TIM16 || TIM17 || TIM18 || TIM19 || TIM20 */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_TIM_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_usart.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_usart.h new file mode 100644 index 0000000..0e4725f --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_usart.h @@ -0,0 +1,3650 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_usart.h + * @author MCD Application Team + * @brief Header file of USART LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32F3xx_LL_USART_H +#define STM32F3xx_LL_USART_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +#if defined(USART1) || defined(USART2) || defined(USART3) || defined(UART4) || defined(UART5) + +/** @defgroup USART_LL USART + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup USART_LL_Private_Constants USART Private Constants + * @{ + */ +/** + * @} + */ +/* Private macros ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup USART_LL_Private_Macros USART Private Macros + * @{ + */ +/** + * @} + */ +#endif /*USE_FULL_LL_DRIVER*/ + +/* Exported types ------------------------------------------------------------*/ +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup USART_LL_ES_INIT USART Exported Init structures + * @{ + */ + +/** + * @brief LL USART Init Structure definition + */ +typedef struct +{ + + uint32_t BaudRate; /*!< This field defines expected Usart communication baud rate. + + This feature can be modified afterwards using unitary + function @ref LL_USART_SetBaudRate().*/ + + uint32_t DataWidth; /*!< Specifies the number of data bits transmitted or received in a frame. + This parameter can be a value of @ref USART_LL_EC_DATAWIDTH. + + This feature can be modified afterwards using unitary + function @ref LL_USART_SetDataWidth().*/ + + uint32_t StopBits; /*!< Specifies the number of stop bits transmitted. + This parameter can be a value of @ref USART_LL_EC_STOPBITS. + + This feature can be modified afterwards using unitary + function @ref LL_USART_SetStopBitsLength().*/ + + uint32_t Parity; /*!< Specifies the parity mode. + This parameter can be a value of @ref USART_LL_EC_PARITY. + + This feature can be modified afterwards using unitary + function @ref LL_USART_SetParity().*/ + + uint32_t TransferDirection; /*!< Specifies whether the Receive and/or Transmit mode is enabled or disabled. + This parameter can be a value of @ref USART_LL_EC_DIRECTION. + + This feature can be modified afterwards using unitary + function @ref LL_USART_SetTransferDirection().*/ + + uint32_t HardwareFlowControl; /*!< Specifies whether the hardware flow control mode is enabled or disabled. + This parameter can be a value of @ref USART_LL_EC_HWCONTROL. + + This feature can be modified afterwards using unitary + function @ref LL_USART_SetHWFlowCtrl().*/ + + uint32_t OverSampling; /*!< Specifies whether USART oversampling mode is 16 or 8. + This parameter can be a value of @ref USART_LL_EC_OVERSAMPLING. + + This feature can be modified afterwards using unitary + function @ref LL_USART_SetOverSampling().*/ + +} LL_USART_InitTypeDef; + +/** + * @brief LL USART Clock Init Structure definition + */ +typedef struct +{ + uint32_t ClockOutput; /*!< Specifies whether the USART clock is enabled or disabled. + This parameter can be a value of @ref USART_LL_EC_CLOCK. + + USART HW configuration can be modified afterwards using unitary functions + @ref LL_USART_EnableSCLKOutput() or @ref LL_USART_DisableSCLKOutput(). + For more details, refer to description of this function. */ + + uint32_t ClockPolarity; /*!< Specifies the steady state of the serial clock. + This parameter can be a value of @ref USART_LL_EC_POLARITY. + + USART HW configuration can be modified afterwards using unitary + functions @ref LL_USART_SetClockPolarity(). + For more details, refer to description of this function. */ + + uint32_t ClockPhase; /*!< Specifies the clock transition on which the bit capture is made. + This parameter can be a value of @ref USART_LL_EC_PHASE. + + USART HW configuration can be modified afterwards using unitary + functions @ref LL_USART_SetClockPhase(). + For more details, refer to description of this function. */ + + uint32_t LastBitClockPulse; /*!< Specifies whether the clock pulse corresponding to the last transmitted + data bit (MSB) has to be output on the SCLK pin in synchronous mode. + This parameter can be a value of @ref USART_LL_EC_LASTCLKPULSE. + + USART HW configuration can be modified afterwards using unitary + functions @ref LL_USART_SetLastClkPulseOutput(). + For more details, refer to description of this function. */ + +} LL_USART_ClockInitTypeDef; + +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup USART_LL_Exported_Constants USART Exported Constants + * @{ + */ + +/** @defgroup USART_LL_EC_CLEAR_FLAG Clear Flags Defines + * @brief Flags defines which can be used with LL_USART_WriteReg function + * @{ + */ +#define LL_USART_ICR_PECF USART_ICR_PECF /*!< Parity error clear flag */ +#define LL_USART_ICR_FECF USART_ICR_FECF /*!< Framing error clear flag */ +#define LL_USART_ICR_NCF USART_ICR_NCF /*!< Noise error detected clear flag */ +#define LL_USART_ICR_ORECF USART_ICR_ORECF /*!< Overrun error clear flag */ +#define LL_USART_ICR_IDLECF USART_ICR_IDLECF /*!< Idle line detected clear flag */ +#define LL_USART_ICR_TCCF USART_ICR_TCCF /*!< Transmission complete clear flag */ +#define LL_USART_ICR_LBDCF USART_ICR_LBDCF /*!< LIN break detection clear flag */ +#define LL_USART_ICR_CTSCF USART_ICR_CTSCF /*!< CTS clear flag */ +#define LL_USART_ICR_RTOCF USART_ICR_RTOCF /*!< Receiver timeout clear flag */ +#define LL_USART_ICR_EOBCF USART_ICR_EOBCF /*!< End of block clear flag */ +#define LL_USART_ICR_CMCF USART_ICR_CMCF /*!< Character match clear flag */ +#define LL_USART_ICR_WUCF USART_ICR_WUCF /*!< Wakeup from Stop mode clear flag */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_GET_FLAG Get Flags Defines + * @brief Flags defines which can be used with LL_USART_ReadReg function + * @{ + */ +#define LL_USART_ISR_PE USART_ISR_PE /*!< Parity error flag */ +#define LL_USART_ISR_FE USART_ISR_FE /*!< Framing error flag */ +#define LL_USART_ISR_NE USART_ISR_NE /*!< Noise detected flag */ +#define LL_USART_ISR_ORE USART_ISR_ORE /*!< Overrun error flag */ +#define LL_USART_ISR_IDLE USART_ISR_IDLE /*!< Idle line detected flag */ +#define LL_USART_ISR_RXNE USART_ISR_RXNE /*!< Read data register not empty flag */ +#define LL_USART_ISR_TC USART_ISR_TC /*!< Transmission complete flag */ +#define LL_USART_ISR_TXE USART_ISR_TXE /*!< Transmit data register empty flag */ +#define LL_USART_ISR_LBDF USART_ISR_LBDF /*!< LIN break detection flag */ +#define LL_USART_ISR_CTSIF USART_ISR_CTSIF /*!< CTS interrupt flag */ +#define LL_USART_ISR_CTS USART_ISR_CTS /*!< CTS flag */ +#define LL_USART_ISR_RTOF USART_ISR_RTOF /*!< Receiver timeout flag */ +#define LL_USART_ISR_EOBF USART_ISR_EOBF /*!< End of block flag */ +#define LL_USART_ISR_ABRE USART_ISR_ABRE /*!< Auto baud rate error flag */ +#define LL_USART_ISR_ABRF USART_ISR_ABRF /*!< Auto baud rate flag */ +#define LL_USART_ISR_BUSY USART_ISR_BUSY /*!< Busy flag */ +#define LL_USART_ISR_CMF USART_ISR_CMF /*!< Character match flag */ +#define LL_USART_ISR_SBKF USART_ISR_SBKF /*!< Send break flag */ +#define LL_USART_ISR_RWU USART_ISR_RWU /*!< Receiver wakeup from Mute mode flag */ +#define LL_USART_ISR_WUF USART_ISR_WUF /*!< Wakeup from Stop mode flag */ +#define LL_USART_ISR_TEACK USART_ISR_TEACK /*!< Transmit enable acknowledge flag */ +#define LL_USART_ISR_REACK USART_ISR_REACK /*!< Receive enable acknowledge flag */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_IT IT Defines + * @brief IT defines which can be used with LL_USART_ReadReg and LL_USART_WriteReg functions + * @{ + */ +#define LL_USART_CR1_IDLEIE USART_CR1_IDLEIE /*!< IDLE interrupt enable */ +#define LL_USART_CR1_RXNEIE USART_CR1_RXNEIE /*!< Read data register not empty interrupt enable */ +#define LL_USART_CR1_TCIE USART_CR1_TCIE /*!< Transmission complete interrupt enable */ +#define LL_USART_CR1_TXEIE USART_CR1_TXEIE /*!< Transmit data register empty interrupt enable */ +#define LL_USART_CR1_PEIE USART_CR1_PEIE /*!< Parity error */ +#define LL_USART_CR1_CMIE USART_CR1_CMIE /*!< Character match interrupt enable */ +#define LL_USART_CR1_RTOIE USART_CR1_RTOIE /*!< Receiver timeout interrupt enable */ +#define LL_USART_CR1_EOBIE USART_CR1_EOBIE /*!< End of Block interrupt enable */ +#define LL_USART_CR2_LBDIE USART_CR2_LBDIE /*!< LIN break detection interrupt enable */ +#define LL_USART_CR3_EIE USART_CR3_EIE /*!< Error interrupt enable */ +#define LL_USART_CR3_CTSIE USART_CR3_CTSIE /*!< CTS interrupt enable */ +#define LL_USART_CR3_WUFIE USART_CR3_WUFIE /*!< Wakeup from Stop mode interrupt enable */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_DIRECTION Communication Direction + * @{ + */ +#define LL_USART_DIRECTION_NONE 0x00000000U /*!< Transmitter and Receiver are disabled */ +#define LL_USART_DIRECTION_RX USART_CR1_RE /*!< Transmitter is disabled and Receiver is enabled */ +#define LL_USART_DIRECTION_TX USART_CR1_TE /*!< Transmitter is enabled and Receiver is disabled */ +#define LL_USART_DIRECTION_TX_RX (USART_CR1_TE |USART_CR1_RE) /*!< Transmitter and Receiver are enabled */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_PARITY Parity Control + * @{ + */ +#define LL_USART_PARITY_NONE 0x00000000U /*!< Parity control disabled */ +#define LL_USART_PARITY_EVEN USART_CR1_PCE /*!< Parity control enabled and Even Parity is selected */ +#define LL_USART_PARITY_ODD (USART_CR1_PCE | USART_CR1_PS) /*!< Parity control enabled and Odd Parity is selected */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_WAKEUP Wakeup + * @{ + */ +#define LL_USART_WAKEUP_IDLELINE 0x00000000U /*!< USART wake up from Mute mode on Idle Line */ +#define LL_USART_WAKEUP_ADDRESSMARK USART_CR1_WAKE /*!< USART wake up from Mute mode on Address Mark */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_DATAWIDTH Datawidth + * @{ + */ +#if defined(USART_7BITS_SUPPORT) +#define LL_USART_DATAWIDTH_7B USART_CR1_M1 /*!< 7 bits word length : Start bit, 7 data bits, n stop bits */ +#define LL_USART_DATAWIDTH_8B 0x00000000U /*!< 8 bits word length : Start bit, 8 data bits, n stop bits */ +#define LL_USART_DATAWIDTH_9B USART_CR1_M0 /*!< 9 bits word length : Start bit, 9 data bits, n stop bits */ +#else +#define LL_USART_DATAWIDTH_8B 0x00000000U /*!< 8 bits word length : Start bit, 8 data bits, n stop bits */ +#define LL_USART_DATAWIDTH_9B USART_CR1_M /*!< 9 bits word length : Start bit, 9 data bits, n stop bits */ +#endif /* USART_7BITS_SUPPORT */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_OVERSAMPLING Oversampling + * @{ + */ +#define LL_USART_OVERSAMPLING_16 0x00000000U /*!< Oversampling by 16 */ +#define LL_USART_OVERSAMPLING_8 USART_CR1_OVER8 /*!< Oversampling by 8 */ +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup USART_LL_EC_CLOCK Clock Signal + * @{ + */ + +#define LL_USART_CLOCK_DISABLE 0x00000000U /*!< Clock signal not provided */ +#define LL_USART_CLOCK_ENABLE USART_CR2_CLKEN /*!< Clock signal provided */ +/** + * @} + */ +#endif /*USE_FULL_LL_DRIVER*/ + +/** @defgroup USART_LL_EC_LASTCLKPULSE Last Clock Pulse + * @{ + */ +#define LL_USART_LASTCLKPULSE_NO_OUTPUT 0x00000000U /*!< The clock pulse of the last data bit is not output to the SCLK pin */ +#define LL_USART_LASTCLKPULSE_OUTPUT USART_CR2_LBCL /*!< The clock pulse of the last data bit is output to the SCLK pin */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_PHASE Clock Phase + * @{ + */ +#define LL_USART_PHASE_1EDGE 0x00000000U /*!< The first clock transition is the first data capture edge */ +#define LL_USART_PHASE_2EDGE USART_CR2_CPHA /*!< The second clock transition is the first data capture edge */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_POLARITY Clock Polarity + * @{ + */ +#define LL_USART_POLARITY_LOW 0x00000000U /*!< Steady low value on SCLK pin outside transmission window*/ +#define LL_USART_POLARITY_HIGH USART_CR2_CPOL /*!< Steady high value on SCLK pin outside transmission window */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_STOPBITS Stop Bits + * @{ + */ +#define LL_USART_STOPBITS_0_5 USART_CR2_STOP_0 /*!< 0.5 stop bit */ +#define LL_USART_STOPBITS_1 0x00000000U /*!< 1 stop bit */ +#define LL_USART_STOPBITS_1_5 (USART_CR2_STOP_0 | USART_CR2_STOP_1) /*!< 1.5 stop bits */ +#define LL_USART_STOPBITS_2 USART_CR2_STOP_1 /*!< 2 stop bits */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_TXRX TX RX Pins Swap + * @{ + */ +#define LL_USART_TXRX_STANDARD 0x00000000U /*!< TX/RX pins are used as defined in standard pinout */ +#define LL_USART_TXRX_SWAPPED (USART_CR2_SWAP) /*!< TX and RX pins functions are swapped. */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_RXPIN_LEVEL RX Pin Active Level Inversion + * @{ + */ +#define LL_USART_RXPIN_LEVEL_STANDARD 0x00000000U /*!< RX pin signal works using the standard logic levels */ +#define LL_USART_RXPIN_LEVEL_INVERTED (USART_CR2_RXINV) /*!< RX pin signal values are inverted. */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_TXPIN_LEVEL TX Pin Active Level Inversion + * @{ + */ +#define LL_USART_TXPIN_LEVEL_STANDARD 0x00000000U /*!< TX pin signal works using the standard logic levels */ +#define LL_USART_TXPIN_LEVEL_INVERTED (USART_CR2_TXINV) /*!< TX pin signal values are inverted. */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_BINARY_LOGIC Binary Data Inversion + * @{ + */ +#define LL_USART_BINARY_LOGIC_POSITIVE 0x00000000U /*!< Logical data from the data register are send/received in positive/direct logic. (1=H, 0=L) */ +#define LL_USART_BINARY_LOGIC_NEGATIVE USART_CR2_DATAINV /*!< Logical data from the data register are send/received in negative/inverse logic. (1=L, 0=H). The parity bit is also inverted. */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_BITORDER Bit Order + * @{ + */ +#define LL_USART_BITORDER_LSBFIRST 0x00000000U /*!< data is transmitted/received with data bit 0 first, following the start bit */ +#define LL_USART_BITORDER_MSBFIRST USART_CR2_MSBFIRST /*!< data is transmitted/received with the MSB first, following the start bit */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_AUTOBAUD_DETECT_ON Autobaud Detection + * @{ + */ +#define LL_USART_AUTOBAUD_DETECT_ON_STARTBIT 0x00000000U /*!< Measurement of the start bit is used to detect the baud rate */ +#define LL_USART_AUTOBAUD_DETECT_ON_FALLINGEDGE USART_CR2_ABRMODE_0 /*!< Falling edge to falling edge measurement. Received frame must start with a single bit = 1 -> Frame = Start10xxxxxx */ +#define LL_USART_AUTOBAUD_DETECT_ON_7F_FRAME USART_CR2_ABRMODE_1 /*!< 0x7F frame detection */ +#define LL_USART_AUTOBAUD_DETECT_ON_55_FRAME (USART_CR2_ABRMODE_1 | USART_CR2_ABRMODE_0) /*!< 0x55 frame detection */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_ADDRESS_DETECT Address Length Detection + * @{ + */ +#define LL_USART_ADDRESS_DETECT_4B 0x00000000U /*!< 4-bit address detection method selected */ +#define LL_USART_ADDRESS_DETECT_7B USART_CR2_ADDM7 /*!< 7-bit address detection (in 8-bit data mode) method selected */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_HWCONTROL Hardware Control + * @{ + */ +#define LL_USART_HWCONTROL_NONE 0x00000000U /*!< CTS and RTS hardware flow control disabled */ +#define LL_USART_HWCONTROL_RTS USART_CR3_RTSE /*!< RTS output enabled, data is only requested when there is space in the receive buffer */ +#define LL_USART_HWCONTROL_CTS USART_CR3_CTSE /*!< CTS mode enabled, data is only transmitted when the nCTS input is asserted (tied to 0) */ +#define LL_USART_HWCONTROL_RTS_CTS (USART_CR3_RTSE | USART_CR3_CTSE) /*!< CTS and RTS hardware flow control enabled */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_WAKEUP_ON Wakeup Activation + * @{ + */ +#define LL_USART_WAKEUP_ON_ADDRESS 0x00000000U /*!< Wake up active on address match */ +#define LL_USART_WAKEUP_ON_STARTBIT USART_CR3_WUS_1 /*!< Wake up active on Start bit detection */ +#define LL_USART_WAKEUP_ON_RXNE (USART_CR3_WUS_0 | USART_CR3_WUS_1) /*!< Wake up active on RXNE */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_IRDA_POWER IrDA Power + * @{ + */ +#define LL_USART_IRDA_POWER_NORMAL 0x00000000U /*!< IrDA normal power mode */ +#define LL_USART_IRDA_POWER_LOW USART_CR3_IRLP /*!< IrDA low power mode */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_LINBREAK_DETECT LIN Break Detection Length + * @{ + */ +#define LL_USART_LINBREAK_DETECT_10B 0x00000000U /*!< 10-bit break detection method selected */ +#define LL_USART_LINBREAK_DETECT_11B USART_CR2_LBDL /*!< 11-bit break detection method selected */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_DE_POLARITY Driver Enable Polarity + * @{ + */ +#define LL_USART_DE_POLARITY_HIGH 0x00000000U /*!< DE signal is active high */ +#define LL_USART_DE_POLARITY_LOW USART_CR3_DEP /*!< DE signal is active low */ +/** + * @} + */ + +/** @defgroup USART_LL_EC_DMA_REG_DATA DMA Register Data + * @{ + */ +#define LL_USART_DMA_REG_DATA_TRANSMIT 0x00000000U /*!< Get address of data register used for transmission */ +#define LL_USART_DMA_REG_DATA_RECEIVE 0x00000001U /*!< Get address of data register used for reception */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ +/** @defgroup USART_LL_Exported_Macros USART Exported Macros + * @{ + */ + +/** @defgroup USART_LL_EM_WRITE_READ Common Write and read registers Macros + * @{ + */ + +/** + * @brief Write a value in USART register + * @param __INSTANCE__ USART Instance + * @param __REG__ Register to be written + * @param __VALUE__ Value to be written in the register + * @retval None + */ +#define LL_USART_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) + +/** + * @brief Read a value in USART register + * @param __INSTANCE__ USART Instance + * @param __REG__ Register to be read + * @retval Register value + */ +#define LL_USART_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) +/** + * @} + */ + +/** @defgroup USART_LL_EM_Exported_Macros_Helper Exported_Macros_Helper + * @{ + */ + +/** + * @brief Compute USARTDIV value according to Peripheral Clock and + * expected Baud Rate in 8 bits sampling mode (32 bits value of USARTDIV is returned) + * @param __PERIPHCLK__ Peripheral Clock frequency used for USART instance + * @param __BAUDRATE__ Baud rate value to achieve + * @retval USARTDIV value to be used for BRR register filling in OverSampling_8 case + */ +#define __LL_USART_DIV_SAMPLING8(__PERIPHCLK__, __BAUDRATE__) ((((__PERIPHCLK__)*2U)\ + + ((__BAUDRATE__)/2U))/(__BAUDRATE__)) + +/** + * @brief Compute USARTDIV value according to Peripheral Clock and + * expected Baud Rate in 16 bits sampling mode (32 bits value of USARTDIV is returned) + * @param __PERIPHCLK__ Peripheral Clock frequency used for USART instance + * @param __BAUDRATE__ Baud rate value to achieve + * @retval USARTDIV value to be used for BRR register filling in OverSampling_16 case + */ +#define __LL_USART_DIV_SAMPLING16(__PERIPHCLK__, __BAUDRATE__) (((__PERIPHCLK__) + ((__BAUDRATE__)/2U))/(__BAUDRATE__)) + +/** + * @} + */ + +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup USART_LL_Exported_Functions USART Exported Functions + * @{ + */ + +/** @defgroup USART_LL_EF_Configuration Configuration functions + * @{ + */ + +/** + * @brief USART Enable + * @rmtoll CR1 UE LL_USART_Enable + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_Enable(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR1, USART_CR1_UE); +} + +/** + * @brief USART Disable (all USART prescalers and outputs are disabled) + * @note When USART is disabled, USART prescalers and outputs are stopped immediately, + * and current operations are discarded. The configuration of the USART is kept, but all the status + * flags, in the USARTx_ISR are set to their default values. + * @rmtoll CR1 UE LL_USART_Disable + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_Disable(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR1, USART_CR1_UE); +} + +/** + * @brief Indicate if USART is enabled + * @rmtoll CR1 UE LL_USART_IsEnabled + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabled(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_UE) == (USART_CR1_UE)) ? 1UL : 0UL); +} + +/** + * @brief USART enabled in STOP Mode. + * @note When this function is enabled, USART is able to wake up the MCU from Stop mode, provided that + * USART clock selection is HSI or LSE in RCC. + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll CR1 UESM LL_USART_EnableInStopMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableInStopMode(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_UESM); +} + +/** + * @brief USART disabled in STOP Mode. + * @note When this function is disabled, USART is not able to wake up the MCU from Stop mode + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll CR1 UESM LL_USART_DisableInStopMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableInStopMode(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_UESM); +} + +/** + * @brief Indicate if USART is enabled in STOP Mode (able to wake up MCU from Stop mode or not) + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll CR1 UESM LL_USART_IsEnabledInStopMode + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledInStopMode(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_UESM) == (USART_CR1_UESM)) ? 1UL : 0UL); +} + +/** + * @brief Receiver Enable (Receiver is enabled and begins searching for a start bit) + * @rmtoll CR1 RE LL_USART_EnableDirectionRx + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableDirectionRx(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_RE); +} + +/** + * @brief Receiver Disable + * @rmtoll CR1 RE LL_USART_DisableDirectionRx + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableDirectionRx(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_RE); +} + +/** + * @brief Transmitter Enable + * @rmtoll CR1 TE LL_USART_EnableDirectionTx + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableDirectionTx(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_TE); +} + +/** + * @brief Transmitter Disable + * @rmtoll CR1 TE LL_USART_DisableDirectionTx + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableDirectionTx(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_TE); +} + +/** + * @brief Configure simultaneously enabled/disabled states + * of Transmitter and Receiver + * @rmtoll CR1 RE LL_USART_SetTransferDirection\n + * CR1 TE LL_USART_SetTransferDirection + * @param USARTx USART Instance + * @param TransferDirection This parameter can be one of the following values: + * @arg @ref LL_USART_DIRECTION_NONE + * @arg @ref LL_USART_DIRECTION_RX + * @arg @ref LL_USART_DIRECTION_TX + * @arg @ref LL_USART_DIRECTION_TX_RX + * @retval None + */ +__STATIC_INLINE void LL_USART_SetTransferDirection(USART_TypeDef *USARTx, uint32_t TransferDirection) +{ + ATOMIC_MODIFY_REG(USARTx->CR1, USART_CR1_RE | USART_CR1_TE, TransferDirection); +} + +/** + * @brief Return enabled/disabled states of Transmitter and Receiver + * @rmtoll CR1 RE LL_USART_GetTransferDirection\n + * CR1 TE LL_USART_GetTransferDirection + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_DIRECTION_NONE + * @arg @ref LL_USART_DIRECTION_RX + * @arg @ref LL_USART_DIRECTION_TX + * @arg @ref LL_USART_DIRECTION_TX_RX + */ +__STATIC_INLINE uint32_t LL_USART_GetTransferDirection(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_RE | USART_CR1_TE)); +} + +/** + * @brief Configure Parity (enabled/disabled and parity mode if enabled). + * @note This function selects if hardware parity control (generation and detection) is enabled or disabled. + * When the parity control is enabled (Odd or Even), computed parity bit is inserted at the MSB position + * (9th or 8th bit depending on data width) and parity is checked on the received data. + * @rmtoll CR1 PS LL_USART_SetParity\n + * CR1 PCE LL_USART_SetParity + * @param USARTx USART Instance + * @param Parity This parameter can be one of the following values: + * @arg @ref LL_USART_PARITY_NONE + * @arg @ref LL_USART_PARITY_EVEN + * @arg @ref LL_USART_PARITY_ODD + * @retval None + */ +__STATIC_INLINE void LL_USART_SetParity(USART_TypeDef *USARTx, uint32_t Parity) +{ + MODIFY_REG(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE, Parity); +} + +/** + * @brief Return Parity configuration (enabled/disabled and parity mode if enabled) + * @rmtoll CR1 PS LL_USART_GetParity\n + * CR1 PCE LL_USART_GetParity + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_PARITY_NONE + * @arg @ref LL_USART_PARITY_EVEN + * @arg @ref LL_USART_PARITY_ODD + */ +__STATIC_INLINE uint32_t LL_USART_GetParity(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE)); +} + +/** + * @brief Set Receiver Wake Up method from Mute mode. + * @rmtoll CR1 WAKE LL_USART_SetWakeUpMethod + * @param USARTx USART Instance + * @param Method This parameter can be one of the following values: + * @arg @ref LL_USART_WAKEUP_IDLELINE + * @arg @ref LL_USART_WAKEUP_ADDRESSMARK + * @retval None + */ +__STATIC_INLINE void LL_USART_SetWakeUpMethod(USART_TypeDef *USARTx, uint32_t Method) +{ + MODIFY_REG(USARTx->CR1, USART_CR1_WAKE, Method); +} + +/** + * @brief Return Receiver Wake Up method from Mute mode + * @rmtoll CR1 WAKE LL_USART_GetWakeUpMethod + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_WAKEUP_IDLELINE + * @arg @ref LL_USART_WAKEUP_ADDRESSMARK + */ +__STATIC_INLINE uint32_t LL_USART_GetWakeUpMethod(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_WAKE)); +} + +/** + * @brief Set Word length (i.e. nb of data bits, excluding start and stop bits) + * @rmtoll CR1 M0 LL_USART_SetDataWidth\n + * CR1 M1 LL_USART_SetDataWidth + * @param USARTx USART Instance + * @param DataWidth This parameter can be one of the following values: + * @arg @ref LL_USART_DATAWIDTH_7B (*) + * @arg @ref LL_USART_DATAWIDTH_8B + * @arg @ref LL_USART_DATAWIDTH_9B + * + * (*) Values not available on all devices + * @retval None + */ +__STATIC_INLINE void LL_USART_SetDataWidth(USART_TypeDef *USARTx, uint32_t DataWidth) +{ + MODIFY_REG(USARTx->CR1, USART_CR1_M, DataWidth); +} + +/** + * @brief Return Word length (i.e. nb of data bits, excluding start and stop bits) + * @rmtoll CR1 M0 LL_USART_GetDataWidth\n + * CR1 M1 LL_USART_GetDataWidth + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_DATAWIDTH_7B (*) + * @arg @ref LL_USART_DATAWIDTH_8B + * @arg @ref LL_USART_DATAWIDTH_9B + * + * (*) Values not available on all devices + */ +__STATIC_INLINE uint32_t LL_USART_GetDataWidth(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_M)); +} + +/** + * @brief Allow switch between Mute Mode and Active mode + * @rmtoll CR1 MME LL_USART_EnableMuteMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableMuteMode(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_MME); +} + +/** + * @brief Prevent Mute Mode use. Set Receiver in active mode permanently. + * @rmtoll CR1 MME LL_USART_DisableMuteMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableMuteMode(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_MME); +} + +/** + * @brief Indicate if switch between Mute Mode and Active mode is allowed + * @rmtoll CR1 MME LL_USART_IsEnabledMuteMode + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledMuteMode(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_MME) == (USART_CR1_MME)) ? 1UL : 0UL); +} + +/** + * @brief Set Oversampling to 8-bit or 16-bit mode + * @rmtoll CR1 OVER8 LL_USART_SetOverSampling + * @param USARTx USART Instance + * @param OverSampling This parameter can be one of the following values: + * @arg @ref LL_USART_OVERSAMPLING_16 + * @arg @ref LL_USART_OVERSAMPLING_8 + * @retval None + */ +__STATIC_INLINE void LL_USART_SetOverSampling(USART_TypeDef *USARTx, uint32_t OverSampling) +{ + MODIFY_REG(USARTx->CR1, USART_CR1_OVER8, OverSampling); +} + +/** + * @brief Return Oversampling mode + * @rmtoll CR1 OVER8 LL_USART_GetOverSampling + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_OVERSAMPLING_16 + * @arg @ref LL_USART_OVERSAMPLING_8 + */ +__STATIC_INLINE uint32_t LL_USART_GetOverSampling(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_OVER8)); +} + +/** + * @brief Configure if Clock pulse of the last data bit is output to the SCLK pin or not + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 LBCL LL_USART_SetLastClkPulseOutput + * @param USARTx USART Instance + * @param LastBitClockPulse This parameter can be one of the following values: + * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT + * @arg @ref LL_USART_LASTCLKPULSE_OUTPUT + * @retval None + */ +__STATIC_INLINE void LL_USART_SetLastClkPulseOutput(USART_TypeDef *USARTx, uint32_t LastBitClockPulse) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_LBCL, LastBitClockPulse); +} + +/** + * @brief Retrieve Clock pulse of the last data bit output configuration + * (Last bit Clock pulse output to the SCLK pin or not) + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 LBCL LL_USART_GetLastClkPulseOutput + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT + * @arg @ref LL_USART_LASTCLKPULSE_OUTPUT + */ +__STATIC_INLINE uint32_t LL_USART_GetLastClkPulseOutput(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBCL)); +} + +/** + * @brief Select the phase of the clock output on the SCLK pin in synchronous mode + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 CPHA LL_USART_SetClockPhase + * @param USARTx USART Instance + * @param ClockPhase This parameter can be one of the following values: + * @arg @ref LL_USART_PHASE_1EDGE + * @arg @ref LL_USART_PHASE_2EDGE + * @retval None + */ +__STATIC_INLINE void LL_USART_SetClockPhase(USART_TypeDef *USARTx, uint32_t ClockPhase) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_CPHA, ClockPhase); +} + +/** + * @brief Return phase of the clock output on the SCLK pin in synchronous mode + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 CPHA LL_USART_GetClockPhase + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_PHASE_1EDGE + * @arg @ref LL_USART_PHASE_2EDGE + */ +__STATIC_INLINE uint32_t LL_USART_GetClockPhase(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPHA)); +} + +/** + * @brief Select the polarity of the clock output on the SCLK pin in synchronous mode + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 CPOL LL_USART_SetClockPolarity + * @param USARTx USART Instance + * @param ClockPolarity This parameter can be one of the following values: + * @arg @ref LL_USART_POLARITY_LOW + * @arg @ref LL_USART_POLARITY_HIGH + * @retval None + */ +__STATIC_INLINE void LL_USART_SetClockPolarity(USART_TypeDef *USARTx, uint32_t ClockPolarity) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_CPOL, ClockPolarity); +} + +/** + * @brief Return polarity of the clock output on the SCLK pin in synchronous mode + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 CPOL LL_USART_GetClockPolarity + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_POLARITY_LOW + * @arg @ref LL_USART_POLARITY_HIGH + */ +__STATIC_INLINE uint32_t LL_USART_GetClockPolarity(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_CPOL)); +} + +/** + * @brief Configure Clock signal format (Phase Polarity and choice about output of last bit clock pulse) + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @note Call of this function is equivalent to following function call sequence : + * - Clock Phase configuration using @ref LL_USART_SetClockPhase() function + * - Clock Polarity configuration using @ref LL_USART_SetClockPolarity() function + * - Output of Last bit Clock pulse configuration using @ref LL_USART_SetLastClkPulseOutput() function + * @rmtoll CR2 CPHA LL_USART_ConfigClock\n + * CR2 CPOL LL_USART_ConfigClock\n + * CR2 LBCL LL_USART_ConfigClock + * @param USARTx USART Instance + * @param Phase This parameter can be one of the following values: + * @arg @ref LL_USART_PHASE_1EDGE + * @arg @ref LL_USART_PHASE_2EDGE + * @param Polarity This parameter can be one of the following values: + * @arg @ref LL_USART_POLARITY_LOW + * @arg @ref LL_USART_POLARITY_HIGH + * @param LBCPOutput This parameter can be one of the following values: + * @arg @ref LL_USART_LASTCLKPULSE_NO_OUTPUT + * @arg @ref LL_USART_LASTCLKPULSE_OUTPUT + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigClock(USART_TypeDef *USARTx, uint32_t Phase, uint32_t Polarity, uint32_t LBCPOutput) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_CPHA | USART_CR2_CPOL | USART_CR2_LBCL, Phase | Polarity | LBCPOutput); +} + +/** + * @brief Enable Clock output on SCLK pin + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 CLKEN LL_USART_EnableSCLKOutput + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableSCLKOutput(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR2, USART_CR2_CLKEN); +} + +/** + * @brief Disable Clock output on SCLK pin + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 CLKEN LL_USART_DisableSCLKOutput + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableSCLKOutput(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR2, USART_CR2_CLKEN); +} + +/** + * @brief Indicate if Clock output on SCLK pin is enabled + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @rmtoll CR2 CLKEN LL_USART_IsEnabledSCLKOutput + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledSCLKOutput(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR2, USART_CR2_CLKEN) == (USART_CR2_CLKEN)) ? 1UL : 0UL); +} + +/** + * @brief Set the length of the stop bits + * @rmtoll CR2 STOP LL_USART_SetStopBitsLength + * @param USARTx USART Instance + * @param StopBits This parameter can be one of the following values: + * @arg @ref LL_USART_STOPBITS_0_5 + * @arg @ref LL_USART_STOPBITS_1 + * @arg @ref LL_USART_STOPBITS_1_5 + * @arg @ref LL_USART_STOPBITS_2 + * @retval None + */ +__STATIC_INLINE void LL_USART_SetStopBitsLength(USART_TypeDef *USARTx, uint32_t StopBits) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_STOP, StopBits); +} + +/** + * @brief Retrieve the length of the stop bits + * @rmtoll CR2 STOP LL_USART_GetStopBitsLength + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_STOPBITS_0_5 + * @arg @ref LL_USART_STOPBITS_1 + * @arg @ref LL_USART_STOPBITS_1_5 + * @arg @ref LL_USART_STOPBITS_2 + */ +__STATIC_INLINE uint32_t LL_USART_GetStopBitsLength(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_STOP)); +} + +/** + * @brief Configure Character frame format (Datawidth, Parity control, Stop Bits) + * @note Call of this function is equivalent to following function call sequence : + * - Data Width configuration using @ref LL_USART_SetDataWidth() function + * - Parity Control and mode configuration using @ref LL_USART_SetParity() function + * - Stop bits configuration using @ref LL_USART_SetStopBitsLength() function + * @rmtoll CR1 PS LL_USART_ConfigCharacter\n + * CR1 PCE LL_USART_ConfigCharacter\n + * CR1 M0 LL_USART_ConfigCharacter\n + * CR1 M1 LL_USART_ConfigCharacter\n + * CR2 STOP LL_USART_ConfigCharacter + * @param USARTx USART Instance + * @param DataWidth This parameter can be one of the following values: + * @arg @ref LL_USART_DATAWIDTH_7B (*) + * @arg @ref LL_USART_DATAWIDTH_8B + * @arg @ref LL_USART_DATAWIDTH_9B + * @param Parity This parameter can be one of the following values: + * @arg @ref LL_USART_PARITY_NONE + * @arg @ref LL_USART_PARITY_EVEN + * @arg @ref LL_USART_PARITY_ODD + * @param StopBits This parameter can be one of the following values: + * @arg @ref LL_USART_STOPBITS_0_5 + * @arg @ref LL_USART_STOPBITS_1 + * @arg @ref LL_USART_STOPBITS_1_5 + * @arg @ref LL_USART_STOPBITS_2 + * + * (*) Values not available on all devices + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigCharacter(USART_TypeDef *USARTx, uint32_t DataWidth, uint32_t Parity, + uint32_t StopBits) +{ + MODIFY_REG(USARTx->CR1, USART_CR1_PS | USART_CR1_PCE | USART_CR1_M, Parity | DataWidth); + MODIFY_REG(USARTx->CR2, USART_CR2_STOP, StopBits); +} + +/** + * @brief Configure TX/RX pins swapping setting. + * @rmtoll CR2 SWAP LL_USART_SetTXRXSwap + * @param USARTx USART Instance + * @param SwapConfig This parameter can be one of the following values: + * @arg @ref LL_USART_TXRX_STANDARD + * @arg @ref LL_USART_TXRX_SWAPPED + * @retval None + */ +__STATIC_INLINE void LL_USART_SetTXRXSwap(USART_TypeDef *USARTx, uint32_t SwapConfig) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_SWAP, SwapConfig); +} + +/** + * @brief Retrieve TX/RX pins swapping configuration. + * @rmtoll CR2 SWAP LL_USART_GetTXRXSwap + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_TXRX_STANDARD + * @arg @ref LL_USART_TXRX_SWAPPED + */ +__STATIC_INLINE uint32_t LL_USART_GetTXRXSwap(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_SWAP)); +} + +/** + * @brief Configure RX pin active level logic + * @rmtoll CR2 RXINV LL_USART_SetRXPinLevel + * @param USARTx USART Instance + * @param PinInvMethod This parameter can be one of the following values: + * @arg @ref LL_USART_RXPIN_LEVEL_STANDARD + * @arg @ref LL_USART_RXPIN_LEVEL_INVERTED + * @retval None + */ +__STATIC_INLINE void LL_USART_SetRXPinLevel(USART_TypeDef *USARTx, uint32_t PinInvMethod) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_RXINV, PinInvMethod); +} + +/** + * @brief Retrieve RX pin active level logic configuration + * @rmtoll CR2 RXINV LL_USART_GetRXPinLevel + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_RXPIN_LEVEL_STANDARD + * @arg @ref LL_USART_RXPIN_LEVEL_INVERTED + */ +__STATIC_INLINE uint32_t LL_USART_GetRXPinLevel(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_RXINV)); +} + +/** + * @brief Configure TX pin active level logic + * @rmtoll CR2 TXINV LL_USART_SetTXPinLevel + * @param USARTx USART Instance + * @param PinInvMethod This parameter can be one of the following values: + * @arg @ref LL_USART_TXPIN_LEVEL_STANDARD + * @arg @ref LL_USART_TXPIN_LEVEL_INVERTED + * @retval None + */ +__STATIC_INLINE void LL_USART_SetTXPinLevel(USART_TypeDef *USARTx, uint32_t PinInvMethod) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_TXINV, PinInvMethod); +} + +/** + * @brief Retrieve TX pin active level logic configuration + * @rmtoll CR2 TXINV LL_USART_GetTXPinLevel + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_TXPIN_LEVEL_STANDARD + * @arg @ref LL_USART_TXPIN_LEVEL_INVERTED + */ +__STATIC_INLINE uint32_t LL_USART_GetTXPinLevel(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_TXINV)); +} + +/** + * @brief Configure Binary data logic. + * @note Allow to define how Logical data from the data register are send/received : + * either in positive/direct logic (1=H, 0=L) or in negative/inverse logic (1=L, 0=H) + * @rmtoll CR2 DATAINV LL_USART_SetBinaryDataLogic + * @param USARTx USART Instance + * @param DataLogic This parameter can be one of the following values: + * @arg @ref LL_USART_BINARY_LOGIC_POSITIVE + * @arg @ref LL_USART_BINARY_LOGIC_NEGATIVE + * @retval None + */ +__STATIC_INLINE void LL_USART_SetBinaryDataLogic(USART_TypeDef *USARTx, uint32_t DataLogic) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_DATAINV, DataLogic); +} + +/** + * @brief Retrieve Binary data configuration + * @rmtoll CR2 DATAINV LL_USART_GetBinaryDataLogic + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_BINARY_LOGIC_POSITIVE + * @arg @ref LL_USART_BINARY_LOGIC_NEGATIVE + */ +__STATIC_INLINE uint32_t LL_USART_GetBinaryDataLogic(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_DATAINV)); +} + +/** + * @brief Configure transfer bit order (either Less or Most Significant Bit First) + * @note MSB First means data is transmitted/received with the MSB first, following the start bit. + * LSB First means data is transmitted/received with data bit 0 first, following the start bit. + * @rmtoll CR2 MSBFIRST LL_USART_SetTransferBitOrder + * @param USARTx USART Instance + * @param BitOrder This parameter can be one of the following values: + * @arg @ref LL_USART_BITORDER_LSBFIRST + * @arg @ref LL_USART_BITORDER_MSBFIRST + * @retval None + */ +__STATIC_INLINE void LL_USART_SetTransferBitOrder(USART_TypeDef *USARTx, uint32_t BitOrder) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_MSBFIRST, BitOrder); +} + +/** + * @brief Return transfer bit order (either Less or Most Significant Bit First) + * @note MSB First means data is transmitted/received with the MSB first, following the start bit. + * LSB First means data is transmitted/received with data bit 0 first, following the start bit. + * @rmtoll CR2 MSBFIRST LL_USART_GetTransferBitOrder + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_BITORDER_LSBFIRST + * @arg @ref LL_USART_BITORDER_MSBFIRST + */ +__STATIC_INLINE uint32_t LL_USART_GetTransferBitOrder(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_MSBFIRST)); +} + +/** + * @brief Enable Auto Baud-Rate Detection + * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not + * Auto Baud Rate detection feature is supported by the USARTx instance. + * @rmtoll CR2 ABREN LL_USART_EnableAutoBaudRate + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableAutoBaudRate(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR2, USART_CR2_ABREN); +} + +/** + * @brief Disable Auto Baud-Rate Detection + * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not + * Auto Baud Rate detection feature is supported by the USARTx instance. + * @rmtoll CR2 ABREN LL_USART_DisableAutoBaudRate + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableAutoBaudRate(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR2, USART_CR2_ABREN); +} + +/** + * @brief Indicate if Auto Baud-Rate Detection mechanism is enabled + * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not + * Auto Baud Rate detection feature is supported by the USARTx instance. + * @rmtoll CR2 ABREN LL_USART_IsEnabledAutoBaud + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledAutoBaud(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR2, USART_CR2_ABREN) == (USART_CR2_ABREN)) ? 1UL : 0UL); +} + +/** + * @brief Set Auto Baud-Rate mode bits + * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not + * Auto Baud Rate detection feature is supported by the USARTx instance. + * @rmtoll CR2 ABRMODE LL_USART_SetAutoBaudRateMode + * @param USARTx USART Instance + * @param AutoBaudRateMode This parameter can be one of the following values: + * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_STARTBIT + * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_FALLINGEDGE + * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_7F_FRAME + * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_55_FRAME + * @retval None + */ +__STATIC_INLINE void LL_USART_SetAutoBaudRateMode(USART_TypeDef *USARTx, uint32_t AutoBaudRateMode) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_ABRMODE, AutoBaudRateMode); +} + +/** + * @brief Return Auto Baud-Rate mode + * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not + * Auto Baud Rate detection feature is supported by the USARTx instance. + * @rmtoll CR2 ABRMODE LL_USART_GetAutoBaudRateMode + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_STARTBIT + * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_FALLINGEDGE + * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_7F_FRAME + * @arg @ref LL_USART_AUTOBAUD_DETECT_ON_55_FRAME + */ +__STATIC_INLINE uint32_t LL_USART_GetAutoBaudRateMode(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ABRMODE)); +} + +/** + * @brief Enable Receiver Timeout + * @rmtoll CR2 RTOEN LL_USART_EnableRxTimeout + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableRxTimeout(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR2, USART_CR2_RTOEN); +} + +/** + * @brief Disable Receiver Timeout + * @rmtoll CR2 RTOEN LL_USART_DisableRxTimeout + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableRxTimeout(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR2, USART_CR2_RTOEN); +} + +/** + * @brief Indicate if Receiver Timeout feature is enabled + * @rmtoll CR2 RTOEN LL_USART_IsEnabledRxTimeout + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledRxTimeout(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR2, USART_CR2_RTOEN) == (USART_CR2_RTOEN)) ? 1UL : 0UL); +} + +/** + * @brief Set Address of the USART node. + * @note This is used in multiprocessor communication during Mute mode or Stop mode, + * for wake up with address mark detection. + * @note 4bits address node is used when 4-bit Address Detection is selected in ADDM7. + * (b7-b4 should be set to 0) + * 8bits address node is used when 7-bit Address Detection is selected in ADDM7. + * (This is used in multiprocessor communication during Mute mode or Stop mode, + * for wake up with 7-bit address mark detection. + * The MSB of the character sent by the transmitter should be equal to 1. + * It may also be used for character detection during normal reception, + * Mute mode inactive (for example, end of block detection in ModBus protocol). + * In this case, the whole received character (8-bit) is compared to the ADD[7:0] + * value and CMF flag is set on match) + * @rmtoll CR2 ADD LL_USART_ConfigNodeAddress\n + * CR2 ADDM7 LL_USART_ConfigNodeAddress + * @param USARTx USART Instance + * @param AddressLen This parameter can be one of the following values: + * @arg @ref LL_USART_ADDRESS_DETECT_4B + * @arg @ref LL_USART_ADDRESS_DETECT_7B + * @param NodeAddress 4 or 7 bit Address of the USART node. + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigNodeAddress(USART_TypeDef *USARTx, uint32_t AddressLen, uint32_t NodeAddress) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_ADD | USART_CR2_ADDM7, + (uint32_t)(AddressLen | (NodeAddress << USART_CR2_ADD_Pos))); +} + +/** + * @brief Return 8 bit Address of the USART node as set in ADD field of CR2. + * @note If 4-bit Address Detection is selected in ADDM7, + * only 4bits (b3-b0) of returned value are relevant (b31-b4 are not relevant) + * If 7-bit Address Detection is selected in ADDM7, + * only 8bits (b7-b0) of returned value are relevant (b31-b8 are not relevant) + * @rmtoll CR2 ADD LL_USART_GetNodeAddress + * @param USARTx USART Instance + * @retval Address of the USART node (Value between Min_Data=0 and Max_Data=255) + */ +__STATIC_INLINE uint32_t LL_USART_GetNodeAddress(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ADD) >> USART_CR2_ADD_Pos); +} + +/** + * @brief Return Length of Node Address used in Address Detection mode (7-bit or 4-bit) + * @rmtoll CR2 ADDM7 LL_USART_GetNodeAddressLen + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_ADDRESS_DETECT_4B + * @arg @ref LL_USART_ADDRESS_DETECT_7B + */ +__STATIC_INLINE uint32_t LL_USART_GetNodeAddressLen(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_ADDM7)); +} + +/** + * @brief Enable RTS HW Flow Control + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 RTSE LL_USART_EnableRTSHWFlowCtrl + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableRTSHWFlowCtrl(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_RTSE); +} + +/** + * @brief Disable RTS HW Flow Control + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 RTSE LL_USART_DisableRTSHWFlowCtrl + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableRTSHWFlowCtrl(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_RTSE); +} + +/** + * @brief Enable CTS HW Flow Control + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 CTSE LL_USART_EnableCTSHWFlowCtrl + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableCTSHWFlowCtrl(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_CTSE); +} + +/** + * @brief Disable CTS HW Flow Control + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 CTSE LL_USART_DisableCTSHWFlowCtrl + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableCTSHWFlowCtrl(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_CTSE); +} + +/** + * @brief Configure HW Flow Control mode (both CTS and RTS) + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 RTSE LL_USART_SetHWFlowCtrl\n + * CR3 CTSE LL_USART_SetHWFlowCtrl + * @param USARTx USART Instance + * @param HardwareFlowControl This parameter can be one of the following values: + * @arg @ref LL_USART_HWCONTROL_NONE + * @arg @ref LL_USART_HWCONTROL_RTS + * @arg @ref LL_USART_HWCONTROL_CTS + * @arg @ref LL_USART_HWCONTROL_RTS_CTS + * @retval None + */ +__STATIC_INLINE void LL_USART_SetHWFlowCtrl(USART_TypeDef *USARTx, uint32_t HardwareFlowControl) +{ + MODIFY_REG(USARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE, HardwareFlowControl); +} + +/** + * @brief Return HW Flow Control configuration (both CTS and RTS) + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 RTSE LL_USART_GetHWFlowCtrl\n + * CR3 CTSE LL_USART_GetHWFlowCtrl + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_HWCONTROL_NONE + * @arg @ref LL_USART_HWCONTROL_RTS + * @arg @ref LL_USART_HWCONTROL_CTS + * @arg @ref LL_USART_HWCONTROL_RTS_CTS + */ +__STATIC_INLINE uint32_t LL_USART_GetHWFlowCtrl(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_RTSE | USART_CR3_CTSE)); +} + +/** + * @brief Enable One bit sampling method + * @rmtoll CR3 ONEBIT LL_USART_EnableOneBitSamp + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableOneBitSamp(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_ONEBIT); +} + +/** + * @brief Disable One bit sampling method + * @rmtoll CR3 ONEBIT LL_USART_DisableOneBitSamp + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableOneBitSamp(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_ONEBIT); +} + +/** + * @brief Indicate if One bit sampling method is enabled + * @rmtoll CR3 ONEBIT LL_USART_IsEnabledOneBitSamp + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledOneBitSamp(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_ONEBIT) == (USART_CR3_ONEBIT)) ? 1UL : 0UL); +} + +/** + * @brief Enable Overrun detection + * @rmtoll CR3 OVRDIS LL_USART_EnableOverrunDetect + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableOverrunDetect(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_OVRDIS); +} + +/** + * @brief Disable Overrun detection + * @rmtoll CR3 OVRDIS LL_USART_DisableOverrunDetect + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableOverrunDetect(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_OVRDIS); +} + +/** + * @brief Indicate if Overrun detection is enabled + * @rmtoll CR3 OVRDIS LL_USART_IsEnabledOverrunDetect + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledOverrunDetect(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_OVRDIS) != USART_CR3_OVRDIS) ? 1UL : 0UL); +} + +/** + * @brief Select event type for Wake UP Interrupt Flag (WUS[1:0] bits) + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll CR3 WUS LL_USART_SetWKUPType + * @param USARTx USART Instance + * @param Type This parameter can be one of the following values: + * @arg @ref LL_USART_WAKEUP_ON_ADDRESS + * @arg @ref LL_USART_WAKEUP_ON_STARTBIT + * @arg @ref LL_USART_WAKEUP_ON_RXNE + * @retval None + */ +__STATIC_INLINE void LL_USART_SetWKUPType(USART_TypeDef *USARTx, uint32_t Type) +{ + MODIFY_REG(USARTx->CR3, USART_CR3_WUS, Type); +} + +/** + * @brief Return event type for Wake UP Interrupt Flag (WUS[1:0] bits) + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll CR3 WUS LL_USART_GetWKUPType + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_WAKEUP_ON_ADDRESS + * @arg @ref LL_USART_WAKEUP_ON_STARTBIT + * @arg @ref LL_USART_WAKEUP_ON_RXNE + */ +__STATIC_INLINE uint32_t LL_USART_GetWKUPType(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_WUS)); +} + +/** + * @brief Configure USART BRR register for achieving expected Baud Rate value. + * @note Compute and set USARTDIV value in BRR Register (full BRR content) + * according to used Peripheral Clock, Oversampling mode, and expected Baud Rate values + * @note Peripheral clock and Baud rate values provided as function parameters should be valid + * (Baud rate value != 0) + * @note In case of oversampling by 16 and 8, BRR content must be greater than or equal to 16d. + * @rmtoll BRR BRR LL_USART_SetBaudRate + * @param USARTx USART Instance + * @param PeriphClk Peripheral Clock + * @param OverSampling This parameter can be one of the following values: + * @arg @ref LL_USART_OVERSAMPLING_16 + * @arg @ref LL_USART_OVERSAMPLING_8 + * @param BaudRate Baud Rate + * @retval None + */ +__STATIC_INLINE void LL_USART_SetBaudRate(USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling, + uint32_t BaudRate) +{ + uint32_t usartdiv; + uint32_t brrtemp; + + if (OverSampling == LL_USART_OVERSAMPLING_8) + { + usartdiv = (uint16_t)(__LL_USART_DIV_SAMPLING8(PeriphClk, BaudRate)); + brrtemp = usartdiv & 0xFFF0U; + brrtemp |= (uint16_t)((usartdiv & (uint16_t)0x000FU) >> 1U); + USARTx->BRR = brrtemp; + } + else + { + USARTx->BRR = (uint16_t)(__LL_USART_DIV_SAMPLING16(PeriphClk, BaudRate)); + } +} + +/** + * @brief Return current Baud Rate value, according to USARTDIV present in BRR register + * (full BRR content), and to used Peripheral Clock and Oversampling mode values + * @note In case of non-initialized or invalid value stored in BRR register, value 0 will be returned. + * @note In case of oversampling by 16 and 8, BRR content must be greater than or equal to 16d. + * @rmtoll BRR BRR LL_USART_GetBaudRate + * @param USARTx USART Instance + * @param PeriphClk Peripheral Clock + * @param OverSampling This parameter can be one of the following values: + * @arg @ref LL_USART_OVERSAMPLING_16 + * @arg @ref LL_USART_OVERSAMPLING_8 + * @retval Baud Rate + */ +__STATIC_INLINE uint32_t LL_USART_GetBaudRate(const USART_TypeDef *USARTx, uint32_t PeriphClk, uint32_t OverSampling) +{ + uint32_t usartdiv; + uint32_t brrresult = 0x0U; + + usartdiv = USARTx->BRR; + + if (usartdiv == 0U) + { + /* Do not perform a division by 0 */ + } + else if (OverSampling == LL_USART_OVERSAMPLING_8) + { + usartdiv = (uint16_t)((usartdiv & 0xFFF0U) | ((usartdiv & 0x0007U) << 1U)) ; + if (usartdiv != 0U) + { + brrresult = (PeriphClk * 2U) / usartdiv; + } + } + else + { + if ((usartdiv & 0xFFFFU) != 0U) + { + brrresult = PeriphClk / usartdiv; + } + } + return (brrresult); +} + +/** + * @brief Set Receiver Time Out Value (expressed in nb of bits duration) + * @rmtoll RTOR RTO LL_USART_SetRxTimeout + * @param USARTx USART Instance + * @param Timeout Value between Min_Data=0x00 and Max_Data=0x00FFFFFF + * @retval None + */ +__STATIC_INLINE void LL_USART_SetRxTimeout(USART_TypeDef *USARTx, uint32_t Timeout) +{ + MODIFY_REG(USARTx->RTOR, USART_RTOR_RTO, Timeout); +} + +/** + * @brief Get Receiver Time Out Value (expressed in nb of bits duration) + * @rmtoll RTOR RTO LL_USART_GetRxTimeout + * @param USARTx USART Instance + * @retval Value between Min_Data=0x00 and Max_Data=0x00FFFFFF + */ +__STATIC_INLINE uint32_t LL_USART_GetRxTimeout(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->RTOR, USART_RTOR_RTO)); +} + +/** + * @brief Set Block Length value in reception + * @rmtoll RTOR BLEN LL_USART_SetBlockLength + * @param USARTx USART Instance + * @param BlockLength Value between Min_Data=0x00 and Max_Data=0xFF + * @retval None + */ +__STATIC_INLINE void LL_USART_SetBlockLength(USART_TypeDef *USARTx, uint32_t BlockLength) +{ + MODIFY_REG(USARTx->RTOR, USART_RTOR_BLEN, BlockLength << USART_RTOR_BLEN_Pos); +} + +/** + * @brief Get Block Length value in reception + * @rmtoll RTOR BLEN LL_USART_GetBlockLength + * @param USARTx USART Instance + * @retval Value between Min_Data=0x00 and Max_Data=0xFF + */ +__STATIC_INLINE uint32_t LL_USART_GetBlockLength(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->RTOR, USART_RTOR_BLEN) >> USART_RTOR_BLEN_Pos); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_Configuration_IRDA Configuration functions related to Irda feature + * @{ + */ + +/** + * @brief Enable IrDA mode + * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not + * IrDA feature is supported by the USARTx instance. + * @rmtoll CR3 IREN LL_USART_EnableIrda + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIrda(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_IREN); +} + +/** + * @brief Disable IrDA mode + * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not + * IrDA feature is supported by the USARTx instance. + * @rmtoll CR3 IREN LL_USART_DisableIrda + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIrda(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_IREN); +} + +/** + * @brief Indicate if IrDA mode is enabled + * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not + * IrDA feature is supported by the USARTx instance. + * @rmtoll CR3 IREN LL_USART_IsEnabledIrda + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIrda(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_IREN) == (USART_CR3_IREN)) ? 1UL : 0UL); +} + +/** + * @brief Configure IrDA Power Mode (Normal or Low Power) + * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not + * IrDA feature is supported by the USARTx instance. + * @rmtoll CR3 IRLP LL_USART_SetIrdaPowerMode + * @param USARTx USART Instance + * @param PowerMode This parameter can be one of the following values: + * @arg @ref LL_USART_IRDA_POWER_NORMAL + * @arg @ref LL_USART_IRDA_POWER_LOW + * @retval None + */ +__STATIC_INLINE void LL_USART_SetIrdaPowerMode(USART_TypeDef *USARTx, uint32_t PowerMode) +{ + MODIFY_REG(USARTx->CR3, USART_CR3_IRLP, PowerMode); +} + +/** + * @brief Retrieve IrDA Power Mode configuration (Normal or Low Power) + * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not + * IrDA feature is supported by the USARTx instance. + * @rmtoll CR3 IRLP LL_USART_GetIrdaPowerMode + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_IRDA_POWER_NORMAL + * @arg @ref LL_USART_PHASE_2EDGE + */ +__STATIC_INLINE uint32_t LL_USART_GetIrdaPowerMode(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_IRLP)); +} + +/** + * @brief Set Irda prescaler value, used for dividing the USART clock source + * to achieve the Irda Low Power frequency (8 bits value) + * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not + * IrDA feature is supported by the USARTx instance. + * @rmtoll GTPR PSC LL_USART_SetIrdaPrescaler + * @param USARTx USART Instance + * @param PrescalerValue Value between Min_Data=0x00 and Max_Data=0xFF + * @retval None + */ +__STATIC_INLINE void LL_USART_SetIrdaPrescaler(USART_TypeDef *USARTx, uint32_t PrescalerValue) +{ + MODIFY_REG(USARTx->GTPR, USART_GTPR_PSC, (uint16_t)PrescalerValue); +} + +/** + * @brief Return Irda prescaler value, used for dividing the USART clock source + * to achieve the Irda Low Power frequency (8 bits value) + * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not + * IrDA feature is supported by the USARTx instance. + * @rmtoll GTPR PSC LL_USART_GetIrdaPrescaler + * @param USARTx USART Instance + * @retval Irda prescaler value (Value between Min_Data=0x00 and Max_Data=0xFF) + */ +__STATIC_INLINE uint32_t LL_USART_GetIrdaPrescaler(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_PSC)); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_Configuration_Smartcard Configuration functions related to Smartcard feature + * @{ + */ + +/** + * @brief Enable Smartcard NACK transmission + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR3 NACK LL_USART_EnableSmartcardNACK + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableSmartcardNACK(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_NACK); +} + +/** + * @brief Disable Smartcard NACK transmission + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR3 NACK LL_USART_DisableSmartcardNACK + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableSmartcardNACK(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_NACK); +} + +/** + * @brief Indicate if Smartcard NACK transmission is enabled + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR3 NACK LL_USART_IsEnabledSmartcardNACK + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledSmartcardNACK(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_NACK) == (USART_CR3_NACK)) ? 1UL : 0UL); +} + +/** + * @brief Enable Smartcard mode + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR3 SCEN LL_USART_EnableSmartcard + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableSmartcard(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_SCEN); +} + +/** + * @brief Disable Smartcard mode + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR3 SCEN LL_USART_DisableSmartcard + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableSmartcard(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_SCEN); +} + +/** + * @brief Indicate if Smartcard mode is enabled + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR3 SCEN LL_USART_IsEnabledSmartcard + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledSmartcard(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_SCEN) == (USART_CR3_SCEN)) ? 1UL : 0UL); +} + +/** + * @brief Set Smartcard Auto-Retry Count value (SCARCNT[2:0] bits) + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @note This bit-field specifies the number of retries in transmit and receive, in Smartcard mode. + * In transmission mode, it specifies the number of automatic retransmission retries, before + * generating a transmission error (FE bit set). + * In reception mode, it specifies the number or erroneous reception trials, before generating a + * reception error (RXNE and PE bits set) + * @rmtoll CR3 SCARCNT LL_USART_SetSmartcardAutoRetryCount + * @param USARTx USART Instance + * @param AutoRetryCount Value between Min_Data=0 and Max_Data=7 + * @retval None + */ +__STATIC_INLINE void LL_USART_SetSmartcardAutoRetryCount(USART_TypeDef *USARTx, uint32_t AutoRetryCount) +{ + MODIFY_REG(USARTx->CR3, USART_CR3_SCARCNT, AutoRetryCount << USART_CR3_SCARCNT_Pos); +} + +/** + * @brief Return Smartcard Auto-Retry Count value (SCARCNT[2:0] bits) + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR3 SCARCNT LL_USART_GetSmartcardAutoRetryCount + * @param USARTx USART Instance + * @retval Smartcard Auto-Retry Count value (Value between Min_Data=0 and Max_Data=7) + */ +__STATIC_INLINE uint32_t LL_USART_GetSmartcardAutoRetryCount(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_SCARCNT) >> USART_CR3_SCARCNT_Pos); +} + +/** + * @brief Set Smartcard prescaler value, used for dividing the USART clock + * source to provide the SMARTCARD Clock (5 bits value) + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll GTPR PSC LL_USART_SetSmartcardPrescaler + * @param USARTx USART Instance + * @param PrescalerValue Value between Min_Data=0 and Max_Data=31 + * @retval None + */ +__STATIC_INLINE void LL_USART_SetSmartcardPrescaler(USART_TypeDef *USARTx, uint32_t PrescalerValue) +{ + MODIFY_REG(USARTx->GTPR, USART_GTPR_PSC, (uint16_t)PrescalerValue); +} + +/** + * @brief Return Smartcard prescaler value, used for dividing the USART clock + * source to provide the SMARTCARD Clock (5 bits value) + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll GTPR PSC LL_USART_GetSmartcardPrescaler + * @param USARTx USART Instance + * @retval Smartcard prescaler value (Value between Min_Data=0 and Max_Data=31) + */ +__STATIC_INLINE uint32_t LL_USART_GetSmartcardPrescaler(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_PSC)); +} + +/** + * @brief Set Smartcard Guard time value, expressed in nb of baud clocks periods + * (GT[7:0] bits : Guard time value) + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll GTPR GT LL_USART_SetSmartcardGuardTime + * @param USARTx USART Instance + * @param GuardTime Value between Min_Data=0x00 and Max_Data=0xFF + * @retval None + */ +__STATIC_INLINE void LL_USART_SetSmartcardGuardTime(USART_TypeDef *USARTx, uint32_t GuardTime) +{ + MODIFY_REG(USARTx->GTPR, USART_GTPR_GT, (uint16_t)(GuardTime << USART_GTPR_GT_Pos)); +} + +/** + * @brief Return Smartcard Guard time value, expressed in nb of baud clocks periods + * (GT[7:0] bits : Guard time value) + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll GTPR GT LL_USART_GetSmartcardGuardTime + * @param USARTx USART Instance + * @retval Smartcard Guard time value (Value between Min_Data=0x00 and Max_Data=0xFF) + */ +__STATIC_INLINE uint32_t LL_USART_GetSmartcardGuardTime(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->GTPR, USART_GTPR_GT) >> USART_GTPR_GT_Pos); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_Configuration_HalfDuplex Configuration functions related to Half Duplex feature + * @{ + */ + +/** + * @brief Enable Single Wire Half-Duplex mode + * @note Macro IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not + * Half-Duplex mode is supported by the USARTx instance. + * @rmtoll CR3 HDSEL LL_USART_EnableHalfDuplex + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableHalfDuplex(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_HDSEL); +} + +/** + * @brief Disable Single Wire Half-Duplex mode + * @note Macro IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not + * Half-Duplex mode is supported by the USARTx instance. + * @rmtoll CR3 HDSEL LL_USART_DisableHalfDuplex + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableHalfDuplex(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_HDSEL); +} + +/** + * @brief Indicate if Single Wire Half-Duplex mode is enabled + * @note Macro IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not + * Half-Duplex mode is supported by the USARTx instance. + * @rmtoll CR3 HDSEL LL_USART_IsEnabledHalfDuplex + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledHalfDuplex(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_HDSEL) == (USART_CR3_HDSEL)) ? 1UL : 0UL); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_Configuration_LIN Configuration functions related to LIN feature + * @{ + */ + +/** + * @brief Set LIN Break Detection Length + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll CR2 LBDL LL_USART_SetLINBrkDetectionLen + * @param USARTx USART Instance + * @param LINBDLength This parameter can be one of the following values: + * @arg @ref LL_USART_LINBREAK_DETECT_10B + * @arg @ref LL_USART_LINBREAK_DETECT_11B + * @retval None + */ +__STATIC_INLINE void LL_USART_SetLINBrkDetectionLen(USART_TypeDef *USARTx, uint32_t LINBDLength) +{ + MODIFY_REG(USARTx->CR2, USART_CR2_LBDL, LINBDLength); +} + +/** + * @brief Return LIN Break Detection Length + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll CR2 LBDL LL_USART_GetLINBrkDetectionLen + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_LINBREAK_DETECT_10B + * @arg @ref LL_USART_LINBREAK_DETECT_11B + */ +__STATIC_INLINE uint32_t LL_USART_GetLINBrkDetectionLen(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR2, USART_CR2_LBDL)); +} + +/** + * @brief Enable LIN mode + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll CR2 LINEN LL_USART_EnableLIN + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableLIN(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR2, USART_CR2_LINEN); +} + +/** + * @brief Disable LIN mode + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll CR2 LINEN LL_USART_DisableLIN + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableLIN(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR2, USART_CR2_LINEN); +} + +/** + * @brief Indicate if LIN mode is enabled + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll CR2 LINEN LL_USART_IsEnabledLIN + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledLIN(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR2, USART_CR2_LINEN) == (USART_CR2_LINEN)) ? 1UL : 0UL); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_Configuration_DE Configuration functions related to Driver Enable feature + * @{ + */ + +/** + * @brief Set DEDT (Driver Enable De-Assertion Time), Time value expressed on 5 bits ([4:0] bits). + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR1 DEDT LL_USART_SetDEDeassertionTime + * @param USARTx USART Instance + * @param Time Value between Min_Data=0 and Max_Data=31 + * @retval None + */ +__STATIC_INLINE void LL_USART_SetDEDeassertionTime(USART_TypeDef *USARTx, uint32_t Time) +{ + MODIFY_REG(USARTx->CR1, USART_CR1_DEDT, Time << USART_CR1_DEDT_Pos); +} + +/** + * @brief Return DEDT (Driver Enable De-Assertion Time) + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR1 DEDT LL_USART_GetDEDeassertionTime + * @param USARTx USART Instance + * @retval Time value expressed on 5 bits ([4:0] bits) : Value between Min_Data=0 and Max_Data=31 + */ +__STATIC_INLINE uint32_t LL_USART_GetDEDeassertionTime(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_DEDT) >> USART_CR1_DEDT_Pos); +} + +/** + * @brief Set DEAT (Driver Enable Assertion Time), Time value expressed on 5 bits ([4:0] bits). + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR1 DEAT LL_USART_SetDEAssertionTime + * @param USARTx USART Instance + * @param Time Value between Min_Data=0 and Max_Data=31 + * @retval None + */ +__STATIC_INLINE void LL_USART_SetDEAssertionTime(USART_TypeDef *USARTx, uint32_t Time) +{ + MODIFY_REG(USARTx->CR1, USART_CR1_DEAT, Time << USART_CR1_DEAT_Pos); +} + +/** + * @brief Return DEAT (Driver Enable Assertion Time) + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR1 DEAT LL_USART_GetDEAssertionTime + * @param USARTx USART Instance + * @retval Time value expressed on 5 bits ([4:0] bits) : Value between Min_Data=0 and Max_Data=31 + */ +__STATIC_INLINE uint32_t LL_USART_GetDEAssertionTime(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR1, USART_CR1_DEAT) >> USART_CR1_DEAT_Pos); +} + +/** + * @brief Enable Driver Enable (DE) Mode + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR3 DEM LL_USART_EnableDEMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableDEMode(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_DEM); +} + +/** + * @brief Disable Driver Enable (DE) Mode + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR3 DEM LL_USART_DisableDEMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableDEMode(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_DEM); +} + +/** + * @brief Indicate if Driver Enable (DE) Mode is enabled + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR3 DEM LL_USART_IsEnabledDEMode + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledDEMode(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_DEM) == (USART_CR3_DEM)) ? 1UL : 0UL); +} + +/** + * @brief Select Driver Enable Polarity + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR3 DEP LL_USART_SetDESignalPolarity + * @param USARTx USART Instance + * @param Polarity This parameter can be one of the following values: + * @arg @ref LL_USART_DE_POLARITY_HIGH + * @arg @ref LL_USART_DE_POLARITY_LOW + * @retval None + */ +__STATIC_INLINE void LL_USART_SetDESignalPolarity(USART_TypeDef *USARTx, uint32_t Polarity) +{ + MODIFY_REG(USARTx->CR3, USART_CR3_DEP, Polarity); +} + +/** + * @brief Return Driver Enable Polarity + * @note Macro IS_UART_DRIVER_ENABLE_INSTANCE(USARTx) can be used to check whether or not + * Driver Enable feature is supported by the USARTx instance. + * @rmtoll CR3 DEP LL_USART_GetDESignalPolarity + * @param USARTx USART Instance + * @retval Returned value can be one of the following values: + * @arg @ref LL_USART_DE_POLARITY_HIGH + * @arg @ref LL_USART_DE_POLARITY_LOW + */ +__STATIC_INLINE uint32_t LL_USART_GetDESignalPolarity(const USART_TypeDef *USARTx) +{ + return (uint32_t)(READ_BIT(USARTx->CR3, USART_CR3_DEP)); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_AdvancedConfiguration Advanced Configurations services + * @{ + */ + +/** + * @brief Perform basic configuration of USART for enabling use in Asynchronous Mode (UART) + * @note In UART mode, the following bits must be kept cleared: + * - LINEN bit in the USART_CR2 register, + * - CLKEN bit in the USART_CR2 register, + * - SCEN bit in the USART_CR3 register, + * - IREN bit in the USART_CR3 register, + * - HDSEL bit in the USART_CR3 register. + * @note Call of this function is equivalent to following function call sequence : + * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function + * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function + * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function + * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function + * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function + * @note Other remaining configurations items related to Asynchronous Mode + * (as Baud Rate, Word length, Parity, ...) should be set using + * dedicated functions + * @rmtoll CR2 LINEN LL_USART_ConfigAsyncMode\n + * CR2 CLKEN LL_USART_ConfigAsyncMode\n + * CR3 SCEN LL_USART_ConfigAsyncMode\n + * CR3 IREN LL_USART_ConfigAsyncMode\n + * CR3 HDSEL LL_USART_ConfigAsyncMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigAsyncMode(USART_TypeDef *USARTx) +{ + /* In Asynchronous mode, the following bits must be kept cleared: + - LINEN, CLKEN bits in the USART_CR2 register, + - SCEN, IREN and HDSEL bits in the USART_CR3 register. + */ + CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN)); + CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN | USART_CR3_HDSEL)); +} + +/** + * @brief Perform basic configuration of USART for enabling use in Synchronous Mode + * @note In Synchronous mode, the following bits must be kept cleared: + * - LINEN bit in the USART_CR2 register, + * - SCEN bit in the USART_CR3 register, + * - IREN bit in the USART_CR3 register, + * - HDSEL bit in the USART_CR3 register. + * This function also sets the USART in Synchronous mode. + * @note Macro IS_USART_INSTANCE(USARTx) can be used to check whether or not + * Synchronous mode is supported by the USARTx instance. + * @note Call of this function is equivalent to following function call sequence : + * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function + * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function + * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function + * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function + * - Set CLKEN in CR2 using @ref LL_USART_EnableSCLKOutput() function + * @note Other remaining configurations items related to Synchronous Mode + * (as Baud Rate, Word length, Parity, Clock Polarity, ...) should be set using + * dedicated functions + * @rmtoll CR2 LINEN LL_USART_ConfigSyncMode\n + * CR2 CLKEN LL_USART_ConfigSyncMode\n + * CR3 SCEN LL_USART_ConfigSyncMode\n + * CR3 IREN LL_USART_ConfigSyncMode\n + * CR3 HDSEL LL_USART_ConfigSyncMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigSyncMode(USART_TypeDef *USARTx) +{ + /* In Synchronous mode, the following bits must be kept cleared: + - LINEN bit in the USART_CR2 register, + - SCEN, IREN and HDSEL bits in the USART_CR3 register. + */ + CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN)); + CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN | USART_CR3_HDSEL)); + /* set the UART/USART in Synchronous mode */ + SET_BIT(USARTx->CR2, USART_CR2_CLKEN); +} + +/** + * @brief Perform basic configuration of USART for enabling use in LIN Mode + * @note In LIN mode, the following bits must be kept cleared: + * - STOP and CLKEN bits in the USART_CR2 register, + * - SCEN bit in the USART_CR3 register, + * - IREN bit in the USART_CR3 register, + * - HDSEL bit in the USART_CR3 register. + * This function also set the UART/USART in LIN mode. + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @note Call of this function is equivalent to following function call sequence : + * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function + * - Clear STOP in CR2 using @ref LL_USART_SetStopBitsLength() function + * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function + * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function + * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function + * - Set LINEN in CR2 using @ref LL_USART_EnableLIN() function + * @note Other remaining configurations items related to LIN Mode + * (as Baud Rate, Word length, LIN Break Detection Length, ...) should be set using + * dedicated functions + * @rmtoll CR2 CLKEN LL_USART_ConfigLINMode\n + * CR2 STOP LL_USART_ConfigLINMode\n + * CR2 LINEN LL_USART_ConfigLINMode\n + * CR3 IREN LL_USART_ConfigLINMode\n + * CR3 SCEN LL_USART_ConfigLINMode\n + * CR3 HDSEL LL_USART_ConfigLINMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigLINMode(USART_TypeDef *USARTx) +{ + /* In LIN mode, the following bits must be kept cleared: + - STOP and CLKEN bits in the USART_CR2 register, + - IREN, SCEN and HDSEL bits in the USART_CR3 register. + */ + CLEAR_BIT(USARTx->CR2, (USART_CR2_CLKEN | USART_CR2_STOP)); + CLEAR_BIT(USARTx->CR3, (USART_CR3_IREN | USART_CR3_SCEN | USART_CR3_HDSEL)); + /* Set the UART/USART in LIN mode */ + SET_BIT(USARTx->CR2, USART_CR2_LINEN); +} + +/** + * @brief Perform basic configuration of USART for enabling use in Half Duplex Mode + * @note In Half Duplex mode, the following bits must be kept cleared: + * - LINEN bit in the USART_CR2 register, + * - CLKEN bit in the USART_CR2 register, + * - SCEN bit in the USART_CR3 register, + * - IREN bit in the USART_CR3 register, + * This function also sets the UART/USART in Half Duplex mode. + * @note Macro IS_UART_HALFDUPLEX_INSTANCE(USARTx) can be used to check whether or not + * Half-Duplex mode is supported by the USARTx instance. + * @note Call of this function is equivalent to following function call sequence : + * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function + * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function + * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function + * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function + * - Set HDSEL in CR3 using @ref LL_USART_EnableHalfDuplex() function + * @note Other remaining configurations items related to Half Duplex Mode + * (as Baud Rate, Word length, Parity, ...) should be set using + * dedicated functions + * @rmtoll CR2 LINEN LL_USART_ConfigHalfDuplexMode\n + * CR2 CLKEN LL_USART_ConfigHalfDuplexMode\n + * CR3 HDSEL LL_USART_ConfigHalfDuplexMode\n + * CR3 SCEN LL_USART_ConfigHalfDuplexMode\n + * CR3 IREN LL_USART_ConfigHalfDuplexMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigHalfDuplexMode(USART_TypeDef *USARTx) +{ + /* In Half Duplex mode, the following bits must be kept cleared: + - LINEN and CLKEN bits in the USART_CR2 register, + - SCEN and IREN bits in the USART_CR3 register. + */ + CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN)); + CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_IREN)); + /* set the UART/USART in Half Duplex mode */ + SET_BIT(USARTx->CR3, USART_CR3_HDSEL); +} + +/** + * @brief Perform basic configuration of USART for enabling use in Smartcard Mode + * @note In Smartcard mode, the following bits must be kept cleared: + * - LINEN bit in the USART_CR2 register, + * - IREN bit in the USART_CR3 register, + * - HDSEL bit in the USART_CR3 register. + * This function also configures Stop bits to 1.5 bits and + * sets the USART in Smartcard mode (SCEN bit). + * Clock Output is also enabled (CLKEN). + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @note Call of this function is equivalent to following function call sequence : + * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function + * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function + * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function + * - Configure STOP in CR2 using @ref LL_USART_SetStopBitsLength() function + * - Set CLKEN in CR2 using @ref LL_USART_EnableSCLKOutput() function + * - Set SCEN in CR3 using @ref LL_USART_EnableSmartcard() function + * @note Other remaining configurations items related to Smartcard Mode + * (as Baud Rate, Word length, Parity, ...) should be set using + * dedicated functions + * @rmtoll CR2 LINEN LL_USART_ConfigSmartcardMode\n + * CR2 STOP LL_USART_ConfigSmartcardMode\n + * CR2 CLKEN LL_USART_ConfigSmartcardMode\n + * CR3 HDSEL LL_USART_ConfigSmartcardMode\n + * CR3 SCEN LL_USART_ConfigSmartcardMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigSmartcardMode(USART_TypeDef *USARTx) +{ + /* In Smartcard mode, the following bits must be kept cleared: + - LINEN bit in the USART_CR2 register, + - IREN and HDSEL bits in the USART_CR3 register. + */ + CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN)); + CLEAR_BIT(USARTx->CR3, (USART_CR3_IREN | USART_CR3_HDSEL)); + /* Configure Stop bits to 1.5 bits */ + /* Synchronous mode is activated by default */ + SET_BIT(USARTx->CR2, (USART_CR2_STOP_0 | USART_CR2_STOP_1 | USART_CR2_CLKEN)); + /* set the UART/USART in Smartcard mode */ + SET_BIT(USARTx->CR3, USART_CR3_SCEN); +} + +/** + * @brief Perform basic configuration of USART for enabling use in Irda Mode + * @note In IRDA mode, the following bits must be kept cleared: + * - LINEN bit in the USART_CR2 register, + * - STOP and CLKEN bits in the USART_CR2 register, + * - SCEN bit in the USART_CR3 register, + * - HDSEL bit in the USART_CR3 register. + * This function also sets the UART/USART in IRDA mode (IREN bit). + * @note Macro IS_IRDA_INSTANCE(USARTx) can be used to check whether or not + * IrDA feature is supported by the USARTx instance. + * @note Call of this function is equivalent to following function call sequence : + * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function + * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function + * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function + * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function + * - Configure STOP in CR2 using @ref LL_USART_SetStopBitsLength() function + * - Set IREN in CR3 using @ref LL_USART_EnableIrda() function + * @note Other remaining configurations items related to Irda Mode + * (as Baud Rate, Word length, Power mode, ...) should be set using + * dedicated functions + * @rmtoll CR2 LINEN LL_USART_ConfigIrdaMode\n + * CR2 CLKEN LL_USART_ConfigIrdaMode\n + * CR2 STOP LL_USART_ConfigIrdaMode\n + * CR3 SCEN LL_USART_ConfigIrdaMode\n + * CR3 HDSEL LL_USART_ConfigIrdaMode\n + * CR3 IREN LL_USART_ConfigIrdaMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigIrdaMode(USART_TypeDef *USARTx) +{ + /* In IRDA mode, the following bits must be kept cleared: + - LINEN, STOP and CLKEN bits in the USART_CR2 register, + - SCEN and HDSEL bits in the USART_CR3 register. + */ + CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN | USART_CR2_STOP)); + CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL)); + /* set the UART/USART in IRDA mode */ + SET_BIT(USARTx->CR3, USART_CR3_IREN); +} + +/** + * @brief Perform basic configuration of USART for enabling use in Multi processor Mode + * (several USARTs connected in a network, one of the USARTs can be the master, + * its TX output connected to the RX inputs of the other slaves USARTs). + * @note In MultiProcessor mode, the following bits must be kept cleared: + * - LINEN bit in the USART_CR2 register, + * - CLKEN bit in the USART_CR2 register, + * - SCEN bit in the USART_CR3 register, + * - IREN bit in the USART_CR3 register, + * - HDSEL bit in the USART_CR3 register. + * @note Call of this function is equivalent to following function call sequence : + * - Clear LINEN in CR2 using @ref LL_USART_DisableLIN() function + * - Clear CLKEN in CR2 using @ref LL_USART_DisableSCLKOutput() function + * - Clear SCEN in CR3 using @ref LL_USART_DisableSmartcard() function + * - Clear IREN in CR3 using @ref LL_USART_DisableIrda() function + * - Clear HDSEL in CR3 using @ref LL_USART_DisableHalfDuplex() function + * @note Other remaining configurations items related to Multi processor Mode + * (as Baud Rate, Wake Up Method, Node address, ...) should be set using + * dedicated functions + * @rmtoll CR2 LINEN LL_USART_ConfigMultiProcessMode\n + * CR2 CLKEN LL_USART_ConfigMultiProcessMode\n + * CR3 SCEN LL_USART_ConfigMultiProcessMode\n + * CR3 HDSEL LL_USART_ConfigMultiProcessMode\n + * CR3 IREN LL_USART_ConfigMultiProcessMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ConfigMultiProcessMode(USART_TypeDef *USARTx) +{ + /* In Multi Processor mode, the following bits must be kept cleared: + - LINEN and CLKEN bits in the USART_CR2 register, + - IREN, SCEN and HDSEL bits in the USART_CR3 register. + */ + CLEAR_BIT(USARTx->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN)); + CLEAR_BIT(USARTx->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN)); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_FLAG_Management FLAG_Management + * @{ + */ + +/** + * @brief Check if the USART Parity Error Flag is set or not + * @rmtoll ISR PE LL_USART_IsActiveFlag_PE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_PE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_PE) == (USART_ISR_PE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Framing Error Flag is set or not + * @rmtoll ISR FE LL_USART_IsActiveFlag_FE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_FE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_FE) == (USART_ISR_FE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Noise error detected Flag is set or not + * @rmtoll ISR NE LL_USART_IsActiveFlag_NE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_NE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_NE) == (USART_ISR_NE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART OverRun Error Flag is set or not + * @rmtoll ISR ORE LL_USART_IsActiveFlag_ORE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_ORE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_ORE) == (USART_ISR_ORE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART IDLE line detected Flag is set or not + * @rmtoll ISR IDLE LL_USART_IsActiveFlag_IDLE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_IDLE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_IDLE) == (USART_ISR_IDLE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Read Data Register Not Empty Flag is set or not + * @rmtoll ISR RXNE LL_USART_IsActiveFlag_RXNE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_RXNE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_RXNE) == (USART_ISR_RXNE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Transmission Complete Flag is set or not + * @rmtoll ISR TC LL_USART_IsActiveFlag_TC + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TC(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_TC) == (USART_ISR_TC)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Transmit Data Register Empty Flag is set or not + * @rmtoll ISR TXE LL_USART_IsActiveFlag_TXE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TXE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_TXE) == (USART_ISR_TXE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART LIN Break Detection Flag is set or not + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll ISR LBDF LL_USART_IsActiveFlag_LBD + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_LBD(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_LBDF) == (USART_ISR_LBDF)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART CTS interrupt Flag is set or not + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll ISR CTSIF LL_USART_IsActiveFlag_nCTS + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_nCTS(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_CTSIF) == (USART_ISR_CTSIF)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART CTS Flag is set or not + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll ISR CTS LL_USART_IsActiveFlag_CTS + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_CTS(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_CTS) == (USART_ISR_CTS)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Receiver Time Out Flag is set or not + * @rmtoll ISR RTOF LL_USART_IsActiveFlag_RTO + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_RTO(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_RTOF) == (USART_ISR_RTOF)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART End Of Block Flag is set or not + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll ISR EOBF LL_USART_IsActiveFlag_EOB + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_EOB(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_EOBF) == (USART_ISR_EOBF)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Auto-Baud Rate Error Flag is set or not + * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not + * Auto Baud Rate detection feature is supported by the USARTx instance. + * @rmtoll ISR ABRE LL_USART_IsActiveFlag_ABRE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_ABRE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_ABRE) == (USART_ISR_ABRE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Auto-Baud Rate Flag is set or not + * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not + * Auto Baud Rate detection feature is supported by the USARTx instance. + * @rmtoll ISR ABRF LL_USART_IsActiveFlag_ABR + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_ABR(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_ABRF) == (USART_ISR_ABRF)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Busy Flag is set or not + * @rmtoll ISR BUSY LL_USART_IsActiveFlag_BUSY + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_BUSY(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_BUSY) == (USART_ISR_BUSY)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Character Match Flag is set or not + * @rmtoll ISR CMF LL_USART_IsActiveFlag_CM + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_CM(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_CMF) == (USART_ISR_CMF)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Send Break Flag is set or not + * @rmtoll ISR SBKF LL_USART_IsActiveFlag_SBK + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_SBK(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_SBKF) == (USART_ISR_SBKF)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Receive Wake Up from mute mode Flag is set or not + * @rmtoll ISR RWU LL_USART_IsActiveFlag_RWU + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_RWU(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_RWU) == (USART_ISR_RWU)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Wake Up from stop mode Flag is set or not + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll ISR WUF LL_USART_IsActiveFlag_WKUP + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_WKUP(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_WUF) == (USART_ISR_WUF)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Transmit Enable Acknowledge Flag is set or not + * @rmtoll ISR TEACK LL_USART_IsActiveFlag_TEACK + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_TEACK(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_TEACK) == (USART_ISR_TEACK)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Receive Enable Acknowledge Flag is set or not + * @rmtoll ISR REACK LL_USART_IsActiveFlag_REACK + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsActiveFlag_REACK(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->ISR, USART_ISR_REACK) == (USART_ISR_REACK)) ? 1UL : 0UL); +} + +/** + * @brief Clear Parity Error Flag + * @rmtoll ICR PECF LL_USART_ClearFlag_PE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_PE(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_PECF); +} + +/** + * @brief Clear Framing Error Flag + * @rmtoll ICR FECF LL_USART_ClearFlag_FE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_FE(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_FECF); +} + +/** + * @brief Clear Noise Error detected Flag + * @rmtoll ICR NCF LL_USART_ClearFlag_NE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_NE(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_NCF); +} + +/** + * @brief Clear OverRun Error Flag + * @rmtoll ICR ORECF LL_USART_ClearFlag_ORE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_ORE(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_ORECF); +} + +/** + * @brief Clear IDLE line detected Flag + * @rmtoll ICR IDLECF LL_USART_ClearFlag_IDLE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_IDLE(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_IDLECF); +} + +/** + * @brief Clear Transmission Complete Flag + * @rmtoll ICR TCCF LL_USART_ClearFlag_TC + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_TC(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_TCCF); +} + + +/** + * @brief Clear LIN Break Detection Flag + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll ICR LBDCF LL_USART_ClearFlag_LBD + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_LBD(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_LBDCF); +} + +/** + * @brief Clear CTS Interrupt Flag + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll ICR CTSCF LL_USART_ClearFlag_nCTS + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_nCTS(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_CTSCF); +} + +/** + * @brief Clear Receiver Time Out Flag + * @rmtoll ICR RTOCF LL_USART_ClearFlag_RTO + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_RTO(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_RTOCF); +} + +/** + * @brief Clear End Of Block Flag + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll ICR EOBCF LL_USART_ClearFlag_EOB + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_EOB(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_EOBCF); +} + +/** + * @brief Clear Character Match Flag + * @rmtoll ICR CMCF LL_USART_ClearFlag_CM + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_CM(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_CMCF); +} + +/** + * @brief Clear Wake Up from stop mode Flag + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll ICR WUCF LL_USART_ClearFlag_WKUP + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_ClearFlag_WKUP(USART_TypeDef *USARTx) +{ + WRITE_REG(USARTx->ICR, USART_ICR_WUCF); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_IT_Management IT_Management + * @{ + */ + +/** + * @brief Enable IDLE Interrupt + * @rmtoll CR1 IDLEIE LL_USART_EnableIT_IDLE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_IDLE(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_IDLEIE); +} + +/** + * @brief Enable RX Not Empty Interrupt + * @rmtoll CR1 RXNEIE LL_USART_EnableIT_RXNE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_RXNE(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_RXNEIE); +} + +/** + * @brief Enable Transmission Complete Interrupt + * @rmtoll CR1 TCIE LL_USART_EnableIT_TC + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_TC(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_TCIE); +} + +/** + * @brief Enable TX Empty Interrupt + * @rmtoll CR1 TXEIE LL_USART_EnableIT_TXE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_TXE(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_TXEIE); +} + +/** + * @brief Enable Parity Error Interrupt + * @rmtoll CR1 PEIE LL_USART_EnableIT_PE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_PE(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_PEIE); +} + +/** + * @brief Enable Character Match Interrupt + * @rmtoll CR1 CMIE LL_USART_EnableIT_CM + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_CM(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_CMIE); +} + +/** + * @brief Enable Receiver Timeout Interrupt + * @rmtoll CR1 RTOIE LL_USART_EnableIT_RTO + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_RTO(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_RTOIE); +} + +/** + * @brief Enable End Of Block Interrupt + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR1 EOBIE LL_USART_EnableIT_EOB + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_EOB(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR1, USART_CR1_EOBIE); +} + +/** + * @brief Enable LIN Break Detection Interrupt + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll CR2 LBDIE LL_USART_EnableIT_LBD + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_LBD(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR2, USART_CR2_LBDIE); +} + +/** + * @brief Enable Error Interrupt + * @note When set, Error Interrupt Enable Bit is enabling interrupt generation in case of a framing + * error, overrun error or noise flag (FE=1 or ORE=1 or NF=1 in the USARTx_ISR register). + * 0: Interrupt is inhibited + * 1: An interrupt is generated when FE=1 or ORE=1 or NF=1 in the USARTx_ISR register. + * @rmtoll CR3 EIE LL_USART_EnableIT_ERROR + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_ERROR(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_EIE); +} + +/** + * @brief Enable CTS Interrupt + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 CTSIE LL_USART_EnableIT_CTS + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_CTS(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_CTSIE); +} + +/** + * @brief Enable Wake Up from Stop Mode Interrupt + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll CR3 WUFIE LL_USART_EnableIT_WKUP + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableIT_WKUP(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_WUFIE); +} + + +/** + * @brief Disable IDLE Interrupt + * @rmtoll CR1 IDLEIE LL_USART_DisableIT_IDLE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_IDLE(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_IDLEIE); +} + +/** + * @brief Disable RX Not Empty Interrupt + * @rmtoll CR1 RXNEIE LL_USART_DisableIT_RXNE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_RXNE(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_RXNEIE); +} + +/** + * @brief Disable Transmission Complete Interrupt + * @rmtoll CR1 TCIE LL_USART_DisableIT_TC + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_TC(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_TCIE); +} + +/** + * @brief Disable TX Empty Interrupt + * @rmtoll CR1 TXEIE LL_USART_DisableIT_TXE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_TXE(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_TXEIE); +} + +/** + * @brief Disable Parity Error Interrupt + * @rmtoll CR1 PEIE LL_USART_DisableIT_PE + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_PE(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_PEIE); +} + +/** + * @brief Disable Character Match Interrupt + * @rmtoll CR1 CMIE LL_USART_DisableIT_CM + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_CM(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_CMIE); +} + +/** + * @brief Disable Receiver Timeout Interrupt + * @rmtoll CR1 RTOIE LL_USART_DisableIT_RTO + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_RTO(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_RTOIE); +} + +/** + * @brief Disable End Of Block Interrupt + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR1 EOBIE LL_USART_DisableIT_EOB + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_EOB(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR1, USART_CR1_EOBIE); +} + +/** + * @brief Disable LIN Break Detection Interrupt + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll CR2 LBDIE LL_USART_DisableIT_LBD + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_LBD(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR2, USART_CR2_LBDIE); +} + +/** + * @brief Disable Error Interrupt + * @note When set, Error Interrupt Enable Bit is enabling interrupt generation in case of a framing + * error, overrun error or noise flag (FE=1 or ORE=1 or NF=1 in the USARTx_ISR register). + * 0: Interrupt is inhibited + * 1: An interrupt is generated when FE=1 or ORE=1 or NF=1 in the USARTx_ISR register. + * @rmtoll CR3 EIE LL_USART_DisableIT_ERROR + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_ERROR(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_EIE); +} + +/** + * @brief Disable CTS Interrupt + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 CTSIE LL_USART_DisableIT_CTS + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_CTS(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_CTSIE); +} + +/** + * @brief Disable Wake Up from Stop Mode Interrupt + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll CR3 WUFIE LL_USART_DisableIT_WKUP + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableIT_WKUP(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_WUFIE); +} + + +/** + * @brief Check if the USART IDLE Interrupt source is enabled or disabled. + * @rmtoll CR1 IDLEIE LL_USART_IsEnabledIT_IDLE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_IDLE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_IDLEIE) == (USART_CR1_IDLEIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART RX Not Empty Interrupt is enabled or disabled. + * @rmtoll CR1 RXNEIE LL_USART_IsEnabledIT_RXNE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_RXNE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_RXNEIE) == (USART_CR1_RXNEIE)) ? 1U : 0U); +} + +/** + * @brief Check if the USART Transmission Complete Interrupt is enabled or disabled. + * @rmtoll CR1 TCIE LL_USART_IsEnabledIT_TC + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_TC(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_TCIE) == (USART_CR1_TCIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART TX Empty Interrupt is enabled or disabled. + * @rmtoll CR1 TXEIE LL_USART_IsEnabledIT_TXE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_TXE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_TXEIE) == (USART_CR1_TXEIE)) ? 1U : 0U); +} + +/** + * @brief Check if the USART Parity Error Interrupt is enabled or disabled. + * @rmtoll CR1 PEIE LL_USART_IsEnabledIT_PE + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_PE(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_PEIE) == (USART_CR1_PEIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Character Match Interrupt is enabled or disabled. + * @rmtoll CR1 CMIE LL_USART_IsEnabledIT_CM + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_CM(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_CMIE) == (USART_CR1_CMIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Receiver Timeout Interrupt is enabled or disabled. + * @rmtoll CR1 RTOIE LL_USART_IsEnabledIT_RTO + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_RTO(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_RTOIE) == (USART_CR1_RTOIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART End Of Block Interrupt is enabled or disabled. + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll CR1 EOBIE LL_USART_IsEnabledIT_EOB + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_EOB(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR1, USART_CR1_EOBIE) == (USART_CR1_EOBIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART LIN Break Detection Interrupt is enabled or disabled. + * @note Macro IS_UART_LIN_INSTANCE(USARTx) can be used to check whether or not + * LIN feature is supported by the USARTx instance. + * @rmtoll CR2 LBDIE LL_USART_IsEnabledIT_LBD + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_LBD(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR2, USART_CR2_LBDIE) == (USART_CR2_LBDIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Error Interrupt is enabled or disabled. + * @rmtoll CR3 EIE LL_USART_IsEnabledIT_ERROR + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_ERROR(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_EIE) == (USART_CR3_EIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART CTS Interrupt is enabled or disabled. + * @note Macro IS_UART_HWFLOW_INSTANCE(USARTx) can be used to check whether or not + * Hardware Flow control feature is supported by the USARTx instance. + * @rmtoll CR3 CTSIE LL_USART_IsEnabledIT_CTS + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_CTS(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_CTSIE) == (USART_CR3_CTSIE)) ? 1UL : 0UL); +} + +/** + * @brief Check if the USART Wake Up from Stop Mode Interrupt is enabled or disabled. + * @note Macro IS_UART_WAKEUP_FROMSTOP_INSTANCE(USARTx) can be used to check whether or not + * Wake-up from Stop mode feature is supported by the USARTx instance. + * @rmtoll CR3 WUFIE LL_USART_IsEnabledIT_WKUP + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledIT_WKUP(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_WUFIE) == (USART_CR3_WUFIE)) ? 1UL : 0UL); +} + + +/** + * @} + */ + +/** @defgroup USART_LL_EF_DMA_Management DMA_Management + * @{ + */ + +/** + * @brief Enable DMA Mode for reception + * @rmtoll CR3 DMAR LL_USART_EnableDMAReq_RX + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableDMAReq_RX(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_DMAR); +} + +/** + * @brief Disable DMA Mode for reception + * @rmtoll CR3 DMAR LL_USART_DisableDMAReq_RX + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableDMAReq_RX(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_DMAR); +} + +/** + * @brief Check if DMA Mode is enabled for reception + * @rmtoll CR3 DMAR LL_USART_IsEnabledDMAReq_RX + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledDMAReq_RX(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_DMAR) == (USART_CR3_DMAR)) ? 1UL : 0UL); +} + +/** + * @brief Enable DMA Mode for transmission + * @rmtoll CR3 DMAT LL_USART_EnableDMAReq_TX + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableDMAReq_TX(USART_TypeDef *USARTx) +{ + ATOMIC_SET_BIT(USARTx->CR3, USART_CR3_DMAT); +} + +/** + * @brief Disable DMA Mode for transmission + * @rmtoll CR3 DMAT LL_USART_DisableDMAReq_TX + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableDMAReq_TX(USART_TypeDef *USARTx) +{ + ATOMIC_CLEAR_BIT(USARTx->CR3, USART_CR3_DMAT); +} + +/** + * @brief Check if DMA Mode is enabled for transmission + * @rmtoll CR3 DMAT LL_USART_IsEnabledDMAReq_TX + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledDMAReq_TX(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_DMAT) == (USART_CR3_DMAT)) ? 1UL : 0UL); +} + +/** + * @brief Enable DMA Disabling on Reception Error + * @rmtoll CR3 DDRE LL_USART_EnableDMADeactOnRxErr + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_EnableDMADeactOnRxErr(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->CR3, USART_CR3_DDRE); +} + +/** + * @brief Disable DMA Disabling on Reception Error + * @rmtoll CR3 DDRE LL_USART_DisableDMADeactOnRxErr + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_DisableDMADeactOnRxErr(USART_TypeDef *USARTx) +{ + CLEAR_BIT(USARTx->CR3, USART_CR3_DDRE); +} + +/** + * @brief Indicate if DMA Disabling on Reception Error is disabled + * @rmtoll CR3 DDRE LL_USART_IsEnabledDMADeactOnRxErr + * @param USARTx USART Instance + * @retval State of bit (1 or 0). + */ +__STATIC_INLINE uint32_t LL_USART_IsEnabledDMADeactOnRxErr(const USART_TypeDef *USARTx) +{ + return ((READ_BIT(USARTx->CR3, USART_CR3_DDRE) == (USART_CR3_DDRE)) ? 1UL : 0UL); +} + +/** + * @brief Get the data register address used for DMA transfer + * @rmtoll RDR RDR LL_USART_DMA_GetRegAddr\n + * @rmtoll TDR TDR LL_USART_DMA_GetRegAddr + * @param USARTx USART Instance + * @param Direction This parameter can be one of the following values: + * @arg @ref LL_USART_DMA_REG_DATA_TRANSMIT + * @arg @ref LL_USART_DMA_REG_DATA_RECEIVE + * @retval Address of data register + */ +__STATIC_INLINE uint32_t LL_USART_DMA_GetRegAddr(const USART_TypeDef *USARTx, uint32_t Direction) +{ + uint32_t data_reg_addr; + + if (Direction == LL_USART_DMA_REG_DATA_TRANSMIT) + { + /* return address of TDR register */ + data_reg_addr = (uint32_t) &(USARTx->TDR); + } + else + { + /* return address of RDR register */ + data_reg_addr = (uint32_t) &(USARTx->RDR); + } + + return data_reg_addr; +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_Data_Management Data_Management + * @{ + */ + +/** + * @brief Read Receiver Data register (Receive Data value, 8 bits) + * @rmtoll RDR RDR LL_USART_ReceiveData8 + * @param USARTx USART Instance + * @retval Value between Min_Data=0x00 and Max_Data=0xFF + */ +__STATIC_INLINE uint8_t LL_USART_ReceiveData8(const USART_TypeDef *USARTx) +{ + return (uint8_t)(READ_BIT(USARTx->RDR, USART_RDR_RDR) & 0xFFU); +} + +/** + * @brief Read Receiver Data register (Receive Data value, 9 bits) + * @rmtoll RDR RDR LL_USART_ReceiveData9 + * @param USARTx USART Instance + * @retval Value between Min_Data=0x00 and Max_Data=0x1FF + */ +__STATIC_INLINE uint16_t LL_USART_ReceiveData9(const USART_TypeDef *USARTx) +{ + return (uint16_t)(READ_BIT(USARTx->RDR, USART_RDR_RDR)); +} + +/** + * @brief Write in Transmitter Data Register (Transmit Data value, 8 bits) + * @rmtoll TDR TDR LL_USART_TransmitData8 + * @param USARTx USART Instance + * @param Value between Min_Data=0x00 and Max_Data=0xFF + * @retval None + */ +__STATIC_INLINE void LL_USART_TransmitData8(USART_TypeDef *USARTx, uint8_t Value) +{ + USARTx->TDR = Value; +} + +/** + * @brief Write in Transmitter Data Register (Transmit Data value, 9 bits) + * @rmtoll TDR TDR LL_USART_TransmitData9 + * @param USARTx USART Instance + * @param Value between Min_Data=0x00 and Max_Data=0x1FF + * @retval None + */ +__STATIC_INLINE void LL_USART_TransmitData9(USART_TypeDef *USARTx, uint16_t Value) +{ + USARTx->TDR = (uint16_t)(Value & 0x1FFUL); +} + +/** + * @} + */ + +/** @defgroup USART_LL_EF_Execution Execution + * @{ + */ + +/** + * @brief Request an Automatic Baud Rate measurement on next received data frame + * @note Macro IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(USARTx) can be used to check whether or not + * Auto Baud Rate detection feature is supported by the USARTx instance. + * @rmtoll RQR ABRRQ LL_USART_RequestAutoBaudRate + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_RequestAutoBaudRate(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->RQR, (uint16_t)USART_RQR_ABRRQ); +} + +/** + * @brief Request Break sending + * @rmtoll RQR SBKRQ LL_USART_RequestBreakSending + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_RequestBreakSending(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->RQR, (uint16_t)USART_RQR_SBKRQ); +} + +/** + * @brief Put USART in mute mode and set the RWU flag + * @rmtoll RQR MMRQ LL_USART_RequestEnterMuteMode + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_RequestEnterMuteMode(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->RQR, (uint16_t)USART_RQR_MMRQ); +} + +/** + * @brief Request a Receive Data flush + * @note Allows to discard the received data without reading them, and avoid an overrun + * condition. + * @rmtoll RQR RXFRQ LL_USART_RequestRxDataFlush + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_RequestRxDataFlush(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->RQR, (uint16_t)USART_RQR_RXFRQ); +} + +/** + * @brief Request a Transmit data flush + * @note Macro IS_SMARTCARD_INSTANCE(USARTx) can be used to check whether or not + * Smartcard feature is supported by the USARTx instance. + * @rmtoll RQR TXFRQ LL_USART_RequestTxDataFlush + * @param USARTx USART Instance + * @retval None + */ +__STATIC_INLINE void LL_USART_RequestTxDataFlush(USART_TypeDef *USARTx) +{ + SET_BIT(USARTx->RQR, (uint16_t)USART_RQR_TXFRQ); +} + +/** + * @} + */ + +#if defined(USE_FULL_LL_DRIVER) +/** @defgroup USART_LL_EF_Init Initialization and de-initialization functions + * @{ + */ +ErrorStatus LL_USART_DeInit(const USART_TypeDef *USARTx); +ErrorStatus LL_USART_Init(USART_TypeDef *USARTx, const LL_USART_InitTypeDef *USART_InitStruct); +void LL_USART_StructInit(LL_USART_InitTypeDef *USART_InitStruct); +ErrorStatus LL_USART_ClockInit(USART_TypeDef *USARTx, const LL_USART_ClockInitTypeDef *USART_ClockInitStruct); +void LL_USART_ClockStructInit(LL_USART_ClockInitTypeDef *USART_ClockInitStruct); +/** + * @} + */ +#endif /* USE_FULL_LL_DRIVER */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* USART1 || USART2 || USART3 || UART4 || UART5 */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* STM32F3xx_LL_USART_H */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_utils.h b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_utils.h new file mode 100644 index 0000000..93613bb --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_ll_utils.h @@ -0,0 +1,280 @@ +/** + ****************************************************************************** + * @file stm32f3xx_ll_utils.h + * @author MCD Application Team + * @brief Header file of UTILS LL module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + The LL UTILS driver contains a set of generic APIs that can be + used by user: + (+) Device electronic signature + (+) Timing functions + (+) PLL configuration functions + + @endverbatim + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32F3xx_LL_UTILS_H +#define __STM32F3xx_LL_UTILS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx.h" + +/** @addtogroup STM32F3xx_LL_Driver + * @{ + */ + +/** @defgroup UTILS_LL UTILS + * @{ + */ + +/* Private types -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ +/** @defgroup UTILS_LL_Private_Constants UTILS Private Constants + * @{ + */ + +/* Max delay can be used in LL_mDelay */ +#define LL_MAX_DELAY 0xFFFFFFFFU + +/** + * @brief Unique device ID register base address + */ +#define UID_BASE_ADDRESS UID_BASE + +/** + * @brief Flash size data register base address + */ +#define FLASHSIZE_BASE_ADDRESS FLASHSIZE_BASE + +/** + * @brief Package data register base address + */ +#define PACKAGE_BASE_ADDRESS PACKAGE_BASE + +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @defgroup UTILS_LL_Private_Macros UTILS Private Macros + * @{ + */ +/** + * @} + */ +/* Exported types ------------------------------------------------------------*/ +/** @defgroup UTILS_LL_ES_INIT UTILS Exported structures + * @{ + */ +/** + * @brief UTILS PLL structure definition + */ +typedef struct +{ + uint32_t PLLMul; /*!< Multiplication factor for PLL VCO input clock. + This parameter can be a value of @ref RCC_LL_EC_PLL_MUL + + This feature can be modified afterwards using unitary function + @ref LL_RCC_PLL_ConfigDomain_SYS(). */ + +#if defined(RCC_PLLSRC_PREDIV1_SUPPORT) + uint32_t PLLDiv; /*!< Division factor for PLL VCO output clock. + This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV + + This feature can be modified afterwards using unitary function + @ref LL_RCC_PLL_ConfigDomain_SYS(). */ +#else + uint32_t Prediv; /*!< Division factor for HSE used as PLL clock source. + This parameter can be a value of @ref RCC_LL_EC_PREDIV_DIV + + This feature can be modified afterwards using unitary function + @ref LL_RCC_PLL_ConfigDomain_SYS(). */ +#endif /* RCC_PLLSRC_PREDIV1_SUPPORT */ +} LL_UTILS_PLLInitTypeDef; + +/** + * @brief UTILS System, AHB and APB buses clock configuration structure definition + */ +typedef struct +{ + uint32_t AHBCLKDivider; /*!< The AHB clock (HCLK) divider. This clock is derived from the system clock (SYSCLK). + This parameter can be a value of @ref RCC_LL_EC_SYSCLK_DIV + + This feature can be modified afterwards using unitary function + @ref LL_RCC_SetAHBPrescaler(). */ + + uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the AHB clock (HCLK). + This parameter can be a value of @ref RCC_LL_EC_APB1_DIV + + This feature can be modified afterwards using unitary function + @ref LL_RCC_SetAPB1Prescaler(). */ + + uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the AHB clock (HCLK). + This parameter can be a value of @ref RCC_LL_EC_APB2_DIV + + This feature can be modified afterwards using unitary function + @ref LL_RCC_SetAPB2Prescaler(). */ + +} LL_UTILS_ClkInitTypeDef; + +/** + * @} + */ + +/* Exported constants --------------------------------------------------------*/ +/** @defgroup UTILS_LL_Exported_Constants UTILS Exported Constants + * @{ + */ + +/** @defgroup UTILS_EC_HSE_BYPASS HSE Bypass activation + * @{ + */ +#define LL_UTILS_HSEBYPASS_OFF 0x00000000U /*!< HSE Bypass is not enabled */ +#define LL_UTILS_HSEBYPASS_ON 0x00000001U /*!< HSE Bypass is enabled */ +/** + * @} + */ + +/** + * @} + */ + +/* Exported macro ------------------------------------------------------------*/ + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup UTILS_LL_Exported_Functions UTILS Exported Functions + * @{ + */ + +/** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE + * @{ + */ + +/** + * @brief Get Word0 of the unique device identifier (UID based on 96 bits) + * @retval UID[31:0]: X and Y coordinates on the wafer expressed in BCD format + */ +__STATIC_INLINE uint32_t LL_GetUID_Word0(void) +{ + return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS))); +} + +/** + * @brief Get Word1 of the unique device identifier (UID based on 96 bits) + * @retval UID[63:32]: Wafer number (UID[39:32]) & LOT_NUM[23:0] (UID[63:40]) + */ +__STATIC_INLINE uint32_t LL_GetUID_Word1(void) +{ + return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U)))); +} + +/** + * @brief Get Word2 of the unique device identifier (UID based on 96 bits) + * @retval UID[95:64]: Lot number (ASCII encoded) - LOT_NUM[55:24] + */ +__STATIC_INLINE uint32_t LL_GetUID_Word2(void) +{ + return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U)))); +} + +/** + * @brief Get Flash memory size + * @note This bitfield indicates the size of the device Flash memory expressed in + * Kbytes. As an example, 0x040 corresponds to 64 Kbytes. + * @retval FLASH_SIZE[15:0]: Flash memory size + */ +__STATIC_INLINE uint32_t LL_GetFlashSize(void) +{ + return (uint16_t)(READ_REG(*((uint32_t *)FLASHSIZE_BASE_ADDRESS))); +} + + +/** + * @} + */ + +/** @defgroup UTILS_LL_EF_DELAY DELAY + * @{ + */ + +/** + * @brief This function configures the Cortex-M SysTick source of the time base. + * @param HCLKFrequency HCLK frequency in Hz (can be calculated thanks to RCC helper macro) + * @note When a RTOS is used, it is recommended to avoid changing the SysTick + * configuration by calling this function, for a delay use rather osDelay RTOS service. + * @param Ticks Number of ticks + * @retval None + */ +__STATIC_INLINE void LL_InitTick(uint32_t HCLKFrequency, uint32_t Ticks) +{ + /* Configure the SysTick to have interrupt in 1ms time base */ + SysTick->LOAD = (uint32_t)((HCLKFrequency / Ticks) - 1UL); /* set reload register */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable the Systick Timer */ +} + +void LL_Init1msTick(uint32_t HCLKFrequency); +void LL_mDelay(uint32_t Delay); + +/** + * @} + */ + +/** @defgroup UTILS_EF_SYSTEM SYSTEM + * @{ + */ + +void LL_SetSystemCoreClock(uint32_t HCLKFrequency); +#if defined(FLASH_ACR_LATENCY) +ErrorStatus LL_SetFlashLatency(uint32_t Frequency); +#endif /* FLASH_ACR_LATENCY */ +ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, + LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct); +ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypass, + LL_UTILS_PLLInitTypeDef *UTILS_PLLInitStruct, LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct); + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32F3xx_LL_UTILS_H */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/LICENSE.txt b/Software/Code/Drivers/STM32F3xx_HAL_Driver/LICENSE.txt new file mode 100644 index 0000000..3edc4d1 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/LICENSE.txt @@ -0,0 +1,6 @@ +This software component is provided to you as part of a software package and +applicable license terms are in the Package_license file. If you received this +software component outside of a package or without applicable license terms, +the terms of the BSD-3-Clause license shall apply. +You may obtain a copy of the BSD-3-Clause at: +https://opensource.org/licenses/BSD-3-Clause diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c new file mode 100644 index 0000000..68d8338 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c @@ -0,0 +1,532 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal.c + * @author MCD Application Team + * @brief HAL module driver. + * This is the common part of the HAL initialization + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + The common HAL driver contains a set of generic and common APIs that can be + used by the PPP peripheral drivers and the user to start using the HAL. + [..] + The HAL contains two APIs categories: + (+) HAL Initialization and de-initialization functions + (+) HAL Control functions + + @endverbatim + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup HAL HAL + * @brief HAL module driver. + * @{ + */ + +#ifdef HAL_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup HAL_Private Constants + * @{ + */ +/** + * @brief STM32F3xx HAL Driver version number V1.5.7 + */ +#define __STM32F3xx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */ +#define __STM32F3xx_HAL_VERSION_SUB1 (0x05U) /*!< [23:16] sub1 version */ +#define __STM32F3xx_HAL_VERSION_SUB2 (0x07U) /*!< [15:8] sub2 version */ +#define __STM32F3xx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */ +#define __STM32F3xx_HAL_VERSION ((__STM32F3xx_HAL_VERSION_MAIN << 24U)\ + |(__STM32F3xx_HAL_VERSION_SUB1 << 16U)\ + |(__STM32F3xx_HAL_VERSION_SUB2 << 8U )\ + |(__STM32F3xx_HAL_VERSION_RC)) + +#define IDCODE_DEVID_MASK (0x00000FFFU) +/** + * @} + */ + +/* Private macro -------------------------------------------------------------*/ +/* Exported variables --------------------------------------------------------*/ +/** @defgroup HAL_Exported_Variables HAL Exported Variables + * @{ + */ +__IO uint32_t uwTick; +uint32_t uwTickPrio = (1UL << __NVIC_PRIO_BITS); /* Invalid PRIO */ +HAL_TickFreqTypeDef uwTickFreq = HAL_TICK_FREQ_DEFAULT; /* 1KHz */ +/** + * @} + */ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions ---------------------------------------------------------*/ + +/** @defgroup HAL_Exported_Functions HAL Exported Functions + * @{ + */ + +/** @defgroup HAL_Exported_Functions_Group1 Initialization and de-initialization Functions + * @brief Initialization and de-initialization functions + * +@verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Initializes the Flash interface, the NVIC allocation and initial clock + configuration. It initializes the systick also when timeout is needed + and the backup domain when enabled. + (+) de-Initializes common part of the HAL. + (+) Configure The time base source to have 1ms time base with a dedicated + Tick interrupt priority. + (++) SysTick timer is used by default as source of time base, but user + can eventually implement his proper time base source (a general purpose + timer for example or other time source), keeping in mind that Time base + duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and + handled in milliseconds basis. + (++) Time base configuration function (HAL_InitTick ()) is called automatically + at the beginning of the program after reset by HAL_Init() or at any time + when clock is configured, by HAL_RCC_ClockConfig(). + (++) Source of time base is configured to generate interrupts at regular + time intervals. Care must be taken if HAL_Delay() is called from a + peripheral ISR process, the Tick interrupt line must have higher priority + (numerically lower) than the peripheral interrupt. Otherwise the caller + ISR process will be blocked. + (++) functions affecting time base configurations are declared as __Weak + to make override possible in case of other implementations in user file. + +@endverbatim + * @{ + */ + +/** + * @brief This function configures the Flash prefetch, + * Configures time base source, NVIC and Low level hardware + * @note This function is called at the beginning of program after reset and before + * the clock configuration + * + * @note The Systick configuration is based on HSI clock, as HSI is the clock + * used after a system Reset and the NVIC configuration is set to Priority group 4 + * + * @note The time base configuration is based on MSI clock when exiting from Reset. + * Once done, time base tick start incrementing. + * In the default implementation,Systick is used as source of time base. + * The tick variable is incremented each 1ms in its ISR. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_Init(void) +{ + /* Configure Flash prefetch */ +#if (PREFETCH_ENABLE != 0U) + __HAL_FLASH_PREFETCH_BUFFER_ENABLE(); +#endif /* PREFETCH_ENABLE */ + + /* Set Interrupt Group Priority */ + HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); + + /* Enable systick and configure 1ms tick (default clock after Reset is HSI) */ + HAL_InitTick(TICK_INT_PRIORITY); + + /* Init the low level hardware */ + HAL_MspInit(); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief This function de-Initializes common part of the HAL and stops the systick. + * @note This function is optional. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DeInit(void) +{ + /* Reset of all peripherals */ + __HAL_RCC_APB1_FORCE_RESET(); + __HAL_RCC_APB1_RELEASE_RESET(); + + __HAL_RCC_APB2_FORCE_RESET(); + __HAL_RCC_APB2_RELEASE_RESET(); + + __HAL_RCC_AHB_FORCE_RESET(); + __HAL_RCC_AHB_RELEASE_RESET(); + + /* De-Init the low level hardware */ + HAL_MspDeInit(); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Initialize the MSP. + * @retval None + */ +__weak void HAL_MspInit(void) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitialize the MSP. + * @retval None + */ +__weak void HAL_MspDeInit(void) +{ + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_MspDeInit could be implemented in the user file + */ +} + +/** + * @brief This function configures the source of the time base. + * The time source is configured to have 1ms time base with a dedicated + * Tick interrupt priority. + * @note This function is called automatically at the beginning of program after + * reset by HAL_Init() or at any time when clock is reconfigured by HAL_RCC_ClockConfig(). + * @note In the default implementation , SysTick timer is the source of time base. + * It is used to generate interrupts at regular time intervals. + * Care must be taken if HAL_Delay() is called from a peripheral ISR process, + * The SysTick interrupt must have higher priority (numerically lower) + * than the peripheral interrupt. Otherwise the caller ISR process will be blocked. + * The function is declared as __Weak to be overwritten in case of other + * implementation in user file. + * @param TickPriority Tick interrupt priority. + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) +{ + /* Configure the SysTick to have interrupt in 1ms time basis*/ + if (HAL_SYSTICK_Config(SystemCoreClock / (1000U / uwTickFreq)) > 0U) + { + return HAL_ERROR; + } + + /* Configure the SysTick IRQ priority */ + if (TickPriority < (1UL << __NVIC_PRIO_BITS)) + { + HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority, 0U); + uwTickPrio = TickPriority; + } + else + { + return HAL_ERROR; + } + /* Return function status */ + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup HAL_Exported_Functions_Group2 HAL Control functions + * @brief HAL Control functions + * +@verbatim + =============================================================================== + ##### HAL Control functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Provide a tick value in millisecond + (+) Provide a blocking delay in millisecond + (+) Suspend the time base source interrupt + (+) Resume the time base source interrupt + (+) Get the HAL API driver version + (+) Get the device identifier + (+) Get the device revision identifier + (+) Enable/Disable Debug module during Sleep mode + (+) Enable/Disable Debug module during STOP mode + (+) Enable/Disable Debug module during STANDBY mode + +@endverbatim + * @{ + */ + +/** + * @brief This function is called to increment a global variable "uwTick" + * used as application time base. + * @note In the default implementation, this variable is incremented each 1ms + * in SysTick ISR. + * @note This function is declared as __weak to be overwritten in case of other + * implementations in user file. + * @retval None + */ +__weak void HAL_IncTick(void) +{ + uwTick += uwTickFreq; +} + +/** + * @brief Povides a tick value in millisecond. + * @note The function is declared as __Weak to be overwritten in case of other + * implementations in user file. + * @retval tick value + */ +__weak uint32_t HAL_GetTick(void) +{ + return uwTick; +} + +/** + * @brief This function returns a tick priority. + * @retval tick priority + */ +uint32_t HAL_GetTickPrio(void) +{ + return uwTickPrio; +} + +/** + * @brief Set new tick Freq. + * @retval status + */ +HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq) +{ + HAL_StatusTypeDef status = HAL_OK; + HAL_TickFreqTypeDef prevTickFreq; + + assert_param(IS_TICKFREQ(Freq)); + + if (uwTickFreq != Freq) + { + /* Back up uwTickFreq frequency */ + prevTickFreq = uwTickFreq; + + /* Update uwTickFreq global variable used by HAL_InitTick() */ + uwTickFreq = Freq; + + /* Apply the new tick Freq */ + status = HAL_InitTick(uwTickPrio); + + if (status != HAL_OK) + { + /* Restore previous tick frequency */ + uwTickFreq = prevTickFreq; + } + } + + return status; +} + +/** + * @brief Return tick frequency. + * @retval Tick frequency. + * Value of @ref HAL_TickFreqTypeDef. + */ +HAL_TickFreqTypeDef HAL_GetTickFreq(void) +{ + return uwTickFreq; +} + +/** + * @brief This function provides accurate delay (in milliseconds) based + * on variable incremented. + * @note In the default implementation , SysTick timer is the source of time base. + * It is used to generate interrupts at regular time intervals where uwTick + * is incremented. + * The function is declared as __Weak to be overwritten in case of other + * implementations in user file. + * @param Delay specifies the delay time length, in milliseconds. + * @retval None + */ +__weak void HAL_Delay(uint32_t Delay) +{ + uint32_t tickstart = HAL_GetTick(); + uint32_t wait = Delay; + + /* Add freq to guarantee minimum wait */ + if (wait < HAL_MAX_DELAY) + { + wait += (uint32_t)(uwTickFreq); + } + + while((HAL_GetTick() - tickstart) < wait) + { + } +} + +/** + * @brief Suspend Tick increment. + * @note In the default implementation , SysTick timer is the source of time base. It is + * used to generate interrupts at regular time intervals. Once HAL_SuspendTick() + * is called, the the SysTick interrupt will be disabled and so Tick increment + * is suspended. + * @note This function is declared as __weak to be overwritten in case of other + * implementations in user file. + * @retval None + */ +__weak void HAL_SuspendTick(void) + +{ + /* Disable SysTick Interrupt */ + SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk; + +} + +/** + * @brief Resume Tick increment. + * @note In the default implementation , SysTick timer is the source of time base. It is + * used to generate interrupts at regular time intervals. Once HAL_ResumeTick() + * is called, the the SysTick interrupt will be enabled and so Tick increment + * is resumed. + * The function is declared as __Weak to be overwritten in case of other + * implementations in user file. + * @retval None + */ +__weak void HAL_ResumeTick(void) +{ + /* Enable SysTick Interrupt */ + SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; + +} + +/** + * @brief This function returns the HAL revision + * @retval version 0xXYZR (8bits for each decimal, R for RC) + */ +uint32_t HAL_GetHalVersion(void) +{ + return __STM32F3xx_HAL_VERSION; +} + +/** + * @brief Returns the device revision identifier. + * @retval Device revision identifier + */ +uint32_t HAL_GetREVID(void) +{ + return((DBGMCU->IDCODE) >> 16U); +} + +/** + * @brief Returns the device identifier. + * @retval Device identifier + */ +uint32_t HAL_GetDEVID(void) +{ + return((DBGMCU->IDCODE) & IDCODE_DEVID_MASK); +} + +/** + * @brief Returns first word of the unique device identifier (UID based on 96 bits) + * @retval Device identifier + */ +uint32_t HAL_GetUIDw0(void) +{ + return(READ_REG(*((uint32_t *)UID_BASE))); +} + +/** + * @brief Returns second word of the unique device identifier (UID based on 96 bits) + * @retval Device identifier + */ +uint32_t HAL_GetUIDw1(void) +{ + return(READ_REG(*((uint32_t *)(UID_BASE + 4U)))); +} + +/** + * @brief Returns third word of the unique device identifier (UID based on 96 bits) + * @retval Device identifier + */ +uint32_t HAL_GetUIDw2(void) +{ + return(READ_REG(*((uint32_t *)(UID_BASE + 8U)))); +} + +/** + * @brief Enable the Debug Module during SLEEP mode + * @retval None + */ +void HAL_DBGMCU_EnableDBGSleepMode(void) +{ + SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP); +} + +/** + * @brief Disable the Debug Module during SLEEP mode + * @retval None + */ +void HAL_DBGMCU_DisableDBGSleepMode(void) +{ + CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP); +} + +/** + * @brief Enable the Debug Module during STOP mode + * @retval None + */ +void HAL_DBGMCU_EnableDBGStopMode(void) +{ + SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP); +} + +/** + * @brief Disable the Debug Module during STOP mode + * @retval None + */ +void HAL_DBGMCU_DisableDBGStopMode(void) +{ + CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STOP); +} + +/** + * @brief Enable the Debug Module during STANDBY mode + * @retval None + */ +void HAL_DBGMCU_EnableDBGStandbyMode(void) +{ + SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); +} + +/** + * @brief Disable the Debug Module during STANDBY mode + * @retval None + */ +void HAL_DBGMCU_DisableDBGStandbyMode(void) +{ + CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_STANDBY); +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc.c new file mode 100644 index 0000000..7f322d6 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc.c @@ -0,0 +1,1203 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_adc.c + * @author MCD Application Team + * @brief This file provides firmware functions to manage the following + * functionalities of the Analog to Digital Convertor (ADC) + * peripheral: + * + Initialization and de-initialization functions + * + Peripheral Control functions + * + Peripheral State functions + * Other functions (extended functions) are available in file + * "stm32f3xx_hal_adc_ex.c". + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### ADC peripheral features ##### + ============================================================================== + [..] + (+) 12-bit, 10-bit, 8-bit or 6-bit configurable resolution (available only on + STM32F30xxC devices). + + (+) Interrupt generation at the end of regular conversion, end of injected + conversion, and in case of analog watchdog or overrun events. + + (+) Single and continuous conversion modes. + + (+) Scan mode for conversion of several channels sequentially. + + (+) Data alignment with in-built data coherency. + + (+) Programmable sampling time (channel wise) + + (+) ADC conversion of regular group and injected group. + + (+) External trigger (timer or EXTI) with configurable polarity + for both regular and injected groups. + + (+) DMA request generation for transfer of conversions data of regular group. + + (+) Multimode dual mode (available on devices with 2 ADCs or more). + + (+) Configurable DMA data storage in Multimode Dual mode (available on devices + with 2 DCs or more). + + (+) Configurable delay between conversions in Dual interleaved mode (available + on devices with 2 DCs or more). + + (+) ADC calibration + + (+) ADC channels selectable single/differential input (available only on + STM32F30xxC devices) + + (+) ADC Injected sequencer&channels configuration context queue (available + only on STM32F30xxC devices) + + (+) ADC offset on injected and regular groups (offset on regular group + available only on STM32F30xxC devices) + + (+) ADC supply requirements: 2.4 V to 3.6 V at full speed and down to 1.8 V at + slower speed. + + (+) ADC input range: from Vref- (connected to Vssa) to Vref+ (connected to + Vdda or to an external voltage reference). + + + ##### How to use this driver ##### + ============================================================================== + [..] + + *** Configuration of top level parameters related to ADC *** + ============================================================ + [..] + + (#) Enable the ADC interface + (++) As prerequisite, ADC clock must be configured at RCC top level. + + (++) For STM32F30x/STM32F33x devices: + Two possible clock sources: synchronous clock derived from AHB clock + or asynchronous clock derived from ADC dedicated PLL 72MHz. + - Synchronous clock is mandatory since used as ADC core clock. + Synchronous clock can be used optionally as ADC conversion clock, depending on ADC init structure clock setting. + Synchronous clock is configured using macro __ADCx_CLK_ENABLE(). + - Asynchronous can be used optionally as ADC conversion clock, depending on ADC init structure clock setting. + Asynchronous clock is configured using function HAL_RCCEx_PeriphCLKConfig(). + (+++) For example, in case of device with a single ADC: + Into HAL_ADC_MspInit() (recommended code location) or with + other device clock parameters configuration: + (+++) __HAL_RCC_ADC1_CLK_ENABLE() (mandatory) + (+++) PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC (optional, if ADC conversion from asynchronous clock) + (+++) PeriphClkInit.Adc1ClockSelection = RCC_ADC1PLLCLK_DIV1 (optional, if ADC conversion from asynchronous clock) + (+++) HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInitStructure) (optional, if ADC conversion from asynchronous clock) + + (+++) For example, in case of device with 4 ADCs: + + (+++) if((hadc->Instance == ADC1) || (hadc->Instance == ADC2)) + (+++) { + (+++) __HAL_RCC_ADC12_CLK_ENABLE() (mandatory) + (+++) PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC (optional, if ADC conversion from asynchronous clock) + (+++) PeriphClkInit.Adc12ClockSelection = RCC_ADC12PLLCLK_DIV1 (optional, if ADC conversion from asynchronous clock) + (+++) HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInitStructure) (optional, if ADC conversion from asynchronous clock) + (+++) } + (+++) else + (+++) { + (+++) __HAL_RCC_ADC34_CLK_ENABLE() (mandatory) + (+++) PeriphClkInit.Adc34ClockSelection = RCC_ADC34PLLCLK_DIV1; (optional, if ADC conversion from asynchronous clock) + (+++) HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInitStructure); (optional, if ADC conversion from asynchronous clock) + (+++) } + + (++) For STM32F37x devices: + One clock setting is mandatory: + ADC clock (core and conversion clock) from APB2 clock. + (+++) Example: + Into HAL_ADC_MspInit() (recommended code location) or with + other device clock parameters configuration: + (+++) PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC + (+++) PeriphClkInit.AdcClockSelection = RCC_ADCPLLCLK_DIV2 + (+++) HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) + + (#) ADC pins configuration + (++) Enable the clock for the ADC GPIOs + using macro __HAL_RCC_GPIOx_CLK_ENABLE() + (++) Configure these ADC pins in analog mode + using function HAL_GPIO_Init() + + (#) Optionally, in case of usage of ADC with interruptions: + (++) Configure the NVIC for ADC + using function HAL_NVIC_EnableIRQ(ADCx_IRQn) + (++) Insert the ADC interruption handler function HAL_ADC_IRQHandler() + into the function of corresponding ADC interruption vector + ADCx_IRQHandler(). + + (#) Optionally, in case of usage of DMA: + (++) Configure the DMA (DMA channel, mode normal or circular, ...) + using function HAL_DMA_Init(). + (++) Configure the NVIC for DMA + using function HAL_NVIC_EnableIRQ(DMAx_Channelx_IRQn) + (++) Insert the ADC interruption handler function HAL_ADC_IRQHandler() + into the function of corresponding DMA interruption vector + DMAx_Channelx_IRQHandler(). + + *** Configuration of ADC, groups regular/injected, channels parameters *** + ========================================================================== + [..] + + (#) Configure the ADC parameters (resolution, data alignment, ...) + and regular group parameters (conversion trigger, sequencer, ...) + using function HAL_ADC_Init(). + + (#) Configure the channels for regular group parameters (channel number, + channel rank into sequencer, ..., into regular group) + using function HAL_ADC_ConfigChannel(). + + (#) Optionally, configure the injected group parameters (conversion trigger, + sequencer, ..., of injected group) + and the channels for injected group parameters (channel number, + channel rank into sequencer, ..., into injected group) + using function HAL_ADCEx_InjectedConfigChannel(). + + (#) Optionally, configure the analog watchdog parameters (channels + monitored, thresholds, ...) + using function HAL_ADC_AnalogWDGConfig(). + + (#) Optionally, for devices with several ADC instances: configure the + multimode parameters + using function HAL_ADCEx_MultiModeConfigChannel(). + + *** Execution of ADC conversions *** + ==================================== + [..] + + (#) Optionally, perform an automatic ADC calibration to improve the + conversion accuracy + using function HAL_ADCEx_Calibration_Start(). + + (#) ADC driver can be used among three modes: polling, interruption, + transfer by DMA. + + (++) ADC conversion by polling: + (+++) Activate the ADC peripheral and start conversions + using function HAL_ADC_Start() + (+++) Wait for ADC conversion completion + using function HAL_ADC_PollForConversion() + (or for injected group: HAL_ADCEx_InjectedPollForConversion() ) + (+++) Retrieve conversion results + using function HAL_ADC_GetValue() + (or for injected group: HAL_ADCEx_InjectedGetValue() ) + (+++) Stop conversion and disable the ADC peripheral + using function HAL_ADC_Stop() + + (++) ADC conversion by interruption: + (+++) Activate the ADC peripheral and start conversions + using function HAL_ADC_Start_IT() + (+++) Wait for ADC conversion completion by call of function + HAL_ADC_ConvCpltCallback() + (this function must be implemented in user program) + (or for injected group: HAL_ADCEx_InjectedConvCpltCallback() ) + (+++) Retrieve conversion results + using function HAL_ADC_GetValue() + (or for injected group: HAL_ADCEx_InjectedGetValue() ) + (+++) Stop conversion and disable the ADC peripheral + using function HAL_ADC_Stop_IT() + + (++) ADC conversion with transfer by DMA: + (+++) Activate the ADC peripheral and start conversions + using function HAL_ADC_Start_DMA() + (+++) Wait for ADC conversion completion by call of function + HAL_ADC_ConvCpltCallback() or HAL_ADC_ConvHalfCpltCallback() + (these functions must be implemented in user program) + (+++) Conversion results are automatically transferred by DMA into + destination variable address. + (+++) Stop conversion and disable the ADC peripheral + using function HAL_ADC_Stop_DMA() + + (++) For devices with several ADCs: ADC multimode conversion + with transfer by DMA: + (+++) Activate the ADC peripheral (slave) + using function HAL_ADC_Start() + (conversion start pending ADC master) + (+++) Activate the ADC peripheral (master) and start conversions + using function HAL_ADCEx_MultiModeStart_DMA() + (+++) Wait for ADC conversion completion by call of function + HAL_ADC_ConvCpltCallback() or HAL_ADC_ConvHalfCpltCallback() + (these functions must be implemented in user program) + (+++) Conversion results are automatically transferred by DMA into + destination variable address. + (+++) Stop conversion and disable the ADC peripheral (master) + using function HAL_ADCEx_MultiModeStop_DMA() + (+++) Stop conversion and disable the ADC peripheral (slave) + using function HAL_ADC_Stop_IT() + + [..] + + (@) Callback functions must be implemented in user program: + (+@) HAL_ADC_ErrorCallback() + (+@) HAL_ADC_LevelOutOfWindowCallback() (callback of analog watchdog) + (+@) HAL_ADC_ConvCpltCallback() + (+@) HAL_ADC_ConvHalfCpltCallback + (+@) HAL_ADCEx_InjectedConvCpltCallback() + (+@) HAL_ADCEx_InjectedQueueOverflowCallback() (for STM32F30x/STM32F33x devices) + + *** Deinitialization of ADC *** + ============================================================ + [..] + + (#) Disable the ADC interface + (++) ADC clock can be hard reset and disabled at RCC top level. + (++) Hard reset of ADC peripherals + using macro __ADCx_FORCE_RESET(), __ADCx_RELEASE_RESET(). + (++) ADC clock disable + using the equivalent macro/functions as configuration step. + + (++) For STM32F30x/STM32F33x devices: + Caution: For devices with several ADCs: + These settings impact both ADC of common group: ADC1&ADC2, ADC3&ADC4 + if available (ADC2, ADC3, ADC4 availability depends on STM32 product) + + (+++) For example, in case of device with a single ADC: + Into HAL_ADC_MspDeInit() (recommended code location) or with + other device clock parameters configuration: + (+++) __HAL_RCC_ADC1_FORCE_RESET() (optional) + (+++) __HAL_RCC_ADC1_RELEASE_RESET() (optional) + (+++) __HAL_RCC_ADC1_CLK_DISABLE() (mandatory) + (+++) PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC (optional, if configured before) + (+++) PeriphClkInit.Adc1ClockSelection = RCC_ADC1PLLCLK_OFF (optional, if configured before) + (+++) HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInitStructure) (optional, if configured before) + + (+++) For example, in case of device with 4 ADCs: + (+++) if((hadc->Instance == ADC1) || (hadc->Instance == ADC2)) + (+++) { + (+++) __HAL_RCC_ADC12_FORCE_RESET() (optional) + (+++) __HAL_RCC_ADC12_RELEASE_RESET() (optional) + (+++) __HAL_RCC_ADC12_CLK_DISABLE() (mandatory) + (+++) PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC (optional, if configured before) + (+++) PeriphClkInit.Adc12ClockSelection = RCC_ADC12PLLCLK_OFF (optional, if configured before) + (+++) HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInitStructure) (optional, if configured before) + (+++) } + (+++) else + (+++) { + (+++) __HAL_RCC_ADC32_FORCE_RESET() (optional) + (+++) __HAL_RCC_ADC32_RELEASE_RESET() (optional) + (+++) __HAL_RCC_ADC34_CLK_DISABLE() (mandatory) + (+++) PeriphClkInit.Adc34ClockSelection = RCC_ADC34PLLCLK_OFF (optional, if configured before) + (+++) HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphClkInitStructure) (optional, if configured before) + (+++) } + + (++) For STM32F37x devices: + (+++) Example: + Into HAL_ADC_MspDeInit() (recommended code location) or with + other device clock parameters configuration: + (+++) PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC + (+++) PeriphClkInit.AdcClockSelection = RCC_ADCPLLCLK_OFF + (+++) HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) + + (#) ADC pins configuration + (++) Disable the clock for the ADC GPIOs + using macro __HAL_RCC_GPIOx_CLK_DISABLE() + + (#) Optionally, in case of usage of ADC with interruptions: + (++) Disable the NVIC for ADC + using function HAL_NVIC_DisableIRQ(ADCx_IRQn) + + (#) Optionally, in case of usage of DMA: + (++) Deinitialize the DMA + using function HAL_DMA_DeInit(). + (++) Disable the NVIC for DMA + using function HAL_NVIC_DisableIRQ(DMAx_Channelx_IRQn) + + [..] + + *** Callback registration *** + ============================================= + [..] + + The compilation flag USE_HAL_ADC_REGISTER_CALLBACKS, when set to 1, + allows the user to configure dynamically the driver callbacks. + Use Functions HAL_ADC_RegisterCallback() + to register an interrupt callback. + [..] + + Function HAL_ADC_RegisterCallback() allows to register following callbacks: + (+) ConvCpltCallback : ADC conversion complete callback + (+) ConvHalfCpltCallback : ADC conversion DMA half-transfer callback + (+) LevelOutOfWindowCallback : ADC analog watchdog 1 callback + (+) ErrorCallback : ADC error callback + (+) InjectedConvCpltCallback : ADC group injected conversion complete callback + (+) MspInitCallback : ADC Msp Init callback + (+) MspDeInitCallback : ADC Msp DeInit callback + This function takes as parameters the HAL peripheral handle, the Callback ID + and a pointer to the user callback function. + [..] + + Use function HAL_ADC_UnRegisterCallback to reset a callback to the default + weak function. + [..] + + HAL_ADC_UnRegisterCallback takes as parameters the HAL peripheral handle, + and the Callback ID. + This function allows to reset following callbacks: + (+) ConvCpltCallback : ADC conversion complete callback + (+) ConvHalfCpltCallback : ADC conversion DMA half-transfer callback + (+) LevelOutOfWindowCallback : ADC analog watchdog 1 callback + (+) ErrorCallback : ADC error callback + (+) InjectedConvCpltCallback : ADC group injected conversion complete callback + (+) MspInitCallback : ADC Msp Init callback + (+) MspDeInitCallback : ADC Msp DeInit callback + [..] + + By default, after the HAL_ADC_Init() and when the state is HAL_ADC_STATE_RESET + all callbacks are set to the corresponding weak functions: + examples HAL_ADC_ConvCpltCallback(), HAL_ADC_ErrorCallback(). + Exception done for MspInit and MspDeInit functions that are + reset to the legacy weak functions in the HAL_ADC_Init()/ HAL_ADC_DeInit() only when + these callbacks are null (not registered beforehand). + [..] + + If MspInit or MspDeInit are not null, the HAL_ADC_Init()/ HAL_ADC_DeInit() + keep and use the user MspInit/MspDeInit callbacks (registered beforehand) whatever the state. + [..] + + Callbacks can be registered/unregistered in HAL_ADC_STATE_READY state only. + Exception done MspInit/MspDeInit functions that can be registered/unregistered + in HAL_ADC_STATE_READY or HAL_ADC_STATE_RESET state, + thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit. + [..] + + Then, the user first registers the MspInit/MspDeInit user callbacks + using HAL_ADC_RegisterCallback() before calling HAL_ADC_DeInit() + or HAL_ADC_Init() function. + [..] + + When the compilation flag USE_HAL_ADC_REGISTER_CALLBACKS is set to 0 or + not defined, the callback registration feature is not available and all callbacks + are set to the corresponding weak functions. + + @endverbatim + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup ADC ADC + * @brief ADC HAL module driver + * @{ + */ + +#ifdef HAL_ADC_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup ADC_Exported_Functions ADC Exported Functions + * @{ + */ + +/** @defgroup ADC_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Initialize and configure the ADC. + (+) De-initialize the ADC. + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the ADC peripheral and regular group according to + * parameters specified in structure "ADC_InitTypeDef". + * @note As prerequisite, ADC clock must be configured at RCC top level + * depending on both possible clock sources: PLL clock or AHB clock. + * See commented example code below that can be copied and uncommented + * into HAL_ADC_MspInit(). + * @note Possibility to update parameters on the fly: + * This function initializes the ADC MSP (HAL_ADC_MspInit()) only when + * coming from ADC state reset. Following calls to this function can + * be used to reconfigure some parameters of ADC_InitTypeDef + * structure on the fly, without modifying MSP configuration. If ADC + * MSP has to be modified again, HAL_ADC_DeInit() must be called + * before HAL_ADC_Init(). + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_InitTypeDef". + * @note This function configures the ADC within 2 scopes: scope of entire + * ADC and scope of regular group. For parameters details, see comments + * of structure "ADC_InitTypeDef". + * @note For devices with several ADCs: parameters related to common ADC + * registers (ADC clock mode) are set only if all ADCs sharing the + * same common group are disabled. + * If this is not the case, these common parameters setting are + * bypassed without error reporting: it can be the intended behaviour in + * case of update of a parameter of ADC_InitTypeDef on the fly, + * without disabling the other ADCs sharing the same common group. + * @param hadc ADC handle + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Deinitialize the ADC peripheral registers to their default reset + * values, with deinitialization of the ADC MSP. + * @note For devices with several ADCs: reset of ADC common registers is done + * only if all ADCs sharing the same common group are disabled. + * If this is not the case, reset of these common parameters reset is + * bypassed without error reporting: it can be the intended behaviour in + * case of reset of a single ADC while the other ADCs sharing the same + * common group is still running. + * @note For devices with several ADCs: Global reset of all ADCs sharing a + * common group is possible. + * As this function is intended to reset a single ADC, to not impact + * other ADCs, instructions for global reset of multiple ADCs have been + * let commented below. + * If needed, the example code can be copied and uncommented into + * function HAL_ADC_MspDeInit(). + * @param hadc ADC handle + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Initializes the ADC MSP. + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADC_MspInit must be implemented in the user file. + */ +} + +/** + * @brief DeInitializes the ADC MSP. + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADC_MspDeInit must be implemented in the user file. + */ +} + +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) +/** + * @brief Register a User ADC Callback + * To be used instead of the weak predefined callback + * @param hadc Pointer to a ADC_HandleTypeDef structure that contains + * the configuration information for the specified ADC. + * @param CallbackID ID of the callback to be registered + * This parameter can be one of the following values: + * @arg @ref HAL_ADC_CONVERSION_COMPLETE_CB_ID ADC conversion complete callback ID + * @arg @ref HAL_ADC_CONVERSION_HALF_CB_ID ADC conversion complete callback ID + * @arg @ref HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID ADC analog watchdog 1 callback ID + * @arg @ref HAL_ADC_ERROR_CB_ID ADC error callback ID + * @arg @ref HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID ADC group injected conversion complete callback ID + * @arg @ref HAL_ADC_MSPINIT_CB_ID ADC Msp Init callback ID + * @arg @ref HAL_ADC_MSPDEINIT_CB_ID ADC Msp DeInit callback ID + * @arg @ref HAL_ADC_MSPINIT_CB_ID MspInit callback ID + * @arg @ref HAL_ADC_MSPDEINIT_CB_ID MspDeInit callback ID + * @param pCallback pointer to the Callback function + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_RegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID, pADC_CallbackTypeDef pCallback) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (pCallback == NULL) + { + /* Update the error code */ + hadc->ErrorCode |= HAL_ADC_ERROR_INVALID_CALLBACK; + + return HAL_ERROR; + } + + if ((hadc->State & HAL_ADC_STATE_READY) != 0) + { + switch (CallbackID) + { + case HAL_ADC_CONVERSION_COMPLETE_CB_ID : + hadc->ConvCpltCallback = pCallback; + break; + + case HAL_ADC_CONVERSION_HALF_CB_ID : + hadc->ConvHalfCpltCallback = pCallback; + break; + + case HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID : + hadc->LevelOutOfWindowCallback = pCallback; + break; + + case HAL_ADC_ERROR_CB_ID : + hadc->ErrorCallback = pCallback; + break; + + case HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID : + hadc->InjectedConvCpltCallback = pCallback; + break; + + case HAL_ADC_MSPINIT_CB_ID : + hadc->MspInitCallback = pCallback; + break; + + case HAL_ADC_MSPDEINIT_CB_ID : + hadc->MspDeInitCallback = pCallback; + break; + + default : + /* Update the error code */ + hadc->ErrorCode |= HAL_ADC_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else if (HAL_ADC_STATE_RESET == hadc->State) + { + switch (CallbackID) + { + case HAL_ADC_MSPINIT_CB_ID : + hadc->MspInitCallback = pCallback; + break; + + case HAL_ADC_MSPDEINIT_CB_ID : + hadc->MspDeInitCallback = pCallback; + break; + + default : + /* Update the error code */ + hadc->ErrorCode |= HAL_ADC_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else + { + /* Update the error code */ + hadc->ErrorCode |= HAL_ADC_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} + +/** + * @brief Unregister a ADC Callback + * ADC callback is redirected to the weak predefined callback + * @param hadc Pointer to a ADC_HandleTypeDef structure that contains + * the configuration information for the specified ADC. + * @param CallbackID ID of the callback to be unregistered + * This parameter can be one of the following values: + * @arg @ref HAL_ADC_CONVERSION_COMPLETE_CB_ID ADC conversion complete callback ID + * @arg @ref HAL_ADC_CONVERSION_HALF_CB_ID ADC conversion complete callback ID + * @arg @ref HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID ADC analog watchdog 1 callback ID + * @arg @ref HAL_ADC_ERROR_CB_ID ADC error callback ID + * @arg @ref HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID ADC group injected conversion complete callback ID + * @arg @ref HAL_ADC_MSPINIT_CB_ID ADC Msp Init callback ID + * @arg @ref HAL_ADC_MSPDEINIT_CB_ID ADC Msp DeInit callback ID + * @arg @ref HAL_ADC_MSPINIT_CB_ID MspInit callback ID + * @arg @ref HAL_ADC_MSPDEINIT_CB_ID MspDeInit callback ID + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_UnRegisterCallback(ADC_HandleTypeDef *hadc, HAL_ADC_CallbackIDTypeDef CallbackID) +{ + HAL_StatusTypeDef status = HAL_OK; + + if ((hadc->State & HAL_ADC_STATE_READY) != 0) + { + switch (CallbackID) + { + case HAL_ADC_CONVERSION_COMPLETE_CB_ID : + hadc->ConvCpltCallback = HAL_ADC_ConvCpltCallback; + break; + + case HAL_ADC_CONVERSION_HALF_CB_ID : + hadc->ConvHalfCpltCallback = HAL_ADC_ConvHalfCpltCallback; + break; + + case HAL_ADC_LEVEL_OUT_OF_WINDOW_1_CB_ID : + hadc->LevelOutOfWindowCallback = HAL_ADC_LevelOutOfWindowCallback; + break; + + case HAL_ADC_ERROR_CB_ID : + hadc->ErrorCallback = HAL_ADC_ErrorCallback; + break; + + case HAL_ADC_INJ_CONVERSION_COMPLETE_CB_ID : + hadc->InjectedConvCpltCallback = HAL_ADCEx_InjectedConvCpltCallback; + break; + + case HAL_ADC_MSPINIT_CB_ID : + hadc->MspInitCallback = HAL_ADC_MspInit; /* Legacy weak MspInit */ + break; + + case HAL_ADC_MSPDEINIT_CB_ID : + hadc->MspDeInitCallback = HAL_ADC_MspDeInit; /* Legacy weak MspDeInit */ + break; + + default : + /* Update the error code */ + hadc->ErrorCode |= HAL_ADC_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else if (HAL_ADC_STATE_RESET == hadc->State) + { + switch (CallbackID) + { + case HAL_ADC_MSPINIT_CB_ID : + hadc->MspInitCallback = HAL_ADC_MspInit; /* Legacy weak MspInit */ + break; + + case HAL_ADC_MSPDEINIT_CB_ID : + hadc->MspDeInitCallback = HAL_ADC_MspDeInit; /* Legacy weak MspDeInit */ + break; + + default : + /* Update the error code */ + hadc->ErrorCode |= HAL_ADC_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else + { + /* Update the error code */ + hadc->ErrorCode |= HAL_ADC_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} + +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/** @defgroup ADC_Exported_Functions_Group2 Input and Output operation functions + * @brief IO operation functions + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Start conversion of regular group. + (+) Stop conversion of regular group. + (+) Poll for conversion complete on regular group. + (+) Poll for conversion event. + (+) Get result of regular channel conversion. + (+) Start conversion of regular group and enable interruptions. + (+) Stop conversion of regular group and disable interruptions. + (+) Handle ADC interrupt request + (+) Start conversion of regular group and enable DMA transfer. + (+) Stop conversion of regular group and disable ADC DMA transfer. + +@endverbatim + * @{ + */ +/** + * @brief Enables ADC, starts conversion of regular group. + * Interruptions enabled in this function: None. + * @note: Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC slave first, then ADC master. + * For ADC slave, ADC is enabled only (conversion is not started). + * For ADC master, ADC is enabled and multimode conversion is started. + * @param hadc ADC handle + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Stop ADC conversion of regular group (and injected group in + * case of auto_injection mode), disable ADC peripheral. + * @note: ADC peripheral disable is forcing stop of potential + * conversion on injected group. If injected group is under use, it + * should be preliminarily stopped using HAL_ADCEx_InjectedStop function. + * @note: Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC master first, then ADC slave. + * For ADC master, conversion is stopped and ADC is disabled. + * For ADC slave, ADC is disabled only (conversion stop of ADC master + * has already stopped conversion of ADC slave). + * @param hadc ADC handle + * @retval HAL status. + */ +__weak HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Wait for regular group conversion to be completed. + * @param hadc ADC handle + * @param Timeout Timeout value in millisecond. + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + UNUSED(Timeout); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Poll for conversion event. + * @param hadc ADC handle + * @param EventType the ADC event type. + * This parameter can be one of the following values: + * @arg ADC_AWD_EVENT: ADC Analog watchdog 1 event (main analog watchdog, present on all STM32 devices) + * @arg ADC_AWD2_EVENT: ADC Analog watchdog 2 event (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_AWD3_EVENT: ADC Analog watchdog 3 event (additional analog watchdog, present only on STM32F3 devices) + * @arg ADC_OVR_EVENT: ADC Overrun event + * @arg ADC_JQOVF_EVENT: ADC Injected context queue overflow event + * @param Timeout Timeout value in millisecond. + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + UNUSED(EventType); + UNUSED(Timeout); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Enables ADC, starts conversion of regular group with interruption. + * Interruptions enabled in this function: + * - EOC (end of conversion of regular group) or EOS (end of + * sequence of regular group) depending on ADC initialization + * parameter "EOCSelection" (if available) + * - overrun (if available) + * Each of these interruptions has its dedicated callback function. + * @note: Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC slave first, then ADC master. + * For ADC slave, ADC is enabled only (conversion is not started). + * For ADC master, ADC is enabled and multimode conversion is started. + * @param hadc ADC handle + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Stop ADC conversion of regular group (and injected group in + * case of auto_injection mode), disable interruption of + * end-of-conversion, disable ADC peripheral. + * @note: ADC peripheral disable is forcing stop of potential + * conversion on injected group. If injected group is under use, it + * should be preliminarily stopped using HAL_ADCEx_InjectedStop function. + * @note: Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC master first, then ADC slave. + * For ADC master, conversion is stopped and ADC is disabled. + * For ADC slave, ADC is disabled only (conversion stop of ADC master + * has already stopped conversion of ADC slave). + * @param hadc ADC handle + * @retval HAL status. + */ +__weak HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Enables ADC, starts conversion of regular group and transfers result + * through DMA. + * Interruptions enabled in this function: + * - DMA transfer complete + * - DMA half transfer + * - overrun (if available) + * Each of these interruptions has its dedicated callback function. + * @note: Case of multimode enabled (for devices with several ADCs): This + * function is for single-ADC mode only. For multimode, use the + * dedicated MultimodeStart function. + * @param hadc ADC handle + * @param pData The destination Buffer address. + * @param Length The length of data to be transferred from ADC peripheral to memory. + * @retval None + */ +__weak HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + UNUSED(pData); + UNUSED(Length); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Stop ADC conversion of regular group (and injected group in + * case of auto_injection mode), disable ADC DMA transfer, disable + * ADC peripheral. + * @note: ADC peripheral disable is forcing stop of potential + * conversion on injected group. If injected group is under use, it + * should be preliminarily stopped using HAL_ADCEx_InjectedStop function. + * @note: Case of multimode enabled (for devices with several ADCs): This + * function is for single-ADC mode only. For multimode, use the + * dedicated MultimodeStop function. + * @param hadc ADC handle + * @retval HAL status. + */ +__weak HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Get ADC regular group conversion result. + * @note Reading DR register automatically clears EOC (end of conversion of + * regular group) flag. + * Additionally, this functions clears EOS (end of sequence of + * regular group) flag, in case of the end of the sequence is reached. + * @param hadc ADC handle + * @retval Converted value + */ +__weak uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc) +{ + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return ADC converted value */ + return hadc->Instance->DR; +} + +/** + * @brief Handles ADC interrupt request. + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ +} + +/** + * @brief Conversion complete callback in non blocking mode + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADC_ConvCpltCallback must be implemented in the user file. + */ +} + +/** + * @brief Conversion DMA half-transfer callback in non blocking mode + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADC_ConvHalfCpltCallback(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADC_ConvHalfCpltCallback must be implemented in the user file. + */ +} + +/** + * @brief Analog watchdog callback in non blocking mode. + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADC_LevelOoutOfWindowCallback must be implemented in the user file. + */ +} + +/** + * @brief ADC error callback in non blocking mode + * (ADC conversion with interruption or transfer by DMA) + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADC_ErrorCallback(ADC_HandleTypeDef *hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADC_ErrorCallback must be implemented in the user file. + */ +} + +/** + * @} + */ + +/** @defgroup ADC_Exported_Functions_Group3 Peripheral Control functions + * @brief Peripheral Control functions + * +@verbatim + =============================================================================== + ##### Peripheral Control functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Configure channels on regular group + (+) Configure the analog watchdog + +@endverbatim + * @{ + */ + +/** + * @brief Configures the the selected channel to be linked to the regular + * group. + * @note In case of usage of internal measurement channels: + * Vbat/VrefInt/TempSensor. + * The recommended sampling time is at least: + * - For devices STM32F37x: 17.1us for temperature sensor + * - For the other STM32F3 devices: 2.2us for each of channels + * Vbat/VrefInt/TempSensor. + * These internal paths can be be disabled using function + * HAL_ADC_DeInit(). + * @note Possibility to update parameters on the fly: + * This function initializes channel into regular group, following + * calls to this function can be used to reconfigure some parameters + * of structure "ADC_ChannelConfTypeDef" on the fly, without resetting + * the ADC. + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_ChannelConfTypeDef". + * @param hadc ADC handle + * @param sConfig Structure of ADC channel for regular group. + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + UNUSED(sConfig); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @brief Configures the analog watchdog. + * @note Possibility to update parameters on the fly: + * This function initializes the selected analog watchdog, following + * calls to this function can be used to reconfigure some parameters + * of structure "ADC_AnalogWDGConfTypeDef" on the fly, without resetting + * the ADC. + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_AnalogWDGConfTypeDef". + * @param hadc ADC handle + * @param AnalogWDGConfig Structure of ADC analog watchdog configuration + * @retval HAL status + */ +__weak HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + UNUSED(AnalogWDGConfig); + + /* Note : This function is defined into this file for library reference. */ + /* Function content is located into file stm32f3xx_hal_adc_ex.c */ + + /* Return function status */ + return HAL_ERROR; +} + +/** + * @} + */ + +/** @defgroup ADC_Exported_Functions_Group4 Peripheral State functions + * @brief ADC Peripheral State functions + * +@verbatim + =============================================================================== + ##### Peripheral state and errors functions ##### + =============================================================================== + [..] + This subsection provides functions to get in run-time the status of the + peripheral. + (+) Check the ADC state + (+) Check the ADC error code + +@endverbatim + * @{ + */ + +/** + * @brief return the ADC state + * @note ADC state machine is managed by bitfield, state must be compared + * with bit by bit. + * For example: + * " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_REG_BUSY)) " + * " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_AWD1) ) " + * @param hadc ADC handle + * @retval HAL state + */ +uint32_t HAL_ADC_GetState(ADC_HandleTypeDef* hadc) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Return ADC state */ + return hadc->State; +} + +/** + * @brief Return the ADC error code + * @param hadc ADC handle + * @retval ADC Error Code + */ +uint32_t HAL_ADC_GetError(ADC_HandleTypeDef *hadc) +{ + return hadc->ErrorCode; +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_ADC_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc_ex.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc_ex.c new file mode 100644 index 0000000..ff1f54e --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_adc_ex.c @@ -0,0 +1,7627 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_adc_ex.c + * @author MCD Application Team + * @brief This file provides firmware functions to manage the following + * functionalities of the Analog to Digital Convertor (ADC) + * peripheral: + * + Peripheral Control functions + * Other functions (generic functions) are available in file + * "stm32f3xx_hal_adc.c". + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + [..] + (@) Sections "ADC peripheral features" and "How to use this driver" are + available in file of generic functions "stm32f3xx_hal_adc.c". + [..] + @endverbatim + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup ADCEx ADCEx + * @brief ADC Extended HAL module driver + * @{ + */ + +#ifdef HAL_ADC_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup ADCEx_Private_Constants ADCEx Private Constants + * @{ + */ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + /* Fixed timeout values for ADC calibration, enable settling time, disable */ + /* settling time. */ + /* Values defined to be higher than worst cases: low clock frequency, */ + /* maximum prescalers. */ + /* Ex of profile low frequency : Clock source at 0.5 MHz, ADC clock */ + /* prescaler 256 (devices STM32F30xx), sampling time 7.5 ADC clock cycles, */ + /* resolution 12 bits. */ + /* Unit: ms */ + #define ADC_CALIBRATION_TIMEOUT ( 10U) + #define ADC_ENABLE_TIMEOUT ( 2U) + #define ADC_DISABLE_TIMEOUT ( 2U) + #define ADC_STOP_CONVERSION_TIMEOUT ( 11U) + + /* Timeout to wait for current conversion on going to be completed. */ + /* Timeout fixed to worst case, for 1 channel. */ + /* - maximum sampling time (601.5 adc_clk) */ + /* - ADC resolution (Tsar 12 bits= 12.5 adc_clk) */ + /* - ADC clock (from PLL with prescaler 256 (devices STM32F30xx)) */ + /* Unit: cycles of CPU clock. */ + #define ADC_CONVERSION_TIME_MAX_CPU_CYCLES ( 156928U) + + /* Delay for ADC stabilization time (ADC voltage regulator start-up time) */ + /* Maximum delay is 10us (refer to device datasheet, param. TADCVREG_STUP). */ + /* Unit: us */ + #define ADC_STAB_DELAY_US ( 10U) + + /* Delay for temperature sensor stabilization time. */ + /* Maximum delay is 10us (refer device datasheet, parameter tSTART). */ + /* Unit: us */ + #define ADC_TEMPSENSOR_DELAY_US ( 10U) + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) + /* Timeout values for ADC enable and disable settling time. */ + /* Values defined to be higher than worst cases: low clocks freq, */ + /* maximum prescaler. */ + /* Ex of profile low frequency : Clock source at 0.1 MHz, ADC clock */ + /* prescaler 4U, sampling time 12.5 ADC clock cycles, resolution 12 bits. */ + /* Unit: ms */ + #define ADC_ENABLE_TIMEOUT ( 2U) + #define ADC_DISABLE_TIMEOUT ( 2U) + + /* Delay for ADC calibration: */ + /* Hardware prerequisite before starting a calibration: the ADC must have */ + /* been in power-on state for at least two ADC clock cycles. */ + /* Unit: ADC clock cycles */ + #define ADC_PRECALIBRATION_DELAY_ADCCLOCKCYCLES ( 2U) + + /* Timeout value for ADC calibration */ + /* Value defined to be higher than worst cases: low clocks freq, */ + /* maximum prescaler. */ + /* Ex of profile low frequency : Clock source at 0.1 MHz, ADC clock */ + /* prescaler 4U, sampling time 12.5 ADC clock cycles, resolution 12 bits. */ + /* Unit: ms */ + #define ADC_CALIBRATION_TIMEOUT ( 10U) + + /* Delay for ADC stabilization time. */ + /* Maximum delay is 1us (refer to device datasheet, parameter tSTAB). */ + /* Unit: us */ + #define ADC_STAB_DELAY_US ( 1U) + + /* Delay for temperature sensor stabilization time. */ + /* Maximum delay is 10us (refer to device datasheet, parameter tSTART). */ + /* Unit: us */ + #define ADC_TEMPSENSOR_DELAY_US ( 10U) + + /* Maximum number of CPU cycles corresponding to 1 ADC cycle */ + /* Value fixed to worst case: clock prescalers slowing down ADC clock to */ + /* minimum frequency */ + /* - AHB prescaler: 16 */ + /* - ADC prescaler: 8 */ + /* Unit: cycles of CPU clock. */ + #define ADC_CYCLE_WORST_CASE_CPU_CYCLES ( 128U) + + /* ADC conversion cycles (unit: ADC clock cycles) */ + /* (selected sampling time + conversion time of 12.5 ADC clock cycles, with */ + /* resolution 12 bits) */ + #define ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_1CYCLE5 ( 14U) + #define ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_7CYCLES5 ( 20U) + #define ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_13CYCLES5 ( 26U) + #define ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_28CYCLES5 ( 41U) + #define ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_41CYCLES5 ( 54U) + #define ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_55CYCLES5 ( 68U) + #define ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_71CYCLES5 ( 84U) + #define ADC_CONVERSIONCLOCKCYCLES_SAMPLETIME_239CYCLES5 (252U) +#endif /* STM32F373xC || STM32F378xx */ +/** + * @} + */ + +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +static HAL_StatusTypeDef ADC_Enable(ADC_HandleTypeDef* hadc); +static HAL_StatusTypeDef ADC_Disable(ADC_HandleTypeDef* hadc); +static HAL_StatusTypeDef ADC_ConversionStop(ADC_HandleTypeDef* hadc, uint32_t ConversionGroup); +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +static HAL_StatusTypeDef ADC_Enable(ADC_HandleTypeDef* hadc); +static HAL_StatusTypeDef ADC_ConversionStop_Disable(ADC_HandleTypeDef* hadc); +#endif /* STM32F373xC || STM32F378xx */ + +static void ADC_DMAConvCplt(DMA_HandleTypeDef *hdma); +static void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma); +static void ADC_DMAError(DMA_HandleTypeDef *hdma); + +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup ADCEx_Exported_Functions ADCEx Exported Functions + * @{ + */ + +/** @defgroup ADCEx_Exported_Functions_Group1 ADCEx Initialization and de-initialization functions + * @brief ADC Extended Initialization and Configuration functions + * +@verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Initialize and configure the ADC. + (+) De-initialize the ADC. + +@endverbatim + * @{ + */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Initializes the ADC peripheral and regular group according to + * parameters specified in structure "ADC_InitTypeDef". + * @note As prerequisite, ADC clock must be configured at RCC top level + * depending on possible clock sources: AHB clock or PLL clock. + * See commented example code below that can be copied and uncommented + * into HAL_ADC_MspInit(). + * @note Possibility to update parameters on the fly: + * This function initializes the ADC MSP (HAL_ADC_MspInit()) only when + * coming from ADC state reset. Following calls to this function can + * be used to reconfigure some parameters of ADC_InitTypeDef + * structure on the fly, without modifying MSP configuration. If ADC + * MSP has to be modified again, HAL_ADC_DeInit() must be called + * before HAL_ADC_Init(). + * The setting of these parameters is conditioned by ADC state. + * For parameters constraints, see comments of structure + * "ADC_InitTypeDef". + * @note This function configures the ADC within 2 scopes: scope of entire + * ADC and scope of regular group. For parameters details, see comments + * of structure "ADC_InitTypeDef". + * @note For devices with several ADCs: parameters related to common ADC + * registers (ADC clock mode) are set only if all ADCs sharing the + * same common group are disabled. + * If this is not the case, these common parameters setting are + * bypassed without error reporting: it can be the intended behaviour in + * case of update of a parameter of ADC_InitTypeDef on the fly, + * without disabling the other ADCs sharing the same common group. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + ADC_Common_TypeDef *tmpADC_Common; + ADC_HandleTypeDef tmphadcSharingSameCommonRegister; + uint32_t tmpCFGR = 0U; + __IO uint32_t wait_loop_index = 0U; + + /* Check ADC handle */ + if(hadc == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_CLOCKPRESCALER(hadc->Init.ClockPrescaler)); + assert_param(IS_ADC_RESOLUTION(hadc->Init.Resolution)); + assert_param(IS_ADC_DATA_ALIGN(hadc->Init.DataAlign)); + assert_param(IS_ADC_SCAN_MODE(hadc->Init.ScanConvMode)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); + assert_param(IS_ADC_EXTTRIG_EDGE(hadc->Init.ExternalTrigConvEdge)); + assert_param(IS_ADC_EXTTRIG(hadc->Init.ExternalTrigConv)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.DMAContinuousRequests)); + assert_param(IS_ADC_EOC_SELECTION(hadc->Init.EOCSelection)); + assert_param(IS_ADC_OVERRUN(hadc->Init.Overrun)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.LowPowerAutoWait)); + + if(hadc->Init.ScanConvMode != ADC_SCAN_DISABLE) + { + assert_param(IS_ADC_REGULAR_NB_CONV(hadc->Init.NbrOfConversion)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.DiscontinuousConvMode)); + if(hadc->Init.DiscontinuousConvMode != DISABLE) + { + assert_param(IS_ADC_REGULAR_DISCONT_NUMBER(hadc->Init.NbrOfDiscConversion)); + } + } + + /* Configuration of ADC core parameters and ADC MSP related parameters */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL)) + { + /* As prerequisite, into HAL_ADC_MspInit(), ADC clock must be configured */ + /* at RCC top level. */ + /* Refer to header of this file for more details on clock enabling */ + /* procedure. */ + + /* Actions performed only if ADC is coming from state reset: */ + /* - Initialization of ADC MSP */ + /* - ADC voltage regulator enable */ + if (hadc->State == HAL_ADC_STATE_RESET) + { + /* Initialize ADC error code */ + ADC_CLEAR_ERRORCODE(hadc); + + /* Initialize HAL ADC API internal variables */ + hadc->InjectionConfig.ChannelCount = 0U; + hadc->InjectionConfig.ContextQueue = 0U; + + /* Allocate lock resource and initialize it */ + hadc->Lock = HAL_UNLOCKED; + +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + /* Init the ADC Callback settings */ + hadc->ConvCpltCallback = HAL_ADC_ConvCpltCallback; /* Legacy weak callback */ + hadc->ConvHalfCpltCallback = HAL_ADC_ConvHalfCpltCallback; /* Legacy weak callback */ + hadc->LevelOutOfWindowCallback = HAL_ADC_LevelOutOfWindowCallback; /* Legacy weak callback */ + hadc->ErrorCallback = HAL_ADC_ErrorCallback; /* Legacy weak callback */ + hadc->InjectedConvCpltCallback = HAL_ADCEx_InjectedConvCpltCallback; /* Legacy weak callback */ + + if (hadc->MspInitCallback == NULL) + { + hadc->MspInitCallback = HAL_ADC_MspInit; /* Legacy weak MspInit */ + } + + /* Init the low level hardware */ + hadc->MspInitCallback(hadc); +#else + /* Init the low level hardware */ + HAL_ADC_MspInit(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + + /* Enable voltage regulator (if disabled at this step) */ + if (HAL_IS_BIT_CLR(hadc->Instance->CR, ADC_CR_ADVREGEN_0)) + { + /* Note: The software must wait for the startup time of the ADC */ + /* voltage regulator before launching a calibration or */ + /* enabling the ADC. This temporization must be implemented by */ + /* software and is equal to 10 us in the worst case */ + /* process/temperature/power supply. */ + + /* Disable the ADC (if not already disabled) */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + /* Configuration of ADC parameters if previous preliminary actions */ + /* are correctly completed. */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL) && + (tmp_hal_status == HAL_OK) ) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_BUSY_INTERNAL); + + /* Set the intermediate state before moving the ADC voltage */ + /* regulator to state enable. */ + CLEAR_BIT(hadc->Instance->CR, (ADC_CR_ADVREGEN_1 | ADC_CR_ADVREGEN_0)); + /* Set ADVREGEN bits to 0x01U */ + SET_BIT(hadc->Instance->CR, ADC_CR_ADVREGEN_0); + + /* Delay for ADC stabilization time. */ + /* Compute number of CPU cycles to wait for */ + wait_loop_index = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000U)); + while(wait_loop_index != 0U) + { + wait_loop_index--; + } + } + } + } + + /* Verification that ADC voltage regulator is correctly enabled, whether */ + /* or not ADC is coming from state reset (if any potential problem of */ + /* clocking, voltage regulator would not be enabled). */ + if (HAL_IS_BIT_CLR(hadc->Instance->CR, ADC_CR_ADVREGEN_0) || + HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_ADVREGEN_1) ) + { + /* Update ADC state machine to error */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + tmp_hal_status = HAL_ERROR; + } + } + + + /* Configuration of ADC parameters if previous preliminary actions are */ + /* correctly completed and if there is no conversion on going on regular */ + /* group (ADC may already be enabled at this point if HAL_ADC_Init() is */ + /* called to update a parameter on the fly). */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL) && + (tmp_hal_status == HAL_OK) && + (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) ) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY, + HAL_ADC_STATE_BUSY_INTERNAL); + + /* Configuration of common ADC parameters */ + + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + /* Set handle of the other ADC sharing the same common register */ + ADC_COMMON_ADC_OTHER(hadc, &tmphadcSharingSameCommonRegister); + + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated only when ADC is disabled: */ + /* - Multimode clock configuration */ + if ((ADC_IS_ENABLE(hadc) == RESET) && + ((tmphadcSharingSameCommonRegister.Instance == NULL) || + (ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) ) ) + { + /* Reset configuration of ADC common register CCR: */ + /* - ADC clock mode: CKMODE */ + /* Some parameters of this register are not reset, since they are set */ + /* by other functions and must be kept in case of usage of this */ + /* function on the fly (update of a parameter of ADC_InitTypeDef */ + /* without needing to reconfigure all other ADC groups/channels */ + /* parameters): */ + /* - multimode related parameters: MDMA, DMACFG, DELAY, MULTI (set */ + /* into HAL_ADCEx_MultiModeConfigChannel() ) */ + /* - internal measurement paths: Vbat, temperature sensor, Vref */ + /* (set into HAL_ADC_ConfigChannel() or */ + /* HAL_ADCEx_InjectedConfigChannel() ) */ + + MODIFY_REG(tmpADC_Common->CCR , + ADC_CCR_CKMODE , + hadc->Init.ClockPrescaler ); + } + + + /* Configuration of ADC: */ + /* - resolution */ + /* - data alignment */ + /* - external trigger to start conversion */ + /* - external trigger polarity */ + /* - continuous conversion mode */ + /* - overrun */ + /* - discontinuous mode */ + SET_BIT(tmpCFGR, ADC_CFGR_CONTINUOUS((uint32_t)hadc->Init.ContinuousConvMode) | + ADC_CFGR_OVERRUN(hadc->Init.Overrun) | + hadc->Init.DataAlign | + hadc->Init.Resolution ); + + /* Enable discontinuous mode only if continuous mode is disabled */ + if (hadc->Init.DiscontinuousConvMode == ENABLE) + { + if (hadc->Init.ContinuousConvMode == DISABLE) + { + /* Enable the selected ADC regular discontinuous mode */ + /* Set the number of channels to be converted in discontinuous mode */ + SET_BIT(tmpCFGR, ADC_CFGR_DISCEN | + ADC_CFGR_DISCONTINUOUS_NUM(hadc->Init.NbrOfDiscConversion) ); + } + else + { + /* ADC regular group discontinuous was intended to be enabled, */ + /* but ADC regular group modes continuous and sequencer discontinuous */ + /* cannot be enabled simultaneously. */ + + /* Update ADC state machine to error */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_ERROR_CONFIG); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + } + } + + /* Enable external trigger if trigger selection is different of software */ + /* start. */ + /* Note: This configuration keeps the hardware feature of parameter */ + /* ExternalTrigConvEdge "trigger edge none" equivalent to */ + /* software start. */ + if (hadc->Init.ExternalTrigConv != ADC_SOFTWARE_START) + { + SET_BIT(tmpCFGR, ADC_CFGR_EXTSEL_SET(hadc, hadc->Init.ExternalTrigConv) | + hadc->Init.ExternalTrigConvEdge ); + } + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated when ADC is disabled or enabled without */ + /* conversion on going on regular and injected groups: */ + /* - DMA continuous request */ + /* - LowPowerAutoWait feature */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED(hadc) == RESET) + { + CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_AUTDLY | + ADC_CFGR_DMACFG ); + + SET_BIT(tmpCFGR, ADC_CFGR_AUTOWAIT((uint32_t)hadc->Init.LowPowerAutoWait) | + ADC_CFGR_DMACONTREQ((uint32_t)hadc->Init.DMAContinuousRequests) ); + } + + /* Update ADC configuration register with previous settings */ + MODIFY_REG(hadc->Instance->CFGR, + ADC_CFGR_DISCNUM | + ADC_CFGR_DISCEN | + ADC_CFGR_CONT | + ADC_CFGR_OVRMOD | + ADC_CFGR_EXTSEL | + ADC_CFGR_EXTEN | + ADC_CFGR_ALIGN | + ADC_CFGR_RES , + tmpCFGR ); + + + /* Configuration of regular group sequencer: */ + /* - if scan mode is disabled, regular channels sequence length is set to */ + /* 0x00: 1 channel converted (channel on regular rank 1U) */ + /* Parameter "NbrOfConversion" is discarded. */ + /* Note: Scan mode is not present by hardware on this device, but */ + /* emulated by software for alignment over all STM32 devices. */ + /* - if scan mode is enabled, regular channels sequence length is set to */ + /* parameter "NbrOfConversion" */ + if (hadc->Init.ScanConvMode == ADC_SCAN_ENABLE) + { + /* Set number of ranks in regular group sequencer */ + MODIFY_REG(hadc->Instance->SQR1 , + ADC_SQR1_L , + (hadc->Init.NbrOfConversion - (uint8_t)1U) ); + } + else + { + CLEAR_BIT(hadc->Instance->SQR1, ADC_SQR1_L); + } + + /* Set ADC error code to none */ + ADC_CLEAR_ERRORCODE(hadc); + + /* Set the ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_READY); + } + else + { + /* Update ADC state machine to error */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_ERROR_INTERNAL); + + tmp_hal_status = HAL_ERROR; + } + + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Initializes the ADC peripheral and regular group according to + * parameters specified in structure "ADC_InitTypeDef". + * @note As prerequisite, ADC clock must be configured at RCC top level + * (clock source APB2). + * See commented example code below that can be copied and uncommented + * into HAL_ADC_MspInit(). + * @note Possibility to update parameters on the fly: + * This function initializes the ADC MSP (HAL_ADC_MspInit()) only when + * coming from ADC state reset. Following calls to this function can + * be used to reconfigure some parameters of ADC_InitTypeDef + * structure on the fly, without modifying MSP configuration. If ADC + * MSP has to be modified again, HAL_ADC_DeInit() must be called + * before HAL_ADC_Init(). + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_InitTypeDef". + * @note This function configures the ADC within 2 scopes: scope of entire + * ADC and scope of regular group. For parameters details, see comments + * of structure "ADC_InitTypeDef". + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_Init(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + uint32_t tmp_cr1 = 0U; + uint32_t tmp_cr2 = 0U; + uint32_t tmp_sqr1 = 0U; + + /* Check ADC handle */ + if(hadc == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_DATA_ALIGN(hadc->Init.DataAlign)); + assert_param(IS_ADC_SCAN_MODE(hadc->Init.ScanConvMode)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); + assert_param(IS_ADC_EXTTRIG(hadc->Init.ExternalTrigConv)); + + if(hadc->Init.ScanConvMode != ADC_SCAN_DISABLE) + { + assert_param(IS_ADC_REGULAR_NB_CONV(hadc->Init.NbrOfConversion)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.DiscontinuousConvMode)); + if(hadc->Init.DiscontinuousConvMode != DISABLE) + { + assert_param(IS_ADC_REGULAR_DISCONT_NUMBER(hadc->Init.NbrOfDiscConversion)); + } + } + + /* As prerequisite, into HAL_ADC_MspInit(), ADC clock must be configured */ + /* at RCC top level. */ + /* Refer to header of this file for more details on clock enabling */ + /* procedure. */ + + /* Actions performed only if ADC is coming from state reset: */ + /* - Initialization of ADC MSP */ + if (hadc->State == HAL_ADC_STATE_RESET) + { + /* Initialize ADC error code */ + ADC_CLEAR_ERRORCODE(hadc); + + /* Allocate lock resource and initialize it */ + hadc->Lock = HAL_UNLOCKED; + +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + /* Init the ADC Callback settings */ + hadc->ConvCpltCallback = HAL_ADC_ConvCpltCallback; /* Legacy weak callback */ + hadc->ConvHalfCpltCallback = HAL_ADC_ConvHalfCpltCallback; /* Legacy weak callback */ + hadc->LevelOutOfWindowCallback = HAL_ADC_LevelOutOfWindowCallback; /* Legacy weak callback */ + hadc->ErrorCallback = HAL_ADC_ErrorCallback; /* Legacy weak callback */ + hadc->InjectedConvCpltCallback = HAL_ADCEx_InjectedConvCpltCallback; /* Legacy weak callback */ + + if (hadc->MspInitCallback == NULL) + { + hadc->MspInitCallback = HAL_ADC_MspInit; /* Legacy weak MspInit */ + } + + /* Init the low level hardware */ + hadc->MspInitCallback(hadc); +#else + /* Init the low level hardware */ + HAL_ADC_MspInit(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + } + + /* Stop potential conversion on going, on regular and injected groups */ + /* Disable ADC peripheral */ + /* Note: In case of ADC already enabled, precaution to not launch an */ + /* unwanted conversion while modifying register CR2 by writing 1 to */ + /* bit ADON. */ + tmp_hal_status = ADC_ConversionStop_Disable(hadc); + + + /* Configuration of ADC parameters if previous preliminary actions are */ + /* correctly completed. */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL) && + (tmp_hal_status == HAL_OK) ) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_BUSY_INTERNAL); + + /* Set ADC parameters */ + + /* Configuration of ADC: */ + /* - data alignment */ + /* - external trigger to start conversion */ + /* - external trigger polarity (always set to 1U, because needed for all */ + /* triggers: external trigger of SW start) */ + /* - continuous conversion mode */ + /* Note: External trigger polarity (ADC_CR2_EXTTRIG) is set into */ + /* HAL_ADC_Start_xxx functions because if set in this function, */ + /* a conversion on injected group would start a conversion also on */ + /* regular group after ADC enabling. */ + tmp_cr2 |= (hadc->Init.DataAlign | + hadc->Init.ExternalTrigConv | + ADC_CR2_CONTINUOUS((uint32_t)hadc->Init.ContinuousConvMode) ); + + /* Configuration of ADC: */ + /* - scan mode */ + /* - discontinuous mode disable/enable */ + /* - discontinuous mode number of conversions */ + tmp_cr1 |= (ADC_CR1_SCAN_SET(hadc->Init.ScanConvMode)); + + /* Enable discontinuous mode only if continuous mode is disabled */ + /* Note: If parameter "Init.ScanConvMode" is set to disable, parameter */ + /* discontinuous is set anyway, but will have no effect on ADC HW. */ + if (hadc->Init.DiscontinuousConvMode == ENABLE) + { + if (hadc->Init.ContinuousConvMode == DISABLE) + { + /* Enable the selected ADC regular discontinuous mode */ + /* Set the number of channels to be converted in discontinuous mode */ + tmp_cr1 |= (ADC_CR1_DISCEN | + ADC_CR1_DISCONTINUOUS_NUM(hadc->Init.NbrOfDiscConversion) ); + } + else + { + /* ADC regular group discontinuous was intended to be enabled, */ + /* but ADC regular group modes continuous and sequencer discontinuous */ + /* cannot be enabled simultaneously. */ + + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + } + } + + /* Update ADC configuration register CR1 with previous settings */ + MODIFY_REG(hadc->Instance->CR1, + ADC_CR1_SCAN | + ADC_CR1_DISCEN | + ADC_CR1_DISCNUM , + tmp_cr1 ); + + /* Update ADC configuration register CR2 with previous settings */ + MODIFY_REG(hadc->Instance->CR2, + ADC_CR2_ALIGN | + ADC_CR2_EXTSEL | + ADC_CR2_EXTTRIG | + ADC_CR2_CONT , + tmp_cr2 ); + + /* Configuration of regular group sequencer: */ + /* - if scan mode is disabled, regular channels sequence length is set to */ + /* 0x00: 1 channel converted (channel on regular rank 1U) */ + /* Parameter "NbrOfConversion" is discarded. */ + /* Note: Scan mode is present by hardware on this device and, if */ + /* disabled, discards automatically nb of conversions. Anyway, nb of */ + /* conversions is forced to 0x00 for alignment over all STM32 devices. */ + /* - if scan mode is enabled, regular channels sequence length is set to */ + /* parameter "NbrOfConversion" */ + if (ADC_CR1_SCAN_SET(hadc->Init.ScanConvMode) == ADC_SCAN_ENABLE) + { + tmp_sqr1 = ADC_SQR1_L_SHIFT(hadc->Init.NbrOfConversion); + } + + MODIFY_REG(hadc->Instance->SQR1, + ADC_SQR1_L , + tmp_sqr1 ); + + /* Check back that ADC registers have effectively been configured to */ + /* ensure of no potential problem of ADC core IP clocking. */ + /* Check through register CR2 (excluding bits set in other functions: */ + /* execution control bits (ADON, JSWSTART, SWSTART), regular group bits */ + /* (DMA), injected group bits (JEXTTRIG and JEXTSEL), channel internal */ + /* measurement path bit (TSVREFE). */ + if (READ_BIT(hadc->Instance->CR2, ~(ADC_CR2_ADON | ADC_CR2_DMA | + ADC_CR2_SWSTART | ADC_CR2_JSWSTART | + ADC_CR2_JEXTTRIG | ADC_CR2_JEXTSEL | + ADC_CR2_TSVREFE )) + == tmp_cr2) + { + /* Set ADC error code to none */ + ADC_CLEAR_ERRORCODE(hadc); + + /* Set the ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_READY); + } + else + { + /* Update ADC state machine to error */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + tmp_hal_status = HAL_ERROR; + } + + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + tmp_hal_status = HAL_ERROR; + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Deinitialize the ADC peripheral registers to their default reset + * values, with deinitialization of the ADC MSP. + * @note For devices with several ADCs: reset of ADC common registers is done + * only if all ADCs sharing the same common group are disabled. + * If this is not the case, reset of these common parameters reset is + * bypassed without error reporting: it can be the intended behaviour in + * case of reset of a single ADC while the other ADCs sharing the same + * common group is still running. + * @note For devices with several ADCs: Global reset of all ADCs sharing a + * common group is possible. + * As this function is intended to reset a single ADC, to not impact + * other ADCs, instructions for global reset of multiple ADCs have been + * let commented below. + * If needed, the example code can be copied and uncommented into + * function HAL_ADC_MspDeInit(). + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + ADC_Common_TypeDef *tmpADC_Common; + ADC_HandleTypeDef tmphadcSharingSameCommonRegister; + + /* Check ADC handle */ + if(hadc == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_BUSY_INTERNAL); + + /* Stop potential conversion on going, on regular and injected groups */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_INJECTED_GROUP); + + /* Disable ADC peripheral if conversions are effectively stopped */ + if (tmp_hal_status == HAL_OK) + { + /* Flush register JSQR: queue sequencer reset when injected queue */ + /* sequencer is enabled and ADC disabled. */ + /* Enable injected queue sequencer after injected conversion stop */ + SET_BIT(hadc->Instance->CFGR, ADC_CFGR_JQM); + + /* Disable the ADC peripheral */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Change ADC state */ + hadc->State = HAL_ADC_STATE_READY; + } + else + { + tmp_hal_status = HAL_ERROR; + } + } + + + /* Configuration of ADC parameters if previous preliminary actions are */ + /* correctly completed. */ + if (tmp_hal_status == HAL_OK) + { + /* ========== Reset ADC registers ========== */ + /* Reset register IER */ + __HAL_ADC_DISABLE_IT(hadc, (ADC_IT_AWD3 | ADC_IT_AWD2 | ADC_IT_AWD1 | + ADC_IT_JQOVF | ADC_IT_OVR | + ADC_IT_JEOS | ADC_IT_JEOC | + ADC_IT_EOS | ADC_IT_EOC | + ADC_IT_EOSMP | ADC_IT_RDY ) ); + + /* Reset register ISR */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_AWD3 | ADC_FLAG_AWD2 | ADC_FLAG_AWD1 | + ADC_FLAG_JQOVF | ADC_FLAG_OVR | + ADC_FLAG_JEOS | ADC_FLAG_JEOC | + ADC_FLAG_EOS | ADC_FLAG_EOC | + ADC_FLAG_EOSMP | ADC_FLAG_RDY ) ); + + /* Reset register CR */ + /* Bits ADC_CR_JADSTP, ADC_CR_ADSTP, ADC_CR_JADSTART, ADC_CR_ADSTART are */ + /* in access mode "read-set": no direct reset applicable. */ + /* Reset Calibration mode to default setting (single ended): */ + /* Disable voltage regulator: */ + /* Note: Voltage regulator disable is conditioned to ADC state disabled: */ + /* already done above. */ + /* Note: Voltage regulator disable is intended for power saving. */ + /* Sequence to disable voltage regulator: */ + /* 1. Set the intermediate state before moving the ADC voltage regulator */ + /* to disable state. */ + CLEAR_BIT(hadc->Instance->CR, ADC_CR_ADVREGEN_1 | ADC_CR_ADVREGEN_0 | ADC_CR_ADCALDIF); + /* 2. Set ADVREGEN bits to 0x10U */ + SET_BIT(hadc->Instance->CR, ADC_CR_ADVREGEN_1); + + /* Reset register CFGR */ + CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_AWD1CH | ADC_CFGR_JAUTO | ADC_CFGR_JAWD1EN | + ADC_CFGR_AWD1EN | ADC_CFGR_AWD1SGL | ADC_CFGR_JQM | + ADC_CFGR_JDISCEN | ADC_CFGR_DISCNUM | ADC_CFGR_DISCEN | + ADC_CFGR_AUTDLY | ADC_CFGR_CONT | ADC_CFGR_OVRMOD | + ADC_CFGR_EXTEN | ADC_CFGR_EXTSEL | ADC_CFGR_ALIGN | + ADC_CFGR_RES | ADC_CFGR_DMACFG | ADC_CFGR_DMAEN ); + + /* Reset register SMPR1 */ + CLEAR_BIT(hadc->Instance->SMPR1, ADC_SMPR1_SMP9 | ADC_SMPR1_SMP8 | ADC_SMPR1_SMP7 | + ADC_SMPR1_SMP6 | ADC_SMPR1_SMP5 | ADC_SMPR1_SMP4 | + ADC_SMPR1_SMP3 | ADC_SMPR1_SMP2 | ADC_SMPR1_SMP1 ); + + /* Reset register SMPR2 */ + CLEAR_BIT(hadc->Instance->SMPR2, ADC_SMPR2_SMP18 | ADC_SMPR2_SMP17 | ADC_SMPR2_SMP16 | + ADC_SMPR2_SMP15 | ADC_SMPR2_SMP14 | ADC_SMPR2_SMP13 | + ADC_SMPR2_SMP12 | ADC_SMPR2_SMP11 | ADC_SMPR2_SMP10 ); + + /* Reset register TR1 */ + CLEAR_BIT(hadc->Instance->TR1, ADC_TR1_HT1 | ADC_TR1_LT1); + + /* Reset register TR2 */ + CLEAR_BIT(hadc->Instance->TR2, ADC_TR2_HT2 | ADC_TR2_LT2); + + /* Reset register TR3 */ + CLEAR_BIT(hadc->Instance->TR3, ADC_TR3_HT3 | ADC_TR3_LT3); + + /* Reset register SQR1 */ + CLEAR_BIT(hadc->Instance->SQR1, ADC_SQR1_SQ4 | ADC_SQR1_SQ3 | ADC_SQR1_SQ2 | + ADC_SQR1_SQ1 | ADC_SQR1_L); + + /* Reset register SQR2 */ + CLEAR_BIT(hadc->Instance->SQR2, ADC_SQR2_SQ9 | ADC_SQR2_SQ8 | ADC_SQR2_SQ7 | + ADC_SQR2_SQ6 | ADC_SQR2_SQ5); + + /* Reset register SQR3 */ + CLEAR_BIT(hadc->Instance->SQR3, ADC_SQR3_SQ14 | ADC_SQR3_SQ13 | ADC_SQR3_SQ12 | + ADC_SQR3_SQ11 | ADC_SQR3_SQ10); + + /* Reset register SQR4 */ + CLEAR_BIT(hadc->Instance->SQR4, ADC_SQR4_SQ16 | ADC_SQR4_SQ15); + + /* Reset register DR */ + /* bits in access mode read only, no direct reset applicable*/ + + /* Reset register OFR1 */ + CLEAR_BIT(hadc->Instance->OFR1, ADC_OFR1_OFFSET1_EN | ADC_OFR1_OFFSET1_CH | ADC_OFR1_OFFSET1); + /* Reset register OFR2 */ + CLEAR_BIT(hadc->Instance->OFR2, ADC_OFR2_OFFSET2_EN | ADC_OFR2_OFFSET2_CH | ADC_OFR2_OFFSET2); + /* Reset register OFR3 */ + CLEAR_BIT(hadc->Instance->OFR3, ADC_OFR3_OFFSET3_EN | ADC_OFR3_OFFSET3_CH | ADC_OFR3_OFFSET3); + /* Reset register OFR4 */ + CLEAR_BIT(hadc->Instance->OFR4, ADC_OFR4_OFFSET4_EN | ADC_OFR4_OFFSET4_CH | ADC_OFR4_OFFSET4); + + /* Reset registers JDR1, JDR2, JDR3, JDR4 */ + /* bits in access mode read only, no direct reset applicable*/ + + /* Reset register AWD2CR */ + CLEAR_BIT(hadc->Instance->AWD2CR, ADC_AWD2CR_AWD2CH); + + /* Reset register AWD3CR */ + CLEAR_BIT(hadc->Instance->AWD3CR, ADC_AWD3CR_AWD3CH); + + /* Reset register DIFSEL */ + CLEAR_BIT(hadc->Instance->DIFSEL, ADC_DIFSEL_DIFSEL); + + /* Reset register CALFACT */ + CLEAR_BIT(hadc->Instance->CALFACT, ADC_CALFACT_CALFACT_D | ADC_CALFACT_CALFACT_S); + + + + + + + /* ========== Reset common ADC registers ========== */ + + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + /* Set handle of the other ADC sharing the same common register */ + ADC_COMMON_ADC_OTHER(hadc, &tmphadcSharingSameCommonRegister); + + /* Software is allowed to change common parameters only when all ADCs of */ + /* the common group are disabled. */ + if ((ADC_IS_ENABLE(hadc) == RESET) && + ( (tmphadcSharingSameCommonRegister.Instance == NULL) || + (ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) ) ) + { + /* Reset configuration of ADC common register CCR: + - clock mode: CKMODE + - multimode related parameters: MDMA, DMACFG, DELAY, MULTI (set into + HAL_ADCEx_MultiModeConfigChannel() ) + - internal measurement paths: Vbat, temperature sensor, Vref (set into + HAL_ADC_ConfigChannel() or HAL_ADCEx_InjectedConfigChannel() ) + */ + CLEAR_BIT(tmpADC_Common->CCR, ADC_CCR_CKMODE | + ADC_CCR_VBATEN | + ADC_CCR_TSEN | + ADC_CCR_VREFEN | + ADC_CCR_MDMA | + ADC_CCR_DMACFG | + ADC_CCR_DELAY | + ADC_CCR_MULTI ); + + /* Other ADC common registers (CSR, CDR) are in access mode read only, + no direct reset applicable */ + } + + + /* ========== Hard reset and clock disable of ADC peripheral ========== */ + /* Into HAL_ADC_MspDeInit(), ADC clock can be hard reset and disabled */ + /* at RCC top level. */ + /* Refer to header of this file for more details on clock disabling */ + /* procedure. */ + + +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + if (hadc->MspDeInitCallback == NULL) + { + hadc->MspDeInitCallback = HAL_ADC_MspDeInit; /* Legacy weak MspDeInit */ + } + + /* DeInit the low level hardware */ + hadc->MspDeInitCallback(hadc); +#else + /* DeInit the low level hardware */ + HAL_ADC_MspDeInit(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + + /* Set ADC error code to none */ + ADC_CLEAR_ERRORCODE(hadc); + + /* Set ADC state */ + hadc->State = HAL_ADC_STATE_RESET; + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Deinitialize the ADC peripheral registers to its default reset values. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_DeInit(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check ADC handle */ + if(hadc == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_BUSY_INTERNAL); + + /* Stop potential conversion on going, on regular and injected groups */ + /* Disable ADC peripheral */ + tmp_hal_status = ADC_ConversionStop_Disable(hadc); + + + /* Configuration of ADC parameters if previous preliminary actions are */ + /* correctly completed. */ + if (tmp_hal_status == HAL_OK) + { + /* ========== Reset ADC registers ========== */ + /* Reset register SR */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_AWD | ADC_FLAG_JEOC | ADC_FLAG_EOC | + ADC_FLAG_JSTRT | ADC_FLAG_STRT)); + + /* Reset register CR1 */ + CLEAR_BIT(hadc->Instance->CR1, (ADC_CR1_AWDEN | ADC_CR1_JAWDEN | ADC_CR1_DISCNUM | + ADC_CR1_JDISCEN | ADC_CR1_DISCEN | ADC_CR1_JAUTO | + ADC_CR1_AWDSGL | ADC_CR1_SCAN | ADC_CR1_JEOCIE | + ADC_CR1_AWDIE | ADC_CR1_EOCIE | ADC_CR1_AWDCH )); + + /* Reset register CR2 */ + CLEAR_BIT(hadc->Instance->CR2, (ADC_CR2_TSVREFE | ADC_CR2_SWSTART | ADC_CR2_JSWSTART | + ADC_CR2_EXTTRIG | ADC_CR2_EXTSEL | ADC_CR2_JEXTTRIG | + ADC_CR2_JEXTSEL | ADC_CR2_ALIGN | ADC_CR2_DMA | + ADC_CR2_RSTCAL | ADC_CR2_CAL | ADC_CR2_CONT | + ADC_CR2_ADON )); + + /* Reset register SMPR1 */ + CLEAR_BIT(hadc->Instance->SMPR1, (ADC_SMPR1_SMP18 | ADC_SMPR1_SMP17 | ADC_SMPR1_SMP15 | + ADC_SMPR1_SMP15 | ADC_SMPR1_SMP14 | ADC_SMPR1_SMP13 | + ADC_SMPR1_SMP12 | ADC_SMPR1_SMP11 | ADC_SMPR1_SMP10 )); + + /* Reset register SMPR2 */ + CLEAR_BIT(hadc->Instance->SMPR2, (ADC_SMPR2_SMP9 | ADC_SMPR2_SMP8 | ADC_SMPR2_SMP7 | + ADC_SMPR2_SMP6 | ADC_SMPR2_SMP5 | ADC_SMPR2_SMP4 | + ADC_SMPR2_SMP3 | ADC_SMPR2_SMP2 | ADC_SMPR2_SMP1 | + ADC_SMPR2_SMP0 )); + + /* Reset register JOFR1 */ + CLEAR_BIT(hadc->Instance->JOFR1, ADC_JOFR1_JOFFSET1); + /* Reset register JOFR2 */ + CLEAR_BIT(hadc->Instance->JOFR2, ADC_JOFR2_JOFFSET2); + /* Reset register JOFR3 */ + CLEAR_BIT(hadc->Instance->JOFR3, ADC_JOFR3_JOFFSET3); + /* Reset register JOFR4 */ + CLEAR_BIT(hadc->Instance->JOFR4, ADC_JOFR4_JOFFSET4); + + /* Reset register HTR */ + CLEAR_BIT(hadc->Instance->HTR, ADC_HTR_HT); + /* Reset register LTR */ + CLEAR_BIT(hadc->Instance->LTR, ADC_LTR_LT); + + /* Reset register SQR1 */ + CLEAR_BIT(hadc->Instance->SQR1, ADC_SQR1_L | + ADC_SQR1_SQ16 | ADC_SQR1_SQ15 | + ADC_SQR1_SQ14 | ADC_SQR1_SQ13 ); + + /* Reset register SQR1 */ + CLEAR_BIT(hadc->Instance->SQR1, ADC_SQR1_L | + ADC_SQR1_SQ16 | ADC_SQR1_SQ15 | + ADC_SQR1_SQ14 | ADC_SQR1_SQ13 ); + + /* Reset register SQR2 */ + CLEAR_BIT(hadc->Instance->SQR2, ADC_SQR2_SQ12 | ADC_SQR2_SQ11 | ADC_SQR2_SQ10 | + ADC_SQR2_SQ9 | ADC_SQR2_SQ8 | ADC_SQR2_SQ7 ); + + /* Reset register SQR3 */ + CLEAR_BIT(hadc->Instance->SQR3, ADC_SQR3_SQ6 | ADC_SQR3_SQ5 | ADC_SQR3_SQ4 | + ADC_SQR3_SQ3 | ADC_SQR3_SQ2 | ADC_SQR3_SQ1 ); + + /* Reset register JSQR */ + CLEAR_BIT(hadc->Instance->JSQR, ADC_JSQR_JL | + ADC_JSQR_JSQ4 | ADC_JSQR_JSQ3 | + ADC_JSQR_JSQ2 | ADC_JSQR_JSQ1 ); + + /* Reset register JSQR */ + CLEAR_BIT(hadc->Instance->JSQR, ADC_JSQR_JL | + ADC_JSQR_JSQ4 | ADC_JSQR_JSQ3 | + ADC_JSQR_JSQ2 | ADC_JSQR_JSQ1 ); + + /* Reset register DR */ + /* bits in access mode read only, no direct reset applicable*/ + + /* Reset registers JDR1, JDR2, JDR3, JDR4 */ + /* bits in access mode read only, no direct reset applicable*/ + + /* Reset VBAT measurement path, in case of enabled before by selecting */ + /* channel ADC_CHANNEL_VBAT. */ + SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_VBAT); + + + /* ========== Hard reset ADC peripheral ========== */ + /* Performs a global reset of the entire ADC peripheral: ADC state is */ + /* forced to a similar state after device power-on. */ + /* If needed, copy-paste and uncomment the following reset code into */ + /* function "void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)": */ + /* */ + /* __HAL_RCC_ADC1_FORCE_RESET() */ + /* __HAL_RCC_ADC1_RELEASE_RESET() */ + +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + if (hadc->MspDeInitCallback == NULL) + { + hadc->MspDeInitCallback = HAL_ADC_MspDeInit; /* Legacy weak MspDeInit */ + } + + /* DeInit the low level hardware */ + hadc->MspDeInitCallback(hadc); +#else + /* DeInit the low level hardware */ + HAL_ADC_MspDeInit(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + + /* Set ADC error code to none */ + ADC_CLEAR_ERRORCODE(hadc); + + /* Set ADC state */ + hadc->State = HAL_ADC_STATE_RESET; + + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +/** + * @} + */ + +/** @defgroup ADCEx_Exported_Functions_Group2 ADCEx Input and Output operation functions + * @brief ADC Extended IO operation functions + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Start conversion of regular group. + (+) Stop conversion of regular group. + (+) Poll for conversion complete on regular group. + (+) Poll for conversion event. + (+) Get result of regular channel conversion. + (+) Start conversion of regular group and enable interruptions. + (+) Stop conversion of regular group and disable interruptions. + (+) Handle ADC interrupt request + (+) Start conversion of regular group and enable DMA transfer. + (+) Stop conversion of regular group and disable ADC DMA transfer. + + (+) Start conversion of injected group. + (+) Stop conversion of injected group. + (+) Poll for conversion complete on injected group. + (+) Get result of injected channel conversion. + (+) Start conversion of injected group and enable interruptions. + (+) Stop conversion of injected group and disable interruptions. + + (+) Start multimode and enable DMA transfer. + (+) Stop multimode and disable ADC DMA transfer. + (+) Get result of multimode conversion. + + (+) Perform the ADC self-calibration for single or differential ending. + (+) Get calibration factors for single or differential ending. + (+) Set calibration factors for single or differential ending. + +@endverbatim + * @{ + */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Enables ADC, starts conversion of regular group. + * Interruptions enabled in this function: None. + * @note Case of multimode enabled (for devices with several ADCs): + * if ADC is slave, ADC is enabled only (conversion is not started). + * if ADC is master, ADC is enabled and multimode conversion is started. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Perform ADC enable and conversion start if no conversion is on going */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) + { + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to regular group conversion results */ + /* - Set state bitfield related to regular operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC | HAL_ADC_STATE_REG_OVR | HAL_ADC_STATE_REG_EOSMP, + HAL_ADC_STATE_REG_BUSY); + + /* Set group injected state (from auto-injection) and multimode state */ + /* for all cases of multimode: independent mode, multimode ADC master */ + /* or multimode ADC slave (for devices with several ADCs): */ + if (ADC_NONMULTIMODE_OR_MULTIMODEMASTER(hadc)) + { + /* Set ADC state (ADC independent or master) */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + + /* If conversions on group regular are also triggering group injected,*/ + /* update ADC state. */ + if (READ_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO) != RESET) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + } + else + { + /* Set ADC state (ADC slave) */ + SET_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + + /* If conversions on group regular are also triggering group injected,*/ + /* update ADC state. */ + if (ADC_MULTIMODE_AUTO_INJECTED(hadc)) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + } + + /* State machine update: Check if an injected conversion is ongoing */ + if (HAL_IS_BIT_SET(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + /* Reset ADC error code fields related to conversions on group regular*/ + CLEAR_BIT(hadc->ErrorCode, (HAL_ADC_ERROR_OVR | HAL_ADC_ERROR_DMA)); + } + else + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Clear regular group conversion flag and overrun flag */ + /* (To ensure of no unknown state from potential previous ADC */ + /* operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_EOC | ADC_FLAG_EOS | ADC_FLAG_OVR)); + + /* Enable conversion of regular group. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* Case of multimode enabled (for devices with several ADCs): */ + /* - if ADC is slave, ADC is enabled only (conversion is not started). */ + /* - if ADC is master, ADC is enabled and conversion is started. */ + if (ADC_NONMULTIMODE_REG_OR_MULTIMODEMASTER(hadc)) + { + SET_BIT(hadc->Instance->CR, ADC_CR_ADSTART); + } + } + else + { + /* Process unlocked */ + __HAL_UNLOCK(hadc); + } + } + else + { + tmp_hal_status = HAL_BUSY; + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Enables ADC, starts conversion of regular group. + * Interruptions enabled in this function: None. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_Start(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to regular group conversion results */ + /* - Set state bitfield related to regular operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC, + HAL_ADC_STATE_REG_BUSY); + + /* Set group injected state (from auto-injection) */ + /* If conversions on group regular are also triggering group injected, */ + /* update ADC state. */ + if (READ_BIT(hadc->Instance->CR1, ADC_CR1_JAUTO) != RESET) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + + /* State machine update: Check if an injected conversion is ongoing */ + if (HAL_IS_BIT_SET(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + /* Reset ADC error code fields related to conversions on group regular */ + CLEAR_BIT(hadc->ErrorCode, (HAL_ADC_ERROR_OVR | HAL_ADC_ERROR_DMA)); + } + else + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Clear regular group conversion flag and overrun flag */ + /* (To ensure of no unknown state from potential previous ADC operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_EOC); + + /* Enable conversion of regular group. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* Note: Alternate trigger for single conversion could be to force an */ + /* additional set of bit ADON "hadc->Instance->CR2 |= ADC_CR2_ADON;"*/ + if (ADC_IS_SOFTWARE_START_REGULAR(hadc)) + { + /* Start ADC conversion on regular group with SW start */ + SET_BIT(hadc->Instance->CR2, (ADC_CR2_SWSTART | ADC_CR2_EXTTRIG)); + } + else + { + /* Start ADC conversion on regular group with external trigger */ + SET_BIT(hadc->Instance->CR2, ADC_CR2_EXTTRIG); + } + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Stop ADC conversion of both groups regular and injected, + * disable ADC peripheral. + * @note ADC peripheral disable is forcing interruption of potential + * conversion on injected group. If injected group is under use, + * it should be preliminarily stopped using function + * @ref HAL_ADCEx_InjectedStop(). + * To stop ADC conversion only on ADC group regular + * while letting ADC group injected conversions running, + * use function @ref HAL_ADCEx_RegularStop(). + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* 1. Stop potential conversion on going, on regular and injected groups */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_INJECTED_GROUP); + + /* Disable ADC peripheral if conversions are effectively stopped */ + if (tmp_hal_status == HAL_OK) + { + /* 2. Disable the ADC peripheral */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Stop ADC conversion of regular group (and injected channels in + * case of auto_injection mode), disable ADC peripheral. + * @note ADC peripheral disable is forcing interruption of potential + * conversion on injected group. If injected group is under use, it + * should be preliminarily stopped using HAL_ADCEx_InjectedStop function. + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADC_Stop(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential conversion on going, on regular and injected groups */ + /* Disable ADC peripheral */ + tmp_hal_status = ADC_ConversionStop_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Wait for regular group conversion to be completed. + * @note ADC conversion flags EOS (end of sequence) and EOC (end of + * conversion) are cleared by this function, with an exception: + * if low power feature "LowPowerAutoWait" is enabled, flags are + * not cleared to not interfere with this feature until data register + * is read using function HAL_ADC_GetValue(). + * @note This function cannot be used in a particular setup: ADC configured + * in DMA mode and polling for end of each conversion (ADC init + * parameter "EOCSelection" set to ADC_EOC_SINGLE_CONV). + * In this case, DMA resets the flag EOC and polling cannot be + * performed on each conversion. Nevertheless, polling can still + * be performed on the complete sequence (ADC init + * parameter "EOCSelection" set to ADC_EOC_SEQ_CONV). + * @param hadc ADC handle + * @param Timeout Timeout value in millisecond. + * @note Depending on init parameter "EOCSelection", flags EOS or EOC is + * checked and cleared depending on autodelay status (bit AUTDLY). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout) +{ + uint32_t tickstart; + uint32_t tmp_Flag_EOC; + ADC_Common_TypeDef *tmpADC_Common; + uint32_t tmp_cfgr = 0x0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + +/* If end of conversion selected to end of sequence */ + if (hadc->Init.EOCSelection == ADC_EOC_SEQ_CONV) + { + tmp_Flag_EOC = ADC_FLAG_EOS; + } + /* If end of conversion selected to end of each conversion */ + else /* ADC_EOC_SINGLE_CONV */ + { + /* Verification that ADC configuration is compliant with polling for */ + /* each conversion: */ + /* Particular case is ADC configured in DMA mode and ADC sequencer with */ + /* several ranks and polling for end of each conversion. */ + /* For code simplicity sake, this particular case is generalized to */ + /* ADC configured in DMA mode and and polling for end of each conversion. */ + + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may have up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + /* Check DMA configuration, depending on MultiMode set or not */ + if (READ_BIT(tmpADC_Common->CCR, ADC_CCR_MULTI) == ADC_MODE_INDEPENDENT) + { + if (HAL_IS_BIT_SET(hadc->Instance->CFGR, ADC_CFGR_DMAEN)) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + else + { + /* MultiMode is enabled, Common Control Register MDMA bits must be checked */ + if (READ_BIT(tmpADC_Common->CCR, ADC_CCR_MDMA) != RESET) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + + tmp_Flag_EOC = (ADC_FLAG_EOC | ADC_FLAG_EOS); + + } + + /* Get relevant register CFGR in ADC instance of ADC master or slave */ + /* in function of multimode state (for devices with multimode */ + /* available). */ + if(ADC_NONMULTIMODE_OR_MULTIMODEMASTER(hadc)) + { + tmp_cfgr = READ_REG(hadc->Instance->CFGR); + } + else + { + tmp_cfgr = READ_REG(ADC_MASTER_INSTANCE(hadc)->CFGR); + } + + /* Get tick count */ + tickstart = HAL_GetTick(); + + /* Wait until End of Conversion or End of Sequence flag is raised */ + while(HAL_IS_BIT_CLR(hadc->Instance->ISR, tmp_Flag_EOC)) + { + /* Check if timeout is disabled (set to infinite wait) */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout)) + { + /* New check to avoid false timeout detection in case of preemption */ + if(HAL_IS_BIT_CLR(hadc->Instance->ISR, tmp_Flag_EOC)) + { + /* Update ADC state machine to timeout */ + SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_TIMEOUT; + } + } + } + } + + /* Update ADC state machine */ + SET_BIT(hadc->State, HAL_ADC_STATE_REG_EOC); + + /* Determine whether any further conversion upcoming on group regular */ + /* by external trigger, continuous mode or scan sequence on going. */ + if(ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (READ_BIT (tmp_cfgr, ADC_CFGR_CONT) == RESET) ) + { + /* If End of Sequence is reached, disable interrupts */ + if( __HAL_ADC_GET_FLAG(hadc, ADC_FLAG_EOS) ) + { + /* Allowed to modify bits ADC_IT_EOC/ADC_IT_EOS only if bit */ + /* ADSTART==0 (no conversion on going) */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + else + { + /* Change ADC state to error state */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + } + } + } + + /* Clear end of conversion flag of regular group if low power feature */ + /* "LowPowerAutoWait " is disabled, to not interfere with this feature */ + /* until data register is read using function HAL_ADC_GetValue(). */ + if (READ_BIT (tmp_cfgr, ADC_CFGR_AUTDLY) == RESET) + { + /* Clear regular group conversion flag */ + /* (EOC or EOS depending on HAL ADC initialization parameter) */ + __HAL_ADC_CLEAR_FLAG(hadc, tmp_Flag_EOC); + } + + /* Return ADC state */ + return HAL_OK; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Wait for regular group conversion to be completed. + * @note This function cannot be used in a particular setup: ADC configured + * in DMA mode. + * In this case, DMA resets the flag EOC and polling cannot be + * performed on each conversion. + * @note On STM32F37x devices, limitation in case of sequencer enabled + * (several ranks selected): polling cannot be done on each + * conversion inside the sequence. In this case, polling is replaced by + * wait for maximum conversion time. + * @param hadc ADC handle + * @param Timeout Timeout value in millisecond. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_PollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout) +{ + uint32_t tickstart; + + /* Variables for polling in case of scan mode enabled */ + uint32_t Conversion_Timeout_CPU_cycles_max = 0U; + uint32_t Conversion_Timeout_CPU_cycles = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Verification that ADC configuration is compliant with polling for */ + /* each conversion: */ + /* Particular case is ADC configured in DMA mode */ + if (HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_DMA)) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + + /* Get tick count */ + tickstart = HAL_GetTick(); + + /* Polling for end of conversion: differentiation if single/sequence */ + /* conversion. */ + /* - If single conversion for regular group (Scan mode disabled or enabled */ + /* with NbrOfConversion =1U), flag EOC is used to determine the */ + /* conversion completion. */ + /* - If sequence conversion for regular group (scan mode enabled and */ + /* NbrOfConversion >=2U), flag EOC is set only at the end of the */ + /* sequence. */ + /* To poll for each conversion, the maximum conversion time is computed */ + /* from ADC conversion time (selected sampling time + conversion time of */ + /* 12.5 ADC clock cycles) and APB2/ADC clock prescalers (depending on */ + /* settings, conversion time range can be from 28 to 32256 CPU cycles). */ + /* As flag EOC is not set after each conversion, no timeout status can */ + /* be set. */ + if (HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_SCAN) && + HAL_IS_BIT_CLR(hadc->Instance->SQR1, ADC_SQR1_L) ) + { + /* Wait until End of Conversion flag is raised */ + while(HAL_IS_BIT_CLR(hadc->Instance->SR, ADC_FLAG_EOC)) + { + /* Check if timeout is disabled (set to infinite wait) */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout)) + { + /* New check to avoid false timeout detection in case of preemption */ + if(HAL_IS_BIT_CLR(hadc->Instance->SR, ADC_FLAG_EOC)) + { + /* Update ADC state machine to timeout */ + SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_TIMEOUT; + } + } + } + } + } + else + { + /* Replace polling by wait for maximum conversion time */ + /* Calculation of CPU cycles corresponding to ADC conversion cycles. */ + /* Retrieve ADC clock prescaler and ADC maximum conversion cycles on all */ + /* channels. */ + Conversion_Timeout_CPU_cycles_max = ADC_CLOCK_PRESCALER_RANGE() ; + Conversion_Timeout_CPU_cycles_max *= ADC_CONVCYCLES_MAX_RANGE(hadc); + + /* Poll with maximum conversion time */ + while(Conversion_Timeout_CPU_cycles < Conversion_Timeout_CPU_cycles_max) + { + /* Check if timeout is disabled (set to infinite wait) */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart ) > Timeout)) + { + /* New check to avoid false timeout detection in case of preemption */ + if(Conversion_Timeout_CPU_cycles < Conversion_Timeout_CPU_cycles_max) + { + /* Update ADC state machine to timeout */ + SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_TIMEOUT; + } + } + } + Conversion_Timeout_CPU_cycles ++; + } + } + + /* Clear regular group conversion flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_STRT | ADC_FLAG_EOC); + + /* Update ADC state machine */ + SET_BIT(hadc->State, HAL_ADC_STATE_REG_EOC); + + /* Determine whether any further conversion upcoming on group regular */ + /* by external trigger, continuous mode or scan sequence on going. */ + /* Note: On STM32F37x devices, in case of sequencer enabled */ + /* (several ranks selected), end of conversion flag is raised */ + /* at the end of the sequence. */ + if(ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (hadc->Init.ContinuousConvMode == DISABLE) ) + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + + /* Return ADC state */ + return HAL_OK; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Poll for conversion event. + * @param hadc ADC handle + * @param EventType the ADC event type. + * This parameter can be one of the following values: + * @arg ADC_AWD1_EVENT: ADC Analog watchdog 1 event (main analog watchdog, present on all STM32 devices) + * @arg ADC_AWD2_EVENT: ADC Analog watchdog 2 event (additional analog watchdog, not present on all STM32 families) + * @arg ADC_AWD3_EVENT: ADC Analog watchdog 3 event (additional analog watchdog, not present on all STM32 families) + * @arg ADC_OVR_EVENT: ADC Overrun event + * @arg ADC_JQOVF_EVENT: ADC Injected context queue overflow event + * @param Timeout Timeout value in millisecond. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout) +{ + uint32_t tickstart; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_EVENT_TYPE(EventType)); + + /* Get start tick count */ + tickstart = HAL_GetTick(); + + /* Check selected event flag */ + while(__HAL_ADC_GET_FLAG(hadc, EventType) == RESET) + { + /* Check if timeout is disabled (set to infinite wait) */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart ) > Timeout)) + { + /* New check to avoid false timeout detection in case of preemption */ + if(__HAL_ADC_GET_FLAG(hadc, EventType) == RESET) + { + /* Update ADC state machine to timeout */ + SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_TIMEOUT; + } + } + } + } + + + switch(EventType) + { + /* Analog watchdog (level out of window) event */ + /* Note: In case of several analog watchdog enabled, if needed to know */ + /* which one triggered and on which ADCx, test ADC state of analog watchdog */ + /* flags HAL_ADC_STATE_AWD1/2U/3 using function "HAL_ADC_GetState()". */ + /* For example: */ + /* " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_AWD1)) " */ + /* " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_AWD2)) " */ + /* " if (HAL_IS_BIT_SET(HAL_ADC_GetState(hadc1), HAL_ADC_STATE_AWD3)) " */ + /* Check analog watchdog 1 flag */ + case ADC_AWD_EVENT: + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_AWD1); + + /* Clear ADC analog watchdog flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD1); + break; + + /* Check analog watchdog 2 flag */ + case ADC_AWD2_EVENT: + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_AWD2); + + /* Clear ADC analog watchdog flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD2); + break; + + /* Check analog watchdog 3 flag */ + case ADC_AWD3_EVENT: + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_AWD3); + + /* Clear ADC analog watchdog flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD3); + break; + + /* Injected context queue overflow event */ + case ADC_JQOVF_EVENT: + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_INJ_JQOVF); + + /* Set ADC error code to Injected context queue overflow */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_JQOVF); + + /* Clear ADC Injected context queue overflow flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_JQOVF); + break; + + /* Overrun event */ + default: /* Case ADC_OVR_EVENT */ + /* If overrun is set to overwrite previous data, overrun event is not */ + /* considered as an error. */ + /* (cf ref manual "Managing conversions without using the DMA and without */ + /* overrun ") */ + if (hadc->Init.Overrun == ADC_OVR_DATA_PRESERVED) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_REG_OVR); + + /* Set ADC error code to overrun */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_OVR); + } + + /* Clear ADC Overrun flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_OVR); + break; + } + + /* Return ADC state */ + return HAL_OK; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Poll for conversion event. + * @param hadc ADC handle + * @param EventType the ADC event type. + * This parameter can be one of the following values: + * @arg ADC_AWD_EVENT: ADC Analog watchdog event. + * @param Timeout Timeout value in millisecond. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_PollForEvent(ADC_HandleTypeDef* hadc, uint32_t EventType, uint32_t Timeout) +{ + uint32_t tickstart; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_EVENT_TYPE(EventType)); + + tickstart = HAL_GetTick(); + + /* Check selected event flag */ + while(__HAL_ADC_GET_FLAG(hadc, EventType) == RESET) + { + /* Check if timeout is disabled (set to infinite wait) */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout)) + { + /* New check to avoid false timeout detection in case of preemption */ + if(__HAL_ADC_GET_FLAG(hadc, EventType) == RESET) + { + /* Update ADC state machine to timeout */ + SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + } + } + + /* Analog watchdog (level out of window) event */ + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_AWD1); + + /* Clear ADC analog watchdog flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD); + + /* Return ADC state */ + return HAL_OK; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Enables ADC, starts conversion of regular group with interruption. + * Interruptions enabled in this function: + * - EOC (end of conversion of regular group) or EOS (end of + * sequence of regular group) depending on ADC initialization + * parameter "EOCSelection" + * - overrun, depending on ADC initialization parameter "Overrun" + * Each of these interruptions has its dedicated callback function. + * @note Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC slave first, then ADC master. + * For ADC slave, ADC is enabled only (conversion is not started). + * For ADC master, ADC is enabled and multimode conversion is started. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Perform ADC enable and conversion start if no conversion is on going */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) + { + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to regular group conversion results */ + /* - Set state bitfield related to regular operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC | HAL_ADC_STATE_REG_OVR | HAL_ADC_STATE_REG_EOSMP, + HAL_ADC_STATE_REG_BUSY); + + /* Set group injected state (from auto-injection) and multimode state */ + /* for all cases of multimode: independent mode, multimode ADC master */ + /* or multimode ADC slave (for devices with several ADCs): */ + if (ADC_NONMULTIMODE_OR_MULTIMODEMASTER(hadc)) + { + /* Set ADC state (ADC independent or master) */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + + /* If conversions on group regular are also triggering group injected,*/ + /* update ADC state. */ + if (READ_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO) != RESET) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + } + else + { + /* Set ADC state (ADC slave) */ + SET_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + + /* If conversions on group regular are also triggering group injected,*/ + /* update ADC state. */ + if (ADC_MULTIMODE_AUTO_INJECTED(hadc)) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + } + + /* State machine update: Check if an injected conversion is ongoing */ + if (HAL_IS_BIT_SET(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + /* Reset ADC error code fields related to conversions on group regular*/ + CLEAR_BIT(hadc->ErrorCode, (HAL_ADC_ERROR_OVR | HAL_ADC_ERROR_DMA)); + } + else + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Clear regular group conversion flag and overrun flag */ + /* (To ensure of no unknown state from potential previous ADC */ + /* operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_EOC | ADC_FLAG_EOS | ADC_FLAG_OVR)); + + /* Enable ADC end of conversion interrupt */ + /* Enable ADC overrun interrupt */ + switch(hadc->Init.EOCSelection) + { + case ADC_EOC_SEQ_CONV: + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_EOC); + __HAL_ADC_ENABLE_IT(hadc, (ADC_IT_EOS)); + break; + /* case ADC_EOC_SINGLE_CONV */ + default: + __HAL_ADC_ENABLE_IT(hadc, (ADC_IT_EOC | ADC_IT_EOS)); + break; + } + + /* If overrun is set to overwrite previous data (default setting), */ + /* overrun interrupt is not activated (overrun event is not considered */ + /* as an error). */ + /* (cf ref manual "Managing conversions without using the DMA and */ + /* without overrun ") */ + if (hadc->Init.Overrun == ADC_OVR_DATA_PRESERVED) + { + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_OVR); + } + + /* Enable conversion of regular group. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* Case of multimode enabled (for devices with several ADCs): */ + /* - if ADC is slave, ADC is enabled only (conversion is not started). */ + /* - if ADC is master, ADC is enabled and conversion is started. */ + if (ADC_NONMULTIMODE_REG_OR_MULTIMODEMASTER(hadc)) + { + SET_BIT(hadc->Instance->CR, ADC_CR_ADSTART); + } + } + else + { + /* Process unlocked */ + __HAL_UNLOCK(hadc); + } + } + else + { + tmp_hal_status = HAL_BUSY; + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Enables ADC, starts conversion of regular group with interruption. + * Interruptions enabled in this function: + * - EOC (end of conversion of regular group) + * Each of these interruptions has its dedicated callback function. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_Start_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to regular group conversion results */ + /* - Set state bitfield related to regular operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC, + HAL_ADC_STATE_REG_BUSY); + + /* Set group injected state (from auto-injection) */ + /* If conversions on group regular are also triggering group injected, */ + /* update ADC state. */ + if (READ_BIT(hadc->Instance->CR1, ADC_CR1_JAUTO) != RESET) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + + /* State machine update: Check if an injected conversion is ongoing */ + if (HAL_IS_BIT_SET(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + /* Reset ADC error code fields related to conversions on group regular */ + CLEAR_BIT(hadc->ErrorCode, (HAL_ADC_ERROR_OVR | HAL_ADC_ERROR_DMA)); + } + else + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Clear regular group conversion flag and overrun flag */ + /* (To ensure of no unknown state from potential previous ADC operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_EOC); + + /* Enable end of conversion interrupt for regular group */ + __HAL_ADC_ENABLE_IT(hadc, ADC_IT_EOC); + + /* Enable conversion of regular group. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + if (ADC_IS_SOFTWARE_START_REGULAR(hadc)) + { + /* Start ADC conversion on regular group with SW start */ + SET_BIT(hadc->Instance->CR2, (ADC_CR2_SWSTART | ADC_CR2_EXTTRIG)); + } + else + { + /* Start ADC conversion on regular group with external trigger */ + SET_BIT(hadc->Instance->CR2, ADC_CR2_EXTTRIG); + } + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Stop ADC conversion of both groups regular and injected, + * disable ADC peripheral. + * Interruptions disabled in this function: + * - EOC (end of conversion of regular group) and EOS (end of + * sequence of regular group) + * - overrun + * @note ADC peripheral disable is forcing interruption of potential + * conversion on injected group. If injected group is under use, + * it should be preliminarily stopped using function + * @ref HAL_ADCEx_InjectedStop(). + * To stop ADC conversion only on ADC group regular + * while letting ADC group injected conversions running, + * use function @ref HAL_ADCEx_RegularStop_IT(). + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* 1. Stop potential conversion on going, on regular and injected groups */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_INJECTED_GROUP); + + /* Disable ADC peripheral if conversions are effectively stopped */ + if (tmp_hal_status == HAL_OK) + { + /* Disable ADC end of conversion interrupt for regular group */ + /* Disable ADC overrun interrupt */ + __HAL_ADC_DISABLE_IT(hadc, (ADC_IT_EOC | ADC_IT_EOS | ADC_IT_OVR)); + + /* 2. Disable the ADC peripheral */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Stop ADC conversion of regular group (and injected group in + * case of auto_injection mode), disable interrution of + * end-of-conversion, disable ADC peripheral. + * @param hadc ADC handle + * @retval None + */ +HAL_StatusTypeDef HAL_ADC_Stop_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential conversion on going, on regular and injected groups */ + /* Disable ADC peripheral */ + tmp_hal_status = ADC_ConversionStop_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Disable ADC end of conversion interrupt for regular group */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_EOC); + + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Enables ADC, starts conversion of regular group and transfers result + * through DMA. + * Interruptions enabled in this function: + * - DMA transfer complete + * - DMA half transfer + * - overrun + * Each of these interruptions has its dedicated callback function. + * @note Case of multimode enabled (for devices with several ADCs): This + * function is for single-ADC mode only. For multimode, use the + * dedicated MultimodeStart function. + * @param hadc ADC handle + * @param pData The destination Buffer address. + * @param Length The length of data to be transferred from ADC peripheral to memory. + * @retval None + */ +HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Perform ADC enable and conversion start if no conversion is on going */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) + { + /* Process locked */ + __HAL_LOCK(hadc); + + /* Verification if multimode is disabled (for devices with several ADC) */ + /* If multimode is enabled, dedicated function multimode conversion */ + /* start DMA must be used. */ + if(ADC_COMMON_CCR_MULTI(hadc) == RESET) + { + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to regular group conversion results */ + /* - Set state bitfield related to regular operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC | HAL_ADC_STATE_REG_OVR | HAL_ADC_STATE_REG_EOSMP, + HAL_ADC_STATE_REG_BUSY); + + /* Set group injected state (from auto-injection) and multimode state */ + /* for all cases of multimode: independent mode, multimode ADC master */ + /* or multimode ADC slave (for devices with several ADCs): */ + if (ADC_NONMULTIMODE_OR_MULTIMODEMASTER(hadc)) + { + /* Set ADC state (ADC independent or master) */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + + /* If conversions on group regular are also triggering group injected,*/ + /* update ADC state. */ + if (READ_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO) != RESET) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + } + else + { + /* Set ADC state (ADC slave) */ + SET_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + + /* If conversions on group regular are also triggering group injected,*/ + /* update ADC state. */ + if (ADC_MULTIMODE_AUTO_INJECTED(hadc)) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + } + + /* State machine update: Check if an injected conversion is ongoing */ + if (HAL_IS_BIT_SET(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + /* Reset ADC error code fields related to conversions on group regular*/ + CLEAR_BIT(hadc->ErrorCode, (HAL_ADC_ERROR_OVR | HAL_ADC_ERROR_DMA)); + } + else + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + + /* Set the DMA transfer complete callback */ + hadc->DMA_Handle->XferCpltCallback = ADC_DMAConvCplt; + + /* Set the DMA half transfer complete callback */ + hadc->DMA_Handle->XferHalfCpltCallback = ADC_DMAHalfConvCplt; + + /* Set the DMA error callback */ + hadc->DMA_Handle->XferErrorCallback = ADC_DMAError; + + + /* Manage ADC and DMA start: ADC overrun interruption, DMA start, ADC */ + /* start (in case of SW start): */ + + /* Clear regular group conversion flag and overrun flag */ + /* (To ensure of no unknown state from potential previous ADC */ + /* operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_EOC | ADC_FLAG_EOS | ADC_FLAG_OVR)); + + /* Enable ADC overrun interrupt */ + __HAL_ADC_ENABLE_IT(hadc, ADC_IT_OVR); + + /* Enable ADC DMA mode */ + SET_BIT(hadc->Instance->CFGR, ADC_CFGR_DMAEN); + + /* Start the DMA channel */ + HAL_DMA_Start_IT(hadc->DMA_Handle, (uint32_t)&hadc->Instance->DR, (uint32_t)pData, Length); + + /* Enable conversion of regular group. */ + /* If software start has been selected, conversion starts immediately.*/ + /* If external trigger has been selected, conversion will start at */ + /* next trigger event. */ + SET_BIT(hadc->Instance->CR, ADC_CR_ADSTART); + + } + else + { + /* Process unlocked */ + __HAL_UNLOCK(hadc); + } + } + else + { + tmp_hal_status = HAL_ERROR; + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + } + } + else + { + tmp_hal_status = HAL_BUSY; + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Enables ADC, starts conversion of regular group and transfers result + * through DMA. + * Interruptions enabled in this function: + * - DMA transfer complete + * - DMA half transfer + * Each of these interruptions has its dedicated callback function. + * @note For devices with several ADCs: This function is for single-ADC mode + * only. For multimode, use the dedicated MultimodeStart function. + * @param hadc ADC handle + * @param pData The destination Buffer address. + * @param Length The length of data to be transferred from ADC peripheral to memory. + * @retval None + */ +HAL_StatusTypeDef HAL_ADC_Start_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to regular group conversion results */ + /* - Set state bitfield related to regular operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC, + HAL_ADC_STATE_REG_BUSY); + + /* Set group injected state (from auto-injection) */ + /* If conversions on group regular are also triggering group injected, */ + /* update ADC state. */ + if (READ_BIT(hadc->Instance->CR1, ADC_CR1_JAUTO) != RESET) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + + /* State machine update: Check if an injected conversion is ongoing */ + if (HAL_IS_BIT_SET(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + /* Reset ADC error code fields related to conversions on group regular */ + CLEAR_BIT(hadc->ErrorCode, (HAL_ADC_ERROR_OVR | HAL_ADC_ERROR_DMA)); + } + else + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Set the DMA transfer complete callback */ + hadc->DMA_Handle->XferCpltCallback = ADC_DMAConvCplt; + + /* Set the DMA half transfer complete callback */ + hadc->DMA_Handle->XferHalfCpltCallback = ADC_DMAHalfConvCplt; + + /* Set the DMA error callback */ + hadc->DMA_Handle->XferErrorCallback = ADC_DMAError; + + + /* Manage ADC and DMA start: ADC overrun interruption, DMA start, ADC */ + /* start (in case of SW start): */ + + /* Clear regular group conversion flag and overrun flag */ + /* (To ensure of no unknown state from potential previous ADC operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_EOC); + + /* Enable ADC DMA mode */ + hadc->Instance->CR2 |= ADC_CR2_DMA; + + /* Start the DMA channel */ + HAL_DMA_Start_IT(hadc->DMA_Handle, (uint32_t)&hadc->Instance->DR, (uint32_t)pData, Length); + + /* Enable conversion of regular group. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* Note: Alternate trigger for single conversion could be to force an */ + /* additional set of bit ADON "hadc->Instance->CR2 |= ADC_CR2_ADON;"*/ + if (ADC_IS_SOFTWARE_START_REGULAR(hadc)) + { + /* Start ADC conversion on regular group with SW start */ + SET_BIT(hadc->Instance->CR2, (ADC_CR2_SWSTART | ADC_CR2_EXTTRIG)); + } + else + { + /* Start ADC conversion on regular group with external trigger */ + SET_BIT(hadc->Instance->CR2, ADC_CR2_EXTTRIG); + } + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Stop ADC conversion of both groups regular and injected, + * disable ADC DMA transfer, disable ADC peripheral. + * Interruptions disabled in this function: + * - DMA transfer complete + * - DMA half transfer + * - overrun + * @note ADC peripheral disable is forcing interruption of potential + * conversion on injected group. If injected group is under use, + * it should be preliminarily stopped using function + * @ref HAL_ADCEx_InjectedStop(). + * To stop ADC conversion only on ADC group regular + * while letting ADC group injected conversions running, + * use function @ref HAL_ADCEx_RegularStop_DMA(). + * @note Case of multimode enabled (for devices with several ADCs): This + * function is for single-ADC mode only. For multimode, use the + * dedicated MultimodeStop function. + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* 1. Stop potential conversion on going, on regular and injected groups */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_INJECTED_GROUP); + + /* Disable ADC peripheral if conversions are effectively stopped */ + if (tmp_hal_status == HAL_OK) + { + /* Disable ADC DMA (ADC DMA configuration ADC_CFGR_DMACFG is kept) */ + CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_DMAEN); + + /* Disable the DMA channel (in case of DMA in circular mode or stop while */ + /* while DMA transfer is on going) */ + if (hadc->DMA_Handle->State == HAL_DMA_STATE_BUSY) + { + tmp_hal_status = HAL_DMA_Abort(hadc->DMA_Handle); + + /* Check if DMA channel effectively disabled */ + if (tmp_hal_status != HAL_OK) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); + } + } + + /* Disable ADC overrun interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_OVR); + + /* 2. Disable the ADC peripheral */ + /* Update "tmp_hal_status" only if DMA channel disabling passed, */ + /* to retain a potential failing status. */ + if (tmp_hal_status == HAL_OK) + { + tmp_hal_status = ADC_Disable(hadc); + } + else + { + ADC_Disable(hadc); + } + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Stop ADC conversion of regular group (and injected group in + * case of auto_injection mode), disable ADC DMA transfer, disable + * ADC peripheral. + * @note ADC peripheral disable is forcing interruption of potential + * conversion on injected group. If injected group is under use, it + * should be preliminarily stopped using HAL_ADCEx_InjectedStop function. + * @note For devices with several ADCs: This function is for single-ADC mode + * only. For multimode, use the dedicated MultimodeStop function. + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADC_Stop_DMA(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential conversion on going, on regular and injected groups */ + /* Disable ADC peripheral */ + tmp_hal_status = ADC_ConversionStop_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Disable ADC DMA mode */ + hadc->Instance->CR2 &= ~ADC_CR2_DMA; + + /* Disable the DMA channel (in case of DMA in circular mode or stop while */ + /* while DMA transfer is on going) */ + tmp_hal_status = HAL_DMA_Abort(hadc->DMA_Handle); + + /* Check if DMA channel effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); + } + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Get ADC regular group conversion result. + * @note Reading register DR automatically clears ADC flag EOC + * (ADC group regular end of unitary conversion). + * @note This function does not clear ADC flag EOS + * (ADC group regular end of sequence conversion). + * Occurrence of flag EOS rising: + * - If sequencer is composed of 1 rank, flag EOS is equivalent + * to flag EOC. + * - If sequencer is composed of several ranks, during the scan + * sequence flag EOC only is raised, at the end of the scan sequence + * both flags EOC and EOS are raised. + * To clear this flag, either use function: + * in programming model IT: @ref HAL_ADC_IRQHandler(), in programming + * model polling: @ref HAL_ADC_PollForConversion() + * or @ref __HAL_ADC_CLEAR_FLAG(&hadc, ADC_FLAG_EOS). + * @param hadc ADC handle + * @retval ADC group regular conversion data + */ +uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Note: ADC flag EOC is not cleared here by software because */ + /* automatically cleared by hardware when reading register DR. */ + + /* Return ADC converted value */ + return hadc->Instance->DR; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Get ADC regular group conversion result. + * @note Reading register DR automatically clears ADC flag EOC + * (ADC group regular end of unitary conversion). + * @note This function does not clear ADC flag EOS + * (ADC group regular end of sequence conversion). + * Occurrence of flag EOS rising: + * - If sequencer is composed of 1 rank, flag EOS is equivalent + * to flag EOC. + * - If sequencer is composed of several ranks, during the scan + * sequence flag EOC only is raised, at the end of the scan sequence + * both flags EOC and EOS are raised. + * To clear this flag, either use function: + * in programming model IT: @ref HAL_ADC_IRQHandler(), in programming + * model polling: @ref HAL_ADC_PollForConversion() + * or @ref __HAL_ADC_CLEAR_FLAG(&hadc, ADC_FLAG_EOS). + * @param hadc ADC handle + * @retval ADC group regular conversion data + */ +uint32_t HAL_ADC_GetValue(ADC_HandleTypeDef* hadc) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Note: EOC flag is not cleared here by software because automatically */ + /* cleared by hardware when reading register DR. */ + + /* Return ADC converted value */ + return hadc->Instance->DR; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Handles ADC interrupt request. + * @param hadc ADC handle + * @retval None + */ +void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc) +{ + uint32_t overrun_error = 0U; /* flag set if overrun occurrence has to be considered as an error */ + ADC_Common_TypeDef *tmpADC_Common; + uint32_t tmp_cfgr = 0x0U; + uint32_t tmp_cfgr_jqm = 0x0U; + uint32_t tmp_isr = hadc->Instance->ISR; + uint32_t tmp_ier = hadc->Instance->IER; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); + assert_param(IS_ADC_EOC_SELECTION(hadc->Init.EOCSelection)); + + /* ========== Check End of Conversion flag for regular group ========== */ + if( (((tmp_isr & ADC_FLAG_EOC) == ADC_FLAG_EOC) && ((tmp_ier & ADC_IT_EOC) == ADC_IT_EOC)) || + (((tmp_isr & ADC_FLAG_EOS) == ADC_FLAG_EOS) && ((tmp_ier & ADC_IT_EOS) == ADC_IT_EOS)) ) + { + /* Update state machine on conversion status if not in error state */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL)) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_REG_EOC); + } + + /* Get relevant register CFGR in ADC instance of ADC master or slave */ + /* in function of multimode state (for devices with multimode */ + /* available). */ + if (ADC_NONMULTIMODE_REG_OR_MULTIMODEMASTER(hadc)) + { + tmp_cfgr = READ_REG(hadc->Instance->CFGR); + } + else + { + tmp_cfgr = READ_REG(ADC_MASTER_INSTANCE(hadc)->CFGR); + } + + /* Disable interruption if no further conversion upcoming by regular */ + /* external trigger or by continuous mode, */ + /* and if scan sequence if completed. */ + if(ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (READ_BIT(tmp_cfgr, ADC_CFGR_CONT) == RESET) ) + { + /* If End of Sequence is reached, disable interrupts */ + if((tmp_isr & ADC_FLAG_EOS) == ADC_FLAG_EOS) + { + /* Allowed to modify bits ADC_IT_EOC/ADC_IT_EOS only if bit */ + /* ADSTART==0 (no conversion on going) */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) + { + /* Disable ADC end of sequence conversion interrupt */ + /* Note: Overrun interrupt was enabled with EOC interrupt in */ + /* HAL_Start_IT(), but is not disabled here because can be used */ + /* by overrun IRQ process below. */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_EOC | ADC_IT_EOS); + + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + } + } + } + + /* Conversion complete callback */ + /* Note: into callback, to determine if conversion has been triggered */ + /* from EOC or EOS, possibility to use: */ + /* " if( __HAL_ADC_GET_FLAG(&hadc, ADC_FLAG_EOS)) " */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->ConvCpltCallback(hadc); +#else + HAL_ADC_ConvCpltCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + + + /* Clear regular group conversion flag */ + /* Note: in case of overrun set to ADC_OVR_DATA_PRESERVED, end of */ + /* conversion flags clear induces the release of the preserved */ + /* data. */ + /* Therefore, if the preserved data value is needed, it must be */ + /* read preliminarily into HAL_ADC_ConvCpltCallback(). */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_EOC | ADC_FLAG_EOS) ); + } + + + /* ========== Check End of Conversion flag for injected group ========== */ + if( (((tmp_isr & ADC_FLAG_JEOC) == ADC_FLAG_JEOC) && ((tmp_ier & ADC_IT_JEOC) == ADC_IT_JEOC)) || + (((tmp_isr & ADC_FLAG_JEOS) == ADC_FLAG_JEOS) && ((tmp_ier & ADC_IT_JEOS) == ADC_IT_JEOS)) ) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_INJ_EOC); + + /* Get relevant register CFGR in ADC instance of ADC master or slave */ + /* in function of multimode state (for devices with multimode */ + /* available). */ + if (ADC_NONMULTIMODE_REG_OR_MULTIMODEMASTER(hadc)) + { + tmp_cfgr = READ_REG(hadc->Instance->CFGR); + } + else + { + tmp_cfgr = READ_REG(ADC_MASTER_INSTANCE(hadc)->CFGR); + } + + /* Disable interruption if no further conversion upcoming by injected */ + /* external trigger or by automatic injected conversion with regular */ + /* group having no further conversion upcoming (same conditions as */ + /* regular group interruption disabling above), */ + /* and if injected scan sequence is completed. */ + if(ADC_IS_SOFTWARE_START_INJECTED(hadc)) + { + if((READ_BIT (tmp_cfgr, ADC_CFGR_JAUTO) == RESET) || + (ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (READ_BIT (tmp_cfgr, ADC_CFGR_CONT) == RESET) ) ) + { + /* If End of Sequence is reached, disable interrupts */ + if((tmp_isr & ADC_FLAG_JEOS) == ADC_FLAG_JEOS) + { + + /* Get relevant register CFGR in ADC instance of ADC master or slave */ + /* in function of multimode state (for devices with multimode */ + /* available). */ + if (ADC_NONMULTIMODE_INJ_OR_MULTIMODEMASTER(hadc)) + { + tmp_cfgr_jqm = READ_REG(hadc->Instance->CFGR); + } + else + { + tmp_cfgr_jqm = READ_REG(ADC_MASTER_INSTANCE(hadc)->CFGR); + } + + /* Particular case if injected contexts queue is enabled: */ + /* when the last context has been fully processed, JSQR is reset */ + /* by the hardware. Even if no injected conversion is planned to come */ + /* (queue empty, triggers are ignored), it can start again */ + /* immediately after setting a new context (JADSTART is still set). */ + /* Therefore, state of HAL ADC injected group is kept to busy. */ + if(READ_BIT(tmp_cfgr_jqm, ADC_CFGR_JQM) == RESET) + { + /* Allowed to modify bits ADC_IT_JEOC/ADC_IT_JEOS only if bit */ + /* JADSTART==0 (no conversion on going) */ + if (ADC_IS_CONVERSION_ONGOING_INJECTED(hadc) == RESET) + { + /* Disable ADC end of sequence conversion interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_JEOC | ADC_IT_JEOS); + + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_INJ_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + } + } + } + } + } + + /* Conversion complete callback */ + /* Note: into callback, to determine if conversion has been triggered */ + /* from JEOC or JEOS, possibility to use: */ + /* " if( __HAL_ADC_GET_FLAG(&hadc, ADC_FLAG_JEOS)) " */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->InjectedConvCpltCallback(hadc); +#else + HAL_ADCEx_InjectedConvCpltCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + + /* Clear injected group conversion flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_JEOC | ADC_FLAG_JEOS); + } + + /* ========== Check analog watchdog 1 flag ========== */ + if(((tmp_isr & ADC_FLAG_AWD1) == ADC_FLAG_AWD1) && ((tmp_ier & ADC_IT_AWD1) == ADC_IT_AWD1)) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_AWD1); + + /* Level out of window 1 callback */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->LevelOutOfWindowCallback(hadc); +#else + HAL_ADC_LevelOutOfWindowCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + /* Clear ADC analog watchdog flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD1); + } + + /* ========== Check analog watchdog 2 flag ========== */ + if(((tmp_isr & ADC_FLAG_AWD2) == ADC_FLAG_AWD2) && ((tmp_ier & ADC_IT_AWD2) == ADC_IT_AWD2)) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_AWD2); + + /* Level out of window 2 callback */ + HAL_ADCEx_LevelOutOfWindow2Callback(hadc); + /* Clear ADC analog watchdog flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD2); + } + + /* ========== Check analog watchdog 3 flag ========== */ + if(((tmp_isr & ADC_FLAG_AWD3) == ADC_FLAG_AWD3) && ((tmp_ier & ADC_IT_AWD3) == ADC_IT_AWD3)) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_AWD3); + + /* Level out of window 3 callback */ + HAL_ADCEx_LevelOutOfWindow3Callback(hadc); + /* Clear ADC analog watchdog flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD3); + } + + /* ========== Check Overrun flag ========== */ + if(((tmp_isr & ADC_FLAG_OVR) == ADC_FLAG_OVR) && ((tmp_ier & ADC_IT_OVR) == ADC_IT_OVR)) + { + /* If overrun is set to overwrite previous data (default setting), */ + /* overrun event is not considered as an error. */ + /* (cf ref manual "Managing conversions without using the DMA and */ + /* without overrun ") */ + /* Exception for usage with DMA overrun event always considered as an */ + /* error. */ + if (hadc->Init.Overrun == ADC_OVR_DATA_PRESERVED) + { + overrun_error = 1U; + } + else + { + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + /* Check DMA configuration, depending on MultiMode set or not */ + if (READ_BIT(tmpADC_Common->CCR, ADC_CCR_MULTI) == ADC_MODE_INDEPENDENT) + { + if (HAL_IS_BIT_SET(hadc->Instance->CFGR, ADC_CFGR_DMAEN)) + { + overrun_error = 1U; + } + } + else + { + /* MultiMode is enabled, Common Control Register MDMA bits must be checked */ + if (READ_BIT(tmpADC_Common->CCR, ADC_CCR_MDMA) != RESET) + { + overrun_error = 1U; + } + } + } + + if (overrun_error == 1U) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_REG_OVR); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_OVR); + + /* Error callback */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->ErrorCallback(hadc); +#else + HAL_ADC_ErrorCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + } + + /* Clear the Overrun flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_OVR); + + } + + + /* ========== Check Injected context queue overflow flag ========== */ + if(((tmp_isr & ADC_FLAG_JQOVF) == ADC_FLAG_JQOVF) && ((tmp_ier & ADC_IT_JQOVF) == ADC_IT_JQOVF)) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_INJ_JQOVF); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_JQOVF); + + /* Clear the Injected context queue overflow flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_JQOVF); + + /* Error callback */ + HAL_ADCEx_InjectedQueueOverflowCallback(hadc); + } + +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Handles ADC interrupt request + * @param hadc ADC handle + * @retval None + */ +void HAL_ADC_IRQHandler(ADC_HandleTypeDef* hadc) +{ + uint32_t tmp_sr = hadc->Instance->SR; + uint32_t tmp_cr1 = hadc->Instance->CR1; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); + assert_param(IS_ADC_REGULAR_NB_CONV(hadc->Init.NbrOfConversion)); + + + /* ========== Check End of Conversion flag for regular group ========== */ + if((tmp_cr1 & ADC_IT_EOC) == ADC_IT_EOC) + { + if((tmp_sr & ADC_FLAG_EOC) == ADC_FLAG_EOC) + { + /* Update state machine on conversion status if not in error state */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL)) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_REG_EOC); + } + + /* Determine whether any further conversion upcoming on group regular */ + /* by external trigger, continuous mode or scan sequence on going. */ + /* Note: On STM32F37x devices, in case of sequencer enabled */ + /* (several ranks selected), end of conversion flag is raised */ + /* at the end of the sequence. */ + if(ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (hadc->Init.ContinuousConvMode == DISABLE) ) + { + /* Disable ADC end of single conversion interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_EOC); + + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + + /* Conversion complete callback */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->ConvCpltCallback(hadc); +#else + HAL_ADC_ConvCpltCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + + /* Clear regular group conversion flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_STRT | ADC_FLAG_EOC); + } + } + + /* ========== Check End of Conversion flag for injected group ========== */ + if((tmp_cr1 & ADC_IT_JEOC) == ADC_IT_JEOC) + { + if((tmp_sr & ADC_FLAG_JEOC) == ADC_FLAG_JEOC) + { + /* Update state machine on conversion status if not in error state */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL)) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_INJ_EOC); + } + + /* Determine whether any further conversion upcoming on group injected */ + /* by external trigger, scan sequence on going or by automatic injected */ + /* conversion from group regular (same conditions as group regular */ + /* interruption disabling above). */ + /* Note: On STM32F37x devices, in case of sequencer enabled */ + /* (several ranks selected), end of conversion flag is raised */ + /* at the end of the sequence. */ + if(ADC_IS_SOFTWARE_START_INJECTED(hadc) || + (HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_JAUTO) && + (ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (hadc->Init.ContinuousConvMode == DISABLE) ) ) ) + { + /* Disable ADC end of single conversion interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_JEOC); + + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_INJ_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + + /* Conversion complete callback */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->InjectedConvCpltCallback(hadc); +#else + HAL_ADCEx_InjectedConvCpltCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + + /* Clear injected group conversion flag */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_JSTRT | ADC_FLAG_JEOC)); + } + } + + /* ========== Check Analog watchdog flags ========== */ + if((tmp_cr1 & ADC_IT_AWD) == ADC_IT_AWD) + { + if((tmp_sr & ADC_FLAG_AWD) == ADC_FLAG_AWD) + { + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_AWD1); + + /* Level out of window callback */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->LevelOutOfWindowCallback(hadc); +#else + HAL_ADC_LevelOutOfWindowCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + + /* Clear the ADC analog watchdog flag */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_AWD); + } + } + +} +#endif /* STM32F373xC || STM32F378xx */ + + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Perform an ADC automatic self-calibration + * Calibration prerequisite: ADC must be disabled (execute this + * function before HAL_ADC_Start() or after HAL_ADC_Stop() ). + * @param hadc ADC handle + * @param SingleDiff Selection of single-ended or differential input + * This parameter can be one of the following values: + * @arg ADC_SINGLE_ENDED: Channel in mode input single ended + * @arg ADC_DIFFERENTIAL_ENDED: Channel in mode input differential ended + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc, uint32_t SingleDiff) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + uint32_t tickstart; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_SINGLE_DIFFERENTIAL(SingleDiff)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Calibration prerequisite: ADC must be disabled. */ + + /* Disable the ADC (if not already disabled) */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Change ADC state */ + hadc->State = HAL_ADC_STATE_READY; + + /* Select calibration mode single ended or differential ended */ + hadc->Instance->CR &= (~ADC_CR_ADCALDIF); + if (SingleDiff == ADC_DIFFERENTIAL_ENDED) + { + hadc->Instance->CR |= ADC_CR_ADCALDIF; + } + + /* Start ADC calibration */ + hadc->Instance->CR |= ADC_CR_ADCAL; + + tickstart = HAL_GetTick(); + + /* Wait for calibration completion */ + while(HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_ADCAL)) + { + if((HAL_GetTick() - tickstart) > ADC_CALIBRATION_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_ADCAL)) + { + /* Update ADC state machine to error */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_ERROR_INTERNAL); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + } + + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_READY); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Perform an ADC automatic self-calibration + * Calibration prerequisite: ADC must be disabled (execute this + * function before HAL_ADC_Start() or after HAL_ADC_Stop() ). + * During calibration process, ADC is enabled. ADC is let enabled at + * the completion of this function. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + uint32_t tickstart; + __IO uint32_t wait_loop_index = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* 1. Calibration prerequisite: */ + /* - ADC must be disabled for at least two ADC clock cycles in disable */ + /* mode before ADC enable */ + /* Stop potential conversion on going, on regular and injected groups */ + /* Disable ADC peripheral */ + tmp_hal_status = ADC_ConversionStop_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_BUSY_INTERNAL); + + /* Wait two ADC clock cycles */ + while(wait_loop_index < ADC_CYCLE_WORST_CASE_CPU_CYCLES *2U) + { + wait_loop_index++; + } + + /* 2. Enable the ADC peripheral */ + ADC_Enable(hadc); + + + /* 3. Resets ADC calibration registers */ + SET_BIT(hadc->Instance->CR2, ADC_CR2_RSTCAL); + + tickstart = HAL_GetTick(); + + /* Wait for calibration reset completion */ + while(HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_RSTCAL)) + { + if((HAL_GetTick() - tickstart) > ADC_CALIBRATION_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_RSTCAL)) + { + /* Update ADC state machine to error */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_ERROR_INTERNAL); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + } + + + /* 4. Start ADC calibration */ + SET_BIT(hadc->Instance->CR2, ADC_CR2_CAL); + + tickstart = HAL_GetTick(); + + /* Wait for calibration completion */ + while(HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_CAL)) + { + if((HAL_GetTick() - tickstart) > ADC_CALIBRATION_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(HAL_IS_BIT_SET(hadc->Instance->CR2, ADC_CR2_CAL)) + { + /* Update ADC state machine to error */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_ERROR_INTERNAL); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + } + + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_BUSY_INTERNAL, + HAL_ADC_STATE_READY); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} + +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Get the calibration factor from automatic conversion result + * @param hadc ADC handle + * @param SingleDiff Selection of single-ended or differential input + * This parameter can be one of the following values: + * @arg ADC_SINGLE_ENDED: Channel in mode input single ended + * @arg ADC_DIFFERENTIAL_ENDED: Channel in mode input differential ended + * @retval Converted value + */ +uint32_t HAL_ADCEx_Calibration_GetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_SINGLE_DIFFERENTIAL(SingleDiff)); + + /* Return the selected ADC calibration value */ + if (SingleDiff == ADC_DIFFERENTIAL_ENDED) + { + return ADC_CALFACT_DIFF_GET(hadc->Instance->CALFACT); + } + else + { + return ((hadc->Instance->CALFACT) & ADC_CALFACT_CALFACT_S); + } +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Set the calibration factor to overwrite automatic conversion result. ADC must be enabled and no conversion on going. + * @param hadc ADC handle + * @param SingleDiff Selection of single-ended or differential input + * This parameter can be one of the following values: + * @arg ADC_SINGLE_ENDED: Channel in mode input single ended + * @arg ADC_DIFFERENTIAL_ENDED: Channel in mode input differential ended + * @param CalibrationFactor Calibration factor (coded on 7 bits maximum) + * @retval HAL state + */ +HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff, uint32_t CalibrationFactor) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_SINGLE_DIFFERENTIAL(SingleDiff)); + assert_param(IS_ADC_CALFACT(CalibrationFactor)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Verification of hardware constraints before modifying the calibration */ + /* factors register: ADC must be enabled, no conversion on going. */ + if ( (ADC_IS_ENABLE(hadc) != RESET) && + (ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED(hadc) == RESET) ) + { + /* Set the selected ADC calibration value */ + if (SingleDiff == ADC_DIFFERENTIAL_ENDED) + { + MODIFY_REG(hadc->Instance->CALFACT , + ADC_CALFACT_CALFACT_D , + ADC_CALFACT_DIFF_SET(CalibrationFactor) ); + } + else + { + MODIFY_REG(hadc->Instance->CALFACT, + ADC_CALFACT_CALFACT_S , + CalibrationFactor ); + } + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Enables ADC, starts conversion of injected group. + * Interruptions enabled in this function: None. + * @note Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC slave first, then ADC master. + * For ADC slave, ADC is enabled only (conversion is not started). + * For ADC master, ADC is enabled and multimode conversion is started. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Perform ADC enable and conversion start if no conversion is on going */ + if (ADC_IS_CONVERSION_ONGOING_INJECTED(hadc) == RESET) + { + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to injected group conversion results */ + /* - Set state bitfield related to injected operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_INJ_EOC, + HAL_ADC_STATE_INJ_BUSY); + + /* Case of independent mode or multimode(for devices with several ADCs):*/ + /* Set multimode state. */ + if (ADC_NONMULTIMODE_OR_MULTIMODEMASTER(hadc)) + { + CLEAR_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + } + else + { + SET_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + } + + /* Check if a regular conversion is ongoing */ + /* Note: On this device, there is no ADC error code fields related to */ + /* conversions on group injected only. In case of conversion on */ + /* going on group regular, no error code is reset. */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY)) + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Clear injected group conversion flag */ + /* (To ensure of no unknown state from potential previous ADC */ + /* operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_JEOC | ADC_FLAG_JEOS)); + + /* Enable conversion of injected group, if automatic injected */ + /* conversion is disabled. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* Case of multimode enabled (for devices with several ADCs): */ + /* - if ADC is slave, ADC is enabled only (conversion is not started). */ + /* - if ADC is master, ADC is enabled and conversion is started. */ + if (HAL_IS_BIT_CLR(hadc->Instance->CFGR, ADC_CFGR_JAUTO) && + ADC_NONMULTIMODE_INJ_OR_MULTIMODEMASTER(hadc) ) + { + SET_BIT(hadc->Instance->CR, ADC_CR_JADSTART); + } + } + else + { + /* Process unlocked */ + __HAL_UNLOCK(hadc); + } + } + else + { + tmp_hal_status = HAL_BUSY; + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Enables ADC, starts conversion of injected group. + * Interruptions enabled in this function: None. + * @param hadc ADC handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStart(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to injected group conversion results */ + /* - Set state bitfield related to injected operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_INJ_EOC, + HAL_ADC_STATE_INJ_BUSY); + + /* Check if a regular conversion is ongoing */ + /* Note: On this device, there is no ADC error code fields related to */ + /* conversions on group injected only. In case of conversion on */ + /* going on group regular, no error code is reset. */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY)) + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Clear injected group conversion flag */ + /* (To ensure of no unknown state from potential previous ADC operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_JEOC); + + /* Enable conversion of injected group. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* If automatic injected conversion is enabled, conversion will start */ + /* after next regular group conversion. */ + if (ADC_IS_SOFTWARE_START_INJECTED(hadc) && + HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_JAUTO) ) + { + /* Start ADC conversion on injected group with SW start */ + SET_BIT(hadc->Instance->CR2, (ADC_CR2_JSWSTART | ADC_CR2_JEXTTRIG)); + } + else + { + /* Start ADC conversion on injected group with external trigger */ + SET_BIT(hadc->Instance->CR2, ADC_CR2_JEXTTRIG); + } + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Stop ADC group injected conversion (potential conversion on going + * on ADC group regular is not impacted), disable ADC peripheral + * if no conversion is on going on group regular. + * @note To stop ADC conversion of both groups regular and injected and to + * to disable ADC peripheral, instead of using 2 functions + * @ref HAL_ADCEx_RegularStop() and @ref HAL_ADCEx_InjectedStop(), + * use function @ref HAL_ADC_Stop(). + * @note If injected group mode auto-injection is enabled, + * function HAL_ADC_Stop must be used. + * @note Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC master first, then ADC slave. + * For ADC master, conversion is stopped and ADC is disabled. + * For ADC slave, ADC is disabled only (conversion stop of ADC master + * has already stopped conversion of ADC slave). + * @note In case of auto-injection mode, HAL_ADC_Stop must be used. + * @param hadc ADC handle + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential ADC conversion on going and disable ADC peripheral */ + /* conditioned to: */ + /* - In case of auto-injection mode, HAL_ADC_Stop must be used. */ + /* - For ADC injected group conversion stop: */ + /* On this STM32 family, conversion on the other group */ + /* (group regular) can continue (groups regular and injected */ + /* conversion stop commands are independent) */ + /* - For ADC disable: */ + /* No conversion on the other group (group regular) must be intended to */ + /* continue (groups regular and injected are both impacted by */ + /* ADC disable) */ + if(HAL_IS_BIT_CLR(hadc->Instance->CFGR, ADC_CFGR_JAUTO)) + { + /* 1. Stop potential conversion on going on injected group only. */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_INJECTED_GROUP); + + /* Disable ADC peripheral if conversion on ADC group injected is */ + /* effectively stopped and if no conversion on the other group */ + /* (ADC group regular) is intended to continue. */ + if (tmp_hal_status == HAL_OK) + { + if((ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) && + ((hadc->State & HAL_ADC_STATE_REG_BUSY) == RESET) ) + { + /* 2. Disable the ADC peripheral */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + /* Conversion on ADC group injected group is stopped, but ADC is not */ + /* disabled since conversion on ADC group regular is still on going. */ + else + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_INJ_BUSY); + } + } + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Stop conversion of injected channels. Disable ADC peripheral if + * no regular conversion is on going. + * @note If ADC must be disabled and if conversion is on going on + * regular group, function HAL_ADC_Stop must be used to stop both + * injected and regular groups, and disable the ADC. + * @note In case of auto-injection mode, HAL_ADC_Stop must be used. + * @param hadc ADC handle + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStop(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential conversion and disable ADC peripheral */ + /* Conditioned to: */ + /* - No conversion on the other group (regular group) is intended to */ + /* continue (injected and regular groups stop conversion and ADC disable */ + /* are common) */ + /* - In case of auto-injection mode, HAL_ADC_Stop must be used. */ + if(((hadc->State & HAL_ADC_STATE_REG_BUSY) == RESET) && + HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_JAUTO) ) + { + /* Stop potential conversion on going, on regular and injected groups */ + /* Disable ADC peripheral */ + tmp_hal_status = ADC_ConversionStop_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Wait for injected group conversion to be completed. + * @param hadc ADC handle + * @param Timeout Timeout value in millisecond. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout) +{ + uint32_t tickstart; + uint32_t tmp_Flag_EOC; + uint32_t tmp_cfgr = 0x00000000U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* If end of conversion selected to end of sequence */ + if (hadc->Init.EOCSelection == ADC_EOC_SEQ_CONV) + { + tmp_Flag_EOC = ADC_FLAG_JEOS; + } + /* If end of conversion selected to end of each conversion */ + else /* ADC_EOC_SINGLE_CONV */ + { + tmp_Flag_EOC = (ADC_FLAG_JEOC | ADC_FLAG_JEOS); + } + + /* Get relevant register CFGR in ADC instance of ADC master or slave */ + /* in function of multimode state (for devices with multimode */ + /* available). */ + if (ADC_NONMULTIMODE_OR_MULTIMODEMASTER(hadc)) + { + tmp_cfgr = READ_REG(hadc->Instance->CFGR); + } + else + { + tmp_cfgr = READ_REG(ADC_MASTER_INSTANCE(hadc)->CFGR); + } + + /* Get tick count */ + tickstart = HAL_GetTick(); + + /* Wait until End of Conversion flag is raised */ + while(HAL_IS_BIT_CLR(hadc->Instance->ISR, tmp_Flag_EOC)) + { + /* Check if timeout is disabled (set to infinite wait) */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout)) + { + /* New check to avoid false timeout detection in case of preemption */ + if(HAL_IS_BIT_CLR(hadc->Instance->ISR, tmp_Flag_EOC)) + { + /* Update ADC state machine to timeout */ + SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_TIMEOUT; + } + } + } + } + + /* Update ADC state machine */ + SET_BIT(hadc->State, HAL_ADC_STATE_INJ_EOC); + + /* Determine whether any further conversion upcoming on group injected */ + /* by external trigger or by automatic injected conversion */ + /* from group regular. */ + if(ADC_IS_SOFTWARE_START_INJECTED(hadc) || + ((READ_BIT (tmp_cfgr, ADC_CFGR_JAUTO) == RESET) && + (ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (READ_BIT (tmp_cfgr, ADC_CFGR_CONT) == RESET) ) ) ) + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_INJ_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + + /* Clear end of conversion flag of injected group if low power feature */ + /* "Auto Wait" is disabled, to not interfere with this feature until data */ + /* register is read using function HAL_ADC_GetValue(). */ + if (READ_BIT (tmp_cfgr, ADC_CFGR_AUTDLY) == RESET) + { + /* Clear injected group conversion flag */ + /* (JEOC or JEOS depending on HAL ADC initialization parameter) */ + __HAL_ADC_CLEAR_FLAG(hadc, tmp_Flag_EOC); + } + + /* Return ADC state */ + return HAL_OK; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Wait for injected group conversion to be completed. + * @param hadc ADC handle + * @param Timeout Timeout value in millisecond. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedPollForConversion(ADC_HandleTypeDef* hadc, uint32_t Timeout) +{ + uint32_t tickstart = 0U; + + /* Variables for polling in case of scan mode enabled */ + uint32_t Conversion_Timeout_CPU_cycles_max =0U; + uint32_t Conversion_Timeout_CPU_cycles =0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Get tick count */ + tickstart = HAL_GetTick(); + + /* Polling for end of conversion: differentiation if single/sequence */ + /* conversion. */ + /* For injected group, flag JEOC is set only at the end of the sequence, */ + /* not for each conversion within the sequence. */ + /* - If single conversion for injected group (scan mode disabled or */ + /* InjectedNbrOfConversion ==1U), flag JEOC is used to determine the */ + /* conversion completion. */ + /* - If sequence conversion for injected group (scan mode enabled and */ + /* InjectedNbrOfConversion >=2U), flag JEOC is set only at the end of the */ + /* sequence. */ + /* To poll for each conversion, the maximum conversion time is computed */ + /* from ADC conversion time (selected sampling time + conversion time of */ + /* 12.5 ADC clock cycles) and APB2/ADC clock prescalers (depending on */ + /* settings, conversion time range can be from 28 to 32256 CPU cycles). */ + /* As flag JEOC is not set after each conversion, no timeout status can */ + /* be set. */ + if ((hadc->Instance->JSQR & ADC_JSQR_JL) == RESET) + { + /* Wait until End of Conversion flag is raised */ + while(HAL_IS_BIT_CLR(hadc->Instance->SR, ADC_FLAG_JEOC)) + { + /* Check if timeout is disabled (set to infinite wait) */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout)) + { + /* New check to avoid false timeout detection in case of preemption */ + if(HAL_IS_BIT_CLR(hadc->Instance->SR, ADC_FLAG_JEOC)) + { + /* Update ADC state machine to timeout */ + SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_TIMEOUT; + } + } + } + } + } + else + { + /* Replace polling by wait for maximum conversion time */ + /* Calculation of CPU cycles corresponding to ADC conversion cycles. */ + /* Retrieve ADC clock prescaler and ADC maximum conversion cycles on all */ + /* channels. */ + Conversion_Timeout_CPU_cycles_max = ADC_CLOCK_PRESCALER_RANGE(); + Conversion_Timeout_CPU_cycles_max *= ADC_CONVCYCLES_MAX_RANGE(hadc); + + /* Poll with maximum conversion time */ + while(Conversion_Timeout_CPU_cycles < Conversion_Timeout_CPU_cycles_max) + { + /* Check if timeout is disabled (set to infinite wait) */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout)) + { + /* New check to avoid false timeout detection in case of preemption */ + if(Conversion_Timeout_CPU_cycles < Conversion_Timeout_CPU_cycles_max) + { + /* Update ADC state machine to timeout */ + SET_BIT(hadc->State, HAL_ADC_STATE_TIMEOUT); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_TIMEOUT; + } + } + } + Conversion_Timeout_CPU_cycles ++; + } + } + + + /* Clear injected group conversion flag (and regular conversion flag raised simultaneously) */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_JSTRT | ADC_FLAG_JEOC | ADC_FLAG_EOC); + + /* Update ADC state machine */ + SET_BIT(hadc->State, HAL_ADC_STATE_INJ_EOC); + + /* Determine whether any further conversion upcoming on group injected */ + /* by external trigger or by automatic injected conversion */ + /* from group regular. */ + if(ADC_IS_SOFTWARE_START_INJECTED(hadc) || + (HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_JAUTO) && + (ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (hadc->Init.ContinuousConvMode == DISABLE) ) ) ) + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_INJ_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + + /* Return ADC state */ + return HAL_OK; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Enables ADC, starts conversion of injected group with interruption. + * Interruptions enabled in this function: + * - JEOC (end of conversion of injected group) or JEOS (end of + * sequence of injected group) depending on ADC initialization + * parameter "EOCSelection" + * Each of these interruptions has its dedicated callback function. + * @note Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC slave first, then ADC master. + * For ADC slave, ADC is enabled only (conversion is not started). + * For ADC master, ADC is enabled and multimode conversion is started. + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Perform ADC enable and conversion start if no conversion is on going */ + if (ADC_IS_CONVERSION_ONGOING_INJECTED(hadc) == RESET) + { + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to injected group conversion results */ + /* - Set state bitfield related to injected operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_INJ_EOC, + HAL_ADC_STATE_INJ_BUSY); + + /* Case of independent mode or multimode(for devices with several ADCs):*/ + /* Set multimode state. */ + if (ADC_NONMULTIMODE_OR_MULTIMODEMASTER(hadc)) + { + CLEAR_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + } + else + { + SET_BIT(hadc->State, HAL_ADC_STATE_MULTIMODE_SLAVE); + } + + /* Check if a regular conversion is ongoing */ + /* Note: On this device, there is no ADC error code fields related to */ + /* conversions on group injected only. In case of conversion on */ + /* going on group regular, no error code is reset. */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY)) + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Clear injected group conversion flag */ + /* (To ensure of no unknown state from potential previous ADC */ + /* operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_JEOC | ADC_FLAG_JEOS)); + + /* Enable ADC Injected context queue overflow interrupt if this feature */ + /* is enabled. */ + if ((hadc->Instance->CFGR & ADC_CFGR_JQM) != RESET) + { + __HAL_ADC_ENABLE_IT(hadc, ADC_FLAG_JQOVF); + } + + /* Enable ADC end of conversion interrupt */ + switch(hadc->Init.EOCSelection) + { + case ADC_EOC_SEQ_CONV: + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_JEOC); + __HAL_ADC_ENABLE_IT(hadc, ADC_IT_JEOS); + break; + /* case ADC_EOC_SINGLE_CONV */ + default: + __HAL_ADC_ENABLE_IT(hadc, ADC_IT_JEOC | ADC_IT_JEOS); + break; + } + + /* Enable conversion of injected group, if automatic injected */ + /* conversion is disabled. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* Case of multimode enabled (for devices with several ADCs): */ + /* - if ADC is slave, ADC is enabled only (conversion is not started). */ + /* - if ADC is master, ADC is enabled and conversion is started. */ + if (HAL_IS_BIT_CLR(hadc->Instance->CFGR, ADC_CFGR_JAUTO) && + ADC_NONMULTIMODE_INJ_OR_MULTIMODEMASTER(hadc) ) + { + SET_BIT(hadc->Instance->CR, ADC_CR_JADSTART); + } + } + else + { + /* Process unlocked */ + __HAL_UNLOCK(hadc); + } + } + else + { + tmp_hal_status = HAL_BUSY; + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Enables ADC, starts conversion of injected group with interruption. + * Interruptions enabled in this function: + * - JEOC (end of conversion of injected group) + * Each of these interruptions has its dedicated callback function. + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStart_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Enable the ADC peripheral */ + tmp_hal_status = ADC_Enable(hadc); + + /* Start conversion if ADC is effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + /* - Clear state bitfield related to injected group conversion results */ + /* - Set state bitfield related to injected operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_INJ_EOC, + HAL_ADC_STATE_INJ_BUSY); + + /* Check if a regular conversion is ongoing */ + /* Note: On this device, there is no ADC error code fields related to */ + /* conversions on group injected only. In case of conversion on */ + /* going on group regular, no error code is reset. */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_REG_BUSY)) + { + /* Reset ADC all error code fields */ + ADC_CLEAR_ERRORCODE(hadc); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Set ADC error code to none */ + ADC_CLEAR_ERRORCODE(hadc); + + /* Clear injected group conversion flag */ + /* (To ensure of no unknown state from potential previous ADC operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_JEOC); + + /* Enable end of conversion interrupt for injected channels */ + __HAL_ADC_ENABLE_IT(hadc, ADC_IT_JEOC); + + /* Enable conversion of injected group. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + /* If automatic injected conversion is enabled, conversion will start */ + /* after next regular group conversion. */ + if (ADC_IS_SOFTWARE_START_INJECTED(hadc) && + HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_JAUTO) ) + { + /* Start ADC conversion on injected group with SW start */ + SET_BIT(hadc->Instance->CR2, (ADC_CR2_JSWSTART | ADC_CR2_JEXTTRIG)); + } + else + { + /* Start ADC conversion on injected group with external trigger */ + SET_BIT(hadc->Instance->CR2, ADC_CR2_JEXTTRIG); + } + } + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Stop ADC group injected conversion (potential conversion on going + * on ADC group regular is not impacted), disable ADC peripheral + * if no conversion is on going on group regular. + * Interruptions disabled in this function: + * - JEOC (end of conversion of injected group) and JEOS (end of + * sequence of injected group) + * @note To stop ADC conversion of both groups regular and injected and to + * to disable ADC peripheral, instead of using 2 functions + * @ref HAL_ADCEx_RegularStop() and @ref HAL_ADCEx_InjectedStop(), + * use function @ref HAL_ADC_Stop(). + * @note If injected group mode auto-injection is enabled, + * function HAL_ADC_Stop must be used. + * @note Case of multimode enabled (for devices with several ADCs): This + * function must be called for ADC master first, then ADC slave. + * For ADC master, conversion is stopped and ADC is disabled. + * For ADC slave, ADC is disabled only (conversion stop of ADC master + * has already stopped conversion of ADC slave). + * @note In case of auto-injection mode, HAL_ADC_Stop must be used. + * @param hadc ADC handle + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential ADC conversion on going and disable ADC peripheral */ + /* conditioned to: */ + /* - In case of auto-injection mode, HAL_ADC_Stop must be used. */ + /* - For ADC injected group conversion stop: */ + /* On this STM32 family, conversion on the other group */ + /* (group regular) can continue (groups regular and injected */ + /* conversion stop commands are independent) */ + /* - For ADC disable: */ + /* No conversion on the other group (group regular) must be intended to */ + /* continue (groups regular and injected are both impacted by */ + /* ADC disable) */ + if(HAL_IS_BIT_CLR(hadc->Instance->CFGR, ADC_CFGR_JAUTO)) + { + /* 1. Stop potential conversion on going on injected group only. */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_INJECTED_GROUP); + + /* Disable ADC peripheral if conversion on ADC group injected is */ + /* effectively stopped and if no conversion on the other group */ + /* (ADC group regular) is intended to continue. */ + if (tmp_hal_status == HAL_OK) + { + /* Disable ADC end of conversion interrupt for injected channels */ + __HAL_ADC_DISABLE_IT(hadc, (ADC_IT_JEOC | ADC_IT_JEOS | ADC_IT_JQOVF)); + + if((ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) && + ((hadc->State & HAL_ADC_STATE_REG_BUSY) == RESET) ) + { + /* 2. Disable the ADC peripheral */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + /* Conversion on ADC group injected group is stopped, but ADC is not */ + /* disabled since conversion on ADC group regular is still on going. */ + else + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_INJ_BUSY); + } + } + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Stop conversion of injected channels, disable interruption of + * end-of-conversion. Disable ADC peripheral if no regular conversion + * is on going. + * @note If ADC must be disabled and if conversion is on going on + * regular group, function HAL_ADC_Stop must be used to stop both + * injected and regular groups, and disable the ADC. + * @param hadc ADC handle + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedStop_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential conversion and disable ADC peripheral */ + /* Conditioned to: */ + /* - No conversion on the other group (regular group) is intended to */ + /* continue (injected and regular groups stop conversion and ADC disable */ + /* are common) */ + /* - In case of auto-injection mode, HAL_ADC_Stop must be used. */ + if(((hadc->State & HAL_ADC_STATE_REG_BUSY) == RESET) && + HAL_IS_BIT_CLR(hadc->Instance->CR1, ADC_CR1_JAUTO) ) + { + /* Stop potential conversion on going, on regular and injected groups */ + /* Disable ADC peripheral */ + tmp_hal_status = ADC_ConversionStop_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Disable ADC end of conversion interrupt for injected channels */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_JEOC); + + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +/** + * @brief With ADC configured in multimode, for ADC master: + * Enables ADC, starts conversion of regular group and transfers result + * through DMA. + * Multimode must have been previously configured using + * HAL_ADCEx_MultiModeConfigChannel() function. + * Interruptions enabled in this function: + * - DMA transfer complete + * - DMA half transfer + * - overrun + * Each of these interruptions has its dedicated callback function. + * @note ADC slave must be preliminarily enabled using single-mode + * HAL_ADC_Start() function. + * @param hadc ADC handle of ADC master (handle of ADC slave must not be used) + * @param pData The destination Buffer address. + * @param Length The length of data to be transferred from ADC peripheral to memory. + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_MultiModeStart_DMA(ADC_HandleTypeDef* hadc, uint32_t* pData, uint32_t Length) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + ADC_HandleTypeDef tmphadcSlave = {0}; + ADC_Common_TypeDef *tmpADC_Common; + + /* Check the parameters */ + assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.ContinuousConvMode)); + assert_param(IS_ADC_EXTTRIG_EDGE(hadc->Init.ExternalTrigConvEdge)); + assert_param(IS_FUNCTIONAL_STATE(hadc->Init.DMAContinuousRequests)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Perform ADC enable and conversion start if no conversion is on going */ + /* (check on ADC master only) */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) + { + /* Set a temporary handle of the ADC slave associated to the ADC master */ + /* (Depending on STM32F3 product, there may be up to 2 ADC slaves) */ + ADC_MULTI_SLAVE(hadc, &tmphadcSlave); + + if (tmphadcSlave.Instance == NULL) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + + + /* Enable the ADC peripherals: master and slave (in case if not already */ + /* enabled previously) */ + tmp_hal_status = ADC_Enable(hadc); + if (tmp_hal_status == HAL_OK) + { + tmp_hal_status = ADC_Enable(&tmphadcSlave); + } + + /* Start conversion all ADCs of multimode are effectively enabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state (ADC master) */ + /* - Clear state bitfield related to regular group conversion results */ + /* - Set state bitfield related to regular operation */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_READY | HAL_ADC_STATE_REG_EOC | HAL_ADC_STATE_REG_OVR | HAL_ADC_STATE_REG_EOSMP | HAL_ADC_STATE_MULTIMODE_SLAVE, + HAL_ADC_STATE_REG_BUSY); + + /* If conversions on group regular are also triggering group injected, */ + /* update ADC state. */ + if (READ_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO) != RESET) + { + ADC_STATE_CLR_SET(hadc->State, HAL_ADC_STATE_INJ_EOC, HAL_ADC_STATE_INJ_BUSY); + } + + /* Process unlocked */ + /* Unlock before starting ADC conversions: in case of potential */ + /* interruption, to let the process to ADC IRQ Handler. */ + __HAL_UNLOCK(hadc); + + /* Set ADC error code to none */ + ADC_CLEAR_ERRORCODE(hadc); + + + /* Set the DMA transfer complete callback */ + hadc->DMA_Handle->XferCpltCallback = ADC_DMAConvCplt; + + /* Set the DMA half transfer complete callback */ + hadc->DMA_Handle->XferHalfCpltCallback = ADC_DMAHalfConvCplt; + + /* Set the DMA error callback */ + hadc->DMA_Handle->XferErrorCallback = ADC_DMAError ; + + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + + /* Manage ADC and DMA start: ADC overrun interruption, DMA start, ADC */ + /* start (in case of SW start): */ + + /* Clear regular group conversion flag and overrun flag */ + /* (To ensure of no unknown state from potential previous ADC operations) */ + __HAL_ADC_CLEAR_FLAG(hadc, (ADC_FLAG_EOC | ADC_FLAG_EOS | ADC_FLAG_OVR)); + + /* Enable ADC overrun interrupt */ + __HAL_ADC_ENABLE_IT(hadc, ADC_IT_OVR); + + /* Start the DMA channel */ + HAL_DMA_Start_IT(hadc->DMA_Handle, (uint32_t)&tmpADC_Common->CDR, (uint32_t)pData, Length); + + /* Enable conversion of regular group. */ + /* If software start has been selected, conversion starts immediately. */ + /* If external trigger has been selected, conversion will start at next */ + /* trigger event. */ + SET_BIT(hadc->Instance->CR, ADC_CR_ADSTART); + + } + else + { + /* Process unlocked */ + __HAL_UNLOCK(hadc); + } + } + else + { + tmp_hal_status = HAL_BUSY; + } + + /* Return function status */ + return tmp_hal_status; +} + +/** + * @brief With ADC configured in multimode, for ADC master: + * Stop ADC group regular conversion (potential conversion on going + * on ADC group injected is not impacted), + * disable ADC DMA transfer, disable ADC peripheral + * if no conversion is on going on group injected. + * Interruptions disabled in this function: + * - DMA transfer complete + * - DMA half transfer + * - overrun + * @note In case of auto-injection mode, this function also stop conversion + * on ADC group injected. + * @note Multimode is kept enabled after this function. To disable multimode + * (set with HAL_ADCEx_MultiModeConfigChannel() ), ADC must be + * reinitialized using HAL_ADC_Init() or HAL_ADC_ReInit(). + * @note In case of DMA configured in circular mode, function + * HAL_ADC_Stop_DMA must be called after this function with handle of + * ADC slave, to properly disable the DMA channel of ADC slave. + * @param hadc ADC handle of ADC master (handle of ADC slave must not be used) + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_MultiModeStop_DMA(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + uint32_t tickstart; + ADC_HandleTypeDef tmphadcSlave = {0}; + + /* Check the parameters */ + assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* 1. Stop potential multimode conversion on going, on regular and */ + /* injected groups. */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_INJECTED_GROUP); + + /* Disable ADC peripheral if conversions are effectively stopped */ + if (tmp_hal_status == HAL_OK) + { + /* Set a temporary handle of the ADC slave associated to the ADC master */ + /* (Depending on STM32F3 product, there may be up to 2 ADC slaves) */ + ADC_MULTI_SLAVE(hadc, &tmphadcSlave); + + if (tmphadcSlave.Instance == NULL) + { + /* Update ADC state machine (ADC master) to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + + /* Procedure to disable the ADC peripheral: wait for conversions */ + /* effectively stopped (ADC master and ADC slave), then disable ADC */ + + /* 1. Wait until ADSTP=0 for ADC master and ADC slave */ + tickstart = HAL_GetTick(); + + while(ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) || + ADC_IS_CONVERSION_ONGOING_REGULAR(&tmphadcSlave) ) + { + if((HAL_GetTick() - tickstart) > ADC_STOP_CONVERSION_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) || + ADC_IS_CONVERSION_ONGOING_REGULAR(&tmphadcSlave) ) + { + /* Update ADC state machine (ADC master) to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + } + + /* Disable the DMA channel (in case of DMA in circular mode or stop while */ + /* while DMA transfer is on going) */ + /* Note: In case of ADC slave using its own DMA channel (multimode */ + /* parameter "DMAAccessMode" set to disabled): */ + /* DMA channel of ADC slave should stopped after this function with */ + /* function HAL_ADC_Stop_DMA. */ + tmp_hal_status = HAL_DMA_Abort(hadc->DMA_Handle); + + /* Check if DMA channel effectively disabled */ + if (tmp_hal_status != HAL_OK) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); + } + + /* Disable ADC overrun interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_OVR); + + + + /* 2. Disable the ADC peripherals: master and slave */ + /* Update "tmp_hal_status" only if DMA channel disabling passed, */ + /* to retain a potential failing status. */ + if (tmp_hal_status == HAL_OK) + { + /* Check if ADC are effectively disabled */ + if ((ADC_Disable(hadc) != HAL_ERROR) && + (ADC_Disable(&tmphadcSlave) != HAL_ERROR) ) + { + tmp_hal_status = HAL_OK; + + /* Change ADC state (ADC master) */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + else + { + /* In case of error, attempt to disable ADC instances anyway */ + ADC_Disable(hadc); + ADC_Disable(&tmphadcSlave); + + /* Update ADC state machine (ADC master) to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + } + + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} + +/** + * @brief Returns the last ADC Master&Slave regular conversions results data + * in the selected multi mode. + * @note Reading register CDR does not clear flag ADC flag EOC + * (ADC group regular end of unitary conversion), + * as it is the case for independent mode data register. + * @param hadc ADC handle of ADC master (handle of ADC slave must not be used) + * @retval The converted data value. + */ +uint32_t HAL_ADCEx_MultiModeGetValue(ADC_HandleTypeDef* hadc) +{ + ADC_Common_TypeDef *tmpADC_Common; + + /* Check the parameters */ + assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance)); + + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + /* Return the multi mode conversion value */ + return tmpADC_Common->CDR; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Get ADC injected group conversion result. + * @note Reading register JDRx automatically clears ADC flag JEOC + * (ADC group injected end of unitary conversion). + * @note This function does not clear ADC flag JEOS + * (ADC group injected end of sequence conversion) + * Occurrence of flag JEOS rising: + * - If sequencer is composed of 1 rank, flag JEOS is equivalent + * to flag JEOC. + * - If sequencer is composed of several ranks, during the scan + * sequence flag JEOC only is raised, at the end of the scan sequence + * both flags JEOC and EOS are raised. + * Flag JEOS must not be cleared by this function because + * it would not be compliant with low power features + * (feature low power auto-wait, not available on all STM32 families). + * To clear this flag, either use function: + * in programming model IT: @ref HAL_ADC_IRQHandler(), in programming + * model polling: @ref HAL_ADCEx_InjectedPollForConversion() + * or @ref __HAL_ADC_CLEAR_FLAG(&hadc, ADC_FLAG_JEOS). + * @param hadc ADC handle + * @param InjectedRank the converted ADC injected rank. + * This parameter can be one of the following values: + * @arg ADC_INJECTED_RANK_1: Injected Channel1 selected + * @arg ADC_INJECTED_RANK_2: Injected Channel2 selected + * @arg ADC_INJECTED_RANK_3: Injected Channel3 selected + * @arg ADC_INJECTED_RANK_4: Injected Channel4 selected + * @retval ADC group injected conversion data + */ +uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank) +{ + uint32_t tmp_jdr = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_INJECTED_RANK(InjectedRank)); + + /* Note: ADC flag JEOC is not cleared here by software because */ + /* automatically cleared by hardware when reading register JDRx. */ + + /* Get ADC converted value */ + switch(InjectedRank) + { + case ADC_INJECTED_RANK_4: + tmp_jdr = hadc->Instance->JDR4; + break; + case ADC_INJECTED_RANK_3: + tmp_jdr = hadc->Instance->JDR3; + break; + case ADC_INJECTED_RANK_2: + tmp_jdr = hadc->Instance->JDR2; + break; + case ADC_INJECTED_RANK_1: + default: + tmp_jdr = hadc->Instance->JDR1; + break; + } + + /* Return ADC converted value */ + return tmp_jdr; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Get ADC injected group conversion result. + * @note Reading register JDRx automatically clears ADC flag JEOC + * (ADC group injected end of unitary conversion). + * @note This function does not clear ADC flag JEOS + * (ADC group injected end of sequence conversion) + * Occurrence of flag JEOS rising: + * - If sequencer is composed of 1 rank, flag JEOS is equivalent + * to flag JEOC. + * - If sequencer is composed of several ranks, during the scan + * sequence flag JEOC only is raised, at the end of the scan sequence + * both flags JEOC and EOS are raised. + * Flag JEOS must not be cleared by this function because + * it would not be compliant with low power features + * (feature low power auto-wait, not available on all STM32 families). + * To clear this flag, either use function: + * in programming model IT: @ref HAL_ADC_IRQHandler(), in programming + * model polling: @ref HAL_ADCEx_InjectedPollForConversion() + * or @ref __HAL_ADC_CLEAR_FLAG(&hadc, ADC_FLAG_JEOS). + * @param hadc ADC handle + * @param InjectedRank the converted ADC injected rank. + * This parameter can be one of the following values: + * @arg ADC_INJECTED_RANK_1: Injected Channel1 selected + * @arg ADC_INJECTED_RANK_2: Injected Channel2 selected + * @arg ADC_INJECTED_RANK_3: Injected Channel3 selected + * @arg ADC_INJECTED_RANK_4: Injected Channel4 selected + * @retval ADC group injected conversion data + */ +uint32_t HAL_ADCEx_InjectedGetValue(ADC_HandleTypeDef* hadc, uint32_t InjectedRank) +{ + uint32_t tmp_jdr = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_INJECTED_RANK(InjectedRank)); + + /* Get ADC converted value */ + switch(InjectedRank) + { + case ADC_INJECTED_RANK_4: + tmp_jdr = hadc->Instance->JDR4; + break; + case ADC_INJECTED_RANK_3: + tmp_jdr = hadc->Instance->JDR3; + break; + case ADC_INJECTED_RANK_2: + tmp_jdr = hadc->Instance->JDR2; + break; + case ADC_INJECTED_RANK_1: + default: + tmp_jdr = hadc->Instance->JDR1; + break; + } + + /* Return ADC converted value */ + return tmp_jdr; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Stop ADC group regular conversion (potential conversion on going + * on ADC group injected is not impacted), disable ADC peripheral + * if no conversion is on going on group injected. + * @note To stop ADC conversion of both groups regular and injected and to + * to disable ADC peripheral, instead of using 2 functions + * @ref HAL_ADCEx_RegularStop() and @ref HAL_ADCEx_InjectedStop(), + * use function @ref HAL_ADC_Stop(). + * @note In case of auto-injection mode, this function also stop conversion + * on ADC group injected. + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADCEx_RegularStop(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential ADC conversion on going and disable ADC peripheral */ + /* conditioned to: */ + /* - For ADC regular group conversion stop: */ + /* On this STM32 family, conversion on the other group */ + /* (group injected) can continue (groups regular and injected */ + /* conversion stop commands are independent) */ + /* - For ADC disable: */ + /* No conversion on the other group (group injected) must be intended to */ + /* continue (groups regular and injected are both impacted by */ + /* ADC disable) */ + + /* 1. Stop potential conversion on going, on regular group only */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_GROUP); + + /* Disable ADC peripheral if conversion on ADC group regular is */ + /* effectively stopped and if no conversion on the other group */ + /* (ADC group injected) is intended to continue. */ + if((ADC_IS_CONVERSION_ONGOING_INJECTED(hadc) == RESET) && + ((hadc->State & HAL_ADC_STATE_INJ_BUSY) == RESET) ) + { + /* 2. Disable the ADC peripheral */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + /* Conversion on ADC group regular group is stopped, but ADC is not */ + /* disabled since conversion on ADC group injected is still on going. */ + else + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} + +/** + * @brief Stop ADC group regular conversion (potential conversion on going + * on ADC group injected is not impacted), disable ADC peripheral + * if no conversion is on going on group injected. + * Interruptions disabled in this function: + * - EOC (end of conversion of regular group) and EOS (end of + * sequence of regular group) + * - overrun + * @note To stop ADC conversion of both groups regular and injected and to + * to disable ADC peripheral, instead of using 2 functions + * @ref HAL_ADCEx_RegularStop() and @ref HAL_ADCEx_InjectedStop(), + * use function @ref HAL_ADC_Stop(). + * @note In case of auto-injection mode, this function also stop conversion + * on ADC group injected. + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADCEx_RegularStop_IT(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential ADC conversion on going and disable ADC peripheral */ + /* conditioned to: */ + /* - For ADC regular group conversion stop: */ + /* On this STM32 family, conversion on the other group */ + /* (group injected) can continue (groups regular and injected */ + /* conversion stop commands are independent) */ + /* - For ADC disable: */ + /* No conversion on the other group (group injected) must be intended to */ + /* continue (groups regular and injected are both impacted by */ + /* ADC disable) */ + + /* 1. Stop potential conversion on going, on regular group only */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_GROUP); + + /* Disable ADC peripheral if conversion on ADC group regular is */ + /* effectively stopped and if no conversion on the other group */ + /* (ADC group injected) is intended to continue. */ + if((ADC_IS_CONVERSION_ONGOING_INJECTED(hadc) == RESET) && + ((hadc->State & HAL_ADC_STATE_INJ_BUSY) == RESET) ) + { + /* Disable ADC end of conversion interrupt for regular group */ + /* Disable ADC overrun interrupt */ + __HAL_ADC_DISABLE_IT(hadc, (ADC_IT_EOC | ADC_IT_EOS | ADC_IT_OVR)); + + /* 2. Disable the ADC peripheral */ + tmp_hal_status = ADC_Disable(hadc); + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + /* Conversion on ADC group regular group is stopped, but ADC is not */ + /* disabled since conversion on ADC group injected is still on going. */ + else + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} + +/** + * @brief Stop ADC group regular conversion (potential conversion on going + * on ADC group injected is not impacted), + * disable ADC DMA transfer, disable ADC peripheral + * if no conversion is on going on group injected. + * Interruptions disabled in this function: + * - DMA transfer complete + * - DMA half transfer + * - overrun + * @note To stop ADC conversion of both groups regular and injected and to + * to disable ADC peripheral, instead of using 2 functions + * @ref HAL_ADCEx_RegularStop() and @ref HAL_ADCEx_InjectedStop(), + * use function @ref HAL_ADC_Stop(). + * @note Case of multimode enabled (for devices with several ADCs): This + * function is for single-ADC mode only. For multimode, use the + * dedicated MultimodeStop function. + * @param hadc ADC handle + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_ADCEx_RegularStop_DMA(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential ADC conversion on going and disable ADC peripheral */ + /* conditioned to: */ + /* - For ADC regular group conversion stop: */ + /* On this STM32 family, conversion on the other group */ + /* (group injected) can continue (groups regular and injected */ + /* conversion stop commands are independent) */ + /* - For ADC disable: */ + /* No conversion on the other group (group injected) must be intended to */ + /* continue (groups regular and injected are both impacted by */ + /* ADC disable) */ + + /* 1. Stop potential conversion on going, on regular group only */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_GROUP); + + /* Disable ADC peripheral if conversion on ADC group regular is */ + /* effectively stopped and if no conversion on the other group */ + /* (ADC group injected) is intended to continue. */ + if((ADC_IS_CONVERSION_ONGOING_INJECTED(hadc) == RESET) && + ((hadc->State & HAL_ADC_STATE_INJ_BUSY) == RESET) ) + { + /* Disable ADC DMA (ADC DMA configuration ADC_CFGR_DMACFG is kept) */ + CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_DMAEN); + + /* Disable the DMA channel (in case of DMA in circular mode or stop while */ + /* while DMA transfer is on going) */ + tmp_hal_status = HAL_DMA_Abort(hadc->DMA_Handle); + + /* Check if DMA channel effectively disabled */ + if (tmp_hal_status != HAL_OK) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); + } + + /* Disable ADC overrun interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_OVR); + + /* 2. Disable the ADC peripheral */ + /* Update "tmp_hal_status" only if DMA channel disabling passed, */ + /* to retain a potential failing status. */ + if (tmp_hal_status == HAL_OK) + { + tmp_hal_status = ADC_Disable(hadc); + } + else + { + ADC_Disable(hadc); + } + + /* Check if ADC is effectively disabled */ + if (tmp_hal_status == HAL_OK) + { + /* Set ADC state */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + /* Conversion on ADC group regular group is stopped, but ADC is not */ + /* disabled since conversion on ADC group injected is still on going. */ + else + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +/** + * @brief With ADC configured in multimode, for ADC master: + * Stop ADC group regular conversion (potential conversion on going + * on ADC group injected is not impacted), + * disable ADC DMA transfer, disable ADC peripheral + * if no conversion is on going on group injected. + * Interruptions disabled in this function: + * - DMA transfer complete + * - DMA half transfer + * - overrun + * @note To stop ADC conversion of both groups regular and injected and to + * to disable ADC peripheral, instead of using 2 functions + * @ref HAL_ADCEx_RegularMultiModeStop_DMA() and + * @ref HAL_ADCEx_InjectedStop(), use function + * @ref HAL_ADCEx_MultiModeStop_DMA. + * @note In case of auto-injection mode, this function also stop conversion + * on ADC group injected. + * @note Multimode is kept enabled after this function. To disable multimode + * (set with HAL_ADCEx_MultiModeConfigChannel() ), ADC must be + * reinitialized using HAL_ADC_Init() or HAL_ADC_ReInit(). + * @note In case of DMA configured in circular mode, function + * HAL_ADC_Stop_DMA must be called after this function with handle of + * ADC slave, to properly disable the DMA channel of ADC slave. + * @param hadc ADC handle of ADC master (handle of ADC slave must not be used) + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_RegularMultiModeStop_DMA(ADC_HandleTypeDef* hadc) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + uint32_t tickstart; + ADC_HandleTypeDef tmphadcSlave = {0}; + + /* Check the parameters */ + assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance)); + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Stop potential ADC conversion on going and disable ADC peripheral */ + /* conditioned to: */ + /* - For ADC regular group conversion stop: */ + /* On this STM32 family, conversion on the other group */ + /* (group injected) can continue (groups regular and injected */ + /* conversion stop commands are independent) */ + /* - For ADC disable: */ + /* No conversion on the other group (group injected) must be intended to */ + /* continue (groups regular and injected are both impacted by */ + /* ADC disable) */ + + /* 1. Stop potential conversion on going, on regular group only */ + tmp_hal_status = ADC_ConversionStop(hadc, ADC_REGULAR_GROUP); + + /* Disable ADC peripheral if conversion on ADC group regular is */ + /* effectively stopped and if no conversion on the other group */ + /* (ADC group injected) is intended to continue. */ + if((ADC_IS_CONVERSION_ONGOING_INJECTED(hadc) == RESET) && + ((hadc->State & HAL_ADC_STATE_INJ_BUSY) == RESET) ) + { + /* Set a temporary handle of the ADC slave associated to the ADC master */ + /* (Depending on STM32F3 product, there may be up to 2 ADC slaves) */ + ADC_MULTI_SLAVE(hadc, &tmphadcSlave); + + if (tmphadcSlave.Instance == NULL) + { + /* Update ADC state machine (ADC master) to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + + /* Procedure to disable the ADC peripheral: wait for conversions */ + /* effectively stopped (ADC master and ADC slave), then disable ADC */ + + /* 1. Wait until ADSTP=0 for ADC master and ADC slave*/ + tickstart = HAL_GetTick(); + + while(ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) || + ADC_IS_CONVERSION_ONGOING_REGULAR(&tmphadcSlave) ) + { + if((HAL_GetTick() - tickstart) > ADC_STOP_CONVERSION_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) || + ADC_IS_CONVERSION_ONGOING_REGULAR(&tmphadcSlave) ) + { + /* Update ADC state machine (ADC master) to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + } + + /* Disable the DMA channel (in case of DMA in circular mode or stop while */ + /* while DMA transfer is on going) */ + /* Note: In case of ADC slave using its own DMA channel (multimode */ + /* parameter "DMAAccessMode" set to disabled): */ + /* DMA channel of ADC slave should stopped after this function with */ + /* function HAL_ADC_Stop_DMA. */ + tmp_hal_status = HAL_DMA_Abort(hadc->DMA_Handle); + + /* Check if DMA channel effectively disabled */ + if (tmp_hal_status != HAL_OK) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); + } + + /* Disable ADC overrun interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_OVR); + + + + /* 2. Disable the ADC peripherals: master and slave */ + /* Update "tmp_hal_status" only if DMA channel disabling passed, */ + /* to retain a potential failing status. */ + if (tmp_hal_status == HAL_OK) + { + /* Check if ADC are effectively disabled */ + if ((ADC_Disable(hadc) != HAL_ERROR) && + (ADC_Disable(&tmphadcSlave) != HAL_ERROR) ) + { + tmp_hal_status = HAL_OK; + + /* Change ADC state (ADC master) */ + ADC_STATE_CLR_SET(hadc->State, + HAL_ADC_STATE_REG_BUSY | HAL_ADC_STATE_INJ_BUSY, + HAL_ADC_STATE_READY); + } + } + else + { + /* In case of error, attempt to disable ADC instances anyway */ + ADC_Disable(hadc); + ADC_Disable(&tmphadcSlave); + + /* Update ADC state machine (ADC master) to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + } + + } + /* Conversion on ADC group regular group is stopped, but ADC is not */ + /* disabled since conversion on ADC group injected is still on going. */ + else + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @brief Injected conversion complete callback in non blocking mode + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_ADCEx_InjectedConvCpltCallback could be implemented in the user file + */ +} + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Injected context queue overflow flag callback. + * @note This callback is called if injected context queue is enabled + (parameter "QueueInjectedContext" in injected channel configuration) + and if a new injected context is set when queue is full (maximum 2 + contexts). + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADCEx_InjectedQueueOverflowCallback(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADCEx_InjectedQueueOverflowCallback must be implemented + in the user file. + */ +} + +/** + * @brief Analog watchdog 2 callback in non blocking mode. + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADCEx_LevelOutOfWindow2Callback(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADC_LevelOoutOfWindow2Callback must be implemented in the user file. + */ +} + +/** + * @brief Analog watchdog 3 callback in non blocking mode. + * @param hadc ADC handle + * @retval None + */ +__weak void HAL_ADCEx_LevelOutOfWindow3Callback(ADC_HandleTypeDef* hadc) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hadc); + + /* NOTE : This function should not be modified. When the callback is needed, + function HAL_ADC_LevelOoutOfWindow3Callback must be implemented in the user file. + */ +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +/** + * @} + */ + +/** @defgroup ADCEx_Exported_Functions_Group3 ADCEx Peripheral Control functions + * @brief ADC Extended Peripheral Control functions + * +@verbatim + =============================================================================== + ##### Peripheral Control functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Configure channels on regular group + (+) Configure channels on injected group + (+) Configure multimode + (+) Configure the analog watchdog + +@endverbatim + * @{ + */ + + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Configures the the selected channel to be linked to the regular + * group. + * @note In case of usage of internal measurement channels: + * Vbat/VrefInt/TempSensor. + * The recommended sampling time is at least: + * - For devices STM32F37x: 17.1us for temperature sensor + * - For the other STM32F3 devices: 2.2us for each of channels + * Vbat/VrefInt/TempSensor. + * These internal paths can be be disabled using function + * HAL_ADC_DeInit(). + * @note Possibility to update parameters on the fly: + * This function initializes channel into regular group, following + * calls to this function can be used to reconfigure some parameters + * of structure "ADC_ChannelConfTypeDef" on the fly, without resetting + * the ADC. + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_ChannelConfTypeDef". + * @param hadc ADC handle + * @param sConfig Structure ADC channel for regular group. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + ADC_Common_TypeDef *tmpADC_Common; + ADC_HandleTypeDef tmphadcSharingSameCommonRegister; + uint32_t tmpOffsetShifted; + __IO uint32_t wait_loop_index = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_REGULAR_RANK(sConfig->Rank)); + assert_param(IS_ADC_SAMPLE_TIME(sConfig->SamplingTime)); + assert_param(IS_ADC_SINGLE_DIFFERENTIAL(sConfig->SingleDiff)); + assert_param(IS_ADC_OFFSET_NUMBER(sConfig->OffsetNumber)); + assert_param(IS_ADC_RANGE(ADC_GET_RESOLUTION(hadc), sConfig->Offset)); + + + /* Verification of channel number: Channels 1 to 14 are available in */ + /* differential mode. Channels 15U, 16U, 17U, 18 can be used only in */ + /* single-ended mode. */ + if (sConfig->SingleDiff != ADC_DIFFERENTIAL_ENDED) + { + assert_param(IS_ADC_CHANNEL(sConfig->Channel)); + } + else + { + assert_param(IS_ADC_DIFF_CHANNEL(sConfig->Channel)); + } + + /* Process locked */ + __HAL_LOCK(hadc); + + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated when ADC is disabled or enabled without */ + /* conversion on going on regular group: */ + /* - Channel number */ + /* - Channel rank */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) + { + /* Regular sequence configuration */ + /* For Rank 1 to 4U */ + if (sConfig->Rank < 5U) + { + MODIFY_REG(hadc->Instance->SQR1, + ADC_SQR1_RK(ADC_SQR2_SQ5, sConfig->Rank) , + ADC_SQR1_RK(sConfig->Channel, sConfig->Rank) ); + } + /* For Rank 5 to 9U */ + else if (sConfig->Rank < 10U) + { + MODIFY_REG(hadc->Instance->SQR2, + ADC_SQR2_RK(ADC_SQR2_SQ5, sConfig->Rank) , + ADC_SQR2_RK(sConfig->Channel, sConfig->Rank) ); + } + /* For Rank 10 to 14U */ + else if (sConfig->Rank < 15U) + { + MODIFY_REG(hadc->Instance->SQR3 , + ADC_SQR3_RK(ADC_SQR3_SQ10, sConfig->Rank) , + ADC_SQR3_RK(sConfig->Channel, sConfig->Rank) ); + } + /* For Rank 15 to 16U */ + else + { + MODIFY_REG(hadc->Instance->SQR4 , + ADC_SQR4_RK(ADC_SQR4_SQ15, sConfig->Rank) , + ADC_SQR4_RK(sConfig->Channel, sConfig->Rank) ); + } + + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated when ADC is disabled or enabled without */ + /* conversion on going on regular group: */ + /* - Channel sampling time */ + /* - Channel offset */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED(hadc) == RESET) + { + /* Channel sampling time configuration */ + /* For channels 10 to 18U */ + if (sConfig->Channel >= ADC_CHANNEL_10) + { + MODIFY_REG(hadc->Instance->SMPR2 , + ADC_SMPR2(ADC_SMPR2_SMP10, sConfig->Channel) , + ADC_SMPR2(sConfig->SamplingTime, sConfig->Channel) ); + } + else /* For channels 1 to 9U */ + { + MODIFY_REG(hadc->Instance->SMPR1 , + ADC_SMPR1(ADC_SMPR1_SMP0, sConfig->Channel) , + ADC_SMPR1(sConfig->SamplingTime, sConfig->Channel) ); + } + + + /* Configure the offset: offset enable/disable, channel, offset value */ + + /* Shift the offset in function of the selected ADC resolution. */ + /* Offset has to be left-aligned on bit 11U, the LSB (right bits) are set */ + /* to 0. */ + tmpOffsetShifted = ADC_OFFSET_SHIFT_RESOLUTION(hadc, sConfig->Offset); + + /* Configure the selected offset register: */ + /* - Enable offset */ + /* - Set channel number */ + /* - Set offset value */ + switch (sConfig->OffsetNumber) + { + case ADC_OFFSET_1: + /* Configure offset register 1U */ + MODIFY_REG(hadc->Instance->OFR1 , + ADC_OFR1_OFFSET1_CH | + ADC_OFR1_OFFSET1 , + ADC_OFR1_OFFSET1_EN | + ADC_OFR_CHANNEL(sConfig->Channel) | + tmpOffsetShifted ); + break; + + case ADC_OFFSET_2: + /* Configure offset register 2U */ + MODIFY_REG(hadc->Instance->OFR2 , + ADC_OFR2_OFFSET2_CH | + ADC_OFR2_OFFSET2 , + ADC_OFR2_OFFSET2_EN | + ADC_OFR_CHANNEL(sConfig->Channel) | + tmpOffsetShifted ); + break; + + case ADC_OFFSET_3: + /* Configure offset register 3U */ + MODIFY_REG(hadc->Instance->OFR3 , + ADC_OFR3_OFFSET3_CH | + ADC_OFR3_OFFSET3 , + ADC_OFR3_OFFSET3_EN | + ADC_OFR_CHANNEL(sConfig->Channel) | + tmpOffsetShifted ); + break; + + case ADC_OFFSET_4: + /* Configure offset register 4U */ + MODIFY_REG(hadc->Instance->OFR4 , + ADC_OFR4_OFFSET4_CH | + ADC_OFR4_OFFSET4 , + ADC_OFR4_OFFSET4_EN | + ADC_OFR_CHANNEL(sConfig->Channel) | + tmpOffsetShifted ); + break; + + /* Case ADC_OFFSET_NONE */ + default : + /* Scan OFR1, OFR2, OFR3, OFR4 to check if the selected channel is */ + /* enabled. If this is the case, offset OFRx is disabled. */ + if (((hadc->Instance->OFR1) & ADC_OFR1_OFFSET1_CH) == ADC_OFR_CHANNEL(sConfig->Channel)) + { + /* Disable offset OFR1*/ + CLEAR_BIT(hadc->Instance->OFR1, ADC_OFR1_OFFSET1_EN); + } + if (((hadc->Instance->OFR2) & ADC_OFR2_OFFSET2_CH) == ADC_OFR_CHANNEL(sConfig->Channel)) + { + /* Disable offset OFR2*/ + CLEAR_BIT(hadc->Instance->OFR2, ADC_OFR2_OFFSET2_EN); + } + if (((hadc->Instance->OFR3) & ADC_OFR3_OFFSET3_CH) == ADC_OFR_CHANNEL(sConfig->Channel)) + { + /* Disable offset OFR3*/ + CLEAR_BIT(hadc->Instance->OFR3, ADC_OFR3_OFFSET3_EN); + } + if (((hadc->Instance->OFR4) & ADC_OFR4_OFFSET4_CH) == ADC_OFR_CHANNEL(sConfig->Channel)) + { + /* Disable offset OFR4*/ + CLEAR_BIT(hadc->Instance->OFR4, ADC_OFR4_OFFSET4_EN); + } + break; + } + + } + + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated only when ADC is disabled: */ + /* - Single or differential mode */ + /* - Internal measurement channels: Vbat/VrefInt/TempSensor */ + if (ADC_IS_ENABLE(hadc) == RESET) + { + /* Configuration of differential mode */ + if (sConfig->SingleDiff != ADC_DIFFERENTIAL_ENDED) + { + /* Disable differential mode (default mode: single-ended) */ + CLEAR_BIT(hadc->Instance->DIFSEL, ADC_DIFSEL_CHANNEL(sConfig->Channel)); + } + else + { + /* Enable differential mode */ + SET_BIT(hadc->Instance->DIFSEL, ADC_DIFSEL_CHANNEL(sConfig->Channel)); + + /* Channel sampling time configuration (channel ADC_INx +1 */ + /* corresponding to differential negative input). */ + /* For channels 10 to 18U */ + if (sConfig->Channel >= ADC_CHANNEL_10) + { + MODIFY_REG(hadc->Instance->SMPR2, + ADC_SMPR2(ADC_SMPR2_SMP10, sConfig->Channel +1U) , + ADC_SMPR2(sConfig->SamplingTime, sConfig->Channel +1U) ); + } + else /* For channels 1 to 9U */ + { + MODIFY_REG(hadc->Instance->SMPR1, + ADC_SMPR1(ADC_SMPR1_SMP0, sConfig->Channel +1U) , + ADC_SMPR1(sConfig->SamplingTime, sConfig->Channel +1U) ); + } + } + + + /* Management of internal measurement channels: VrefInt/TempSensor/Vbat */ + /* internal measurement paths enable: If internal channel selected, */ + /* enable dedicated internal buffers and path. */ + /* Note: these internal measurement paths can be disabled using */ + /* HAL_ADC_DeInit(). */ + + /* Configuration of common ADC parameters */ + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + /* If the requested internal measurement path has already been enabled, */ + /* bypass the configuration processing. */ + if (( (sConfig->Channel == ADC_CHANNEL_TEMPSENSOR) && + (HAL_IS_BIT_CLR(tmpADC_Common->CCR, ADC_CCR_TSEN)) ) || + ( (sConfig->Channel == ADC_CHANNEL_VBAT) && + (HAL_IS_BIT_CLR(tmpADC_Common->CCR, ADC_CCR_VBATEN)) ) || + ( (sConfig->Channel == ADC_CHANNEL_VREFINT) && + (HAL_IS_BIT_CLR(tmpADC_Common->CCR, ADC_CCR_VREFEN))) + ) + { + /* Configuration of common ADC parameters (continuation) */ + /* Set handle of the other ADC sharing the same common register */ + ADC_COMMON_ADC_OTHER(hadc, &tmphadcSharingSameCommonRegister); + + /* Software is allowed to change common parameters only when all ADCs */ + /* of the common group are disabled. */ + if ((ADC_IS_ENABLE(hadc) == RESET) && + ( (tmphadcSharingSameCommonRegister.Instance == NULL) || + (ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) ) ) + { + /* If Channel_16 is selected, enable Temp. sensor measurement path */ + /* Note: Temp. sensor internal channels available on ADC1 only */ + if ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR) && (hadc->Instance == ADC1)) + { + SET_BIT(tmpADC_Common->CCR, ADC_CCR_TSEN); + + /* Delay for temperature sensor stabilization time */ + /* Compute number of CPU cycles to wait for */ + wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U)); + while(wait_loop_index != 0U) + { + wait_loop_index--; + } + } + /* If Channel_17 is selected, enable VBAT measurement path */ + /* Note: VBAT internal channels available on ADC1 only */ + else if ((sConfig->Channel == ADC_CHANNEL_VBAT) && (hadc->Instance == ADC1)) + { + SET_BIT(tmpADC_Common->CCR, ADC_CCR_VBATEN); + } + /* If Channel_18 is selected, enable VREFINT measurement path */ + /* Note: VrefInt internal channels available on all ADCs, but only */ + /* one ADC is allowed to be connected to VrefInt at the same */ + /* time. */ + else if (sConfig->Channel == ADC_CHANNEL_VREFINT) + { + SET_BIT(tmpADC_Common->CCR, ADC_CCR_VREFEN); + } + } + /* If the requested internal measurement path has already been */ + /* enabled and other ADC of the common group are enabled, internal */ + /* measurement paths cannot be enabled. */ + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + } + + } + + } + /* If a conversion is on going on regular group, no update on regular */ + /* channel could be done on neither of the channel configuration structure */ + /* parameters. */ + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Configures the the selected channel to be linked to the regular + * group. + * @note In case of usage of internal measurement channels: + * Vbat/VrefInt/TempSensor. + * The recommended sampling time is at least: + * - For devices STM32F37x: 17.1us for temperature sensor + * - For the other STM32F3 devices: 2.2us for each of channels + * Vbat/VrefInt/TempSensor. + * These internal paths can be be disabled using function + * HAL_ADC_DeInit(). + * @note Possibility to update parameters on the fly: + * This function initializes channel into regular group, following + * calls to this function can be used to reconfigure some parameters + * of structure "ADC_ChannelConfTypeDef" on the fly, without resetting + * the ADC. + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_ChannelConfTypeDef". + * @param hadc ADC handle + * @param sConfig Structure of ADC channel for regular group. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_ConfigChannel(ADC_HandleTypeDef* hadc, ADC_ChannelConfTypeDef* sConfig) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + __IO uint32_t wait_loop_index = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_CHANNEL(sConfig->Channel)); + assert_param(IS_ADC_REGULAR_RANK(sConfig->Rank)); + assert_param(IS_ADC_SAMPLE_TIME(sConfig->SamplingTime)); + + /* Process locked */ + __HAL_LOCK(hadc); + + + /* Regular sequence configuration */ + /* For Rank 1 to 6U */ + if (sConfig->Rank < 7U) + { + MODIFY_REG(hadc->Instance->SQR3 , + ADC_SQR3_RK(ADC_SQR3_SQ1, sConfig->Rank) , + ADC_SQR3_RK(sConfig->Channel, sConfig->Rank) ); + } + /* For Rank 7 to 12U */ + else if (sConfig->Rank < 13U) + { + MODIFY_REG(hadc->Instance->SQR2 , + ADC_SQR2_RK(ADC_SQR2_SQ7, sConfig->Rank) , + ADC_SQR2_RK(sConfig->Channel, sConfig->Rank) ); + } + /* For Rank 13 to 16U */ + else + { + MODIFY_REG(hadc->Instance->SQR1 , + ADC_SQR1_RK(ADC_SQR1_SQ13, sConfig->Rank) , + ADC_SQR1_RK(sConfig->Channel, sConfig->Rank) ); + } + + + /* Channel sampling time configuration */ + /* For channels 10 to 18U */ + if (sConfig->Channel > ADC_CHANNEL_10) + { + MODIFY_REG(hadc->Instance->SMPR1 , + ADC_SMPR1(ADC_SMPR1_SMP10, sConfig->Channel) , + ADC_SMPR1(sConfig->SamplingTime, sConfig->Channel) ); + } + else /* For channels 0 to 9U */ + { + MODIFY_REG(hadc->Instance->SMPR2 , + ADC_SMPR2(ADC_SMPR2_SMP0, sConfig->Channel) , + ADC_SMPR2(sConfig->SamplingTime, sConfig->Channel) ); + } + + /* If ADC1 Channel_16 or Channel_17 is selected, enable Temperature sensor */ + /* and VREFINT measurement path. */ + if ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR) || + (sConfig->Channel == ADC_CHANNEL_VREFINT) ) + { + SET_BIT(hadc->Instance->CR2, ADC_CR2_TSVREFE); + + if ((sConfig->Channel == ADC_CHANNEL_TEMPSENSOR)) + { + /* Delay for temperature sensor stabilization time */ + /* Compute number of CPU cycles to wait for */ + wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U)); + while(wait_loop_index != 0U) + { + wait_loop_index--; + } + } + } + /* if ADC1 Channel_18 is selected, enable VBAT measurement path */ + else if (sConfig->Channel == ADC_CHANNEL_VBAT) + { + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_VBAT); + } + + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Configures the ADC injected group and the selected channel to be + * linked to the injected group. + * @note Possibility to update parameters on the fly: + * This function initializes injected group, following calls to this + * function can be used to reconfigure some parameters of structure + * "ADC_InjectionConfTypeDef" on the fly, without resetting the ADC. + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_InjectionConfTypeDef". + * @note In case of usage of internal measurement channels: + * Vbat/VrefInt/TempSensor. + * The recommended sampling time is at least: + * - For devices STM32F37x: 17.1us for temperature sensor + * - For the other STM32F3 devices: 2.2us for each of channels + * Vbat/VrefInt/TempSensor. + * These internal paths can be be disabled using function + * HAL_ADC_DeInit(). + * @note To reset injected sequencer, function HAL_ADCEx_InjectedStop() can + * be used. + * @note Caution: For Injected Context Queue use: a context must be fully + * defined before start of injected conversion: all channels configured + * consecutively for the same ADC instance. Therefore, Number of calls of + * HAL_ADCEx_InjectedConfigChannel() must correspond to value of parameter + * InjectedNbrOfConversion for each context. + * - Example 1: If 1 context intended to be used (or not use of this feature: + * QueueInjectedContext=DISABLE) and usage of the 3 first injected ranks + * (InjectedNbrOfConversion=3), HAL_ADCEx_InjectedConfigChannel() must be + * called once for each channel (3 times) before launching a conversion. + * This function must not be called to configure the 4th injected channel: + * it would start a new context into context queue. + * - Example 2: If 2 contexts intended to be used and usage of the 3 first + * injected ranks (InjectedNbrOfConversion=3), + * HAL_ADCEx_InjectedConfigChannel() must be called once for each channel and + * for each context (3 channels x 2 contexts = 6 calls). Conversion can + * start once the 1st context is set. The 2nd context can be set on the fly. + * @param hadc ADC handle + * @param sConfigInjected Structure of ADC injected group and ADC channel for + * injected group. + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_InjectionConfTypeDef* sConfigInjected) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + ADC_Common_TypeDef *tmpADC_Common; + ADC_HandleTypeDef tmphadcSharingSameCommonRegister; + uint32_t tmpOffsetShifted; + __IO uint32_t wait_loop_index = 0U; + + /* Injected context queue feature: temporary JSQR variables defined in */ + /* static to be passed over calls of this function */ + uint32_t tmp_JSQR_ContextQueueBeingBuilt = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_SAMPLE_TIME(sConfigInjected->InjectedSamplingTime)); + assert_param(IS_ADC_SINGLE_DIFFERENTIAL(sConfigInjected->InjectedSingleDiff)); + assert_param(IS_FUNCTIONAL_STATE(sConfigInjected->AutoInjectedConv)); + assert_param(IS_FUNCTIONAL_STATE(sConfigInjected->QueueInjectedContext)); + assert_param(IS_ADC_EXTTRIGINJEC_EDGE(sConfigInjected->ExternalTrigInjecConvEdge)); + assert_param(IS_ADC_EXTTRIGINJEC(sConfigInjected->ExternalTrigInjecConv)); + assert_param(IS_ADC_OFFSET_NUMBER(sConfigInjected->InjectedOffsetNumber)); + assert_param(IS_ADC_RANGE(ADC_GET_RESOLUTION(hadc), sConfigInjected->InjectedOffset)); + + if(hadc->Init.ScanConvMode != ADC_SCAN_DISABLE) + { + assert_param(IS_ADC_INJECTED_RANK(sConfigInjected->InjectedRank)); + assert_param(IS_ADC_INJECTED_NB_CONV(sConfigInjected->InjectedNbrOfConversion)); + assert_param(IS_FUNCTIONAL_STATE(sConfigInjected->InjectedDiscontinuousConvMode)); + } + + /* Verification of channel number: Channels 1 to 14 are available in */ + /* differential mode. Channels 15U, 16U, 17U, 18 can be used only in */ + /* single-ended mode. */ + if (sConfigInjected->InjectedSingleDiff != ADC_DIFFERENTIAL_ENDED) + { + assert_param(IS_ADC_CHANNEL(sConfigInjected->InjectedChannel)); + } + else + { + assert_param(IS_ADC_DIFF_CHANNEL(sConfigInjected->InjectedChannel)); + } + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Configuration of Injected group sequencer. */ + /* Hardware constraint: Must fully define injected context register JSQR */ + /* before make it entering into injected sequencer queue. */ + /* */ + /* - if scan mode is disabled: */ + /* * Injected channels sequence length is set to 0x00: 1 channel */ + /* converted (channel on injected rank 1U) */ + /* Parameter "InjectedNbrOfConversion" is discarded. */ + /* * Injected context register JSQR setting is simple: register is fully */ + /* defined on one call of this function (for injected rank 1U) and can */ + /* be entered into queue directly. */ + /* - if scan mode is enabled: */ + /* * Injected channels sequence length is set to parameter */ + /* "InjectedNbrOfConversion". */ + /* * Injected context register JSQR setting more complex: register is */ + /* fully defined over successive calls of this function, for each */ + /* injected channel rank. It is entered into queue only when all */ + /* injected ranks have been set. */ + /* Note: Scan mode is not present by hardware on this device, but used */ + /* by software for alignment over all STM32 devices. */ + + if ((hadc->Init.ScanConvMode == ADC_SCAN_DISABLE) || + (sConfigInjected->InjectedNbrOfConversion == 1U) ) + { + /* Configuration of context register JSQR: */ + /* - number of ranks in injected group sequencer: fixed to 1st rank */ + /* (scan mode disabled, only rank 1 used) */ + /* - external trigger to start conversion */ + /* - external trigger polarity */ + /* - channel set to rank 1 (scan mode disabled, only rank 1 used) */ + + if (sConfigInjected->InjectedRank == ADC_INJECTED_RANK_1) + { + /* Enable external trigger if trigger selection is different of */ + /* software start. */ + /* Note: This configuration keeps the hardware feature of parameter */ + /* ExternalTrigInjecConvEdge "trigger edge none" equivalent to */ + /* software start. */ + if (sConfigInjected->ExternalTrigInjecConv != ADC_INJECTED_SOFTWARE_START) + { + SET_BIT(tmp_JSQR_ContextQueueBeingBuilt, ADC_JSQR_RK(sConfigInjected->InjectedChannel, ADC_INJECTED_RANK_1) | + ADC_JSQR_JEXTSEL_SET(hadc, sConfigInjected->ExternalTrigInjecConv) | + sConfigInjected->ExternalTrigInjecConvEdge ); + } + else + { + SET_BIT(tmp_JSQR_ContextQueueBeingBuilt, ADC_JSQR_RK(sConfigInjected->InjectedChannel, ADC_INJECTED_RANK_1) ); + } + + /* Update ADC register JSQR */ + MODIFY_REG(hadc->Instance->JSQR , + ADC_JSQR_JSQ4 | + ADC_JSQR_JSQ3 | + ADC_JSQR_JSQ2 | + ADC_JSQR_JSQ1 | + ADC_JSQR_JEXTEN | + ADC_JSQR_JEXTSEL | + ADC_JSQR_JL , + tmp_JSQR_ContextQueueBeingBuilt ); + + /* For debug and informative reasons, hadc handle saves JSQR setting */ + hadc->InjectionConfig.ContextQueue = tmp_JSQR_ContextQueueBeingBuilt; + } + /* If another injected rank than rank1 was intended to be set, and could */ + /* not due to ScanConvMode disabled, error is reported. */ + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + + } + else + { + /* Case of scan mode enabled, several channels to set into injected group */ + /* sequencer. */ + /* Procedure to define injected context register JSQR over successive */ + /* calls of this function, for each injected channel rank: */ + + /* 1. Start new context and set parameters related to all injected */ + /* channels: injected sequence length and trigger */ + if (hadc->InjectionConfig.ChannelCount == 0U) + { + /* Initialize number of channels that will be configured on the context */ + /* being built */ + hadc->InjectionConfig.ChannelCount = sConfigInjected->InjectedNbrOfConversion; + /* Initialize value that will be set into register JSQR */ + hadc->InjectionConfig.ContextQueue = 0x00000000U; + + /* Configuration of context register JSQR: */ + /* - number of ranks in injected group sequencer */ + /* - external trigger to start conversion */ + /* - external trigger polarity */ + + /* Enable external trigger if trigger selection is different of */ + /* software start. */ + /* Note: This configuration keeps the hardware feature of parameter */ + /* ExternalTrigInjecConvEdge "trigger edge none" equivalent to */ + /* software start. */ + if (sConfigInjected->ExternalTrigInjecConv != ADC_INJECTED_SOFTWARE_START) + { + SET_BIT(hadc->InjectionConfig.ContextQueue, (sConfigInjected->InjectedNbrOfConversion - 1U) | + ADC_JSQR_JEXTSEL_SET(hadc, sConfigInjected->ExternalTrigInjecConv) | + sConfigInjected->ExternalTrigInjecConvEdge ); + } + else + { + SET_BIT(hadc->InjectionConfig.ContextQueue, (sConfigInjected->InjectedNbrOfConversion - 1U) ); + } + + } + + /* 2. Continue setting of context under definition with parameter */ + /* related to each channel: channel rank sequence */ + + /* Set the JSQx bits for the selected rank */ + MODIFY_REG(hadc->InjectionConfig.ContextQueue , + ADC_JSQR_RK(ADC_SQR3_SQ10, sConfigInjected->InjectedRank) , + ADC_JSQR_RK(sConfigInjected->InjectedChannel, sConfigInjected->InjectedRank) ); + + /* Decrease channel count after setting into temporary JSQR variable */ + hadc->InjectionConfig.ChannelCount --; + + /* 3. End of context setting: If last channel set, then write context */ + /* into register JSQR and make it enter into queue */ + if (hadc->InjectionConfig.ChannelCount == 0U) + { + /* Update ADC register JSQR */ + MODIFY_REG(hadc->Instance->JSQR , + ADC_JSQR_JSQ4 | + ADC_JSQR_JSQ3 | + ADC_JSQR_JSQ2 | + ADC_JSQR_JSQ1 | + ADC_JSQR_JEXTEN | + ADC_JSQR_JEXTSEL | + ADC_JSQR_JL , + hadc->InjectionConfig.ContextQueue ); + } + + } + + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated when ADC is disabled or enabled without */ + /* conversion on going on injected group: */ + /* - Injected context queue: Queue disable (active context is kept) or */ + /* enable (context decremented, up to 2 contexts queued) */ + /* - Injected discontinuous mode: can be enabled only if auto-injected */ + /* mode is disabled. */ + if (ADC_IS_CONVERSION_ONGOING_INJECTED(hadc) == RESET) + { + /* If auto-injected mode is disabled: no constraint */ + if (sConfigInjected->AutoInjectedConv == DISABLE) + { + MODIFY_REG(hadc->Instance->CFGR , + ADC_CFGR_JQM | + ADC_CFGR_JDISCEN , + ADC_CFGR_INJECT_CONTEXT_QUEUE((uint32_t)sConfigInjected->QueueInjectedContext) | + ADC_CFGR_INJECT_DISCCONTINUOUS((uint32_t)sConfigInjected->InjectedDiscontinuousConvMode) ); + } + /* If auto-injected mode is enabled: Injected discontinuous setting is */ + /* discarded. */ + else + { + MODIFY_REG(hadc->Instance->CFGR , + ADC_CFGR_JQM | + ADC_CFGR_JDISCEN , + ADC_CFGR_INJECT_CONTEXT_QUEUE((uint32_t)sConfigInjected->QueueInjectedContext) ); + + /* If injected discontinuous mode was intended to be set and could not */ + /* due to auto-injected enabled, error is reported. */ + if (sConfigInjected->InjectedDiscontinuousConvMode == ENABLE) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + } + + } + + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated when ADC is disabled or enabled without */ + /* conversion on going on regular and injected groups: */ + /* - Automatic injected conversion: can be enabled if injected group */ + /* external triggers are disabled. */ + /* - Channel sampling time */ + /* - Channel offset */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED(hadc) == RESET) + { + /* If injected group external triggers are disabled (set to injected */ + /* software start): no constraint */ + if (sConfigInjected->ExternalTrigInjecConv == ADC_INJECTED_SOFTWARE_START) + { + MODIFY_REG(hadc->Instance->CFGR , + ADC_CFGR_JAUTO , + ADC_CFGR_INJECT_AUTO_CONVERSION((uint32_t)sConfigInjected->AutoInjectedConv) ); + } + /* If Automatic injected conversion was intended to be set and could not */ + /* due to injected group external triggers enabled, error is reported. */ + else + { + /* Disable Automatic injected conversion */ + CLEAR_BIT(hadc->Instance->CFGR, ADC_CFGR_JAUTO); + + if (sConfigInjected->AutoInjectedConv == ENABLE) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + } + + + /* Channel sampling time configuration */ + /* For channels 10 to 18U */ + if (sConfigInjected->InjectedChannel >= ADC_CHANNEL_10) + { + MODIFY_REG(hadc->Instance->SMPR2 , + ADC_SMPR2(ADC_SMPR2_SMP10, sConfigInjected->InjectedChannel) , + ADC_SMPR2(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel) ); + } + else /* For channels 1 to 9U */ + { + MODIFY_REG(hadc->Instance->SMPR1 , + ADC_SMPR1(ADC_SMPR1_SMP0, sConfigInjected->InjectedChannel) , + ADC_SMPR1(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel) ); + } + + /* Configure the offset: offset enable/disable, channel, offset value */ + + /* Shift the offset in function of the selected ADC resolution. */ + /* Offset has to be left-aligned on bit 11U, the LSB (right bits) are set */ + /* to 0. */ + tmpOffsetShifted = ADC_OFFSET_SHIFT_RESOLUTION(hadc, sConfigInjected->InjectedOffset); + + /* Configure the selected offset register: */ + /* - Enable offset */ + /* - Set channel number */ + /* - Set offset value */ + switch (sConfigInjected->InjectedOffsetNumber) + { + case ADC_OFFSET_1: + /* Configure offset register 1U */ + MODIFY_REG(hadc->Instance->OFR1 , + ADC_OFR1_OFFSET1_CH | + ADC_OFR1_OFFSET1 , + ADC_OFR1_OFFSET1_EN | + ADC_OFR_CHANNEL(sConfigInjected->InjectedChannel) | + tmpOffsetShifted ); + break; + + case ADC_OFFSET_2: + /* Configure offset register 2U */ + MODIFY_REG(hadc->Instance->OFR2 , + ADC_OFR2_OFFSET2_CH | + ADC_OFR2_OFFSET2 , + ADC_OFR2_OFFSET2_EN | + ADC_OFR_CHANNEL(sConfigInjected->InjectedChannel) | + tmpOffsetShifted ); + break; + + case ADC_OFFSET_3: + /* Configure offset register 3U */ + MODIFY_REG(hadc->Instance->OFR3 , + ADC_OFR3_OFFSET3_CH | + ADC_OFR3_OFFSET3 , + ADC_OFR3_OFFSET3_EN | + ADC_OFR_CHANNEL(sConfigInjected->InjectedChannel) | + tmpOffsetShifted ); + break; + + case ADC_OFFSET_4: + /* Configure offset register 4U */ + MODIFY_REG(hadc->Instance->OFR4 , + ADC_OFR4_OFFSET4_CH | + ADC_OFR4_OFFSET4 , + ADC_OFR4_OFFSET4_EN | + ADC_OFR_CHANNEL(sConfigInjected->InjectedChannel) | + tmpOffsetShifted ); + break; + + /* Case ADC_OFFSET_NONE */ + default : + /* Scan OFR1, OFR2, OFR3, OFR4 to check if the selected channel is */ + /* enabled. If this is the case, offset OFRx is disabled. */ + if (((hadc->Instance->OFR1) & ADC_OFR1_OFFSET1_CH) == ADC_OFR_CHANNEL(sConfigInjected->InjectedChannel)) + { + /* Disable offset OFR1*/ + CLEAR_BIT(hadc->Instance->OFR1, ADC_OFR1_OFFSET1_EN); + } + if (((hadc->Instance->OFR2) & ADC_OFR2_OFFSET2_CH) == ADC_OFR_CHANNEL(sConfigInjected->InjectedChannel)) + { + /* Disable offset OFR2*/ + CLEAR_BIT(hadc->Instance->OFR2, ADC_OFR2_OFFSET2_EN); + } + if (((hadc->Instance->OFR3) & ADC_OFR3_OFFSET3_CH) == ADC_OFR_CHANNEL(sConfigInjected->InjectedChannel)) + { + /* Disable offset OFR3*/ + CLEAR_BIT(hadc->Instance->OFR3, ADC_OFR3_OFFSET3_EN); + } + if (((hadc->Instance->OFR4) & ADC_OFR4_OFFSET4_CH) == ADC_OFR_CHANNEL(sConfigInjected->InjectedChannel)) + { + /* Disable offset OFR4*/ + CLEAR_BIT(hadc->Instance->OFR4, ADC_OFR4_OFFSET4_EN); + } + break; + } + + } + + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated only when ADC is disabled: */ + /* - Single or differential mode */ + /* - Internal measurement channels: Vbat/VrefInt/TempSensor */ + if (ADC_IS_ENABLE(hadc) == RESET) + { + /* Configuration of differential mode */ + if (sConfigInjected->InjectedSingleDiff != ADC_DIFFERENTIAL_ENDED) + { + /* Disable differential mode (default mode: single-ended) */ + CLEAR_BIT(hadc->Instance->DIFSEL, ADC_DIFSEL_CHANNEL(sConfigInjected->InjectedChannel)); + } + else + { + /* Enable differential mode */ + SET_BIT(hadc->Instance->DIFSEL, ADC_DIFSEL_CHANNEL(sConfigInjected->InjectedChannel)); + + /* Channel sampling time configuration (channel ADC_INx +1 */ + /* corresponding to differential negative input). */ + /* For channels 10 to 18U */ + if (sConfigInjected->InjectedChannel >= ADC_CHANNEL_10) + { + MODIFY_REG(hadc->Instance->SMPR2, + ADC_SMPR2(ADC_SMPR2_SMP10, sConfigInjected->InjectedChannel +1U), + ADC_SMPR2(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel +1U) ); + } + else /* For channels 1 to 9U */ + { + MODIFY_REG(hadc->Instance->SMPR1, + ADC_SMPR1(ADC_SMPR1_SMP0, sConfigInjected->InjectedChannel +1U), + ADC_SMPR1(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel +1U) ); + } + } + + + /* Management of internal measurement channels: VrefInt/TempSensor/Vbat */ + /* internal measurement paths enable: If internal channel selected, */ + /* enable dedicated internal buffers and path. */ + /* Note: these internal measurement paths can be disabled using */ + /* HAL_ADC_deInit(). */ + + /* Configuration of common ADC parameters */ + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may be up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + /* If the requested internal measurement path has already been enabled, */ + /* bypass the configuration processing. */ + if (( (sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR) && + (HAL_IS_BIT_CLR(tmpADC_Common->CCR, ADC_CCR_TSEN)) ) || + ( (sConfigInjected->InjectedChannel == ADC_CHANNEL_VBAT) && + (HAL_IS_BIT_CLR(tmpADC_Common->CCR, ADC_CCR_VBATEN)) ) || + ( (sConfigInjected->InjectedChannel == ADC_CHANNEL_VREFINT) && + (HAL_IS_BIT_CLR(tmpADC_Common->CCR, ADC_CCR_VREFEN))) + ) + { + /* Configuration of common ADC parameters (continuation) */ + /* Set handle of the other ADC sharing the same common register */ + ADC_COMMON_ADC_OTHER(hadc, &tmphadcSharingSameCommonRegister); + + /* Software is allowed to change common parameters only when all ADCs */ + /* of the common group are disabled. */ + if ((ADC_IS_ENABLE(hadc) == RESET) && + ( (tmphadcSharingSameCommonRegister.Instance == NULL) || + (ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) ) ) + { + /* If Channel_16 is selected, enable Temp. sensor measurement path */ + /* Note: Temp. sensor internal channels available on ADC1 only */ + if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR) && (hadc->Instance == ADC1)) + { + SET_BIT(tmpADC_Common->CCR, ADC_CCR_TSEN); + + /* Delay for temperature sensor stabilization time */ + /* Compute number of CPU cycles to wait for */ + wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U)); + while(wait_loop_index != 0U) + { + wait_loop_index--; + } + } + /* If Channel_17 is selected, enable VBAT measurement path */ + /* Note: VBAT internal channels available on ADC1 only */ + else if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_VBAT) && (hadc->Instance == ADC1)) + { + SET_BIT(tmpADC_Common->CCR, ADC_CCR_VBATEN); + } + /* If Channel_18 is selected, enable VREFINT measurement path */ + /* Note: VrefInt internal channels available on all ADCs, but only */ + /* one ADC is allowed to be connected to VrefInt at the same */ + /* time. */ + else if (sConfigInjected->InjectedChannel == ADC_CHANNEL_VREFINT) + { + SET_BIT(tmpADC_Common->CCR, ADC_CCR_VREFEN); + } + } + /* If the requested internal measurement path has already been enabled */ + /* and other ADC of the common group are enabled, internal */ + /* measurement paths cannot be enabled. */ + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + } + + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Configures the ADC injected group and the selected channel to be + * linked to the injected group. + * @note Possibility to update parameters on the fly: + * This function initializes injected group, following calls to this + * function can be used to reconfigure some parameters of structure + * "ADC_InjectionConfTypeDef" on the fly, without resetting the ADC. + * The setting of these parameters is conditioned to ADC state: + * this function must be called when ADC is not under conversion. + * @note In case of usage of internal measurement channels: + * Vbat/VrefInt/TempSensor. + * The recommended sampling time is at least: + * - For devices STM32F37x: 17.1us for temperature sensor + * - For the other STM32F3 devices: 2.2us for each of channels + * Vbat/VrefInt/TempSensor. + * These internal paths can be be disabled using function + * HAL_ADC_DeInit(). + * @param hadc ADC handle + * @param sConfigInjected Structure of ADC injected group and ADC channel for + * injected group. + * @retval None + */ +HAL_StatusTypeDef HAL_ADCEx_InjectedConfigChannel(ADC_HandleTypeDef* hadc, ADC_InjectionConfTypeDef* sConfigInjected) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + __IO uint32_t wait_loop_index = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_CHANNEL(sConfigInjected->InjectedChannel)); + assert_param(IS_ADC_SAMPLE_TIME(sConfigInjected->InjectedSamplingTime)); + assert_param(IS_FUNCTIONAL_STATE(sConfigInjected->AutoInjectedConv)); + assert_param(IS_ADC_EXTTRIGINJEC(sConfigInjected->ExternalTrigInjecConv)); + assert_param(IS_ADC_RANGE(sConfigInjected->InjectedOffset)); + + if(hadc->Init.ScanConvMode != ADC_SCAN_DISABLE) + { + assert_param(IS_ADC_INJECTED_RANK(sConfigInjected->InjectedRank)); + assert_param(IS_ADC_INJECTED_NB_CONV(sConfigInjected->InjectedNbrOfConversion)); + assert_param(IS_FUNCTIONAL_STATE(sConfigInjected->InjectedDiscontinuousConvMode)); + } + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Configuration of injected group sequencer: */ + /* - if scan mode is disabled, injected channels sequence length is set to */ + /* 0x00: 1 channel converted (channel on regular rank 1U) */ + /* Parameter "InjectedNbrOfConversion" is discarded. */ + /* Note: Scan mode is present by hardware on this device and, if */ + /* disabled, discards automatically nb of conversions. Anyway, nb of */ + /* conversions is forced to 0x00 for alignment over all STM32 devices. */ + /* - if scan mode is enabled, injected channels sequence length is set to */ + /* parameter "InjectedNbrOfConversion". */ + if (hadc->Init.ScanConvMode == ADC_SCAN_DISABLE) + { + if (sConfigInjected->InjectedRank == ADC_INJECTED_RANK_1) + { + /* Clear the old SQx bits for all injected ranks */ + MODIFY_REG(hadc->Instance->JSQR , + ADC_JSQR_JL | + ADC_JSQR_JSQ4 | + ADC_JSQR_JSQ3 | + ADC_JSQR_JSQ2 | + ADC_JSQR_JSQ1 , + ADC_JSQR_RK_JL(sConfigInjected->InjectedChannel, + ADC_INJECTED_RANK_1, + 0x01U) ); + } + /* If another injected rank than rank1 was intended to be set, and could */ + /* not due to ScanConvMode disabled, error is reported. */ + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + } + else + { + /* Since injected channels rank conv. order depends on total number of */ + /* injected conversions, selected rank must be below or equal to total */ + /* number of injected conversions to be updated. */ + if (sConfigInjected->InjectedRank <= sConfigInjected->InjectedNbrOfConversion) + { + /* Clear the old SQx bits for the selected rank */ + /* Set the SQx bits for the selected rank */ + MODIFY_REG(hadc->Instance->JSQR , + + ADC_JSQR_JL | + ADC_JSQR_RK_JL(ADC_JSQR_JSQ1, + sConfigInjected->InjectedRank, + sConfigInjected->InjectedNbrOfConversion) , + + ADC_JSQR_JL_SHIFT(sConfigInjected->InjectedNbrOfConversion) | + ADC_JSQR_RK_JL(sConfigInjected->InjectedChannel, + sConfigInjected->InjectedRank, + sConfigInjected->InjectedNbrOfConversion) ); + } + else + { + /* Clear the old SQx bits for the selected rank */ + MODIFY_REG(hadc->Instance->JSQR , + + ADC_JSQR_JL | + ADC_JSQR_RK_JL(ADC_JSQR_JSQ1, + sConfigInjected->InjectedRank, + sConfigInjected->InjectedNbrOfConversion) , + + 0x00000000 ); + } + } + + /* Configuration of injected group */ + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated only when ADC is disabled: */ + /* - external trigger to start conversion */ + /* Parameters update not conditioned to ADC state: */ + /* - Automatic injected conversion */ + /* - Injected discontinuous mode */ + /* Note: In case of ADC already enabled, caution to not launch an unwanted */ + /* conversion while modifying register CR2 by writing 1 to bit ADON. */ + if (ADC_IS_ENABLE(hadc) == RESET) + { + MODIFY_REG(hadc->Instance->CR2 , + ADC_CR2_JEXTSEL | + ADC_CR2_ADON , + sConfigInjected->ExternalTrigInjecConv ); + } + + /* Configuration of injected group */ + /* - Automatic injected conversion */ + /* - Injected discontinuous mode */ + + /* Automatic injected conversion can be enabled if injected group */ + /* external triggers are disabled. */ + if (sConfigInjected->AutoInjectedConv == ENABLE) + { + if (sConfigInjected->ExternalTrigInjecConv == ADC_INJECTED_SOFTWARE_START) + { + SET_BIT(hadc->Instance->CR1, ADC_CR1_JAUTO); + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + } + + /* Injected discontinuous can be enabled only if auto-injected mode is */ + /* disabled. */ + if (sConfigInjected->InjectedDiscontinuousConvMode == ENABLE) + { + if (sConfigInjected->AutoInjectedConv == DISABLE) + { + SET_BIT(hadc->Instance->CR1, ADC_CR1_JDISCEN); + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + } + + + /* InjectedChannel sampling time configuration */ + /* For channels 10 to 18 */ + if (sConfigInjected->InjectedChannel > ADC_CHANNEL_10) + { + MODIFY_REG(hadc->Instance->SMPR1, + ADC_SMPR1(ADC_SMPR1_SMP10, sConfigInjected->InjectedChannel), + ADC_SMPR1(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel) ); + } + else /* For channels 1 to 9 */ + { + MODIFY_REG(hadc->Instance->SMPR2, + ADC_SMPR2(ADC_SMPR2_SMP0, sConfigInjected->InjectedChannel), + ADC_SMPR2(sConfigInjected->InjectedSamplingTime, sConfigInjected->InjectedChannel) ); + } + + + /* Configure the offset: offset enable/disable, InjectedChannel, offset value */ + switch(sConfigInjected->InjectedRank) + { + case 1: + /* Set injected channel 1 offset */ + MODIFY_REG(hadc->Instance->JOFR1, + ADC_JOFR1_JOFFSET1, + sConfigInjected->InjectedOffset); + break; + case 2: + /* Set injected channel 2 offset */ + MODIFY_REG(hadc->Instance->JOFR2, + ADC_JOFR2_JOFFSET2, + sConfigInjected->InjectedOffset); + break; + case 3: + /* Set injected channel 3 offset */ + MODIFY_REG(hadc->Instance->JOFR3, + ADC_JOFR3_JOFFSET3, + sConfigInjected->InjectedOffset); + break; + case 4: + default: + MODIFY_REG(hadc->Instance->JOFR4, + ADC_JOFR4_JOFFSET4, + sConfigInjected->InjectedOffset); + break; + } + + /* If ADC1 Channel_16 or Channel_17 is selected, enable Temperature sensor */ + /* and VREFINT measurement path. */ + if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR) || + (sConfigInjected->InjectedChannel == ADC_CHANNEL_VREFINT) ) + { + if (READ_BIT(hadc->Instance->CR2, ADC_CR2_TSVREFE) == RESET) + { + SET_BIT(hadc->Instance->CR2, ADC_CR2_TSVREFE); + + if ((sConfigInjected->InjectedChannel == ADC_CHANNEL_TEMPSENSOR)) + { + /* Delay for temperature sensor stabilization time */ + /* Compute number of CPU cycles to wait for */ + wait_loop_index = (ADC_TEMPSENSOR_DELAY_US * (SystemCoreClock / 1000000U)); + while(wait_loop_index != 0U) + { + wait_loop_index--; + } + } + } + } + /* if ADC1 Channel_18 is selected, enable VBAT measurement path */ + else if (sConfigInjected->InjectedChannel == ADC_CHANNEL_VBAT) + { + SET_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_VBAT); + } + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Configures the analog watchdog. + * @note Possibility to update parameters on the fly: + * This function initializes the selected analog watchdog, following + * calls to this function can be used to reconfigure some parameters + * of structure "ADC_AnalogWDGConfTypeDef" on the fly, without resetting + * the ADC. + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_AnalogWDGConfTypeDef". + * @param hadc ADC handle + * @param AnalogWDGConfig Structure of ADC analog watchdog configuration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + + uint32_t tmpAWDHighThresholdShifted; + uint32_t tmpAWDLowThresholdShifted; + + uint32_t tmpADCFlagAWD2orAWD3; + uint32_t tmpADCITAWD2orAWD3; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_ANALOG_WATCHDOG_NUMBER(AnalogWDGConfig->WatchdogNumber)); + assert_param(IS_ADC_ANALOG_WATCHDOG_MODE(AnalogWDGConfig->WatchdogMode)); + assert_param(IS_FUNCTIONAL_STATE(AnalogWDGConfig->ITMode)); + + /* Verify if threshold is within the selected ADC resolution */ + assert_param(IS_ADC_RANGE(ADC_GET_RESOLUTION(hadc), AnalogWDGConfig->HighThreshold)); + assert_param(IS_ADC_RANGE(ADC_GET_RESOLUTION(hadc), AnalogWDGConfig->LowThreshold)); + + if((AnalogWDGConfig->WatchdogMode == ADC_ANALOGWATCHDOG_SINGLE_REG) || + (AnalogWDGConfig->WatchdogMode == ADC_ANALOGWATCHDOG_SINGLE_INJEC) || + (AnalogWDGConfig->WatchdogMode == ADC_ANALOGWATCHDOG_SINGLE_REGINJEC) ) + { + assert_param(IS_ADC_CHANNEL(AnalogWDGConfig->Channel)); + } + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated when ADC is disabled or enabled without */ + /* conversion on going on regular and injected groups: */ + /* - Analog watchdog channels */ + /* - Analog watchdog thresholds */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED(hadc) == RESET) + { + + /* Analog watchdogs configuration */ + if(AnalogWDGConfig->WatchdogNumber == ADC_ANALOGWATCHDOG_1) + { + /* Configuration of analog watchdog: */ + /* - Set the analog watchdog enable mode: regular and/or injected */ + /* groups, one or overall group of channels. */ + /* - Set the Analog watchdog channel (is not used if watchdog */ + /* mode "all channels": ADC_CFGR_AWD1SGL=0U). */ + MODIFY_REG(hadc->Instance->CFGR , + ADC_CFGR_AWD1SGL | + ADC_CFGR_JAWD1EN | + ADC_CFGR_AWD1EN | + ADC_CFGR_AWD1CH , + AnalogWDGConfig->WatchdogMode | + ADC_CFGR_AWD1CH_SHIFT(AnalogWDGConfig->Channel) ); + + /* Shift the offset in function of the selected ADC resolution: */ + /* Thresholds have to be left-aligned on bit 11U, the LSB (right bits) */ + /* are set to 0 */ + tmpAWDHighThresholdShifted = ADC_AWD1THRESHOLD_SHIFT_RESOLUTION(hadc, AnalogWDGConfig->HighThreshold); + tmpAWDLowThresholdShifted = ADC_AWD1THRESHOLD_SHIFT_RESOLUTION(hadc, AnalogWDGConfig->LowThreshold); + + /* Set the high and low thresholds */ + MODIFY_REG(hadc->Instance->TR1 , + ADC_TR1_HT1 | + ADC_TR1_LT1 , + ADC_TRX_HIGHTHRESHOLD(tmpAWDHighThresholdShifted) | + tmpAWDLowThresholdShifted ); + + /* Clear the ADC Analog watchdog flag (in case of left enabled by */ + /* previous ADC operations) to be ready to use for HAL_ADC_IRQHandler() */ + /* or HAL_ADC_PollForEvent(). */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_IT_AWD1); + + /* Configure ADC Analog watchdog interrupt */ + if(AnalogWDGConfig->ITMode == ENABLE) + { + /* Enable the ADC Analog watchdog interrupt */ + __HAL_ADC_ENABLE_IT(hadc, ADC_IT_AWD1); + } + else + { + /* Disable the ADC Analog watchdog interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_AWD1); + } + + } + /* Case of ADC_ANALOGWATCHDOG_2 and ADC_ANALOGWATCHDOG_3 */ + else + { + /* Shift the threshold in function of the selected ADC resolution */ + /* have to be left-aligned on bit 7U, the LSB (right bits) are set to 0 */ + tmpAWDHighThresholdShifted = ADC_AWD23THRESHOLD_SHIFT_RESOLUTION(hadc, AnalogWDGConfig->HighThreshold); + tmpAWDLowThresholdShifted = ADC_AWD23THRESHOLD_SHIFT_RESOLUTION(hadc, AnalogWDGConfig->LowThreshold); + + if (AnalogWDGConfig->WatchdogNumber == ADC_ANALOGWATCHDOG_2) + { + /* Set the Analog watchdog channel or group of channels. This also */ + /* enables the watchdog. */ + /* Note: Conditional register reset, because several channels can be */ + /* set by successive calls of this function. */ + if (AnalogWDGConfig->WatchdogMode != ADC_ANALOGWATCHDOG_NONE) + { + /* Set the high and low thresholds */ + MODIFY_REG(hadc->Instance->TR2 , + ADC_TR2_HT2 | + ADC_TR2_LT2 , + ADC_TRX_HIGHTHRESHOLD(tmpAWDHighThresholdShifted) | + tmpAWDLowThresholdShifted ); + + SET_BIT(hadc->Instance->AWD2CR, ADC_CFGR_AWD23CR(AnalogWDGConfig->Channel)); + } + else + { + CLEAR_BIT(hadc->Instance->TR2, ADC_TR2_HT2 | ADC_TR2_LT2); + CLEAR_BIT(hadc->Instance->AWD2CR, ADC_AWD2CR_AWD2CH); + } + + /* Set temporary variable to flag and IT of AWD2 or AWD3 for further */ + /* settings. */ + tmpADCFlagAWD2orAWD3 = ADC_FLAG_AWD2; + tmpADCITAWD2orAWD3 = ADC_IT_AWD2; + } + /* (AnalogWDGConfig->WatchdogNumber == ADC_ANALOGWATCHDOG_3) */ + else + { + /* Set the Analog watchdog channel or group of channels. This also */ + /* enables the watchdog. */ + /* Note: Conditional register reset, because several channels can be */ + /* set by successive calls of this function. */ + if (AnalogWDGConfig->WatchdogMode != ADC_ANALOGWATCHDOG_NONE) + { + /* Set the high and low thresholds */ + MODIFY_REG(hadc->Instance->TR3 , + ADC_TR3_HT3 | + ADC_TR3_LT3 , + ADC_TRX_HIGHTHRESHOLD(tmpAWDHighThresholdShifted) | + tmpAWDLowThresholdShifted ); + + SET_BIT(hadc->Instance->AWD3CR, ADC_CFGR_AWD23CR(AnalogWDGConfig->Channel)); + } + else + { + CLEAR_BIT(hadc->Instance->TR3, ADC_TR3_HT3 | ADC_TR3_LT3); + CLEAR_BIT(hadc->Instance->AWD3CR, ADC_AWD3CR_AWD3CH); + } + + /* Set temporary variable to flag and IT of AWD2 or AWD3 for further */ + /* settings. */ + tmpADCFlagAWD2orAWD3 = ADC_FLAG_AWD3; + tmpADCITAWD2orAWD3 = ADC_IT_AWD3; + } + + /* Clear the ADC Analog watchdog flag (in case of left enabled by */ + /* previous ADC operations) to be ready to use for HAL_ADC_IRQHandler() */ + /* or HAL_ADC_PollForEvent(). */ + __HAL_ADC_CLEAR_FLAG(hadc, tmpADCFlagAWD2orAWD3); + + /* Configure ADC Analog watchdog interrupt */ + if(AnalogWDGConfig->ITMode == ENABLE) + { + __HAL_ADC_ENABLE_IT(hadc, tmpADCITAWD2orAWD3); + } + else + { + __HAL_ADC_DISABLE_IT(hadc, tmpADCITAWD2orAWD3); + } + } + + } + /* If a conversion is on going on regular or injected groups, no update */ + /* could be done on neither of the AWD configuration structure parameters. */ + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Configures the analog watchdog. + * @note Analog watchdog thresholds can be modified while ADC conversion + * is on going. + * In this case, some constraints must be taken into account: + * the programmed threshold values are effective from the next + * ADC EOC (end of unitary conversion). + * Considering that registers write delay may happen due to + * bus activity, this might cause an uncertainty on the + * effective timing of the new programmed threshold values. + * @param hadc ADC handle + * @param AnalogWDGConfig Structure of ADC analog watchdog configuration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADC_AnalogWDGConfig(ADC_HandleTypeDef* hadc, ADC_AnalogWDGConfTypeDef* AnalogWDGConfig) +{ + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_ANALOG_WATCHDOG_MODE(AnalogWDGConfig->WatchdogMode)); + assert_param(IS_FUNCTIONAL_STATE(AnalogWDGConfig->ITMode)); + assert_param(IS_ADC_RANGE(AnalogWDGConfig->HighThreshold)); + assert_param(IS_ADC_RANGE(AnalogWDGConfig->LowThreshold)); + + if((AnalogWDGConfig->WatchdogMode == ADC_ANALOGWATCHDOG_SINGLE_REG) || + (AnalogWDGConfig->WatchdogMode == ADC_ANALOGWATCHDOG_SINGLE_INJEC) || + (AnalogWDGConfig->WatchdogMode == ADC_ANALOGWATCHDOG_SINGLE_REGINJEC) ) + { + assert_param(IS_ADC_CHANNEL(AnalogWDGConfig->Channel)); + } + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Analog watchdog configuration */ + + /* Configure ADC Analog watchdog interrupt */ + if(AnalogWDGConfig->ITMode == ENABLE) + { + /* Enable the ADC Analog watchdog interrupt */ + __HAL_ADC_ENABLE_IT(hadc, ADC_IT_AWD); + } + else + { + /* Disable the ADC Analog watchdog interrupt */ + __HAL_ADC_DISABLE_IT(hadc, ADC_IT_AWD); + } + + /* Configuration of analog watchdog: */ + /* - Set the analog watchdog enable mode: regular and/or injected groups, */ + /* one or all channels. */ + /* - Set the Analog watchdog channel (is not used if watchdog */ + /* mode "all channels": ADC_CFGR_AWD1SGL=0U). */ + MODIFY_REG(hadc->Instance->CR1 , + ADC_CR1_AWDSGL | + ADC_CR1_JAWDEN | + ADC_CR1_AWDEN | + ADC_CR1_AWDCH , + AnalogWDGConfig->WatchdogMode | + AnalogWDGConfig->Channel ); + + /* Set the high threshold */ + WRITE_REG(hadc->Instance->HTR, AnalogWDGConfig->HighThreshold); + + /* Set the low threshold */ + WRITE_REG(hadc->Instance->LTR, AnalogWDGConfig->LowThreshold); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return HAL_OK; +} +#endif /* STM32F373xC || STM32F378xx */ + + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) +/** + * @brief Enable ADC multimode and configure multimode parameters + * @note Possibility to update parameters on the fly: + * This function initializes multimode parameters, following + * calls to this function can be used to reconfigure some parameters + * of structure "ADC_MultiModeTypeDef" on the fly, without resetting + * the ADCs (both ADCs of the common group). + * The setting of these parameters is conditioned to ADC state. + * For parameters constraints, see comments of structure + * "ADC_MultiModeTypeDef". + * @note To change back configuration from multimode to single mode, ADC must + * be reset (using function HAL_ADC_Init() ). + * @param hadc ADC handle + * @param multimode Structure of ADC multimode configuration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_ADCEx_MultiModeConfigChannel(ADC_HandleTypeDef* hadc, ADC_MultiModeTypeDef* multimode) +{ + HAL_StatusTypeDef tmp_hal_status = HAL_OK; + ADC_Common_TypeDef *tmpADC_Common; + ADC_HandleTypeDef tmphadcSharingSameCommonRegister; + + /* Check the parameters */ + assert_param(IS_ADC_MULTIMODE_MASTER_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_MODE(multimode->Mode)); + if(multimode->Mode != ADC_MODE_INDEPENDENT) + { + assert_param(IS_ADC_DMA_ACCESS_MODE(multimode->DMAAccessMode)); + assert_param(IS_ADC_SAMPLING_DELAY(multimode->TwoSamplingDelay)); + } + + /* Set handle of the other ADC sharing the same common register */ + ADC_COMMON_ADC_OTHER(hadc, &tmphadcSharingSameCommonRegister); + if (tmphadcSharingSameCommonRegister.Instance == NULL) + { + /* Return function status */ + return HAL_ERROR; + } + + /* Process locked */ + __HAL_LOCK(hadc); + + /* Parameters update conditioned to ADC state: */ + /* Parameters that can be updated when ADC is disabled or enabled without */ + /* conversion on going on regular group: */ + /* - Multimode DMA configuration */ + /* - Multimode DMA mode */ + if ( (ADC_IS_CONVERSION_ONGOING_REGULAR(hadc) == RESET) + && (ADC_IS_CONVERSION_ONGOING_REGULAR(&tmphadcSharingSameCommonRegister) == RESET) ) + { + /* Pointer to the common control register to which is belonging hadc */ + /* (Depending on STM32F3 product, there may have up to 4 ADC and 2 common */ + /* control registers) */ + tmpADC_Common = ADC_COMMON_REGISTER(hadc); + + /* If multimode is selected, configure all multimode parameters. */ + /* Otherwise, reset multimode parameters (can be used in case of */ + /* transition from multimode to independent mode). */ + if(multimode->Mode != ADC_MODE_INDEPENDENT) + { + /* Configuration of ADC common group ADC1&ADC2, ADC3&ADC4 if available */ + /* (ADC2, ADC3, ADC4 availability depends on STM32 product) */ + /* - DMA access mode */ + MODIFY_REG(tmpADC_Common->CCR , + ADC_CCR_MDMA | + ADC_CCR_DMACFG , + multimode->DMAAccessMode | + ADC_CCR_MULTI_DMACONTREQ((uint32_t)hadc->Init.DMAContinuousRequests) ); + + /* Parameters that can be updated only when ADC is disabled: */ + /* - Multimode mode selection */ + /* - Set delay between two sampling phases */ + /* Note: Delay range depends on selected resolution: */ + /* from 1 to 12 clock cycles for 12 bits */ + /* from 1 to 10 clock cycles for 10 bits, */ + /* from 1 to 8 clock cycles for 8 bits */ + /* from 1 to 6 clock cycles for 6 bits */ + /* If a higher delay is selected, it will be clamped to maximum delay */ + /* range */ + /* Note: If ADC is not in the appropriate state to modify these */ + /* parameters, their setting is bypassed without error reporting */ + /* (as it can be the expected behaviour in case of intended action */ + /* to update parameter above (which fulfills the ADC state */ + /* condition: no conversion on going on group regular) */ + /* on the fly). */ + if ((ADC_IS_ENABLE(hadc) == RESET) && + (ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) ) + { + MODIFY_REG(tmpADC_Common->CCR , + ADC_CCR_MULTI | + ADC_CCR_DELAY , + multimode->Mode | + multimode->TwoSamplingDelay ); + } + } + else /* ADC_MODE_INDEPENDENT */ + { + CLEAR_BIT(tmpADC_Common->CCR, ADC_CCR_MDMA | ADC_CCR_DMACFG); + + /* Parameters that can be updated only when ADC is disabled: */ + /* - Multimode mode selection */ + /* - Multimode delay */ + if ((ADC_IS_ENABLE(hadc) == RESET) && + (ADC_IS_ENABLE(&tmphadcSharingSameCommonRegister) == RESET) ) + { + CLEAR_BIT(tmpADC_Common->CCR, ADC_CCR_MULTI | ADC_CCR_DELAY); + } + } + } + /* If one of the ADC sharing the same common group is enabled, no update */ + /* could be done on neither of the multimode structure parameters. */ + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_CONFIG); + + tmp_hal_status = HAL_ERROR; + } + + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + /* Return function status */ + return tmp_hal_status; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F328xx || STM32F334x8 */ + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup ADCEx_Private_Functions ADCEx Private Functions + * @{ + */ +/** + * @brief DMA transfer complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +static void ADC_DMAConvCplt(DMA_HandleTypeDef *hdma) +{ + /* Retrieve ADC handle corresponding to current DMA handle */ + ADC_HandleTypeDef* hadc = ( ADC_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Update state machine on conversion status if not in error state */ + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL | HAL_ADC_STATE_ERROR_DMA)) + { + /* Update ADC state machine */ + SET_BIT(hadc->State, HAL_ADC_STATE_REG_EOC); + + /* Determine whether any further conversion upcoming on group regular */ + /* by external trigger, continuous mode or scan sequence on going. */ + /* Note: On STM32F3 devices, in case of sequencer enabled */ + /* (several ranks selected), end of conversion flag is raised */ + /* at the end of the sequence. */ + if(ADC_IS_SOFTWARE_START_REGULAR(hadc) && + (hadc->Init.ContinuousConvMode == DISABLE) ) + { + /* Set ADC state */ + CLEAR_BIT(hadc->State, HAL_ADC_STATE_REG_BUSY); + + if (HAL_IS_BIT_CLR(hadc->State, HAL_ADC_STATE_INJ_BUSY)) + { + SET_BIT(hadc->State, HAL_ADC_STATE_READY); + } + } + + /* Conversion complete callback */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->ConvCpltCallback(hadc); +#else + HAL_ADC_ConvCpltCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ + } + else + { + /* Call DMA error callback */ + hadc->DMA_Handle->XferErrorCallback(hdma); + } +} + +/** + * @brief DMA half transfer complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +static void ADC_DMAHalfConvCplt(DMA_HandleTypeDef *hdma) +{ + /* Retrieve ADC handle corresponding to current DMA handle */ + ADC_HandleTypeDef* hadc = ( ADC_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Half conversion callback */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->ConvHalfCpltCallback(hadc); +#else + HAL_ADC_ConvHalfCpltCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ +} + +/** + * @brief DMA error callback + * @param hdma pointer to DMA handle. + * @retval None + */ +static void ADC_DMAError(DMA_HandleTypeDef *hdma) +{ + /* Retrieve ADC handle corresponding to current DMA handle */ + ADC_HandleTypeDef* hadc = ( ADC_HandleTypeDef* )((DMA_HandleTypeDef* )hdma)->Parent; + + /* Set ADC state */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_DMA); + + /* Set ADC error code to DMA error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_DMA); + + /* Error callback */ +#if (USE_HAL_ADC_REGISTER_CALLBACKS == 1) + hadc->ErrorCallback(hadc); +#else + HAL_ADC_ErrorCallback(hadc); +#endif /* USE_HAL_ADC_REGISTER_CALLBACKS */ +} + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \ + defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \ + defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ + defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) +/** + * @brief Enable the selected ADC. + * @note Prerequisite condition to use this function: ADC must be disabled + * and voltage regulator must be enabled (done into HAL_ADC_Init()). + * @param hadc ADC handle + * @retval HAL status. + */ +static HAL_StatusTypeDef ADC_Enable(ADC_HandleTypeDef* hadc) +{ + uint32_t tickstart = 0U; + + /* ADC enable and wait for ADC ready (in case of ADC is disabled or */ + /* enabling phase not yet completed: flag ADC ready not yet set). */ + /* Timeout implemented to not be stuck if ADC cannot be enabled (possible */ + /* causes: ADC clock not running, ...). */ + if (ADC_IS_ENABLE(hadc) == RESET) + { + /* Check if conditions to enable the ADC are fulfilled */ + if (ADC_ENABLING_CONDITIONS(hadc) == RESET) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + return HAL_ERROR; + } + + /* Enable the ADC peripheral */ + __HAL_ADC_ENABLE(hadc); + + /* Wait for ADC effectively enabled */ + tickstart = HAL_GetTick(); + + while(__HAL_ADC_GET_FLAG(hadc, ADC_FLAG_RDY) == RESET) + { + if((HAL_GetTick() - tickstart) > ADC_ENABLE_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(__HAL_ADC_GET_FLAG(hadc, ADC_FLAG_RDY) == RESET) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + return HAL_ERROR; + } + } + } + } + + /* Return HAL status */ + return HAL_OK; +} + +/** + * @brief Disable the selected ADC. + * @note Prerequisite condition to use this function: ADC conversions must be + * stopped. + * @param hadc ADC handle + * @retval HAL status. + */ +static HAL_StatusTypeDef ADC_Disable(ADC_HandleTypeDef* hadc) +{ + uint32_t tickstart = 0U; + + /* Verification if ADC is not already disabled: */ + /* Note: forbidden to disable ADC (set bit ADC_CR_ADDIS) if ADC is already */ + /* disabled. */ + if (ADC_IS_ENABLE(hadc) != RESET ) + { + /* Check if conditions to disable the ADC are fulfilled */ + if (ADC_DISABLING_CONDITIONS(hadc) != RESET) + { + /* Disable the ADC peripheral */ + __HAL_ADC_DISABLE(hadc); + } + else + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + return HAL_ERROR; + } + + /* Wait for ADC effectively disabled */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_ADEN)) + { + if((HAL_GetTick() - tickstart) > ADC_DISABLE_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_ADEN)) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + return HAL_ERROR; + } + } + } + } + + /* Return HAL status */ + return HAL_OK; +} + + +/** + * @brief Stop ADC conversion. + * @param hadc ADC handle + * @param ConversionGroup ADC group regular and/or injected. + * This parameter can be one of the following values: + * @arg ADC_REGULAR_GROUP: ADC regular conversion type. + * @arg ADC_INJECTED_GROUP: ADC injected conversion type. + * @arg ADC_REGULAR_INJECTED_GROUP: ADC regular and injected conversion type. + * @retval HAL status. + */ +static HAL_StatusTypeDef ADC_ConversionStop(ADC_HandleTypeDef* hadc, uint32_t ConversionGroup) +{ + uint32_t tmp_ADC_CR_ADSTART_JADSTART = 0U; + uint32_t tickstart = 0U; + uint32_t Conversion_Timeout_CPU_cycles = 0U; + + /* Check the parameters */ + assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); + assert_param(IS_ADC_CONVERSION_GROUP(ConversionGroup)); + + /* Verification if ADC is not already stopped (on regular and injected */ + /* groups) to bypass this function if not needed. */ + if (ADC_IS_CONVERSION_ONGOING_REGULAR_INJECTED(hadc)) + { + /* Particular case of continuous auto-injection mode combined with */ + /* auto-delay mode. */ + /* In auto-injection mode, regular group stop ADC_CR_ADSTP is used (not */ + /* injected group stop ADC_CR_JADSTP). */ + /* Procedure to be followed: Wait until JEOS=1U, clear JEOS, set ADSTP=1 */ + /* (see reference manual). */ + if ((HAL_IS_BIT_SET(hadc->Instance->CFGR, ADC_CFGR_JAUTO)) && + (hadc->Init.ContinuousConvMode==ENABLE) && + (hadc->Init.LowPowerAutoWait==ENABLE) ) + { + /* Use stop of regular group */ + ConversionGroup = ADC_REGULAR_GROUP; + + /* Wait until JEOS=1 (maximum Timeout: 4 injected conversions) */ + while(__HAL_ADC_GET_FLAG(hadc, ADC_FLAG_JEOS) == RESET) + { + if (Conversion_Timeout_CPU_cycles >= (ADC_CONVERSION_TIME_MAX_CPU_CYCLES *4U)) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + return HAL_ERROR; + } + Conversion_Timeout_CPU_cycles ++; + } + + /* Clear JEOS */ + __HAL_ADC_CLEAR_FLAG(hadc, ADC_FLAG_JEOS); + } + + /* Stop potential conversion on going on regular group */ + if (ConversionGroup != ADC_INJECTED_GROUP) + { + /* Software is allowed to set ADSTP only when ADSTART=1 and ADDIS=0U */ + if (HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_ADSTART) && + HAL_IS_BIT_CLR(hadc->Instance->CR, ADC_CR_ADDIS) ) + { + /* Stop conversions on regular group */ + hadc->Instance->CR |= ADC_CR_ADSTP; + } + } + + /* Stop potential conversion on going on injected group */ + if (ConversionGroup != ADC_REGULAR_GROUP) + { + /* Software is allowed to set JADSTP only when JADSTART=1 and ADDIS=0U */ + if (HAL_IS_BIT_SET(hadc->Instance->CR, ADC_CR_JADSTART) && + HAL_IS_BIT_CLR(hadc->Instance->CR, ADC_CR_ADDIS) ) + { + /* Stop conversions on injected group */ + hadc->Instance->CR |= ADC_CR_JADSTP; + } + } + + /* Selection of start and stop bits in function of regular or injected group */ + switch(ConversionGroup) + { + case ADC_REGULAR_INJECTED_GROUP: + tmp_ADC_CR_ADSTART_JADSTART = (ADC_CR_ADSTART | ADC_CR_JADSTART); + break; + case ADC_INJECTED_GROUP: + tmp_ADC_CR_ADSTART_JADSTART = ADC_CR_JADSTART; + break; + /* Case ADC_REGULAR_GROUP */ + default: + tmp_ADC_CR_ADSTART_JADSTART = ADC_CR_ADSTART; + break; + } + + /* Wait for conversion effectively stopped */ + tickstart = HAL_GetTick(); + + while((hadc->Instance->CR & tmp_ADC_CR_ADSTART_JADSTART) != RESET) + { + if((HAL_GetTick() - tickstart) > ADC_STOP_CONVERSION_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if((hadc->Instance->CR & tmp_ADC_CR_ADSTART_JADSTART) != RESET) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + return HAL_ERROR; + } + } + } + } + + /* Return HAL status */ + return HAL_OK; +} +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) +/** + * @brief Enable the selected ADC. + * @note Prerequisite condition to use this function: ADC must be disabled + * and voltage regulator must be enabled (done into HAL_ADC_Init()). + * @param hadc ADC handle + * @retval HAL status. + */ +static HAL_StatusTypeDef ADC_Enable(ADC_HandleTypeDef* hadc) +{ + uint32_t tickstart = 0U; + __IO uint32_t wait_loop_index = 0U; + + /* ADC enable and wait for ADC ready (in case of ADC is disabled or */ + /* enabling phase not yet completed: flag ADC ready not yet set). */ + /* Timeout implemented to not be stuck if ADC cannot be enabled (possible */ + /* causes: ADC clock not running, ...). */ + if (ADC_IS_ENABLE(hadc) == RESET) + { + /* Enable the Peripheral */ + __HAL_ADC_ENABLE(hadc); + + /* Delay for ADC stabilization time */ + /* Compute number of CPU cycles to wait for */ + wait_loop_index = (ADC_STAB_DELAY_US * (SystemCoreClock / 1000000U)); + while(wait_loop_index != 0U) + { + wait_loop_index--; + } + + /* Get tick count */ + tickstart = HAL_GetTick(); + + /* Wait for ADC effectively enabled */ + while(ADC_IS_ENABLE(hadc) == RESET) + { + if((HAL_GetTick() - tickstart) > ADC_ENABLE_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(ADC_IS_ENABLE(hadc) == RESET) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + /* Process unlocked */ + __HAL_UNLOCK(hadc); + + return HAL_ERROR; + } + } + } + } + + /* Return HAL status */ + return HAL_OK; +} + +/** + * @brief Stop ADC conversion and disable the selected ADC + * @param hadc ADC handle + * @retval HAL status. + */ +static HAL_StatusTypeDef ADC_ConversionStop_Disable(ADC_HandleTypeDef* hadc) +{ + uint32_t tickstart = 0U; + + /* Verification if ADC is not already disabled: */ + if (ADC_IS_ENABLE(hadc) != RESET) + { + /* Disable the ADC peripheral */ + __HAL_ADC_DISABLE(hadc); + + /* Get tick count */ + tickstart = HAL_GetTick(); + + /* Wait for ADC effectively disabled */ + while(ADC_IS_ENABLE(hadc) != RESET) + { + if((HAL_GetTick() - tickstart) > ADC_DISABLE_TIMEOUT) + { + /* New check to avoid false timeout detection in case of preemption */ + if(ADC_IS_ENABLE(hadc) != RESET) + { + /* Update ADC state machine to error */ + SET_BIT(hadc->State, HAL_ADC_STATE_ERROR_INTERNAL); + + /* Set ADC error code to ADC IP internal error */ + SET_BIT(hadc->ErrorCode, HAL_ADC_ERROR_INTERNAL); + + return HAL_ERROR; + } + } + } + } + + /* Return HAL status */ + return HAL_OK; +} +#endif /* STM32F373xC || STM32F378xx */ +/** + * @} + */ + +#endif /* HAL_ADC_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c new file mode 100644 index 0000000..1d572f3 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_can.c @@ -0,0 +1,2421 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_can.c + * @author MCD Application Team + * @brief CAN HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Controller Area Network (CAN) peripheral: + * + Initialization and de-initialization functions + * + Configuration functions + * + Control functions + * + Interrupts management + * + Callbacks functions + * + Peripheral State and Error functions + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + (#) Initialize the CAN low level resources by implementing the + HAL_CAN_MspInit(): + (++) Enable the CAN interface clock using __HAL_RCC_CANx_CLK_ENABLE() + (++) Configure CAN pins + (+++) Enable the clock for the CAN GPIOs + (+++) Configure CAN pins as alternate function open-drain + (++) In case of using interrupts (e.g. HAL_CAN_ActivateNotification()) + (+++) Configure the CAN interrupt priority using + HAL_NVIC_SetPriority() + (+++) Enable the CAN IRQ handler using HAL_NVIC_EnableIRQ() + (+++) In CAN IRQ handler, call HAL_CAN_IRQHandler() + + (#) Initialize the CAN peripheral using HAL_CAN_Init() function. This + function resorts to HAL_CAN_MspInit() for low-level initialization. + + (#) Configure the reception filters using the following configuration + functions: + (++) HAL_CAN_ConfigFilter() + + (#) Start the CAN module using HAL_CAN_Start() function. At this level + the node is active on the bus: it receive messages, and can send + messages. + + (#) To manage messages transmission, the following Tx control functions + can be used: + (++) HAL_CAN_AddTxMessage() to request transmission of a new + message. + (++) HAL_CAN_AbortTxRequest() to abort transmission of a pending + message. + (++) HAL_CAN_GetTxMailboxesFreeLevel() to get the number of free Tx + mailboxes. + (++) HAL_CAN_IsTxMessagePending() to check if a message is pending + in a Tx mailbox. + (++) HAL_CAN_GetTxTimestamp() to get the timestamp of Tx message + sent, if time triggered communication mode is enabled. + + (#) When a message is received into the CAN Rx FIFOs, it can be retrieved + using the HAL_CAN_GetRxMessage() function. The function + HAL_CAN_GetRxFifoFillLevel() allows to know how many Rx message are + stored in the Rx Fifo. + + (#) Calling the HAL_CAN_Stop() function stops the CAN module. + + (#) The deinitialization is achieved with HAL_CAN_DeInit() function. + + + *** Polling mode operation *** + ============================== + [..] + (#) Reception: + (++) Monitor reception of message using HAL_CAN_GetRxFifoFillLevel() + until at least one message is received. + (++) Then get the message using HAL_CAN_GetRxMessage(). + + (#) Transmission: + (++) Monitor the Tx mailboxes availability until at least one Tx + mailbox is free, using HAL_CAN_GetTxMailboxesFreeLevel(). + (++) Then request transmission of a message using + HAL_CAN_AddTxMessage(). + + + *** Interrupt mode operation *** + ================================ + [..] + (#) Notifications are activated using HAL_CAN_ActivateNotification() + function. Then, the process can be controlled through the + available user callbacks: HAL_CAN_xxxCallback(), using same APIs + HAL_CAN_GetRxMessage() and HAL_CAN_AddTxMessage(). + + (#) Notifications can be deactivated using + HAL_CAN_DeactivateNotification() function. + + (#) Special care should be taken for CAN_IT_RX_FIFO0_MSG_PENDING and + CAN_IT_RX_FIFO1_MSG_PENDING notifications. These notifications trig + the callbacks HAL_CAN_RxFIFO0MsgPendingCallback() and + HAL_CAN_RxFIFO1MsgPendingCallback(). User has two possible options + here. + (++) Directly get the Rx message in the callback, using + HAL_CAN_GetRxMessage(). + (++) Or deactivate the notification in the callback without + getting the Rx message. The Rx message can then be got later + using HAL_CAN_GetRxMessage(). Once the Rx message have been + read, the notification can be activated again. + + + *** Sleep mode *** + ================== + [..] + (#) The CAN peripheral can be put in sleep mode (low power), using + HAL_CAN_RequestSleep(). The sleep mode will be entered as soon as the + current CAN activity (transmission or reception of a CAN frame) will + be completed. + + (#) A notification can be activated to be informed when the sleep mode + will be entered. + + (#) It can be checked if the sleep mode is entered using + HAL_CAN_IsSleepActive(). + Note that the CAN state (accessible from the API HAL_CAN_GetState()) + is HAL_CAN_STATE_SLEEP_PENDING as soon as the sleep mode request is + submitted (the sleep mode is not yet entered), and become + HAL_CAN_STATE_SLEEP_ACTIVE when the sleep mode is effective. + + (#) The wake-up from sleep mode can be triggered by two ways: + (++) Using HAL_CAN_WakeUp(). When returning from this function, + the sleep mode is exited (if return status is HAL_OK). + (++) When a start of Rx CAN frame is detected by the CAN peripheral, + if automatic wake up mode is enabled. + + *** Callback registration *** + ============================================= + + The compilation define USE_HAL_CAN_REGISTER_CALLBACKS when set to 1 + allows the user to configure dynamically the driver callbacks. + Use Function HAL_CAN_RegisterCallback() to register an interrupt callback. + + Function HAL_CAN_RegisterCallback() allows to register following callbacks: + (+) TxMailbox0CompleteCallback : Tx Mailbox 0 Complete Callback. + (+) TxMailbox1CompleteCallback : Tx Mailbox 1 Complete Callback. + (+) TxMailbox2CompleteCallback : Tx Mailbox 2 Complete Callback. + (+) TxMailbox0AbortCallback : Tx Mailbox 0 Abort Callback. + (+) TxMailbox1AbortCallback : Tx Mailbox 1 Abort Callback. + (+) TxMailbox2AbortCallback : Tx Mailbox 2 Abort Callback. + (+) RxFifo0MsgPendingCallback : Rx Fifo 0 Message Pending Callback. + (+) RxFifo0FullCallback : Rx Fifo 0 Full Callback. + (+) RxFifo1MsgPendingCallback : Rx Fifo 1 Message Pending Callback. + (+) RxFifo1FullCallback : Rx Fifo 1 Full Callback. + (+) SleepCallback : Sleep Callback. + (+) WakeUpFromRxMsgCallback : Wake Up From Rx Message Callback. + (+) ErrorCallback : Error Callback. + (+) MspInitCallback : CAN MspInit. + (+) MspDeInitCallback : CAN MspDeInit. + This function takes as parameters the HAL peripheral handle, the Callback ID + and a pointer to the user callback function. + + Use function HAL_CAN_UnRegisterCallback() to reset a callback to the default + weak function. + HAL_CAN_UnRegisterCallback takes as parameters the HAL peripheral handle, + and the Callback ID. + This function allows to reset following callbacks: + (+) TxMailbox0CompleteCallback : Tx Mailbox 0 Complete Callback. + (+) TxMailbox1CompleteCallback : Tx Mailbox 1 Complete Callback. + (+) TxMailbox2CompleteCallback : Tx Mailbox 2 Complete Callback. + (+) TxMailbox0AbortCallback : Tx Mailbox 0 Abort Callback. + (+) TxMailbox1AbortCallback : Tx Mailbox 1 Abort Callback. + (+) TxMailbox2AbortCallback : Tx Mailbox 2 Abort Callback. + (+) RxFifo0MsgPendingCallback : Rx Fifo 0 Message Pending Callback. + (+) RxFifo0FullCallback : Rx Fifo 0 Full Callback. + (+) RxFifo1MsgPendingCallback : Rx Fifo 1 Message Pending Callback. + (+) RxFifo1FullCallback : Rx Fifo 1 Full Callback. + (+) SleepCallback : Sleep Callback. + (+) WakeUpFromRxMsgCallback : Wake Up From Rx Message Callback. + (+) ErrorCallback : Error Callback. + (+) MspInitCallback : CAN MspInit. + (+) MspDeInitCallback : CAN MspDeInit. + + By default, after the HAL_CAN_Init() and when the state is HAL_CAN_STATE_RESET, + all callbacks are set to the corresponding weak functions: + example HAL_CAN_ErrorCallback(). + Exception done for MspInit and MspDeInit functions that are + reset to the legacy weak function in the HAL_CAN_Init()/ HAL_CAN_DeInit() only when + these callbacks are null (not registered beforehand). + if not, MspInit or MspDeInit are not null, the HAL_CAN_Init()/ HAL_CAN_DeInit() + keep and use the user MspInit/MspDeInit callbacks (registered beforehand) + + Callbacks can be registered/unregistered in HAL_CAN_STATE_READY state only. + Exception done MspInit/MspDeInit that can be registered/unregistered + in HAL_CAN_STATE_READY or HAL_CAN_STATE_RESET state, + thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit. + In that case first register the MspInit/MspDeInit user callbacks + using HAL_CAN_RegisterCallback() before calling HAL_CAN_DeInit() + or HAL_CAN_Init() function. + + When The compilation define USE_HAL_CAN_REGISTER_CALLBACKS is set to 0 or + not defined, the callback registration feature is not available and all callbacks + are set to the corresponding weak functions. + + @endverbatim + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +#if defined(CAN) + +/** @defgroup CAN CAN + * @brief CAN driver modules + * @{ + */ + +#ifdef HAL_CAN_MODULE_ENABLED + +#ifdef HAL_CAN_LEGACY_MODULE_ENABLED +#error "The CAN driver cannot be used with its legacy, Please enable only one CAN module at once" +#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup CAN_Private_Constants CAN Private Constants + * @{ + */ +#define CAN_TIMEOUT_VALUE 10U +/** + * @} + */ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup CAN_Exported_Functions CAN Exported Functions + * @{ + */ + +/** @defgroup CAN_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim + ============================================================================== + ##### Initialization and de-initialization functions ##### + ============================================================================== + [..] This section provides functions allowing to: + (+) HAL_CAN_Init : Initialize and configure the CAN. + (+) HAL_CAN_DeInit : De-initialize the CAN. + (+) HAL_CAN_MspInit : Initialize the CAN MSP. + (+) HAL_CAN_MspDeInit : DeInitialize the CAN MSP. + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the CAN peripheral according to the specified + * parameters in the CAN_InitStruct. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef *hcan) +{ + uint32_t tickstart; + + /* Check CAN handle */ + if (hcan == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_CAN_ALL_INSTANCE(hcan->Instance)); + assert_param(IS_FUNCTIONAL_STATE(hcan->Init.TimeTriggeredMode)); + assert_param(IS_FUNCTIONAL_STATE(hcan->Init.AutoBusOff)); + assert_param(IS_FUNCTIONAL_STATE(hcan->Init.AutoWakeUp)); + assert_param(IS_FUNCTIONAL_STATE(hcan->Init.AutoRetransmission)); + assert_param(IS_FUNCTIONAL_STATE(hcan->Init.ReceiveFifoLocked)); + assert_param(IS_FUNCTIONAL_STATE(hcan->Init.TransmitFifoPriority)); + assert_param(IS_CAN_MODE(hcan->Init.Mode)); + assert_param(IS_CAN_SJW(hcan->Init.SyncJumpWidth)); + assert_param(IS_CAN_BS1(hcan->Init.TimeSeg1)); + assert_param(IS_CAN_BS2(hcan->Init.TimeSeg2)); + assert_param(IS_CAN_PRESCALER(hcan->Init.Prescaler)); + +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + if (hcan->State == HAL_CAN_STATE_RESET) + { + /* Reset callbacks to legacy functions */ + hcan->RxFifo0MsgPendingCallback = HAL_CAN_RxFifo0MsgPendingCallback; /* Legacy weak RxFifo0MsgPendingCallback */ + hcan->RxFifo0FullCallback = HAL_CAN_RxFifo0FullCallback; /* Legacy weak RxFifo0FullCallback */ + hcan->RxFifo1MsgPendingCallback = HAL_CAN_RxFifo1MsgPendingCallback; /* Legacy weak RxFifo1MsgPendingCallback */ + hcan->RxFifo1FullCallback = HAL_CAN_RxFifo1FullCallback; /* Legacy weak RxFifo1FullCallback */ + hcan->TxMailbox0CompleteCallback = HAL_CAN_TxMailbox0CompleteCallback; /* Legacy weak TxMailbox0CompleteCallback */ + hcan->TxMailbox1CompleteCallback = HAL_CAN_TxMailbox1CompleteCallback; /* Legacy weak TxMailbox1CompleteCallback */ + hcan->TxMailbox2CompleteCallback = HAL_CAN_TxMailbox2CompleteCallback; /* Legacy weak TxMailbox2CompleteCallback */ + hcan->TxMailbox0AbortCallback = HAL_CAN_TxMailbox0AbortCallback; /* Legacy weak TxMailbox0AbortCallback */ + hcan->TxMailbox1AbortCallback = HAL_CAN_TxMailbox1AbortCallback; /* Legacy weak TxMailbox1AbortCallback */ + hcan->TxMailbox2AbortCallback = HAL_CAN_TxMailbox2AbortCallback; /* Legacy weak TxMailbox2AbortCallback */ + hcan->SleepCallback = HAL_CAN_SleepCallback; /* Legacy weak SleepCallback */ + hcan->WakeUpFromRxMsgCallback = HAL_CAN_WakeUpFromRxMsgCallback; /* Legacy weak WakeUpFromRxMsgCallback */ + hcan->ErrorCallback = HAL_CAN_ErrorCallback; /* Legacy weak ErrorCallback */ + + if (hcan->MspInitCallback == NULL) + { + hcan->MspInitCallback = HAL_CAN_MspInit; /* Legacy weak MspInit */ + } + + /* Init the low level hardware: CLOCK, NVIC */ + hcan->MspInitCallback(hcan); + } + +#else + if (hcan->State == HAL_CAN_STATE_RESET) + { + /* Init the low level hardware: CLOCK, NVIC */ + HAL_CAN_MspInit(hcan); + } +#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */ + + /* Request initialisation */ + SET_BIT(hcan->Instance->MCR, CAN_MCR_INRQ); + + /* Get tick */ + tickstart = HAL_GetTick(); + + /* Wait initialisation acknowledge */ + while ((hcan->Instance->MSR & CAN_MSR_INAK) == 0U) + { + if ((HAL_GetTick() - tickstart) > CAN_TIMEOUT_VALUE) + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_TIMEOUT; + + /* Change CAN state */ + hcan->State = HAL_CAN_STATE_ERROR; + + return HAL_ERROR; + } + } + + /* Exit from sleep mode */ + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_SLEEP); + + /* Get tick */ + tickstart = HAL_GetTick(); + + /* Check Sleep mode leave acknowledge */ + while ((hcan->Instance->MSR & CAN_MSR_SLAK) != 0U) + { + if ((HAL_GetTick() - tickstart) > CAN_TIMEOUT_VALUE) + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_TIMEOUT; + + /* Change CAN state */ + hcan->State = HAL_CAN_STATE_ERROR; + + return HAL_ERROR; + } + } + + /* Set the time triggered communication mode */ + if (hcan->Init.TimeTriggeredMode == ENABLE) + { + SET_BIT(hcan->Instance->MCR, CAN_MCR_TTCM); + } + else + { + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_TTCM); + } + + /* Set the automatic bus-off management */ + if (hcan->Init.AutoBusOff == ENABLE) + { + SET_BIT(hcan->Instance->MCR, CAN_MCR_ABOM); + } + else + { + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_ABOM); + } + + /* Set the automatic wake-up mode */ + if (hcan->Init.AutoWakeUp == ENABLE) + { + SET_BIT(hcan->Instance->MCR, CAN_MCR_AWUM); + } + else + { + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_AWUM); + } + + /* Set the automatic retransmission */ + if (hcan->Init.AutoRetransmission == ENABLE) + { + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_NART); + } + else + { + SET_BIT(hcan->Instance->MCR, CAN_MCR_NART); + } + + /* Set the receive FIFO locked mode */ + if (hcan->Init.ReceiveFifoLocked == ENABLE) + { + SET_BIT(hcan->Instance->MCR, CAN_MCR_RFLM); + } + else + { + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_RFLM); + } + + /* Set the transmit FIFO priority */ + if (hcan->Init.TransmitFifoPriority == ENABLE) + { + SET_BIT(hcan->Instance->MCR, CAN_MCR_TXFP); + } + else + { + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_TXFP); + } + + /* Set the bit timing register */ + WRITE_REG(hcan->Instance->BTR, (uint32_t)(hcan->Init.Mode | + hcan->Init.SyncJumpWidth | + hcan->Init.TimeSeg1 | + hcan->Init.TimeSeg2 | + (hcan->Init.Prescaler - 1U))); + + /* Initialize the error code */ + hcan->ErrorCode = HAL_CAN_ERROR_NONE; + + /* Initialize the CAN state */ + hcan->State = HAL_CAN_STATE_READY; + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Deinitializes the CAN peripheral registers to their default + * reset values. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_DeInit(CAN_HandleTypeDef *hcan) +{ + /* Check CAN handle */ + if (hcan == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_CAN_ALL_INSTANCE(hcan->Instance)); + + /* Stop the CAN module */ + (void)HAL_CAN_Stop(hcan); + +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + if (hcan->MspDeInitCallback == NULL) + { + hcan->MspDeInitCallback = HAL_CAN_MspDeInit; /* Legacy weak MspDeInit */ + } + + /* DeInit the low level hardware: CLOCK, NVIC */ + hcan->MspDeInitCallback(hcan); + +#else + /* DeInit the low level hardware: CLOCK, NVIC */ + HAL_CAN_MspDeInit(hcan); +#endif /* (USE_HAL_CAN_REGISTER_CALLBACKS) */ + + /* Reset the CAN peripheral */ + SET_BIT(hcan->Instance->MCR, CAN_MCR_RESET); + + /* Reset the CAN ErrorCode */ + hcan->ErrorCode = HAL_CAN_ERROR_NONE; + + /* Change CAN state */ + hcan->State = HAL_CAN_STATE_RESET; + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Initializes the CAN MSP. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_MspInit(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes the CAN MSP. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_MspDeInit(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_MspDeInit could be implemented in the user file + */ +} + +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 +/** + * @brief Register a CAN CallBack. + * To be used instead of the weak predefined callback + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for CAN module + * @param CallbackID ID of the callback to be registered + * This parameter can be one of the following values: + * @arg @ref HAL_CAN_TX_MAILBOX0_COMPLETE_CB_ID Tx Mailbox 0 Complete callback ID + * @arg @ref HAL_CAN_TX_MAILBOX1_COMPLETE_CB_ID Tx Mailbox 1 Complete callback ID + * @arg @ref HAL_CAN_TX_MAILBOX2_COMPLETE_CB_ID Tx Mailbox 2 Complete callback ID + * @arg @ref HAL_CAN_TX_MAILBOX0_ABORT_CB_ID Tx Mailbox 0 Abort callback ID + * @arg @ref HAL_CAN_TX_MAILBOX1_ABORT_CB_ID Tx Mailbox 1 Abort callback ID + * @arg @ref HAL_CAN_TX_MAILBOX2_ABORT_CB_ID Tx Mailbox 2 Abort callback ID + * @arg @ref HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID Rx Fifo 0 message pending callback ID + * @arg @ref HAL_CAN_RX_FIFO0_FULL_CB_ID Rx Fifo 0 full callback ID + * @arg @ref HAL_CAN_RX_FIFO1_MSG_PENDING_CB_ID Rx Fifo 1 message pending callback ID + * @arg @ref HAL_CAN_RX_FIFO1_FULL_CB_ID Rx Fifo 1 full callback ID + * @arg @ref HAL_CAN_SLEEP_CB_ID Sleep callback ID + * @arg @ref HAL_CAN_WAKEUP_FROM_RX_MSG_CB_ID Wake Up from Rx message callback ID + * @arg @ref HAL_CAN_ERROR_CB_ID Error callback ID + * @arg @ref HAL_CAN_MSPINIT_CB_ID MspInit callback ID + * @arg @ref HAL_CAN_MSPDEINIT_CB_ID MspDeInit callback ID + * @param pCallback pointer to the Callback function + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_RegisterCallback(CAN_HandleTypeDef *hcan, HAL_CAN_CallbackIDTypeDef CallbackID, + void (* pCallback)(CAN_HandleTypeDef *_hcan)) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (pCallback == NULL) + { + /* Update the error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_INVALID_CALLBACK; + + return HAL_ERROR; + } + + if (hcan->State == HAL_CAN_STATE_READY) + { + switch (CallbackID) + { + case HAL_CAN_TX_MAILBOX0_COMPLETE_CB_ID : + hcan->TxMailbox0CompleteCallback = pCallback; + break; + + case HAL_CAN_TX_MAILBOX1_COMPLETE_CB_ID : + hcan->TxMailbox1CompleteCallback = pCallback; + break; + + case HAL_CAN_TX_MAILBOX2_COMPLETE_CB_ID : + hcan->TxMailbox2CompleteCallback = pCallback; + break; + + case HAL_CAN_TX_MAILBOX0_ABORT_CB_ID : + hcan->TxMailbox0AbortCallback = pCallback; + break; + + case HAL_CAN_TX_MAILBOX1_ABORT_CB_ID : + hcan->TxMailbox1AbortCallback = pCallback; + break; + + case HAL_CAN_TX_MAILBOX2_ABORT_CB_ID : + hcan->TxMailbox2AbortCallback = pCallback; + break; + + case HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID : + hcan->RxFifo0MsgPendingCallback = pCallback; + break; + + case HAL_CAN_RX_FIFO0_FULL_CB_ID : + hcan->RxFifo0FullCallback = pCallback; + break; + + case HAL_CAN_RX_FIFO1_MSG_PENDING_CB_ID : + hcan->RxFifo1MsgPendingCallback = pCallback; + break; + + case HAL_CAN_RX_FIFO1_FULL_CB_ID : + hcan->RxFifo1FullCallback = pCallback; + break; + + case HAL_CAN_SLEEP_CB_ID : + hcan->SleepCallback = pCallback; + break; + + case HAL_CAN_WAKEUP_FROM_RX_MSG_CB_ID : + hcan->WakeUpFromRxMsgCallback = pCallback; + break; + + case HAL_CAN_ERROR_CB_ID : + hcan->ErrorCallback = pCallback; + break; + + case HAL_CAN_MSPINIT_CB_ID : + hcan->MspInitCallback = pCallback; + break; + + case HAL_CAN_MSPDEINIT_CB_ID : + hcan->MspDeInitCallback = pCallback; + break; + + default : + /* Update the error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else if (hcan->State == HAL_CAN_STATE_RESET) + { + switch (CallbackID) + { + case HAL_CAN_MSPINIT_CB_ID : + hcan->MspInitCallback = pCallback; + break; + + case HAL_CAN_MSPDEINIT_CB_ID : + hcan->MspDeInitCallback = pCallback; + break; + + default : + /* Update the error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else + { + /* Update the error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} + +/** + * @brief Unregister a CAN CallBack. + * CAN callback is redirected to the weak predefined callback + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for CAN module + * @param CallbackID ID of the callback to be unregistered + * This parameter can be one of the following values: + * @arg @ref HAL_CAN_TX_MAILBOX0_COMPLETE_CB_ID Tx Mailbox 0 Complete callback ID + * @arg @ref HAL_CAN_TX_MAILBOX1_COMPLETE_CB_ID Tx Mailbox 1 Complete callback ID + * @arg @ref HAL_CAN_TX_MAILBOX2_COMPLETE_CB_ID Tx Mailbox 2 Complete callback ID + * @arg @ref HAL_CAN_TX_MAILBOX0_ABORT_CB_ID Tx Mailbox 0 Abort callback ID + * @arg @ref HAL_CAN_TX_MAILBOX1_ABORT_CB_ID Tx Mailbox 1 Abort callback ID + * @arg @ref HAL_CAN_TX_MAILBOX2_ABORT_CB_ID Tx Mailbox 2 Abort callback ID + * @arg @ref HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID Rx Fifo 0 message pending callback ID + * @arg @ref HAL_CAN_RX_FIFO0_FULL_CB_ID Rx Fifo 0 full callback ID + * @arg @ref HAL_CAN_RX_FIFO1_MSG_PENDING_CB_ID Rx Fifo 1 message pending callback ID + * @arg @ref HAL_CAN_RX_FIFO1_FULL_CB_ID Rx Fifo 1 full callback ID + * @arg @ref HAL_CAN_SLEEP_CB_ID Sleep callback ID + * @arg @ref HAL_CAN_WAKEUP_FROM_RX_MSG_CB_ID Wake Up from Rx message callback ID + * @arg @ref HAL_CAN_ERROR_CB_ID Error callback ID + * @arg @ref HAL_CAN_MSPINIT_CB_ID MspInit callback ID + * @arg @ref HAL_CAN_MSPDEINIT_CB_ID MspDeInit callback ID + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_UnRegisterCallback(CAN_HandleTypeDef *hcan, HAL_CAN_CallbackIDTypeDef CallbackID) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (hcan->State == HAL_CAN_STATE_READY) + { + switch (CallbackID) + { + case HAL_CAN_TX_MAILBOX0_COMPLETE_CB_ID : + hcan->TxMailbox0CompleteCallback = HAL_CAN_TxMailbox0CompleteCallback; + break; + + case HAL_CAN_TX_MAILBOX1_COMPLETE_CB_ID : + hcan->TxMailbox1CompleteCallback = HAL_CAN_TxMailbox1CompleteCallback; + break; + + case HAL_CAN_TX_MAILBOX2_COMPLETE_CB_ID : + hcan->TxMailbox2CompleteCallback = HAL_CAN_TxMailbox2CompleteCallback; + break; + + case HAL_CAN_TX_MAILBOX0_ABORT_CB_ID : + hcan->TxMailbox0AbortCallback = HAL_CAN_TxMailbox0AbortCallback; + break; + + case HAL_CAN_TX_MAILBOX1_ABORT_CB_ID : + hcan->TxMailbox1AbortCallback = HAL_CAN_TxMailbox1AbortCallback; + break; + + case HAL_CAN_TX_MAILBOX2_ABORT_CB_ID : + hcan->TxMailbox2AbortCallback = HAL_CAN_TxMailbox2AbortCallback; + break; + + case HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID : + hcan->RxFifo0MsgPendingCallback = HAL_CAN_RxFifo0MsgPendingCallback; + break; + + case HAL_CAN_RX_FIFO0_FULL_CB_ID : + hcan->RxFifo0FullCallback = HAL_CAN_RxFifo0FullCallback; + break; + + case HAL_CAN_RX_FIFO1_MSG_PENDING_CB_ID : + hcan->RxFifo1MsgPendingCallback = HAL_CAN_RxFifo1MsgPendingCallback; + break; + + case HAL_CAN_RX_FIFO1_FULL_CB_ID : + hcan->RxFifo1FullCallback = HAL_CAN_RxFifo1FullCallback; + break; + + case HAL_CAN_SLEEP_CB_ID : + hcan->SleepCallback = HAL_CAN_SleepCallback; + break; + + case HAL_CAN_WAKEUP_FROM_RX_MSG_CB_ID : + hcan->WakeUpFromRxMsgCallback = HAL_CAN_WakeUpFromRxMsgCallback; + break; + + case HAL_CAN_ERROR_CB_ID : + hcan->ErrorCallback = HAL_CAN_ErrorCallback; + break; + + case HAL_CAN_MSPINIT_CB_ID : + hcan->MspInitCallback = HAL_CAN_MspInit; + break; + + case HAL_CAN_MSPDEINIT_CB_ID : + hcan->MspDeInitCallback = HAL_CAN_MspDeInit; + break; + + default : + /* Update the error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else if (hcan->State == HAL_CAN_STATE_RESET) + { + switch (CallbackID) + { + case HAL_CAN_MSPINIT_CB_ID : + hcan->MspInitCallback = HAL_CAN_MspInit; + break; + + case HAL_CAN_MSPDEINIT_CB_ID : + hcan->MspDeInitCallback = HAL_CAN_MspDeInit; + break; + + default : + /* Update the error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else + { + /* Update the error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/** @defgroup CAN_Exported_Functions_Group2 Configuration functions + * @brief Configuration functions. + * +@verbatim + ============================================================================== + ##### Configuration functions ##### + ============================================================================== + [..] This section provides functions allowing to: + (+) HAL_CAN_ConfigFilter : Configure the CAN reception filters + +@endverbatim + * @{ + */ + +/** + * @brief Configures the CAN reception filter according to the specified + * parameters in the CAN_FilterInitStruct. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param sFilterConfig pointer to a CAN_FilterTypeDef structure that + * contains the filter configuration information. + * @retval None + */ +HAL_StatusTypeDef HAL_CAN_ConfigFilter(CAN_HandleTypeDef *hcan, const CAN_FilterTypeDef *sFilterConfig) +{ + uint32_t filternbrbitpos; + CAN_TypeDef *can_ip = hcan->Instance; + HAL_CAN_StateTypeDef state = hcan->State; + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Check the parameters */ + assert_param(IS_CAN_FILTER_ID_HALFWORD(sFilterConfig->FilterIdHigh)); + assert_param(IS_CAN_FILTER_ID_HALFWORD(sFilterConfig->FilterIdLow)); + assert_param(IS_CAN_FILTER_ID_HALFWORD(sFilterConfig->FilterMaskIdHigh)); + assert_param(IS_CAN_FILTER_ID_HALFWORD(sFilterConfig->FilterMaskIdLow)); + assert_param(IS_CAN_FILTER_MODE(sFilterConfig->FilterMode)); + assert_param(IS_CAN_FILTER_SCALE(sFilterConfig->FilterScale)); + assert_param(IS_CAN_FILTER_FIFO(sFilterConfig->FilterFIFOAssignment)); + assert_param(IS_CAN_FILTER_ACTIVATION(sFilterConfig->FilterActivation)); + + /* CAN is single instance with 14 dedicated filters banks */ + + /* Check the parameters */ + assert_param(IS_CAN_FILTER_BANK_SINGLE(sFilterConfig->FilterBank)); + + /* Initialisation mode for the filter */ + SET_BIT(can_ip->FMR, CAN_FMR_FINIT); + + /* Convert filter number into bit position */ + filternbrbitpos = (uint32_t)1 << (sFilterConfig->FilterBank & 0x1FU); + + /* Filter Deactivation */ + CLEAR_BIT(can_ip->FA1R, filternbrbitpos); + + /* Filter Scale */ + if (sFilterConfig->FilterScale == CAN_FILTERSCALE_16BIT) + { + /* 16-bit scale for the filter */ + CLEAR_BIT(can_ip->FS1R, filternbrbitpos); + + /* First 16-bit identifier and First 16-bit mask */ + /* Or First 16-bit identifier and Second 16-bit identifier */ + can_ip->sFilterRegister[sFilterConfig->FilterBank].FR1 = + ((0x0000FFFFU & (uint32_t)sFilterConfig->FilterMaskIdLow) << 16U) | + (0x0000FFFFU & (uint32_t)sFilterConfig->FilterIdLow); + + /* Second 16-bit identifier and Second 16-bit mask */ + /* Or Third 16-bit identifier and Fourth 16-bit identifier */ + can_ip->sFilterRegister[sFilterConfig->FilterBank].FR2 = + ((0x0000FFFFU & (uint32_t)sFilterConfig->FilterMaskIdHigh) << 16U) | + (0x0000FFFFU & (uint32_t)sFilterConfig->FilterIdHigh); + } + + if (sFilterConfig->FilterScale == CAN_FILTERSCALE_32BIT) + { + /* 32-bit scale for the filter */ + SET_BIT(can_ip->FS1R, filternbrbitpos); + + /* 32-bit identifier or First 32-bit identifier */ + can_ip->sFilterRegister[sFilterConfig->FilterBank].FR1 = + ((0x0000FFFFU & (uint32_t)sFilterConfig->FilterIdHigh) << 16U) | + (0x0000FFFFU & (uint32_t)sFilterConfig->FilterIdLow); + + /* 32-bit mask or Second 32-bit identifier */ + can_ip->sFilterRegister[sFilterConfig->FilterBank].FR2 = + ((0x0000FFFFU & (uint32_t)sFilterConfig->FilterMaskIdHigh) << 16U) | + (0x0000FFFFU & (uint32_t)sFilterConfig->FilterMaskIdLow); + } + + /* Filter Mode */ + if (sFilterConfig->FilterMode == CAN_FILTERMODE_IDMASK) + { + /* Id/Mask mode for the filter*/ + CLEAR_BIT(can_ip->FM1R, filternbrbitpos); + } + else /* CAN_FilterInitStruct->CAN_FilterMode == CAN_FilterMode_IdList */ + { + /* Identifier list mode for the filter*/ + SET_BIT(can_ip->FM1R, filternbrbitpos); + } + + /* Filter FIFO assignment */ + if (sFilterConfig->FilterFIFOAssignment == CAN_FILTER_FIFO0) + { + /* FIFO 0 assignation for the filter */ + CLEAR_BIT(can_ip->FFA1R, filternbrbitpos); + } + else + { + /* FIFO 1 assignation for the filter */ + SET_BIT(can_ip->FFA1R, filternbrbitpos); + } + + /* Filter activation */ + if (sFilterConfig->FilterActivation == CAN_FILTER_ENABLE) + { + SET_BIT(can_ip->FA1R, filternbrbitpos); + } + + /* Leave the initialisation mode for the filter */ + CLEAR_BIT(can_ip->FMR, CAN_FMR_FINIT); + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + return HAL_ERROR; + } +} + +/** + * @} + */ + +/** @defgroup CAN_Exported_Functions_Group3 Control functions + * @brief Control functions + * +@verbatim + ============================================================================== + ##### Control functions ##### + ============================================================================== + [..] This section provides functions allowing to: + (+) HAL_CAN_Start : Start the CAN module + (+) HAL_CAN_Stop : Stop the CAN module + (+) HAL_CAN_RequestSleep : Request sleep mode entry. + (+) HAL_CAN_WakeUp : Wake up from sleep mode. + (+) HAL_CAN_IsSleepActive : Check is sleep mode is active. + (+) HAL_CAN_AddTxMessage : Add a message to the Tx mailboxes + and activate the corresponding + transmission request + (+) HAL_CAN_AbortTxRequest : Abort transmission request + (+) HAL_CAN_GetTxMailboxesFreeLevel : Return Tx mailboxes free level + (+) HAL_CAN_IsTxMessagePending : Check if a transmission request is + pending on the selected Tx mailbox + (+) HAL_CAN_GetRxMessage : Get a CAN frame from the Rx FIFO + (+) HAL_CAN_GetRxFifoFillLevel : Return Rx FIFO fill level + +@endverbatim + * @{ + */ + +/** + * @brief Start the CAN module. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_Start(CAN_HandleTypeDef *hcan) +{ + uint32_t tickstart; + + if (hcan->State == HAL_CAN_STATE_READY) + { + /* Change CAN peripheral state */ + hcan->State = HAL_CAN_STATE_LISTENING; + + /* Request leave initialisation */ + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_INRQ); + + /* Get tick */ + tickstart = HAL_GetTick(); + + /* Wait the acknowledge */ + while ((hcan->Instance->MSR & CAN_MSR_INAK) != 0U) + { + /* Check for the Timeout */ + if ((HAL_GetTick() - tickstart) > CAN_TIMEOUT_VALUE) + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_TIMEOUT; + + /* Change CAN state */ + hcan->State = HAL_CAN_STATE_ERROR; + + return HAL_ERROR; + } + } + + /* Reset the CAN ErrorCode */ + hcan->ErrorCode = HAL_CAN_ERROR_NONE; + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_READY; + + return HAL_ERROR; + } +} + +/** + * @brief Stop the CAN module and enable access to configuration registers. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_Stop(CAN_HandleTypeDef *hcan) +{ + uint32_t tickstart; + + if (hcan->State == HAL_CAN_STATE_LISTENING) + { + /* Request initialisation */ + SET_BIT(hcan->Instance->MCR, CAN_MCR_INRQ); + + /* Get tick */ + tickstart = HAL_GetTick(); + + /* Wait the acknowledge */ + while ((hcan->Instance->MSR & CAN_MSR_INAK) == 0U) + { + /* Check for the Timeout */ + if ((HAL_GetTick() - tickstart) > CAN_TIMEOUT_VALUE) + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_TIMEOUT; + + /* Change CAN state */ + hcan->State = HAL_CAN_STATE_ERROR; + + return HAL_ERROR; + } + } + + /* Exit from sleep mode */ + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_SLEEP); + + /* Change CAN peripheral state */ + hcan->State = HAL_CAN_STATE_READY; + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_STARTED; + + return HAL_ERROR; + } +} + +/** + * @brief Request the sleep mode (low power) entry. + * When returning from this function, Sleep mode will be entered + * as soon as the current CAN activity (transmission or reception + * of a CAN frame) has been completed. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_CAN_RequestSleep(CAN_HandleTypeDef *hcan) +{ + HAL_CAN_StateTypeDef state = hcan->State; + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Request Sleep mode */ + SET_BIT(hcan->Instance->MCR, CAN_MCR_SLEEP); + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + /* Return function status */ + return HAL_ERROR; + } +} + +/** + * @brief Wake up from sleep mode. + * When returning with HAL_OK status from this function, Sleep mode + * is exited. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_CAN_WakeUp(CAN_HandleTypeDef *hcan) +{ + __IO uint32_t count = 0; + uint32_t timeout = 1000000U; + HAL_CAN_StateTypeDef state = hcan->State; + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Wake up request */ + CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_SLEEP); + + /* Wait sleep mode is exited */ + do + { + /* Increment counter */ + count++; + + /* Check if timeout is reached */ + if (count > timeout) + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_TIMEOUT; + + return HAL_ERROR; + } + } + while ((hcan->Instance->MSR & CAN_MSR_SLAK) != 0U); + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + return HAL_ERROR; + } +} + +/** + * @brief Check is sleep mode is active. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval Status + * - 0 : Sleep mode is not active. + * - 1 : Sleep mode is active. + */ +uint32_t HAL_CAN_IsSleepActive(const CAN_HandleTypeDef *hcan) +{ + uint32_t status = 0U; + HAL_CAN_StateTypeDef state = hcan->State; + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Check Sleep mode */ + if ((hcan->Instance->MSR & CAN_MSR_SLAK) != 0U) + { + status = 1U; + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Add a message to the first free Tx mailbox and activate the + * corresponding transmission request. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param pHeader pointer to a CAN_TxHeaderTypeDef structure. + * @param aData array containing the payload of the Tx frame. + * @param pTxMailbox pointer to a variable where the function will return + * the TxMailbox used to store the Tx message. + * This parameter can be a value of @arg CAN_Tx_Mailboxes. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_AddTxMessage(CAN_HandleTypeDef *hcan, const CAN_TxHeaderTypeDef *pHeader, + const uint8_t aData[], uint32_t *pTxMailbox) +{ + uint32_t transmitmailbox; + HAL_CAN_StateTypeDef state = hcan->State; + uint32_t tsr = READ_REG(hcan->Instance->TSR); + + /* Check the parameters */ + assert_param(IS_CAN_IDTYPE(pHeader->IDE)); + assert_param(IS_CAN_RTR(pHeader->RTR)); + assert_param(IS_CAN_DLC(pHeader->DLC)); + if (pHeader->IDE == CAN_ID_STD) + { + assert_param(IS_CAN_STDID(pHeader->StdId)); + } + else + { + assert_param(IS_CAN_EXTID(pHeader->ExtId)); + } + assert_param(IS_FUNCTIONAL_STATE(pHeader->TransmitGlobalTime)); + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Check that all the Tx mailboxes are not full */ + if (((tsr & CAN_TSR_TME0) != 0U) || + ((tsr & CAN_TSR_TME1) != 0U) || + ((tsr & CAN_TSR_TME2) != 0U)) + { + /* Select an empty transmit mailbox */ + transmitmailbox = (tsr & CAN_TSR_CODE) >> CAN_TSR_CODE_Pos; + + /* Store the Tx mailbox */ + *pTxMailbox = (uint32_t)1 << transmitmailbox; + + /* Set up the Id */ + if (pHeader->IDE == CAN_ID_STD) + { + hcan->Instance->sTxMailBox[transmitmailbox].TIR = ((pHeader->StdId << CAN_TI0R_STID_Pos) | + pHeader->RTR); + } + else + { + hcan->Instance->sTxMailBox[transmitmailbox].TIR = ((pHeader->ExtId << CAN_TI0R_EXID_Pos) | + pHeader->IDE | + pHeader->RTR); + } + + /* Set up the DLC */ + hcan->Instance->sTxMailBox[transmitmailbox].TDTR = (pHeader->DLC); + + /* Set up the Transmit Global Time mode */ + if (pHeader->TransmitGlobalTime == ENABLE) + { + SET_BIT(hcan->Instance->sTxMailBox[transmitmailbox].TDTR, CAN_TDT0R_TGT); + } + + /* Set up the data field */ + WRITE_REG(hcan->Instance->sTxMailBox[transmitmailbox].TDHR, + ((uint32_t)aData[7] << CAN_TDH0R_DATA7_Pos) | + ((uint32_t)aData[6] << CAN_TDH0R_DATA6_Pos) | + ((uint32_t)aData[5] << CAN_TDH0R_DATA5_Pos) | + ((uint32_t)aData[4] << CAN_TDH0R_DATA4_Pos)); + WRITE_REG(hcan->Instance->sTxMailBox[transmitmailbox].TDLR, + ((uint32_t)aData[3] << CAN_TDL0R_DATA3_Pos) | + ((uint32_t)aData[2] << CAN_TDL0R_DATA2_Pos) | + ((uint32_t)aData[1] << CAN_TDL0R_DATA1_Pos) | + ((uint32_t)aData[0] << CAN_TDL0R_DATA0_Pos)); + + /* Request transmission */ + SET_BIT(hcan->Instance->sTxMailBox[transmitmailbox].TIR, CAN_TI0R_TXRQ); + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_PARAM; + + return HAL_ERROR; + } + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + return HAL_ERROR; + } +} + +/** + * @brief Abort transmission requests + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param TxMailboxes List of the Tx Mailboxes to abort. + * This parameter can be any combination of @arg CAN_Tx_Mailboxes. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_AbortTxRequest(CAN_HandleTypeDef *hcan, uint32_t TxMailboxes) +{ + HAL_CAN_StateTypeDef state = hcan->State; + + /* Check function parameters */ + assert_param(IS_CAN_TX_MAILBOX_LIST(TxMailboxes)); + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Check Tx Mailbox 0 */ + if ((TxMailboxes & CAN_TX_MAILBOX0) != 0U) + { + /* Add cancellation request for Tx Mailbox 0 */ + SET_BIT(hcan->Instance->TSR, CAN_TSR_ABRQ0); + } + + /* Check Tx Mailbox 1 */ + if ((TxMailboxes & CAN_TX_MAILBOX1) != 0U) + { + /* Add cancellation request for Tx Mailbox 1 */ + SET_BIT(hcan->Instance->TSR, CAN_TSR_ABRQ1); + } + + /* Check Tx Mailbox 2 */ + if ((TxMailboxes & CAN_TX_MAILBOX2) != 0U) + { + /* Add cancellation request for Tx Mailbox 2 */ + SET_BIT(hcan->Instance->TSR, CAN_TSR_ABRQ2); + } + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + return HAL_ERROR; + } +} + +/** + * @brief Return Tx Mailboxes free level: number of free Tx Mailboxes. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval Number of free Tx Mailboxes. + */ +uint32_t HAL_CAN_GetTxMailboxesFreeLevel(const CAN_HandleTypeDef *hcan) +{ + uint32_t freelevel = 0U; + HAL_CAN_StateTypeDef state = hcan->State; + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Check Tx Mailbox 0 status */ + if ((hcan->Instance->TSR & CAN_TSR_TME0) != 0U) + { + freelevel++; + } + + /* Check Tx Mailbox 1 status */ + if ((hcan->Instance->TSR & CAN_TSR_TME1) != 0U) + { + freelevel++; + } + + /* Check Tx Mailbox 2 status */ + if ((hcan->Instance->TSR & CAN_TSR_TME2) != 0U) + { + freelevel++; + } + } + + /* Return Tx Mailboxes free level */ + return freelevel; +} + +/** + * @brief Check if a transmission request is pending on the selected Tx + * Mailboxes. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param TxMailboxes List of Tx Mailboxes to check. + * This parameter can be any combination of @arg CAN_Tx_Mailboxes. + * @retval Status + * - 0 : No pending transmission request on any selected Tx Mailboxes. + * - 1 : Pending transmission request on at least one of the selected + * Tx Mailbox. + */ +uint32_t HAL_CAN_IsTxMessagePending(const CAN_HandleTypeDef *hcan, uint32_t TxMailboxes) +{ + uint32_t status = 0U; + HAL_CAN_StateTypeDef state = hcan->State; + + /* Check function parameters */ + assert_param(IS_CAN_TX_MAILBOX_LIST(TxMailboxes)); + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Check pending transmission request on the selected Tx Mailboxes */ + if ((hcan->Instance->TSR & (TxMailboxes << CAN_TSR_TME0_Pos)) != (TxMailboxes << CAN_TSR_TME0_Pos)) + { + status = 1U; + } + } + + /* Return status */ + return status; +} + +/** + * @brief Return timestamp of Tx message sent, if time triggered communication + mode is enabled. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param TxMailbox Tx Mailbox where the timestamp of message sent will be + * read. + * This parameter can be one value of @arg CAN_Tx_Mailboxes. + * @retval Timestamp of message sent from Tx Mailbox. + */ +uint32_t HAL_CAN_GetTxTimestamp(const CAN_HandleTypeDef *hcan, uint32_t TxMailbox) +{ + uint32_t timestamp = 0U; + uint32_t transmitmailbox; + HAL_CAN_StateTypeDef state = hcan->State; + + /* Check function parameters */ + assert_param(IS_CAN_TX_MAILBOX(TxMailbox)); + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Select the Tx mailbox */ + transmitmailbox = POSITION_VAL(TxMailbox); + + /* Get timestamp */ + timestamp = (hcan->Instance->sTxMailBox[transmitmailbox].TDTR & CAN_TDT0R_TIME) >> CAN_TDT0R_TIME_Pos; + } + + /* Return the timestamp */ + return timestamp; +} + +/** + * @brief Get an CAN frame from the Rx FIFO zone into the message RAM. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param RxFifo Fifo number of the received message to be read. + * This parameter can be a value of @arg CAN_receive_FIFO_number. + * @param pHeader pointer to a CAN_RxHeaderTypeDef structure where the header + * of the Rx frame will be stored. + * @param aData array where the payload of the Rx frame will be stored. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_GetRxMessage(CAN_HandleTypeDef *hcan, uint32_t RxFifo, + CAN_RxHeaderTypeDef *pHeader, uint8_t aData[]) +{ + HAL_CAN_StateTypeDef state = hcan->State; + + assert_param(IS_CAN_RX_FIFO(RxFifo)); + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Check the Rx FIFO */ + if (RxFifo == CAN_RX_FIFO0) /* Rx element is assigned to Rx FIFO 0 */ + { + /* Check that the Rx FIFO 0 is not empty */ + if ((hcan->Instance->RF0R & CAN_RF0R_FMP0) == 0U) + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_PARAM; + + return HAL_ERROR; + } + } + else /* Rx element is assigned to Rx FIFO 1 */ + { + /* Check that the Rx FIFO 1 is not empty */ + if ((hcan->Instance->RF1R & CAN_RF1R_FMP1) == 0U) + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_PARAM; + + return HAL_ERROR; + } + } + + /* Get the header */ + pHeader->IDE = CAN_RI0R_IDE & hcan->Instance->sFIFOMailBox[RxFifo].RIR; + if (pHeader->IDE == CAN_ID_STD) + { + pHeader->StdId = (CAN_RI0R_STID & hcan->Instance->sFIFOMailBox[RxFifo].RIR) >> CAN_TI0R_STID_Pos; + } + else + { + pHeader->ExtId = ((CAN_RI0R_EXID | CAN_RI0R_STID) & + hcan->Instance->sFIFOMailBox[RxFifo].RIR) >> CAN_RI0R_EXID_Pos; + } + pHeader->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[RxFifo].RIR); + if (((CAN_RDT0R_DLC & hcan->Instance->sFIFOMailBox[RxFifo].RDTR) >> CAN_RDT0R_DLC_Pos) >= 8U) + { + /* Truncate DLC to 8 if received field is over range */ + pHeader->DLC = 8U; + } + else + { + pHeader->DLC = (CAN_RDT0R_DLC & hcan->Instance->sFIFOMailBox[RxFifo].RDTR) >> CAN_RDT0R_DLC_Pos; + } + pHeader->FilterMatchIndex = (CAN_RDT0R_FMI & hcan->Instance->sFIFOMailBox[RxFifo].RDTR) >> CAN_RDT0R_FMI_Pos; + pHeader->Timestamp = (CAN_RDT0R_TIME & hcan->Instance->sFIFOMailBox[RxFifo].RDTR) >> CAN_RDT0R_TIME_Pos; + + /* Get the data */ + aData[0] = (uint8_t)((CAN_RDL0R_DATA0 & hcan->Instance->sFIFOMailBox[RxFifo].RDLR) >> CAN_RDL0R_DATA0_Pos); + aData[1] = (uint8_t)((CAN_RDL0R_DATA1 & hcan->Instance->sFIFOMailBox[RxFifo].RDLR) >> CAN_RDL0R_DATA1_Pos); + aData[2] = (uint8_t)((CAN_RDL0R_DATA2 & hcan->Instance->sFIFOMailBox[RxFifo].RDLR) >> CAN_RDL0R_DATA2_Pos); + aData[3] = (uint8_t)((CAN_RDL0R_DATA3 & hcan->Instance->sFIFOMailBox[RxFifo].RDLR) >> CAN_RDL0R_DATA3_Pos); + aData[4] = (uint8_t)((CAN_RDH0R_DATA4 & hcan->Instance->sFIFOMailBox[RxFifo].RDHR) >> CAN_RDH0R_DATA4_Pos); + aData[5] = (uint8_t)((CAN_RDH0R_DATA5 & hcan->Instance->sFIFOMailBox[RxFifo].RDHR) >> CAN_RDH0R_DATA5_Pos); + aData[6] = (uint8_t)((CAN_RDH0R_DATA6 & hcan->Instance->sFIFOMailBox[RxFifo].RDHR) >> CAN_RDH0R_DATA6_Pos); + aData[7] = (uint8_t)((CAN_RDH0R_DATA7 & hcan->Instance->sFIFOMailBox[RxFifo].RDHR) >> CAN_RDH0R_DATA7_Pos); + + /* Release the FIFO */ + if (RxFifo == CAN_RX_FIFO0) /* Rx element is assigned to Rx FIFO 0 */ + { + /* Release RX FIFO 0 */ + SET_BIT(hcan->Instance->RF0R, CAN_RF0R_RFOM0); + } + else /* Rx element is assigned to Rx FIFO 1 */ + { + /* Release RX FIFO 1 */ + SET_BIT(hcan->Instance->RF1R, CAN_RF1R_RFOM1); + } + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + return HAL_ERROR; + } +} + +/** + * @brief Return Rx FIFO fill level. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param RxFifo Rx FIFO. + * This parameter can be a value of @arg CAN_receive_FIFO_number. + * @retval Number of messages available in Rx FIFO. + */ +uint32_t HAL_CAN_GetRxFifoFillLevel(const CAN_HandleTypeDef *hcan, uint32_t RxFifo) +{ + uint32_t filllevel = 0U; + HAL_CAN_StateTypeDef state = hcan->State; + + /* Check function parameters */ + assert_param(IS_CAN_RX_FIFO(RxFifo)); + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + if (RxFifo == CAN_RX_FIFO0) + { + filllevel = hcan->Instance->RF0R & CAN_RF0R_FMP0; + } + else /* RxFifo == CAN_RX_FIFO1 */ + { + filllevel = hcan->Instance->RF1R & CAN_RF1R_FMP1; + } + } + + /* Return Rx FIFO fill level */ + return filllevel; +} + +/** + * @} + */ + +/** @defgroup CAN_Exported_Functions_Group4 Interrupts management + * @brief Interrupts management + * +@verbatim + ============================================================================== + ##### Interrupts management ##### + ============================================================================== + [..] This section provides functions allowing to: + (+) HAL_CAN_ActivateNotification : Enable interrupts + (+) HAL_CAN_DeactivateNotification : Disable interrupts + (+) HAL_CAN_IRQHandler : Handles CAN interrupt request + +@endverbatim + * @{ + */ + +/** + * @brief Enable interrupts. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param ActiveITs indicates which interrupts will be enabled. + * This parameter can be any combination of @arg CAN_Interrupts. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_ActivateNotification(CAN_HandleTypeDef *hcan, uint32_t ActiveITs) +{ + HAL_CAN_StateTypeDef state = hcan->State; + + /* Check function parameters */ + assert_param(IS_CAN_IT(ActiveITs)); + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Enable the selected interrupts */ + __HAL_CAN_ENABLE_IT(hcan, ActiveITs); + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + return HAL_ERROR; + } +} + +/** + * @brief Disable interrupts. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @param InactiveITs indicates which interrupts will be disabled. + * This parameter can be any combination of @arg CAN_Interrupts. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_DeactivateNotification(CAN_HandleTypeDef *hcan, uint32_t InactiveITs) +{ + HAL_CAN_StateTypeDef state = hcan->State; + + /* Check function parameters */ + assert_param(IS_CAN_IT(InactiveITs)); + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Disable the selected interrupts */ + __HAL_CAN_DISABLE_IT(hcan, InactiveITs); + + /* Return function status */ + return HAL_OK; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + return HAL_ERROR; + } +} + +/** + * @brief Handles CAN interrupt request + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +void HAL_CAN_IRQHandler(CAN_HandleTypeDef *hcan) +{ + uint32_t errorcode = HAL_CAN_ERROR_NONE; + uint32_t interrupts = READ_REG(hcan->Instance->IER); + uint32_t msrflags = READ_REG(hcan->Instance->MSR); + uint32_t tsrflags = READ_REG(hcan->Instance->TSR); + uint32_t rf0rflags = READ_REG(hcan->Instance->RF0R); + uint32_t rf1rflags = READ_REG(hcan->Instance->RF1R); + uint32_t esrflags = READ_REG(hcan->Instance->ESR); + + /* Transmit Mailbox empty interrupt management *****************************/ + if ((interrupts & CAN_IT_TX_MAILBOX_EMPTY) != 0U) + { + /* Transmit Mailbox 0 management *****************************************/ + if ((tsrflags & CAN_TSR_RQCP0) != 0U) + { + /* Clear the Transmission Complete flag (and TXOK0,ALST0,TERR0 bits) */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_RQCP0); + + if ((tsrflags & CAN_TSR_TXOK0) != 0U) + { + /* Transmission Mailbox 0 complete callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->TxMailbox0CompleteCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_TxMailbox0CompleteCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + else + { + if ((tsrflags & CAN_TSR_ALST0) != 0U) + { + /* Update error code */ + errorcode |= HAL_CAN_ERROR_TX_ALST0; + } + else if ((tsrflags & CAN_TSR_TERR0) != 0U) + { + /* Update error code */ + errorcode |= HAL_CAN_ERROR_TX_TERR0; + } + else + { + /* Transmission Mailbox 0 abort callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->TxMailbox0AbortCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_TxMailbox0AbortCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + } + + /* Transmit Mailbox 1 management *****************************************/ + if ((tsrflags & CAN_TSR_RQCP1) != 0U) + { + /* Clear the Transmission Complete flag (and TXOK1,ALST1,TERR1 bits) */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_RQCP1); + + if ((tsrflags & CAN_TSR_TXOK1) != 0U) + { + /* Transmission Mailbox 1 complete callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->TxMailbox1CompleteCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_TxMailbox1CompleteCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + else + { + if ((tsrflags & CAN_TSR_ALST1) != 0U) + { + /* Update error code */ + errorcode |= HAL_CAN_ERROR_TX_ALST1; + } + else if ((tsrflags & CAN_TSR_TERR1) != 0U) + { + /* Update error code */ + errorcode |= HAL_CAN_ERROR_TX_TERR1; + } + else + { + /* Transmission Mailbox 1 abort callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->TxMailbox1AbortCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_TxMailbox1AbortCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + } + + /* Transmit Mailbox 2 management *****************************************/ + if ((tsrflags & CAN_TSR_RQCP2) != 0U) + { + /* Clear the Transmission Complete flag (and TXOK2,ALST2,TERR2 bits) */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_RQCP2); + + if ((tsrflags & CAN_TSR_TXOK2) != 0U) + { + /* Transmission Mailbox 2 complete callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->TxMailbox2CompleteCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_TxMailbox2CompleteCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + else + { + if ((tsrflags & CAN_TSR_ALST2) != 0U) + { + /* Update error code */ + errorcode |= HAL_CAN_ERROR_TX_ALST2; + } + else if ((tsrflags & CAN_TSR_TERR2) != 0U) + { + /* Update error code */ + errorcode |= HAL_CAN_ERROR_TX_TERR2; + } + else + { + /* Transmission Mailbox 2 abort callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->TxMailbox2AbortCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_TxMailbox2AbortCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + } + } + + /* Receive FIFO 0 overrun interrupt management *****************************/ + if ((interrupts & CAN_IT_RX_FIFO0_OVERRUN) != 0U) + { + if ((rf0rflags & CAN_RF0R_FOVR0) != 0U) + { + /* Set CAN error code to Rx Fifo 0 overrun error */ + errorcode |= HAL_CAN_ERROR_RX_FOV0; + + /* Clear FIFO0 Overrun Flag */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_FOV0); + } + } + + /* Receive FIFO 0 full interrupt management ********************************/ + if ((interrupts & CAN_IT_RX_FIFO0_FULL) != 0U) + { + if ((rf0rflags & CAN_RF0R_FULL0) != 0U) + { + /* Clear FIFO 0 full Flag */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_FF0); + + /* Receive FIFO 0 full Callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->RxFifo0FullCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_RxFifo0FullCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + + /* Receive FIFO 0 message pending interrupt management *********************/ + if ((interrupts & CAN_IT_RX_FIFO0_MSG_PENDING) != 0U) + { + /* Check if message is still pending */ + if ((hcan->Instance->RF0R & CAN_RF0R_FMP0) != 0U) + { + /* Receive FIFO 0 message pending Callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->RxFifo0MsgPendingCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_RxFifo0MsgPendingCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + + /* Receive FIFO 1 overrun interrupt management *****************************/ + if ((interrupts & CAN_IT_RX_FIFO1_OVERRUN) != 0U) + { + if ((rf1rflags & CAN_RF1R_FOVR1) != 0U) + { + /* Set CAN error code to Rx Fifo 1 overrun error */ + errorcode |= HAL_CAN_ERROR_RX_FOV1; + + /* Clear FIFO1 Overrun Flag */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_FOV1); + } + } + + /* Receive FIFO 1 full interrupt management ********************************/ + if ((interrupts & CAN_IT_RX_FIFO1_FULL) != 0U) + { + if ((rf1rflags & CAN_RF1R_FULL1) != 0U) + { + /* Clear FIFO 1 full Flag */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_FF1); + + /* Receive FIFO 1 full Callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->RxFifo1FullCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_RxFifo1FullCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + + /* Receive FIFO 1 message pending interrupt management *********************/ + if ((interrupts & CAN_IT_RX_FIFO1_MSG_PENDING) != 0U) + { + /* Check if message is still pending */ + if ((hcan->Instance->RF1R & CAN_RF1R_FMP1) != 0U) + { + /* Receive FIFO 1 message pending Callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->RxFifo1MsgPendingCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_RxFifo1MsgPendingCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + + /* Sleep interrupt management *********************************************/ + if ((interrupts & CAN_IT_SLEEP_ACK) != 0U) + { + if ((msrflags & CAN_MSR_SLAKI) != 0U) + { + /* Clear Sleep interrupt Flag */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_SLAKI); + + /* Sleep Callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->SleepCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_SleepCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + + /* WakeUp interrupt management *********************************************/ + if ((interrupts & CAN_IT_WAKEUP) != 0U) + { + if ((msrflags & CAN_MSR_WKUI) != 0U) + { + /* Clear WakeUp Flag */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_WKU); + + /* WakeUp Callback */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->WakeUpFromRxMsgCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_WakeUpFromRxMsgCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } + } + + /* Error interrupts management *********************************************/ + if ((interrupts & CAN_IT_ERROR) != 0U) + { + if ((msrflags & CAN_MSR_ERRI) != 0U) + { + /* Check Error Warning Flag */ + if (((interrupts & CAN_IT_ERROR_WARNING) != 0U) && + ((esrflags & CAN_ESR_EWGF) != 0U)) + { + /* Set CAN error code to Error Warning */ + errorcode |= HAL_CAN_ERROR_EWG; + + /* No need for clear of Error Warning Flag as read-only */ + } + + /* Check Error Passive Flag */ + if (((interrupts & CAN_IT_ERROR_PASSIVE) != 0U) && + ((esrflags & CAN_ESR_EPVF) != 0U)) + { + /* Set CAN error code to Error Passive */ + errorcode |= HAL_CAN_ERROR_EPV; + + /* No need for clear of Error Passive Flag as read-only */ + } + + /* Check Bus-off Flag */ + if (((interrupts & CAN_IT_BUSOFF) != 0U) && + ((esrflags & CAN_ESR_BOFF) != 0U)) + { + /* Set CAN error code to Bus-Off */ + errorcode |= HAL_CAN_ERROR_BOF; + + /* No need for clear of Error Bus-Off as read-only */ + } + + /* Check Last Error Code Flag */ + if (((interrupts & CAN_IT_LAST_ERROR_CODE) != 0U) && + ((esrflags & CAN_ESR_LEC) != 0U)) + { + switch (esrflags & CAN_ESR_LEC) + { + case (CAN_ESR_LEC_0): + /* Set CAN error code to Stuff error */ + errorcode |= HAL_CAN_ERROR_STF; + break; + case (CAN_ESR_LEC_1): + /* Set CAN error code to Form error */ + errorcode |= HAL_CAN_ERROR_FOR; + break; + case (CAN_ESR_LEC_1 | CAN_ESR_LEC_0): + /* Set CAN error code to Acknowledgement error */ + errorcode |= HAL_CAN_ERROR_ACK; + break; + case (CAN_ESR_LEC_2): + /* Set CAN error code to Bit recessive error */ + errorcode |= HAL_CAN_ERROR_BR; + break; + case (CAN_ESR_LEC_2 | CAN_ESR_LEC_0): + /* Set CAN error code to Bit Dominant error */ + errorcode |= HAL_CAN_ERROR_BD; + break; + case (CAN_ESR_LEC_2 | CAN_ESR_LEC_1): + /* Set CAN error code to CRC error */ + errorcode |= HAL_CAN_ERROR_CRC; + break; + default: + break; + } + + /* Clear Last error code Flag */ + CLEAR_BIT(hcan->Instance->ESR, CAN_ESR_LEC); + } + } + + /* Clear ERRI Flag */ + __HAL_CAN_CLEAR_FLAG(hcan, CAN_FLAG_ERRI); + } + + /* Call the Error call Back in case of Errors */ + if (errorcode != HAL_CAN_ERROR_NONE) + { + /* Update error code in handle */ + hcan->ErrorCode |= errorcode; + + /* Call Error callback function */ +#if USE_HAL_CAN_REGISTER_CALLBACKS == 1 + /* Call registered callback*/ + hcan->ErrorCallback(hcan); +#else + /* Call weak (surcharged) callback */ + HAL_CAN_ErrorCallback(hcan); +#endif /* USE_HAL_CAN_REGISTER_CALLBACKS */ + } +} + +/** + * @} + */ + +/** @defgroup CAN_Exported_Functions_Group5 Callback functions + * @brief CAN Callback functions + * +@verbatim + ============================================================================== + ##### Callback functions ##### + ============================================================================== + [..] + This subsection provides the following callback functions: + (+) HAL_CAN_TxMailbox0CompleteCallback + (+) HAL_CAN_TxMailbox1CompleteCallback + (+) HAL_CAN_TxMailbox2CompleteCallback + (+) HAL_CAN_TxMailbox0AbortCallback + (+) HAL_CAN_TxMailbox1AbortCallback + (+) HAL_CAN_TxMailbox2AbortCallback + (+) HAL_CAN_RxFifo0MsgPendingCallback + (+) HAL_CAN_RxFifo0FullCallback + (+) HAL_CAN_RxFifo1MsgPendingCallback + (+) HAL_CAN_RxFifo1FullCallback + (+) HAL_CAN_SleepCallback + (+) HAL_CAN_WakeUpFromRxMsgCallback + (+) HAL_CAN_ErrorCallback + +@endverbatim + * @{ + */ + +/** + * @brief Transmission Mailbox 0 complete callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_TxMailbox0CompleteCallback could be implemented in the + user file + */ +} + +/** + * @brief Transmission Mailbox 1 complete callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_TxMailbox1CompleteCallback could be implemented in the + user file + */ +} + +/** + * @brief Transmission Mailbox 2 complete callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_TxMailbox2CompleteCallback could be implemented in the + user file + */ +} + +/** + * @brief Transmission Mailbox 0 Cancellation callback. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_TxMailbox0AbortCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_TxMailbox0AbortCallback could be implemented in the + user file + */ +} + +/** + * @brief Transmission Mailbox 1 Cancellation callback. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_TxMailbox1AbortCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_TxMailbox1AbortCallback could be implemented in the + user file + */ +} + +/** + * @brief Transmission Mailbox 2 Cancellation callback. + * @param hcan pointer to an CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_TxMailbox2AbortCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_TxMailbox2AbortCallback could be implemented in the + user file + */ +} + +/** + * @brief Rx FIFO 0 message pending callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_RxFifo0MsgPendingCallback could be implemented in the + user file + */ +} + +/** + * @brief Rx FIFO 0 full callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_RxFifo0FullCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_RxFifo0FullCallback could be implemented in the user + file + */ +} + +/** + * @brief Rx FIFO 1 message pending callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_RxFifo1MsgPendingCallback could be implemented in the + user file + */ +} + +/** + * @brief Rx FIFO 1 full callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_RxFifo1FullCallback could be implemented in the user + file + */ +} + +/** + * @brief Sleep callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_SleepCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_SleepCallback could be implemented in the user file + */ +} + +/** + * @brief WakeUp from Rx message callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_WakeUpFromRxMsgCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_WakeUpFromRxMsgCallback could be implemented in the + user file + */ +} + +/** + * @brief Error CAN callback. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval None + */ +__weak void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hcan); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_CAN_ErrorCallback could be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup CAN_Exported_Functions_Group6 Peripheral State and Error functions + * @brief CAN Peripheral State functions + * +@verbatim + ============================================================================== + ##### Peripheral State and Error functions ##### + ============================================================================== + [..] + This subsection provides functions allowing to : + (+) HAL_CAN_GetState() : Return the CAN state. + (+) HAL_CAN_GetError() : Return the CAN error codes if any. + (+) HAL_CAN_ResetError(): Reset the CAN error codes if any. + +@endverbatim + * @{ + */ + +/** + * @brief Return the CAN state. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval HAL state + */ +HAL_CAN_StateTypeDef HAL_CAN_GetState(const CAN_HandleTypeDef *hcan) +{ + HAL_CAN_StateTypeDef state = hcan->State; + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Check sleep mode acknowledge flag */ + if ((hcan->Instance->MSR & CAN_MSR_SLAK) != 0U) + { + /* Sleep mode is active */ + state = HAL_CAN_STATE_SLEEP_ACTIVE; + } + /* Check sleep mode request flag */ + else if ((hcan->Instance->MCR & CAN_MCR_SLEEP) != 0U) + { + /* Sleep mode request is pending */ + state = HAL_CAN_STATE_SLEEP_PENDING; + } + else + { + /* Neither sleep mode request nor sleep mode acknowledge */ + } + } + + /* Return CAN state */ + return state; +} + +/** + * @brief Return the CAN error code. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval CAN Error Code + */ +uint32_t HAL_CAN_GetError(const CAN_HandleTypeDef *hcan) +{ + /* Return CAN error code */ + return hcan->ErrorCode; +} + +/** + * @brief Reset the CAN error code. + * @param hcan pointer to a CAN_HandleTypeDef structure that contains + * the configuration information for the specified CAN. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_CAN_ResetError(CAN_HandleTypeDef *hcan) +{ + HAL_StatusTypeDef status = HAL_OK; + HAL_CAN_StateTypeDef state = hcan->State; + + if ((state == HAL_CAN_STATE_READY) || + (state == HAL_CAN_STATE_LISTENING)) + { + /* Reset CAN error code */ + hcan->ErrorCode = 0U; + } + else + { + /* Update error code */ + hcan->ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED; + + status = HAL_ERROR; + } + + /* Return the status */ + return status; +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_CAN_MODULE_ENABLED */ + +/** + * @} + */ + +#endif /* CAN */ + +/** + * @} + */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c new file mode 100644 index 0000000..0998036 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c @@ -0,0 +1,511 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_cortex.c + * @author MCD Application Team + * @brief CORTEX HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the CORTEX: + * + Initialization and de-initialization functions + * + Peripheral Control functions + * + * @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + + [..] + *** How to configure Interrupts using CORTEX HAL driver *** + =========================================================== + [..] + This section provides functions allowing to configure the NVIC interrupts (IRQ). + The Cortex-M4 exceptions are managed by CMSIS functions. + + (#) Configure the NVIC Priority Grouping using HAL_NVIC_SetPriorityGrouping() function + + (#) Configure the priority of the selected IRQ Channels using HAL_NVIC_SetPriority() + + (#) Enable the selected IRQ Channels using HAL_NVIC_EnableIRQ() + + + -@- When the NVIC_PRIORITYGROUP_0 is selected, IRQ pre-emption is no more possible. + The pending IRQ priority will be managed only by the sub priority. + + -@- IRQ priority order (sorted by highest to lowest priority): + (+@) Lowest pre-emption priority + (+@) Lowest sub priority + (+@) Lowest hardware priority (IRQ number) + + [..] + *** How to configure Systick using CORTEX HAL driver *** + ======================================================== + [..] + Setup SysTick Timer for time base + + (+) The HAL_SYSTICK_Config()function calls the SysTick_Config() function which + is a CMSIS function that: + (++) Configures the SysTick Reload register with value passed as function parameter. + (++) Configures the SysTick IRQ priority to the lowest value (0x0FU). + (++) Resets the SysTick Counter register. + (++) Configures the SysTick Counter clock source to be Core Clock Source (HCLK). + (++) Enables the SysTick Interrupt. + (++) Starts the SysTick Counter. + + (+) You can change the SysTick Clock source to be HCLK_Div8 by calling the macro + __HAL_CORTEX_SYSTICKCLK_CONFIG(SYSTICK_CLKSOURCE_HCLK_DIV8) just after the + HAL_SYSTICK_Config() function call. The __HAL_CORTEX_SYSTICKCLK_CONFIG() macro is defined + inside the stm32f3xx_hal_cortex.h file. + + (+) You can change the SysTick IRQ priority by calling the + HAL_NVIC_SetPriority(SysTick_IRQn,...) function just after the HAL_SYSTICK_Config() function + call. The HAL_NVIC_SetPriority() call the NVIC_SetPriority() function which is a CMSIS function. + + (+) To adjust the SysTick time base, use the following formula: + + Reload Value = SysTick Counter Clock (Hz) x Desired Time base (s) + (++) Reload Value is the parameter to be passed for HAL_SYSTICK_Config() function + (++) Reload Value should not exceed 0xFFFFFF + + @endverbatim + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* + Additional Tables: CORTEX_NVIC_Priority_Table + The table below gives the allowed values of the pre-emption priority and subpriority according + to the Priority Grouping configuration performed by HAL_NVIC_SetPriorityGrouping() function + ========================================================================================================================== + NVIC_PriorityGroup | NVIC_IRQChannelPreemptionPriority | NVIC_IRQChannelSubPriority | Description + ========================================================================================================================== + NVIC_PRIORITYGROUP_0 | 0 | 0U-15 | 0 bits for pre-emption priority + | | | 4 bits for subpriority + -------------------------------------------------------------------------------------------------------------------------- + NVIC_PRIORITYGROUP_1 | 0U-1 | 0U-7 | 1 bits for pre-emption priority + | | | 3 bits for subpriority + -------------------------------------------------------------------------------------------------------------------------- + NVIC_PRIORITYGROUP_2 | 0U-3 | 0U-3 | 2 bits for pre-emption priority + | | | 2 bits for subpriority + -------------------------------------------------------------------------------------------------------------------------- + NVIC_PRIORITYGROUP_3 | 0U-7 | 0U-1 | 3 bits for pre-emption priority + | | | 1 bits for subpriority + -------------------------------------------------------------------------------------------------------------------------- + NVIC_PRIORITYGROUP_4 | 0U-15 | 0 | 4 bits for pre-emption priority + | | | 0 bits for subpriority + ========================================================================================================================== + +*/ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup CORTEX CORTEX + * @brief CORTEX CORTEX HAL module driver + * @{ + */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions ---------------------------------------------------------*/ + +/** @defgroup CORTEX_Exported_Functions CORTEX Exported Functions + * @{ + */ + + +/** @defgroup CORTEX_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim + ============================================================================== + ##### Initialization and de-initialization functions ##### + ============================================================================== + [..] + This section provides the CORTEX HAL driver functions allowing to configure Interrupts + Systick functionalities + +@endverbatim + * @{ + */ + + +/** + * @brief Sets the priority grouping field (pre-emption priority and subpriority) + * using the required unlock sequence. + * @param PriorityGroup The priority grouping bits length. + * This parameter can be one of the following values: + * @arg NVIC_PRIORITYGROUP_0: 0 bits for pre-emption priority + * 4 bits for subpriority + * @arg NVIC_PRIORITYGROUP_1: 1 bits for pre-emption priority + * 3 bits for subpriority + * @arg NVIC_PRIORITYGROUP_2: 2 bits for pre-emption priority + * 2 bits for subpriority + * @arg NVIC_PRIORITYGROUP_3: 3 bits for pre-emption priority + * 1 bits for subpriority + * @arg NVIC_PRIORITYGROUP_4: 4 bits for pre-emption priority + * 0 bits for subpriority + * @note When the NVIC_PriorityGroup_0 is selected, IRQ pre-emption is no more possible. + * The pending IRQ priority will be managed only by the subpriority. + * @retval None + */ +void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + /* Check the parameters */ + assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup)); + + /* Set the PRIGROUP[10:8] bits according to the PriorityGroup parameter value */ + NVIC_SetPriorityGrouping(PriorityGroup); +} + +/** + * @brief Sets the priority of an interrupt. + * @param IRQn External interrupt number + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f3xxxx.h)) + * @param PreemptPriority The pre-emption priority for the IRQn channel. + * This parameter can be a value between 0 and 15 as described in the table CORTEX_NVIC_Priority_Table + * A lower priority value indicates a higher priority + * @param SubPriority the subpriority level for the IRQ channel. + * This parameter can be a value between 0 and 15 as described in the table CORTEX_NVIC_Priority_Table + * A lower priority value indicates a higher priority. + * @retval None + */ +void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t prioritygroup = 0x00U; + + /* Check the parameters */ + assert_param(IS_NVIC_SUB_PRIORITY(SubPriority)); + assert_param(IS_NVIC_PREEMPTION_PRIORITY(PreemptPriority)); + + prioritygroup = NVIC_GetPriorityGrouping(); + + NVIC_SetPriority(IRQn, NVIC_EncodePriority(prioritygroup, PreemptPriority, SubPriority)); +} + +/** + * @brief Enables a device specific interrupt in the NVIC interrupt controller. + * @note To configure interrupts priority correctly, the NVIC_PriorityGroupConfig() + * function should be called before. + * @param IRQn External interrupt number + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f3xxxx.h)) + * @retval None + */ +void HAL_NVIC_EnableIRQ(IRQn_Type IRQn) +{ + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + + /* Enable interrupt */ + NVIC_EnableIRQ(IRQn); +} + +/** + * @brief Disables a device specific interrupt in the NVIC interrupt controller. + * @param IRQn External interrupt number + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f3xxxx.h)) + * @retval None + */ +void HAL_NVIC_DisableIRQ(IRQn_Type IRQn) +{ + /* Check the parameters */ + assert_param(IS_NVIC_DEVICE_IRQ(IRQn)); + + /* Disable interrupt */ + NVIC_DisableIRQ(IRQn); +} + +/** + * @brief Initiates a system reset request to reset the MCU. + * @retval None + */ +void HAL_NVIC_SystemReset(void) +{ + /* System Reset */ + NVIC_SystemReset(); +} + +/** + * @brief Initializes the System Timer and its interrupt, and starts the System Tick Timer. + * Counter is in free running mode to generate periodic interrupts. + * @param TicksNumb Specifies the ticks Number of ticks between two interrupts. + * @retval status: - 0 Function succeeded. + * - 1 Function failed. + */ +uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb) +{ + return SysTick_Config(TicksNumb); +} +/** + * @} + */ + +/** @defgroup CORTEX_Exported_Functions_Group2 Peripheral Control functions + * @brief Cortex control functions + * +@verbatim + ============================================================================== + ##### Peripheral Control functions ##### + ============================================================================== + [..] + This subsection provides a set of functions allowing to control the CORTEX + (NVIC, SYSTICK, MPU) functionalities. + + +@endverbatim + * @{ + */ + +#if (__MPU_PRESENT == 1U) + +/** + * @brief Disables the MPU also clears the HFNMIENA bit (ARM recommendation) + * @retval None + */ +void HAL_MPU_Disable(void) +{ + /* Disable fault exceptions */ + SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk; + + /* Disable the MPU */ + MPU->CTRL = 0U; +} + +/** + * @brief Enables the MPU + * @param MPU_Control Specifies the control mode of the MPU during hard fault, + * NMI, FAULTMASK and privileged access to the default memory + * This parameter can be one of the following values: + * @arg MPU_HFNMI_PRIVDEF_NONE + * @arg MPU_HARDFAULT_NMI + * @arg MPU_PRIVILEGED_DEFAULT + * @arg MPU_HFNMI_PRIVDEF + * @retval None + */ +void HAL_MPU_Enable(uint32_t MPU_Control) +{ + /* Enable the MPU */ + MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk; + + /* Enable fault exceptions */ + SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk; +} + + /** + * @brief Initializes and configures the Region and the memory to be protected. + * @param MPU_Init Pointer to a MPU_Region_InitTypeDef structure that contains + * the initialization and configuration information. + * @retval None + */ +void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init) +{ + /* Check the parameters */ + assert_param(IS_MPU_REGION_NUMBER(MPU_Init->Number)); + assert_param(IS_MPU_REGION_ENABLE(MPU_Init->Enable)); + + /* Set the Region number */ + MPU->RNR = MPU_Init->Number; + + if ((MPU_Init->Enable) != RESET) + { + /* Check the parameters */ + assert_param(IS_MPU_INSTRUCTION_ACCESS(MPU_Init->DisableExec)); + assert_param(IS_MPU_REGION_PERMISSION_ATTRIBUTE(MPU_Init->AccessPermission)); + assert_param(IS_MPU_TEX_LEVEL(MPU_Init->TypeExtField)); + assert_param(IS_MPU_ACCESS_SHAREABLE(MPU_Init->IsShareable)); + assert_param(IS_MPU_ACCESS_CACHEABLE(MPU_Init->IsCacheable)); + assert_param(IS_MPU_ACCESS_BUFFERABLE(MPU_Init->IsBufferable)); + assert_param(IS_MPU_SUB_REGION_DISABLE(MPU_Init->SubRegionDisable)); + assert_param(IS_MPU_REGION_SIZE(MPU_Init->Size)); + + MPU->RBAR = MPU_Init->BaseAddress; + MPU->RASR = ((uint32_t)MPU_Init->DisableExec << MPU_RASR_XN_Pos) | + ((uint32_t)MPU_Init->AccessPermission << MPU_RASR_AP_Pos) | + ((uint32_t)MPU_Init->TypeExtField << MPU_RASR_TEX_Pos) | + ((uint32_t)MPU_Init->IsShareable << MPU_RASR_S_Pos) | + ((uint32_t)MPU_Init->IsCacheable << MPU_RASR_C_Pos) | + ((uint32_t)MPU_Init->IsBufferable << MPU_RASR_B_Pos) | + ((uint32_t)MPU_Init->SubRegionDisable << MPU_RASR_SRD_Pos) | + ((uint32_t)MPU_Init->Size << MPU_RASR_SIZE_Pos) | + ((uint32_t)MPU_Init->Enable << MPU_RASR_ENABLE_Pos); + } + else + { + MPU->RBAR = 0x00U; + MPU->RASR = 0x00U; + } +} +#endif /* __MPU_PRESENT */ + +/** + * @brief Gets the priority grouping field from the NVIC Interrupt Controller. + * @retval Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field) + */ +uint32_t HAL_NVIC_GetPriorityGrouping(void) +{ + /* Get the PRIGROUP[10:8] field value */ + return NVIC_GetPriorityGrouping(); +} + +/** + * @brief Gets the priority of an interrupt. + * @param IRQn External interrupt number + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f3xxxx.h)) + * @param PriorityGroup: the priority grouping bits length. + * This parameter can be one of the following values: + * @arg NVIC_PRIORITYGROUP_0: 0 bits for pre-emption priority + * 4 bits for subpriority + * @arg NVIC_PRIORITYGROUP_1: 1 bits for pre-emption priority + * 3 bits for subpriority + * @arg NVIC_PRIORITYGROUP_2: 2 bits for pre-emption priority + * 2 bits for subpriority + * @arg NVIC_PRIORITYGROUP_3: 3 bits for pre-emption priority + * 1 bits for subpriority + * @arg NVIC_PRIORITYGROUP_4: 4 bits for pre-emption priority + * 0 bits for subpriority + * @param pPreemptPriority Pointer on the Preemptive priority value (starting from 0). + * @param pSubPriority Pointer on the Subpriority value (starting from 0). + * @retval None + */ +void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority) +{ + /* Check the parameters */ + assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup)); + /* Get priority for Cortex-M system or device specific interrupts */ + NVIC_DecodePriority(NVIC_GetPriority(IRQn), PriorityGroup, pPreemptPriority, pSubPriority); +} + +/** + * @brief Sets Pending bit of an external interrupt. + * @param IRQn External interrupt number + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f3xxxx.h)) + * @retval None + */ +void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + /* Set interrupt pending */ + NVIC_SetPendingIRQ(IRQn); +} + +/** + * @brief Gets Pending Interrupt (reads the pending register in the NVIC + * and returns the pending bit for the specified interrupt). + * @param IRQn External interrupt number + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f3xxxx.h)) + * @retval status: - 0 Interrupt status is not pending. + * - 1 Interrupt status is pending. + */ +uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + /* Return 1 if pending else 0U */ + return NVIC_GetPendingIRQ(IRQn); +} + +/** + * @brief Clears the pending bit of an external interrupt. + * @param IRQn External interrupt number + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f3xxxx.h)) + * @retval None + */ +void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + /* Clear pending interrupt */ + NVIC_ClearPendingIRQ(IRQn); +} + +/** + * @brief Gets active interrupt ( reads the active register in NVIC and returns the active bit). + * @param IRQn External interrupt number + * This parameter can be an enumerator of IRQn_Type enumeration + * (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32f3xxxx.h)) + * @retval status: - 0 Interrupt status is not pending. + * - 1 Interrupt status is pending. + */ +uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn) +{ + /* Return 1 if active else 0U */ + return NVIC_GetActive(IRQn); +} + +/** + * @brief Configures the SysTick clock source. + * @param CLKSource specifies the SysTick clock source. + * This parameter can be one of the following values: + * @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source. + * @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source. + * @retval None + */ +void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource) +{ + /* Check the parameters */ + assert_param(IS_SYSTICK_CLK_SOURCE(CLKSource)); + if (CLKSource == SYSTICK_CLKSOURCE_HCLK) + { + SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK; + } + else + { + SysTick->CTRL &= ~SYSTICK_CLKSOURCE_HCLK; + } +} + +/** + * @brief This function handles SYSTICK interrupt request. + * @retval None + */ +void HAL_SYSTICK_IRQHandler(void) +{ + HAL_SYSTICK_Callback(); +} + +/** + * @brief SYSTICK callback. + * @retval None + */ +__weak void HAL_SYSTICK_Callback(void) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_SYSTICK_Callback could be implemented in the user file + */ +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_CORTEX_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c new file mode 100644 index 0000000..252d1df --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c @@ -0,0 +1,898 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_dma.c + * @author MCD Application Team + * @brief DMA HAL module driver. + * + * This file provides firmware functions to manage the following + * functionalities of the Direct Memory Access (DMA) peripheral: + * + Initialization and de-initialization functions + * + IO operation functions + * + Peripheral State and errors functions + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + (#) Enable and configure the peripheral to be connected to the DMA Channel + (except for internal SRAM / FLASH memories: no initialization is + necessary). Please refer to Reference manual for connection between peripherals + and DMA requests . + + (#) For a given Channel, program the required configuration through the following parameters: + Transfer Direction, Source and Destination data formats, + Circular or Normal mode, Channel Priority level, Source and Destination Increment mode, + using HAL_DMA_Init() function. + + (#) Use HAL_DMA_GetState() function to return the DMA state and HAL_DMA_GetError() in case of error + detection. + + (#) Use HAL_DMA_Abort() function to abort the current transfer + + -@- In Memory-to-Memory transfer mode, Circular mode is not allowed. + *** Polling mode IO operation *** + ================================= + [..] + (+) Use HAL_DMA_Start() to start DMA transfer after the configuration of Source + address and destination address and the Length of data to be transferred + (+) Use HAL_DMA_PollForTransfer() to poll for the end of current transfer, in this + case a fixed Timeout can be configured by User depending from his application. + + *** Interrupt mode IO operation *** + =================================== + [..] + (+) Configure the DMA interrupt priority using HAL_NVIC_SetPriority() + (+) Enable the DMA IRQ handler using HAL_NVIC_EnableIRQ() + (+) Use HAL_DMA_Start_IT() to start DMA transfer after the configuration of + Source address and destination address and the Length of data to be transferred. + In this case the DMA interrupt is configured + (+) Use HAL_DMA_Channel_IRQHandler() called under DMA_IRQHandler() Interrupt subroutine + (+) At the end of data transfer HAL_DMA_IRQHandler() function is executed and user can + add his own function by customization of function pointer XferCpltCallback and + XferErrorCallback (i.e a member of DMA handle structure). + + *** DMA HAL driver macros list *** + ============================================= + [..] + Below the list of most used macros in DMA HAL driver. + + [..] + (@) You can refer to the DMA HAL driver header file for more useful macros + + @endverbatim + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup DMA DMA + * @brief DMA HAL module driver + * @{ + */ + +#ifdef HAL_DMA_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/** @defgroup DMA_Private_Functions DMA Private Functions + * @{ + */ +static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); +static void DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma); +/** + * @} + */ + +/* Exported functions ---------------------------------------------------------*/ + +/** @defgroup DMA_Exported_Functions DMA Exported Functions + * @{ + */ + +/** @defgroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and de-initialization functions + * +@verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + [..] + This section provides functions allowing to initialize the DMA Channel source + and destination addresses, incrementation and data sizes, transfer direction, + circular/normal mode selection, memory-to-memory mode selection and Channel priority value. + [..] + The HAL_DMA_Init() function follows the DMA configuration procedures as described in + reference manual. + +@endverbatim + * @{ + */ + +/** + * @brief Initialize the DMA according to the specified + * parameters in the DMA_InitTypeDef and initialize the associated handle. + * @param hdma Pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma) +{ + uint32_t tmp = 0U; + + /* Check the DMA handle allocation */ + if(NULL == hdma) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_DMA_ALL_INSTANCE(hdma->Instance)); + assert_param(IS_DMA_DIRECTION(hdma->Init.Direction)); + assert_param(IS_DMA_PERIPHERAL_INC_STATE(hdma->Init.PeriphInc)); + assert_param(IS_DMA_MEMORY_INC_STATE(hdma->Init.MemInc)); + assert_param(IS_DMA_PERIPHERAL_DATA_SIZE(hdma->Init.PeriphDataAlignment)); + assert_param(IS_DMA_MEMORY_DATA_SIZE(hdma->Init.MemDataAlignment)); + assert_param(IS_DMA_MODE(hdma->Init.Mode)); + assert_param(IS_DMA_PRIORITY(hdma->Init.Priority)); + + /* Change DMA peripheral state */ + hdma->State = HAL_DMA_STATE_BUSY; + + /* Get the CR register value */ + tmp = hdma->Instance->CCR; + + /* Clear PL, MSIZE, PSIZE, MINC, PINC, CIRC, DIR bits */ + tmp &= ((uint32_t)~(DMA_CCR_PL | DMA_CCR_MSIZE | DMA_CCR_PSIZE | \ + DMA_CCR_MINC | DMA_CCR_PINC | DMA_CCR_CIRC | \ + DMA_CCR_DIR)); + + /* Prepare the DMA Channel configuration */ + tmp |= hdma->Init.Direction | + hdma->Init.PeriphInc | hdma->Init.MemInc | + hdma->Init.PeriphDataAlignment | hdma->Init.MemDataAlignment | + hdma->Init.Mode | hdma->Init.Priority; + + /* Write to DMA Channel CR register */ + hdma->Instance->CCR = tmp; + + /* Initialize DmaBaseAddress and ChannelIndex parameters used + by HAL_DMA_IRQHandler() and HAL_DMA_PollForTransfer() */ + DMA_CalcBaseAndBitshift(hdma); + + /* Initialise the error code */ + hdma->ErrorCode = HAL_DMA_ERROR_NONE; + + /* Initialize the DMA state*/ + hdma->State = HAL_DMA_STATE_READY; + + /* Allocate lock resource and initialize it */ + hdma->Lock = HAL_UNLOCKED; + + return HAL_OK; +} + +/** + * @brief DeInitialize the DMA peripheral + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma) +{ + /* Check the DMA handle allocation */ + if(NULL == hdma) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_DMA_ALL_INSTANCE(hdma->Instance)); + + /* Disable the selected DMA Channelx */ + hdma->Instance->CCR &= ~DMA_CCR_EN; + + /* Reset DMA Channel control register */ + hdma->Instance->CCR = 0U; + + /* Reset DMA Channel Number of Data to Transfer register */ + hdma->Instance->CNDTR = 0U; + + /* Reset DMA Channel peripheral address register */ + hdma->Instance->CPAR = 0U; + + /* Reset DMA Channel memory address register */ + hdma->Instance->CMAR = 0U; + + /* Get DMA Base Address */ + DMA_CalcBaseAndBitshift(hdma); + + /* Clear all flags */ + hdma->DmaBaseAddress->IFCR = DMA_FLAG_GL1 << hdma->ChannelIndex; + + /* Clean callbacks */ + hdma->XferCpltCallback = NULL; + hdma->XferHalfCpltCallback = NULL; + hdma->XferErrorCallback = NULL; + hdma->XferAbortCallback = NULL; + + /* Reset the error code */ + hdma->ErrorCode = HAL_DMA_ERROR_NONE; + + /* Reset the DMA state */ + hdma->State = HAL_DMA_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(hdma); + + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup DMA_Exported_Functions_Group2 Input and Output operation functions + * @brief I/O operation functions + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Configure the source, destination address and data length and Start DMA transfer + (+) Configure the source, destination address and data length and + Start DMA transfer with interrupt + (+) Abort DMA transfer + (+) Poll for transfer complete + (+) Handle DMA interrupt request + +@endverbatim + * @{ + */ + +/** + * @brief Start the DMA Transfer. + * @param hdma : pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @param SrcAddress The source memory Buffer address + * @param DstAddress The destination memory Buffer address + * @param DataLength The length of data to be transferred from source to destination + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_Start(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_DMA_BUFFER_SIZE(DataLength)); + + /* Process locked */ + __HAL_LOCK(hdma); + + if(HAL_DMA_STATE_READY == hdma->State) + { + /* Change DMA peripheral state */ + hdma->State = HAL_DMA_STATE_BUSY; + + hdma->ErrorCode = HAL_DMA_ERROR_NONE; + + /* Disable the peripheral */ + hdma->Instance->CCR &= ~DMA_CCR_EN; + + /* Configure the source, destination address and the data length */ + DMA_SetConfig(hdma, SrcAddress, DstAddress, DataLength); + + /* Enable the Peripheral */ + hdma->Instance->CCR |= DMA_CCR_EN; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + /* Remain BUSY */ + status = HAL_BUSY; + } + + return status; +} + +/** + * @brief Start the DMA Transfer with interrupt enabled. + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @param SrcAddress The source memory Buffer address + * @param DstAddress The destination memory Buffer address + * @param DataLength The length of data to be transferred from source to destination + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_DMA_BUFFER_SIZE(DataLength)); + + /* Process locked */ + __HAL_LOCK(hdma); + + if(HAL_DMA_STATE_READY == hdma->State) + { + /* Change DMA peripheral state */ + hdma->State = HAL_DMA_STATE_BUSY; + + hdma->ErrorCode = HAL_DMA_ERROR_NONE; + + /* Disable the peripheral */ + hdma->Instance->CCR &= ~DMA_CCR_EN; + + /* Configure the source, destination address and the data length */ + DMA_SetConfig(hdma, SrcAddress, DstAddress, DataLength); + + /* Enable the transfer complete, & transfer error interrupts */ + /* Half transfer interrupt is optional: enable it only if associated callback is available */ + if(NULL != hdma->XferHalfCpltCallback ) + { + hdma->Instance->CCR |= (DMA_IT_TC | DMA_IT_HT | DMA_IT_TE); + } + else + { + hdma->Instance->CCR |= (DMA_IT_TC | DMA_IT_TE); + hdma->Instance->CCR &= ~DMA_IT_HT; + } + + /* Enable the Peripheral */ + hdma->Instance->CCR |= DMA_CCR_EN; + } + else + { + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + /* Remain BUSY */ + status = HAL_BUSY; + } + + return status; +} + +/** + * @brief Abort the DMA Transfer. + * @param hdma : pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma) +{ + if(hdma->State != HAL_DMA_STATE_BUSY) + { + /* no transfer ongoing */ + hdma->ErrorCode = HAL_DMA_ERROR_NO_XFER; + + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + return HAL_ERROR; + } + else + { + /* Disable DMA IT */ + hdma->Instance->CCR &= ~(DMA_IT_TC | DMA_IT_HT | DMA_IT_TE); + + /* Disable the channel */ + hdma->Instance->CCR &= ~DMA_CCR_EN; + + /* Clear all flags */ + hdma->DmaBaseAddress->IFCR = (DMA_FLAG_GL1 << hdma->ChannelIndex); + } + /* Change the DMA state*/ + hdma->State = HAL_DMA_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + return HAL_OK; +} + +/** + * @brief Abort the DMA Transfer in Interrupt mode. + * @param hdma : pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Stream. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma) +{ + HAL_StatusTypeDef status = HAL_OK; + + if(HAL_DMA_STATE_BUSY != hdma->State) + { + /* no transfer ongoing */ + hdma->ErrorCode = HAL_DMA_ERROR_NO_XFER; + + status = HAL_ERROR; + } + else + { + + /* Disable DMA IT */ + hdma->Instance->CCR &= ~(DMA_IT_TC | DMA_IT_HT | DMA_IT_TE); + + /* Disable the channel */ + hdma->Instance->CCR &= ~DMA_CCR_EN; + + /* Clear all flags */ + hdma->DmaBaseAddress->IFCR = DMA_FLAG_GL1 << hdma->ChannelIndex; + + /* Change the DMA state */ + hdma->State = HAL_DMA_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + /* Call User Abort callback */ + if(hdma->XferAbortCallback != NULL) + { + hdma->XferAbortCallback(hdma); + } + } + return status; +} + +/** + * @brief Polling for transfer complete. + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @param CompleteLevel Specifies the DMA level complete. + * @param Timeout Timeout duration. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, uint32_t CompleteLevel, uint32_t Timeout) +{ + uint32_t temp; + uint32_t tickstart = 0U; + + if(HAL_DMA_STATE_BUSY != hdma->State) + { + /* no transfer ongoing */ + hdma->ErrorCode = HAL_DMA_ERROR_NO_XFER; + __HAL_UNLOCK(hdma); + return HAL_ERROR; + } + + /* Polling mode not supported in circular mode */ + if (RESET != (hdma->Instance->CCR & DMA_CCR_CIRC)) + { + hdma->ErrorCode = HAL_DMA_ERROR_NOT_SUPPORTED; + return HAL_ERROR; + } + + /* Get the level transfer complete flag */ + if(HAL_DMA_FULL_TRANSFER == CompleteLevel) + { + /* Transfer Complete flag */ + temp = DMA_FLAG_TC1 << hdma->ChannelIndex; + } + else + { + /* Half Transfer Complete flag */ + temp = DMA_FLAG_HT1 << hdma->ChannelIndex; + } + + /* Get tick */ + tickstart = HAL_GetTick(); + + while(RESET == (hdma->DmaBaseAddress->ISR & temp)) + { + if(RESET != (hdma->DmaBaseAddress->ISR & (DMA_FLAG_TE1 << hdma->ChannelIndex))) + { + /* When a DMA transfer error occurs */ + /* A hardware clear of its EN bits is performed */ + /* Clear all flags */ + hdma->DmaBaseAddress->IFCR = DMA_FLAG_GL1 << hdma->ChannelIndex; + + /* Update error code */ + hdma->ErrorCode = HAL_DMA_ERROR_TE; + + /* Change the DMA state */ + hdma->State= HAL_DMA_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + return HAL_ERROR; + } + /* Check for the Timeout */ + if(Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick() - tickstart) > Timeout)) + { + /* Update error code */ + hdma->ErrorCode = HAL_DMA_ERROR_TIMEOUT; + + /* Change the DMA state */ + hdma->State = HAL_DMA_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + return HAL_ERROR; + } + } + } + + if(HAL_DMA_FULL_TRANSFER == CompleteLevel) + { + /* Clear the transfer complete flag */ + hdma->DmaBaseAddress->IFCR = DMA_FLAG_TC1 << hdma->ChannelIndex; + + /* The selected Channelx EN bit is cleared (DMA is disabled and + all transfers are complete) */ + hdma->State = HAL_DMA_STATE_READY; + } + else + { + /* Clear the half transfer complete flag */ + hdma->DmaBaseAddress->IFCR = DMA_FLAG_HT1 << hdma->ChannelIndex; + } + + /* Process unlocked */ + __HAL_UNLOCK(hdma); + + return HAL_OK; +} + +/** + * @brief Handle DMA interrupt request. + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @retval None + */ +void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma) +{ + uint32_t flag_it = hdma->DmaBaseAddress->ISR; + uint32_t source_it = hdma->Instance->CCR; + + /* Half Transfer Complete Interrupt management ******************************/ + if ((RESET != (flag_it & (DMA_FLAG_HT1 << hdma->ChannelIndex))) && (RESET != (source_it & DMA_IT_HT))) + { + /* Disable the half transfer interrupt if the DMA mode is not CIRCULAR */ + if((hdma->Instance->CCR & DMA_CCR_CIRC) == 0U) + { + /* Disable the half transfer interrupt */ + hdma->Instance->CCR &= ~DMA_IT_HT; + } + + /* Clear the half transfer complete flag */ + hdma->DmaBaseAddress->IFCR = DMA_FLAG_HT1 << hdma->ChannelIndex; + + /* DMA peripheral state is not updated in Half Transfer */ + /* State is updated only in Transfer Complete case */ + + if(hdma->XferHalfCpltCallback != NULL) + { + /* Half transfer callback */ + hdma->XferHalfCpltCallback(hdma); + } + } + + /* Transfer Complete Interrupt management ***********************************/ + else if ((RESET != (flag_it & (DMA_FLAG_TC1 << hdma->ChannelIndex))) && (RESET != (source_it & DMA_IT_TC))) + { + if((hdma->Instance->CCR & DMA_CCR_CIRC) == 0U) + { + /* Disable the transfer complete & transfer error interrupts */ + /* if the DMA mode is not CIRCULAR */ + hdma->Instance->CCR &= ~(DMA_IT_TC | DMA_IT_TE); + + /* Change the DMA state */ + hdma->State = HAL_DMA_STATE_READY; + } + + /* Clear the transfer complete flag */ + hdma->DmaBaseAddress->IFCR = DMA_FLAG_TC1 << hdma->ChannelIndex; + + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + if(hdma->XferCpltCallback != NULL) + { + /* Transfer complete callback */ + hdma->XferCpltCallback(hdma); + } + } + + /* Transfer Error Interrupt management ***************************************/ + else if (( RESET != (flag_it & (DMA_FLAG_TE1 << hdma->ChannelIndex))) && (RESET != (source_it & DMA_IT_TE))) + { + /* When a DMA transfer error occurs */ + /* A hardware clear of its EN bits is performed */ + /* Then, disable all DMA interrupts */ + hdma->Instance->CCR &= ~(DMA_IT_TC | DMA_IT_HT | DMA_IT_TE); + + /* Clear all flags */ + hdma->DmaBaseAddress->IFCR = DMA_FLAG_GL1 << hdma->ChannelIndex; + + /* Update error code */ + hdma->ErrorCode = HAL_DMA_ERROR_TE; + + /* Change the DMA state */ + hdma->State = HAL_DMA_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hdma); + + if(hdma->XferErrorCallback != NULL) + { + /* Transfer error callback */ + hdma->XferErrorCallback(hdma); + } + } +} + +/** + * @brief Register callbacks + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Stream. + * @param CallbackID User Callback identifier + * a HAL_DMA_CallbackIDTypeDef ENUM as parameter. + * @param pCallback pointer to private callback function which has pointer to + * a DMA_HandleTypeDef structure as parameter. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void (* pCallback)( DMA_HandleTypeDef * _hdma)) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Process locked */ + __HAL_LOCK(hdma); + + if(HAL_DMA_STATE_READY == hdma->State) + { + switch (CallbackID) + { + case HAL_DMA_XFER_CPLT_CB_ID: + hdma->XferCpltCallback = pCallback; + break; + + case HAL_DMA_XFER_HALFCPLT_CB_ID: + hdma->XferHalfCpltCallback = pCallback; + break; + + case HAL_DMA_XFER_ERROR_CB_ID: + hdma->XferErrorCallback = pCallback; + break; + + case HAL_DMA_XFER_ABORT_CB_ID: + hdma->XferAbortCallback = pCallback; + break; + + default: + status = HAL_ERROR; + break; + } + } + else + { + status = HAL_ERROR; + } + + /* Release Lock */ + __HAL_UNLOCK(hdma); + + return status; +} + +/** + * @brief UnRegister callbacks + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Stream. + * @param CallbackID User Callback identifier + * a HAL_DMA_CallbackIDTypeDef ENUM as parameter. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Process locked */ + __HAL_LOCK(hdma); + + if(HAL_DMA_STATE_READY == hdma->State) + { + switch (CallbackID) + { + case HAL_DMA_XFER_CPLT_CB_ID: + hdma->XferCpltCallback = NULL; + break; + + case HAL_DMA_XFER_HALFCPLT_CB_ID: + hdma->XferHalfCpltCallback = NULL; + break; + + case HAL_DMA_XFER_ERROR_CB_ID: + hdma->XferErrorCallback = NULL; + break; + + case HAL_DMA_XFER_ABORT_CB_ID: + hdma->XferAbortCallback = NULL; + break; + + case HAL_DMA_XFER_ALL_CB_ID: + hdma->XferCpltCallback = NULL; + hdma->XferHalfCpltCallback = NULL; + hdma->XferErrorCallback = NULL; + hdma->XferAbortCallback = NULL; + break; + + default: + status = HAL_ERROR; + break; + } + } + else + { + status = HAL_ERROR; + } + + /* Release Lock */ + __HAL_UNLOCK(hdma); + + return status; +} + +/** + * @} + */ + +/** @defgroup DMA_Exported_Functions_Group3 Peripheral State functions + * @brief Peripheral State functions + * +@verbatim + =============================================================================== + ##### State and Errors functions ##### + =============================================================================== + [..] + This subsection provides functions allowing to + (+) Check the DMA state + (+) Get error code + +@endverbatim + * @{ + */ + +/** + * @brief Returns the DMA state. + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @retval HAL state + */ +HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma) +{ + return hdma->State; +} + +/** + * @brief Return the DMA error code + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @retval DMA Error Code + */ +uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma) +{ + return hdma->ErrorCode; +} + +/** + * @} + */ + +/** + * @} + */ + +/** @addtogroup DMA_Private_Functions + * @{ + */ + +/** + * @brief Set the DMA Transfer parameters. + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Channel. + * @param SrcAddress The source memory Buffer address + * @param DstAddress The destination memory Buffer address + * @param DataLength The length of data to be transferred from source to destination + * @retval HAL status + */ +static void DMA_SetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength) +{ + /* Clear all flags */ + hdma->DmaBaseAddress->IFCR = (DMA_FLAG_GL1 << hdma->ChannelIndex); + + /* Configure DMA Channel data length */ + hdma->Instance->CNDTR = DataLength; + + /* Peripheral to Memory */ + if((hdma->Init.Direction) == DMA_MEMORY_TO_PERIPH) + { + /* Configure DMA Channel destination address */ + hdma->Instance->CPAR = DstAddress; + + /* Configure DMA Channel source address */ + hdma->Instance->CMAR = SrcAddress; + } + /* Memory to Peripheral */ + else + { + /* Configure DMA Channel source address */ + hdma->Instance->CPAR = SrcAddress; + + /* Configure DMA Channel destination address */ + hdma->Instance->CMAR = DstAddress; + } +} + +/** + * @brief Set the DMA base address and channel index depending on DMA instance + * @param hdma pointer to a DMA_HandleTypeDef structure that contains + * the configuration information for the specified DMA Stream. + * @retval None + */ +static void DMA_CalcBaseAndBitshift(DMA_HandleTypeDef *hdma) +{ +#if defined (DMA2) + /* calculation of the channel index */ + if ((uint32_t)(hdma->Instance) < (uint32_t)(DMA2_Channel1)) + { + /* DMA1 */ + hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA1_Channel1) / ((uint32_t)DMA1_Channel2 - (uint32_t)DMA1_Channel1)) << 2U; + hdma->DmaBaseAddress = DMA1; + } + else + { + /* DMA2 */ + hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA2_Channel1) / ((uint32_t)DMA2_Channel2 - (uint32_t)DMA2_Channel1)) << 2U; + hdma->DmaBaseAddress = DMA2; + } +#else + /* calculation of the channel index */ + /* DMA1 */ + hdma->ChannelIndex = (((uint32_t)hdma->Instance - (uint32_t)DMA1_Channel1) / ((uint32_t)DMA1_Channel2 - (uint32_t)DMA1_Channel1)) << 2U; + hdma->DmaBaseAddress = DMA1; +#endif +} + +/** + * @} + */ + +/** + * @} + */ +#endif /* HAL_DMA_MODULE_ENABLED */ + +/** + * @} + */ + + /** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_exti.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_exti.c new file mode 100644 index 0000000..bf792a5 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_exti.c @@ -0,0 +1,619 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_exti.c + * @author MCD Application Team + * @brief EXTI HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Extended Interrupts and events controller (EXTI) peripheral: + * + Initialization and de-initialization functions + * + IO operation functions + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### EXTI Peripheral features ##### + ============================================================================== + [..] + (+) Each Exti line can be configured within this driver. + + (+) Exti line can be configured in 3 different modes + (++) Interrupt + (++) Event + (++) Both of them + + (+) Configurable Exti lines can be configured with 3 different triggers + (++) Rising + (++) Falling + (++) Both of them + + (+) When set in interrupt mode, configurable Exti lines have two different + interrupts pending registers which allow to distinguish which transition + occurs: + (++) Rising edge pending interrupt + (++) Falling + + (+) Exti lines 0 to 15 are linked to gpio pin number 0 to 15. Gpio port can + be selected through multiplexer. + + ##### How to use this driver ##### + ============================================================================== + [..] + + (#) Configure the EXTI line using HAL_EXTI_SetConfigLine(). + (++) Choose the interrupt line number by setting "Line" member from + EXTI_ConfigTypeDef structure. + (++) Configure the interrupt and/or event mode using "Mode" member from + EXTI_ConfigTypeDef structure. + (++) For configurable lines, configure rising and/or falling trigger + "Trigger" member from EXTI_ConfigTypeDef structure. + (++) For Exti lines linked to gpio, choose gpio port using "GPIOSel" + member from GPIO_InitTypeDef structure. + + (#) Get current Exti configuration of a dedicated line using + HAL_EXTI_GetConfigLine(). + (++) Provide exiting handle as parameter. + (++) Provide pointer on EXTI_ConfigTypeDef structure as second parameter. + + (#) Clear Exti configuration of a dedicated line using HAL_EXTI_GetConfigLine(). + (++) Provide exiting handle as parameter. + + (#) Register callback to treat Exti interrupts using HAL_EXTI_RegisterCallback(). + (++) Provide exiting handle as first parameter. + (++) Provide which callback will be registered using one value from + EXTI_CallbackIDTypeDef. + (++) Provide callback function pointer. + + (#) Get interrupt pending bit using HAL_EXTI_GetPending(). + + (#) Clear interrupt pending bit using HAL_EXTI_GetPending(). + + (#) Generate software interrupt using HAL_EXTI_GenerateSWI(). + + @endverbatim + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @addtogroup EXTI + * @{ + */ +/** MISRA C:2012 deviation rule has been granted for following rule: + * Rule-18.1_b - Medium: Array `EXTICR' 1st subscript interval [0,7] may be out + * of bounds [0,3] in following API : + * HAL_EXTI_SetConfigLine + * HAL_EXTI_GetConfigLine + * HAL_EXTI_ClearConfigLine + */ + +#ifdef HAL_EXTI_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ +/** @defgroup EXTI_Private_Constants EXTI Private Constants + * @{ + */ +#define EXTI_MODE_OFFSET 0x08u /* 0x20: offset between CPU IMR/EMR registers */ +#define EXTI_CONFIG_OFFSET 0x08u /* 0x20: offset between CPU Rising/Falling configuration registers */ +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ + +/** @addtogroup EXTI_Exported_Functions + * @{ + */ + +/** @addtogroup EXTI_Exported_Functions_Group1 + * @brief Configuration functions + * +@verbatim + =============================================================================== + ##### Configuration functions ##### + =============================================================================== + +@endverbatim + * @{ + */ + +/** + * @brief Set configuration of a dedicated Exti line. + * @param hexti Exti handle. + * @param pExtiConfig Pointer on EXTI configuration to be set. + * @retval HAL Status. + */ +HAL_StatusTypeDef HAL_EXTI_SetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig) +{ + __IO uint32_t *regaddr; + uint32_t regval; + uint32_t linepos; + uint32_t maskline; + uint32_t offset; + + /* Check null pointer */ + if ((hexti == NULL) || (pExtiConfig == NULL)) + { + return HAL_ERROR; + } + + /* Check parameters */ + assert_param(IS_EXTI_LINE(pExtiConfig->Line)); + assert_param(IS_EXTI_MODE(pExtiConfig->Mode)); + + /* Assign line number to handle */ + hexti->Line = pExtiConfig->Line; + + /* Compute line register offset and line mask */ + offset = ((pExtiConfig->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT); + linepos = (pExtiConfig->Line & EXTI_PIN_MASK); + maskline = (1uL << linepos); + + /* Configure triggers for configurable lines */ + if ((pExtiConfig->Line & EXTI_CONFIG) != 0x00u) + { + assert_param(IS_EXTI_TRIGGER(pExtiConfig->Trigger)); + + /* Configure rising trigger */ + regaddr = (&EXTI->RTSR + (EXTI_CONFIG_OFFSET * offset)); + regval = *regaddr; + + /* Mask or set line */ + if ((pExtiConfig->Trigger & EXTI_TRIGGER_RISING) != 0x00u) + { + regval |= maskline; + } + else + { + regval &= ~maskline; + } + + /* Store rising trigger mode */ + *regaddr = regval; + + /* Configure falling trigger */ + regaddr = (&EXTI->FTSR + (EXTI_CONFIG_OFFSET * offset)); + regval = *regaddr; + + /* Mask or set line */ + if ((pExtiConfig->Trigger & EXTI_TRIGGER_FALLING) != 0x00u) + { + regval |= maskline; + } + else + { + regval &= ~maskline; + } + + /* Store falling trigger mode */ + *regaddr = regval; + + /* Configure gpio port selection in case of gpio exti line */ + if ((pExtiConfig->Line & EXTI_GPIO) == EXTI_GPIO) + { + assert_param(IS_EXTI_GPIO_PORT(pExtiConfig->GPIOSel)); + assert_param(IS_EXTI_GPIO_PIN(linepos)); + + regval = SYSCFG->EXTICR[linepos >> 2u]; + regval &= ~(SYSCFG_EXTICR1_EXTI0 << (SYSCFG_EXTICR1_EXTI1_Pos * (linepos & 0x03u))); + regval |= (pExtiConfig->GPIOSel << (SYSCFG_EXTICR1_EXTI1_Pos * (linepos & 0x03u))); + SYSCFG->EXTICR[linepos >> 2u] = regval; + } + } + + /* Configure interrupt mode : read current mode */ + regaddr = (&EXTI->IMR + (EXTI_MODE_OFFSET * offset)); + regval = *regaddr; + + /* Mask or set line */ + if ((pExtiConfig->Mode & EXTI_MODE_INTERRUPT) != 0x00u) + { + regval |= maskline; + } + else + { + regval &= ~maskline; + } + + /* Store interrupt mode */ + *regaddr = regval; + + /* Configure event mode : read current mode */ + regaddr = (&EXTI->EMR + (EXTI_MODE_OFFSET * offset)); + regval = *regaddr; + + /* Mask or set line */ + if ((pExtiConfig->Mode & EXTI_MODE_EVENT) != 0x00u) + { + regval |= maskline; + } + else + { + regval &= ~maskline; + } + + /* Store event mode */ + *regaddr = regval; + + return HAL_OK; +} + +/** + * @brief Get configuration of a dedicated Exti line. + * @param hexti Exti handle. + * @param pExtiConfig Pointer on structure to store Exti configuration. + * @retval HAL Status. + */ +HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig) +{ + __IO uint32_t *regaddr; + uint32_t regval; + uint32_t linepos; + uint32_t maskline; + uint32_t offset; + + /* Check null pointer */ + if ((hexti == NULL) || (pExtiConfig == NULL)) + { + return HAL_ERROR; + } + + /* Check the parameter */ + assert_param(IS_EXTI_LINE(hexti->Line)); + + /* Store handle line number to configuration structure */ + pExtiConfig->Line = hexti->Line; + + /* compute line register offset and line mask */ + offset = ((pExtiConfig->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT); + linepos = (pExtiConfig->Line & EXTI_PIN_MASK); + maskline = (1uL << linepos); + + /* 1] Get core mode : interrupt */ + regaddr = (&EXTI->IMR + (EXTI_MODE_OFFSET * offset)); + regval = *regaddr; + + /* Check if selected line is enable */ + if ((regval & maskline) != 0x00u) + { + pExtiConfig->Mode = EXTI_MODE_INTERRUPT; + } + else + { + pExtiConfig->Mode = EXTI_MODE_NONE; + } + + /* Get event mode */ + regaddr = (&EXTI->EMR + (EXTI_MODE_OFFSET * offset)); + regval = *regaddr; + + /* Check if selected line is enable */ + if ((regval & maskline) != 0x00u) + { + pExtiConfig->Mode |= EXTI_MODE_EVENT; + } + + /* Get default Trigger and GPIOSel configuration */ + pExtiConfig->Trigger = EXTI_TRIGGER_NONE; + pExtiConfig->GPIOSel = 0x00u; + + /* 2] Get trigger for configurable lines : rising */ + if ((pExtiConfig->Line & EXTI_CONFIG) != 0x00u) + { + regaddr = (&EXTI->RTSR + (EXTI_CONFIG_OFFSET * offset)); + regval = *regaddr; + + /* Check if configuration of selected line is enable */ + if ((regval & maskline) != 0x00u) + { + pExtiConfig->Trigger = EXTI_TRIGGER_RISING; + } + + /* Get falling configuration */ + regaddr = (&EXTI->FTSR + (EXTI_CONFIG_OFFSET * offset)); + regval = *regaddr; + + /* Check if configuration of selected line is enable */ + if ((regval & maskline) != 0x00u) + { + pExtiConfig->Trigger |= EXTI_TRIGGER_FALLING; + } + + /* Get Gpio port selection for gpio lines */ + if ((pExtiConfig->Line & EXTI_GPIO) == EXTI_GPIO) + { + assert_param(IS_EXTI_GPIO_PIN(linepos)); + + regval = SYSCFG->EXTICR[linepos >> 2u]; + pExtiConfig->GPIOSel = (regval >> (SYSCFG_EXTICR1_EXTI1_Pos * (linepos & 0x03u))) & SYSCFG_EXTICR1_EXTI0; + } + } + + return HAL_OK; +} + +/** + * @brief Clear whole configuration of a dedicated Exti line. + * @param hexti Exti handle. + * @retval HAL Status. + */ +HAL_StatusTypeDef HAL_EXTI_ClearConfigLine(EXTI_HandleTypeDef *hexti) +{ + __IO uint32_t *regaddr; + uint32_t regval; + uint32_t linepos; + uint32_t maskline; + uint32_t offset; + + /* Check null pointer */ + if (hexti == NULL) + { + return HAL_ERROR; + } + + /* Check the parameter */ + assert_param(IS_EXTI_LINE(hexti->Line)); + + /* compute line register offset and line mask */ + offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT); + linepos = (hexti->Line & EXTI_PIN_MASK); + maskline = (1uL << linepos); + + /* 1] Clear interrupt mode */ + regaddr = (&EXTI->IMR + (EXTI_MODE_OFFSET * offset)); + regval = (*regaddr & ~maskline); + *regaddr = regval; + + /* 2] Clear event mode */ + regaddr = (&EXTI->EMR + (EXTI_MODE_OFFSET * offset)); + regval = (*regaddr & ~maskline); + *regaddr = regval; + + /* 3] Clear triggers in case of configurable lines */ + if ((hexti->Line & EXTI_CONFIG) != 0x00u) + { + regaddr = (&EXTI->RTSR + (EXTI_CONFIG_OFFSET * offset)); + regval = (*regaddr & ~maskline); + *regaddr = regval; + + regaddr = (&EXTI->FTSR + (EXTI_CONFIG_OFFSET * offset)); + regval = (*regaddr & ~maskline); + *regaddr = regval; + + /* Get Gpio port selection for gpio lines */ + if ((hexti->Line & EXTI_GPIO) == EXTI_GPIO) + { + assert_param(IS_EXTI_GPIO_PIN(linepos)); + + regval = SYSCFG->EXTICR[linepos >> 2u]; + regval &= ~(SYSCFG_EXTICR1_EXTI0 << (SYSCFG_EXTICR1_EXTI1_Pos * (linepos & 0x03u))); + SYSCFG->EXTICR[linepos >> 2u] = regval; + } + } + + return HAL_OK; +} + +/** + * @brief Register callback for a dedicated Exti line. + * @param hexti Exti handle. + * @param CallbackID User callback identifier. + * This parameter can be one of @arg @ref EXTI_CallbackIDTypeDef values. + * @param pPendingCbfn function pointer to be stored as callback. + * @retval HAL Status. + */ +HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void)) +{ + HAL_StatusTypeDef status = HAL_OK; + + switch (CallbackID) + { + case HAL_EXTI_COMMON_CB_ID: + hexti->PendingCallback = pPendingCbfn; + break; + + default: + status = HAL_ERROR; + break; + } + + return status; +} + +/** + * @brief Store line number as handle private field. + * @param hexti Exti handle. + * @param ExtiLine Exti line number. + * This parameter can be from 0 to @ref EXTI_LINE_NB. + * @retval HAL Status. + */ +HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine) +{ + /* Check the parameters */ + assert_param(IS_EXTI_LINE(ExtiLine)); + + /* Check null pointer */ + if (hexti == NULL) + { + return HAL_ERROR; + } + else + { + /* Store line number as handle private field */ + hexti->Line = ExtiLine; + + return HAL_OK; + } +} + +/** + * @} + */ + +/** @addtogroup EXTI_Exported_Functions_Group2 + * @brief EXTI IO functions. + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + +@endverbatim + * @{ + */ + +/** + * @brief Handle EXTI interrupt request. + * @param hexti Exti handle. + * @retval none. + */ +void HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti) +{ + __IO uint32_t *regaddr; + uint32_t regval; + uint32_t maskline; + uint32_t offset; + + /* Compute line register offset and line mask */ + offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT); + maskline = (1uL << (hexti->Line & EXTI_PIN_MASK)); + + /* Get pending bit */ + regaddr = (&EXTI->PR + (EXTI_CONFIG_OFFSET * offset)); + regval = (*regaddr & maskline); + + if (regval != 0x00u) + { + /* Clear pending bit */ + EXTI->PR = maskline; + + /* Call callback */ + if (hexti->PendingCallback != NULL) + { + hexti->PendingCallback(); + } + } +} + +/** + * @brief Get interrupt pending bit of a dedicated line. + * @param hexti Exti handle. + * @param Edge Specify which pending edge as to be checked. + * This parameter can be one of the following values: + * @arg @ref EXTI_TRIGGER_RISING_FALLING + * This parameter is kept for compatibility with other series. + * @retval 1 if interrupt is pending else 0. + */ +uint32_t HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge) +{ + __IO uint32_t *regaddr; + uint32_t regval; + uint32_t linepos; + uint32_t maskline; + uint32_t offset; + + /* Check parameters */ + assert_param(IS_EXTI_LINE(hexti->Line)); + assert_param(IS_EXTI_CONFIG_LINE(hexti->Line)); + assert_param(IS_EXTI_PENDING_EDGE(Edge)); + + /* compute line register offset and line mask */ + offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT); + linepos = (hexti->Line & EXTI_PIN_MASK); + maskline = (1uL << linepos); + + /* Get pending bit */ + regaddr = (&EXTI->PR + (EXTI_CONFIG_OFFSET * offset)); + /* return 1 if bit is set else 0 */ + regval = ((*regaddr & maskline) >> linepos); + return regval; +} + +/** + * @brief Clear interrupt pending bit of a dedicated line. + * @param hexti Exti handle. + * @param Edge Specify which pending edge as to be clear. + * This parameter can be one of the following values: + * @arg @ref EXTI_TRIGGER_RISING_FALLING + * This parameter is kept for compatibility with other series. + * @retval None. + */ +void HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge) +{ + __IO uint32_t *regaddr; + uint32_t maskline; + uint32_t offset; + + /* Check parameters */ + assert_param(IS_EXTI_LINE(hexti->Line)); + assert_param(IS_EXTI_CONFIG_LINE(hexti->Line)); + assert_param(IS_EXTI_PENDING_EDGE(Edge)); + + /* compute line register offset and line mask */ + offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT); + maskline = (1uL << (hexti->Line & EXTI_PIN_MASK)); + + /* Get pending bit */ + regaddr = (&EXTI->PR + (EXTI_CONFIG_OFFSET * offset)); + + /* Clear Pending bit */ + *regaddr = maskline; +} + +/** + * @brief Generate a software interrupt for a dedicated line. + * @param hexti Exti handle. + * @retval None. + */ +void HAL_EXTI_GenerateSWI(EXTI_HandleTypeDef *hexti) +{ + __IO uint32_t *regaddr; + uint32_t maskline; + uint32_t offset; + + /* Check parameters */ + assert_param(IS_EXTI_LINE(hexti->Line)); + assert_param(IS_EXTI_CONFIG_LINE(hexti->Line)); + + /* compute line register offset and line mask */ + offset = ((hexti->Line & EXTI_REG_MASK) >> EXTI_REG_SHIFT); + maskline = (1uL << (hexti->Line & EXTI_PIN_MASK)); + + regaddr = (&EXTI->SWIER + (EXTI_CONFIG_OFFSET * offset)); + *regaddr = maskline; +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_EXTI_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c new file mode 100644 index 0000000..9fc21ee --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c @@ -0,0 +1,692 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_flash.c + * @author MCD Application Team + * @brief FLASH HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the internal FLASH memory: + * + Program operations functions + * + Memory Control functions + * + Peripheral State functions + * + @verbatim + ============================================================================== + ##### FLASH peripheral features ##### + ============================================================================== + [..] The Flash memory interface manages CPU AHB I-Code and D-Code accesses + to the Flash memory. It implements the erase and program Flash memory operations + and the read and write protection mechanisms. + + [..] The Flash memory interface accelerates code execution with a system of instruction + prefetch. + + [..] The FLASH main features are: + (+) Flash memory read operations + (+) Flash memory program/erase operations + (+) Read / write protections + (+) Prefetch on I-Code + (+) Option Bytes programming + + + ##### How to use this driver ##### + ============================================================================== + [..] + This driver provides functions and macros to configure and program the FLASH + memory of all STM32F3xx devices. + + (#) FLASH Memory I/O Programming functions: this group includes all needed + functions to erase and program the main memory: + (++) Lock and Unlock the FLASH interface + (++) Erase function: Erase page, erase all pages + (++) Program functions: half word, word and doubleword + (#) FLASH Option Bytes Programming functions: this group includes all needed + functions to manage the Option Bytes: + (++) Lock and Unlock the Option Bytes + (++) Set/Reset the write protection + (++) Set the Read protection Level + (++) Program the user Option Bytes + (++) Launch the Option Bytes loader + (++) Erase Option Bytes + (++) Program the data Option Bytes + (++) Get the Write protection. + (++) Get the user option bytes. + + (#) Interrupts and flags management functions : this group + includes all needed functions to: + (++) Handle FLASH interrupts + (++) Wait for last FLASH operation according to its status + (++) Get error flag status + + [..] In addition to these function, this driver includes a set of macros allowing + to handle the following operations: + + (+) Set/Get the latency + (+) Enable/Disable the prefetch buffer + (+) Enable/Disable the half cycle access + (+) Enable/Disable the FLASH interrupts + (+) Monitor the FLASH flags status + + @endverbatim + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +#ifdef HAL_FLASH_MODULE_ENABLED + +/** @defgroup FLASH FLASH + * @brief FLASH HAL module driver + * @{ + */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup FLASH_Private_Constants FLASH Private Constants + * @{ + */ +/** + * @} + */ + +/* Private macro ---------------------------- ---------------------------------*/ +/** @defgroup FLASH_Private_Macros FLASH Private Macros + * @{ + */ + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup FLASH_Private_Variables FLASH Private Variables + * @{ + */ +/* Variables used for Erase pages under interruption*/ +FLASH_ProcessTypeDef pFlash; +/** + * @} + */ + +/* Private function prototypes -----------------------------------------------*/ +/** @defgroup FLASH_Private_Functions FLASH Private Functions + * @{ + */ +static void FLASH_Program_HalfWord(uint32_t Address, uint16_t Data); +static void FLASH_SetErrorCode(void); +extern void FLASH_PageErase(uint32_t PageAddress); +/** + * @} + */ + +/* Exported functions ---------------------------------------------------------*/ +/** @defgroup FLASH_Exported_Functions FLASH Exported Functions + * @{ + */ + +/** @defgroup FLASH_Exported_Functions_Group1 Programming operation functions + * @brief Programming operation functions + * +@verbatim +@endverbatim + * @{ + */ + +/** + * @brief Program halfword, word or double word at a specified address + * @note The function HAL_FLASH_Unlock() should be called before to unlock the FLASH interface + * The function HAL_FLASH_Lock() should be called after to lock the FLASH interface + * + * @note If an erase and a program operations are requested simultaneously, + * the erase operation is performed before the program one. + * + * @note FLASH should be previously erased before new programming (only exception to this + * is when 0x0000 is programmed) + * + * @param TypeProgram Indicate the way to program at a specified address. + * This parameter can be a value of @ref FLASH_Type_Program + * @param Address Specifie the address to be programmed. + * @param Data Specifie the data to be programmed + * + * @retval HAL_StatusTypeDef HAL Status + */ +HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data) +{ + HAL_StatusTypeDef status = HAL_ERROR; + uint8_t index = 0U; + uint8_t nbiterations = 0U; + + /* Process Locked */ + __HAL_LOCK(&pFlash); + + /* Check the parameters */ + assert_param(IS_FLASH_TYPEPROGRAM(TypeProgram)); + assert_param(IS_FLASH_PROGRAM_ADDRESS(Address)); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(FLASH_TIMEOUT_VALUE); + + if(status == HAL_OK) + { + if(TypeProgram == FLASH_TYPEPROGRAM_HALFWORD) + { + /* Program halfword (16-bit) at a specified address. */ + nbiterations = 1U; + } + else if(TypeProgram == FLASH_TYPEPROGRAM_WORD) + { + /* Program word (32-bit = 2*16-bit) at a specified address. */ + nbiterations = 2U; + } + else + { + /* Program double word (64-bit = 4*16-bit) at a specified address. */ + nbiterations = 4U; + } + + for (index = 0U; index < nbiterations; index++) + { + FLASH_Program_HalfWord((Address + (2U*index)), (uint16_t)(Data >> (16U*index))); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(FLASH_TIMEOUT_VALUE); + + /* If the program operation is completed, disable the PG Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_PG); + /* In case of error, stop programming procedure */ + if (status != HAL_OK) + { + break; + } + } + } + + /* Process Unlocked */ + __HAL_UNLOCK(&pFlash); + + return status; +} + +/** + * @brief Program halfword, word or double word at a specified address with interrupt enabled. + * @note The function HAL_FLASH_Unlock() should be called before to unlock the FLASH interface + * The function HAL_FLASH_Lock() should be called after to lock the FLASH interface + * + * @note If an erase and a program operations are requested simultaneously, + * the erase operation is performed before the program one. + * + * @param TypeProgram Indicate the way to program at a specified address. + * This parameter can be a value of @ref FLASH_Type_Program + * @param Address Specifie the address to be programmed. + * @param Data Specifie the data to be programmed + * + * @retval HAL_StatusTypeDef HAL Status + */ +HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Process Locked */ + __HAL_LOCK(&pFlash); + + /* Check the parameters */ + assert_param(IS_FLASH_TYPEPROGRAM(TypeProgram)); + assert_param(IS_FLASH_PROGRAM_ADDRESS(Address)); + + /* Enable End of FLASH Operation and Error source interrupts */ + __HAL_FLASH_ENABLE_IT(FLASH_IT_EOP | FLASH_IT_ERR); + + pFlash.Address = Address; + pFlash.Data = Data; + + if(TypeProgram == FLASH_TYPEPROGRAM_HALFWORD) + { + pFlash.ProcedureOnGoing = FLASH_PROC_PROGRAMHALFWORD; + /* Program halfword (16-bit) at a specified address. */ + pFlash.DataRemaining = 1U; + } + else if(TypeProgram == FLASH_TYPEPROGRAM_WORD) + { + pFlash.ProcedureOnGoing = FLASH_PROC_PROGRAMWORD; + /* Program word (32-bit : 2*16-bit) at a specified address. */ + pFlash.DataRemaining = 2U; + } + else + { + pFlash.ProcedureOnGoing = FLASH_PROC_PROGRAMDOUBLEWORD; + /* Program double word (64-bit : 4*16-bit) at a specified address. */ + pFlash.DataRemaining = 4U; + } + + /* Program halfword (16-bit) at a specified address. */ + FLASH_Program_HalfWord(Address, (uint16_t)Data); + + return status; +} + +/** + * @brief This function handles FLASH interrupt request. + * @retval None + */ +void HAL_FLASH_IRQHandler(void) +{ + uint32_t addresstmp = 0U; + + /* Check FLASH operation error flags */ + if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_WRPERR) ||__HAL_FLASH_GET_FLAG(FLASH_FLAG_PGERR)) + { + /* Return the faulty address */ + addresstmp = pFlash.Address; + /* Reset address */ + pFlash.Address = 0xFFFFFFFFU; + + /* Save the Error code */ + FLASH_SetErrorCode(); + + /* FLASH error interrupt user callback */ + HAL_FLASH_OperationErrorCallback(addresstmp); + + /* Stop the procedure ongoing */ + pFlash.ProcedureOnGoing = FLASH_PROC_NONE; + } + + /* Check FLASH End of Operation flag */ + if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_EOP)) + { + /* Clear FLASH End of Operation pending bit */ + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP); + + /* Process can continue only if no error detected */ + if(pFlash.ProcedureOnGoing != FLASH_PROC_NONE) + { + if(pFlash.ProcedureOnGoing == FLASH_PROC_PAGEERASE) + { + /* Nb of pages to erased can be decreased */ + pFlash.DataRemaining--; + + /* Check if there are still pages to erase */ + if(pFlash.DataRemaining != 0U) + { + addresstmp = pFlash.Address; + /*Indicate user which sector has been erased */ + HAL_FLASH_EndOfOperationCallback(addresstmp); + + /*Increment sector number*/ + addresstmp = pFlash.Address + FLASH_PAGE_SIZE; + pFlash.Address = addresstmp; + + /* If the erase operation is completed, disable the PER Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_PER); + + FLASH_PageErase(addresstmp); + } + else + { + /* No more pages to Erase, user callback can be called. */ + /* Reset Sector and stop Erase pages procedure */ + pFlash.Address = addresstmp = 0xFFFFFFFFU; + pFlash.ProcedureOnGoing = FLASH_PROC_NONE; + /* FLASH EOP interrupt user callback */ + HAL_FLASH_EndOfOperationCallback(addresstmp); + } + } + else if(pFlash.ProcedureOnGoing == FLASH_PROC_MASSERASE) + { + /* Operation is completed, disable the MER Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_MER); + + /* MassErase ended. Return the selected bank */ + /* FLASH EOP interrupt user callback */ + HAL_FLASH_EndOfOperationCallback(0U); + + /* Stop Mass Erase procedure*/ + pFlash.ProcedureOnGoing = FLASH_PROC_NONE; + } + else + { + /* Nb of 16-bit data to program can be decreased */ + pFlash.DataRemaining--; + + /* Check if there are still 16-bit data to program */ + if(pFlash.DataRemaining != 0U) + { + /* Increment address to 16-bit */ + pFlash.Address += 2U; + addresstmp = pFlash.Address; + + /* Shift to have next 16-bit data */ + pFlash.Data = (pFlash.Data >> 16U); + + /* Operation is completed, disable the PG Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_PG); + + /*Program halfword (16-bit) at a specified address.*/ + FLASH_Program_HalfWord(addresstmp, (uint16_t)pFlash.Data); + } + else + { + /* Program ended. Return the selected address */ + /* FLASH EOP interrupt user callback */ + if (pFlash.ProcedureOnGoing == FLASH_PROC_PROGRAMHALFWORD) + { + HAL_FLASH_EndOfOperationCallback(pFlash.Address); + } + else if (pFlash.ProcedureOnGoing == FLASH_PROC_PROGRAMWORD) + { + HAL_FLASH_EndOfOperationCallback(pFlash.Address - 2U); + } + else + { + HAL_FLASH_EndOfOperationCallback(pFlash.Address - 6U); + } + + /* Reset Address and stop Program procedure */ + pFlash.Address = 0xFFFFFFFFU; + pFlash.ProcedureOnGoing = FLASH_PROC_NONE; + } + } + } + } + + + if(pFlash.ProcedureOnGoing == FLASH_PROC_NONE) + { + /* Operation is completed, disable the PG, PER and MER Bits */ + CLEAR_BIT(FLASH->CR, (FLASH_CR_PG | FLASH_CR_PER | FLASH_CR_MER)); + + /* Disable End of FLASH Operation and Error source interrupts */ + __HAL_FLASH_DISABLE_IT(FLASH_IT_EOP | FLASH_IT_ERR); + + /* Process Unlocked */ + __HAL_UNLOCK(&pFlash); + } +} + +/** + * @brief FLASH end of operation interrupt callback + * @param ReturnValue The value saved in this parameter depends on the ongoing procedure + * - Mass Erase: No return value expected + * - Pages Erase: Address of the page which has been erased + * (if 0xFFFFFFFF, it means that all the selected pages have been erased) + * - Program: Address which was selected for data program + * @retval none + */ +__weak void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(ReturnValue); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FLASH_EndOfOperationCallback could be implemented in the user file + */ +} + +/** + * @brief FLASH operation error interrupt callback + * @param ReturnValue The value saved in this parameter depends on the ongoing procedure + * - Mass Erase: No return value expected + * - Pages Erase: Address of the page which returned an error + * - Program: Address which was selected for data program + * @retval none + */ +__weak void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(ReturnValue); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_FLASH_OperationErrorCallback could be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup FLASH_Exported_Functions_Group2 Peripheral Control functions + * @brief management functions + * +@verbatim + =============================================================================== + ##### Peripheral Control functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to control the FLASH + memory operations. + +@endverbatim + * @{ + */ + +/** + * @brief Unlock the FLASH control register access + * @retval HAL Status + */ +HAL_StatusTypeDef HAL_FLASH_Unlock(void) +{ + HAL_StatusTypeDef status = HAL_OK; + + if(READ_BIT(FLASH->CR, FLASH_CR_LOCK) != RESET) + { + /* Authorize the FLASH Registers access */ + WRITE_REG(FLASH->KEYR, FLASH_KEY1); + WRITE_REG(FLASH->KEYR, FLASH_KEY2); + + /* Verify Flash is unlocked */ + if(READ_BIT(FLASH->CR, FLASH_CR_LOCK) != RESET) + { + status = HAL_ERROR; + } + } + + return status; +} + +/** + * @brief Locks the FLASH control register access + * @retval HAL Status + */ +HAL_StatusTypeDef HAL_FLASH_Lock(void) +{ + /* Set the LOCK Bit to lock the FLASH Registers access */ + SET_BIT(FLASH->CR, FLASH_CR_LOCK); + + return HAL_OK; +} + +/** + * @brief Unlock the FLASH Option Control Registers access. + * @retval HAL Status + */ +HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void) +{ + if (HAL_IS_BIT_CLR(FLASH->CR, FLASH_CR_OPTWRE)) + { + /* Authorizes the Option Byte register programming */ + WRITE_REG(FLASH->OPTKEYR, FLASH_OPTKEY1); + WRITE_REG(FLASH->OPTKEYR, FLASH_OPTKEY2); + } + else + { + return HAL_ERROR; + } + + return HAL_OK; +} + +/** + * @brief Lock the FLASH Option Control Registers access. + * @retval HAL Status + */ +HAL_StatusTypeDef HAL_FLASH_OB_Lock(void) +{ + /* Clear the OPTWRE Bit to lock the FLASH Option Byte Registers access */ + CLEAR_BIT(FLASH->CR, FLASH_CR_OPTWRE); + + return HAL_OK; +} + +/** + * @brief Launch the option byte loading. + * @note This function will reset automatically the MCU. + * @retval HAL Status + */ +HAL_StatusTypeDef HAL_FLASH_OB_Launch(void) +{ + /* Set the OBL_Launch bit to launch the option byte loading */ + SET_BIT(FLASH->CR, FLASH_CR_OBL_LAUNCH); + + /* Wait for last operation to be completed */ + return(FLASH_WaitForLastOperation(FLASH_TIMEOUT_VALUE)); +} + +/** + * @} + */ + +/** @defgroup FLASH_Exported_Functions_Group3 Peripheral errors functions + * @brief Peripheral errors functions + * +@verbatim + =============================================================================== + ##### Peripheral Errors functions ##### + =============================================================================== + [..] + This subsection permit to get in run-time errors of the FLASH peripheral. + +@endverbatim + * @{ + */ + +/** + * @brief Get the specific FLASH error flag. + * @retval FLASH_ErrorCode The returned value can be: + * @ref FLASH_Error_Codes + */ +uint32_t HAL_FLASH_GetError(void) +{ + return pFlash.ErrorCode; +} + +/** + * @} + */ + +/** + * @} + */ + +/** @addtogroup FLASH_Private_Functions + * @{ + */ + +/** + * @brief Program a half-word (16-bit) at a specified address. + * @param Address specify the address to be programmed. + * @param Data specify the data to be programmed. + * @retval None + */ +static void FLASH_Program_HalfWord(uint32_t Address, uint16_t Data) +{ + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* Proceed to program the new data */ + SET_BIT(FLASH->CR, FLASH_CR_PG); + + /* Write data in the address */ + *(__IO uint16_t*)Address = Data; +} + +/** + * @brief Wait for a FLASH operation to complete. + * @param Timeout maximum flash operation timeout + * @retval HAL Status + */ +HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout) +{ + /* Wait for the FLASH operation to complete by polling on BUSY flag to be reset. + Even if the FLASH operation fails, the BUSY flag will be reset and an error + flag will be set */ + + uint32_t tickstart = HAL_GetTick(); + + while(__HAL_FLASH_GET_FLAG(FLASH_FLAG_BSY)) + { + if (Timeout != HAL_MAX_DELAY) + { + if((Timeout == 0U) || ((HAL_GetTick()-tickstart) > Timeout)) + { + return HAL_TIMEOUT; + } + } + } + + /* Check FLASH End of Operation flag */ + if (__HAL_FLASH_GET_FLAG(FLASH_FLAG_EOP)) + { + /* Clear FLASH End of Operation pending bit */ + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP); + } + + if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_WRPERR) || + __HAL_FLASH_GET_FLAG(FLASH_FLAG_PGERR)) + { + /*Save the error code*/ + FLASH_SetErrorCode(); + return HAL_ERROR; + } + + /* There is no error flag set */ + return HAL_OK; +} + + +/** + * @brief Set the specific FLASH error flag. + * @retval None + */ +static void FLASH_SetErrorCode(void) +{ + uint32_t flags = 0U; + + if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_WRPERR)) + { + pFlash.ErrorCode |= HAL_FLASH_ERROR_WRP; + flags |= FLASH_FLAG_WRPERR; + } + if(__HAL_FLASH_GET_FLAG(FLASH_FLAG_PGERR)) + { + pFlash.ErrorCode |= HAL_FLASH_ERROR_PROG; + flags |= FLASH_FLAG_PGERR; + } + /* Clear FLASH error pending bits */ + __HAL_FLASH_CLEAR_FLAG(flags); +} +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_FLASH_MODULE_ENABLED */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c new file mode 100644 index 0000000..9222cea --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c @@ -0,0 +1,980 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_flash_ex.c + * @author MCD Application Team + * @brief Extended FLASH HAL module driver. + * + * This file provides firmware functions to manage the following + * functionalities of the FLASH peripheral: + * + Extended Initialization/de-initialization functions + * + Extended I/O operation functions + * + Extended Peripheral Control functions + * + @verbatim + ============================================================================== + ##### Flash peripheral extended features ##### + ============================================================================== + + ##### How to use this driver ##### + ============================================================================== + [..] This driver provides functions to configure and program the FLASH memory + of all STM32F3xxx devices. It includes + + (++) Set/Reset the write protection + (++) Program the user Option Bytes + (++) Get the Read protection Level + + @endverbatim + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ +#ifdef HAL_FLASH_MODULE_ENABLED + +/** @addtogroup FLASH + * @{ + */ +/** @addtogroup FLASH_Private_Variables + * @{ + */ +/* Variables used for Erase pages under interruption*/ +extern FLASH_ProcessTypeDef pFlash; +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup FLASHEx FLASHEx + * @brief FLASH HAL Extension module driver + * @{ + */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup FLASHEx_Private_Constants FLASHEx Private Constants + * @{ + */ +#define FLASH_POSITION_IWDGSW_BIT (uint32_t)POSITION_VAL(FLASH_OBR_IWDG_SW) +#define FLASH_POSITION_OB_USERDATA0_BIT (uint32_t)POSITION_VAL(FLASH_OBR_DATA0) +#define FLASH_POSITION_OB_USERDATA1_BIT (uint32_t)POSITION_VAL(FLASH_OBR_DATA1) +/** + * @} + */ + +/* Private macro -------------------------------------------------------------*/ +/** @defgroup FLASHEx_Private_Macros FLASHEx Private Macros + * @{ + */ +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/** @defgroup FLASHEx_Private_Functions FLASHEx Private Functions + * @{ + */ +/* Erase operations */ +static void FLASH_MassErase(void); +void FLASH_PageErase(uint32_t PageAddress); + +/* Option bytes control */ +static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WriteProtectPage); +static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WriteProtectPage); +static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig(uint8_t ReadProtectLevel); +static HAL_StatusTypeDef FLASH_OB_UserConfig(uint8_t UserConfig); +static HAL_StatusTypeDef FLASH_OB_ProgramData(uint32_t Address, uint8_t Data); +static uint32_t FLASH_OB_GetWRP(void); +static uint32_t FLASH_OB_GetRDP(void); +static uint8_t FLASH_OB_GetUser(void); + +/** + * @} + */ + +/* Exported functions ---------------------------------------------------------*/ +/** @defgroup FLASHEx_Exported_Functions FLASHEx Exported Functions + * @{ + */ + +/** @defgroup FLASHEx_Exported_Functions_Group1 FLASHEx Memory Erasing functions + * @brief FLASH Memory Erasing functions + * +@verbatim + ============================================================================== + ##### FLASH Erasing Programming functions ##### + ============================================================================== + + [..] The FLASH Memory Erasing functions, includes the following functions: + (+) HAL_FLASHEx_Erase: return only when erase has been done + (+) HAL_FLASHEx_Erase_IT: end of erase is done when HAL_FLASH_EndOfOperationCallback + is called with parameter 0xFFFFFFFF + + [..] Any operation of erase should follow these steps: + (#) Call the HAL_FLASH_Unlock() function to enable the flash control register and + program memory access. + (#) Call the desired function to erase page. + (#) Call the HAL_FLASH_Lock() to disable the flash program memory access + (recommended to protect the FLASH memory against possible unwanted operation). + +@endverbatim + * @{ + */ + + +/** + * @brief Perform a mass erase or erase the specified FLASH memory pages + * @note To correctly run this function, the @ref HAL_FLASH_Unlock() function + * must be called before. + * Call the @ref HAL_FLASH_Lock() to disable the flash memory access + * (recommended to protect the FLASH memory against possible unwanted operation) + * @param[in] pEraseInit pointer to an FLASH_EraseInitTypeDef structure that + * contains the configuration information for the erasing. + * + * @param[out] PageError pointer to variable that + * contains the configuration information on faulty page in case of error + * (0xFFFFFFFF means that all the pages have been correctly erased) + * + * @retval HAL_StatusTypeDef HAL Status + */ +HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError) +{ + HAL_StatusTypeDef status = HAL_ERROR; + uint32_t address = 0U; + + /* Process Locked */ + __HAL_LOCK(&pFlash); + + /* Check the parameters */ + assert_param(IS_FLASH_TYPEERASE(pEraseInit->TypeErase)); + + if (pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE) + { + /* Mass Erase requested for Bank1 */ + /* Wait for last operation to be completed */ + if (FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE) == HAL_OK) + { + /*Mass erase to be done*/ + FLASH_MassErase(); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + /* If the erase operation is completed, disable the MER Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_MER); + } + } + else + { + /* Page Erase is requested */ + /* Check the parameters */ + assert_param(IS_FLASH_PROGRAM_ADDRESS(pEraseInit->PageAddress)); + assert_param(IS_FLASH_NB_PAGES(pEraseInit->PageAddress, pEraseInit->NbPages)); + + /* Page Erase requested on address located on bank1 */ + /* Wait for last operation to be completed */ + if (FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE) == HAL_OK) + { + /*Initialization of PageError variable*/ + *PageError = 0xFFFFFFFFU; + + /* Erase page by page to be done*/ + for(address = pEraseInit->PageAddress; + address < ((pEraseInit->NbPages * FLASH_PAGE_SIZE) + pEraseInit->PageAddress); + address += FLASH_PAGE_SIZE) + { + FLASH_PageErase(address); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + /* If the erase operation is completed, disable the PER Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_PER); + + if (status != HAL_OK) + { + /* In case of error, stop erase procedure and return the faulty address */ + *PageError = address; + break; + } + } + } + } + + /* Process Unlocked */ + __HAL_UNLOCK(&pFlash); + + return status; +} + +/** + * @brief Perform a mass erase or erase the specified FLASH memory pages with interrupt enabled + * @note To correctly run this function, the @ref HAL_FLASH_Unlock() function + * must be called before. + * Call the @ref HAL_FLASH_Lock() to disable the flash memory access + * (recommended to protect the FLASH memory against possible unwanted operation) + * @param pEraseInit pointer to an FLASH_EraseInitTypeDef structure that + * contains the configuration information for the erasing. + * + * @retval HAL_StatusTypeDef HAL Status + */ +HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Process Locked */ + __HAL_LOCK(&pFlash); + + /* If procedure already ongoing, reject the next one */ + if (pFlash.ProcedureOnGoing != FLASH_PROC_NONE) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_FLASH_TYPEERASE(pEraseInit->TypeErase)); + + /* Enable End of FLASH Operation and Error source interrupts */ + __HAL_FLASH_ENABLE_IT(FLASH_IT_EOP | FLASH_IT_ERR); + + if (pEraseInit->TypeErase == FLASH_TYPEERASE_MASSERASE) + { + /*Mass erase to be done*/ + pFlash.ProcedureOnGoing = FLASH_PROC_MASSERASE; + FLASH_MassErase(); + } + else + { + /* Erase by page to be done*/ + + /* Check the parameters */ + assert_param(IS_FLASH_PROGRAM_ADDRESS(pEraseInit->PageAddress)); + assert_param(IS_FLASH_NB_PAGES(pEraseInit->PageAddress, pEraseInit->NbPages)); + + pFlash.ProcedureOnGoing = FLASH_PROC_PAGEERASE; + pFlash.DataRemaining = pEraseInit->NbPages; + pFlash.Address = pEraseInit->PageAddress; + + /*Erase 1st page and wait for IT*/ + FLASH_PageErase(pEraseInit->PageAddress); + } + + return status; +} + +/** + * @} + */ + +/** @defgroup FLASHEx_Exported_Functions_Group2 Option Bytes Programming functions + * @brief Option Bytes Programming functions + * +@verbatim + ============================================================================== + ##### Option Bytes Programming functions ##### + ============================================================================== + [..] + This subsection provides a set of functions allowing to control the FLASH + option bytes operations. + +@endverbatim + * @{ + */ + +/** + * @brief Erases the FLASH option bytes. + * @note This functions erases all option bytes except the Read protection (RDP). + * The function @ref HAL_FLASH_Unlock() should be called before to unlock the FLASH interface + * The function @ref HAL_FLASH_OB_Unlock() should be called before to unlock the options bytes + * The function @ref HAL_FLASH_OB_Launch() should be called after to force the reload of the options bytes + * (system reset will occur) + * @retval HAL status + */ + +HAL_StatusTypeDef HAL_FLASHEx_OBErase(void) +{ + uint8_t rdptmp = OB_RDP_LEVEL_0; + HAL_StatusTypeDef status = HAL_ERROR; + + /* Get the actual read protection Option Byte value */ + rdptmp = FLASH_OB_GetRDP(); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + if(status == HAL_OK) + { + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* If the previous operation is completed, proceed to erase the option bytes */ + SET_BIT(FLASH->CR, FLASH_CR_OPTER); + SET_BIT(FLASH->CR, FLASH_CR_STRT); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + /* If the erase operation is completed, disable the OPTER Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_OPTER); + + if(status == HAL_OK) + { + /* Restore the last read protection Option Byte value */ + status = FLASH_OB_RDP_LevelConfig(rdptmp); + } + } + + /* Return the erase status */ + return status; +} + +/** + * @brief Program option bytes + * @note The function @ref HAL_FLASH_Unlock() should be called before to unlock the FLASH interface + * The function @ref HAL_FLASH_OB_Unlock() should be called before to unlock the options bytes + * The function @ref HAL_FLASH_OB_Launch() should be called after to force the reload of the options bytes + * (system reset will occur) + * + * @param pOBInit pointer to an FLASH_OBInitStruct structure that + * contains the configuration information for the programming. + * + * @retval HAL_StatusTypeDef HAL Status + */ +HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit) +{ + HAL_StatusTypeDef status = HAL_ERROR; + + /* Process Locked */ + __HAL_LOCK(&pFlash); + + /* Check the parameters */ + assert_param(IS_OPTIONBYTE(pOBInit->OptionType)); + + /* Write protection configuration */ + if((pOBInit->OptionType & OPTIONBYTE_WRP) == OPTIONBYTE_WRP) + { + assert_param(IS_WRPSTATE(pOBInit->WRPState)); + if (pOBInit->WRPState == OB_WRPSTATE_ENABLE) + { + /* Enable of Write protection on the selected page */ + status = FLASH_OB_EnableWRP(pOBInit->WRPPage); + } + else + { + /* Disable of Write protection on the selected page */ + status = FLASH_OB_DisableWRP(pOBInit->WRPPage); + } + if (status != HAL_OK) + { + /* Process Unlocked */ + __HAL_UNLOCK(&pFlash); + return status; + } + } + + /* Read protection configuration */ + if((pOBInit->OptionType & OPTIONBYTE_RDP) == OPTIONBYTE_RDP) + { + status = FLASH_OB_RDP_LevelConfig(pOBInit->RDPLevel); + if (status != HAL_OK) + { + /* Process Unlocked */ + __HAL_UNLOCK(&pFlash); + return status; + } + } + + /* USER configuration */ + if((pOBInit->OptionType & OPTIONBYTE_USER) == OPTIONBYTE_USER) + { + status = FLASH_OB_UserConfig(pOBInit->USERConfig); + if (status != HAL_OK) + { + /* Process Unlocked */ + __HAL_UNLOCK(&pFlash); + return status; + } + } + + /* DATA configuration*/ + if((pOBInit->OptionType & OPTIONBYTE_DATA) == OPTIONBYTE_DATA) + { + status = FLASH_OB_ProgramData(pOBInit->DATAAddress, pOBInit->DATAData); + if (status != HAL_OK) + { + /* Process Unlocked */ + __HAL_UNLOCK(&pFlash); + return status; + } + } + + /* Process Unlocked */ + __HAL_UNLOCK(&pFlash); + + return status; +} + +/** + * @brief Get the Option byte configuration + * @param pOBInit pointer to an FLASH_OBInitStruct structure that + * contains the configuration information for the programming. + * + * @retval None + */ +void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit) +{ + pOBInit->OptionType = OPTIONBYTE_WRP | OPTIONBYTE_RDP | OPTIONBYTE_USER; + + /*Get WRP*/ + pOBInit->WRPPage = FLASH_OB_GetWRP(); + + /*Get RDP Level*/ + pOBInit->RDPLevel = FLASH_OB_GetRDP(); + + /*Get USER*/ + pOBInit->USERConfig = FLASH_OB_GetUser(); +} + +/** + * @brief Get the Option byte user data + * @param DATAAdress Address of the option byte DATA + * This parameter can be one of the following values: + * @arg @ref OB_DATA_ADDRESS_DATA0 + * @arg @ref OB_DATA_ADDRESS_DATA1 + * @retval Value programmed in USER data + */ +uint32_t HAL_FLASHEx_OBGetUserData(uint32_t DATAAdress) +{ + uint32_t value = 0U; + + if (DATAAdress == OB_DATA_ADDRESS_DATA0) + { + /* Get value programmed in OB USER Data0 */ + value = READ_BIT(FLASH->OBR, FLASH_OBR_DATA0) >> FLASH_POSITION_OB_USERDATA0_BIT; + } + else + { + /* Get value programmed in OB USER Data1 */ + value = READ_BIT(FLASH->OBR, FLASH_OBR_DATA1) >> FLASH_POSITION_OB_USERDATA1_BIT; + } + + return value; +} + +/** + * @} + */ + +/** + * @} + */ + +/** @addtogroup FLASHEx_Private_Functions + * @{ + */ + +/** + * @brief Full erase of FLASH memory Bank + * + * @retval None + */ +static void FLASH_MassErase(void) +{ + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* Only bank1 will be erased*/ + SET_BIT(FLASH->CR, FLASH_CR_MER); + SET_BIT(FLASH->CR, FLASH_CR_STRT); +} + +/** + * @brief Enable the write protection of the desired pages + * @note An option byte erase is done automatically in this function. + * @note When the memory read protection level is selected (RDP level = 1), + * it is not possible to program or erase the flash page i if + * debug features are connected or boot code is executed in RAM, even if nWRPi = 1 + * + * @param WriteProtectPage specifies the page(s) to be write protected. + * The value of this parameter depend on device used within the same series + * @retval HAL status + */ +static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WriteProtectPage) +{ + HAL_StatusTypeDef status = HAL_OK; + uint16_t WRP0_Data = 0xFFFFU; +#if defined(OB_WRP1_WRP1) + uint16_t WRP1_Data = 0xFFFFU; +#endif /* OB_WRP1_WRP1 */ +#if defined(OB_WRP2_WRP2) + uint16_t WRP2_Data = 0xFFFFU; +#endif /* OB_WRP2_WRP2 */ +#if defined(OB_WRP3_WRP3) + uint16_t WRP3_Data = 0xFFFFU; +#endif /* OB_WRP3_WRP3 */ + + /* Check the parameters */ + assert_param(IS_OB_WRP(WriteProtectPage)); + + /* Get current write protected pages and the new pages to be protected ******/ + WriteProtectPage = (uint32_t)(~((~FLASH_OB_GetWRP()) | WriteProtectPage)); + +#if defined(OB_WRP_PAGES0TO15MASK) + WRP0_Data = (uint16_t)(WriteProtectPage & OB_WRP_PAGES0TO15MASK); +#endif /* OB_WRP_PAGES0TO31MASK */ + +#if defined(OB_WRP_PAGES16TO31MASK) + WRP1_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES16TO31MASK) >> 8U); +#endif /* OB_WRP_PAGES32TO63MASK */ + +#if defined(OB_WRP_PAGES32TO47MASK) + WRP2_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES32TO47MASK) >> 16U); +#endif /* OB_WRP_PAGES32TO47MASK */ + +#if defined(OB_WRP_PAGES48TO127MASK) + WRP3_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES48TO127MASK) >> 24U); +#elif defined(OB_WRP_PAGES48TO255MASK) + WRP3_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES48TO255MASK) >> 24U); +#endif /* OB_WRP_PAGES48TO63MASK */ + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + if(status == HAL_OK) + { + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* To be able to write again option byte, need to perform a option byte erase */ + status = HAL_FLASHEx_OBErase(); + if (status == HAL_OK) + { + /* Enable write protection */ + SET_BIT(FLASH->CR, FLASH_CR_OPTPG); + +#if defined(OB_WRP0_WRP0) + if(WRP0_Data != 0xFFU) + { + OB->WRP0 &= WRP0_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + } +#endif /* OB_WRP0_WRP0 */ + +#if defined(OB_WRP1_WRP1) + if((status == HAL_OK) && (WRP1_Data != 0xFFU)) + { + OB->WRP1 &= WRP1_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + } +#endif /* OB_WRP1_WRP1 */ + +#if defined(OB_WRP2_WRP2) + if((status == HAL_OK) && (WRP2_Data != 0xFFU)) + { + OB->WRP2 &= WRP2_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + } +#endif /* OB_WRP2_WRP2 */ + +#if defined(OB_WRP3_WRP3) + if((status == HAL_OK) && (WRP3_Data != 0xFFU)) + { + OB->WRP3 &= WRP3_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + } +#endif /* OB_WRP3_WRP3 */ + + /* if the program operation is completed, disable the OPTPG Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_OPTPG); + } + } + + return status; +} + +/** + * @brief Disable the write protection of the desired pages + * @note An option byte erase is done automatically in this function. + * @note When the memory read protection level is selected (RDP level = 1), + * it is not possible to program or erase the flash page i if + * debug features are connected or boot code is executed in RAM, even if nWRPi = 1 + * + * @param WriteProtectPage specifies the page(s) to be write unprotected. + * The value of this parameter depend on device used within the same series + * @retval HAL status + */ +static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WriteProtectPage) +{ + HAL_StatusTypeDef status = HAL_OK; + uint16_t WRP0_Data = 0xFFFFU; +#if defined(OB_WRP1_WRP1) + uint16_t WRP1_Data = 0xFFFFU; +#endif /* OB_WRP1_WRP1 */ +#if defined(OB_WRP2_WRP2) + uint16_t WRP2_Data = 0xFFFFU; +#endif /* OB_WRP2_WRP2 */ +#if defined(OB_WRP3_WRP3) + uint16_t WRP3_Data = 0xFFFFU; +#endif /* OB_WRP3_WRP3 */ + + /* Check the parameters */ + assert_param(IS_OB_WRP(WriteProtectPage)); + + /* Get current write protected pages and the new pages to be unprotected ******/ + WriteProtectPage = (FLASH_OB_GetWRP() | WriteProtectPage); + +#if defined(OB_WRP_PAGES0TO15MASK) + WRP0_Data = (uint16_t)(WriteProtectPage & OB_WRP_PAGES0TO15MASK); +#endif /* OB_WRP_PAGES0TO31MASK */ + +#if defined(OB_WRP_PAGES16TO31MASK) + WRP1_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES16TO31MASK) >> 8U); +#endif /* OB_WRP_PAGES32TO63MASK */ + +#if defined(OB_WRP_PAGES32TO47MASK) + WRP2_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES32TO47MASK) >> 16U); +#endif /* OB_WRP_PAGES32TO47MASK */ + +#if defined(OB_WRP_PAGES48TO127MASK) + WRP3_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES48TO127MASK) >> 24U); +#elif defined(OB_WRP_PAGES48TO255MASK) + WRP3_Data = (uint16_t)((WriteProtectPage & OB_WRP_PAGES48TO255MASK) >> 24U); +#endif /* OB_WRP_PAGES48TO63MASK */ + + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + if(status == HAL_OK) + { + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* To be able to write again option byte, need to perform a option byte erase */ + status = HAL_FLASHEx_OBErase(); + if (status == HAL_OK) + { + SET_BIT(FLASH->CR, FLASH_CR_OPTPG); + +#if defined(OB_WRP0_WRP0) + if(WRP0_Data != 0xFFU) + { + OB->WRP0 |= WRP0_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + } +#endif /* OB_WRP0_WRP0 */ + +#if defined(OB_WRP1_WRP1) + if((status == HAL_OK) && (WRP1_Data != 0xFFU)) + { + OB->WRP1 |= WRP1_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + } +#endif /* OB_WRP1_WRP1 */ + +#if defined(OB_WRP2_WRP2) + if((status == HAL_OK) && (WRP2_Data != 0xFFU)) + { + OB->WRP2 |= WRP2_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + } +#endif /* OB_WRP2_WRP2 */ + +#if defined(OB_WRP3_WRP3) + if((status == HAL_OK) && (WRP3_Data != 0xFFU)) + { + OB->WRP3 |= WRP3_Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + } +#endif /* OB_WRP3_WRP3 */ + + /* if the program operation is completed, disable the OPTPG Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_OPTPG); + } + } + return status; +} + +/** + * @brief Set the read protection level. + * @param ReadProtectLevel specifies the read protection level. + * This parameter can be one of the following values: + * @arg @ref OB_RDP_LEVEL_0 No protection + * @arg @ref OB_RDP_LEVEL_1 Read protection of the memory + * @arg @ref OB_RDP_LEVEL_2 Full chip protection + * @note Warning: When enabling OB_RDP level 2 it's no more possible to go back to level 1 or 0 + * @retval HAL status + */ +static HAL_StatusTypeDef FLASH_OB_RDP_LevelConfig(uint8_t ReadProtectLevel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_OB_RDP_LEVEL(ReadProtectLevel)); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + if(status == HAL_OK) + { + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* If the previous operation is completed, proceed to erase the option bytes */ + SET_BIT(FLASH->CR, FLASH_CR_OPTER); + SET_BIT(FLASH->CR, FLASH_CR_STRT); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + /* If the erase operation is completed, disable the OPTER Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_OPTER); + + if(status == HAL_OK) + { + /* Enable the Option Bytes Programming operation */ + SET_BIT(FLASH->CR, FLASH_CR_OPTPG); + + WRITE_REG(OB->RDP, ReadProtectLevel); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + /* if the program operation is completed, disable the OPTPG Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_OPTPG); + } + } + + return status; +} + +/** + * @brief Program the FLASH User Option Byte. + * @note Programming of the OB should be performed only after an erase (otherwise PGERR occurs) + * @param UserConfig The FLASH User Option Bytes values: IWDG_SW(Bit0), RST_STOP(Bit1), RST_STDBY(Bit2), nBOOT1(Bit4), + * VDDA_Analog_Monitoring(Bit5) and SRAM_Parity_Enable(Bit6). + * And SDADC12_VDD_MONITOR(Bit7) for STM32F373 or STM32F378 . + * @retval HAL status + */ +static HAL_StatusTypeDef FLASH_OB_UserConfig(uint8_t UserConfig) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_OB_IWDG_SOURCE((UserConfig&OB_IWDG_SW))); + assert_param(IS_OB_STOP_SOURCE((UserConfig&OB_STOP_NO_RST))); + assert_param(IS_OB_STDBY_SOURCE((UserConfig&OB_STDBY_NO_RST))); + assert_param(IS_OB_BOOT1((UserConfig&OB_BOOT1_SET))); + assert_param(IS_OB_VDDA_ANALOG((UserConfig&OB_VDDA_ANALOG_ON))); + assert_param(IS_OB_SRAM_PARITY((UserConfig&OB_SRAM_PARITY_RESET))); +#if defined(FLASH_OBR_SDADC12_VDD_MONITOR) + assert_param(IS_OB_SDACD_VDD_MONITOR((UserConfig&OB_SDACD_VDD_MONITOR_SET))); +#endif /* FLASH_OBR_SDADC12_VDD_MONITOR */ + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + if(status == HAL_OK) + { + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* Enable the Option Bytes Programming operation */ + SET_BIT(FLASH->CR, FLASH_CR_OPTPG); + +#if defined(FLASH_OBR_SDADC12_VDD_MONITOR) + OB->USER = (UserConfig | 0x08U); +#else + OB->USER = (UserConfig | 0x88U); +#endif + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + /* if the program operation is completed, disable the OPTPG Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_OPTPG); + } + + return status; +} + +/** + * @brief Programs a half word at a specified Option Byte Data address. + * @note The function @ref HAL_FLASH_Unlock() should be called before to unlock the FLASH interface + * The function @ref HAL_FLASH_OB_Unlock() should be called before to unlock the options bytes + * The function @ref HAL_FLASH_OB_Launch() should be called after to force the reload of the options bytes + * (system reset will occur) + * Programming of the OB should be performed only after an erase (otherwise PGERR occurs) + * @param Address specifies the address to be programmed. + * This parameter can be 0x1FFFF804 or 0x1FFFF806. + * @param Data specifies the data to be programmed. + * @retval HAL status + */ +static HAL_StatusTypeDef FLASH_OB_ProgramData(uint32_t Address, uint8_t Data) +{ + HAL_StatusTypeDef status = HAL_ERROR; + + /* Check the parameters */ + assert_param(IS_OB_DATA_ADDRESS(Address)); + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + if(status == HAL_OK) + { + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* Enables the Option Bytes Programming operation */ + SET_BIT(FLASH->CR, FLASH_CR_OPTPG); + *(__IO uint16_t*)Address = Data; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation((uint32_t)FLASH_TIMEOUT_VALUE); + + /* If the program operation is completed, disable the OPTPG Bit */ + CLEAR_BIT(FLASH->CR, FLASH_CR_OPTPG); + } + /* Return the Option Byte Data Program Status */ + return status; +} + +/** + * @brief Return the FLASH Write Protection Option Bytes value. + * @retval The FLASH Write Protection Option Bytes value + */ +static uint32_t FLASH_OB_GetWRP(void) +{ + /* Return the FLASH write protection Register value */ + return (uint32_t)(READ_REG(FLASH->WRPR)); +} + +/** + * @brief Returns the FLASH Read Protection level. + * @retval FLASH RDP level + * This parameter can be one of the following values: + * @arg @ref OB_RDP_LEVEL_0 No protection + * @arg @ref OB_RDP_LEVEL_1 Read protection of the memory + * @arg @ref OB_RDP_LEVEL_2 Full chip protection + */ +static uint32_t FLASH_OB_GetRDP(void) +{ + uint32_t tmp_reg = 0U; + + /* Read RDP level bits */ +#if defined(FLASH_OBR_RDPRT) + tmp_reg = READ_BIT(FLASH->OBR, FLASH_OBR_RDPRT); +#elif defined(FLASH_OBR_LEVEL1_PROT) + tmp_reg = READ_BIT(FLASH->OBR, (FLASH_OBR_LEVEL1_PROT | FLASH_OBR_LEVEL2_PROT)); +#endif /* FLASH_OBR_RDPRT */ + +#if defined(FLASH_OBR_RDPRT) + if (tmp_reg == FLASH_OBR_RDPRT_2) +#elif defined(FLASH_OBR_LEVEL1_PROT) + if (tmp_reg == FLASH_OBR_LEVEL2_PROT) +#endif /* FLASH_OBR_RDPRT */ + { + return OB_RDP_LEVEL_2; + } + else if (tmp_reg == 0U) + { + return OB_RDP_LEVEL_0; + } + else + { + return OB_RDP_LEVEL_1; + } +} + +/** + * @brief Return the FLASH User Option Byte value. + * @retval The FLASH User Option Bytes values: IWDG_SW(Bit0), RST_STOP(Bit1), RST_STDBY(Bit2), nBOOT1(Bit4), + * VDDA_Analog_Monitoring(Bit5) and SRAM_Parity_Enable(Bit6). + * And SDADC12_VDD_MONITOR(Bit7) for STM32F373 or STM32F378 . + */ +static uint8_t FLASH_OB_GetUser(void) +{ + /* Return the User Option Byte */ + return (uint8_t)((READ_REG(FLASH->OBR) & FLASH_OBR_USER) >> FLASH_POSITION_IWDGSW_BIT); +} + +/** + * @} + */ + +/** + * @} + */ + +/** @addtogroup FLASH + * @{ + */ + +/** @addtogroup FLASH_Private_Functions + * @{ + */ + +/** + * @brief Erase the specified FLASH memory page + * @param PageAddress FLASH page to erase + * The value of this parameter depend on device used within the same series + * + * @retval None + */ +void FLASH_PageErase(uint32_t PageAddress) +{ + /* Clean the error context */ + pFlash.ErrorCode = HAL_FLASH_ERROR_NONE; + + /* Proceed to erase the page */ + SET_BIT(FLASH->CR, FLASH_CR_PER); + WRITE_REG(FLASH->AR, PageAddress); + SET_BIT(FLASH->CR, FLASH_CR_STRT); +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_FLASH_MODULE_ENABLED */ +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c new file mode 100644 index 0000000..c56cee7 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c @@ -0,0 +1,541 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_gpio.c + * @author MCD Application Team + * @brief GPIO HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the General Purpose Input/Output (GPIO) peripheral: + * + Initialization and de-initialization functions + * + IO operation functions + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### GPIO Peripheral features ##### + ============================================================================== + [..] + (+) Each port bit of the general-purpose I/O (GPIO) ports can be individually + configured by software in several modes: + (++) Input mode + (++) Analog mode + (++) Output mode + (++) Alternate function mode + (++) External interrupt/event lines + + (+) During and just after reset, the alternate functions and external interrupt + lines are not active and the I/O ports are configured in input floating mode. + + (+) All GPIO pins have weak internal pull-up and pull-down resistors, which can be + activated or not. + + (+) In Output or Alternate mode, each IO can be configured on open-drain or push-pull + type and the IO speed can be selected depending on the VDD value. + + (+) The microcontroller IO pins are connected to onboard peripherals/modules through a + multiplexer that allows only one peripheral alternate function (AF) connected + to an IO pin at a time. In this way, there can be no conflict between peripherals + sharing the same IO pin. + + (+) All ports have external interrupt/event capability. To use external interrupt + lines, the port must be configured in input mode. All available GPIO pins are + connected to the 16 external interrupt/event lines from EXTI0 to EXTI15. + + (+) The external interrupt/event controller consists of up to 23 edge detectors + (16 lines are connected to GPIO) for generating event/interrupt requests (each + input line can be independently configured to select the type (interrupt or event) + and the corresponding trigger event (rising or falling or both). Each line can + also be masked independently. + + ##### How to use this driver ##### + ============================================================================== + [..] + (#) Enable the GPIO AHB clock using the following function: __HAL_RCC_GPIOx_CLK_ENABLE(). + + (#) Configure the GPIO pin(s) using HAL_GPIO_Init(). + (++) Configure the IO mode using "Mode" member from GPIO_InitTypeDef structure + (++) Activate Pull-up, Pull-down resistor using "Pull" member from GPIO_InitTypeDef + structure. + (++) In case of Output or alternate function mode selection: the speed is + configured through "Speed" member from GPIO_InitTypeDef structure. + (++) In alternate mode is selection, the alternate function connected to the IO + is configured through "Alternate" member from GPIO_InitTypeDef structure. + (++) Analog mode is required when a pin is to be used as ADC channel + or DAC output. + (++) In case of external interrupt/event selection the "Mode" member from + GPIO_InitTypeDef structure select the type (interrupt or event) and + the corresponding trigger event (rising or falling or both). + + (#) In case of external interrupt/event mode selection, configure NVIC IRQ priority + mapped to the EXTI line using HAL_NVIC_SetPriority() and enable it using + HAL_NVIC_EnableIRQ(). + + (#) To get the level of a pin configured in input mode use HAL_GPIO_ReadPin(). + + (#) To set/reset the level of a pin configured in output mode use + HAL_GPIO_WritePin()/HAL_GPIO_TogglePin(). + + (#) To lock pin configuration until next reset use HAL_GPIO_LockPin(). + + (#) During and just after reset, the alternate functions are not + active and the GPIO pins are configured in input floating mode (except JTAG + pins). + + (#) The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general purpose + (PC14 and PC15U, respectively) when the LSE oscillator is off. The LSE has + priority over the GPIO function. + + (#) The HSE oscillator pins OSC_IN/OSC_OUT can be used as + general purpose PF0 and PF1, respectively, when the HSE oscillator is off. + The HSE has priority over the GPIO function. + + @endverbatim + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup GPIO GPIO + * @brief GPIO HAL module driver + * @{ + */ + +/** MISRA C:2012 deviation rule has been granted for following rules: + * Rule-18.1_d - Medium: Array pointer `GPIOx' is accessed with index [..,..] + * which may be out of array bounds [..,UNKNOWN] in following APIs: + * HAL_GPIO_Init + * HAL_GPIO_DeInit + */ + +#ifdef HAL_GPIO_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ +/** @addtogroup GPIO_Private_Constants + * @{ + */ +#define GPIO_NUMBER (16U) +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/** @defgroup GPIO_Private_Macros GPIO Private Macros + * @{ + */ +/** + * @} + */ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup GPIO_Exported_Functions GPIO Exported Functions + * @{ + */ + +/** @defgroup GPIO_Exported_Functions_Group1 Initialization/de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + +@endverbatim + * @{ + */ + +/** + * @brief Initialize the GPIOx peripheral according to the specified parameters in the GPIO_Init. + * @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F3 family devices + * @param GPIO_Init pointer to a GPIO_InitTypeDef structure that contains + * the configuration information for the specified GPIO peripheral. + * @retval None + */ +void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) +{ + uint32_t position = 0x00u; + uint32_t iocurrent; + uint32_t temp; + + /* Check the parameters */ + assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); + assert_param(IS_GPIO_PIN(GPIO_Init->Pin)); + assert_param(IS_GPIO_MODE(GPIO_Init->Mode)); + + /* Configure the port pins */ + while (((GPIO_Init->Pin) >> position) != 0x00u) + { + /* Get current io position */ + iocurrent = (GPIO_Init->Pin) & (1uL << position); + + if (iocurrent != 0x00u) + { + /*--------------------- GPIO Mode Configuration ------------------------*/ + /* In case of Output or Alternate function mode selection */ + if(((GPIO_Init->Mode & GPIO_MODE) == MODE_OUTPUT) || ((GPIO_Init->Mode & GPIO_MODE) == MODE_AF)) + { + /* Check the Speed parameter */ + assert_param(IS_GPIO_SPEED(GPIO_Init->Speed)); + /* Configure the IO Speed */ + temp = GPIOx->OSPEEDR; + temp &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2u)); + temp |= (GPIO_Init->Speed << (position * 2u)); + GPIOx->OSPEEDR = temp; + + /* Configure the IO Output Type */ + temp = GPIOx->OTYPER; + temp &= ~(GPIO_OTYPER_OT_0 << position) ; + temp |= (((GPIO_Init->Mode & OUTPUT_TYPE) >> OUTPUT_TYPE_Pos) << position); + GPIOx->OTYPER = temp; + } + + if((GPIO_Init->Mode & GPIO_MODE) != MODE_ANALOG) + { + /* Check the Pull parameter */ + assert_param(IS_GPIO_PULL(GPIO_Init->Pull)); + + /* Activate the Pull-up or Pull down resistor for the current IO */ + temp = GPIOx->PUPDR; + temp &= ~(GPIO_PUPDR_PUPDR0 << (position * 2u)); + temp |= ((GPIO_Init->Pull) << (position * 2u)); + GPIOx->PUPDR = temp; + } + + /*--------------------- GPIO Mode Configuration ------------------------*/ + /* In case of Alternate function mode selection */ + if((GPIO_Init->Mode & GPIO_MODE) == MODE_AF) + { + /* Check the Alternate function parameters */ + assert_param(IS_GPIO_AF_INSTANCE(GPIOx)); + assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); + + /* Configure Alternate function mapped with the current IO */ + temp = GPIOx->AFR[position >> 3u]; + temp &= ~(0xFu << ((position & 0x07u) * 4u)); + temp |= ((GPIO_Init->Alternate) << ((position & 0x07u) * 4u)); + GPIOx->AFR[position >> 3u] = temp; + } + + /* Configure IO Direction mode (Input, Output, Alternate or Analog) */ + temp = GPIOx->MODER; + temp &= ~(GPIO_MODER_MODER0 << (position * 2u)); + temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2u)); + GPIOx->MODER = temp; + + /*--------------------- EXTI Mode Configuration ------------------------*/ + /* Configure the External Interrupt or event for the current IO */ + if((GPIO_Init->Mode & EXTI_MODE) != 0x00u) + { + /* Enable SYSCFG Clock */ + __HAL_RCC_SYSCFG_CLK_ENABLE(); + + temp = SYSCFG->EXTICR[position >> 2u]; + temp &= ~(0x0FuL << (4u * (position & 0x03u))); + temp |= (GPIO_GET_INDEX(GPIOx) << (4u * (position & 0x03u))); + SYSCFG->EXTICR[position >> 2u] = temp; + + /* Clear Rising Falling edge configuration */ + temp = EXTI->RTSR; + temp &= ~(iocurrent); + if((GPIO_Init->Mode & TRIGGER_RISING) != 0x00u) + { + temp |= iocurrent; + } + EXTI->RTSR = temp; + + temp = EXTI->FTSR; + temp &= ~(iocurrent); + if((GPIO_Init->Mode & TRIGGER_FALLING) != 0x00u) + { + temp |= iocurrent; + } + EXTI->FTSR = temp; + + temp = EXTI->EMR; + temp &= ~(iocurrent); + if((GPIO_Init->Mode & EXTI_EVT) != 0x00u) + { + temp |= iocurrent; + } + EXTI->EMR = temp; + + /* Clear EXTI line configuration */ + temp = EXTI->IMR; + temp &= ~(iocurrent); + if((GPIO_Init->Mode & EXTI_IT) != 0x00u) + { + temp |= iocurrent; + } + EXTI->IMR = temp; + } + } + + position++; + } +} + +/** + * @brief De-initialize the GPIOx peripheral registers to their default reset values. + * @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F30X device or STM32F37X device + * @param GPIO_Pin specifies the port bit to be written. + * This parameter can be one of GPIO_PIN_x where x can be (0..15). + * @retval None + */ +void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) +{ + uint32_t position = 0x00u; + uint32_t iocurrent; + uint32_t tmp; + + /* Check the parameters */ + assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); + assert_param(IS_GPIO_PIN(GPIO_Pin)); + + /* Configure the port pins */ + while ((GPIO_Pin >> position) != 0x00u) + { + /* Get current io position */ + iocurrent = (GPIO_Pin) & (1uL << position); + + if (iocurrent != 0x00u) + { + /*------------------------- EXTI Mode Configuration --------------------*/ + /* Clear the External Interrupt or Event for the current IO */ + + tmp = SYSCFG->EXTICR[position >> 2u]; + tmp &= (0x0FuL << (4u * (position & 0x03u))); + if (tmp == (GPIO_GET_INDEX(GPIOx) << (4u * (position & 0x03u)))) + { + /* Clear EXTI line configuration */ + EXTI->IMR &= ~((uint32_t)iocurrent); + EXTI->EMR &= ~((uint32_t)iocurrent); + + /* Clear Rising Falling edge configuration */ + EXTI->FTSR &= ~((uint32_t)iocurrent); + EXTI->RTSR &= ~((uint32_t)iocurrent); + + /* Configure the External Interrupt or event for the current IO */ + tmp = 0x0FuL << (4u * (position & 0x03u)); + SYSCFG->EXTICR[position >> 2u] &= ~tmp; + } + + /*------------------------- GPIO Mode Configuration --------------------*/ + /* Configure IO Direction in Input Floating Mode */ + GPIOx->MODER &= ~(GPIO_MODER_MODER0 << (position * 2u)); + + /* Configure the default Alternate Function in current IO */ + GPIOx->AFR[position >> 3u] &= ~(0xFu << ((uint32_t)(position & 0x07u) * 4u)) ; + + /* Deactivate the Pull-up and Pull-down resistor for the current IO */ + GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << (position * 2u)); + + /* Configure the default value IO Output Type */ + GPIOx->OTYPER &= ~(GPIO_OTYPER_OT_0 << position) ; + + /* Configure the default value for IO Speed */ + GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2u)); + } + + position++; + } +} + +/** + * @} + */ + +/** @defgroup GPIO_Exported_Functions_Group2 IO operation functions + * @brief GPIO Read, Write, Toggle, Lock and EXTI management functions. + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + +@endverbatim + * @{ + */ + +/** + * @brief Read the specified input port pin. + * @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F3 family + * @param GPIO_Pin specifies the port bit to read. + * This parameter can be GPIO_PIN_x where x can be (0..15). + * @retval The input port pin value. + */ +GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) +{ + GPIO_PinState bitstatus; + + /* Check the parameters */ + assert_param(IS_GPIO_PIN(GPIO_Pin)); + + if((GPIOx->IDR & GPIO_Pin) != (uint32_t)GPIO_PIN_RESET) + { + bitstatus = GPIO_PIN_SET; + } + else + { + bitstatus = GPIO_PIN_RESET; + } + return bitstatus; +} + +/** + * @brief Set or clear the selected data port bit. + * + * @note This function uses GPIOx_BSRR and GPIOx_BRR registers to allow atomic read/modify + * accesses. In this way, there is no risk of an IRQ occurring between + * the read and the modify access. + * + * @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F3 family + * @param GPIO_Pin specifies the port bit to be written. + * This parameter can be one of GPIO_PIN_x where x can be (0..15). + * @param PinState specifies the value to be written to the selected bit. + * This parameter can be one of the GPIO_PinState enum values: + * @arg GPIO_PIN_RESET: to clear the port pin + * @arg GPIO_PIN_SET: to set the port pin + * @retval None + */ +void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState) +{ + /* Check the parameters */ + assert_param(IS_GPIO_PIN(GPIO_Pin)); + assert_param(IS_GPIO_PIN_ACTION(PinState)); + + if(PinState != GPIO_PIN_RESET) + { + GPIOx->BSRR = (uint32_t)GPIO_Pin; + } + else + { + GPIOx->BRR = (uint32_t)GPIO_Pin; + } +} + +/** + * @brief Toggle the specified GPIO pin. + * @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F3 family + * @param GPIO_Pin specifies the pin to be toggled. + * @retval None + */ +void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) +{ + uint32_t odr; + + /* Check the parameters */ + assert_param(IS_GPIO_PIN(GPIO_Pin)); + + /* get current Output Data Register value */ + odr = GPIOx->ODR; + + /* Set selected pins that were at low level, and reset ones that were high */ + GPIOx->BSRR = ((odr & GPIO_Pin) << GPIO_NUMBER) | (~odr & GPIO_Pin); +} + +/** +* @brief Lock GPIO Pins configuration registers. + * @note The locked registers are GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR, + * GPIOx_PUPDR, GPIOx_AFRL and GPIOx_AFRH. + * @note The configuration of the locked GPIO pins can no longer be modified + * until the next reset. + * @param GPIOx where x can be (A..F) to select the GPIO peripheral for STM32F3 family + * @param GPIO_Pin specifies the port bits to be locked. + * This parameter can be any combination of GPIO_Pin_x where x can be (0..15). + * @retval None + */ +HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) +{ + __IO uint32_t tmp = GPIO_LCKR_LCKK; + + /* Check the parameters */ + assert_param(IS_GPIO_LOCK_INSTANCE(GPIOx)); + assert_param(IS_GPIO_PIN(GPIO_Pin)); + + /* Apply lock key write sequence */ + tmp |= GPIO_Pin; + /* Set LCKx bit(s): LCKK='1' + LCK[15U-0] */ + GPIOx->LCKR = tmp; + /* Reset LCKx bit(s): LCKK='0' + LCK[15U-0] */ + GPIOx->LCKR = GPIO_Pin; + /* Set LCKx bit(s): LCKK='1' + LCK[15U-0] */ + GPIOx->LCKR = tmp; + /* Read LCKK register. This read is mandatory to complete key lock sequence */ + tmp = GPIOx->LCKR; + + /* read again in order to confirm lock is active */ + if((GPIOx->LCKR & GPIO_LCKR_LCKK) != 0x00u) + { + return HAL_OK; + } + else + { + return HAL_ERROR; + } +} + +/** + * @brief Handle EXTI interrupt request. + * @param GPIO_Pin Specifies the port pin connected to corresponding EXTI line. + * @retval None + */ +void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin) +{ + /* EXTI line interrupt detected */ + if(__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != 0x00u) + { + __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin); + HAL_GPIO_EXTI_Callback(GPIO_Pin); + } +} + +/** + * @brief EXTI line detection callback. + * @param GPIO_Pin Specifies the port pin connected to corresponding EXTI line. + * @retval None + */ +__weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(GPIO_Pin); + + /* NOTE: This function should not be modified, when the callback is needed, + the HAL_GPIO_EXTI_Callback could be implemented in the user file + */ +} + +/** + * @} + */ + + +/** + * @} + */ + +#endif /* HAL_GPIO_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c new file mode 100644 index 0000000..2b5836c --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c @@ -0,0 +1,7278 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_i2c.c + * @author MCD Application Team + * @brief I2C HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Inter Integrated Circuit (I2C) peripheral: + * + Initialization and de-initialization functions + * + IO operation functions + * + Peripheral State and Errors functions + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + The I2C HAL driver can be used as follows: + + (#) Declare a I2C_HandleTypeDef handle structure, for example: + I2C_HandleTypeDef hi2c; + + (#)Initialize the I2C low level resources by implementing the HAL_I2C_MspInit() API: + (##) Enable the I2Cx interface clock + (##) I2C pins configuration + (+++) Enable the clock for the I2C GPIOs + (+++) Configure I2C pins as alternate function open-drain + (##) NVIC configuration if you need to use interrupt process + (+++) Configure the I2Cx interrupt priority + (+++) Enable the NVIC I2C IRQ Channel + (##) DMA Configuration if you need to use DMA process + (+++) Declare a DMA_HandleTypeDef handle structure for + the transmit or receive channel + (+++) Enable the DMAx interface clock using + (+++) Configure the DMA handle parameters + (+++) Configure the DMA Tx or Rx channel + (+++) Associate the initialized DMA handle to the hi2c DMA Tx or Rx handle + (+++) Configure the priority and enable the NVIC for the transfer complete interrupt on + the DMA Tx or Rx channel + + (#) Configure the Communication Clock Timing, Own Address1, Master Addressing mode, Dual Addressing mode, + Own Address2, Own Address2 Mask, General call and Nostretch mode in the hi2c Init structure. + + (#) Initialize the I2C registers by calling the HAL_I2C_Init(), configures also the low level Hardware + (GPIO, CLOCK, NVIC...etc) by calling the customized HAL_I2C_MspInit(&hi2c) API. + + (#) To check if target device is ready for communication, use the function HAL_I2C_IsDeviceReady() + + (#) For I2C IO and IO MEM operations, three operation modes are available within this driver : + + *** Polling mode IO operation *** + ================================= + [..] + (+) Transmit in master mode an amount of data in blocking mode using HAL_I2C_Master_Transmit() + (+) Receive in master mode an amount of data in blocking mode using HAL_I2C_Master_Receive() + (+) Transmit in slave mode an amount of data in blocking mode using HAL_I2C_Slave_Transmit() + (+) Receive in slave mode an amount of data in blocking mode using HAL_I2C_Slave_Receive() + + *** Polling mode IO MEM operation *** + ===================================== + [..] + (+) Write an amount of data in blocking mode to a specific memory address using HAL_I2C_Mem_Write() + (+) Read an amount of data in blocking mode from a specific memory address using HAL_I2C_Mem_Read() + + + *** Interrupt mode IO operation *** + =================================== + [..] + (+) Transmit in master mode an amount of data in non-blocking mode using HAL_I2C_Master_Transmit_IT() + (+) At transmission end of transfer, HAL_I2C_MasterTxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MasterTxCpltCallback() + (+) Receive in master mode an amount of data in non-blocking mode using HAL_I2C_Master_Receive_IT() + (+) At reception end of transfer, HAL_I2C_MasterRxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MasterRxCpltCallback() + (+) Transmit in slave mode an amount of data in non-blocking mode using HAL_I2C_Slave_Transmit_IT() + (+) At transmission end of transfer, HAL_I2C_SlaveTxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_SlaveTxCpltCallback() + (+) Receive in slave mode an amount of data in non-blocking mode using HAL_I2C_Slave_Receive_IT() + (+) At reception end of transfer, HAL_I2C_SlaveRxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_SlaveRxCpltCallback() + (+) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can + add their own code by customization of function pointer HAL_I2C_ErrorCallback() + (+) Abort a master I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT() + (+) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_AbortCpltCallback() + (+) Discard a slave I2C process communication using __HAL_I2C_GENERATE_NACK() macro. + This action will inform Master to generate a Stop condition to discard the communication. + + + *** Interrupt mode or DMA mode IO sequential operation *** + ========================================================== + [..] + (@) These interfaces allow to manage a sequential transfer with a repeated start condition + when a direction change during transfer + [..] + (+) A specific option field manage the different steps of a sequential transfer + (+) Option field values are defined through I2C_XFEROPTIONS and are listed below: + (++) I2C_FIRST_AND_LAST_FRAME: No sequential usage, functional is same as associated interfaces in + no sequential mode + (++) I2C_FIRST_FRAME: Sequential usage, this option allow to manage a sequence with start condition, address + and data to transfer without a final stop condition + (++) I2C_FIRST_AND_NEXT_FRAME: Sequential usage (Master only), this option allow to manage a sequence with + start condition, address and data to transfer without a final stop condition, + an then permit a call the same master sequential interface several times + (like HAL_I2C_Master_Seq_Transmit_IT() then HAL_I2C_Master_Seq_Transmit_IT() + or HAL_I2C_Master_Seq_Transmit_DMA() then HAL_I2C_Master_Seq_Transmit_DMA()) + (++) I2C_NEXT_FRAME: Sequential usage, this option allow to manage a sequence with a restart condition, address + and with new data to transfer if the direction change or manage only the new data to + transfer + if no direction change and without a final stop condition in both cases + (++) I2C_LAST_FRAME: Sequential usage, this option allow to manage a sequance with a restart condition, address + and with new data to transfer if the direction change or manage only the new data to + transfer + if no direction change and with a final stop condition in both cases + (++) I2C_LAST_FRAME_NO_STOP: Sequential usage (Master only), this option allow to manage a restart condition + after several call of the same master sequential interface several times + (link with option I2C_FIRST_AND_NEXT_FRAME). + Usage can, transfer several bytes one by one using + HAL_I2C_Master_Seq_Transmit_IT + or HAL_I2C_Master_Seq_Receive_IT + or HAL_I2C_Master_Seq_Transmit_DMA + or HAL_I2C_Master_Seq_Receive_DMA + with option I2C_FIRST_AND_NEXT_FRAME then I2C_NEXT_FRAME. + Then usage of this option I2C_LAST_FRAME_NO_STOP at the last Transmit or + Receive sequence permit to call the opposite interface Receive or Transmit + without stopping the communication and so generate a restart condition. + (++) I2C_OTHER_FRAME: Sequential usage (Master only), this option allow to manage a restart condition after + each call of the same master sequential + interface. + Usage can, transfer several bytes one by one with a restart with slave address between + each bytes using + HAL_I2C_Master_Seq_Transmit_IT + or HAL_I2C_Master_Seq_Receive_IT + or HAL_I2C_Master_Seq_Transmit_DMA + or HAL_I2C_Master_Seq_Receive_DMA + with option I2C_FIRST_FRAME then I2C_OTHER_FRAME. + Then usage of this option I2C_OTHER_AND_LAST_FRAME at the last frame to help automatic + generation of STOP condition. + + (+) Different sequential I2C interfaces are listed below: + (++) Sequential transmit in master I2C mode an amount of data in non-blocking mode using + HAL_I2C_Master_Seq_Transmit_IT() or using HAL_I2C_Master_Seq_Transmit_DMA() + (+++) At transmission end of current frame transfer, HAL_I2C_MasterTxCpltCallback() is executed and + users can add their own code by customization of function pointer HAL_I2C_MasterTxCpltCallback() + (++) Sequential receive in master I2C mode an amount of data in non-blocking mode using + HAL_I2C_Master_Seq_Receive_IT() or using HAL_I2C_Master_Seq_Receive_DMA() + (+++) At reception end of current frame transfer, HAL_I2C_MasterRxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MasterRxCpltCallback() + (++) Abort a master IT or DMA I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT() + (+++) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_AbortCpltCallback() + (++) Enable/disable the Address listen mode in slave I2C mode using HAL_I2C_EnableListen_IT() + HAL_I2C_DisableListen_IT() + (+++) When address slave I2C match, HAL_I2C_AddrCallback() is executed and users can + add their own code to check the Address Match Code and the transmission direction request by master + (Write/Read). + (+++) At Listen mode end HAL_I2C_ListenCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_ListenCpltCallback() + (++) Sequential transmit in slave I2C mode an amount of data in non-blocking mode using + HAL_I2C_Slave_Seq_Transmit_IT() or using HAL_I2C_Slave_Seq_Transmit_DMA() + (+++) At transmission end of current frame transfer, HAL_I2C_SlaveTxCpltCallback() is executed and + users can add their own code by customization of function pointer HAL_I2C_SlaveTxCpltCallback() + (++) Sequential receive in slave I2C mode an amount of data in non-blocking mode using + HAL_I2C_Slave_Seq_Receive_IT() or using HAL_I2C_Slave_Seq_Receive_DMA() + (+++) At reception end of current frame transfer, HAL_I2C_SlaveRxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_SlaveRxCpltCallback() + (++) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can + add their own code by customization of function pointer HAL_I2C_ErrorCallback() + (++) Discard a slave I2C process communication using __HAL_I2C_GENERATE_NACK() macro. + This action will inform Master to generate a Stop condition to discard the communication. + + *** Interrupt mode IO MEM operation *** + ======================================= + [..] + (+) Write an amount of data in non-blocking mode with Interrupt to a specific memory address using + HAL_I2C_Mem_Write_IT() + (+) At Memory end of write transfer, HAL_I2C_MemTxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MemTxCpltCallback() + (+) Read an amount of data in non-blocking mode with Interrupt from a specific memory address using + HAL_I2C_Mem_Read_IT() + (+) At Memory end of read transfer, HAL_I2C_MemRxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MemRxCpltCallback() + (+) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can + add their own code by customization of function pointer HAL_I2C_ErrorCallback() + + *** DMA mode IO operation *** + ============================== + [..] + (+) Transmit in master mode an amount of data in non-blocking mode (DMA) using + HAL_I2C_Master_Transmit_DMA() + (+) At transmission end of transfer, HAL_I2C_MasterTxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MasterTxCpltCallback() + (+) Receive in master mode an amount of data in non-blocking mode (DMA) using + HAL_I2C_Master_Receive_DMA() + (+) At reception end of transfer, HAL_I2C_MasterRxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MasterRxCpltCallback() + (+) Transmit in slave mode an amount of data in non-blocking mode (DMA) using + HAL_I2C_Slave_Transmit_DMA() + (+) At transmission end of transfer, HAL_I2C_SlaveTxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_SlaveTxCpltCallback() + (+) Receive in slave mode an amount of data in non-blocking mode (DMA) using + HAL_I2C_Slave_Receive_DMA() + (+) At reception end of transfer, HAL_I2C_SlaveRxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_SlaveRxCpltCallback() + (+) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can + add their own code by customization of function pointer HAL_I2C_ErrorCallback() + (+) Abort a master I2C process communication with Interrupt using HAL_I2C_Master_Abort_IT() + (+) End of abort process, HAL_I2C_AbortCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_AbortCpltCallback() + (+) Discard a slave I2C process communication using __HAL_I2C_GENERATE_NACK() macro. + This action will inform Master to generate a Stop condition to discard the communication. + + *** DMA mode IO MEM operation *** + ================================= + [..] + (+) Write an amount of data in non-blocking mode with DMA to a specific memory address using + HAL_I2C_Mem_Write_DMA() + (+) At Memory end of write transfer, HAL_I2C_MemTxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MemTxCpltCallback() + (+) Read an amount of data in non-blocking mode with DMA from a specific memory address using + HAL_I2C_Mem_Read_DMA() + (+) At Memory end of read transfer, HAL_I2C_MemRxCpltCallback() is executed and users can + add their own code by customization of function pointer HAL_I2C_MemRxCpltCallback() + (+) In case of transfer Error, HAL_I2C_ErrorCallback() function is executed and users can + add their own code by customization of function pointer HAL_I2C_ErrorCallback() + + + *** I2C HAL driver macros list *** + ================================== + [..] + Below the list of most used macros in I2C HAL driver. + + (+) __HAL_I2C_ENABLE: Enable the I2C peripheral + (+) __HAL_I2C_DISABLE: Disable the I2C peripheral + (+) __HAL_I2C_GENERATE_NACK: Generate a Non-Acknowledge I2C peripheral in Slave mode + (+) __HAL_I2C_GET_FLAG: Check whether the specified I2C flag is set or not + (+) __HAL_I2C_CLEAR_FLAG: Clear the specified I2C pending flag + (+) __HAL_I2C_ENABLE_IT: Enable the specified I2C interrupt + (+) __HAL_I2C_DISABLE_IT: Disable the specified I2C interrupt + + *** Callback registration *** + ============================================= + [..] + The compilation flag USE_HAL_I2C_REGISTER_CALLBACKS when set to 1 + allows the user to configure dynamically the driver callbacks. + Use Functions HAL_I2C_RegisterCallback() or HAL_I2C_RegisterAddrCallback() + to register an interrupt callback. + [..] + Function HAL_I2C_RegisterCallback() allows to register following callbacks: + (+) MasterTxCpltCallback : callback for Master transmission end of transfer. + (+) MasterRxCpltCallback : callback for Master reception end of transfer. + (+) SlaveTxCpltCallback : callback for Slave transmission end of transfer. + (+) SlaveRxCpltCallback : callback for Slave reception end of transfer. + (+) ListenCpltCallback : callback for end of listen mode. + (+) MemTxCpltCallback : callback for Memory transmission end of transfer. + (+) MemRxCpltCallback : callback for Memory reception end of transfer. + (+) ErrorCallback : callback for error detection. + (+) AbortCpltCallback : callback for abort completion process. + (+) MspInitCallback : callback for Msp Init. + (+) MspDeInitCallback : callback for Msp DeInit. + This function takes as parameters the HAL peripheral handle, the Callback ID + and a pointer to the user callback function. + [..] + For specific callback AddrCallback use dedicated register callbacks : HAL_I2C_RegisterAddrCallback(). + [..] + Use function HAL_I2C_UnRegisterCallback to reset a callback to the default + weak function. + HAL_I2C_UnRegisterCallback takes as parameters the HAL peripheral handle, + and the Callback ID. + This function allows to reset following callbacks: + (+) MasterTxCpltCallback : callback for Master transmission end of transfer. + (+) MasterRxCpltCallback : callback for Master reception end of transfer. + (+) SlaveTxCpltCallback : callback for Slave transmission end of transfer. + (+) SlaveRxCpltCallback : callback for Slave reception end of transfer. + (+) ListenCpltCallback : callback for end of listen mode. + (+) MemTxCpltCallback : callback for Memory transmission end of transfer. + (+) MemRxCpltCallback : callback for Memory reception end of transfer. + (+) ErrorCallback : callback for error detection. + (+) AbortCpltCallback : callback for abort completion process. + (+) MspInitCallback : callback for Msp Init. + (+) MspDeInitCallback : callback for Msp DeInit. + [..] + For callback AddrCallback use dedicated register callbacks : HAL_I2C_UnRegisterAddrCallback(). + [..] + By default, after the HAL_I2C_Init() and when the state is HAL_I2C_STATE_RESET + all callbacks are set to the corresponding weak functions: + examples HAL_I2C_MasterTxCpltCallback(), HAL_I2C_MasterRxCpltCallback(). + Exception done for MspInit and MspDeInit functions that are + reset to the legacy weak functions in the HAL_I2C_Init()/ HAL_I2C_DeInit() only when + these callbacks are null (not registered beforehand). + If MspInit or MspDeInit are not null, the HAL_I2C_Init()/ HAL_I2C_DeInit() + keep and use the user MspInit/MspDeInit callbacks (registered beforehand) whatever the state. + [..] + Callbacks can be registered/unregistered in HAL_I2C_STATE_READY state only. + Exception done MspInit/MspDeInit functions that can be registered/unregistered + in HAL_I2C_STATE_READY or HAL_I2C_STATE_RESET state, + thus registered (user) MspInit/DeInit callbacks can be used during the Init/DeInit. + Then, the user first registers the MspInit/MspDeInit user callbacks + using HAL_I2C_RegisterCallback() before calling HAL_I2C_DeInit() + or HAL_I2C_Init() function. + [..] + When the compilation flag USE_HAL_I2C_REGISTER_CALLBACKS is set to 0 or + not defined, the callback registration feature is not available and all callbacks + are set to the corresponding weak functions. + + [..] + (@) You can refer to the I2C HAL driver header file for more useful macros + + @endverbatim + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup I2C I2C + * @brief I2C HAL module driver + * @{ + */ + +#ifdef HAL_I2C_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ + +/** @defgroup I2C_Private_Define I2C Private Define + * @{ + */ +#define TIMING_CLEAR_MASK (0xF0FFFFFFU) /*!< I2C TIMING clear register Mask */ +#define I2C_TIMEOUT_ADDR (10000U) /*!< 10 s */ +#define I2C_TIMEOUT_BUSY (25U) /*!< 25 ms */ +#define I2C_TIMEOUT_DIR (25U) /*!< 25 ms */ +#define I2C_TIMEOUT_RXNE (25U) /*!< 25 ms */ +#define I2C_TIMEOUT_STOPF (25U) /*!< 25 ms */ +#define I2C_TIMEOUT_TC (25U) /*!< 25 ms */ +#define I2C_TIMEOUT_TCR (25U) /*!< 25 ms */ +#define I2C_TIMEOUT_TXIS (25U) /*!< 25 ms */ +#define I2C_TIMEOUT_FLAG (25U) /*!< 25 ms */ + +#define MAX_NBYTE_SIZE 255U +#define SLAVE_ADDR_SHIFT 7U +#define SLAVE_ADDR_MSK 0x06U + +/* Private define for @ref PreviousState usage */ +#define I2C_STATE_MSK ((uint32_t)((uint32_t)((uint32_t)HAL_I2C_STATE_BUSY_TX | \ + (uint32_t)HAL_I2C_STATE_BUSY_RX) & \ + (uint32_t)(~((uint32_t)HAL_I2C_STATE_READY)))) +/*!< Mask State define, keep only RX and TX bits */ +#define I2C_STATE_NONE ((uint32_t)(HAL_I2C_MODE_NONE)) +/*!< Default Value */ +#define I2C_STATE_MASTER_BUSY_TX ((uint32_t)(((uint32_t)HAL_I2C_STATE_BUSY_TX & I2C_STATE_MSK) | \ + (uint32_t)HAL_I2C_MODE_MASTER)) +/*!< Master Busy TX, combinaison of State LSB and Mode enum */ +#define I2C_STATE_MASTER_BUSY_RX ((uint32_t)(((uint32_t)HAL_I2C_STATE_BUSY_RX & I2C_STATE_MSK) | \ + (uint32_t)HAL_I2C_MODE_MASTER)) +/*!< Master Busy RX, combinaison of State LSB and Mode enum */ +#define I2C_STATE_SLAVE_BUSY_TX ((uint32_t)(((uint32_t)HAL_I2C_STATE_BUSY_TX & I2C_STATE_MSK) | \ + (uint32_t)HAL_I2C_MODE_SLAVE)) +/*!< Slave Busy TX, combinaison of State LSB and Mode enum */ +#define I2C_STATE_SLAVE_BUSY_RX ((uint32_t)(((uint32_t)HAL_I2C_STATE_BUSY_RX & I2C_STATE_MSK) | \ + (uint32_t)HAL_I2C_MODE_SLAVE)) +/*!< Slave Busy RX, combinaison of State LSB and Mode enum */ +#define I2C_STATE_MEM_BUSY_TX ((uint32_t)(((uint32_t)HAL_I2C_STATE_BUSY_TX & I2C_STATE_MSK) | \ + (uint32_t)HAL_I2C_MODE_MEM)) +/*!< Memory Busy TX, combinaison of State LSB and Mode enum */ +#define I2C_STATE_MEM_BUSY_RX ((uint32_t)(((uint32_t)HAL_I2C_STATE_BUSY_RX & I2C_STATE_MSK) | \ + (uint32_t)HAL_I2C_MODE_MEM)) +/*!< Memory Busy RX, combinaison of State LSB and Mode enum */ + + +/* Private define to centralize the enable/disable of Interrupts */ +#define I2C_XFER_TX_IT (uint16_t)(0x0001U) /*!< Bit field can be combinated with + @ref I2C_XFER_LISTEN_IT */ +#define I2C_XFER_RX_IT (uint16_t)(0x0002U) /*!< Bit field can be combinated with + @ref I2C_XFER_LISTEN_IT */ +#define I2C_XFER_LISTEN_IT (uint16_t)(0x8000U) /*!< Bit field can be combinated with @ref I2C_XFER_TX_IT + and @ref I2C_XFER_RX_IT */ + +#define I2C_XFER_ERROR_IT (uint16_t)(0x0010U) /*!< Bit definition to manage addition of global Error + and NACK treatment */ +#define I2C_XFER_CPLT_IT (uint16_t)(0x0020U) /*!< Bit definition to manage only STOP evenement */ +#define I2C_XFER_RELOAD_IT (uint16_t)(0x0040U) /*!< Bit definition to manage only Reload of NBYTE */ + +/* Private define Sequential Transfer Options default/reset value */ +#define I2C_NO_OPTION_FRAME (0xFFFF0000U) +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/** @addtogroup I2C_Private_Macro + * @{ + */ +/* Macro to get remaining data to transfer on DMA side */ +#define I2C_GET_DMA_REMAIN_DATA(__HANDLE__) __HAL_DMA_GET_COUNTER(__HANDLE__) +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ + +/** @defgroup I2C_Private_Functions I2C Private Functions + * @{ + */ +/* Private functions to handle DMA transfer */ +static void I2C_DMAMasterTransmitCplt(DMA_HandleTypeDef *hdma); +static void I2C_DMAMasterReceiveCplt(DMA_HandleTypeDef *hdma); +static void I2C_DMASlaveTransmitCplt(DMA_HandleTypeDef *hdma); +static void I2C_DMASlaveReceiveCplt(DMA_HandleTypeDef *hdma); +static void I2C_DMAError(DMA_HandleTypeDef *hdma); +static void I2C_DMAAbort(DMA_HandleTypeDef *hdma); + + +/* Private functions to handle IT transfer */ +static void I2C_ITAddrCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags); +static void I2C_ITMasterSeqCplt(I2C_HandleTypeDef *hi2c); +static void I2C_ITSlaveSeqCplt(I2C_HandleTypeDef *hi2c); +static void I2C_ITMasterCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags); +static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags); +static void I2C_ITListenCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags); +static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode); + +/* Private functions to handle IT transfer */ +static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, + uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout, + uint32_t Tickstart); +static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, + uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout, + uint32_t Tickstart); + +/* Private functions for I2C transfer IRQ handler */ +static HAL_StatusTypeDef I2C_Master_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources); +static HAL_StatusTypeDef I2C_Mem_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources); +static HAL_StatusTypeDef I2C_Slave_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources); +static HAL_StatusTypeDef I2C_Master_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources); +static HAL_StatusTypeDef I2C_Mem_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources); +static HAL_StatusTypeDef I2C_Slave_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources); + +/* Private functions to handle flags during polling transfer */ +static HAL_StatusTypeDef I2C_WaitOnFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Flag, FlagStatus Status, + uint32_t Timeout, uint32_t Tickstart); +static HAL_StatusTypeDef I2C_WaitOnTXISFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, + uint32_t Tickstart); +static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, + uint32_t Tickstart); +static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, + uint32_t Tickstart); +static HAL_StatusTypeDef I2C_IsErrorOccurred(I2C_HandleTypeDef *hi2c, uint32_t Timeout, + uint32_t Tickstart); + +/* Private functions to centralize the enable/disable of Interrupts */ +static void I2C_Enable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest); +static void I2C_Disable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest); + +/* Private function to treat different error callback */ +static void I2C_TreatErrorCallback(I2C_HandleTypeDef *hi2c); + +/* Private function to flush TXDR register */ +static void I2C_Flush_TXDR(I2C_HandleTypeDef *hi2c); + +/* Private function to handle start, restart or stop a transfer */ +static void I2C_TransferConfig(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t Size, uint32_t Mode, + uint32_t Request); + +/* Private function to Convert Specific options */ +static void I2C_ConvertOtherXferOptions(I2C_HandleTypeDef *hi2c); +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup I2C_Exported_Functions I2C Exported Functions + * @{ + */ + +/** @defgroup I2C_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + [..] This subsection provides a set of functions allowing to initialize and + deinitialize the I2Cx peripheral: + + (+) User must Implement HAL_I2C_MspInit() function in which he configures + all related peripherals resources (CLOCK, GPIO, DMA, IT and NVIC ). + + (+) Call the function HAL_I2C_Init() to configure the selected device with + the selected configuration: + (++) Clock Timing + (++) Own Address 1 + (++) Addressing mode (Master, Slave) + (++) Dual Addressing mode + (++) Own Address 2 + (++) Own Address 2 Mask + (++) General call mode + (++) Nostretch mode + + (+) Call the function HAL_I2C_DeInit() to restore the default configuration + of the selected I2Cx peripheral. + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the I2C according to the specified parameters + * in the I2C_InitTypeDef and initialize the associated handle. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c) +{ + /* Check the I2C handle allocation */ + if (hi2c == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_I2C_ALL_INSTANCE(hi2c->Instance)); + assert_param(IS_I2C_OWN_ADDRESS1(hi2c->Init.OwnAddress1)); + assert_param(IS_I2C_ADDRESSING_MODE(hi2c->Init.AddressingMode)); + assert_param(IS_I2C_DUAL_ADDRESS(hi2c->Init.DualAddressMode)); + assert_param(IS_I2C_OWN_ADDRESS2(hi2c->Init.OwnAddress2)); + assert_param(IS_I2C_OWN_ADDRESS2_MASK(hi2c->Init.OwnAddress2Masks)); + assert_param(IS_I2C_GENERAL_CALL(hi2c->Init.GeneralCallMode)); + assert_param(IS_I2C_NO_STRETCH(hi2c->Init.NoStretchMode)); + + if (hi2c->State == HAL_I2C_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + hi2c->Lock = HAL_UNLOCKED; + +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + /* Init the I2C Callback settings */ + hi2c->MasterTxCpltCallback = HAL_I2C_MasterTxCpltCallback; /* Legacy weak MasterTxCpltCallback */ + hi2c->MasterRxCpltCallback = HAL_I2C_MasterRxCpltCallback; /* Legacy weak MasterRxCpltCallback */ + hi2c->SlaveTxCpltCallback = HAL_I2C_SlaveTxCpltCallback; /* Legacy weak SlaveTxCpltCallback */ + hi2c->SlaveRxCpltCallback = HAL_I2C_SlaveRxCpltCallback; /* Legacy weak SlaveRxCpltCallback */ + hi2c->ListenCpltCallback = HAL_I2C_ListenCpltCallback; /* Legacy weak ListenCpltCallback */ + hi2c->MemTxCpltCallback = HAL_I2C_MemTxCpltCallback; /* Legacy weak MemTxCpltCallback */ + hi2c->MemRxCpltCallback = HAL_I2C_MemRxCpltCallback; /* Legacy weak MemRxCpltCallback */ + hi2c->ErrorCallback = HAL_I2C_ErrorCallback; /* Legacy weak ErrorCallback */ + hi2c->AbortCpltCallback = HAL_I2C_AbortCpltCallback; /* Legacy weak AbortCpltCallback */ + hi2c->AddrCallback = HAL_I2C_AddrCallback; /* Legacy weak AddrCallback */ + + if (hi2c->MspInitCallback == NULL) + { + hi2c->MspInitCallback = HAL_I2C_MspInit; /* Legacy weak MspInit */ + } + + /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */ + hi2c->MspInitCallback(hi2c); +#else + /* Init the low level hardware : GPIO, CLOCK, CORTEX...etc */ + HAL_I2C_MspInit(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + + hi2c->State = HAL_I2C_STATE_BUSY; + + /* Disable the selected I2C peripheral */ + __HAL_I2C_DISABLE(hi2c); + + /*---------------------------- I2Cx TIMINGR Configuration ------------------*/ + /* Configure I2Cx: Frequency range */ + hi2c->Instance->TIMINGR = hi2c->Init.Timing & TIMING_CLEAR_MASK; + + /*---------------------------- I2Cx OAR1 Configuration ---------------------*/ + /* Disable Own Address1 before set the Own Address1 configuration */ + hi2c->Instance->OAR1 &= ~I2C_OAR1_OA1EN; + + /* Configure I2Cx: Own Address1 and ack own address1 mode */ + if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_7BIT) + { + hi2c->Instance->OAR1 = (I2C_OAR1_OA1EN | hi2c->Init.OwnAddress1); + } + else /* I2C_ADDRESSINGMODE_10BIT */ + { + hi2c->Instance->OAR1 = (I2C_OAR1_OA1EN | I2C_OAR1_OA1MODE | hi2c->Init.OwnAddress1); + } + + /*---------------------------- I2Cx CR2 Configuration ----------------------*/ + /* Configure I2Cx: Addressing Master mode */ + if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_10BIT) + { + hi2c->Instance->CR2 = (I2C_CR2_ADD10); + } + /* Enable the AUTOEND by default, and enable NACK (should be disable only during Slave process */ + hi2c->Instance->CR2 |= (I2C_CR2_AUTOEND | I2C_CR2_NACK); + + /*---------------------------- I2Cx OAR2 Configuration ---------------------*/ + /* Disable Own Address2 before set the Own Address2 configuration */ + hi2c->Instance->OAR2 &= ~I2C_DUALADDRESS_ENABLE; + + /* Configure I2Cx: Dual mode and Own Address2 */ + hi2c->Instance->OAR2 = (hi2c->Init.DualAddressMode | hi2c->Init.OwnAddress2 | \ + (hi2c->Init.OwnAddress2Masks << 8)); + + /*---------------------------- I2Cx CR1 Configuration ----------------------*/ + /* Configure I2Cx: Generalcall and NoStretch mode */ + hi2c->Instance->CR1 = (hi2c->Init.GeneralCallMode | hi2c->Init.NoStretchMode); + + /* Enable the selected I2C peripheral */ + __HAL_I2C_ENABLE(hi2c); + + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_NONE; + hi2c->Mode = HAL_I2C_MODE_NONE; + + return HAL_OK; +} + +/** + * @brief DeInitialize the I2C peripheral. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c) +{ + /* Check the I2C handle allocation */ + if (hi2c == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_I2C_ALL_INSTANCE(hi2c->Instance)); + + hi2c->State = HAL_I2C_STATE_BUSY; + + /* Disable the I2C Peripheral Clock */ + __HAL_I2C_DISABLE(hi2c); + +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + if (hi2c->MspDeInitCallback == NULL) + { + hi2c->MspDeInitCallback = HAL_I2C_MspDeInit; /* Legacy weak MspDeInit */ + } + + /* DeInit the low level hardware: GPIO, CLOCK, NVIC */ + hi2c->MspDeInitCallback(hi2c); +#else + /* DeInit the low level hardware: GPIO, CLOCK, NVIC */ + HAL_I2C_MspDeInit(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + hi2c->State = HAL_I2C_STATE_RESET; + hi2c->PreviousState = I2C_STATE_NONE; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Release Lock */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; +} + +/** + * @brief Initialize the I2C MSP. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitialize the I2C MSP. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_MspDeInit could be implemented in the user file + */ +} + +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) +/** + * @brief Register a User I2C Callback + * To be used instead of the weak predefined callback + * @note The HAL_I2C_RegisterCallback() may be called before HAL_I2C_Init() in HAL_I2C_STATE_RESET + * to register callbacks for HAL_I2C_MSPINIT_CB_ID and HAL_I2C_MSPDEINIT_CB_ID. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param CallbackID ID of the callback to be registered + * This parameter can be one of the following values: + * @arg @ref HAL_I2C_MASTER_TX_COMPLETE_CB_ID Master Tx Transfer completed callback ID + * @arg @ref HAL_I2C_MASTER_RX_COMPLETE_CB_ID Master Rx Transfer completed callback ID + * @arg @ref HAL_I2C_SLAVE_TX_COMPLETE_CB_ID Slave Tx Transfer completed callback ID + * @arg @ref HAL_I2C_SLAVE_RX_COMPLETE_CB_ID Slave Rx Transfer completed callback ID + * @arg @ref HAL_I2C_LISTEN_COMPLETE_CB_ID Listen Complete callback ID + * @arg @ref HAL_I2C_MEM_TX_COMPLETE_CB_ID Memory Tx Transfer callback ID + * @arg @ref HAL_I2C_MEM_RX_COMPLETE_CB_ID Memory Rx Transfer completed callback ID + * @arg @ref HAL_I2C_ERROR_CB_ID Error callback ID + * @arg @ref HAL_I2C_ABORT_CB_ID Abort callback ID + * @arg @ref HAL_I2C_MSPINIT_CB_ID MspInit callback ID + * @arg @ref HAL_I2C_MSPDEINIT_CB_ID MspDeInit callback ID + * @param pCallback pointer to the Callback function + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_RegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID, + pI2C_CallbackTypeDef pCallback) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (pCallback == NULL) + { + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + return HAL_ERROR; + } + + if (HAL_I2C_STATE_READY == hi2c->State) + { + switch (CallbackID) + { + case HAL_I2C_MASTER_TX_COMPLETE_CB_ID : + hi2c->MasterTxCpltCallback = pCallback; + break; + + case HAL_I2C_MASTER_RX_COMPLETE_CB_ID : + hi2c->MasterRxCpltCallback = pCallback; + break; + + case HAL_I2C_SLAVE_TX_COMPLETE_CB_ID : + hi2c->SlaveTxCpltCallback = pCallback; + break; + + case HAL_I2C_SLAVE_RX_COMPLETE_CB_ID : + hi2c->SlaveRxCpltCallback = pCallback; + break; + + case HAL_I2C_LISTEN_COMPLETE_CB_ID : + hi2c->ListenCpltCallback = pCallback; + break; + + case HAL_I2C_MEM_TX_COMPLETE_CB_ID : + hi2c->MemTxCpltCallback = pCallback; + break; + + case HAL_I2C_MEM_RX_COMPLETE_CB_ID : + hi2c->MemRxCpltCallback = pCallback; + break; + + case HAL_I2C_ERROR_CB_ID : + hi2c->ErrorCallback = pCallback; + break; + + case HAL_I2C_ABORT_CB_ID : + hi2c->AbortCpltCallback = pCallback; + break; + + case HAL_I2C_MSPINIT_CB_ID : + hi2c->MspInitCallback = pCallback; + break; + + case HAL_I2C_MSPDEINIT_CB_ID : + hi2c->MspDeInitCallback = pCallback; + break; + + default : + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else if (HAL_I2C_STATE_RESET == hi2c->State) + { + switch (CallbackID) + { + case HAL_I2C_MSPINIT_CB_ID : + hi2c->MspInitCallback = pCallback; + break; + + case HAL_I2C_MSPDEINIT_CB_ID : + hi2c->MspDeInitCallback = pCallback; + break; + + default : + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else + { + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} + +/** + * @brief Unregister an I2C Callback + * I2C callback is redirected to the weak predefined callback + * @note The HAL_I2C_UnRegisterCallback() may be called before HAL_I2C_Init() in HAL_I2C_STATE_RESET + * to un-register callbacks for HAL_I2C_MSPINIT_CB_ID and HAL_I2C_MSPDEINIT_CB_ID. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param CallbackID ID of the callback to be unregistered + * This parameter can be one of the following values: + * This parameter can be one of the following values: + * @arg @ref HAL_I2C_MASTER_TX_COMPLETE_CB_ID Master Tx Transfer completed callback ID + * @arg @ref HAL_I2C_MASTER_RX_COMPLETE_CB_ID Master Rx Transfer completed callback ID + * @arg @ref HAL_I2C_SLAVE_TX_COMPLETE_CB_ID Slave Tx Transfer completed callback ID + * @arg @ref HAL_I2C_SLAVE_RX_COMPLETE_CB_ID Slave Rx Transfer completed callback ID + * @arg @ref HAL_I2C_LISTEN_COMPLETE_CB_ID Listen Complete callback ID + * @arg @ref HAL_I2C_MEM_TX_COMPLETE_CB_ID Memory Tx Transfer callback ID + * @arg @ref HAL_I2C_MEM_RX_COMPLETE_CB_ID Memory Rx Transfer completed callback ID + * @arg @ref HAL_I2C_ERROR_CB_ID Error callback ID + * @arg @ref HAL_I2C_ABORT_CB_ID Abort callback ID + * @arg @ref HAL_I2C_MSPINIT_CB_ID MspInit callback ID + * @arg @ref HAL_I2C_MSPDEINIT_CB_ID MspDeInit callback ID + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_UnRegisterCallback(I2C_HandleTypeDef *hi2c, HAL_I2C_CallbackIDTypeDef CallbackID) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (HAL_I2C_STATE_READY == hi2c->State) + { + switch (CallbackID) + { + case HAL_I2C_MASTER_TX_COMPLETE_CB_ID : + hi2c->MasterTxCpltCallback = HAL_I2C_MasterTxCpltCallback; /* Legacy weak MasterTxCpltCallback */ + break; + + case HAL_I2C_MASTER_RX_COMPLETE_CB_ID : + hi2c->MasterRxCpltCallback = HAL_I2C_MasterRxCpltCallback; /* Legacy weak MasterRxCpltCallback */ + break; + + case HAL_I2C_SLAVE_TX_COMPLETE_CB_ID : + hi2c->SlaveTxCpltCallback = HAL_I2C_SlaveTxCpltCallback; /* Legacy weak SlaveTxCpltCallback */ + break; + + case HAL_I2C_SLAVE_RX_COMPLETE_CB_ID : + hi2c->SlaveRxCpltCallback = HAL_I2C_SlaveRxCpltCallback; /* Legacy weak SlaveRxCpltCallback */ + break; + + case HAL_I2C_LISTEN_COMPLETE_CB_ID : + hi2c->ListenCpltCallback = HAL_I2C_ListenCpltCallback; /* Legacy weak ListenCpltCallback */ + break; + + case HAL_I2C_MEM_TX_COMPLETE_CB_ID : + hi2c->MemTxCpltCallback = HAL_I2C_MemTxCpltCallback; /* Legacy weak MemTxCpltCallback */ + break; + + case HAL_I2C_MEM_RX_COMPLETE_CB_ID : + hi2c->MemRxCpltCallback = HAL_I2C_MemRxCpltCallback; /* Legacy weak MemRxCpltCallback */ + break; + + case HAL_I2C_ERROR_CB_ID : + hi2c->ErrorCallback = HAL_I2C_ErrorCallback; /* Legacy weak ErrorCallback */ + break; + + case HAL_I2C_ABORT_CB_ID : + hi2c->AbortCpltCallback = HAL_I2C_AbortCpltCallback; /* Legacy weak AbortCpltCallback */ + break; + + case HAL_I2C_MSPINIT_CB_ID : + hi2c->MspInitCallback = HAL_I2C_MspInit; /* Legacy weak MspInit */ + break; + + case HAL_I2C_MSPDEINIT_CB_ID : + hi2c->MspDeInitCallback = HAL_I2C_MspDeInit; /* Legacy weak MspDeInit */ + break; + + default : + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else if (HAL_I2C_STATE_RESET == hi2c->State) + { + switch (CallbackID) + { + case HAL_I2C_MSPINIT_CB_ID : + hi2c->MspInitCallback = HAL_I2C_MspInit; /* Legacy weak MspInit */ + break; + + case HAL_I2C_MSPDEINIT_CB_ID : + hi2c->MspDeInitCallback = HAL_I2C_MspDeInit; /* Legacy weak MspDeInit */ + break; + + default : + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else + { + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} + +/** + * @brief Register the Slave Address Match I2C Callback + * To be used instead of the weak HAL_I2C_AddrCallback() predefined callback + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pCallback pointer to the Address Match Callback function + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_RegisterAddrCallback(I2C_HandleTypeDef *hi2c, pI2C_AddrCallbackTypeDef pCallback) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (pCallback == NULL) + { + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + return HAL_ERROR; + } + + if (HAL_I2C_STATE_READY == hi2c->State) + { + hi2c->AddrCallback = pCallback; + } + else + { + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} + +/** + * @brief UnRegister the Slave Address Match I2C Callback + * Info Ready I2C Callback is redirected to the weak HAL_I2C_AddrCallback() predefined callback + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_UnRegisterAddrCallback(I2C_HandleTypeDef *hi2c) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (HAL_I2C_STATE_READY == hi2c->State) + { + hi2c->AddrCallback = HAL_I2C_AddrCallback; /* Legacy weak AddrCallback */ + } + else + { + /* Update the error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_INVALID_CALLBACK; + + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} + +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/** @defgroup I2C_Exported_Functions_Group2 Input and Output operation functions + * @brief Data transfers functions + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to manage the I2C data + transfers. + + (#) There are two modes of transfer: + (++) Blocking mode : The communication is performed in the polling mode. + The status of all data processing is returned by the same function + after finishing transfer. + (++) No-Blocking mode : The communication is performed using Interrupts + or DMA. These functions return the status of the transfer startup. + The end of the data processing will be indicated through the + dedicated I2C IRQ when using Interrupt mode or the DMA IRQ when + using DMA mode. + + (#) Blocking mode functions are : + (++) HAL_I2C_Master_Transmit() + (++) HAL_I2C_Master_Receive() + (++) HAL_I2C_Slave_Transmit() + (++) HAL_I2C_Slave_Receive() + (++) HAL_I2C_Mem_Write() + (++) HAL_I2C_Mem_Read() + (++) HAL_I2C_IsDeviceReady() + + (#) No-Blocking mode functions with Interrupt are : + (++) HAL_I2C_Master_Transmit_IT() + (++) HAL_I2C_Master_Receive_IT() + (++) HAL_I2C_Slave_Transmit_IT() + (++) HAL_I2C_Slave_Receive_IT() + (++) HAL_I2C_Mem_Write_IT() + (++) HAL_I2C_Mem_Read_IT() + (++) HAL_I2C_Master_Seq_Transmit_IT() + (++) HAL_I2C_Master_Seq_Receive_IT() + (++) HAL_I2C_Slave_Seq_Transmit_IT() + (++) HAL_I2C_Slave_Seq_Receive_IT() + (++) HAL_I2C_EnableListen_IT() + (++) HAL_I2C_DisableListen_IT() + (++) HAL_I2C_Master_Abort_IT() + + (#) No-Blocking mode functions with DMA are : + (++) HAL_I2C_Master_Transmit_DMA() + (++) HAL_I2C_Master_Receive_DMA() + (++) HAL_I2C_Slave_Transmit_DMA() + (++) HAL_I2C_Slave_Receive_DMA() + (++) HAL_I2C_Mem_Write_DMA() + (++) HAL_I2C_Mem_Read_DMA() + (++) HAL_I2C_Master_Seq_Transmit_DMA() + (++) HAL_I2C_Master_Seq_Receive_DMA() + (++) HAL_I2C_Slave_Seq_Transmit_DMA() + (++) HAL_I2C_Slave_Seq_Receive_DMA() + + (#) A set of Transfer Complete Callbacks are provided in non Blocking mode: + (++) HAL_I2C_MasterTxCpltCallback() + (++) HAL_I2C_MasterRxCpltCallback() + (++) HAL_I2C_SlaveTxCpltCallback() + (++) HAL_I2C_SlaveRxCpltCallback() + (++) HAL_I2C_MemTxCpltCallback() + (++) HAL_I2C_MemRxCpltCallback() + (++) HAL_I2C_AddrCallback() + (++) HAL_I2C_ListenCpltCallback() + (++) HAL_I2C_ErrorCallback() + (++) HAL_I2C_AbortCpltCallback() + +@endverbatim + * @{ + */ + +/** + * @brief Transmits in master mode an amount of data in blocking mode. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param Timeout Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t Timeout) +{ + uint32_t tickstart; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* Init tickstart for timeout management*/ + tickstart = HAL_GetTick(); + + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferISR = NULL; + + /* Send Slave Address */ + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, + I2C_GENERATE_START_WRITE); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_GENERATE_START_WRITE); + } + + while (hi2c->XferCount > 0U) + { + /* Wait until TXIS flag is set */ + if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + hi2c->XferSize--; + + if ((hi2c->XferCount != 0U) && (hi2c->XferSize == 0U)) + { + /* Wait until TCR flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TCR, RESET, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, + I2C_NO_STARTSTOP); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_NO_STARTSTOP); + } + } + } + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is set */ + if (I2C_WaitOnSTOPFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + I2C_RESET_CR2(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receives in master mode an amount of data in blocking mode. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param Timeout Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t Timeout) +{ + uint32_t tickstart; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* Init tickstart for timeout management*/ + tickstart = HAL_GetTick(); + + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferISR = NULL; + + /* Send Slave Address */ + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, + I2C_GENERATE_START_READ); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_GENERATE_START_READ); + } + + while (hi2c->XferCount > 0U) + { + /* Wait until RXNE flag is set */ + if (I2C_WaitOnRXNEFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferSize--; + hi2c->XferCount--; + + if ((hi2c->XferCount != 0U) && (hi2c->XferSize == 0U)) + { + /* Wait until TCR flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TCR, RESET, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, + I2C_NO_STARTSTOP); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_NO_STARTSTOP); + } + } + } + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is set */ + if (I2C_WaitOnSTOPFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + I2C_RESET_CR2(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmits in slave mode an amount of data in blocking mode. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param Timeout Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t Timeout) +{ + uint32_t tickstart; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* Init tickstart for timeout management*/ + tickstart = HAL_GetTick(); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferISR = NULL; + + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Wait until ADDR flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, RESET, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + /* Preload TX data if no stretch enable */ + if (hi2c->Init.NoStretchMode == I2C_NOSTRETCH_ENABLE) + { + /* Preload TX register */ + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + } + + /* Clear ADDR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + + /* If 10bit addressing mode is selected */ + if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_10BIT) + { + /* Wait until ADDR flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, RESET, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + /* Clear ADDR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + } + + /* Wait until DIR flag is set Transmitter mode */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_DIR, RESET, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + while (hi2c->XferCount > 0U) + { + /* Wait until TXIS flag is set */ + if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + } + + /* Wait until AF flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_AF, RESET, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + + /* Clear AF flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Wait until STOP flag is set */ + if (I2C_WaitOnSTOPFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + + return HAL_ERROR; + } + + /* Clear STOP flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Wait until BUSY flag is reset */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in slave mode an amount of data in blocking mode + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param Timeout Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t Timeout) +{ + uint32_t tickstart; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* Init tickstart for timeout management*/ + tickstart = HAL_GetTick(); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferISR = NULL; + + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Wait until ADDR flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_ADDR, RESET, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + /* Clear ADDR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + + /* Wait until DIR flag is reset Receiver mode */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_DIR, SET, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + while (hi2c->XferCount > 0U) + { + /* Wait until RXNE flag is set */ + if (I2C_WaitOnRXNEFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + + /* Store Last receive data if any */ + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == SET) + { + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + hi2c->XferSize--; + } + + return HAL_ERROR; + } + + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + hi2c->XferSize--; + } + + /* Wait until STOP flag is set */ + if (I2C_WaitOnSTOPFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + /* Clear STOP flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Wait until BUSY flag is reset */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, Timeout, tickstart) != HAL_OK) + { + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + return HAL_ERROR; + } + + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmit in master mode an amount of data in non-blocking mode with Interrupt + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size) +{ + uint32_t xfermode; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Master_ISR_IT; + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + xfermode = I2C_AUTOEND_MODE; + } + + /* Send Slave Address */ + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, I2C_GENERATE_START_WRITE); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in master mode an amount of data in non-blocking mode with Interrupt + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size) +{ + uint32_t xfermode; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Master_ISR_IT; + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + xfermode = I2C_AUTOEND_MODE; + } + + /* Send Slave Address */ + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, I2C_GENERATE_START_READ); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, RXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_RX_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmit in slave mode an amount of data in non-blocking mode with Interrupt + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) +{ + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Slave_ISR_IT; + + /* Preload TX data if no stretch enable */ + if (hi2c->Init.NoStretchMode == I2C_NOSTRETCH_ENABLE) + { + /* Preload TX register */ + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + hi2c->XferSize--; + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT | I2C_XFER_LISTEN_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in slave mode an amount of data in non-blocking mode with Interrupt + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) +{ + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Slave_ISR_IT; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, RXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_RX_IT | I2C_XFER_LISTEN_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmit in master mode an amount of data in non-blocking mode with DMA + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size) +{ + uint32_t xfermode; + HAL_StatusTypeDef dmaxferstatus; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Master_ISR_DMA; + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + xfermode = I2C_AUTOEND_MODE; + } + + if (hi2c->XferSize > 0U) + { + if (hi2c->hdmatx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmatx->XferCpltCallback = I2C_DMAMasterTransmitCplt; + + /* Set the DMA error callback */ + hi2c->hdmatx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmatx->XferHalfCpltCallback = NULL; + hi2c->hdmatx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)pData, (uint32_t)&hi2c->Instance->TXDR, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Send Slave Address */ + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, I2C_GENERATE_START_WRITE); + + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR and NACK interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_ERROR_IT); + + /* Enable DMA Request */ + hi2c->Instance->CR1 |= I2C_CR1_TXDMAEN; + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + else + { + /* Update Transfer ISR function pointer */ + hi2c->XferISR = I2C_Master_ISR_IT; + + /* Send Slave Address */ + /* Set NBYTES to write and generate START condition */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_GENERATE_START_WRITE); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in master mode an amount of data in non-blocking mode with DMA + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size) +{ + uint32_t xfermode; + HAL_StatusTypeDef dmaxferstatus; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Master_ISR_DMA; + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + xfermode = I2C_AUTOEND_MODE; + } + + if (hi2c->XferSize > 0U) + { + if (hi2c->hdmarx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmarx->XferCpltCallback = I2C_DMAMasterReceiveCplt; + + /* Set the DMA error callback */ + hi2c->hdmarx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmarx->XferHalfCpltCallback = NULL; + hi2c->hdmarx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmarx, (uint32_t)&hi2c->Instance->RXDR, (uint32_t)pData, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Send Slave Address */ + /* Set NBYTES to read and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, I2C_GENERATE_START_READ); + + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR and NACK interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_ERROR_IT); + + /* Enable DMA Request */ + hi2c->Instance->CR1 |= I2C_CR1_RXDMAEN; + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + else + { + /* Update Transfer ISR function pointer */ + hi2c->XferISR = I2C_Master_ISR_IT; + + /* Send Slave Address */ + /* Set NBYTES to read and generate START condition */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_GENERATE_START_READ); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Transmit in slave mode an amount of data in non-blocking mode with DMA + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) +{ + HAL_StatusTypeDef dmaxferstatus; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Slave_ISR_DMA; + + /* Preload TX data if no stretch enable */ + if (hi2c->Init.NoStretchMode == I2C_NOSTRETCH_ENABLE) + { + /* Preload TX register */ + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + hi2c->XferSize--; + } + + if (hi2c->XferCount != 0U) + { + if (hi2c->hdmatx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmatx->XferCpltCallback = I2C_DMASlaveTransmitCplt; + + /* Set the DMA error callback */ + hi2c->hdmatx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmatx->XferHalfCpltCallback = NULL; + hi2c->hdmatx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, + (uint32_t)hi2c->pBuffPtr, (uint32_t)&hi2c->Instance->TXDR, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, STOP, NACK, ADDR interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_LISTEN_IT); + + /* Enable DMA Request */ + hi2c->Instance->CR1 |= I2C_CR1_TXDMAEN; + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + else + { + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, STOP, NACK, ADDR interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_LISTEN_IT); + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive in slave mode an amount of data in non-blocking mode with DMA + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size) +{ + HAL_StatusTypeDef dmaxferstatus; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Slave_ISR_DMA; + + if (hi2c->hdmarx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmarx->XferCpltCallback = I2C_DMASlaveReceiveCplt; + + /* Set the DMA error callback */ + hi2c->hdmarx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmarx->XferHalfCpltCallback = NULL; + hi2c->hdmarx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmarx, (uint32_t)&hi2c->Instance->RXDR, (uint32_t)pData, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, STOP, NACK, ADDR interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_LISTEN_IT); + + /* Enable DMA Request */ + hi2c->Instance->CR1 |= I2C_CR1_RXDMAEN; + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Write an amount of data in blocking mode to a specific memory address + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param MemAddress Internal memory address + * @param MemAddSize Size of internal memory address + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param Timeout Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + uint32_t tickstart; + + /* Check the parameters */ + assert_param(IS_I2C_MEMADD_SIZE(MemAddSize)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* Init tickstart for timeout management*/ + tickstart = HAL_GetTick(); + + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_MEM; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferISR = NULL; + + /* Send Slave Address and Memory Address */ + if (I2C_RequestMemoryWrite(hi2c, DevAddress, MemAddress, MemAddSize, Timeout, tickstart) != HAL_OK) + { + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + return HAL_ERROR; + } + + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, I2C_NO_STARTSTOP); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, I2C_NO_STARTSTOP); + } + + do + { + /* Wait until TXIS flag is set */ + if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + hi2c->XferSize--; + + if ((hi2c->XferCount != 0U) && (hi2c->XferSize == 0U)) + { + /* Wait until TCR flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TCR, RESET, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, + I2C_NO_STARTSTOP); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_NO_STARTSTOP); + } + } + + } while (hi2c->XferCount > 0U); + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if (I2C_WaitOnSTOPFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + I2C_RESET_CR2(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Read an amount of data in blocking mode from a specific memory address + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param MemAddress Internal memory address + * @param MemAddSize Size of internal memory address + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param Timeout Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + uint32_t tickstart; + + /* Check the parameters */ + assert_param(IS_I2C_MEMADD_SIZE(MemAddSize)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* Init tickstart for timeout management*/ + tickstart = HAL_GetTick(); + + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_MEM; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferISR = NULL; + + /* Send Slave Address and Memory Address */ + if (I2C_RequestMemoryRead(hi2c, DevAddress, MemAddress, MemAddSize, Timeout, tickstart) != HAL_OK) + { + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + return HAL_ERROR; + } + + /* Send Slave Address */ + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, + I2C_GENERATE_START_READ); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_GENERATE_START_READ); + } + + do + { + /* Wait until RXNE flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_RXNE, RESET, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferSize--; + hi2c->XferCount--; + + if ((hi2c->XferCount != 0U) && (hi2c->XferSize == 0U)) + { + /* Wait until TCR flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TCR, RESET, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t) hi2c->XferSize, I2C_RELOAD_MODE, + I2C_NO_STARTSTOP); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_NO_STARTSTOP); + } + } + } while (hi2c->XferCount > 0U); + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is reset */ + if (I2C_WaitOnSTOPFlagUntilTimeout(hi2c, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + I2C_RESET_CR2(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} +/** + * @brief Write an amount of data in non-blocking mode with Interrupt to a specific memory address + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param MemAddress Internal memory address + * @param MemAddSize Size of internal memory address + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size) +{ + /* Check the parameters */ + assert_param(IS_I2C_MEMADD_SIZE(MemAddSize)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_MEM; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Mem_ISR_IT; + hi2c->Devaddress = DevAddress; + + /* If Memory address size is 8Bit */ + if (MemAddSize == I2C_MEMADD_SIZE_8BIT) + { + /* Prefetch Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_LSB(MemAddress); + + /* Reset Memaddress content */ + hi2c->Memaddress = 0xFFFFFFFFU; + } + /* If Memory address size is 16Bit */ + else + { + /* Prefetch Memory Address (MSB part, LSB will be manage through interrupt) */ + hi2c->Instance->TXDR = I2C_MEM_ADD_MSB(MemAddress); + + /* Prepare Memaddress buffer for LSB part */ + hi2c->Memaddress = I2C_MEM_ADD_LSB(MemAddress); + } + /* Send Slave Address and Memory Address */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)MemAddSize, I2C_RELOAD_MODE, I2C_GENERATE_START_WRITE); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Read an amount of data in non-blocking mode with Interrupt from a specific memory address + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param MemAddress Internal memory address + * @param MemAddSize Size of internal memory address + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size) +{ + /* Check the parameters */ + assert_param(IS_I2C_MEMADD_SIZE(MemAddSize)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_MEM; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Mem_ISR_IT; + hi2c->Devaddress = DevAddress; + + /* If Memory address size is 8Bit */ + if (MemAddSize == I2C_MEMADD_SIZE_8BIT) + { + /* Prefetch Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_LSB(MemAddress); + + /* Reset Memaddress content */ + hi2c->Memaddress = 0xFFFFFFFFU; + } + /* If Memory address size is 16Bit */ + else + { + /* Prefetch Memory Address (MSB part, LSB will be manage through interrupt) */ + hi2c->Instance->TXDR = I2C_MEM_ADD_MSB(MemAddress); + + /* Prepare Memaddress buffer for LSB part */ + hi2c->Memaddress = I2C_MEM_ADD_LSB(MemAddress); + } + /* Send Slave Address and Memory Address */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)MemAddSize, I2C_SOFTEND_MODE, I2C_GENERATE_START_WRITE); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + + /* Enable ERR, TC, STOP, NACK, RXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, (I2C_XFER_TX_IT | I2C_XFER_RX_IT)); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Write an amount of data in non-blocking mode with DMA to a specific memory address + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param MemAddress Internal memory address + * @param MemAddSize Size of internal memory address + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size) +{ + HAL_StatusTypeDef dmaxferstatus; + + /* Check the parameters */ + assert_param(IS_I2C_MEMADD_SIZE(MemAddSize)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_MEM; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Mem_ISR_DMA; + hi2c->Devaddress = DevAddress; + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + } + + /* If Memory address size is 8Bit */ + if (MemAddSize == I2C_MEMADD_SIZE_8BIT) + { + /* Prefetch Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_LSB(MemAddress); + + /* Reset Memaddress content */ + hi2c->Memaddress = 0xFFFFFFFFU; + } + /* If Memory address size is 16Bit */ + else + { + /* Prefetch Memory Address (MSB part, LSB will be manage through interrupt) */ + hi2c->Instance->TXDR = I2C_MEM_ADD_MSB(MemAddress); + + /* Prepare Memaddress buffer for LSB part */ + hi2c->Memaddress = I2C_MEM_ADD_LSB(MemAddress); + } + + if (hi2c->hdmatx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmatx->XferCpltCallback = I2C_DMAMasterTransmitCplt; + + /* Set the DMA error callback */ + hi2c->hdmatx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmatx->XferHalfCpltCallback = NULL; + hi2c->hdmatx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)pData, (uint32_t)&hi2c->Instance->TXDR, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Send Slave Address and Memory Address */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)MemAddSize, I2C_RELOAD_MODE, I2C_GENERATE_START_WRITE); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Reads an amount of data in non-blocking mode with DMA from a specific memory address. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param MemAddress Internal memory address + * @param MemAddSize Size of internal memory address + * @param pData Pointer to data buffer + * @param Size Amount of data to be read + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, + uint16_t MemAddSize, uint8_t *pData, uint16_t Size) +{ + HAL_StatusTypeDef dmaxferstatus; + + /* Check the parameters */ + assert_param(IS_I2C_MEMADD_SIZE(MemAddSize)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_MEM; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferISR = I2C_Mem_ISR_DMA; + hi2c->Devaddress = DevAddress; + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + } + + /* If Memory address size is 8Bit */ + if (MemAddSize == I2C_MEMADD_SIZE_8BIT) + { + /* Prefetch Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_LSB(MemAddress); + + /* Reset Memaddress content */ + hi2c->Memaddress = 0xFFFFFFFFU; + } + /* If Memory address size is 16Bit */ + else + { + /* Prefetch Memory Address (MSB part, LSB will be manage through interrupt) */ + hi2c->Instance->TXDR = I2C_MEM_ADD_MSB(MemAddress); + + /* Prepare Memaddress buffer for LSB part */ + hi2c->Memaddress = I2C_MEM_ADD_LSB(MemAddress); + } + + if (hi2c->hdmarx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmarx->XferCpltCallback = I2C_DMAMasterReceiveCplt; + + /* Set the DMA error callback */ + hi2c->hdmarx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmarx->XferHalfCpltCallback = NULL; + hi2c->hdmarx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmarx, (uint32_t)&hi2c->Instance->RXDR, (uint32_t)pData, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Send Slave Address and Memory Address */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)MemAddSize, I2C_SOFTEND_MODE, I2C_GENERATE_START_WRITE); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Checks if target device is ready for communication. + * @note This function is used with Memory devices + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param Trials Number of trials + * @param Timeout Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, + uint32_t Timeout) +{ + uint32_t tickstart; + + __IO uint32_t I2C_Trials = 0UL; + + FlagStatus tmp1; + FlagStatus tmp2; + + if (hi2c->State == HAL_I2C_STATE_READY) + { + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) == SET) + { + return HAL_BUSY; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + do + { + /* Generate Start */ + hi2c->Instance->CR2 = I2C_GENERATE_START(hi2c->Init.AddressingMode, DevAddress); + + /* No need to Check TC flag, with AUTOEND mode the stop is automatically generated */ + /* Wait until STOPF flag is set or a NACK flag is set*/ + tickstart = HAL_GetTick(); + + tmp1 = __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF); + tmp2 = __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_AF); + + while ((tmp1 == RESET) && (tmp2 == RESET)) + { + if (Timeout != HAL_MAX_DELAY) + { + if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U)) + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + + tmp1 = __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF); + tmp2 = __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_AF); + } + + /* Check if the NACKF flag has not been set */ + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_AF) == RESET) + { + /* Wait until STOPF flag is reset */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_STOPF, RESET, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Device is ready */ + hi2c->State = HAL_I2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + /* Wait until STOPF flag is reset */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_STOPF, RESET, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Clear STOP Flag, auto generated with autoend*/ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + } + + /* Check if the maximum allowed number of trials has been reached */ + if (I2C_Trials == Trials) + { + /* Generate Stop */ + hi2c->Instance->CR2 |= I2C_CR2_STOP; + + /* Wait until STOPF flag is reset */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_STOPF, RESET, Timeout, tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + } + + /* Increment Trials */ + I2C_Trials++; + } while (I2C_Trials < Trials); + + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Sequential transmit in master I2C mode an amount of data in non-blocking mode with Interrupt. + * @note This interface allow to manage repeated start condition when a direction change during transfer + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param XferOptions Options of Transfer, value of @ref I2C_XFEROPTIONS + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t XferOptions) +{ + uint32_t xfermode; + uint32_t xferrequest = I2C_GENERATE_START_WRITE; + + /* Check the parameters */ + assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = XferOptions; + hi2c->XferISR = I2C_Master_ISR_IT; + + /* If hi2c->XferCount > MAX_NBYTE_SIZE, use reload mode */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + xfermode = hi2c->XferOptions; + } + + /* If transfer direction not change and there is no request to start another frame, + do not generate Restart Condition */ + /* Mean Previous state is same as current state */ + if ((hi2c->PreviousState == I2C_STATE_MASTER_BUSY_TX) && \ + (IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(XferOptions) == 0)) + { + xferrequest = I2C_NO_STARTSTOP; + } + else + { + /* Convert OTHER_xxx XferOptions if any */ + I2C_ConvertOtherXferOptions(hi2c); + + /* Update xfermode accordingly if no reload is necessary */ + if (hi2c->XferCount <= MAX_NBYTE_SIZE) + { + xfermode = hi2c->XferOptions; + } + } + + /* Send Slave Address and set NBYTES to write */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Sequential transmit in master I2C mode an amount of data in non-blocking mode with DMA. + * @note This interface allow to manage repeated start condition when a direction change during transfer + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param XferOptions Options of Transfer, value of @ref I2C_XFEROPTIONS + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t XferOptions) +{ + uint32_t xfermode; + uint32_t xferrequest = I2C_GENERATE_START_WRITE; + HAL_StatusTypeDef dmaxferstatus; + + /* Check the parameters */ + assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_TX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = XferOptions; + hi2c->XferISR = I2C_Master_ISR_DMA; + + /* If hi2c->XferCount > MAX_NBYTE_SIZE, use reload mode */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + xfermode = hi2c->XferOptions; + } + + /* If transfer direction not change and there is no request to start another frame, + do not generate Restart Condition */ + /* Mean Previous state is same as current state */ + if ((hi2c->PreviousState == I2C_STATE_MASTER_BUSY_TX) && \ + (IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(XferOptions) == 0)) + { + xferrequest = I2C_NO_STARTSTOP; + } + else + { + /* Convert OTHER_xxx XferOptions if any */ + I2C_ConvertOtherXferOptions(hi2c); + + /* Update xfermode accordingly if no reload is necessary */ + if (hi2c->XferCount <= MAX_NBYTE_SIZE) + { + xfermode = hi2c->XferOptions; + } + } + + if (hi2c->XferSize > 0U) + { + if (hi2c->hdmatx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmatx->XferCpltCallback = I2C_DMAMasterTransmitCplt; + + /* Set the DMA error callback */ + hi2c->hdmatx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmatx->XferHalfCpltCallback = NULL; + hi2c->hdmatx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)pData, (uint32_t)&hi2c->Instance->TXDR, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Send Slave Address and set NBYTES to write */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest); + + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR and NACK interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_ERROR_IT); + + /* Enable DMA Request */ + hi2c->Instance->CR1 |= I2C_CR1_TXDMAEN; + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + else + { + /* Update Transfer ISR function pointer */ + hi2c->XferISR = I2C_Master_ISR_IT; + + /* Send Slave Address */ + /* Set NBYTES to write and generate START condition */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_GENERATE_START_WRITE); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Sequential receive in master I2C mode an amount of data in non-blocking mode with Interrupt + * @note This interface allow to manage repeated start condition when a direction change during transfer + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param XferOptions Options of Transfer, value of @ref I2C_XFEROPTIONS + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t XferOptions) +{ + uint32_t xfermode; + uint32_t xferrequest = I2C_GENERATE_START_READ; + + /* Check the parameters */ + assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = XferOptions; + hi2c->XferISR = I2C_Master_ISR_IT; + + /* If hi2c->XferCount > MAX_NBYTE_SIZE, use reload mode */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + xfermode = hi2c->XferOptions; + } + + /* If transfer direction not change and there is no request to start another frame, + do not generate Restart Condition */ + /* Mean Previous state is same as current state */ + if ((hi2c->PreviousState == I2C_STATE_MASTER_BUSY_RX) && \ + (IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(XferOptions) == 0)) + { + xferrequest = I2C_NO_STARTSTOP; + } + else + { + /* Convert OTHER_xxx XferOptions if any */ + I2C_ConvertOtherXferOptions(hi2c); + + /* Update xfermode accordingly if no reload is necessary */ + if (hi2c->XferCount <= MAX_NBYTE_SIZE) + { + xfermode = hi2c->XferOptions; + } + } + + /* Send Slave Address and set NBYTES to read */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + I2C_Enable_IRQ(hi2c, I2C_XFER_RX_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Sequential receive in master I2C mode an amount of data in non-blocking mode with DMA + * @note This interface allow to manage repeated start condition when a direction change during transfer + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param XferOptions Options of Transfer, value of @ref I2C_XFEROPTIONS + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, + uint16_t Size, uint32_t XferOptions) +{ + uint32_t xfermode; + uint32_t xferrequest = I2C_GENERATE_START_READ; + HAL_StatusTypeDef dmaxferstatus; + + /* Check the parameters */ + assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY_RX; + hi2c->Mode = HAL_I2C_MODE_MASTER; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferOptions = XferOptions; + hi2c->XferISR = I2C_Master_ISR_DMA; + + /* If hi2c->XferCount > MAX_NBYTE_SIZE, use reload mode */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + xfermode = hi2c->XferOptions; + } + + /* If transfer direction not change and there is no request to start another frame, + do not generate Restart Condition */ + /* Mean Previous state is same as current state */ + if ((hi2c->PreviousState == I2C_STATE_MASTER_BUSY_RX) && \ + (IS_I2C_TRANSFER_OTHER_OPTIONS_REQUEST(XferOptions) == 0)) + { + xferrequest = I2C_NO_STARTSTOP; + } + else + { + /* Convert OTHER_xxx XferOptions if any */ + I2C_ConvertOtherXferOptions(hi2c); + + /* Update xfermode accordingly if no reload is necessary */ + if (hi2c->XferCount <= MAX_NBYTE_SIZE) + { + xfermode = hi2c->XferOptions; + } + } + + if (hi2c->XferSize > 0U) + { + if (hi2c->hdmarx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmarx->XferCpltCallback = I2C_DMAMasterReceiveCplt; + + /* Set the DMA error callback */ + hi2c->hdmarx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmarx->XferHalfCpltCallback = NULL; + hi2c->hdmarx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmarx, (uint32_t)&hi2c->Instance->RXDR, (uint32_t)pData, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Send Slave Address and set NBYTES to read */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, xfermode, xferrequest); + + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR and NACK interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_ERROR_IT); + + /* Enable DMA Request */ + hi2c->Instance->CR1 |= I2C_CR1_RXDMAEN; + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + else + { + /* Update Transfer ISR function pointer */ + hi2c->XferISR = I2C_Master_ISR_IT; + + /* Send Slave Address */ + /* Set NBYTES to read and generate START condition */ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)hi2c->XferSize, I2C_AUTOEND_MODE, + I2C_GENERATE_START_READ); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, TC, STOP, NACK, TXI interrupt */ + /* possible to enable all of these */ + /* I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | + I2C_IT_ADDRI | I2C_IT_RXI | I2C_IT_TXI */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT); + } + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Sequential transmit in slave/device I2C mode an amount of data in non-blocking mode with Interrupt + * @note This interface allow to manage repeated start condition when a direction change during transfer + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param XferOptions Options of Transfer, value of @ref I2C_XFEROPTIONS + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t XferOptions) +{ + /* Declaration of tmp to prevent undefined behavior of volatile usage */ + FlagStatus tmp; + + /* Check the parameters */ + assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions)); + + if (((uint32_t)hi2c->State & (uint32_t)HAL_I2C_STATE_LISTEN) == (uint32_t)HAL_I2C_STATE_LISTEN) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + /* Disable Interrupts, to prevent preemption during treatment in case of multicall */ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_TX_IT); + + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* I2C cannot manage full duplex exchange so disable previous IT enabled if any */ + /* and then toggle the HAL slave RX state to TX state */ + if (hi2c->State == HAL_I2C_STATE_BUSY_RX_LISTEN) + { + /* Disable associated Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); + + /* Abort DMA Xfer if any */ + if ((hi2c->Instance->CR1 & I2C_CR1_RXDMAEN) == I2C_CR1_RXDMAEN) + { + hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; + + if (hi2c->hdmarx != NULL) + { + /* Set the I2C DMA Abort callback : + will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ + hi2c->hdmarx->XferAbortCallback = I2C_DMAAbort; + + /* Abort DMA RX */ + if (HAL_DMA_Abort_IT(hi2c->hdmarx) != HAL_OK) + { + /* Call Directly XferAbortCallback function in case of error */ + hi2c->hdmarx->XferAbortCallback(hi2c->hdmarx); + } + } + } + } + + hi2c->State = HAL_I2C_STATE_BUSY_TX_LISTEN; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferOptions = XferOptions; + hi2c->XferISR = I2C_Slave_ISR_IT; + + tmp = __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_ADDR); + if ((I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE) && (tmp != RESET)) + { + /* Clear ADDR flag after prepare the transfer parameters */ + /* This action will generate an acknowledge to the Master */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* REnable ADDR interrupt */ + I2C_Enable_IRQ(hi2c, I2C_XFER_TX_IT | I2C_XFER_LISTEN_IT); + + return HAL_OK; + } + else + { + return HAL_ERROR; + } +} + +/** + * @brief Sequential transmit in slave/device I2C mode an amount of data in non-blocking mode with DMA + * @note This interface allow to manage repeated start condition when a direction change during transfer + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param XferOptions Options of Transfer, value of @ref I2C_XFEROPTIONS + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t XferOptions) +{ + /* Declaration of tmp to prevent undefined behavior of volatile usage */ + FlagStatus tmp; + HAL_StatusTypeDef dmaxferstatus; + + /* Check the parameters */ + assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions)); + + if (((uint32_t)hi2c->State & (uint32_t)HAL_I2C_STATE_LISTEN) == (uint32_t)HAL_I2C_STATE_LISTEN) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* Disable Interrupts, to prevent preemption during treatment in case of multicall */ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_TX_IT); + + /* I2C cannot manage full duplex exchange so disable previous IT enabled if any */ + /* and then toggle the HAL slave RX state to TX state */ + if (hi2c->State == HAL_I2C_STATE_BUSY_RX_LISTEN) + { + /* Disable associated Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); + + if ((hi2c->Instance->CR1 & I2C_CR1_RXDMAEN) == I2C_CR1_RXDMAEN) + { + /* Abort DMA Xfer if any */ + if (hi2c->hdmarx != NULL) + { + hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; + + /* Set the I2C DMA Abort callback : + will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ + hi2c->hdmarx->XferAbortCallback = I2C_DMAAbort; + + /* Abort DMA RX */ + if (HAL_DMA_Abort_IT(hi2c->hdmarx) != HAL_OK) + { + /* Call Directly XferAbortCallback function in case of error */ + hi2c->hdmarx->XferAbortCallback(hi2c->hdmarx); + } + } + } + } + else if (hi2c->State == HAL_I2C_STATE_BUSY_TX_LISTEN) + { + if ((hi2c->Instance->CR1 & I2C_CR1_TXDMAEN) == I2C_CR1_TXDMAEN) + { + hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; + + /* Abort DMA Xfer if any */ + if (hi2c->hdmatx != NULL) + { + /* Set the I2C DMA Abort callback : + will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ + hi2c->hdmatx->XferAbortCallback = I2C_DMAAbort; + + /* Abort DMA TX */ + if (HAL_DMA_Abort_IT(hi2c->hdmatx) != HAL_OK) + { + /* Call Directly XferAbortCallback function in case of error */ + hi2c->hdmatx->XferAbortCallback(hi2c->hdmatx); + } + } + } + } + else + { + /* Nothing to do */ + } + + hi2c->State = HAL_I2C_STATE_BUSY_TX_LISTEN; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferOptions = XferOptions; + hi2c->XferISR = I2C_Slave_ISR_DMA; + + if (hi2c->hdmatx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmatx->XferCpltCallback = I2C_DMASlaveTransmitCplt; + + /* Set the DMA error callback */ + hi2c->hdmatx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmatx->XferHalfCpltCallback = NULL; + hi2c->hdmatx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)pData, (uint32_t)&hi2c->Instance->TXDR, + hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Reset XferSize */ + hi2c->XferSize = 0; + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + tmp = __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_ADDR); + if ((I2C_GET_DIR(hi2c) == I2C_DIRECTION_RECEIVE) && (tmp != RESET)) + { + /* Clear ADDR flag after prepare the transfer parameters */ + /* This action will generate an acknowledge to the Master */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Enable DMA Request */ + hi2c->Instance->CR1 |= I2C_CR1_TXDMAEN; + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* Enable ERR, STOP, NACK, ADDR interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_LISTEN_IT); + + return HAL_OK; + } + else + { + return HAL_ERROR; + } +} + +/** + * @brief Sequential receive in slave/device I2C mode an amount of data in non-blocking mode with Interrupt + * @note This interface allow to manage repeated start condition when a direction change during transfer + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param XferOptions Options of Transfer, value of @ref I2C_XFEROPTIONS + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t XferOptions) +{ + /* Declaration of tmp to prevent undefined behavior of volatile usage */ + FlagStatus tmp; + + /* Check the parameters */ + assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions)); + + if (((uint32_t)hi2c->State & (uint32_t)HAL_I2C_STATE_LISTEN) == (uint32_t)HAL_I2C_STATE_LISTEN) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + /* Disable Interrupts, to prevent preemption during treatment in case of multicall */ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_RX_IT); + + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* I2C cannot manage full duplex exchange so disable previous IT enabled if any */ + /* and then toggle the HAL slave TX state to RX state */ + if (hi2c->State == HAL_I2C_STATE_BUSY_TX_LISTEN) + { + /* Disable associated Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); + + if ((hi2c->Instance->CR1 & I2C_CR1_TXDMAEN) == I2C_CR1_TXDMAEN) + { + hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; + + /* Abort DMA Xfer if any */ + if (hi2c->hdmatx != NULL) + { + /* Set the I2C DMA Abort callback : + will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ + hi2c->hdmatx->XferAbortCallback = I2C_DMAAbort; + + /* Abort DMA TX */ + if (HAL_DMA_Abort_IT(hi2c->hdmatx) != HAL_OK) + { + /* Call Directly XferAbortCallback function in case of error */ + hi2c->hdmatx->XferAbortCallback(hi2c->hdmatx); + } + } + } + } + + hi2c->State = HAL_I2C_STATE_BUSY_RX_LISTEN; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferOptions = XferOptions; + hi2c->XferISR = I2C_Slave_ISR_IT; + + tmp = __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_ADDR); + if ((I2C_GET_DIR(hi2c) == I2C_DIRECTION_TRANSMIT) && (tmp != RESET)) + { + /* Clear ADDR flag after prepare the transfer parameters */ + /* This action will generate an acknowledge to the Master */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* REnable ADDR interrupt */ + I2C_Enable_IRQ(hi2c, I2C_XFER_RX_IT | I2C_XFER_LISTEN_IT); + + return HAL_OK; + } + else + { + return HAL_ERROR; + } +} + +/** + * @brief Sequential receive in slave/device I2C mode an amount of data in non-blocking mode with DMA + * @note This interface allow to manage repeated start condition when a direction change during transfer + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param pData Pointer to data buffer + * @param Size Amount of data to be sent + * @param XferOptions Options of Transfer, value of @ref I2C_XFEROPTIONS + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, + uint32_t XferOptions) +{ + /* Declaration of tmp to prevent undefined behavior of volatile usage */ + FlagStatus tmp; + HAL_StatusTypeDef dmaxferstatus; + + /* Check the parameters */ + assert_param(IS_I2C_TRANSFER_OPTIONS_REQUEST(XferOptions)); + + if (((uint32_t)hi2c->State & (uint32_t)HAL_I2C_STATE_LISTEN) == (uint32_t)HAL_I2C_STATE_LISTEN) + { + if ((pData == NULL) || (Size == 0U)) + { + hi2c->ErrorCode = HAL_I2C_ERROR_INVALID_PARAM; + return HAL_ERROR; + } + + /* Disable Interrupts, to prevent preemption during treatment in case of multicall */ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_RX_IT); + + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* I2C cannot manage full duplex exchange so disable previous IT enabled if any */ + /* and then toggle the HAL slave TX state to RX state */ + if (hi2c->State == HAL_I2C_STATE_BUSY_TX_LISTEN) + { + /* Disable associated Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); + + if ((hi2c->Instance->CR1 & I2C_CR1_TXDMAEN) == I2C_CR1_TXDMAEN) + { + /* Abort DMA Xfer if any */ + if (hi2c->hdmatx != NULL) + { + hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; + + /* Set the I2C DMA Abort callback : + will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ + hi2c->hdmatx->XferAbortCallback = I2C_DMAAbort; + + /* Abort DMA TX */ + if (HAL_DMA_Abort_IT(hi2c->hdmatx) != HAL_OK) + { + /* Call Directly XferAbortCallback function in case of error */ + hi2c->hdmatx->XferAbortCallback(hi2c->hdmatx); + } + } + } + } + else if (hi2c->State == HAL_I2C_STATE_BUSY_RX_LISTEN) + { + if ((hi2c->Instance->CR1 & I2C_CR1_RXDMAEN) == I2C_CR1_RXDMAEN) + { + hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; + + /* Abort DMA Xfer if any */ + if (hi2c->hdmarx != NULL) + { + /* Set the I2C DMA Abort callback : + will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ + hi2c->hdmarx->XferAbortCallback = I2C_DMAAbort; + + /* Abort DMA RX */ + if (HAL_DMA_Abort_IT(hi2c->hdmarx) != HAL_OK) + { + /* Call Directly XferAbortCallback function in case of error */ + hi2c->hdmarx->XferAbortCallback(hi2c->hdmarx); + } + } + } + } + else + { + /* Nothing to do */ + } + + hi2c->State = HAL_I2C_STATE_BUSY_RX_LISTEN; + hi2c->Mode = HAL_I2C_MODE_SLAVE; + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + + /* Enable Address Acknowledge */ + hi2c->Instance->CR2 &= ~I2C_CR2_NACK; + + /* Prepare transfer parameters */ + hi2c->pBuffPtr = pData; + hi2c->XferCount = Size; + hi2c->XferSize = hi2c->XferCount; + hi2c->XferOptions = XferOptions; + hi2c->XferISR = I2C_Slave_ISR_DMA; + + if (hi2c->hdmarx != NULL) + { + /* Set the I2C DMA transfer complete callback */ + hi2c->hdmarx->XferCpltCallback = I2C_DMASlaveReceiveCplt; + + /* Set the DMA error callback */ + hi2c->hdmarx->XferErrorCallback = I2C_DMAError; + + /* Set the unused DMA callbacks to NULL */ + hi2c->hdmarx->XferHalfCpltCallback = NULL; + hi2c->hdmarx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + dmaxferstatus = HAL_DMA_Start_IT(hi2c->hdmarx, (uint32_t)&hi2c->Instance->RXDR, + (uint32_t)pData, hi2c->XferSize); + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA_PARAM; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + if (dmaxferstatus == HAL_OK) + { + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Reset XferSize */ + hi2c->XferSize = 0; + } + else + { + /* Update I2C state */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Update I2C error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_DMA; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + + tmp = __HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_ADDR); + if ((I2C_GET_DIR(hi2c) == I2C_DIRECTION_TRANSMIT) && (tmp != RESET)) + { + /* Clear ADDR flag after prepare the transfer parameters */ + /* This action will generate an acknowledge to the Master */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Enable DMA Request */ + hi2c->Instance->CR1 |= I2C_CR1_RXDMAEN; + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + /* REnable ADDR interrupt */ + I2C_Enable_IRQ(hi2c, I2C_XFER_RX_IT | I2C_XFER_LISTEN_IT); + + return HAL_OK; + } + else + { + return HAL_ERROR; + } +} + +/** + * @brief Enable the Address listen mode with Interrupt. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_EnableListen_IT(I2C_HandleTypeDef *hi2c) +{ + if (hi2c->State == HAL_I2C_STATE_READY) + { + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->XferISR = I2C_Slave_ISR_IT; + + /* Enable the Address Match interrupt */ + I2C_Enable_IRQ(hi2c, I2C_XFER_LISTEN_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Disable the Address listen mode with Interrupt. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c) +{ + /* Declaration of tmp to prevent undefined behavior of volatile usage */ + uint32_t tmp; + + /* Disable Address listen mode only if a transfer is not ongoing */ + if (hi2c->State == HAL_I2C_STATE_LISTEN) + { + tmp = (uint32_t)(hi2c->State) & I2C_STATE_MSK; + hi2c->PreviousState = tmp | (uint32_t)(hi2c->Mode); + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + hi2c->XferISR = NULL; + + /* Disable the Address Match interrupt */ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Abort a master I2C IT or DMA process communication with Interrupt. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress) +{ + if (hi2c->Mode == HAL_I2C_MODE_MASTER) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + /* Disable Interrupts and Store Previous state */ + if (hi2c->State == HAL_I2C_STATE_BUSY_TX) + { + I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); + hi2c->PreviousState = I2C_STATE_MASTER_BUSY_TX; + } + else if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); + hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX; + } + else + { + /* Do nothing */ + } + + /* Set State at HAL_I2C_STATE_ABORT */ + hi2c->State = HAL_I2C_STATE_ABORT; + + /* Set NBYTES to 1 to generate a dummy read on I2C peripheral */ + /* Set AUTOEND mode, this will generate a NACK then STOP condition to abort the current transfer */ + I2C_TransferConfig(hi2c, DevAddress, 1, I2C_AUTOEND_MODE, I2C_GENERATE_STOP); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Note : The I2C interrupts must be enabled after unlocking current process + to avoid the risk of I2C interrupt handle execution before current + process unlock */ + I2C_Enable_IRQ(hi2c, I2C_XFER_CPLT_IT); + + return HAL_OK; + } + else + { + /* Wrong usage of abort function */ + /* This function should be used only in case of abort monitored by master device */ + return HAL_ERROR; + } +} + +/** + * @} + */ + +/** @defgroup I2C_IRQ_Handler_and_Callbacks IRQ Handler and Callbacks + * @{ + */ + +/** + * @brief This function handles I2C event interrupt request. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c) /* Derogation MISRAC2012-Rule-8.13 */ +{ + /* Get current IT Flags and IT sources value */ + uint32_t itflags = READ_REG(hi2c->Instance->ISR); + uint32_t itsources = READ_REG(hi2c->Instance->CR1); + + /* I2C events treatment -------------------------------------*/ + if (hi2c->XferISR != NULL) + { + hi2c->XferISR(hi2c, itflags, itsources); + } +} + +/** + * @brief This function handles I2C error interrupt request. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c) +{ + uint32_t itflags = READ_REG(hi2c->Instance->ISR); + uint32_t itsources = READ_REG(hi2c->Instance->CR1); + uint32_t tmperror; + + /* I2C Bus error interrupt occurred ------------------------------------*/ + if ((I2C_CHECK_FLAG(itflags, I2C_FLAG_BERR) != RESET) && \ + (I2C_CHECK_IT_SOURCE(itsources, I2C_IT_ERRI) != RESET)) + { + hi2c->ErrorCode |= HAL_I2C_ERROR_BERR; + + /* Clear BERR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_BERR); + } + + /* I2C Over-Run/Under-Run interrupt occurred ----------------------------------------*/ + if ((I2C_CHECK_FLAG(itflags, I2C_FLAG_OVR) != RESET) && \ + (I2C_CHECK_IT_SOURCE(itsources, I2C_IT_ERRI) != RESET)) + { + hi2c->ErrorCode |= HAL_I2C_ERROR_OVR; + + /* Clear OVR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_OVR); + } + + /* I2C Arbitration Loss error interrupt occurred -------------------------------------*/ + if ((I2C_CHECK_FLAG(itflags, I2C_FLAG_ARLO) != RESET) && \ + (I2C_CHECK_IT_SOURCE(itsources, I2C_IT_ERRI) != RESET)) + { + hi2c->ErrorCode |= HAL_I2C_ERROR_ARLO; + + /* Clear ARLO flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ARLO); + } + + /* Store current volatile hi2c->ErrorCode, misra rule */ + tmperror = hi2c->ErrorCode; + + /* Call the Error Callback in case of Error detected */ + if ((tmperror & (HAL_I2C_ERROR_BERR | HAL_I2C_ERROR_OVR | HAL_I2C_ERROR_ARLO)) != HAL_I2C_ERROR_NONE) + { + I2C_ITError(hi2c, tmperror); + } +} + +/** + * @brief Master Tx Transfer completed callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_MasterTxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Master Rx Transfer completed callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_MasterRxCpltCallback could be implemented in the user file + */ +} + +/** @brief Slave Tx Transfer completed callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_SlaveTxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Slave Rx Transfer completed callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_SlaveRxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Slave Address Match callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param TransferDirection Master request Transfer Direction (Write/Read), value of @ref I2C_XFERDIRECTION + * @param AddrMatchCode Address Match Code + * @retval None + */ +__weak void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + UNUSED(TransferDirection); + UNUSED(AddrMatchCode); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_AddrCallback() could be implemented in the user file + */ +} + +/** + * @brief Listen Complete callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_ListenCpltCallback() could be implemented in the user file + */ +} + +/** + * @brief Memory Tx Transfer completed callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_MemTxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Memory Rx Transfer completed callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_MemRxCpltCallback could be implemented in the user file + */ +} + +/** + * @brief I2C error callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_ErrorCallback could be implemented in the user file + */ +} + +/** + * @brief I2C abort callback. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval None + */ +__weak void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(hi2c); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_I2C_AbortCpltCallback could be implemented in the user file + */ +} + +/** + * @} + */ + +/** @defgroup I2C_Exported_Functions_Group3 Peripheral State, Mode and Error functions + * @brief Peripheral State, Mode and Error functions + * +@verbatim + =============================================================================== + ##### Peripheral State, Mode and Error functions ##### + =============================================================================== + [..] + This subsection permit to get in run-time the status of the peripheral + and the data flow. + +@endverbatim + * @{ + */ + +/** + * @brief Return the I2C handle state. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval HAL state + */ +HAL_I2C_StateTypeDef HAL_I2C_GetState(const I2C_HandleTypeDef *hi2c) +{ + /* Return I2C handle state */ + return hi2c->State; +} + +/** + * @brief Returns the I2C Master, Slave, Memory or no mode. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for I2C module + * @retval HAL mode + */ +HAL_I2C_ModeTypeDef HAL_I2C_GetMode(const I2C_HandleTypeDef *hi2c) +{ + return hi2c->Mode; +} + +/** + * @brief Return the I2C error code. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @retval I2C Error Code + */ +uint32_t HAL_I2C_GetError(const I2C_HandleTypeDef *hi2c) +{ + return hi2c->ErrorCode; +} + +/** + * @} + */ + +/** + * @} + */ + +/** @addtogroup I2C_Private_Functions + * @{ + */ + +/** + * @brief Interrupt Sub-Routine which handle the Interrupt Flags Master Mode with Interrupt. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param ITFlags Interrupt flags to handle. + * @param ITSources Interrupt sources enabled. + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_Master_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources) +{ + uint16_t devaddress; + uint32_t tmpITFlags = ITFlags; + + /* Process Locked */ + __HAL_LOCK(hi2c); + + if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET)) + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Set corresponding Error Code */ + /* No need to generate STOP, it is automatically done */ + /* Error callback will be send during stop flag treatment */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_RXNE) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_RXI) != RESET)) + { + /* Remove RXNE flag on temporary variable as read done */ + tmpITFlags &= ~I2C_FLAG_RXNE; + + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferSize--; + hi2c->XferCount--; + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TXIS) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TXI) != RESET)) + { + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferSize--; + hi2c->XferCount--; + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TCR) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET)) + { + if ((hi2c->XferCount != 0U) && (hi2c->XferSize == 0U)) + { + devaddress = (uint16_t)(hi2c->Instance->CR2 & I2C_CR2_SADD); + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, devaddress, (uint8_t)hi2c->XferSize, I2C_RELOAD_MODE, I2C_NO_STARTSTOP); + } + else + { + hi2c->XferSize = hi2c->XferCount; + if (hi2c->XferOptions != I2C_NO_OPTION_FRAME) + { + I2C_TransferConfig(hi2c, devaddress, (uint8_t)hi2c->XferSize, + hi2c->XferOptions, I2C_NO_STARTSTOP); + } + else + { + I2C_TransferConfig(hi2c, devaddress, (uint8_t)hi2c->XferSize, + I2C_AUTOEND_MODE, I2C_NO_STARTSTOP); + } + } + } + else + { + /* Call TxCpltCallback() if no stop mode is set */ + if (I2C_GET_STOP_MODE(hi2c) != I2C_AUTOEND_MODE) + { + /* Call I2C Master Sequential complete process */ + I2C_ITMasterSeqCplt(hi2c); + } + else + { + /* Wrong size Status regarding TCR flag event */ + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_SIZE); + } + } + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TC) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET)) + { + if (hi2c->XferCount == 0U) + { + if (I2C_GET_STOP_MODE(hi2c) != I2C_AUTOEND_MODE) + { + /* Generate a stop condition in case of no transfer option */ + if (hi2c->XferOptions == I2C_NO_OPTION_FRAME) + { + /* Generate Stop */ + hi2c->Instance->CR2 |= I2C_CR2_STOP; + } + else + { + /* Call I2C Master Sequential complete process */ + I2C_ITMasterSeqCplt(hi2c); + } + } + } + else + { + /* Wrong size Status regarding TC flag event */ + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_SIZE); + } + } + else + { + /* Nothing to do */ + } + + if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_STOPF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) + { + /* Call I2C Master complete process */ + I2C_ITMasterCplt(hi2c, tmpITFlags); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; +} + +/** + * @brief Interrupt Sub-Routine which handle the Interrupt Flags Memory Mode with Interrupt. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param ITFlags Interrupt flags to handle. + * @param ITSources Interrupt sources enabled. + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_Mem_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources) +{ + uint32_t direction = I2C_GENERATE_START_WRITE; + uint32_t tmpITFlags = ITFlags; + + /* Process Locked */ + __HAL_LOCK(hi2c); + + if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET)) + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Set corresponding Error Code */ + /* No need to generate STOP, it is automatically done */ + /* Error callback will be send during stop flag treatment */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_RXNE) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_RXI) != RESET)) + { + /* Remove RXNE flag on temporary variable as read done */ + tmpITFlags &= ~I2C_FLAG_RXNE; + + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferSize--; + hi2c->XferCount--; + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TXIS) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TXI) != RESET)) + { + if (hi2c->Memaddress == 0xFFFFFFFFU) + { + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferSize--; + hi2c->XferCount--; + } + else + { + /* Write LSB part of Memory Address */ + hi2c->Instance->TXDR = hi2c->Memaddress; + + /* Reset Memaddress content */ + hi2c->Memaddress = 0xFFFFFFFFU; + } + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TCR) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET)) + { + if ((hi2c->XferCount != 0U) && (hi2c->XferSize == 0U)) + { + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize, + I2C_RELOAD_MODE, I2C_NO_STARTSTOP); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize, + I2C_AUTOEND_MODE, I2C_NO_STARTSTOP); + } + } + else + { + /* Wrong size Status regarding TCR flag event */ + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_SIZE); + } + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TC) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET)) + { + if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + direction = I2C_GENERATE_START_READ; + } + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */ + I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize, + I2C_RELOAD_MODE, direction); + } + else + { + hi2c->XferSize = hi2c->XferCount; + + /* Set NBYTES to write and generate RESTART */ + I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize, + I2C_AUTOEND_MODE, direction); + } + } + else + { + /* Nothing to do */ + } + + if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_STOPF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) + { + /* Call I2C Master complete process */ + I2C_ITMasterCplt(hi2c, tmpITFlags); + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; +} + +/** + * @brief Interrupt Sub-Routine which handle the Interrupt Flags Slave Mode with Interrupt. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param ITFlags Interrupt flags to handle. + * @param ITSources Interrupt sources enabled. + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_Slave_ISR_IT(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources) +{ + uint32_t tmpoptions = hi2c->XferOptions; + uint32_t tmpITFlags = ITFlags; + + /* Process locked */ + __HAL_LOCK(hi2c); + + /* Check if STOPF is set */ + if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_STOPF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) + { + /* Call I2C Slave complete process */ + I2C_ITSlaveCplt(hi2c, tmpITFlags); + } + + if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET)) + { + /* Check that I2C transfer finished */ + /* if yes, normal use case, a NACK is sent by the MASTER when Transfer is finished */ + /* Mean XferCount == 0*/ + /* So clear Flag NACKF only */ + if (hi2c->XferCount == 0U) + { + if ((hi2c->State == HAL_I2C_STATE_LISTEN) && (tmpoptions == I2C_FIRST_AND_LAST_FRAME)) + /* Same action must be done for (tmpoptions == I2C_LAST_FRAME) which removed for + Warning[Pa134]: left and right operands are identical */ + { + /* Call I2C Listen complete process */ + I2C_ITListenCplt(hi2c, tmpITFlags); + } + else if ((hi2c->State == HAL_I2C_STATE_BUSY_TX_LISTEN) && (tmpoptions != I2C_NO_OPTION_FRAME)) + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + + /* Last Byte is Transmitted */ + /* Call I2C Slave Sequential complete process */ + I2C_ITSlaveSeqCplt(hi2c); + } + else + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + } + } + else + { + /* if no, error use case, a Non-Acknowledge of last Data is generated by the MASTER*/ + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Set ErrorCode corresponding to a Non-Acknowledge */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + + if ((tmpoptions == I2C_FIRST_FRAME) || (tmpoptions == I2C_NEXT_FRAME)) + { + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, hi2c->ErrorCode); + } + } + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_RXNE) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_RXI) != RESET)) + { + if (hi2c->XferCount > 0U) + { + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferSize--; + hi2c->XferCount--; + } + + if ((hi2c->XferCount == 0U) && \ + (tmpoptions != I2C_NO_OPTION_FRAME)) + { + /* Call I2C Slave Sequential complete process */ + I2C_ITSlaveSeqCplt(hi2c); + } + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_ADDR) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_ADDRI) != RESET)) + { + I2C_ITAddrCplt(hi2c, tmpITFlags); + } + else if ((I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_TXIS) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TXI) != RESET)) + { + /* Write data to TXDR only if XferCount not reach "0" */ + /* A TXIS flag can be set, during STOP treatment */ + /* Check if all Data have already been sent */ + /* If it is the case, this last write in TXDR is not sent, correspond to a dummy TXIS event */ + if (hi2c->XferCount > 0U) + { + /* Write data to TXDR */ + hi2c->Instance->TXDR = *hi2c->pBuffPtr; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + hi2c->XferCount--; + hi2c->XferSize--; + } + else + { + if ((tmpoptions == I2C_NEXT_FRAME) || (tmpoptions == I2C_FIRST_FRAME)) + { + /* Last Byte is Transmitted */ + /* Call I2C Slave Sequential complete process */ + I2C_ITSlaveSeqCplt(hi2c); + } + } + } + else + { + /* Nothing to do */ + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; +} + +/** + * @brief Interrupt Sub-Routine which handle the Interrupt Flags Master Mode with DMA. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param ITFlags Interrupt flags to handle. + * @param ITSources Interrupt sources enabled. + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_Master_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources) +{ + uint16_t devaddress; + uint32_t xfermode; + + /* Process Locked */ + __HAL_LOCK(hi2c); + + if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_AF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET)) + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Set corresponding Error Code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + + /* No need to generate STOP, it is automatically done */ + /* But enable STOP interrupt, to treat it */ + /* Error callback will be send during stop flag treatment */ + I2C_Enable_IRQ(hi2c, I2C_XFER_CPLT_IT); + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + } + else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TCR) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET)) + { + /* Disable TC interrupt */ + __HAL_I2C_DISABLE_IT(hi2c, I2C_IT_TCI); + + if (hi2c->XferCount != 0U) + { + /* Recover Slave address */ + devaddress = (uint16_t)(hi2c->Instance->CR2 & I2C_CR2_SADD); + + /* Prepare the new XferSize to transfer */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + xfermode = I2C_RELOAD_MODE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + if (hi2c->XferOptions != I2C_NO_OPTION_FRAME) + { + xfermode = hi2c->XferOptions; + } + else + { + xfermode = I2C_AUTOEND_MODE; + } + } + + /* Set the new XferSize in Nbytes register */ + I2C_TransferConfig(hi2c, devaddress, (uint8_t)hi2c->XferSize, xfermode, I2C_NO_STARTSTOP); + + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Enable DMA Request */ + if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + hi2c->Instance->CR1 |= I2C_CR1_RXDMAEN; + } + else + { + hi2c->Instance->CR1 |= I2C_CR1_TXDMAEN; + } + } + else + { + /* Call TxCpltCallback() if no stop mode is set */ + if (I2C_GET_STOP_MODE(hi2c) != I2C_AUTOEND_MODE) + { + /* Call I2C Master Sequential complete process */ + I2C_ITMasterSeqCplt(hi2c); + } + else + { + /* Wrong size Status regarding TCR flag event */ + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_SIZE); + } + } + } + else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TC) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET)) + { + if (hi2c->XferCount == 0U) + { + if (I2C_GET_STOP_MODE(hi2c) != I2C_AUTOEND_MODE) + { + /* Generate a stop condition in case of no transfer option */ + if (hi2c->XferOptions == I2C_NO_OPTION_FRAME) + { + /* Generate Stop */ + hi2c->Instance->CR2 |= I2C_CR2_STOP; + } + else + { + /* Call I2C Master Sequential complete process */ + I2C_ITMasterSeqCplt(hi2c); + } + } + } + else + { + /* Wrong size Status regarding TC flag event */ + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_SIZE); + } + } + else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_STOPF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) + { + /* Call I2C Master complete process */ + I2C_ITMasterCplt(hi2c, ITFlags); + } + else + { + /* Nothing to do */ + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; +} + +/** + * @brief Interrupt Sub-Routine which handle the Interrupt Flags Memory Mode with DMA. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param ITFlags Interrupt flags to handle. + * @param ITSources Interrupt sources enabled. + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_Mem_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources) +{ + uint32_t direction = I2C_GENERATE_START_WRITE; + + /* Process Locked */ + __HAL_LOCK(hi2c); + + if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_AF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET)) + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Set corresponding Error Code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + + /* No need to generate STOP, it is automatically done */ + /* But enable STOP interrupt, to treat it */ + /* Error callback will be send during stop flag treatment */ + I2C_Enable_IRQ(hi2c, I2C_XFER_CPLT_IT); + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + } + else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TXIS) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TXI) != RESET)) + { + /* Write LSB part of Memory Address */ + hi2c->Instance->TXDR = hi2c->Memaddress; + + /* Reset Memaddress content */ + hi2c->Memaddress = 0xFFFFFFFFU; + } + else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TCR) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET)) + { + /* Enable only Error interrupt */ + I2C_Enable_IRQ(hi2c, I2C_XFER_ERROR_IT); + + if (hi2c->XferCount != 0U) + { + /* Prepare the new XferSize to transfer */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize, + I2C_RELOAD_MODE, I2C_NO_STARTSTOP); + } + else + { + hi2c->XferSize = hi2c->XferCount; + I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize, + I2C_AUTOEND_MODE, I2C_NO_STARTSTOP); + } + + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Enable DMA Request */ + if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + hi2c->Instance->CR1 |= I2C_CR1_RXDMAEN; + } + else + { + hi2c->Instance->CR1 |= I2C_CR1_TXDMAEN; + } + } + else + { + /* Wrong size Status regarding TCR flag event */ + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_SIZE); + } + } + else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_TC) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_TCI) != RESET)) + { + if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + direction = I2C_GENERATE_START_READ; + } + + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + + /* Set NBYTES to write and reload if hi2c->XferCount > MAX_NBYTE_SIZE and generate RESTART */ + I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize, + I2C_RELOAD_MODE, direction); + } + else + { + hi2c->XferSize = hi2c->XferCount; + + /* Set NBYTES to write and generate RESTART */ + I2C_TransferConfig(hi2c, (uint16_t)hi2c->Devaddress, (uint8_t)hi2c->XferSize, + I2C_AUTOEND_MODE, direction); + } + + /* Update XferCount value */ + hi2c->XferCount -= hi2c->XferSize; + + /* Enable DMA Request */ + if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + hi2c->Instance->CR1 |= I2C_CR1_RXDMAEN; + } + else + { + hi2c->Instance->CR1 |= I2C_CR1_TXDMAEN; + } + } + else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_STOPF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) + { + /* Call I2C Master complete process */ + I2C_ITMasterCplt(hi2c, ITFlags); + } + else + { + /* Nothing to do */ + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; +} + +/** + * @brief Interrupt Sub-Routine which handle the Interrupt Flags Slave Mode with DMA. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param ITFlags Interrupt flags to handle. + * @param ITSources Interrupt sources enabled. + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_Slave_ISR_DMA(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, + uint32_t ITSources) +{ + uint32_t tmpoptions = hi2c->XferOptions; + uint32_t treatdmanack = 0U; + HAL_I2C_StateTypeDef tmpstate; + + /* Process locked */ + __HAL_LOCK(hi2c); + + /* Check if STOPF is set */ + if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_STOPF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_STOPI) != RESET)) + { + /* Call I2C Slave complete process */ + I2C_ITSlaveCplt(hi2c, ITFlags); + } + + if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_AF) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_NACKI) != RESET)) + { + /* Check that I2C transfer finished */ + /* if yes, normal use case, a NACK is sent by the MASTER when Transfer is finished */ + /* Mean XferCount == 0 */ + /* So clear Flag NACKF only */ + if ((I2C_CHECK_IT_SOURCE(ITSources, I2C_CR1_TXDMAEN) != RESET) || + (I2C_CHECK_IT_SOURCE(ITSources, I2C_CR1_RXDMAEN) != RESET)) + { + /* Split check of hdmarx, for MISRA compliance */ + if (hi2c->hdmarx != NULL) + { + if (I2C_CHECK_IT_SOURCE(ITSources, I2C_CR1_RXDMAEN) != RESET) + { + if (I2C_GET_DMA_REMAIN_DATA(hi2c->hdmarx) == 0U) + { + treatdmanack = 1U; + } + } + } + + /* Split check of hdmatx, for MISRA compliance */ + if (hi2c->hdmatx != NULL) + { + if (I2C_CHECK_IT_SOURCE(ITSources, I2C_CR1_TXDMAEN) != RESET) + { + if (I2C_GET_DMA_REMAIN_DATA(hi2c->hdmatx) == 0U) + { + treatdmanack = 1U; + } + } + } + + if (treatdmanack == 1U) + { + if ((hi2c->State == HAL_I2C_STATE_LISTEN) && (tmpoptions == I2C_FIRST_AND_LAST_FRAME)) + /* Same action must be done for (tmpoptions == I2C_LAST_FRAME) which removed for + Warning[Pa134]: left and right operands are identical */ + { + /* Call I2C Listen complete process */ + I2C_ITListenCplt(hi2c, ITFlags); + } + else if ((hi2c->State == HAL_I2C_STATE_BUSY_TX_LISTEN) && (tmpoptions != I2C_NO_OPTION_FRAME)) + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + + /* Last Byte is Transmitted */ + /* Call I2C Slave Sequential complete process */ + I2C_ITSlaveSeqCplt(hi2c); + } + else + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + } + } + else + { + /* if no, error use case, a Non-Acknowledge of last Data is generated by the MASTER*/ + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Set ErrorCode corresponding to a Non-Acknowledge */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + + /* Store current hi2c->State, solve MISRA2012-Rule-13.5 */ + tmpstate = hi2c->State; + + if ((tmpoptions == I2C_FIRST_FRAME) || (tmpoptions == I2C_NEXT_FRAME)) + { + if ((tmpstate == HAL_I2C_STATE_BUSY_TX) || (tmpstate == HAL_I2C_STATE_BUSY_TX_LISTEN)) + { + hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_TX; + } + else if ((tmpstate == HAL_I2C_STATE_BUSY_RX) || (tmpstate == HAL_I2C_STATE_BUSY_RX_LISTEN)) + { + hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_RX; + } + else + { + /* Do nothing */ + } + + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, hi2c->ErrorCode); + } + } + } + else + { + /* Only Clear NACK Flag, no DMA treatment is pending */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + } + } + else if ((I2C_CHECK_FLAG(ITFlags, I2C_FLAG_ADDR) != RESET) && \ + (I2C_CHECK_IT_SOURCE(ITSources, I2C_IT_ADDRI) != RESET)) + { + I2C_ITAddrCplt(hi2c, ITFlags); + } + else + { + /* Nothing to do */ + } + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; +} + +/** + * @brief Master sends target device address followed by internal memory address for write request. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param MemAddress Internal memory address + * @param MemAddSize Size of internal memory address + * @param Timeout Timeout duration + * @param Tickstart Tick start value + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_RequestMemoryWrite(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, + uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout, + uint32_t Tickstart) +{ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)MemAddSize, I2C_RELOAD_MODE, I2C_GENERATE_START_WRITE); + + /* Wait until TXIS flag is set */ + if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* If Memory address size is 8Bit */ + if (MemAddSize == I2C_MEMADD_SIZE_8BIT) + { + /* Send Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_LSB(MemAddress); + } + /* If Memory address size is 16Bit */ + else + { + /* Send MSB of Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_MSB(MemAddress); + + /* Wait until TXIS flag is set */ + if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Send LSB of Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_LSB(MemAddress); + } + + /* Wait until TCR flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TCR, RESET, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + return HAL_OK; +} + +/** + * @brief Master sends target device address followed by internal memory address for read request. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param DevAddress Target device address: The device 7 bits address value + * in datasheet must be shifted to the left before calling the interface + * @param MemAddress Internal memory address + * @param MemAddSize Size of internal memory address + * @param Timeout Timeout duration + * @param Tickstart Tick start value + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_RequestMemoryRead(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, + uint16_t MemAddress, uint16_t MemAddSize, uint32_t Timeout, + uint32_t Tickstart) +{ + I2C_TransferConfig(hi2c, DevAddress, (uint8_t)MemAddSize, I2C_SOFTEND_MODE, I2C_GENERATE_START_WRITE); + + /* Wait until TXIS flag is set */ + if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* If Memory address size is 8Bit */ + if (MemAddSize == I2C_MEMADD_SIZE_8BIT) + { + /* Send Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_LSB(MemAddress); + } + /* If Memory address size is 16Bit */ + else + { + /* Send MSB of Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_MSB(MemAddress); + + /* Wait until TXIS flag is set */ + if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Send LSB of Memory Address */ + hi2c->Instance->TXDR = I2C_MEM_ADD_LSB(MemAddress); + } + + /* Wait until TC flag is set */ + if (I2C_WaitOnFlagUntilTimeout(hi2c, I2C_FLAG_TC, RESET, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + return HAL_OK; +} + +/** + * @brief I2C Address complete process callback. + * @param hi2c I2C handle. + * @param ITFlags Interrupt flags to handle. + * @retval None + */ +static void I2C_ITAddrCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) +{ + uint8_t transferdirection; + uint16_t slaveaddrcode; + uint16_t ownadd1code; + uint16_t ownadd2code; + + /* Prevent unused argument(s) compilation warning */ + UNUSED(ITFlags); + + /* In case of Listen state, need to inform upper layer of address match code event */ + if (((uint32_t)hi2c->State & (uint32_t)HAL_I2C_STATE_LISTEN) == (uint32_t)HAL_I2C_STATE_LISTEN) + { + transferdirection = I2C_GET_DIR(hi2c); + slaveaddrcode = I2C_GET_ADDR_MATCH(hi2c); + ownadd1code = I2C_GET_OWN_ADDRESS1(hi2c); + ownadd2code = I2C_GET_OWN_ADDRESS2(hi2c); + + /* If 10bits addressing mode is selected */ + if (hi2c->Init.AddressingMode == I2C_ADDRESSINGMODE_10BIT) + { + if ((slaveaddrcode & SLAVE_ADDR_MSK) == ((ownadd1code >> SLAVE_ADDR_SHIFT) & SLAVE_ADDR_MSK)) + { + slaveaddrcode = ownadd1code; + hi2c->AddrEventCount++; + if (hi2c->AddrEventCount == 2U) + { + /* Reset Address Event counter */ + hi2c->AddrEventCount = 0U; + + /* Clear ADDR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call Slave Addr callback */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->AddrCallback(hi2c, transferdirection, slaveaddrcode); +#else + HAL_I2C_AddrCallback(hi2c, transferdirection, slaveaddrcode); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + } + else + { + slaveaddrcode = ownadd2code; + + /* Disable ADDR Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call Slave Addr callback */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->AddrCallback(hi2c, transferdirection, slaveaddrcode); +#else + HAL_I2C_AddrCallback(hi2c, transferdirection, slaveaddrcode); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + } + /* else 7 bits addressing mode is selected */ + else + { + /* Disable ADDR Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call Slave Addr callback */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->AddrCallback(hi2c, transferdirection, slaveaddrcode); +#else + HAL_I2C_AddrCallback(hi2c, transferdirection, slaveaddrcode); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + } + /* Else clear address flag only */ + else + { + /* Clear ADDR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ADDR); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + } +} + +/** + * @brief I2C Master sequential complete process. + * @param hi2c I2C handle. + * @retval None + */ +static void I2C_ITMasterSeqCplt(I2C_HandleTypeDef *hi2c) +{ + /* Reset I2C handle mode */ + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* No Generate Stop, to permit restart mode */ + /* The stop will be done at the end of transfer, when I2C_AUTOEND_MODE enable */ + if (hi2c->State == HAL_I2C_STATE_BUSY_TX) + { + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_MASTER_BUSY_TX; + hi2c->XferISR = NULL; + + /* Disable Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->MasterTxCpltCallback(hi2c); +#else + HAL_I2C_MasterTxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + /* hi2c->State == HAL_I2C_STATE_BUSY_RX */ + else + { + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX; + hi2c->XferISR = NULL; + + /* Disable Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->MasterRxCpltCallback(hi2c); +#else + HAL_I2C_MasterRxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } +} + +/** + * @brief I2C Slave sequential complete process. + * @param hi2c I2C handle. + * @retval None + */ +static void I2C_ITSlaveSeqCplt(I2C_HandleTypeDef *hi2c) +{ + uint32_t tmpcr1value = READ_REG(hi2c->Instance->CR1); + + /* Reset I2C handle mode */ + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* If a DMA is ongoing, Update handle size context */ + if (I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_CR1_TXDMAEN) != RESET) + { + /* Disable DMA Request */ + hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; + } + else if (I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_CR1_RXDMAEN) != RESET) + { + /* Disable DMA Request */ + hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; + } + else + { + /* Do nothing */ + } + + if (hi2c->State == HAL_I2C_STATE_BUSY_TX_LISTEN) + { + /* Remove HAL_I2C_STATE_SLAVE_BUSY_TX, keep only HAL_I2C_STATE_LISTEN */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_TX; + + /* Disable Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->SlaveTxCpltCallback(hi2c); +#else + HAL_I2C_SlaveTxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + + else if (hi2c->State == HAL_I2C_STATE_BUSY_RX_LISTEN) + { + /* Remove HAL_I2C_STATE_SLAVE_BUSY_RX, keep only HAL_I2C_STATE_LISTEN */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_RX; + + /* Disable Interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->SlaveRxCpltCallback(hi2c); +#else + HAL_I2C_SlaveRxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + else + { + /* Nothing to do */ + } +} + +/** + * @brief I2C Master complete process. + * @param hi2c I2C handle. + * @param ITFlags Interrupt flags to handle. + * @retval None + */ +static void I2C_ITMasterCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) +{ + uint32_t tmperror; + uint32_t tmpITFlags = ITFlags; + __IO uint32_t tmpreg; + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Disable Interrupts and Store Previous state */ + if (hi2c->State == HAL_I2C_STATE_BUSY_TX) + { + I2C_Disable_IRQ(hi2c, I2C_XFER_TX_IT); + hi2c->PreviousState = I2C_STATE_MASTER_BUSY_TX; + } + else if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT); + hi2c->PreviousState = I2C_STATE_MASTER_BUSY_RX; + } + else + { + /* Do nothing */ + } + + /* Clear Configuration Register 2 */ + I2C_RESET_CR2(hi2c); + + /* Reset handle parameters */ + hi2c->XferISR = NULL; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + + if (I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_AF) != RESET) + { + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Set acknowledge error code */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + } + + /* Fetch Last receive data if any */ + if ((hi2c->State == HAL_I2C_STATE_ABORT) && (I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_RXNE) != RESET)) + { + /* Read data from RXDR */ + tmpreg = (uint8_t)hi2c->Instance->RXDR; + UNUSED(tmpreg); + } + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + + /* Store current volatile hi2c->ErrorCode, misra rule */ + tmperror = hi2c->ErrorCode; + + /* Call the corresponding callback to inform upper layer of End of Transfer */ + if ((hi2c->State == HAL_I2C_STATE_ABORT) || (tmperror != HAL_I2C_ERROR_NONE)) + { + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, hi2c->ErrorCode); + } + /* hi2c->State == HAL_I2C_STATE_BUSY_TX */ + else if (hi2c->State == HAL_I2C_STATE_BUSY_TX) + { + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_NONE; + + if (hi2c->Mode == HAL_I2C_MODE_MEM) + { + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->MemTxCpltCallback(hi2c); +#else + HAL_I2C_MemTxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + else + { + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->MasterTxCpltCallback(hi2c); +#else + HAL_I2C_MasterTxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + } + /* hi2c->State == HAL_I2C_STATE_BUSY_RX */ + else if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_NONE; + + if (hi2c->Mode == HAL_I2C_MODE_MEM) + { + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->MemRxCpltCallback(hi2c); +#else + HAL_I2C_MemRxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + else + { + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->MasterRxCpltCallback(hi2c); +#else + HAL_I2C_MasterRxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + } + else + { + /* Nothing to do */ + } +} + +/** + * @brief I2C Slave complete process. + * @param hi2c I2C handle. + * @param ITFlags Interrupt flags to handle. + * @retval None + */ +static void I2C_ITSlaveCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) +{ + uint32_t tmpcr1value = READ_REG(hi2c->Instance->CR1); + uint32_t tmpITFlags = ITFlags; + HAL_I2C_StateTypeDef tmpstate = hi2c->State; + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Disable Interrupts and Store Previous state */ + if ((tmpstate == HAL_I2C_STATE_BUSY_TX) || (tmpstate == HAL_I2C_STATE_BUSY_TX_LISTEN)) + { + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_TX_IT); + hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_TX; + } + else if ((tmpstate == HAL_I2C_STATE_BUSY_RX) || (tmpstate == HAL_I2C_STATE_BUSY_RX_LISTEN)) + { + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_RX_IT); + hi2c->PreviousState = I2C_STATE_SLAVE_BUSY_RX; + } + else + { + /* Do nothing */ + } + + /* Disable Address Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + + /* Clear Configuration Register 2 */ + I2C_RESET_CR2(hi2c); + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + + /* If a DMA is ongoing, Update handle size context */ + if (I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_CR1_TXDMAEN) != RESET) + { + /* Disable DMA Request */ + hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; + + if (hi2c->hdmatx != NULL) + { + hi2c->XferCount = (uint16_t)I2C_GET_DMA_REMAIN_DATA(hi2c->hdmatx); + } + } + else if (I2C_CHECK_IT_SOURCE(tmpcr1value, I2C_CR1_RXDMAEN) != RESET) + { + /* Disable DMA Request */ + hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; + + if (hi2c->hdmarx != NULL) + { + hi2c->XferCount = (uint16_t)I2C_GET_DMA_REMAIN_DATA(hi2c->hdmarx); + } + } + else + { + /* Do nothing */ + } + + /* Store Last receive data if any */ + if (I2C_CHECK_FLAG(tmpITFlags, I2C_FLAG_RXNE) != RESET) + { + /* Remove RXNE flag on temporary variable as read done */ + tmpITFlags &= ~I2C_FLAG_RXNE; + + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + if ((hi2c->XferSize > 0U)) + { + hi2c->XferSize--; + hi2c->XferCount--; + } + } + + /* All data are not transferred, so set error code accordingly */ + if (hi2c->XferCount != 0U) + { + /* Set ErrorCode corresponding to a Non-Acknowledge */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + } + + hi2c->Mode = HAL_I2C_MODE_NONE; + hi2c->XferISR = NULL; + + if (hi2c->ErrorCode != HAL_I2C_ERROR_NONE) + { + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, hi2c->ErrorCode); + + /* Call the Listen Complete callback, to inform upper layer of the end of Listen usecase */ + if (hi2c->State == HAL_I2C_STATE_LISTEN) + { + /* Call I2C Listen complete process */ + I2C_ITListenCplt(hi2c, tmpITFlags); + } + } + else if (hi2c->XferOptions != I2C_NO_OPTION_FRAME) + { + /* Call the Sequential Complete callback, to inform upper layer of the end of Transfer */ + I2C_ITSlaveSeqCplt(hi2c); + + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the Listen Complete callback, to inform upper layer of the end of Listen usecase */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->ListenCpltCallback(hi2c); +#else + HAL_I2C_ListenCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + /* Call the corresponding callback to inform upper layer of End of Transfer */ + else if (hi2c->State == HAL_I2C_STATE_BUSY_RX) + { + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->SlaveRxCpltCallback(hi2c); +#else + HAL_I2C_SlaveRxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + else + { + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->SlaveTxCpltCallback(hi2c); +#else + HAL_I2C_SlaveTxCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } +} + +/** + * @brief I2C Listen complete process. + * @param hi2c I2C handle. + * @param ITFlags Interrupt flags to handle. + * @retval None + */ +static void I2C_ITListenCplt(I2C_HandleTypeDef *hi2c, uint32_t ITFlags) +{ + /* Reset handle parameters */ + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->PreviousState = I2C_STATE_NONE; + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + hi2c->XferISR = NULL; + + /* Store Last receive data if any */ + if (I2C_CHECK_FLAG(ITFlags, I2C_FLAG_RXNE) != RESET) + { + /* Read data from RXDR */ + *hi2c->pBuffPtr = (uint8_t)hi2c->Instance->RXDR; + + /* Increment Buffer pointer */ + hi2c->pBuffPtr++; + + if ((hi2c->XferSize > 0U)) + { + hi2c->XferSize--; + hi2c->XferCount--; + + /* Set ErrorCode corresponding to a Non-Acknowledge */ + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + } + } + + /* Disable all Interrupts*/ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_RX_IT | I2C_XFER_TX_IT); + + /* Clear NACK Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the Listen Complete callback, to inform upper layer of the end of Listen usecase */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->ListenCpltCallback(hi2c); +#else + HAL_I2C_ListenCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ +} + +/** + * @brief I2C interrupts error process. + * @param hi2c I2C handle. + * @param ErrorCode Error code to handle. + * @retval None + */ +static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode) +{ + HAL_I2C_StateTypeDef tmpstate = hi2c->State; + + uint32_t tmppreviousstate; + + /* Reset handle parameters */ + hi2c->Mode = HAL_I2C_MODE_NONE; + hi2c->XferOptions = I2C_NO_OPTION_FRAME; + hi2c->XferCount = 0U; + + /* Set new error code */ + hi2c->ErrorCode |= ErrorCode; + + /* Disable Interrupts */ + if ((tmpstate == HAL_I2C_STATE_LISTEN) || + (tmpstate == HAL_I2C_STATE_BUSY_TX_LISTEN) || + (tmpstate == HAL_I2C_STATE_BUSY_RX_LISTEN)) + { + /* Disable all interrupts, except interrupts related to LISTEN state */ + I2C_Disable_IRQ(hi2c, I2C_XFER_RX_IT | I2C_XFER_TX_IT); + + /* keep HAL_I2C_STATE_LISTEN if set */ + hi2c->State = HAL_I2C_STATE_LISTEN; + hi2c->XferISR = I2C_Slave_ISR_IT; + } + else + { + /* Disable all interrupts */ + I2C_Disable_IRQ(hi2c, I2C_XFER_LISTEN_IT | I2C_XFER_RX_IT | I2C_XFER_TX_IT); + + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + + /* If state is an abort treatment on going, don't change state */ + /* This change will be do later */ + if (hi2c->State != HAL_I2C_STATE_ABORT) + { + /* Set HAL_I2C_STATE_READY */ + hi2c->State = HAL_I2C_STATE_READY; + + /* Check if a STOPF is detected */ + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == SET) + { + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_AF) == SET) + { + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + hi2c->ErrorCode |= HAL_I2C_ERROR_AF; + } + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + } + + } + hi2c->XferISR = NULL; + } + + /* Abort DMA TX transfer if any */ + tmppreviousstate = hi2c->PreviousState; + + if ((hi2c->hdmatx != NULL) && ((tmppreviousstate == I2C_STATE_MASTER_BUSY_TX) || \ + (tmppreviousstate == I2C_STATE_SLAVE_BUSY_TX))) + { + if ((hi2c->Instance->CR1 & I2C_CR1_TXDMAEN) == I2C_CR1_TXDMAEN) + { + hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; + } + + if (HAL_DMA_GetState(hi2c->hdmatx) != HAL_DMA_STATE_READY) + { + /* Set the I2C DMA Abort callback : + will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ + hi2c->hdmatx->XferAbortCallback = I2C_DMAAbort; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Abort DMA TX */ + if (HAL_DMA_Abort_IT(hi2c->hdmatx) != HAL_OK) + { + /* Call Directly XferAbortCallback function in case of error */ + hi2c->hdmatx->XferAbortCallback(hi2c->hdmatx); + } + } + else + { + I2C_TreatErrorCallback(hi2c); + } + } + /* Abort DMA RX transfer if any */ + else if ((hi2c->hdmarx != NULL) && ((tmppreviousstate == I2C_STATE_MASTER_BUSY_RX) || \ + (tmppreviousstate == I2C_STATE_SLAVE_BUSY_RX))) + { + if ((hi2c->Instance->CR1 & I2C_CR1_RXDMAEN) == I2C_CR1_RXDMAEN) + { + hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; + } + + if (HAL_DMA_GetState(hi2c->hdmarx) != HAL_DMA_STATE_READY) + { + /* Set the I2C DMA Abort callback : + will lead to call HAL_I2C_ErrorCallback() at end of DMA abort procedure */ + hi2c->hdmarx->XferAbortCallback = I2C_DMAAbort; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Abort DMA RX */ + if (HAL_DMA_Abort_IT(hi2c->hdmarx) != HAL_OK) + { + /* Call Directly hi2c->hdmarx->XferAbortCallback function in case of error */ + hi2c->hdmarx->XferAbortCallback(hi2c->hdmarx); + } + } + else + { + I2C_TreatErrorCallback(hi2c); + } + } + else + { + I2C_TreatErrorCallback(hi2c); + } +} + +/** + * @brief I2C Error callback treatment. + * @param hi2c I2C handle. + * @retval None + */ +static void I2C_TreatErrorCallback(I2C_HandleTypeDef *hi2c) +{ + if (hi2c->State == HAL_I2C_STATE_ABORT) + { + hi2c->State = HAL_I2C_STATE_READY; + hi2c->PreviousState = I2C_STATE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->AbortCpltCallback(hi2c); +#else + HAL_I2C_AbortCpltCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } + else + { + hi2c->PreviousState = I2C_STATE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + /* Call the corresponding callback to inform upper layer of End of Transfer */ +#if (USE_HAL_I2C_REGISTER_CALLBACKS == 1) + hi2c->ErrorCallback(hi2c); +#else + HAL_I2C_ErrorCallback(hi2c); +#endif /* USE_HAL_I2C_REGISTER_CALLBACKS */ + } +} + +/** + * @brief I2C Tx data register flush process. + * @param hi2c I2C handle. + * @retval None + */ +static void I2C_Flush_TXDR(I2C_HandleTypeDef *hi2c) +{ + /* If a pending TXIS flag is set */ + /* Write a dummy data in TXDR to clear it */ + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_TXIS) != RESET) + { + hi2c->Instance->TXDR = 0x00U; + } + + /* Flush TX register if not empty */ + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_TXE) == RESET) + { + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_TXE); + } +} + +/** + * @brief DMA I2C master transmit process complete callback. + * @param hdma DMA handle + * @retval None + */ +static void I2C_DMAMasterTransmitCplt(DMA_HandleTypeDef *hdma) +{ + /* Derogation MISRAC2012-Rule-11.5 */ + I2C_HandleTypeDef *hi2c = (I2C_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent); + + /* Disable DMA Request */ + hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; + + /* If last transfer, enable STOP interrupt */ + if (hi2c->XferCount == 0U) + { + /* Enable STOP interrupt */ + I2C_Enable_IRQ(hi2c, I2C_XFER_CPLT_IT); + } + /* else prepare a new DMA transfer and enable TCReload interrupt */ + else + { + /* Update Buffer pointer */ + hi2c->pBuffPtr += hi2c->XferSize; + + /* Set the XferSize to transfer */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + } + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(hi2c->hdmatx, (uint32_t)hi2c->pBuffPtr, (uint32_t)&hi2c->Instance->TXDR, + hi2c->XferSize) != HAL_OK) + { + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_DMA); + } + else + { + /* Enable TC interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_RELOAD_IT); + } + } +} + + +/** + * @brief DMA I2C slave transmit process complete callback. + * @param hdma DMA handle + * @retval None + */ +static void I2C_DMASlaveTransmitCplt(DMA_HandleTypeDef *hdma) +{ + /* Derogation MISRAC2012-Rule-11.5 */ + I2C_HandleTypeDef *hi2c = (I2C_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent); + uint32_t tmpoptions = hi2c->XferOptions; + + if ((tmpoptions == I2C_NEXT_FRAME) || (tmpoptions == I2C_FIRST_FRAME)) + { + /* Disable DMA Request */ + hi2c->Instance->CR1 &= ~I2C_CR1_TXDMAEN; + + /* Last Byte is Transmitted */ + /* Call I2C Slave Sequential complete process */ + I2C_ITSlaveSeqCplt(hi2c); + } + else + { + /* No specific action, Master fully manage the generation of STOP condition */ + /* Mean that this generation can arrive at any time, at the end or during DMA process */ + /* So STOP condition should be manage through Interrupt treatment */ + } +} + + +/** + * @brief DMA I2C master receive process complete callback. + * @param hdma DMA handle + * @retval None + */ +static void I2C_DMAMasterReceiveCplt(DMA_HandleTypeDef *hdma) +{ + /* Derogation MISRAC2012-Rule-11.5 */ + I2C_HandleTypeDef *hi2c = (I2C_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent); + + /* Disable DMA Request */ + hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; + + /* If last transfer, enable STOP interrupt */ + if (hi2c->XferCount == 0U) + { + /* Enable STOP interrupt */ + I2C_Enable_IRQ(hi2c, I2C_XFER_CPLT_IT); + } + /* else prepare a new DMA transfer and enable TCReload interrupt */ + else + { + /* Update Buffer pointer */ + hi2c->pBuffPtr += hi2c->XferSize; + + /* Set the XferSize to transfer */ + if (hi2c->XferCount > MAX_NBYTE_SIZE) + { + hi2c->XferSize = MAX_NBYTE_SIZE; + } + else + { + hi2c->XferSize = hi2c->XferCount; + } + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(hi2c->hdmarx, (uint32_t)&hi2c->Instance->RXDR, (uint32_t)hi2c->pBuffPtr, + hi2c->XferSize) != HAL_OK) + { + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_DMA); + } + else + { + /* Enable TC interrupts */ + I2C_Enable_IRQ(hi2c, I2C_XFER_RELOAD_IT); + } + } +} + + +/** + * @brief DMA I2C slave receive process complete callback. + * @param hdma DMA handle + * @retval None + */ +static void I2C_DMASlaveReceiveCplt(DMA_HandleTypeDef *hdma) +{ + /* Derogation MISRAC2012-Rule-11.5 */ + I2C_HandleTypeDef *hi2c = (I2C_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent); + uint32_t tmpoptions = hi2c->XferOptions; + + if ((I2C_GET_DMA_REMAIN_DATA(hi2c->hdmarx) == 0U) && \ + (tmpoptions != I2C_NO_OPTION_FRAME)) + { + /* Disable DMA Request */ + hi2c->Instance->CR1 &= ~I2C_CR1_RXDMAEN; + + /* Call I2C Slave Sequential complete process */ + I2C_ITSlaveSeqCplt(hi2c); + } + else + { + /* No specific action, Master fully manage the generation of STOP condition */ + /* Mean that this generation can arrive at any time, at the end or during DMA process */ + /* So STOP condition should be manage through Interrupt treatment */ + } +} + + +/** + * @brief DMA I2C communication error callback. + * @param hdma DMA handle + * @retval None + */ +static void I2C_DMAError(DMA_HandleTypeDef *hdma) +{ + /* Derogation MISRAC2012-Rule-11.5 */ + I2C_HandleTypeDef *hi2c = (I2C_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent); + + /* Disable Acknowledge */ + hi2c->Instance->CR2 |= I2C_CR2_NACK; + + /* Call the corresponding callback to inform upper layer of End of Transfer */ + I2C_ITError(hi2c, HAL_I2C_ERROR_DMA); +} + + +/** + * @brief DMA I2C communication abort callback + * (To be called at end of DMA Abort procedure). + * @param hdma DMA handle. + * @retval None + */ +static void I2C_DMAAbort(DMA_HandleTypeDef *hdma) +{ + /* Derogation MISRAC2012-Rule-11.5 */ + I2C_HandleTypeDef *hi2c = (I2C_HandleTypeDef *)(((DMA_HandleTypeDef *)hdma)->Parent); + + /* Reset AbortCpltCallback */ + if (hi2c->hdmatx != NULL) + { + hi2c->hdmatx->XferAbortCallback = NULL; + } + if (hi2c->hdmarx != NULL) + { + hi2c->hdmarx->XferAbortCallback = NULL; + } + + I2C_TreatErrorCallback(hi2c); +} + + +/** + * @brief This function handles I2C Communication Timeout. It waits + * until a flag is no longer in the specified status. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param Flag Specifies the I2C flag to check. + * @param Status The actual Flag status (SET or RESET). + * @param Timeout Timeout duration + * @param Tickstart Tick start value + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_WaitOnFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Flag, FlagStatus Status, + uint32_t Timeout, uint32_t Tickstart) +{ + while (__HAL_I2C_GET_FLAG(hi2c, Flag) == Status) + { + /* Check for the Timeout */ + if (Timeout != HAL_MAX_DELAY) + { + if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + { + if ((__HAL_I2C_GET_FLAG(hi2c, Flag) == Status)) + { + hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + return HAL_ERROR; + } + } + } + } + return HAL_OK; +} + +/** + * @brief This function handles I2C Communication Timeout for specific usage of TXIS flag. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param Timeout Timeout duration + * @param Tickstart Tick start value + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_WaitOnTXISFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, + uint32_t Tickstart) +{ + while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_TXIS) == RESET) + { + /* Check if an error is detected */ + if (I2C_IsErrorOccurred(hi2c, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Check for the Timeout */ + if (Timeout != HAL_MAX_DELAY) + { + if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + { + if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_TXIS) == RESET)) + { + hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + } + } + return HAL_OK; +} + +/** + * @brief This function handles I2C Communication Timeout for specific usage of STOP flag. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param Timeout Timeout duration + * @param Tickstart Tick start value + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_WaitOnSTOPFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, + uint32_t Tickstart) +{ + while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == RESET) + { + /* Check if an error is detected */ + if (I2C_IsErrorOccurred(hi2c, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Check for the Timeout */ + if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + { + if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == RESET)) + { + hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + } + return HAL_OK; +} + +/** + * @brief This function handles I2C Communication Timeout for specific usage of RXNE flag. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param Timeout Timeout duration + * @param Tickstart Tick start value + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_WaitOnRXNEFlagUntilTimeout(I2C_HandleTypeDef *hi2c, uint32_t Timeout, + uint32_t Tickstart) +{ + while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == RESET) + { + /* Check if an error is detected */ + if (I2C_IsErrorOccurred(hi2c, Timeout, Tickstart) != HAL_OK) + { + return HAL_ERROR; + } + + /* Check if a STOPF is detected */ + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == SET) + { + /* Check if an RXNE is pending */ + /* Store Last receive data if any */ + if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == SET) && (hi2c->XferSize > 0U)) + { + /* Return HAL_OK */ + /* The Reading of data from RXDR will be done in caller function */ + return HAL_OK; + } + else + { + if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_AF) == SET) + { + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + hi2c->ErrorCode = HAL_I2C_ERROR_AF; + } + else + { + hi2c->ErrorCode = HAL_I2C_ERROR_NONE; + } + + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + + /* Clear Configuration Register 2 */ + I2C_RESET_CR2(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + + /* Check for the Timeout */ + if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + { + if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_RXNE) == RESET)) + { + hi2c->ErrorCode |= HAL_I2C_ERROR_TIMEOUT; + hi2c->State = HAL_I2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_ERROR; + } + } + } + return HAL_OK; +} + +/** + * @brief This function handles errors detection during an I2C Communication. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param Timeout Timeout duration + * @param Tickstart Tick start value + * @retval HAL status + */ +static HAL_StatusTypeDef I2C_IsErrorOccurred(I2C_HandleTypeDef *hi2c, uint32_t Timeout, uint32_t Tickstart) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t itflag = hi2c->Instance->ISR; + uint32_t error_code = 0; + uint32_t tickstart = Tickstart; + uint32_t tmp1; + HAL_I2C_ModeTypeDef tmp2; + + if (HAL_IS_BIT_SET(itflag, I2C_FLAG_AF)) + { + /* Clear NACKF Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF); + + /* Wait until STOP Flag is set or timeout occurred */ + /* AutoEnd should be initiate after AF */ + while ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == RESET) && (status == HAL_OK)) + { + /* Check for the Timeout */ + if (Timeout != HAL_MAX_DELAY) + { + if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U)) + { + tmp1 = (uint32_t)(hi2c->Instance->CR2 & I2C_CR2_STOP); + tmp2 = hi2c->Mode; + + /* In case of I2C still busy, try to regenerate a STOP manually */ + if ((__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_BUSY) != RESET) && \ + (tmp1 != I2C_CR2_STOP) && \ + (tmp2 != HAL_I2C_MODE_SLAVE)) + { + /* Generate Stop */ + hi2c->Instance->CR2 |= I2C_CR2_STOP; + + /* Update Tick with new reference */ + tickstart = HAL_GetTick(); + } + + while (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_STOPF) == RESET) + { + /* Check for the Timeout */ + if ((HAL_GetTick() - tickstart) > I2C_TIMEOUT_STOPF) + { + error_code |= HAL_I2C_ERROR_TIMEOUT; + + status = HAL_ERROR; + + break; + } + } + } + } + } + + /* In case STOP Flag is detected, clear it */ + if (status == HAL_OK) + { + /* Clear STOP Flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_STOPF); + } + + error_code |= HAL_I2C_ERROR_AF; + + status = HAL_ERROR; + } + + /* Refresh Content of Status register */ + itflag = hi2c->Instance->ISR; + + /* Then verify if an additional errors occurs */ + /* Check if a Bus error occurred */ + if (HAL_IS_BIT_SET(itflag, I2C_FLAG_BERR)) + { + error_code |= HAL_I2C_ERROR_BERR; + + /* Clear BERR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_BERR); + + status = HAL_ERROR; + } + + /* Check if an Over-Run/Under-Run error occurred */ + if (HAL_IS_BIT_SET(itflag, I2C_FLAG_OVR)) + { + error_code |= HAL_I2C_ERROR_OVR; + + /* Clear OVR flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_OVR); + + status = HAL_ERROR; + } + + /* Check if an Arbitration Loss error occurred */ + if (HAL_IS_BIT_SET(itflag, I2C_FLAG_ARLO)) + { + error_code |= HAL_I2C_ERROR_ARLO; + + /* Clear ARLO flag */ + __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ARLO); + + status = HAL_ERROR; + } + + if (status != HAL_OK) + { + /* Flush TX register */ + I2C_Flush_TXDR(hi2c); + + /* Clear Configuration Register 2 */ + I2C_RESET_CR2(hi2c); + + hi2c->ErrorCode |= error_code; + hi2c->State = HAL_I2C_STATE_READY; + hi2c->Mode = HAL_I2C_MODE_NONE; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + } + + return status; +} + +/** + * @brief Handles I2Cx communication when starting transfer or during transfer (TC or TCR flag are set). + * @param hi2c I2C handle. + * @param DevAddress Specifies the slave address to be programmed. + * @param Size Specifies the number of bytes to be programmed. + * This parameter must be a value between 0 and 255. + * @param Mode New state of the I2C START condition generation. + * This parameter can be one of the following values: + * @arg @ref I2C_RELOAD_MODE Enable Reload mode . + * @arg @ref I2C_AUTOEND_MODE Enable Automatic end mode. + * @arg @ref I2C_SOFTEND_MODE Enable Software end mode. + * @param Request New state of the I2C START condition generation. + * This parameter can be one of the following values: + * @arg @ref I2C_NO_STARTSTOP Don't Generate stop and start condition. + * @arg @ref I2C_GENERATE_STOP Generate stop condition (Size should be set to 0). + * @arg @ref I2C_GENERATE_START_READ Generate Restart for read request. + * @arg @ref I2C_GENERATE_START_WRITE Generate Restart for write request. + * @retval None + */ +static void I2C_TransferConfig(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t Size, uint32_t Mode, + uint32_t Request) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_INSTANCE(hi2c->Instance)); + assert_param(IS_TRANSFER_MODE(Mode)); + assert_param(IS_TRANSFER_REQUEST(Request)); + + /* Declaration of tmp to prevent undefined behavior of volatile usage */ + uint32_t tmp = ((uint32_t)(((uint32_t)DevAddress & I2C_CR2_SADD) | \ + (((uint32_t)Size << I2C_CR2_NBYTES_Pos) & I2C_CR2_NBYTES) | \ + (uint32_t)Mode | (uint32_t)Request) & (~0x80000000U)); + + /* update CR2 register */ + MODIFY_REG(hi2c->Instance->CR2, \ + ((I2C_CR2_SADD | I2C_CR2_NBYTES | I2C_CR2_RELOAD | I2C_CR2_AUTOEND | \ + (I2C_CR2_RD_WRN & (uint32_t)(Request >> (31U - I2C_CR2_RD_WRN_Pos))) | \ + I2C_CR2_START | I2C_CR2_STOP)), tmp); +} + +/** + * @brief Manage the enabling of Interrupts. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param InterruptRequest Value of @ref I2C_Interrupt_configuration_definition. + * @retval None + */ +static void I2C_Enable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest) +{ + uint32_t tmpisr = 0U; + + if ((hi2c->XferISR != I2C_Master_ISR_DMA) && \ + (hi2c->XferISR != I2C_Slave_ISR_DMA) && \ + (hi2c->XferISR != I2C_Mem_ISR_DMA)) + { + if ((InterruptRequest & I2C_XFER_LISTEN_IT) == I2C_XFER_LISTEN_IT) + { + /* Enable ERR, STOP, NACK and ADDR interrupts */ + tmpisr |= I2C_IT_ADDRI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_ERRI; + } + + if ((InterruptRequest & I2C_XFER_TX_IT) == I2C_XFER_TX_IT) + { + /* Enable ERR, TC, STOP, NACK and RXI interrupts */ + tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_TXI; + } + + if ((InterruptRequest & I2C_XFER_RX_IT) == I2C_XFER_RX_IT) + { + /* Enable ERR, TC, STOP, NACK and TXI interrupts */ + tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_RXI; + } + + if (InterruptRequest == I2C_XFER_ERROR_IT) + { + /* Enable ERR and NACK interrupts */ + tmpisr |= I2C_IT_ERRI | I2C_IT_NACKI; + } + + if (InterruptRequest == I2C_XFER_CPLT_IT) + { + /* Enable STOP interrupts */ + tmpisr |= I2C_IT_STOPI; + } + } + + else + { + if ((InterruptRequest & I2C_XFER_LISTEN_IT) == I2C_XFER_LISTEN_IT) + { + /* Enable ERR, STOP, NACK and ADDR interrupts */ + tmpisr |= I2C_IT_ADDRI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_ERRI; + } + + if ((InterruptRequest & I2C_XFER_TX_IT) == I2C_XFER_TX_IT) + { + /* Enable ERR, TC, STOP, NACK and RXI interrupts */ + tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_TXI; + } + + if ((InterruptRequest & I2C_XFER_RX_IT) == I2C_XFER_RX_IT) + { + /* Enable ERR, TC, STOP, NACK and TXI interrupts */ + tmpisr |= I2C_IT_ERRI | I2C_IT_TCI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_RXI; + } + + if (InterruptRequest == I2C_XFER_ERROR_IT) + { + /* Enable ERR and NACK interrupts */ + tmpisr |= I2C_IT_ERRI | I2C_IT_NACKI; + } + + if (InterruptRequest == I2C_XFER_CPLT_IT) + { + /* Enable STOP interrupts */ + tmpisr |= (I2C_IT_STOPI | I2C_IT_TCI); + } + + if ((hi2c->XferISR != I2C_Mem_ISR_DMA) && (InterruptRequest == I2C_XFER_RELOAD_IT)) + { + /* Enable TC interrupts */ + tmpisr |= I2C_IT_TCI; + } + } + + /* Enable interrupts only at the end */ + /* to avoid the risk of I2C interrupt handle execution before */ + /* all interrupts requested done */ + __HAL_I2C_ENABLE_IT(hi2c, tmpisr); +} + +/** + * @brief Manage the disabling of Interrupts. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2C. + * @param InterruptRequest Value of @ref I2C_Interrupt_configuration_definition. + * @retval None + */ +static void I2C_Disable_IRQ(I2C_HandleTypeDef *hi2c, uint16_t InterruptRequest) +{ + uint32_t tmpisr = 0U; + + if ((InterruptRequest & I2C_XFER_TX_IT) == I2C_XFER_TX_IT) + { + /* Disable TC and TXI interrupts */ + tmpisr |= I2C_IT_TCI | I2C_IT_TXI; + + if (((uint32_t)hi2c->State & (uint32_t)HAL_I2C_STATE_LISTEN) != (uint32_t)HAL_I2C_STATE_LISTEN) + { + /* Disable NACK and STOP interrupts */ + tmpisr |= I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_ERRI; + } + } + + if ((InterruptRequest & I2C_XFER_RX_IT) == I2C_XFER_RX_IT) + { + /* Disable TC and RXI interrupts */ + tmpisr |= I2C_IT_TCI | I2C_IT_RXI; + + if (((uint32_t)hi2c->State & (uint32_t)HAL_I2C_STATE_LISTEN) != (uint32_t)HAL_I2C_STATE_LISTEN) + { + /* Disable NACK and STOP interrupts */ + tmpisr |= I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_ERRI; + } + } + + if ((InterruptRequest & I2C_XFER_LISTEN_IT) == I2C_XFER_LISTEN_IT) + { + /* Disable ADDR, NACK and STOP interrupts */ + tmpisr |= I2C_IT_ADDRI | I2C_IT_STOPI | I2C_IT_NACKI | I2C_IT_ERRI; + } + + if (InterruptRequest == I2C_XFER_ERROR_IT) + { + /* Enable ERR and NACK interrupts */ + tmpisr |= I2C_IT_ERRI | I2C_IT_NACKI; + } + + if (InterruptRequest == I2C_XFER_CPLT_IT) + { + /* Enable STOP interrupts */ + tmpisr |= I2C_IT_STOPI; + } + + if (InterruptRequest == I2C_XFER_RELOAD_IT) + { + /* Enable TC interrupts */ + tmpisr |= I2C_IT_TCI; + } + + /* Disable interrupts only at the end */ + /* to avoid a breaking situation like at "t" time */ + /* all disable interrupts request are not done */ + __HAL_I2C_DISABLE_IT(hi2c, tmpisr); +} + +/** + * @brief Convert I2Cx OTHER_xxx XferOptions to functional XferOptions. + * @param hi2c I2C handle. + * @retval None + */ +static void I2C_ConvertOtherXferOptions(I2C_HandleTypeDef *hi2c) +{ + /* if user set XferOptions to I2C_OTHER_FRAME */ + /* it request implicitly to generate a restart condition */ + /* set XferOptions to I2C_FIRST_FRAME */ + if (hi2c->XferOptions == I2C_OTHER_FRAME) + { + hi2c->XferOptions = I2C_FIRST_FRAME; + } + /* else if user set XferOptions to I2C_OTHER_AND_LAST_FRAME */ + /* it request implicitly to generate a restart condition */ + /* then generate a stop condition at the end of transfer */ + /* set XferOptions to I2C_FIRST_AND_LAST_FRAME */ + else if (hi2c->XferOptions == I2C_OTHER_AND_LAST_FRAME) + { + hi2c->XferOptions = I2C_FIRST_AND_LAST_FRAME; + } + else + { + /* Nothing to do */ + } +} + +/** + * @} + */ + +#endif /* HAL_I2C_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c new file mode 100644 index 0000000..3fc652b --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c @@ -0,0 +1,364 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_i2c_ex.c + * @author MCD Application Team + * @brief I2C Extended HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of I2C Extended peripheral: + * + Filter Mode Functions + * + WakeUp Mode Functions + * + FastModePlus Functions + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### I2C peripheral Extended features ##### + ============================================================================== + + [..] Comparing to other previous devices, the I2C interface for STM32F3xx + devices contains the following additional features + + (+) Possibility to disable or enable Analog Noise Filter + (+) Use of a configured Digital Noise Filter + (+) Disable or enable wakeup from Stop mode(s) + (+) Disable or enable Fast Mode Plus + + ##### How to use this driver ##### + ============================================================================== + [..] This driver provides functions to configure Noise Filter and Wake Up Feature + (#) Configure I2C Analog noise filter using the function HAL_I2CEx_ConfigAnalogFilter() + (#) Configure I2C Digital noise filter using the function HAL_I2CEx_ConfigDigitalFilter() + (#) Configure the enable or disable of I2C Wake Up Mode using the functions : + (++) HAL_I2CEx_EnableWakeUp() + (++) HAL_I2CEx_DisableWakeUp() + (#) Configure the enable or disable of fast mode plus driving capability using the functions : + (++) HAL_I2CEx_EnableFastModePlus() + (++) HAL_I2CEx_DisableFastModePlus() + @endverbatim + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup I2CEx I2CEx + * @brief I2C Extended HAL module driver + * @{ + */ + +#ifdef HAL_I2C_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +/** @defgroup I2CEx_Exported_Functions I2C Extended Exported Functions + * @{ + */ + +/** @defgroup I2CEx_Exported_Functions_Group1 Filter Mode Functions + * @brief Filter Mode Functions + * +@verbatim + =============================================================================== + ##### Filter Mode Functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Configure Noise Filters + +@endverbatim + * @{ + */ + +/** + * @brief Configure I2C Analog noise filter. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2Cx peripheral. + * @param AnalogFilter New state of the Analog filter. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2CEx_ConfigAnalogFilter(I2C_HandleTypeDef *hi2c, uint32_t AnalogFilter) +{ + /* Check the parameters */ + assert_param(IS_I2C_ALL_INSTANCE(hi2c->Instance)); + assert_param(IS_I2C_ANALOG_FILTER(AnalogFilter)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY; + + /* Disable the selected I2C peripheral */ + __HAL_I2C_DISABLE(hi2c); + + /* Reset I2Cx ANOFF bit */ + hi2c->Instance->CR1 &= ~(I2C_CR1_ANFOFF); + + /* Set analog filter bit*/ + hi2c->Instance->CR1 |= AnalogFilter; + + __HAL_I2C_ENABLE(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Configure I2C Digital noise filter. + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2Cx peripheral. + * @param DigitalFilter Coefficient of digital noise filter between Min_Data=0x00 and Max_Data=0x0F. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2CEx_ConfigDigitalFilter(I2C_HandleTypeDef *hi2c, uint32_t DigitalFilter) +{ + uint32_t tmpreg; + + /* Check the parameters */ + assert_param(IS_I2C_ALL_INSTANCE(hi2c->Instance)); + assert_param(IS_I2C_DIGITAL_FILTER(DigitalFilter)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY; + + /* Disable the selected I2C peripheral */ + __HAL_I2C_DISABLE(hi2c); + + /* Get the old register value */ + tmpreg = hi2c->Instance->CR1; + + /* Reset I2Cx DNF bits [11:8] */ + tmpreg &= ~(I2C_CR1_DNF); + + /* Set I2Cx DNF coefficient */ + tmpreg |= DigitalFilter << 8U; + + /* Store the new register value */ + hi2c->Instance->CR1 = tmpreg; + + __HAL_I2C_ENABLE(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} +/** + * @} + */ + +/** @defgroup I2CEx_Exported_Functions_Group2 WakeUp Mode Functions + * @brief WakeUp Mode Functions + * +@verbatim + =============================================================================== + ##### WakeUp Mode Functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Configure Wake Up Feature + +@endverbatim + * @{ + */ + +/** + * @brief Enable I2C wakeup from Stop mode(s). + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2Cx peripheral. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2CEx_EnableWakeUp(I2C_HandleTypeDef *hi2c) +{ + /* Check the parameters */ + assert_param(IS_I2C_WAKEUP_FROMSTOP_INSTANCE(hi2c->Instance)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY; + + /* Disable the selected I2C peripheral */ + __HAL_I2C_DISABLE(hi2c); + + /* Enable wakeup from stop mode */ + hi2c->Instance->CR1 |= I2C_CR1_WUPEN; + + __HAL_I2C_ENABLE(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Disable I2C wakeup from Stop mode(s). + * @param hi2c Pointer to a I2C_HandleTypeDef structure that contains + * the configuration information for the specified I2Cx peripheral. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_I2CEx_DisableWakeUp(I2C_HandleTypeDef *hi2c) +{ + /* Check the parameters */ + assert_param(IS_I2C_WAKEUP_FROMSTOP_INSTANCE(hi2c->Instance)); + + if (hi2c->State == HAL_I2C_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(hi2c); + + hi2c->State = HAL_I2C_STATE_BUSY; + + /* Disable the selected I2C peripheral */ + __HAL_I2C_DISABLE(hi2c); + + /* Enable wakeup from stop mode */ + hi2c->Instance->CR1 &= ~(I2C_CR1_WUPEN); + + __HAL_I2C_ENABLE(hi2c); + + hi2c->State = HAL_I2C_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(hi2c); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} +/** + * @} + */ + +/** @defgroup I2CEx_Exported_Functions_Group3 Fast Mode Plus Functions + * @brief Fast Mode Plus Functions + * +@verbatim + =============================================================================== + ##### Fast Mode Plus Functions ##### + =============================================================================== + [..] This section provides functions allowing to: + (+) Configure Fast Mode Plus + +@endverbatim + * @{ + */ + +/** + * @brief Enable the I2C fast mode plus driving capability. + * @param ConfigFastModePlus Selects the pin. + * This parameter can be one of the @ref I2CEx_FastModePlus values + * @note For I2C1, fast mode plus driving capability can be enabled on all selected + * I2C1 pins using I2C_FASTMODEPLUS_I2C1 parameter or independently + * on each one of the following pins PB6, PB7, PB8 and PB9. + * @note For remaining I2C1 pins (PA14, PA15...) fast mode plus driving capability + * can be enabled only by using I2C_FASTMODEPLUS_I2C1 parameter. + * @note For all I2C2 pins fast mode plus driving capability can be enabled + * only by using I2C_FASTMODEPLUS_I2C2 parameter. + * @note For all I2C3 pins fast mode plus driving capability can be enabled + * only by using I2C_FASTMODEPLUS_I2C3 parameter. + * @retval None + */ +void HAL_I2CEx_EnableFastModePlus(uint32_t ConfigFastModePlus) +{ + /* Check the parameter */ + assert_param(IS_I2C_FASTMODEPLUS(ConfigFastModePlus)); + + /* Enable SYSCFG clock */ + __HAL_RCC_SYSCFG_CLK_ENABLE(); + + /* Enable fast mode plus driving capability for selected pin */ + SET_BIT(SYSCFG->CFGR1, (uint32_t)ConfigFastModePlus); +} + +/** + * @brief Disable the I2C fast mode plus driving capability. + * @param ConfigFastModePlus Selects the pin. + * This parameter can be one of the @ref I2CEx_FastModePlus values + * @note For I2C1, fast mode plus driving capability can be disabled on all selected + * I2C1 pins using I2C_FASTMODEPLUS_I2C1 parameter or independently + * on each one of the following pins PB6, PB7, PB8 and PB9. + * @note For remaining I2C1 pins (PA14, PA15...) fast mode plus driving capability + * can be disabled only by using I2C_FASTMODEPLUS_I2C1 parameter. + * @note For all I2C2 pins fast mode plus driving capability can be disabled + * only by using I2C_FASTMODEPLUS_I2C2 parameter. + * @note For all I2C3 pins fast mode plus driving capability can be disabled + * only by using I2C_FASTMODEPLUS_I2C3 parameter. + * @retval None + */ +void HAL_I2CEx_DisableFastModePlus(uint32_t ConfigFastModePlus) +{ + /* Check the parameter */ + assert_param(IS_I2C_FASTMODEPLUS(ConfigFastModePlus)); + + /* Enable SYSCFG clock */ + __HAL_RCC_SYSCFG_CLK_ENABLE(); + + /* Disable fast mode plus driving capability for selected pin */ + CLEAR_BIT(SYSCFG->CFGR1, (uint32_t)ConfigFastModePlus); +} +/** + * @} + */ +/** + * @} + */ + +#endif /* HAL_I2C_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c new file mode 100644 index 0000000..77d5c2e --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c @@ -0,0 +1,457 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_pwr.c + * @author MCD Application Team + * @brief PWR HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Power Controller (PWR) peripheral: + * + Initialization/de-initialization functions + * + Peripheral Control functions + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup PWR PWR + * @brief PWR HAL module driver + * @{ + */ + +#ifdef HAL_PWR_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +/** @defgroup PWR_Exported_Functions PWR Exported Functions + * @{ + */ + +/** @defgroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and de-initialization functions + * +@verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + [..] + After reset, the backup domain (RTC registers, RTC backup data + registers and backup SRAM) is protected against possible unwanted + write accesses. + To enable access to the RTC Domain and RTC registers, proceed as follows: + (+) Enable the Power Controller (PWR) APB1 interface clock using the + __HAL_RCC_PWR_CLK_ENABLE() macro. + (+) Enable access to RTC domain using the HAL_PWR_EnableBkUpAccess() function. + +@endverbatim + * @{ + */ + +/** + * @brief Deinitializes the PWR peripheral registers to their default reset values. + * @retval None + */ +void HAL_PWR_DeInit(void) +{ + __HAL_RCC_PWR_FORCE_RESET(); + __HAL_RCC_PWR_RELEASE_RESET(); +} + +/** + * @brief Enables access to the backup domain (RTC registers, RTC + * backup data registers and backup SRAM). + * @note If the HSE divided by 32 is used as the RTC clock, the + * Backup Domain Access should be kept enabled. + * @retval None + */ +void HAL_PWR_EnableBkUpAccess(void) +{ + SET_BIT(PWR->CR, PWR_CR_DBP); +} + +/** + * @brief Disables access to the backup domain (RTC registers, RTC + * backup data registers and backup SRAM). + * @note If the HSE divided by 32 is used as the RTC clock, the + * Backup Domain Access should be kept enabled. + * @retval None + */ +void HAL_PWR_DisableBkUpAccess(void) +{ + CLEAR_BIT(PWR->CR, PWR_CR_DBP); +} + +/** + * @} + */ + +/** @defgroup PWR_Exported_Functions_Group2 Peripheral Control functions + * @brief Low Power modes configuration functions + * +@verbatim + + =============================================================================== + ##### Peripheral Control functions ##### + =============================================================================== + + *** WakeUp pin configuration *** + ================================ + [..] + (+) WakeUp pin is used to wakeup the system from Standby mode. This pin is + forced in input pull down configuration and is active on rising edges. + (+) There are up to three WakeUp pins: + (++)WakeUp Pin 1 on PA.00. + (++)WakeUp Pin 2 on PC.13 (STM32F303xC, STM32F303xE only). + (++)WakeUp Pin 3 on PE.06. + + *** Main and Backup Regulators configuration *** + ================================================ + [..] + (+) When the backup domain is supplied by VDD (analog switch connected to VDD) + the backup SRAM is powered from VDD which replaces the VBAT power supply to + save battery life. + + (+) The backup SRAM is not mass erased by a tamper event. It is read + protected to prevent confidential data, such as cryptographic private + key, from being accessed. The backup SRAM can be erased only through + the Flash interface when a protection level change from level 1 to + level 0 is requested. + -@- Refer to the description of Read protection (RDP) in the Flash + programming manual. + + Refer to the datasheets for more details. + + *** Low Power modes configuration *** + ===================================== + [..] + The devices feature 3 low-power modes: + (+) Sleep mode: Cortex-M4 core stopped, peripherals kept running. + (+) Stop mode: all clocks are stopped, regulator running, regulator + in low power mode + (+) Standby mode: 1.2V domain powered off (mode not available on STM32F3x8 devices). + + *** Sleep mode *** + ================== + [..] + (+) Entry: + The Sleep mode is entered by using the HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFx) + functions with + (++) PWR_SLEEPENTRY_WFI: enter SLEEP mode with WFI instruction + (++) PWR_SLEEPENTRY_WFE: enter SLEEP mode with WFE instruction + + (+) Exit: + (++) Any peripheral interrupt acknowledged by the nested vectored interrupt + controller (NVIC) can wake up the device from Sleep mode. + + *** Stop mode *** + ================= + [..] + In Stop mode, all clocks in the 1.8V domain are stopped, the PLL, the HSI, + and the HSE RC oscillators are disabled. Internal SRAM and register contents + are preserved. + The voltage regulator can be configured either in normal or low-power mode to minimize the consumption. + + (+) Entry: + The Stop mode is entered using the HAL_PWR_EnterSTOPMode(PWR_MAINREGULATOR_ON, PWR_STOPENTRY_WFI ) + function with: + (++) Main regulator ON or + (++) Low Power regulator ON. + (++) PWR_STOPENTRY_WFI: enter STOP mode with WFI instruction or + (++) PWR_STOPENTRY_WFE: enter STOP mode with WFE instruction + (+) Exit: + (++) Any EXTI Line (Internal or External) configured in Interrupt/Event mode. + (++) Some specific communication peripherals (CEC, USART, I2C) interrupts, + when programmed in wakeup mode (the peripheral must be + programmed in wakeup mode and the corresponding interrupt vector + must be enabled in the NVIC). + + *** Standby mode *** + ==================== + [..] + The Standby mode allows to achieve the lowest power consumption. It is based + on the Cortex-M4 deep sleep mode, with the voltage regulator disabled. + The 1.8V domain is consequently powered off. The PLL, the HSI oscillator and + the HSE oscillator are also switched off. SRAM and register contents are lost + except for the RTC registers, RTC backup registers, backup SRAM and Standby + circuitry. + The voltage regulator is OFF. + + (+) Entry: + (++) The Standby mode is entered using the HAL_PWR_EnterSTANDBYMode() function. + (+) Exit: + (++) WKUP pin rising edge, RTC alarm (Alarm A and Alarm B), RTC wakeup, + tamper event, time-stamp event, external reset in NRST pin, IWDG reset. + + *** Auto-wakeup (AWU) from low-power mode *** + ============================================= + [..] + The MCU can be woken up from low-power mode by an RTC Alarm event, an RTC + Wakeup event, a tamper event, a time-stamp event, or a comparator event, + without depending on an external interrupt (Auto-wakeup mode). + + (+) RTC auto-wakeup (AWU) from the Stop and Standby modes + + (++) To wake up from the Stop mode with an RTC alarm event, it is necessary to + configure the RTC to generate the RTC alarm using the HAL_RTC_SetAlarm_IT() function. + + (++) To wake up from the Stop mode with an RTC Tamper or time stamp event, it + is necessary to configure the RTC to detect the tamper or time stamp event using the + HAL_RTC_SetTimeStamp_IT() or HAL_RTC_SetTamper_IT() functions. + + (++) To wake up from the Stop mode with an RTC WakeUp event, it is necessary to + configure the RTC to generate the RTC WakeUp event using the HAL_RTC_SetWakeUpTimer_IT() function. + + (+) Comparator auto-wakeup (AWU) from the Stop mode + + (++) To wake up from the Stop mode with a comparator wakeup event, it is necessary to: + (+++) Configure the EXTI Line associated with the comparator (example EXTI Line 22 for comparator 2U) + to be sensitive to to the selected edges (falling, rising or falling + and rising) (Interrupt or Event modes) using the EXTI_Init() function. + (+++) Configure the comparator to generate the event. +@endverbatim + * @{ + */ + +/** + * @brief Enables the WakeUp PINx functionality. + * @param WakeUpPinx Specifies the Power Wake-Up pin to enable. + * This parameter can be value of : + * @ref PWR_WakeUp_Pins + * @retval None + */ +void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinx) +{ + /* Check the parameters */ + assert_param(IS_PWR_WAKEUP_PIN(WakeUpPinx)); + /* Enable the EWUPx pin */ + SET_BIT(PWR->CSR, WakeUpPinx); +} + +/** + * @brief Disables the WakeUp PINx functionality. + * @param WakeUpPinx Specifies the Power Wake-Up pin to disable. + * This parameter can be values of : + * @ref PWR_WakeUp_Pins + * @retval None + */ +void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx) +{ + /* Check the parameters */ + assert_param(IS_PWR_WAKEUP_PIN(WakeUpPinx)); + /* Disable the EWUPx pin */ + CLEAR_BIT(PWR->CSR, WakeUpPinx); +} + +/** + * @brief Enters Sleep mode. + * @note In Sleep mode, all I/O pins keep the same state as in Run mode. + * @param Regulator Specifies the regulator state in SLEEP mode. + * This parameter can be one of the following values: + * @arg PWR_MAINREGULATOR_ON: SLEEP mode with regulator ON + * @arg PWR_LOWPOWERREGULATOR_ON: SLEEP mode with low power regulator ON + * @note This parameter has no effect in F3 family and is just maintained to + * offer full portability of other STM32 families software. + * @param SLEEPEntry Specifies if SLEEP mode is entered with WFI or WFE instruction. + * When WFI entry is used, tick interrupt have to be disabled if not desired as + * the interrupt wake up source. + * This parameter can be one of the following values: + * @arg PWR_SLEEPENTRY_WFI: enter SLEEP mode with WFI instruction + * @arg PWR_SLEEPENTRY_WFE: enter SLEEP mode with WFE instruction + * @retval None + */ +void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry) +{ + /* Check the parameters */ + assert_param(IS_PWR_SLEEP_ENTRY(SLEEPEntry)); + + /* Clear SLEEPDEEP bit of Cortex System Control Register */ + SCB->SCR &= (uint32_t)~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); + + /* Select SLEEP mode entry -------------------------------------------------*/ + if(SLEEPEntry == PWR_SLEEPENTRY_WFI) + { + /* Request Wait For Interrupt */ + __WFI(); + } + else + { + /* Request Wait For Event */ + __SEV(); + __WFE(); + __WFE(); + } +} + +/** + * @brief Enters STOP mode. + * @note In Stop mode, all I/O pins keep the same state as in Run mode. + * @note When exiting Stop mode by issuing an interrupt or a wakeup event, + * the HSI RC oscillator is selected as system clock. + * @note When the voltage regulator operates in low power mode, an additional + * startup delay is incurred when waking up from Stop mode. + * By keeping the internal regulator ON during Stop mode, the consumption + * is higher although the startup time is reduced. + * @param Regulator Specifies the regulator state in STOP mode. + * This parameter can be one of the following values: + * @arg PWR_MAINREGULATOR_ON: STOP mode with regulator ON + * @arg PWR_LOWPOWERREGULATOR_ON: STOP mode with low power regulator ON + * @param STOPEntry specifies if STOP mode in entered with WFI or WFE instruction. + * This parameter can be one of the following values: + * @arg PWR_STOPENTRY_WFI:Enter STOP mode with WFI instruction + * @arg PWR_STOPENTRY_WFE: Enter STOP mode with WFE instruction + * @retval None + */ +void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry) +{ + uint32_t tmpreg = 0U; + + /* Check the parameters */ + assert_param(IS_PWR_REGULATOR(Regulator)); + assert_param(IS_PWR_STOP_ENTRY(STOPEntry)); + + /* Select the regulator state in STOP mode ---------------------------------*/ + tmpreg = PWR->CR; + + /* Clear PDDS and LPDS bits */ + tmpreg &= (uint32_t)~(PWR_CR_PDDS | PWR_CR_LPDS); + + /* Set LPDS bit according to Regulator value */ + tmpreg |= Regulator; + + /* Store the new value */ + PWR->CR = tmpreg; + + /* Set SLEEPDEEP bit of Cortex System Control Register */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + + /* Select STOP mode entry --------------------------------------------------*/ + if(STOPEntry == PWR_STOPENTRY_WFI) + { + /* Request Wait For Interrupt */ + __WFI(); + } + else + { + /* Request Wait For Event */ + __SEV(); + __WFE(); + __WFE(); + } + + /* Reset SLEEPDEEP bit of Cortex System Control Register */ + SCB->SCR &= (uint32_t)~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); +} + +/** + * @brief Enters STANDBY mode. + * @note In Standby mode, all I/O pins are high impedance except for: + * - Reset pad (still available), + * - RTC alternate function pins if configured for tamper, time-stamp, RTC + * Alarm out, or RTC clock calibration out, + * - WKUP pins if enabled. + * @retval None + */ +void HAL_PWR_EnterSTANDBYMode(void) +{ + /* Select STANDBY mode */ + PWR->CR |= PWR_CR_PDDS; + + /* Set SLEEPDEEP bit of Cortex System Control Register */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + + /* This option is used to ensure that store operations are completed */ +#if defined ( __CC_ARM) + __force_stores(); +#endif + /* Request Wait For Interrupt */ + __WFI(); +} + +/** + * @brief Indicates Sleep-On-Exit when returning from Handler mode to Thread mode. + * @note Set SLEEPONEXIT bit of SCR register. When this bit is set, the processor + * re-enters SLEEP mode when an interruption handling is over. + * Setting this bit is useful when the processor is expected to run only on + * interruptions handling. + * @retval None + */ +void HAL_PWR_EnableSleepOnExit(void) +{ + /* Set SLEEPONEXIT bit of Cortex System Control Register */ + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk)); +} + + +/** + * @brief Disables Sleep-On-Exit feature when returning from Handler mode to Thread mode. + * @note Clears SLEEPONEXIT bit of SCR register. When this bit is set, the processor + * re-enters SLEEP mode when an interruption handling is over. + * @retval None + */ +void HAL_PWR_DisableSleepOnExit(void) +{ + /* Clear SLEEPONEXIT bit of Cortex System Control Register */ + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPONEXIT_Msk)); +} + + + +/** + * @brief Enables CORTEX M4 SEVONPEND bit. + * @note Sets SEVONPEND bit of SCR register. When this bit is set, this causes + * WFE to wake up when an interrupt moves from inactive to pended. + * @retval None + */ +void HAL_PWR_EnableSEVOnPend(void) +{ + /* Set SEVONPEND bit of Cortex System Control Register */ + SET_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk)); +} + + +/** + * @brief Disables CORTEX M4 SEVONPEND bit. + * @note Clears SEVONPEND bit of SCR register. When this bit is set, this causes + * WFE to wake up when an interrupt moves from inactive to pended. + * @retval None + */ +void HAL_PWR_DisableSEVOnPend(void) +{ + /* Clear SEVONPEND bit of Cortex System Control Register */ + CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SEVONPEND_Msk)); +} +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_PWR_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c new file mode 100644 index 0000000..68404c5 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c @@ -0,0 +1,269 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_pwr_ex.c + * @author MCD Application Team + * @brief Extended PWR HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Power Controller (PWR) peripheral: + * + Extended Initialization and de-initialization functions + * + Extended Peripheral Control functions + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup PWREx PWREx + * @brief PWREx HAL module driver + * @{ + */ + +#ifdef HAL_PWR_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup PWREx_Private_Constants PWR Extended Private Constants + * @{ + */ +#define PVD_MODE_IT (0x00010000U) +#define PVD_MODE_EVT (0x00020000U) +#define PVD_RISING_EDGE (0x00000001U) +#define PVD_FALLING_EDGE (0x00000002U) +/** + * @} + */ + +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions ---------------------------------------------------------*/ + +/** @defgroup PWREx_Exported_Functions PWR Extended Exported Functions + * @{ + */ + +/** @defgroup PWREx_Exported_Functions_Group1 Peripheral Extended Control Functions + * @brief Extended Peripheral Control functions + * +@verbatim + + =============================================================================== + ##### Peripheral Extended control functions ##### + =============================================================================== + *** PVD configuration (present on all other devices than STM32F3x8 devices) *** + ========================= + [..] + (+) The PVD is used to monitor the VDD power supply by comparing it to a + threshold selected by the PVD Level (PLS[2:0] bits in the PWR_CR). + (+) A PVDO flag is available to indicate if VDD/VDDA is higher or lower + than the PVD threshold. This event is internally connected to the EXTI + line16 and can generate an interrupt if enabled. This is done through + __HAL_PWR_PVD_EXTI_ENABLE_IT() macro + (+) The PVD is stopped in Standby mode. + -@- PVD is not available on STM32F3x8 Product Line + + + *** Voltage regulator *** + ========================= + [..] + (+) The voltage regulator is always enabled after Reset. It works in three different + modes. + In Run mode, the regulator supplies full power to the 1.8V domain (core, memories + and digital peripherals). + In Stop mode, the regulator supplies low power to the 1.8V domain, preserving + contents of registers and SRAM. + In Stop mode, the regulator is powered off. The contents of the registers and SRAM + are lost except for the Standby circuitry and the Backup Domain. + Note: in the STM32F3x8xx devices, the voltage regulator is bypassed and the + microcontroller must be powered from a nominal VDD = 1.8V +/-8U% voltage. + + + (+) A PVDO flag is available to indicate if VDD/VDDA is higher or lower + than the PVD threshold. This event is internally connected to the EXTI + line16 and can generate an interrupt if enabled. This is done through + __HAL_PWR_PVD_EXTI_ENABLE_IT() macro + (+) The PVD is stopped in Standby mode. + + + *** SDADC power configuration *** + ================================ + [..] + (+) On STM32F373xC/STM32F378xx devices, there are up to + 3 SDADC instances that can be enabled/disabled. + +@endverbatim + * @{ + */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || \ + defined(STM32F302xC) || defined(STM32F303xC) || \ + defined(STM32F303x8) || defined(STM32F334x8) || \ + defined(STM32F301x8) || defined(STM32F302x8) || \ + defined(STM32F373xC) + +/** + * @brief Configures the voltage threshold detected by the Power Voltage Detector(PVD). + * @param sConfigPVD pointer to an PWR_PVDTypeDef structure that contains the configuration + * information for the PVD. + * @note Refer to the electrical characteristics of your device datasheet for + * more details about the voltage threshold corresponding to each + * detection level. + * @retval None + */ +void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD) +{ + /* Check the parameters */ + assert_param(IS_PWR_PVD_LEVEL(sConfigPVD->PVDLevel)); + assert_param(IS_PWR_PVD_MODE(sConfigPVD->Mode)); + + /* Set PLS[7:5] bits according to PVDLevel value */ + MODIFY_REG(PWR->CR, PWR_CR_PLS, sConfigPVD->PVDLevel); + + /* Clear any previous config. Keep it clear if no event or IT mode is selected */ + __HAL_PWR_PVD_EXTI_DISABLE_EVENT(); + __HAL_PWR_PVD_EXTI_DISABLE_IT(); + __HAL_PWR_PVD_EXTI_DISABLE_RISING_EDGE();__HAL_PWR_PVD_EXTI_DISABLE_FALLING_EDGE(); + + /* Configure interrupt mode */ + if((sConfigPVD->Mode & PVD_MODE_IT) == PVD_MODE_IT) + { + __HAL_PWR_PVD_EXTI_ENABLE_IT(); + } + + /* Configure event mode */ + if((sConfigPVD->Mode & PVD_MODE_EVT) == PVD_MODE_EVT) + { + __HAL_PWR_PVD_EXTI_ENABLE_EVENT(); + } + + /* Configure the edge */ + if((sConfigPVD->Mode & PVD_RISING_EDGE) == PVD_RISING_EDGE) + { + __HAL_PWR_PVD_EXTI_ENABLE_RISING_EDGE(); + } + + if((sConfigPVD->Mode & PVD_FALLING_EDGE) == PVD_FALLING_EDGE) + { + __HAL_PWR_PVD_EXTI_ENABLE_FALLING_EDGE(); + } +} + +/** + * @brief Enables the Power Voltage Detector(PVD). + * @retval None + */ +void HAL_PWR_EnablePVD(void) +{ + SET_BIT(PWR->CR, PWR_CR_PVDE); +} + +/** + * @brief Disables the Power Voltage Detector(PVD). + * @retval None + */ +void HAL_PWR_DisablePVD(void) +{ + CLEAR_BIT(PWR->CR, PWR_CR_PVDE); +} + +/** + * @brief This function handles the PWR PVD interrupt request. + * @note This API should be called under the PVD_IRQHandler(). + * @retval None + */ +void HAL_PWR_PVD_IRQHandler(void) +{ + /* Check PWR exti flag */ + if(__HAL_PWR_PVD_EXTI_GET_FLAG() != RESET) + { + /* PWR PVD interrupt user callback */ + HAL_PWR_PVDCallback(); + + /* Clear PWR Exti pending bit */ + __HAL_PWR_PVD_EXTI_CLEAR_FLAG(); + } +} + +/** + * @brief PWR PVD interrupt callback + * @retval None + */ +__weak void HAL_PWR_PVDCallback(void) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_PWR_PVDCallback could be implemented in the user file + */ +} + +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F303x8 || STM32F334x8 || */ + /* STM32F301x8 || STM32F302x8 || */ + /* STM32F373xC */ + +#if defined(STM32F373xC) || defined(STM32F378xx) + +/** + * @brief Enables the SDADC peripheral functionaliy + * @param Analogx specifies the SDADC peripheral instance. + * This parameter can be: PWR_SDADC_ANALOG1, PWR_SDADC_ANALOG2 or PWR_SDADC_ANALOG3. + * @retval None + */ +void HAL_PWREx_EnableSDADC(uint32_t Analogx) +{ + /* Check the parameters */ + assert_param(IS_PWR_SDADC_ANALOG(Analogx)); + + /* Enable PWR clock interface for SDADC use */ + __HAL_RCC_PWR_CLK_ENABLE(); + + PWR->CR |= Analogx; +} + +/** + * @brief Disables the SDADC peripheral functionaliy + * @param Analogx specifies the SDADC peripheral instance. + * This parameter can be: PWR_SDADC_ANALOG1, PWR_SDADC_ANALOG2 or PWR_SDADC_ANALOG3. + * @retval None + */ +void HAL_PWREx_DisableSDADC(uint32_t Analogx) +{ + /* Check the parameters */ + assert_param(IS_PWR_SDADC_ANALOG(Analogx)); + + PWR->CR &= ~Analogx; +} + +#endif /* STM32F373xC || STM32F378xx */ + +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_PWR_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c new file mode 100644 index 0000000..aca0e18 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c @@ -0,0 +1,1221 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_rcc.c + * @author MCD Application Team + * @brief RCC HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Reset and Clock Control (RCC) peripheral: + * + Initialization and de-initialization functions + * + Peripheral Control functions + * + @verbatim + ============================================================================== + ##### RCC specific features ##### + ============================================================================== + [..] + After reset the device is running from Internal High Speed oscillator + (HSI 8MHz) with Flash 0 wait state, Flash prefetch buffer is enabled, + and all peripherals are off except internal SRAM, Flash and JTAG. + (+) There is no prescaler on High speed (AHB) and Low speed (APB) buses; + all peripherals mapped on these buses are running at HSI speed. + (+) The clock for all peripherals is switched off, except the SRAM and FLASH. + (+) All GPIOs are in input floating state, except the JTAG pins which + are assigned to be used for debug purpose. + [..] Once the device started from reset, the user application has to: + (+) Configure the clock source to be used to drive the System clock + (if the application needs higher frequency/performance) + (+) Configure the System clock frequency and Flash settings + (+) Configure the AHB and APB buses prescalers + (+) Enable the clock for the peripheral(s) to be used + (+) Configure the clock source(s) for peripherals whose clocks are not + derived from the System clock (RTC, ADC, I2C, I2S, TIM, USB FS) + + ##### RCC Limitations ##### + ============================================================================== + [..] + A delay between an RCC peripheral clock enable and the effective peripheral + enabling should be taken into account in order to manage the peripheral read/write + from/to registers. + (+) This delay depends on the peripheral mapping. + (++) AHB & APB peripherals, 1 dummy read is necessary + + [..] + Workarounds: + (#) For AHB & APB peripherals, a dummy read to the peripheral register has been + inserted in each __HAL_RCC_PPP_CLK_ENABLE() macro. + + @endverbatim + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup RCC RCC +* @brief RCC HAL module driver + * @{ + */ + +#ifdef HAL_RCC_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup RCC_Private_Constants RCC Private Constants + * @{ + */ +/* Bits position in in the CFGR register */ +#define RCC_CFGR_HPRE_BITNUMBER POSITION_VAL(RCC_CFGR_HPRE) +#define RCC_CFGR_PPRE1_BITNUMBER POSITION_VAL(RCC_CFGR_PPRE1) +#define RCC_CFGR_PPRE2_BITNUMBER POSITION_VAL(RCC_CFGR_PPRE2) +/** + * @} + */ +/* Private macro -------------------------------------------------------------*/ +/** @defgroup RCC_Private_Macros RCC Private Macros + * @{ + */ + +#define MCO1_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() +#define MCO1_GPIO_PORT GPIOA +#define MCO1_PIN GPIO_PIN_8 + +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/** @defgroup RCC_Private_Variables RCC Private Variables + * @{ + */ +static const uint8_t aPLLMULFactorTable[16U] = { 2U, 3U, 4U, 5U, 6U, 7U, 8U, 9U, + 10U, 11U, 12U, 13U, 14U, 15U, 16U, 16U}; +static const uint8_t aPredivFactorTable[16U] = { 1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U, + 9U,10U, 11U, 12U, 13U, 14U, 15U, 16U}; +/** + * @} + */ + +/* Private function prototypes -----------------------------------------------*/ +/* Exported functions ---------------------------------------------------------*/ + +/** @defgroup RCC_Exported_Functions RCC Exported Functions + * @{ + */ + +/** @defgroup RCC_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * + @verbatim + =============================================================================== + ##### Initialization and de-initialization functions ##### + =============================================================================== + [..] + This section provides functions allowing to configure the internal/external oscillators + (HSE, HSI, LSE, LSI, PLL, CSS and MCO) and the System buses clocks (SYSCLK, AHB, APB1 + and APB2). + + [..] Internal/external clock and PLL configuration + (#) HSI (high-speed internal), 8 MHz factory-trimmed RC used directly or through + the PLL as System clock source. + The HSI clock can be used also to clock the USART and I2C peripherals. + + (#) LSI (low-speed internal), ~40 KHz low consumption RC used as IWDG and/or RTC + clock source. + + (#) HSE (high-speed external), 4 to 32 MHz crystal oscillator used directly or + through the PLL as System clock source. Can be used also as RTC clock source. + + (#) LSE (low-speed external), 32 KHz oscillator used as RTC clock source. + + (#) PLL (clocked by HSI or HSE), featuring different output clocks: + (++) The first output is used to generate the high speed system clock (up to 72 MHz) + (++) The second output is used to generate the clock for the USB FS (48 MHz) + (++) The third output may be used to generate the clock for the ADC peripherals (up to 72 MHz) + (++) The fourth output may be used to generate the clock for the TIM peripherals (144 MHz) + + (#) CSS (Clock security system), once enable using the macro __HAL_RCC_CSS_ENABLE() + and if a HSE clock failure occurs(HSE used directly or through PLL as System + clock source), the System clocks automatically switched to HSI and an interrupt + is generated if enabled. The interrupt is linked to the Cortex-M4 NMI + (Non-Maskable Interrupt) exception vector. + + (#) MCO (microcontroller clock output), used to output SYSCLK, HSI, HSE, LSI, LSE or PLL + clock (divided by 2) output on pin (such as PA8 pin). + + [..] System, AHB and APB buses clocks configuration + (#) Several clock sources can be used to drive the System clock (SYSCLK): HSI, + HSE and PLL. + The AHB clock (HCLK) is derived from System clock through configurable + prescaler and used to clock the CPU, memory and peripherals mapped + on AHB bus (DMA, GPIO...). APB1 (PCLK1) and APB2 (PCLK2) clocks are derived + from AHB clock through configurable prescalers and used to clock + the peripherals mapped on these buses. You can use + "HAL_RCC_GetSysClockFreq()" function to retrieve the frequencies of these clocks. + + (#) All the peripheral clocks are derived from the System clock (SYSCLK) except: + (++) The FLASH program/erase clock which is always HSI 8MHz clock. + (++) The USB 48 MHz clock which is derived from the PLL VCO clock. + (++) The USART clock which can be derived as well from HSI 8MHz, LSI or LSE. + (++) The I2C clock which can be derived as well from HSI 8MHz clock. + (++) The ADC clock which is derived from PLL output. + (++) The RTC clock which is derived from the LSE, LSI or 1 MHz HSE_RTC + (HSE divided by a programmable prescaler). The System clock (SYSCLK) + frequency must be higher or equal to the RTC clock frequency. + (++) IWDG clock which is always the LSI clock. + + (#) For the STM32F3xx devices, the maximum frequency of the SYSCLK, HCLK, PCLK1 and PCLK2 is 72 MHz, + Depending on the SYSCLK frequency, the flash latency should be adapted accordingly. + + (#) After reset, the System clock source is the HSI (8 MHz) with 0 WS and + prefetch is disabled. + @endverbatim + * @{ + */ + +/* + Additional consideration on the SYSCLK based on Latency settings: + +-----------------------------------------------+ + | Latency | SYSCLK clock frequency (MHz) | + |---------------|-------------------------------| + |0WS(1CPU cycle)| 0 < SYSCLK <= 24 | + |---------------|-------------------------------| + |1WS(2CPU cycle)| 24 < SYSCLK <= 48 | + |---------------|-------------------------------| + |2WS(3CPU cycle)| 48 < SYSCLK <= 72 | + +-----------------------------------------------+ + */ + +/** + * @brief Resets the RCC clock configuration to the default reset state. + * @note The default reset state of the clock configuration is given below: + * - HSI ON and used as system clock source + * - HSE and PLL OFF + * - AHB, APB1 and APB2 prescaler set to 1. + * - CSS and MCO1 OFF + * - All interrupts disabled + * @note This function does not modify the configuration of the + * - Peripheral clocks + * - LSI, LSE and RTC clocks + * @retval HAL status + */ +HAL_StatusTypeDef HAL_RCC_DeInit(void) +{ + uint32_t tickstart = 0; + + /* Set HSION bit */ + SET_BIT(RCC->CR, RCC_CR_HSION); + + /* Insure HSIRDY bit is set before writing default HSITRIM value */ + /* Get start tick */ + tickstart = HAL_GetTick(); + + /* Wait till HSI is ready */ + while(READ_BIT(RCC->CR, RCC_CR_HSIRDY) == RESET) + { + if((HAL_GetTick() - tickstart) > HSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Set HSITRIM default value */ + MODIFY_REG(RCC->CR, RCC_CR_HSITRIM, RCC_CR_HSITRIM_4); + + /* Reset SW[1:0], HPRE[3:0], PPRE1[2:0], PPRE2[2:0] and MCOSEL[2:0] bits */ + CLEAR_BIT(RCC->CFGR, RCC_CFGR_SW | RCC_CFGR_HPRE | RCC_CFGR_PPRE1 | RCC_CFGR_PPRE2 | RCC_CFGR_MCO); + + /* Insure HSI selected as system clock source */ + /* Get start tick */ + tickstart = HAL_GetTick(); + + /* Wait till system clock source is ready */ + while(READ_BIT(RCC->CFGR, RCC_CFGR_SWS) != RCC_CFGR_SWS_HSI) + { + if((HAL_GetTick() - tickstart) > CLOCKSWITCH_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Update the SystemCoreClock global variable for HSI as system clock source */ + SystemCoreClock = HSI_VALUE; + + /* Configure the source of time base considering new system clock settings */ + if(HAL_InitTick(uwTickPrio) != HAL_OK) + { + return HAL_ERROR; + } + + /* Reset HSEON, CSSON, PLLON bits */ + CLEAR_BIT(RCC->CR, RCC_CR_PLLON | RCC_CR_CSSON | RCC_CR_HSEON); + + /* Reset HSEBYP bit */ + CLEAR_BIT(RCC->CR, RCC_CR_HSEBYP); + + /* Insure PLLRDY is reset */ + /* Get start tick */ + tickstart = HAL_GetTick(); + while(READ_BIT(RCC->CR, RCC_CR_PLLRDY) != 0U) + { + if((HAL_GetTick() - tickstart) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Reset CFGR register */ + CLEAR_REG(RCC->CFGR); + + /* Reset CFGR2 register */ + CLEAR_REG(RCC->CFGR2); + + /* Reset CFGR3 register */ + CLEAR_REG(RCC->CFGR3); + + /* Clear all interrupt flags */ + SET_BIT(RCC->CIR, RCC_CIR_LSIRDYC | RCC_CIR_LSERDYC | RCC_CIR_HSIRDYC | RCC_CIR_HSERDYC | RCC_CIR_PLLRDYC | RCC_CIR_CSSC); + + /* Disable all interrupts */ + CLEAR_REG(RCC->CIR); + + /* Reset all CSR flags */ + __HAL_RCC_CLEAR_RESET_FLAGS(); + + return HAL_OK; +} + +/** + * @brief Initializes the RCC Oscillators according to the specified parameters in the + * RCC_OscInitTypeDef. + * @param RCC_OscInitStruct pointer to an RCC_OscInitTypeDef structure that + * contains the configuration information for the RCC Oscillators. + * @note The PLL is not disabled when used as system clock. + * @note Transitions LSE Bypass to LSE On and LSE On to LSE Bypass are not + * supported by this macro. User should request a transition to LSE Off + * first and then LSE On or LSE Bypass. + * @note Transition HSE Bypass to HSE On and HSE On to HSE Bypass are not + * supported by this macro. User should request a transition to HSE Off + * first and then HSE On or HSE Bypass. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) +{ + uint32_t tickstart; + uint32_t pll_config; +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) + uint32_t pll_config2; +#endif /* RCC_CFGR_PLLSRC_HSI_PREDIV */ + + /* Check Null pointer */ + if(RCC_OscInitStruct == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_RCC_OSCILLATORTYPE(RCC_OscInitStruct->OscillatorType)); + + /*------------------------------- HSE Configuration ------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSE) == RCC_OSCILLATORTYPE_HSE) + { + /* Check the parameters */ + assert_param(IS_RCC_HSE(RCC_OscInitStruct->HSEState)); + + /* When the HSE is used as system clock or clock source for PLL in these cases it is not allowed to be disabled */ + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_HSE) + || ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && (__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_HSE))) + { + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) && (RCC_OscInitStruct->HSEState == RCC_HSE_OFF)) + { + return HAL_ERROR; + } + } + else + { + /* Set the new HSE configuration ---------------------------------------*/ + __HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState); + +#if defined(RCC_CFGR_PLLSRC_HSI_DIV2) + /* Configure the HSE predivision factor --------------------------------*/ + __HAL_RCC_HSE_PREDIV_CONFIG(RCC_OscInitStruct->HSEPredivValue); +#endif /* RCC_CFGR_PLLSRC_HSI_DIV2 */ + + /* Check the HSE State */ + if(RCC_OscInitStruct->HSEState != RCC_HSE_OFF) + { + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till HSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till HSE is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + } + /*----------------------------- HSI Configuration --------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_HSI) == RCC_OSCILLATORTYPE_HSI) + { + /* Check the parameters */ + assert_param(IS_RCC_HSI(RCC_OscInitStruct->HSIState)); + assert_param(IS_RCC_CALIBRATION_VALUE(RCC_OscInitStruct->HSICalibrationValue)); + + /* Check if HSI is used as system clock or as PLL source when PLL is selected as system clock */ + if((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_HSI) + || ((__HAL_RCC_GET_SYSCLK_SOURCE() == RCC_SYSCLKSOURCE_STATUS_PLLCLK) && (__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_HSI))) + { + /* When HSI is used as system clock it will not disabled */ + if((__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) && (RCC_OscInitStruct->HSIState != RCC_HSI_ON)) + { + return HAL_ERROR; + } + /* Otherwise, just the calibration is allowed */ + else + { + /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/ + __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue); + } + } + else + { + /* Check the HSI State */ + if(RCC_OscInitStruct->HSIState != RCC_HSI_OFF) + { + /* Enable the Internal High Speed oscillator (HSI). */ + __HAL_RCC_HSI_ENABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till HSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + + /* Adjusts the Internal High Speed oscillator (HSI) calibration value.*/ + __HAL_RCC_HSI_CALIBRATIONVALUE_ADJUST(RCC_OscInitStruct->HSICalibrationValue); + } + else + { + /* Disable the Internal High Speed oscillator (HSI). */ + __HAL_RCC_HSI_DISABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till HSI is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > HSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + } + /*------------------------------ LSI Configuration -------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI) + { + /* Check the parameters */ + assert_param(IS_RCC_LSI(RCC_OscInitStruct->LSIState)); + + /* Check the LSI State */ + if(RCC_OscInitStruct->LSIState != RCC_LSI_OFF) + { + /* Enable the Internal Low Speed oscillator (LSI). */ + __HAL_RCC_LSI_ENABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till LSI is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + /* Disable the Internal Low Speed oscillator (LSI). */ + __HAL_RCC_LSI_DISABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till LSI is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSIRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > LSI_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + /*------------------------------ LSE Configuration -------------------------*/ + if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE) + { + FlagStatus pwrclkchanged = RESET; + + /* Check the parameters */ + assert_param(IS_RCC_LSE(RCC_OscInitStruct->LSEState)); + + /* Update LSE configuration in Backup Domain control register */ + /* Requires to enable write access to Backup Domain of necessary */ + if(__HAL_RCC_PWR_IS_CLK_DISABLED()) + { + __HAL_RCC_PWR_CLK_ENABLE(); + pwrclkchanged = SET; + } + + if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + { + /* Enable write access to Backup domain */ + SET_BIT(PWR->CR, PWR_CR_DBP); + + /* Wait for Backup domain Write protection disable */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + { + if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + + /* Set the new LSE configuration -----------------------------------------*/ + __HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState); + /* Check the LSE State */ + if(RCC_OscInitStruct->LSEState != RCC_LSE_OFF) + { + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till LSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till LSE is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + + /* Require to disable power clock if necessary */ + if(pwrclkchanged == SET) + { + __HAL_RCC_PWR_CLK_DISABLE(); + } + } + + /*-------------------------------- PLL Configuration -----------------------*/ + /* Check the parameters */ + assert_param(IS_RCC_PLL(RCC_OscInitStruct->PLL.PLLState)); + if ((RCC_OscInitStruct->PLL.PLLState) != RCC_PLL_NONE) + { + /* Check if the PLL is used as system clock or not */ + if(__HAL_RCC_GET_SYSCLK_SOURCE() != RCC_SYSCLKSOURCE_STATUS_PLLCLK) + { + if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_ON) + { + /* Check the parameters */ + assert_param(IS_RCC_PLLSOURCE(RCC_OscInitStruct->PLL.PLLSource)); + assert_param(IS_RCC_PLL_MUL(RCC_OscInitStruct->PLL.PLLMUL)); +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) + assert_param(IS_RCC_PREDIV(RCC_OscInitStruct->PLL.PREDIV)); +#endif + + /* Disable the main PLL. */ + __HAL_RCC_PLL_DISABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till PLL is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) + /* Configure the main PLL clock source, predivider and multiplication factor. */ + __HAL_RCC_PLL_CONFIG(RCC_OscInitStruct->PLL.PLLSource, + RCC_OscInitStruct->PLL.PREDIV, + RCC_OscInitStruct->PLL.PLLMUL); +#else + /* Configure the main PLL clock source and multiplication factor. */ + __HAL_RCC_PLL_CONFIG(RCC_OscInitStruct->PLL.PLLSource, + RCC_OscInitStruct->PLL.PLLMUL); +#endif /* RCC_CFGR_PLLSRC_HSI_PREDIV */ + /* Enable the main PLL. */ + __HAL_RCC_PLL_ENABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till PLL is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + else + { + /* Disable the main PLL. */ + __HAL_RCC_PLL_DISABLE(); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till PLL is disabled */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) != RESET) + { + if((HAL_GetTick() - tickstart ) > PLL_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + else + { + /* Check if there is a request to disable the PLL used as System clock source */ + if((RCC_OscInitStruct->PLL.PLLState) == RCC_PLL_OFF) + { + return HAL_ERROR; + } + else + { + /* Do not return HAL_ERROR if request repeats the current configuration */ + pll_config = RCC->CFGR; +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) + pll_config2 = RCC->CFGR2; + if((READ_BIT(pll_config, RCC_CFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) || + (READ_BIT(pll_config, RCC_CFGR_PLLMUL) != RCC_OscInitStruct->PLL.PLLMUL) || + (READ_BIT(pll_config2, RCC_CFGR2_PREDIV) != RCC_OscInitStruct->PLL.PREDIV)) +#else + if((READ_BIT(pll_config, RCC_CFGR_PLLSRC) != RCC_OscInitStruct->PLL.PLLSource) || + (READ_BIT(pll_config, RCC_CFGR_PLLMUL) != RCC_OscInitStruct->PLL.PLLMUL)) +#endif + { + return HAL_ERROR; + } + } + } + } + + return HAL_OK; +} + +/** + * @brief Initializes the CPU, AHB and APB buses clocks according to the specified + * parameters in the RCC_ClkInitStruct. + * @param RCC_ClkInitStruct pointer to an RCC_OscInitTypeDef structure that + * contains the configuration information for the RCC peripheral. + * @param FLatency FLASH Latency + * The value of this parameter depend on device used within the same series + * @note The SystemCoreClock CMSIS variable is used to store System Clock Frequency + * and updated by @ref HAL_RCC_GetHCLKFreq() function called within this function + * + * @note The HSI is used (enabled by hardware) as system clock source after + * start-up from Reset, wake-up from STOP and STANDBY mode, or in case + * of failure of the HSE used directly or indirectly as system clock + * (if the Clock Security System CSS is enabled). + * + * @note A switch from one clock source to another occurs only if the target + * clock source is ready (clock stable after start-up delay or PLL locked). + * If a clock source which is not yet ready is selected, the switch will + * occur when the clock source will be ready. + * You can use @ref HAL_RCC_GetClockConfig() function to know which clock is + * currently used as system clock source. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency) +{ + uint32_t tickstart = 0U; + + /* Check Null pointer */ + if(RCC_ClkInitStruct == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_RCC_CLOCKTYPE(RCC_ClkInitStruct->ClockType)); + assert_param(IS_FLASH_LATENCY(FLatency)); + + /* To correctly read data from FLASH memory, the number of wait states (LATENCY) + must be correctly programmed according to the frequency of the CPU clock + (HCLK) of the device. */ + + /* Increasing the number of wait states because of higher CPU frequency */ + if(FLatency > __HAL_FLASH_GET_LATENCY()) + { + /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */ + __HAL_FLASH_SET_LATENCY(FLatency); + + /* Check that the new number of wait states is taken into account to access the Flash + memory by reading the FLASH_ACR register */ + if(__HAL_FLASH_GET_LATENCY() != FLatency) + { + return HAL_ERROR; + } + } + + /*-------------------------- HCLK Configuration --------------------------*/ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_HCLK) == RCC_CLOCKTYPE_HCLK) + { + assert_param(IS_RCC_HCLK(RCC_ClkInitStruct->AHBCLKDivider)); + MODIFY_REG(RCC->CFGR, RCC_CFGR_HPRE, RCC_ClkInitStruct->AHBCLKDivider); + } + + /*------------------------- SYSCLK Configuration ---------------------------*/ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_SYSCLK) == RCC_CLOCKTYPE_SYSCLK) + { + assert_param(IS_RCC_SYSCLKSOURCE(RCC_ClkInitStruct->SYSCLKSource)); + + /* HSE is selected as System Clock Source */ + if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_HSE) + { + /* Check the HSE ready flag */ + if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET) + { + return HAL_ERROR; + } + } + /* PLL is selected as System Clock Source */ + else if(RCC_ClkInitStruct->SYSCLKSource == RCC_SYSCLKSOURCE_PLLCLK) + { + /* Check the PLL ready flag */ + if(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET) + { + return HAL_ERROR; + } + } + /* HSI is selected as System Clock Source */ + else + { + /* Check the HSI ready flag */ + if(__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET) + { + return HAL_ERROR; + } + } + + __HAL_RCC_SYSCLK_CONFIG(RCC_ClkInitStruct->SYSCLKSource); + + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + while (__HAL_RCC_GET_SYSCLK_SOURCE() != (RCC_ClkInitStruct->SYSCLKSource << RCC_CFGR_SWS_Pos)) + { + if ((HAL_GetTick() - tickstart) > CLOCKSWITCH_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + /* Decreasing the number of wait states because of lower CPU frequency */ + if(FLatency < __HAL_FLASH_GET_LATENCY()) + { + /* Program the new number of wait states to the LATENCY bits in the FLASH_ACR register */ + __HAL_FLASH_SET_LATENCY(FLatency); + + /* Check that the new number of wait states is taken into account to access the Flash + memory by reading the FLASH_ACR register */ + if(__HAL_FLASH_GET_LATENCY() != FLatency) + { + return HAL_ERROR; + } + } + + /*-------------------------- PCLK1 Configuration ---------------------------*/ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK1) == RCC_CLOCKTYPE_PCLK1) + { + assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB1CLKDivider)); + MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE1, RCC_ClkInitStruct->APB1CLKDivider); + } + + /*-------------------------- PCLK2 Configuration ---------------------------*/ + if(((RCC_ClkInitStruct->ClockType) & RCC_CLOCKTYPE_PCLK2) == RCC_CLOCKTYPE_PCLK2) + { + assert_param(IS_RCC_PCLK(RCC_ClkInitStruct->APB2CLKDivider)); + MODIFY_REG(RCC->CFGR, RCC_CFGR_PPRE2, ((RCC_ClkInitStruct->APB2CLKDivider) << 3U)); + } + + /* Update the SystemCoreClock global variable */ + SystemCoreClock = HAL_RCC_GetSysClockFreq() >> AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE)>> RCC_CFGR_HPRE_BITNUMBER]; + + /* Configure the source of time base considering new system clocks settings*/ + HAL_InitTick (uwTickPrio); + + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup RCC_Exported_Functions_Group2 Peripheral Control functions + * @brief RCC clocks control functions + * + @verbatim + =============================================================================== + ##### Peripheral Control functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to control the RCC Clocks + frequencies. + + @endverbatim + * @{ + */ + +#if defined(RCC_CFGR_MCOPRE) +/** + * @brief Selects the clock source to output on MCO pin. + * @note MCO pin should be configured in alternate function mode. + * @param RCC_MCOx specifies the output direction for the clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_MCO1 Clock source to output on MCO1 pin(PA8). + * @param RCC_MCOSource specifies the clock source to output. + * This parameter can be one of the following values: + * @arg @ref RCC_MCO1SOURCE_NOCLOCK No clock selected + * @arg @ref RCC_MCO1SOURCE_SYSCLK System Clock selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_HSI HSI selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_HSE HSE selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_LSI LSI selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_LSE LSE selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_PLLCLK PLLCLK selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_PLLCLK_DIV2 PLLCLK Divided by 2 selected as MCO clock + * @param RCC_MCODiv specifies the MCO DIV. + * This parameter can be one of the following values: + * @arg @ref RCC_MCODIV_1 no division applied to MCO clock + * @arg @ref RCC_MCODIV_2 division by 2 applied to MCO clock + * @arg @ref RCC_MCODIV_4 division by 4 applied to MCO clock + * @arg @ref RCC_MCODIV_8 division by 8 applied to MCO clock + * @arg @ref RCC_MCODIV_16 division by 16 applied to MCO clock + * @arg @ref RCC_MCODIV_32 division by 32 applied to MCO clock + * @arg @ref RCC_MCODIV_64 division by 64 applied to MCO clock + * @arg @ref RCC_MCODIV_128 division by 128 applied to MCO clock + * @retval None + */ +#else +/** + * @brief Selects the clock source to output on MCO pin. + * @note MCO pin should be configured in alternate function mode. + * @param RCC_MCOx specifies the output direction for the clock source. + * This parameter can be one of the following values: + * @arg @ref RCC_MCO1 Clock source to output on MCO1 pin(PA8). + * @param RCC_MCOSource specifies the clock source to output. + * This parameter can be one of the following values: + * @arg @ref RCC_MCO1SOURCE_NOCLOCK No clock selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_SYSCLK System clock selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_HSI HSI selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_HSE HSE selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_LSI LSI selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_LSE LSE selected as MCO clock + * @arg @ref RCC_MCO1SOURCE_PLLCLK_DIV2 PLLCLK Divided by 2 selected as MCO clock + * @param RCC_MCODiv specifies the MCO DIV. + * This parameter can be one of the following values: + * @arg @ref RCC_MCODIV_1 no division applied to MCO clock + * @retval None + */ +#endif +void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv) +{ + GPIO_InitTypeDef gpio; + + /* Check the parameters */ + assert_param(IS_RCC_MCO(RCC_MCOx)); + assert_param(IS_RCC_MCODIV(RCC_MCODiv)); + assert_param(IS_RCC_MCO1SOURCE(RCC_MCOSource)); + + /* Configure the MCO1 pin in alternate function mode */ + gpio.Mode = GPIO_MODE_AF_PP; + gpio.Speed = GPIO_SPEED_FREQ_HIGH; + gpio.Pull = GPIO_NOPULL; + gpio.Pin = MCO1_PIN; + gpio.Alternate = GPIO_AF0_MCO; + + /* MCO1 Clock Enable */ + MCO1_CLK_ENABLE(); + + HAL_GPIO_Init(MCO1_GPIO_PORT, &gpio); + + /* Configure the MCO clock source */ + __HAL_RCC_MCO1_CONFIG(RCC_MCOSource, RCC_MCODiv); +} + +/** + * @brief Enables the Clock Security System. + * @note If a failure is detected on the HSE oscillator clock, this oscillator + * is automatically disabled and an interrupt is generated to inform the + * software about the failure (Clock Security System Interrupt, CSSI), + * allowing the MCU to perform rescue operations. The CSSI is linked to + * the Cortex-M4 NMI (Non-Maskable Interrupt) exception vector. + * @retval None + */ +void HAL_RCC_EnableCSS(void) +{ + *(__IO uint32_t *) RCC_CR_CSSON_BB = (uint32_t)ENABLE; +} + +/** + * @brief Disables the Clock Security System. + * @retval None + */ +void HAL_RCC_DisableCSS(void) +{ + *(__IO uint32_t *) RCC_CR_CSSON_BB = (uint32_t)DISABLE; +} + +/** + * @brief Returns the SYSCLK frequency + * @note The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * @note If SYSCLK source is HSI, function returns values based on HSI_VALUE(*) + * @note If SYSCLK source is HSE, function returns a value based on HSE_VALUE + * divided by PREDIV factor(**) + * @note If SYSCLK source is PLL, function returns a value based on HSE_VALUE + * divided by PREDIV factor(**) or HSI_VALUE(*) multiplied by the PLL factor. + * @note (*) HSI_VALUE is a constant defined in stm32f3xx_hal_conf.h file (default value + * 8 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * @note (**) HSE_VALUE is a constant defined in stm32f3xx_hal_conf.h file (default value + * 8 MHz), user has to ensure that HSE_VALUE is same as the real + * frequency of the crystal used. Otherwise, this function may + * have wrong result. + * + * @note The result of this function could be not correct when using fractional + * value for HSE crystal. + * + * @note This function can be used by the user application to compute the + * baud-rate for the communication peripherals or configure other parameters. + * + * @note Each time SYSCLK changes, this function must be called to update the + * right SYSCLK value. Otherwise, any configuration based on this function will be incorrect. + * + * @retval SYSCLK frequency + */ +uint32_t HAL_RCC_GetSysClockFreq(void) +{ + uint32_t tmpreg = 0U, prediv = 0U, pllclk = 0U, pllmul = 0U; + uint32_t sysclockfreq = 0U; + + tmpreg = RCC->CFGR; + + /* Get SYSCLK source -------------------------------------------------------*/ + switch (tmpreg & RCC_CFGR_SWS) + { + case RCC_SYSCLKSOURCE_STATUS_HSE: /* HSE used as system clock */ + { + sysclockfreq = HSE_VALUE; + break; + } + case RCC_SYSCLKSOURCE_STATUS_PLLCLK: /* PLL used as system clock */ + { + pllmul = aPLLMULFactorTable[(uint32_t)(tmpreg & RCC_CFGR_PLLMUL) >> POSITION_VAL(RCC_CFGR_PLLMUL)]; + prediv = aPredivFactorTable[(uint32_t)(RCC->CFGR2 & RCC_CFGR2_PREDIV) >> POSITION_VAL(RCC_CFGR2_PREDIV)]; +#if defined(RCC_CFGR_PLLSRC_HSI_DIV2) + if ((tmpreg & RCC_CFGR_PLLSRC) != RCC_PLLSOURCE_HSI) + { + /* HSE used as PLL clock source : PLLCLK = HSE/PREDIV * PLLMUL */ + pllclk = (uint32_t)((uint64_t) HSE_VALUE / (uint64_t) (prediv)) * ((uint64_t) pllmul); + } + else + { + /* HSI used as PLL clock source : PLLCLK = HSI/2 * PLLMUL */ + pllclk = (uint32_t)((uint64_t) (HSI_VALUE >> 1U) * ((uint64_t) pllmul)); + } +#else + if ((tmpreg & RCC_CFGR_PLLSRC_HSE_PREDIV) == RCC_CFGR_PLLSRC_HSE_PREDIV) + { + /* HSE used as PLL clock source : PLLCLK = HSE/PREDIV * PLLMUL */ + pllclk = (uint32_t)((uint64_t) HSE_VALUE / (uint64_t) (prediv)) * ((uint64_t) pllmul); + } + else + { + /* HSI used as PLL clock source : PLLCLK = HSI/PREDIV * PLLMUL */ + pllclk = (uint32_t)((uint64_t) HSI_VALUE / (uint64_t) (prediv)) * ((uint64_t) pllmul); + } +#endif /* RCC_CFGR_PLLSRC_HSI_DIV2 */ + sysclockfreq = pllclk; + break; + } + case RCC_SYSCLKSOURCE_STATUS_HSI: /* HSI used as system clock source */ + default: /* HSI used as system clock */ + { + sysclockfreq = HSI_VALUE; + break; + } + } + return sysclockfreq; +} + +/** + * @brief Returns the HCLK frequency + * @note Each time HCLK changes, this function must be called to update the + * right HCLK value. Otherwise, any configuration based on this function will be incorrect. + * + * @note The SystemCoreClock CMSIS variable is used to store System Clock Frequency + * and updated within this function + * @retval HCLK frequency + */ +uint32_t HAL_RCC_GetHCLKFreq(void) +{ + return SystemCoreClock; +} + +/** + * @brief Returns the PCLK1 frequency + * @note Each time PCLK1 changes, this function must be called to update the + * right PCLK1 value. Otherwise, any configuration based on this function will be incorrect. + * @retval PCLK1 frequency + */ +uint32_t HAL_RCC_GetPCLK1Freq(void) +{ + /* Get HCLK source and Compute PCLK1 frequency ---------------------------*/ + return (HAL_RCC_GetHCLKFreq() >> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE1) >> RCC_CFGR_PPRE1_BITNUMBER]); +} + +/** + * @brief Returns the PCLK2 frequency + * @note Each time PCLK2 changes, this function must be called to update the + * right PCLK2 value. Otherwise, any configuration based on this function will be incorrect. + * @retval PCLK2 frequency + */ +uint32_t HAL_RCC_GetPCLK2Freq(void) +{ + /* Get HCLK source and Compute PCLK2 frequency ---------------------------*/ + return (HAL_RCC_GetHCLKFreq()>> APBPrescTable[(RCC->CFGR & RCC_CFGR_PPRE2) >> RCC_CFGR_PPRE2_BITNUMBER]); +} + +/** + * @brief Configures the RCC_OscInitStruct according to the internal + * RCC configuration registers. + * @param RCC_OscInitStruct pointer to an RCC_OscInitTypeDef structure that + * will be configured. + * @retval None + */ +void HAL_RCC_GetOscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) +{ + /* Check the parameters */ + assert_param(RCC_OscInitStruct != NULL); + + /* Set all possible values for the Oscillator type parameter ---------------*/ + RCC_OscInitStruct->OscillatorType = RCC_OSCILLATORTYPE_HSE | RCC_OSCILLATORTYPE_HSI \ + | RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_LSI; + + + /* Get the HSE configuration -----------------------------------------------*/ + if((RCC->CR &RCC_CR_HSEBYP) == RCC_CR_HSEBYP) + { + RCC_OscInitStruct->HSEState = RCC_HSE_BYPASS; + } + else if((RCC->CR &RCC_CR_HSEON) == RCC_CR_HSEON) + { + RCC_OscInitStruct->HSEState = RCC_HSE_ON; + } + else + { + RCC_OscInitStruct->HSEState = RCC_HSE_OFF; + } +#if defined(RCC_CFGR_PLLSRC_HSI_DIV2) + RCC_OscInitStruct->HSEPredivValue = __HAL_RCC_HSE_GET_PREDIV(); +#endif + + /* Get the HSI configuration -----------------------------------------------*/ + if((RCC->CR &RCC_CR_HSION) == RCC_CR_HSION) + { + RCC_OscInitStruct->HSIState = RCC_HSI_ON; + } + else + { + RCC_OscInitStruct->HSIState = RCC_HSI_OFF; + } + + RCC_OscInitStruct->HSICalibrationValue = (uint32_t)((RCC->CR & RCC_CR_HSITRIM) >> POSITION_VAL(RCC_CR_HSITRIM)); + + /* Get the LSE configuration -----------------------------------------------*/ + if((RCC->BDCR &RCC_BDCR_LSEBYP) == RCC_BDCR_LSEBYP) + { + RCC_OscInitStruct->LSEState = RCC_LSE_BYPASS; + } + else if((RCC->BDCR &RCC_BDCR_LSEON) == RCC_BDCR_LSEON) + { + RCC_OscInitStruct->LSEState = RCC_LSE_ON; + } + else + { + RCC_OscInitStruct->LSEState = RCC_LSE_OFF; + } + + /* Get the LSI configuration -----------------------------------------------*/ + if((RCC->CSR &RCC_CSR_LSION) == RCC_CSR_LSION) + { + RCC_OscInitStruct->LSIState = RCC_LSI_ON; + } + else + { + RCC_OscInitStruct->LSIState = RCC_LSI_OFF; + } + + + /* Get the PLL configuration -----------------------------------------------*/ + if((RCC->CR &RCC_CR_PLLON) == RCC_CR_PLLON) + { + RCC_OscInitStruct->PLL.PLLState = RCC_PLL_ON; + } + else + { + RCC_OscInitStruct->PLL.PLLState = RCC_PLL_OFF; + } + RCC_OscInitStruct->PLL.PLLSource = (uint32_t)(RCC->CFGR & RCC_CFGR_PLLSRC); + RCC_OscInitStruct->PLL.PLLMUL = (uint32_t)(RCC->CFGR & RCC_CFGR_PLLMUL); +#if defined(RCC_CFGR_PLLSRC_HSI_PREDIV) + RCC_OscInitStruct->PLL.PREDIV = (uint32_t)(RCC->CFGR2 & RCC_CFGR2_PREDIV); +#endif /* RCC_CFGR_PLLSRC_HSI_PREDIV */ +} + +/** + * @brief Get the RCC_ClkInitStruct according to the internal + * RCC configuration registers. + * @param RCC_ClkInitStruct pointer to an RCC_ClkInitTypeDef structure that + * contains the current clock configuration. + * @param pFLatency Pointer on the Flash Latency. + * @retval None + */ +void HAL_RCC_GetClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t *pFLatency) +{ + /* Check the parameters */ + assert_param(RCC_ClkInitStruct != NULL); + assert_param(pFLatency != NULL); + + /* Set all possible values for the Clock type parameter --------------------*/ + RCC_ClkInitStruct->ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + + /* Get the SYSCLK configuration --------------------------------------------*/ + RCC_ClkInitStruct->SYSCLKSource = (uint32_t)(RCC->CFGR & RCC_CFGR_SW); + + /* Get the HCLK configuration ----------------------------------------------*/ + RCC_ClkInitStruct->AHBCLKDivider = (uint32_t)(RCC->CFGR & RCC_CFGR_HPRE); + + /* Get the APB1 configuration ----------------------------------------------*/ + RCC_ClkInitStruct->APB1CLKDivider = (uint32_t)(RCC->CFGR & RCC_CFGR_PPRE1); + + /* Get the APB2 configuration ----------------------------------------------*/ + RCC_ClkInitStruct->APB2CLKDivider = (uint32_t)((RCC->CFGR & RCC_CFGR_PPRE2) >> 3U); + + /* Get the Flash Wait State (Latency) configuration ------------------------*/ + *pFLatency = (uint32_t)(FLASH->ACR & FLASH_ACR_LATENCY); +} + +/** + * @brief This function handles the RCC CSS interrupt request. + * @note This API should be called under the NMI_Handler(). + * @retval None + */ +void HAL_RCC_NMI_IRQHandler(void) +{ + /* Check RCC CSSF flag */ + if(__HAL_RCC_GET_IT(RCC_IT_CSS)) + { + /* RCC Clock Security System interrupt user callback */ + HAL_RCC_CSSCallback(); + + /* Clear RCC CSS pending bit */ + __HAL_RCC_CLEAR_IT(RCC_IT_CSS); + } +} + +/** + * @brief RCC Clock Security System interrupt callback + * @retval none + */ +__weak void HAL_RCC_CSSCallback(void) +{ + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_RCC_CSSCallback could be implemented in the user file + */ +} + +/** + * @} + */ + +/** + * @} + */ + +#endif /* HAL_RCC_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c new file mode 100644 index 0000000..8966adb --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c @@ -0,0 +1,1581 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_rcc_ex.c + * @author MCD Application Team + * @brief Extended RCC HAL module driver. + * This file provides firmware functions to manage the following + * functionalities RCC extension peripheral: + * + Extended Peripheral Control functions + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file in + * the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +#ifdef HAL_RCC_MODULE_ENABLED + +/** @defgroup RCCEx RCCEx + * @brief RCC Extension HAL module driver. + * @{ + */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/** @defgroup RCCEx_Private_Macros RCCEx Private Macros + * @{ + */ +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ +#if defined(RCC_CFGR2_ADC1PRES) || defined(RCC_CFGR2_ADCPRE12) || defined(RCC_CFGR2_ADCPRE34) || defined(RCC_CFGR_USBPRE) \ + || defined(RCC_CFGR3_TIM1SW) || defined(RCC_CFGR3_TIM2SW) || defined(RCC_CFGR3_TIM8SW) || defined(RCC_CFGR3_TIM15SW) \ + || defined(RCC_CFGR3_TIM16SW) || defined(RCC_CFGR3_TIM17SW) || defined(RCC_CFGR3_TIM20SW) || defined(RCC_CFGR3_TIM34SW) \ + || defined(RCC_CFGR3_HRTIM1SW) +/** @defgroup RCCEx_Private_Functions RCCEx Private Functions + * @{ + */ +static uint32_t RCC_GetPLLCLKFreq(void); + +/** + * @} + */ +#endif /* RCC_CFGR2_ADC1PRES || RCC_CFGR2_ADCPRExx || RCC_CFGR3_TIMxSW || RCC_CFGR3_HRTIM1SW || RCC_CFGR_USBPRE */ + +/** @defgroup RCCEx_Exported_Functions RCCEx Exported Functions + * @{ + */ + +/** @defgroup RCCEx_Exported_Functions_Group1 Extended Peripheral Control functions + * @brief Extended Peripheral Control functions + * +@verbatim + =============================================================================== + ##### Extended Peripheral Control functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to control the RCC Clocks + frequencies. + [..] + (@) Important note: Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to + select the RTC clock source; in this case the Backup domain will be reset in + order to modify the RTC Clock source, as consequence RTC registers (including + the backup registers) are set to their reset values. + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the RCC extended peripherals clocks according to the specified + * parameters in the RCC_PeriphCLKInitTypeDef. + * @param PeriphClkInit pointer to an RCC_PeriphCLKInitTypeDef structure that + * contains the configuration information for the Extended Peripherals clocks + * (ADC, CEC, I2C, I2S, SDADC, HRTIM, TIM, USART, RTC and USB). + * + * @note Care must be taken when HAL_RCCEx_PeriphCLKConfig() is used to select + * the RTC clock source; in this case the Backup domain will be reset in + * order to modify the RTC Clock source, as consequence RTC registers (including + * the backup registers) and RCC_BDCR register are set to their reset values. + * + * @note When the TIMx clock source is APB clock, so the TIMx clock is APB clock or + * APB clock x 2 depending on the APB prescaler. + * When the TIMx clock source is PLL clock, so the TIMx clock is PLL clock x 2. + * + * @retval HAL status + */ +HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) +{ + uint32_t tickstart = 0U; + uint32_t temp_reg = 0U; + FlagStatus pwrclkchanged = RESET; + + /* Check the parameters */ + assert_param(IS_RCC_PERIPHCLOCK(PeriphClkInit->PeriphClockSelection)); + + /*---------------------------- RTC configuration -------------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_RTC) == (RCC_PERIPHCLK_RTC)) + { + /* check for RTC Parameters used to output RTCCLK */ + assert_param(IS_RCC_RTCCLKSOURCE(PeriphClkInit->RTCClockSelection)); + + + /* As soon as function is called to change RTC clock source, activation of the + power domain is done. */ + /* Requires to enable write access to Backup Domain of necessary */ + if(__HAL_RCC_PWR_IS_CLK_DISABLED()) + { + __HAL_RCC_PWR_CLK_ENABLE(); + pwrclkchanged = SET; + } + + if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + { + /* Enable write access to Backup domain */ + SET_BIT(PWR->CR, PWR_CR_DBP); + + /* Wait for Backup domain Write protection disable */ + tickstart = HAL_GetTick(); + + while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP)) + { + if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + + /* Reset the Backup domain only if the RTC Clock source selection is modified from reset value */ + temp_reg = (RCC->BDCR & RCC_BDCR_RTCSEL); + if((temp_reg != 0x00000000U) && (temp_reg != (PeriphClkInit->RTCClockSelection & RCC_BDCR_RTCSEL))) + { + /* Store the content of BDCR register before the reset of Backup Domain */ + temp_reg = (RCC->BDCR & ~(RCC_BDCR_RTCSEL)); + /* RTC Clock selection can be changed only if the Backup Domain is reset */ + __HAL_RCC_BACKUPRESET_FORCE(); + __HAL_RCC_BACKUPRESET_RELEASE(); + /* Restore the Content of BDCR register */ + RCC->BDCR = temp_reg; + + /* Wait for LSERDY if LSE was enabled */ + if (HAL_IS_BIT_SET(temp_reg, RCC_BDCR_LSEON)) + { + /* Get Start Tick */ + tickstart = HAL_GetTick(); + + /* Wait till LSE is ready */ + while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET) + { + if((HAL_GetTick() - tickstart) > RCC_LSE_TIMEOUT_VALUE) + { + return HAL_TIMEOUT; + } + } + } + } + __HAL_RCC_RTC_CONFIG(PeriphClkInit->RTCClockSelection); + + /* Require to disable power clock if necessary */ + if(pwrclkchanged == SET) + { + __HAL_RCC_PWR_CLK_DISABLE(); + } + } + + /*------------------------------- USART1 Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_USART1) == RCC_PERIPHCLK_USART1) + { + /* Check the parameters */ + assert_param(IS_RCC_USART1CLKSOURCE(PeriphClkInit->Usart1ClockSelection)); + + /* Configure the USART1 clock source */ + __HAL_RCC_USART1_CONFIG(PeriphClkInit->Usart1ClockSelection); + } + +#if defined(RCC_CFGR3_USART2SW) + /*----------------------------- USART2 Configuration --------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_USART2) == RCC_PERIPHCLK_USART2) + { + /* Check the parameters */ + assert_param(IS_RCC_USART2CLKSOURCE(PeriphClkInit->Usart2ClockSelection)); + + /* Configure the USART2 clock source */ + __HAL_RCC_USART2_CONFIG(PeriphClkInit->Usart2ClockSelection); + } +#endif /* RCC_CFGR3_USART2SW */ + +#if defined(RCC_CFGR3_USART3SW) + /*------------------------------ USART3 Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_USART3) == RCC_PERIPHCLK_USART3) + { + /* Check the parameters */ + assert_param(IS_RCC_USART3CLKSOURCE(PeriphClkInit->Usart3ClockSelection)); + + /* Configure the USART3 clock source */ + __HAL_RCC_USART3_CONFIG(PeriphClkInit->Usart3ClockSelection); + } +#endif /* RCC_CFGR3_USART3SW */ + + /*------------------------------ I2C1 Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2C1) == RCC_PERIPHCLK_I2C1) + { + /* Check the parameters */ + assert_param(IS_RCC_I2C1CLKSOURCE(PeriphClkInit->I2c1ClockSelection)); + + /* Configure the I2C1 clock source */ + __HAL_RCC_I2C1_CONFIG(PeriphClkInit->I2c1ClockSelection); + } + +#if defined(STM32F302xE) || defined(STM32F303xE)\ + || defined(STM32F302xC) || defined(STM32F303xC)\ + || defined(STM32F302x8) \ + || defined(STM32F373xC) + /*------------------------------ USB Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_USB) == RCC_PERIPHCLK_USB) + { + /* Check the parameters */ + assert_param(IS_RCC_USBCLKSOURCE(PeriphClkInit->USBClockSelection)); + + /* Configure the USB clock source */ + __HAL_RCC_USB_CONFIG(PeriphClkInit->USBClockSelection); + } + +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F302x8 || */ + /* STM32F373xC */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)\ + || defined(STM32F373xC) || defined(STM32F378xx) + + /*------------------------------ I2C2 Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2C2) == RCC_PERIPHCLK_I2C2) + { + /* Check the parameters */ + assert_param(IS_RCC_I2C2CLKSOURCE(PeriphClkInit->I2c2ClockSelection)); + + /* Configure the I2C2 clock source */ + __HAL_RCC_I2C2_CONFIG(PeriphClkInit->I2c2ClockSelection); + } + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + /*------------------------------ I2C3 Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2C3) == RCC_PERIPHCLK_I2C3) + { + /* Check the parameters */ + assert_param(IS_RCC_I2C3CLKSOURCE(PeriphClkInit->I2c3ClockSelection)); + + /* Configure the I2C3 clock source */ + __HAL_RCC_I2C3_CONFIG(PeriphClkInit->I2c3ClockSelection); + } +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) + + /*------------------------------ UART4 Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_UART4) == RCC_PERIPHCLK_UART4) + { + /* Check the parameters */ + assert_param(IS_RCC_UART4CLKSOURCE(PeriphClkInit->Uart4ClockSelection)); + + /* Configure the UART4 clock source */ + __HAL_RCC_UART4_CONFIG(PeriphClkInit->Uart4ClockSelection); + } + + /*------------------------------ UART5 Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_UART5) == RCC_PERIPHCLK_UART5) + { + /* Check the parameters */ + assert_param(IS_RCC_UART5CLKSOURCE(PeriphClkInit->Uart5ClockSelection)); + + /* Configure the UART5 clock source */ + __HAL_RCC_UART5_CONFIG(PeriphClkInit->Uart5ClockSelection); + } + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + /*------------------------------ I2S Configuration ------------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_I2S) == RCC_PERIPHCLK_I2S) + { + /* Check the parameters */ + assert_param(IS_RCC_I2SCLKSOURCE(PeriphClkInit->I2sClockSelection)); + + /* Configure the I2S clock source */ + __HAL_RCC_I2S_CONFIG(PeriphClkInit->I2sClockSelection); + } + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + /*------------------------------ ADC1 clock Configuration ------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_ADC1) == RCC_PERIPHCLK_ADC1) + { + /* Check the parameters */ + assert_param(IS_RCC_ADC1PLLCLK_DIV(PeriphClkInit->Adc1ClockSelection)); + + /* Configure the ADC1 clock source */ + __HAL_RCC_ADC1_CONFIG(PeriphClkInit->Adc1ClockSelection); + } + +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) + + /*------------------------------ ADC1 & ADC2 clock Configuration -------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_ADC12) == RCC_PERIPHCLK_ADC12) + { + /* Check the parameters */ + assert_param(IS_RCC_ADC12PLLCLK_DIV(PeriphClkInit->Adc12ClockSelection)); + + /* Configure the ADC12 clock source */ + __HAL_RCC_ADC12_CONFIG(PeriphClkInit->Adc12ClockSelection); + } + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) + + /*------------------------------ ADC3 & ADC4 clock Configuration -------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_ADC34) == RCC_PERIPHCLK_ADC34) + { + /* Check the parameters */ + assert_param(IS_RCC_ADC34PLLCLK_DIV(PeriphClkInit->Adc34ClockSelection)); + + /* Configure the ADC34 clock source */ + __HAL_RCC_ADC34_CONFIG(PeriphClkInit->Adc34ClockSelection); + } + +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F373xC) || defined(STM32F378xx) + + /*------------------------------ ADC1 clock Configuration ------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_ADC1) == RCC_PERIPHCLK_ADC1) + { + /* Check the parameters */ + assert_param(IS_RCC_ADC1PCLK2_DIV(PeriphClkInit->Adc1ClockSelection)); + + /* Configure the ADC1 clock source */ + __HAL_RCC_ADC1_CONFIG(PeriphClkInit->Adc1ClockSelection); + } + +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + /*------------------------------ TIM1 clock Configuration ----------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM1) == RCC_PERIPHCLK_TIM1) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM1CLKSOURCE(PeriphClkInit->Tim1ClockSelection)); + + /* Configure the TIM1 clock source */ + __HAL_RCC_TIM1_CONFIG(PeriphClkInit->Tim1ClockSelection); + } + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) + + /*------------------------------ TIM8 clock Configuration ----------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM8) == RCC_PERIPHCLK_TIM8) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM8CLKSOURCE(PeriphClkInit->Tim8ClockSelection)); + + /* Configure the TIM8 clock source */ + __HAL_RCC_TIM8_CONFIG(PeriphClkInit->Tim8ClockSelection); + } + +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + /*------------------------------ TIM15 clock Configuration ----------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM15) == RCC_PERIPHCLK_TIM15) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM15CLKSOURCE(PeriphClkInit->Tim15ClockSelection)); + + /* Configure the TIM15 clock source */ + __HAL_RCC_TIM15_CONFIG(PeriphClkInit->Tim15ClockSelection); + } + + /*------------------------------ TIM16 clock Configuration ----------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM16) == RCC_PERIPHCLK_TIM16) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM16CLKSOURCE(PeriphClkInit->Tim16ClockSelection)); + + /* Configure the TIM16 clock source */ + __HAL_RCC_TIM16_CONFIG(PeriphClkInit->Tim16ClockSelection); + } + + /*------------------------------ TIM17 clock Configuration ----------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM17) == RCC_PERIPHCLK_TIM17) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM17CLKSOURCE(PeriphClkInit->Tim17ClockSelection)); + + /* Configure the TIM17 clock source */ + __HAL_RCC_TIM17_CONFIG(PeriphClkInit->Tim17ClockSelection); + } + +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F334x8) + + /*------------------------------ HRTIM1 clock Configuration ----------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_HRTIM1) == RCC_PERIPHCLK_HRTIM1) + { + /* Check the parameters */ + assert_param(IS_RCC_HRTIM1CLKSOURCE(PeriphClkInit->Hrtim1ClockSelection)); + + /* Configure the HRTIM1 clock source */ + __HAL_RCC_HRTIM1_CONFIG(PeriphClkInit->Hrtim1ClockSelection); + } + +#endif /* STM32F334x8 */ + +#if defined(STM32F373xC) || defined(STM32F378xx) + + /*------------------------------ SDADC clock Configuration -------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_SDADC) == RCC_PERIPHCLK_SDADC) + { + /* Check the parameters */ + assert_param(IS_RCC_SDADCSYSCLK_DIV(PeriphClkInit->SdadcClockSelection)); + + /* Configure the SDADC clock prescaler */ + __HAL_RCC_SDADC_CONFIG(PeriphClkInit->SdadcClockSelection); + } + + /*------------------------------ CEC clock Configuration -------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_CEC) == RCC_PERIPHCLK_CEC) + { + /* Check the parameters */ + assert_param(IS_RCC_CECCLKSOURCE(PeriphClkInit->CecClockSelection)); + + /* Configure the CEC clock source */ + __HAL_RCC_CEC_CONFIG(PeriphClkInit->CecClockSelection); + } + +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) + + /*------------------------------ TIM2 clock Configuration -------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM2) == RCC_PERIPHCLK_TIM2) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM2CLKSOURCE(PeriphClkInit->Tim2ClockSelection)); + + /* Configure the CEC clock source */ + __HAL_RCC_TIM2_CONFIG(PeriphClkInit->Tim2ClockSelection); + } + + /*------------------------------ TIM3 clock Configuration -------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM34) == RCC_PERIPHCLK_TIM34) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM3CLKSOURCE(PeriphClkInit->Tim34ClockSelection)); + + /* Configure the CEC clock source */ + __HAL_RCC_TIM34_CONFIG(PeriphClkInit->Tim34ClockSelection); + } + + /*------------------------------ TIM15 clock Configuration ------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM15) == RCC_PERIPHCLK_TIM15) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM15CLKSOURCE(PeriphClkInit->Tim15ClockSelection)); + + /* Configure the CEC clock source */ + __HAL_RCC_TIM15_CONFIG(PeriphClkInit->Tim15ClockSelection); + } + + /*------------------------------ TIM16 clock Configuration ------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM16) == RCC_PERIPHCLK_TIM16) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM16CLKSOURCE(PeriphClkInit->Tim16ClockSelection)); + + /* Configure the CEC clock source */ + __HAL_RCC_TIM16_CONFIG(PeriphClkInit->Tim16ClockSelection); + } + + /*------------------------------ TIM17 clock Configuration ------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM17) == RCC_PERIPHCLK_TIM17) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM17CLKSOURCE(PeriphClkInit->Tim17ClockSelection)); + + /* Configure the CEC clock source */ + __HAL_RCC_TIM17_CONFIG(PeriphClkInit->Tim17ClockSelection); + } + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx) + /*------------------------------ TIM20 clock Configuration ------------------*/ + if(((PeriphClkInit->PeriphClockSelection) & RCC_PERIPHCLK_TIM20) == RCC_PERIPHCLK_TIM20) + { + /* Check the parameters */ + assert_param(IS_RCC_TIM20CLKSOURCE(PeriphClkInit->Tim20ClockSelection)); + + /* Configure the CEC clock source */ + __HAL_RCC_TIM20_CONFIG(PeriphClkInit->Tim20ClockSelection); + } +#endif /* STM32F303xE || STM32F398xx */ + + + return HAL_OK; +} + +/** + * @brief Get the RCC_ClkInitStruct according to the internal + * RCC configuration registers. + * @param PeriphClkInit pointer to an RCC_PeriphCLKInitTypeDef structure that + * returns the configuration information for the Extended Peripherals clocks + * (ADC, CEC, I2C, I2S, SDADC, HRTIM, TIM, USART, RTC and USB clocks). + * @retval None + */ +void HAL_RCCEx_GetPeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit) +{ + /* Set all possible values for the extended clock type parameter------------*/ + /* Common part first */ +#if defined(RCC_CFGR3_USART2SW) && defined(RCC_CFGR3_USART3SW) + PeriphClkInit->PeriphClockSelection = RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART2 | RCC_PERIPHCLK_USART3 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_RTC; +#else + PeriphClkInit->PeriphClockSelection = RCC_PERIPHCLK_USART1 | \ + RCC_PERIPHCLK_I2C1 | RCC_PERIPHCLK_RTC; +#endif /* RCC_CFGR3_USART2SW && RCC_CFGR3_USART3SW */ + + /* Get the RTC configuration --------------------------------------------*/ + PeriphClkInit->RTCClockSelection = __HAL_RCC_GET_RTC_SOURCE(); + /* Get the USART1 clock configuration --------------------------------------------*/ + PeriphClkInit->Usart1ClockSelection = __HAL_RCC_GET_USART1_SOURCE(); +#if defined(RCC_CFGR3_USART2SW) + /* Get the USART2 clock configuration -----------------------------------------*/ + PeriphClkInit->Usart2ClockSelection = __HAL_RCC_GET_USART2_SOURCE(); +#endif /* RCC_CFGR3_USART2SW */ +#if defined(RCC_CFGR3_USART3SW) + /* Get the USART3 clock configuration -----------------------------------------*/ + PeriphClkInit->Usart3ClockSelection = __HAL_RCC_GET_USART3_SOURCE(); +#endif /* RCC_CFGR3_USART3SW */ + /* Get the I2C1 clock configuration -----------------------------------------*/ + PeriphClkInit->I2c1ClockSelection = __HAL_RCC_GET_I2C1_SOURCE(); + +#if defined(STM32F302xE) || defined(STM32F303xE)\ + || defined(STM32F302xC) || defined(STM32F303xC)\ + || defined(STM32F302x8) \ + || defined(STM32F373xC) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_USB; + /* Get the USB clock configuration -----------------------------------------*/ + PeriphClkInit->USBClockSelection = __HAL_RCC_GET_USB_SOURCE(); + +#endif /* STM32F302xE || STM32F303xE || */ + /* STM32F302xC || STM32F303xC || */ + /* STM32F302x8 || */ + /* STM32F373xC */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)\ + || defined(STM32F373xC) || defined(STM32F378xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_I2C2; + /* Get the I2C2 clock configuration -----------------------------------------*/ + PeriphClkInit->I2c2ClockSelection = __HAL_RCC_GET_I2C2_SOURCE(); + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_I2C3; + /* Get the I2C3 clock configuration -----------------------------------------*/ + PeriphClkInit->I2c3ClockSelection = __HAL_RCC_GET_I2C3_SOURCE(); + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) ||defined(STM32F358xx) + + PeriphClkInit->PeriphClockSelection |= (RCC_PERIPHCLK_UART4 | RCC_PERIPHCLK_UART5); + /* Get the UART4 clock configuration -----------------------------------------*/ + PeriphClkInit->Uart4ClockSelection = __HAL_RCC_GET_UART4_SOURCE(); + /* Get the UART5 clock configuration -----------------------------------------*/ + PeriphClkInit->Uart5ClockSelection = __HAL_RCC_GET_UART5_SOURCE(); + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_I2S; + /* Get the I2S clock configuration -----------------------------------------*/ + PeriphClkInit->I2sClockSelection = __HAL_RCC_GET_I2S_SOURCE(); + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)\ + || defined(STM32F373xC) || defined(STM32F378xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_ADC1; + /* Get the ADC1 clock configuration -----------------------------------------*/ + PeriphClkInit->Adc1ClockSelection = __HAL_RCC_GET_ADC1_SOURCE(); + +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ + /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_ADC12; + /* Get the ADC1 & ADC2 clock configuration -----------------------------------------*/ + PeriphClkInit->Adc12ClockSelection = __HAL_RCC_GET_ADC12_SOURCE(); + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_ADC34; + /* Get the ADC3 & ADC4 clock configuration -----------------------------------------*/ + PeriphClkInit->Adc34ClockSelection = __HAL_RCC_GET_ADC34_SOURCE(); + +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)\ + || defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)\ + || defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_TIM1; + /* Get the TIM1 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim1ClockSelection = __HAL_RCC_GET_TIM1_SOURCE(); + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx || */ + /* STM32F302xC || STM32F303xC || STM32F358xx || */ + /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ + /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F303xE) || defined(STM32F398xx)\ + || defined(STM32F303xC) || defined(STM32F358xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_TIM8; + /* Get the TIM8 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim8ClockSelection = __HAL_RCC_GET_TIM8_SOURCE(); + +#endif /* STM32F303xE || STM32F398xx || */ + /* STM32F303xC || STM32F358xx */ + +#if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) + + PeriphClkInit->PeriphClockSelection |= (RCC_PERIPHCLK_TIM15 | RCC_PERIPHCLK_TIM16 | RCC_PERIPHCLK_TIM17); + /* Get the TIM15 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim15ClockSelection = __HAL_RCC_GET_TIM15_SOURCE(); + /* Get the TIM16 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim16ClockSelection = __HAL_RCC_GET_TIM16_SOURCE(); + /* Get the TIM17 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim17ClockSelection = __HAL_RCC_GET_TIM17_SOURCE(); + +#endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ + +#if defined(STM32F334x8) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_HRTIM1; + /* Get the HRTIM1 clock configuration -----------------------------------------*/ + PeriphClkInit->Hrtim1ClockSelection = __HAL_RCC_GET_HRTIM1_SOURCE(); + +#endif /* STM32F334x8 */ + +#if defined(STM32F373xC) || defined(STM32F378xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_SDADC; + /* Get the SDADC clock configuration -----------------------------------------*/ + PeriphClkInit->SdadcClockSelection = __HAL_RCC_GET_SDADC_SOURCE(); + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_CEC; + /* Get the CEC clock configuration -----------------------------------------*/ + PeriphClkInit->CecClockSelection = __HAL_RCC_GET_CEC_SOURCE(); + +#endif /* STM32F373xC || STM32F378xx */ + +#if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_TIM2; + /* Get the TIM2 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim2ClockSelection = __HAL_RCC_GET_TIM2_SOURCE(); + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_TIM34; + /* Get the TIM3 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim34ClockSelection = __HAL_RCC_GET_TIM34_SOURCE(); + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_TIM15; + /* Get the TIM15 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim15ClockSelection = __HAL_RCC_GET_TIM15_SOURCE(); + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_TIM16; + /* Get the TIM16 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim16ClockSelection = __HAL_RCC_GET_TIM16_SOURCE(); + + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_TIM17; + /* Get the TIM17 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim17ClockSelection = __HAL_RCC_GET_TIM17_SOURCE(); + +#endif /* STM32F302xE || STM32F303xE || STM32F398xx */ + +#if defined (STM32F303xE) || defined(STM32F398xx) + PeriphClkInit->PeriphClockSelection |= RCC_PERIPHCLK_TIM20; + /* Get the TIM20 clock configuration -----------------------------------------*/ + PeriphClkInit->Tim20ClockSelection = __HAL_RCC_GET_TIM20_SOURCE(); +#endif /* STM32F303xE || STM32F398xx */ +} + +/** + * @brief Returns the peripheral clock frequency + * @note Returns 0 if peripheral clock is unknown or 0xDEADDEAD if not applicable. + * @param PeriphClk Peripheral clock identifier + * This parameter can be one of the following values: + * @arg @ref RCC_PERIPHCLK_RTC RTC peripheral clock + * @arg @ref RCC_PERIPHCLK_USART1 USART1 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C1 I2C1 peripheral clock + @if STM32F301x8 + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C3 I2C3 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC1 ADC1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM15 TIM15 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM16 TIM16 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM17 TIM17 peripheral clock + @endif + @if STM32F302x8 + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C3 I2C3 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_USB USB peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC1 ADC1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM15 TIM15 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM16 TIM16 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM17 TIM17 peripheral clock + @endif + @if STM32F302xC + * @arg @ref RCC_PERIPHCLK_USART2 USART2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USART3 USART3 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART4 UART4 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART5 UART5 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_USB USB peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + @endif + @if STM32F302xE + * @arg @ref RCC_PERIPHCLK_USART2 USART2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USART3 USART3 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART4 UART4 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART5 UART5 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C3 I2C3 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_USB USB peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM2 TIM2 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM15 TIM15 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM16 TIM16 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM17 TIM17 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM34 TIM34 peripheral clock + @endif + @if STM32F303x8 + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + @endif + @if STM32F303xC + * @arg @ref RCC_PERIPHCLK_USART2 USART2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USART3 USART3 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART4 UART4 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART5 UART5 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_USB USB peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC34 ADC34 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM8 TIM8 peripheral clock + @endif + @if STM32F303xE + * @arg @ref RCC_PERIPHCLK_USART2 USART2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USART3 USART3 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART4 UART4 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART5 UART5 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C3 I2C3 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_USB USB peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC34 ADC34 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM2 TIM2 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM8 TIM8 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM15 TIM15 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM16 TIM16 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM17 TIM17 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM20 TIM20 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM34 TIM34 peripheral clock + @endif + @if STM32F318xx + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C3 I2C3 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC1 ADC1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM15 TIM15 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM16 TIM16 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM17 TIM17 peripheral clock + @endif + @if STM32F328xx + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + @endif + @if STM32F334x8 + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_HRTIM1 HRTIM1 peripheral clock + @endif + @if STM32F358xx + * @arg @ref RCC_PERIPHCLK_USART2 USART2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USART3 USART3 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART4 UART4 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART5 UART5 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC34 ADC34 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM8 TIM8 peripheral clock + @endif + @if STM32F373xC + * @arg @ref RCC_PERIPHCLK_USART2 USART2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USART3 USART3 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USB USB peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC1 ADC1 peripheral clock + * @arg @ref RCC_PERIPHCLK_SDADC SDADC peripheral clock + * @arg @ref RCC_PERIPHCLK_CEC CEC peripheral clock + @endif + @if STM32F378xx + * @arg @ref RCC_PERIPHCLK_USART2 USART2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USART3 USART3 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC1 ADC1 peripheral clock + * @arg @ref RCC_PERIPHCLK_SDADC SDADC peripheral clock + * @arg @ref RCC_PERIPHCLK_CEC CEC peripheral clock + @endif + @if STM32F398xx + * @arg @ref RCC_PERIPHCLK_USART2 USART2 peripheral clock + * @arg @ref RCC_PERIPHCLK_USART3 USART3 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART4 UART4 peripheral clock + * @arg @ref RCC_PERIPHCLK_UART5 UART5 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C2 I2C2 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2C3 I2C3 peripheral clock + * @arg @ref RCC_PERIPHCLK_I2S I2S peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC12 ADC12 peripheral clock + * @arg @ref RCC_PERIPHCLK_ADC34 ADC34 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM1 TIM1 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM2 TIM2 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM8 TIM8 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM15 TIM15 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM16 TIM16 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM17 TIM17 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM20 TIM20 peripheral clock + * @arg @ref RCC_PERIPHCLK_TIM34 TIM34 peripheral clock + @endif + * @retval Frequency in Hz (0: means that no available frequency for the peripheral) + */ +uint32_t HAL_RCCEx_GetPeriphCLKFreq(uint32_t PeriphClk) +{ + /* frequency == 0 : means that no available frequency for the peripheral */ + uint32_t frequency = 0U; + + uint32_t srcclk = 0U; +#if defined(RCC_CFGR2_ADC1PRES) || defined(RCC_CFGR2_ADCPRE12) || defined(RCC_CFGR2_ADCPRE34) + static const uint16_t adc_pll_prediv_table[16U] = { 1U, 2U, 4U, 6U, 8U, 10U, 12U, 16U, 32U, 64U, 128U, 256U, 256U, 256U, 256U, 256U}; +#endif /* RCC_CFGR2_ADC1PRES || RCC_CFGR2_ADCPRE12 || RCC_CFGR2_ADCPRE34 */ +#if defined(RCC_CFGR_SDPRE) + static const uint8_t sdadc_prescaler_table[16U] = { 2U, 4U, 6U, 8U, 10U, 12U, 14U, 16U, 20U, 24U, 28U, 32U, 36U, 40U, 44U, 48U}; +#endif /* RCC_CFGR_SDPRE */ + + /* Check the parameters */ + assert_param(IS_RCC_PERIPHCLOCK(PeriphClk)); + + switch (PeriphClk) + { + case RCC_PERIPHCLK_RTC: + { + /* Get the current RTC source */ + srcclk = __HAL_RCC_GET_RTC_SOURCE(); + + /* Check if LSE is ready and if RTC clock selection is LSE */ + if ((srcclk == RCC_RTCCLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY))) + { + frequency = LSE_VALUE; + } + /* Check if LSI is ready and if RTC clock selection is LSI */ + else if ((srcclk == RCC_RTCCLKSOURCE_LSI) && (HAL_IS_BIT_SET(RCC->CSR, RCC_CSR_LSIRDY))) + { + frequency = LSI_VALUE; + } + /* Check if HSE is ready and if RTC clock selection is HSI_DIV32*/ + else if ((srcclk == RCC_RTCCLKSOURCE_HSE_DIV32) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSERDY))) + { + frequency = HSE_VALUE / 32U; + } + break; + } + case RCC_PERIPHCLK_USART1: + { + /* Get the current USART1 source */ + srcclk = __HAL_RCC_GET_USART1_SOURCE(); + + /* Check if USART1 clock selection is PCLK1 */ +#if defined(RCC_USART1CLKSOURCE_PCLK2) + if (srcclk == RCC_USART1CLKSOURCE_PCLK2) + { + frequency = HAL_RCC_GetPCLK2Freq(); + } +#else + if (srcclk == RCC_USART1CLKSOURCE_PCLK1) + { + frequency = HAL_RCC_GetPCLK1Freq(); + } +#endif /* RCC_USART1CLKSOURCE_PCLK2 */ + /* Check if HSI is ready and if USART1 clock selection is HSI */ + else if ((srcclk == RCC_USART1CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if USART1 clock selection is SYSCLK */ + else if (srcclk == RCC_USART1CLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + /* Check if LSE is ready and if USART1 clock selection is LSE */ + else if ((srcclk == RCC_USART1CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY))) + { + frequency = LSE_VALUE; + } + break; + } +#if defined(RCC_CFGR3_USART2SW) + case RCC_PERIPHCLK_USART2: + { + /* Get the current USART2 source */ + srcclk = __HAL_RCC_GET_USART2_SOURCE(); + + /* Check if USART2 clock selection is PCLK1 */ + if (srcclk == RCC_USART2CLKSOURCE_PCLK1) + { + frequency = HAL_RCC_GetPCLK1Freq(); + } + /* Check if HSI is ready and if USART2 clock selection is HSI */ + else if ((srcclk == RCC_USART2CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if USART2 clock selection is SYSCLK */ + else if (srcclk == RCC_USART2CLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + /* Check if LSE is ready and if USART2 clock selection is LSE */ + else if ((srcclk == RCC_USART2CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY))) + { + frequency = LSE_VALUE; + } + break; + } +#endif /* RCC_CFGR3_USART2SW */ +#if defined(RCC_CFGR3_USART3SW) + case RCC_PERIPHCLK_USART3: + { + /* Get the current USART3 source */ + srcclk = __HAL_RCC_GET_USART3_SOURCE(); + + /* Check if USART3 clock selection is PCLK1 */ + if (srcclk == RCC_USART3CLKSOURCE_PCLK1) + { + frequency = HAL_RCC_GetPCLK1Freq(); + } + /* Check if HSI is ready and if USART3 clock selection is HSI */ + else if ((srcclk == RCC_USART3CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if USART3 clock selection is SYSCLK */ + else if (srcclk == RCC_USART3CLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + /* Check if LSE is ready and if USART3 clock selection is LSE */ + else if ((srcclk == RCC_USART3CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY))) + { + frequency = LSE_VALUE; + } + break; + } +#endif /* RCC_CFGR3_USART3SW */ +#if defined(RCC_CFGR3_UART4SW) + case RCC_PERIPHCLK_UART4: + { + /* Get the current UART4 source */ + srcclk = __HAL_RCC_GET_UART4_SOURCE(); + + /* Check if UART4 clock selection is PCLK1 */ + if (srcclk == RCC_UART4CLKSOURCE_PCLK1) + { + frequency = HAL_RCC_GetPCLK1Freq(); + } + /* Check if HSI is ready and if UART4 clock selection is HSI */ + else if ((srcclk == RCC_UART4CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if UART4 clock selection is SYSCLK */ + else if (srcclk == RCC_UART4CLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + /* Check if LSE is ready and if UART4 clock selection is LSE */ + else if ((srcclk == RCC_UART4CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY))) + { + frequency = LSE_VALUE; + } + break; + } +#endif /* RCC_CFGR3_UART4SW */ +#if defined(RCC_CFGR3_UART5SW) + case RCC_PERIPHCLK_UART5: + { + /* Get the current UART5 source */ + srcclk = __HAL_RCC_GET_UART5_SOURCE(); + + /* Check if UART5 clock selection is PCLK1 */ + if (srcclk == RCC_UART5CLKSOURCE_PCLK1) + { + frequency = HAL_RCC_GetPCLK1Freq(); + } + /* Check if HSI is ready and if UART5 clock selection is HSI */ + else if ((srcclk == RCC_UART5CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if UART5 clock selection is SYSCLK */ + else if (srcclk == RCC_UART5CLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + /* Check if LSE is ready and if UART5 clock selection is LSE */ + else if ((srcclk == RCC_UART5CLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY))) + { + frequency = LSE_VALUE; + } + break; + } +#endif /* RCC_CFGR3_UART5SW */ + case RCC_PERIPHCLK_I2C1: + { + /* Get the current I2C1 source */ + srcclk = __HAL_RCC_GET_I2C1_SOURCE(); + + /* Check if HSI is ready and if I2C1 clock selection is HSI */ + if ((srcclk == RCC_I2C1CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if I2C1 clock selection is SYSCLK */ + else if (srcclk == RCC_I2C1CLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + break; + } +#if defined(RCC_CFGR3_I2C2SW) + case RCC_PERIPHCLK_I2C2: + { + /* Get the current I2C2 source */ + srcclk = __HAL_RCC_GET_I2C2_SOURCE(); + + /* Check if HSI is ready and if I2C2 clock selection is HSI */ + if ((srcclk == RCC_I2C2CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if I2C2 clock selection is SYSCLK */ + else if (srcclk == RCC_I2C2CLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + break; + } +#endif /* RCC_CFGR3_I2C2SW */ +#if defined(RCC_CFGR3_I2C3SW) + case RCC_PERIPHCLK_I2C3: + { + /* Get the current I2C3 source */ + srcclk = __HAL_RCC_GET_I2C3_SOURCE(); + + /* Check if HSI is ready and if I2C3 clock selection is HSI */ + if ((srcclk == RCC_I2C3CLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if I2C3 clock selection is SYSCLK */ + else if (srcclk == RCC_I2C3CLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + break; + } +#endif /* RCC_CFGR3_I2C3SW */ +#if defined(RCC_CFGR_I2SSRC) + case RCC_PERIPHCLK_I2S: + { + /* Get the current I2S source */ + srcclk = __HAL_RCC_GET_I2S_SOURCE(); + + /* Check if I2S clock selection is External clock mapped on the I2S_CKIN pin */ + if (srcclk == RCC_I2SCLKSOURCE_EXT) + { + /* External clock used. Frequency cannot be returned.*/ + frequency = 0xDEADDEADU; + } + /* Check if I2S clock selection is SYSCLK */ + else if (srcclk == RCC_I2SCLKSOURCE_SYSCLK) + { + frequency = HAL_RCC_GetSysClockFreq(); + } + break; + } +#endif /* RCC_CFGR_I2SSRC */ +#if defined(RCC_CFGR_USBPRE) + case RCC_PERIPHCLK_USB: + { + /* Check if PLL is ready */ + if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY)) + { + /* Get the current USB source */ + srcclk = __HAL_RCC_GET_USB_SOURCE(); + + /* Check if USB clock selection is not divided */ + if (srcclk == RCC_USBCLKSOURCE_PLL) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if USB clock selection is divided by 1.5 */ + else /* RCC_USBCLKSOURCE_PLL_DIV1_5 */ + { + frequency = (RCC_GetPLLCLKFreq() * 3U) / 2U; + } + } + break; + } +#endif /* RCC_CFGR_USBPRE */ +#if defined(RCC_CFGR2_ADC1PRES) || defined(RCC_CFGR_ADCPRE) + case RCC_PERIPHCLK_ADC1: + { + /* Get the current ADC1 source */ + srcclk = __HAL_RCC_GET_ADC1_SOURCE(); +#if defined(RCC_CFGR2_ADC1PRES) + /* Check if ADC1 clock selection is AHB */ + if (srcclk == RCC_ADC1PLLCLK_OFF) + { + frequency = SystemCoreClock; + } + /* PLL clock has been selected */ + else + { + /* Check if PLL is ready */ + if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY)) + { + /* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6U/8U/10U/12U/16U/32U/64U/128U/256U) */ + frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> POSITION_VAL(RCC_CFGR2_ADC1PRES)) & 0xFU]; + } + } +#else /* RCC_CFGR_ADCPRE */ + /* ADC1 is set to PLCK2 frequency divided by 2U/4U/6U/8U */ + frequency = HAL_RCC_GetPCLK2Freq() / (((srcclk >> POSITION_VAL(RCC_CFGR_ADCPRE)) + 1U) * 2U); +#endif /* RCC_CFGR2_ADC1PRES */ + break; + } +#endif /* RCC_CFGR2_ADC1PRES || RCC_CFGR_ADCPRE */ +#if defined(RCC_CFGR2_ADCPRE12) + case RCC_PERIPHCLK_ADC12: + { + /* Get the current ADC12 source */ + srcclk = __HAL_RCC_GET_ADC12_SOURCE(); + /* Check if ADC12 clock selection is AHB */ + if (srcclk == RCC_ADC12PLLCLK_OFF) + { + frequency = SystemCoreClock; + } + /* PLL clock has been selected */ + else + { + /* Check if PLL is ready */ + if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY)) + { + /* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6/8U/10U/12U/16U/32U/64U/128U/256U) */ + frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> POSITION_VAL(RCC_CFGR2_ADCPRE12)) & 0xF]; + } + } + break; + } +#endif /* RCC_CFGR2_ADCPRE12 */ +#if defined(RCC_CFGR2_ADCPRE34) + case RCC_PERIPHCLK_ADC34: + { + /* Get the current ADC34 source */ + srcclk = __HAL_RCC_GET_ADC34_SOURCE(); + /* Check if ADC34 clock selection is AHB */ + if (srcclk == RCC_ADC34PLLCLK_OFF) + { + frequency = SystemCoreClock; + } + /* PLL clock has been selected */ + else + { + /* Check if PLL is ready */ + if (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY)) + { + /* Frequency is the PLL frequency divided by ADC prescaler (1U/2U/4U/6U/8U/10U/12U/16U/32U/64U/128U/256U) */ + frequency = RCC_GetPLLCLKFreq() / adc_pll_prediv_table[(srcclk >> POSITION_VAL(RCC_CFGR2_ADCPRE34)) & 0xF]; + } + } + break; + } +#endif /* RCC_CFGR2_ADCPRE34 */ +#if defined(RCC_CFGR3_TIM1SW) + case RCC_PERIPHCLK_TIM1: + { + /* Get the current TIM1 source */ + srcclk = __HAL_RCC_GET_TIM1_SOURCE(); + + /* Check if PLL is ready and if TIM1 clock selection is PLL */ + if ((srcclk == RCC_TIM1CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if TIM1 clock selection is SYSCLK */ + else if (srcclk == RCC_TIM1CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_TIM1SW */ +#if defined(RCC_CFGR3_TIM2SW) + case RCC_PERIPHCLK_TIM2: + { + /* Get the current TIM2 source */ + srcclk = __HAL_RCC_GET_TIM2_SOURCE(); + + /* Check if PLL is ready and if TIM2 clock selection is PLL */ + if ((srcclk == RCC_TIM2CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if TIM2 clock selection is SYSCLK */ + else if (srcclk == RCC_TIM2CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_TIM2SW */ +#if defined(RCC_CFGR3_TIM8SW) + case RCC_PERIPHCLK_TIM8: + { + /* Get the current TIM8 source */ + srcclk = __HAL_RCC_GET_TIM8_SOURCE(); + + /* Check if PLL is ready and if TIM8 clock selection is PLL */ + if ((srcclk == RCC_TIM8CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if TIM8 clock selection is SYSCLK */ + else if (srcclk == RCC_TIM8CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_TIM8SW */ +#if defined(RCC_CFGR3_TIM15SW) + case RCC_PERIPHCLK_TIM15: + { + /* Get the current TIM15 source */ + srcclk = __HAL_RCC_GET_TIM15_SOURCE(); + + /* Check if PLL is ready and if TIM15 clock selection is PLL */ + if ((srcclk == RCC_TIM15CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if TIM15 clock selection is SYSCLK */ + else if (srcclk == RCC_TIM15CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_TIM15SW */ +#if defined(RCC_CFGR3_TIM16SW) + case RCC_PERIPHCLK_TIM16: + { + /* Get the current TIM16 source */ + srcclk = __HAL_RCC_GET_TIM16_SOURCE(); + + /* Check if PLL is ready and if TIM16 clock selection is PLL */ + if ((srcclk == RCC_TIM16CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if TIM16 clock selection is SYSCLK */ + else if (srcclk == RCC_TIM16CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_TIM16SW */ +#if defined(RCC_CFGR3_TIM17SW) + case RCC_PERIPHCLK_TIM17: + { + /* Get the current TIM17 source */ + srcclk = __HAL_RCC_GET_TIM17_SOURCE(); + + /* Check if PLL is ready and if TIM17 clock selection is PLL */ + if ((srcclk == RCC_TIM17CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if TIM17 clock selection is SYSCLK */ + else if (srcclk == RCC_TIM17CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_TIM17SW */ +#if defined(RCC_CFGR3_TIM20SW) + case RCC_PERIPHCLK_TIM20: + { + /* Get the current TIM20 source */ + srcclk = __HAL_RCC_GET_TIM20_SOURCE(); + + /* Check if PLL is ready and if TIM20 clock selection is PLL */ + if ((srcclk == RCC_TIM20CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if TIM20 clock selection is SYSCLK */ + else if (srcclk == RCC_TIM20CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_TIM20SW */ +#if defined(RCC_CFGR3_TIM34SW) + case RCC_PERIPHCLK_TIM34: + { + /* Get the current TIM34 source */ + srcclk = __HAL_RCC_GET_TIM34_SOURCE(); + + /* Check if PLL is ready and if TIM34 clock selection is PLL */ + if ((srcclk == RCC_TIM34CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if TIM34 clock selection is SYSCLK */ + else if (srcclk == RCC_TIM34CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_TIM34SW */ +#if defined(RCC_CFGR3_HRTIM1SW) + case RCC_PERIPHCLK_HRTIM1: + { + /* Get the current HRTIM1 source */ + srcclk = __HAL_RCC_GET_HRTIM1_SOURCE(); + + /* Check if PLL is ready and if HRTIM1 clock selection is PLL */ + if ((srcclk == RCC_HRTIM1CLK_PLLCLK) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_PLLRDY))) + { + frequency = RCC_GetPLLCLKFreq(); + } + /* Check if HRTIM1 clock selection is SYSCLK */ + else if (srcclk == RCC_HRTIM1CLK_HCLK) + { + frequency = SystemCoreClock; + } + break; + } +#endif /* RCC_CFGR3_HRTIM1SW */ +#if defined(RCC_CFGR_SDPRE) + case RCC_PERIPHCLK_SDADC: + { + /* Get the current SDADC source */ + srcclk = __HAL_RCC_GET_SDADC_SOURCE(); + /* Frequency is the system frequency divided by SDADC prescaler (2U/4U/6U/8U/10U/12U/14U/16U/20U/24U/28U/32U/36U/40U/44U/48U) */ + frequency = SystemCoreClock / sdadc_prescaler_table[(srcclk >> POSITION_VAL(RCC_CFGR_SDPRE)) & 0xF]; + break; + } +#endif /* RCC_CFGR_SDPRE */ +#if defined(RCC_CFGR3_CECSW) + case RCC_PERIPHCLK_CEC: + { + /* Get the current CEC source */ + srcclk = __HAL_RCC_GET_CEC_SOURCE(); + + /* Check if HSI is ready and if CEC clock selection is HSI */ + if ((srcclk == RCC_CECCLKSOURCE_HSI) && (HAL_IS_BIT_SET(RCC->CR, RCC_CR_HSIRDY))) + { + frequency = HSI_VALUE; + } + /* Check if LSE is ready and if CEC clock selection is LSE */ + else if ((srcclk == RCC_CECCLKSOURCE_LSE) && (HAL_IS_BIT_SET(RCC->BDCR, RCC_BDCR_LSERDY))) + { + frequency = LSE_VALUE; + } + break; + } +#endif /* RCC_CFGR3_CECSW */ + default: + { + break; + } + } + return(frequency); +} + +/** + * @} + */ + +/** + * @} + */ + + +#if defined(RCC_CFGR2_ADC1PRES) || defined(RCC_CFGR2_ADCPRE12) || defined(RCC_CFGR2_ADCPRE34) || defined(RCC_CFGR_USBPRE) \ + || defined(RCC_CFGR3_TIM1SW) || defined(RCC_CFGR3_TIM2SW) || defined(RCC_CFGR3_TIM8SW) || defined(RCC_CFGR3_TIM15SW) \ + || defined(RCC_CFGR3_TIM16SW) || defined(RCC_CFGR3_TIM17SW) || defined(RCC_CFGR3_TIM20SW) || defined(RCC_CFGR3_TIM34SW) \ + || defined(RCC_CFGR3_HRTIM1SW) + +/** @addtogroup RCCEx_Private_Functions + * @{ + */ +static uint32_t RCC_GetPLLCLKFreq(void) +{ + uint32_t pllmul = 0U, pllsource = 0U, prediv = 0U, pllclk = 0U; + + pllmul = RCC->CFGR & RCC_CFGR_PLLMUL; + pllmul = ( pllmul >> 18U) + 2U; + pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; +#if defined(RCC_CFGR_PLLSRC_HSI_DIV2) + if (pllsource != RCC_PLLSOURCE_HSI) + { + prediv = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1U; + /* HSE used as PLL clock source : PLLCLK = HSE/PREDIV * PLLMUL */ + pllclk = (HSE_VALUE/prediv) * pllmul; + } + else + { + /* HSI used as PLL clock source : PLLCLK = HSI/2U * PLLMUL */ + pllclk = (HSI_VALUE >> 1U) * pllmul; + } +#else + prediv = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1U; + if (pllsource == RCC_CFGR_PLLSRC_HSE_PREDIV) + { + /* HSE used as PLL clock source : PLLCLK = HSE/PREDIV * PLLMUL */ + pllclk = (HSE_VALUE/prediv) * pllmul; + } + else + { + /* HSI used as PLL clock source : PLLCLK = HSI/PREDIV * PLLMUL */ + pllclk = (HSI_VALUE/prediv) * pllmul; + } +#endif /* RCC_CFGR_PLLSRC_HSI_DIV2 */ + + return pllclk; +} +/** + * @} + */ + +#endif /* RCC_CFGR2_ADC1PRES || RCC_CFGR2_ADCPRExx || RCC_CFGR3_TIMxSW || RCC_CFGR3_HRTIM1SW || RCC_CFGR_USBPRE */ + +/** + * @} + */ + +#endif /* HAL_RCC_MODULE_ENABLED */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c new file mode 100644 index 0000000..95edbb3 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c @@ -0,0 +1,7934 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_tim.c + * @author MCD Application Team + * @brief TIM HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Timer (TIM) peripheral: + * + TIM Time Base Initialization + * + TIM Time Base Start + * + TIM Time Base Start Interruption + * + TIM Time Base Start DMA + * + TIM Output Compare/PWM Initialization + * + TIM Output Compare/PWM Channel Configuration + * + TIM Output Compare/PWM Start + * + TIM Output Compare/PWM Start Interruption + * + TIM Output Compare/PWM Start DMA + * + TIM Input Capture Initialization + * + TIM Input Capture Channel Configuration + * + TIM Input Capture Start + * + TIM Input Capture Start Interruption + * + TIM Input Capture Start DMA + * + TIM One Pulse Initialization + * + TIM One Pulse Channel Configuration + * + TIM One Pulse Start + * + TIM Encoder Interface Initialization + * + TIM Encoder Interface Start + * + TIM Encoder Interface Start Interruption + * + TIM Encoder Interface Start DMA + * + Commutation Event configuration with Interruption and DMA + * + TIM OCRef clear configuration + * + TIM External Clock configuration + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### TIMER Generic features ##### + ============================================================================== + [..] The Timer features include: + (#) 16-bit up, down, up/down auto-reload counter. + (#) 16-bit programmable prescaler allowing dividing (also on the fly) the + counter clock frequency either by any factor between 1 and 65536. + (#) Up to 4 independent channels for: + (++) Input Capture + (++) Output Compare + (++) PWM generation (Edge and Center-aligned Mode) + (++) One-pulse mode output + (#) Synchronization circuit to control the timer with external signals and to interconnect + several timers together. + (#) Supports incremental encoder for positioning purposes + + ##### How to use this driver ##### + ============================================================================== + [..] + (#) Initialize the TIM low level resources by implementing the following functions + depending on the selected feature: + (++) Time Base : HAL_TIM_Base_MspInit() + (++) Input Capture : HAL_TIM_IC_MspInit() + (++) Output Compare : HAL_TIM_OC_MspInit() + (++) PWM generation : HAL_TIM_PWM_MspInit() + (++) One-pulse mode output : HAL_TIM_OnePulse_MspInit() + (++) Encoder mode output : HAL_TIM_Encoder_MspInit() + + (#) Initialize the TIM low level resources : + (##) Enable the TIM interface clock using __HAL_RCC_TIMx_CLK_ENABLE(); + (##) TIM pins configuration + (+++) Enable the clock for the TIM GPIOs using the following function: + __HAL_RCC_GPIOx_CLK_ENABLE(); + (+++) Configure these TIM pins in Alternate function mode using HAL_GPIO_Init(); + + (#) The external Clock can be configured, if needed (the default clock is the + internal clock from the APBx), using the following function: + HAL_TIM_ConfigClockSource, the clock configuration should be done before + any start function. + + (#) Configure the TIM in the desired functioning mode using one of the + Initialization function of this driver: + (++) HAL_TIM_Base_Init: to use the Timer to generate a simple time base + (++) HAL_TIM_OC_Init and HAL_TIM_OC_ConfigChannel: to use the Timer to generate an + Output Compare signal. + (++) HAL_TIM_PWM_Init and HAL_TIM_PWM_ConfigChannel: to use the Timer to generate a + PWM signal. + (++) HAL_TIM_IC_Init and HAL_TIM_IC_ConfigChannel: to use the Timer to measure an + external signal. + (++) HAL_TIM_OnePulse_Init and HAL_TIM_OnePulse_ConfigChannel: to use the Timer + in One Pulse Mode. + (++) HAL_TIM_Encoder_Init: to use the Timer Encoder Interface. + + (#) Activate the TIM peripheral using one of the start functions depending from the feature used: + (++) Time Base : HAL_TIM_Base_Start(), HAL_TIM_Base_Start_DMA(), HAL_TIM_Base_Start_IT() + (++) Input Capture : HAL_TIM_IC_Start(), HAL_TIM_IC_Start_DMA(), HAL_TIM_IC_Start_IT() + (++) Output Compare : HAL_TIM_OC_Start(), HAL_TIM_OC_Start_DMA(), HAL_TIM_OC_Start_IT() + (++) PWM generation : HAL_TIM_PWM_Start(), HAL_TIM_PWM_Start_DMA(), HAL_TIM_PWM_Start_IT() + (++) One-pulse mode output : HAL_TIM_OnePulse_Start(), HAL_TIM_OnePulse_Start_IT() + (++) Encoder mode output : HAL_TIM_Encoder_Start(), HAL_TIM_Encoder_Start_DMA(), HAL_TIM_Encoder_Start_IT(). + + (#) The DMA Burst is managed with the two following functions: + HAL_TIM_DMABurst_WriteStart() + HAL_TIM_DMABurst_ReadStart() + + *** Callback registration *** + ============================================= + + [..] + The compilation define USE_HAL_TIM_REGISTER_CALLBACKS when set to 1 + allows the user to configure dynamically the driver callbacks. + + [..] + Use Function HAL_TIM_RegisterCallback() to register a callback. + HAL_TIM_RegisterCallback() takes as parameters the HAL peripheral handle, + the Callback ID and a pointer to the user callback function. + + [..] + Use function HAL_TIM_UnRegisterCallback() to reset a callback to the default + weak function. + HAL_TIM_UnRegisterCallback takes as parameters the HAL peripheral handle, + and the Callback ID. + + [..] + These functions allow to register/unregister following callbacks: + (+) Base_MspInitCallback : TIM Base Msp Init Callback. + (+) Base_MspDeInitCallback : TIM Base Msp DeInit Callback. + (+) IC_MspInitCallback : TIM IC Msp Init Callback. + (+) IC_MspDeInitCallback : TIM IC Msp DeInit Callback. + (+) OC_MspInitCallback : TIM OC Msp Init Callback. + (+) OC_MspDeInitCallback : TIM OC Msp DeInit Callback. + (+) PWM_MspInitCallback : TIM PWM Msp Init Callback. + (+) PWM_MspDeInitCallback : TIM PWM Msp DeInit Callback. + (+) OnePulse_MspInitCallback : TIM One Pulse Msp Init Callback. + (+) OnePulse_MspDeInitCallback : TIM One Pulse Msp DeInit Callback. + (+) Encoder_MspInitCallback : TIM Encoder Msp Init Callback. + (+) Encoder_MspDeInitCallback : TIM Encoder Msp DeInit Callback. + (+) HallSensor_MspInitCallback : TIM Hall Sensor Msp Init Callback. + (+) HallSensor_MspDeInitCallback : TIM Hall Sensor Msp DeInit Callback. + (+) PeriodElapsedCallback : TIM Period Elapsed Callback. + (+) PeriodElapsedHalfCpltCallback : TIM Period Elapsed half complete Callback. + (+) TriggerCallback : TIM Trigger Callback. + (+) TriggerHalfCpltCallback : TIM Trigger half complete Callback. + (+) IC_CaptureCallback : TIM Input Capture Callback. + (+) IC_CaptureHalfCpltCallback : TIM Input Capture half complete Callback. + (+) OC_DelayElapsedCallback : TIM Output Compare Delay Elapsed Callback. + (+) PWM_PulseFinishedCallback : TIM PWM Pulse Finished Callback. + (+) PWM_PulseFinishedHalfCpltCallback : TIM PWM Pulse Finished half complete Callback. + (+) ErrorCallback : TIM Error Callback. + (+) CommutationCallback : TIM Commutation Callback. + (+) CommutationHalfCpltCallback : TIM Commutation half complete Callback. + (+) BreakCallback : TIM Break Callback. + (+) Break2Callback : TIM Break2 Callback (when supported). + + [..] +By default, after the Init and when the state is HAL_TIM_STATE_RESET +all interrupt callbacks are set to the corresponding weak functions: + examples HAL_TIM_TriggerCallback(), HAL_TIM_ErrorCallback(). + + [..] + Exception done for MspInit and MspDeInit functions that are reset to the legacy weak + functionalities in the Init / DeInit only when these callbacks are null + (not registered beforehand). If not, MspInit or MspDeInit are not null, the Init / DeInit + keep and use the user MspInit / MspDeInit callbacks(registered beforehand) + + [..] + Callbacks can be registered / unregistered in HAL_TIM_STATE_READY state only. + Exception done MspInit / MspDeInit that can be registered / unregistered + in HAL_TIM_STATE_READY or HAL_TIM_STATE_RESET state, + thus registered(user) MspInit / DeInit callbacks can be used during the Init / DeInit. + In that case first register the MspInit/MspDeInit user callbacks + using HAL_TIM_RegisterCallback() before calling DeInit or Init function. + + [..] + When The compilation define USE_HAL_TIM_REGISTER_CALLBACKS is set to 0 or + not defined, the callback registration feature is not available and all callbacks + are set to the corresponding weak functions. + + @endverbatim + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup TIM TIM + * @brief TIM HAL module driver + * @{ + */ + +#ifdef HAL_TIM_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/** @addtogroup TIM_Private_Functions + * @{ + */ +static void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config); +static void TIM_OC3_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config); +static void TIM_OC4_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config); +#if defined(TIM_CCER_CC5E) +static void TIM_OC5_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config); +#endif /* TIM_CCER_CC5E */ +#if defined(TIM_CCER_CC6E) +static void TIM_OC6_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config); +#endif /* TIM_CCER_CC6E */ +static void TIM_TI1_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter); +static void TIM_TI2_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, + uint32_t TIM_ICFilter); +static void TIM_TI2_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter); +static void TIM_TI3_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, + uint32_t TIM_ICFilter); +static void TIM_TI4_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, + uint32_t TIM_ICFilter); +static void TIM_ITRx_SetConfig(TIM_TypeDef *TIMx, uint32_t InputTriggerSource); +static void TIM_DMAPeriodElapsedCplt(DMA_HandleTypeDef *hdma); +static void TIM_DMAPeriodElapsedHalfCplt(DMA_HandleTypeDef *hdma); +static void TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma); +static void TIM_DMATriggerCplt(DMA_HandleTypeDef *hdma); +static void TIM_DMATriggerHalfCplt(DMA_HandleTypeDef *hdma); +static HAL_StatusTypeDef TIM_SlaveTimer_SetConfig(TIM_HandleTypeDef *htim, + const TIM_SlaveConfigTypeDef *sSlaveConfig); +/** + * @} + */ +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup TIM_Exported_Functions TIM Exported Functions + * @{ + */ + +/** @defgroup TIM_Exported_Functions_Group1 TIM Time Base functions + * @brief Time Base functions + * +@verbatim + ============================================================================== + ##### Time Base functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Initialize and configure the TIM base. + (+) De-initialize the TIM base. + (+) Start the Time Base. + (+) Stop the Time Base. + (+) Start the Time Base and enable interrupt. + (+) Stop the Time Base and disable interrupt. + (+) Start the Time Base and enable DMA transfer. + (+) Stop the Time Base and disable DMA transfer. + +@endverbatim + * @{ + */ +/** + * @brief Initializes the TIM Time base Unit according to the specified + * parameters in the TIM_HandleTypeDef and initialize the associated handle. + * @note Switching from Center Aligned counter mode to Edge counter mode (or reverse) + * requires a timer reset to avoid unexpected direction + * due to DIR bit readonly in center aligned mode. + * Ex: call @ref HAL_TIM_Base_DeInit() before HAL_TIM_Base_Init() + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Init(TIM_HandleTypeDef *htim) +{ + /* Check the TIM handle allocation */ + if (htim == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode)); + assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); + assert_param(IS_TIM_PERIOD(htim, htim->Init.Period)); + assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload)); + + if (htim->State == HAL_TIM_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + /* Reset interrupt callbacks to legacy weak callbacks */ + TIM_ResetCallback(htim); + + if (htim->Base_MspInitCallback == NULL) + { + htim->Base_MspInitCallback = HAL_TIM_Base_MspInit; + } + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + htim->Base_MspInitCallback(htim); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + HAL_TIM_Base_MspInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Set the Time Base configuration */ + TIM_Base_SetConfig(htim->Instance, &htim->Init); + + /* Initialize the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + + /* Initialize the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + + /* Initialize the TIM state*/ + htim->State = HAL_TIM_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the TIM Base peripheral + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_DeInit(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Disable the TIM Peripheral Clock */ + __HAL_TIM_DISABLE(htim); + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + if (htim->Base_MspDeInitCallback == NULL) + { + htim->Base_MspDeInitCallback = HAL_TIM_Base_MspDeInit; + } + /* DeInit the low level hardware */ + htim->Base_MspDeInitCallback(htim); +#else + /* DeInit the low level hardware: GPIO, CLOCK, NVIC */ + HAL_TIM_Base_MspDeInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_RESET; + + /* Change the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_RESET); + + /* Change TIM state */ + htim->State = HAL_TIM_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Initializes the TIM Base MSP. + * @param htim TIM Base handle + * @retval None + */ +__weak void HAL_TIM_Base_MspInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_Base_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes TIM Base MSP. + * @param htim TIM Base handle + * @retval None + */ +__weak void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_Base_MspDeInit could be implemented in the user file + */ +} + + +/** + * @brief Starts the TIM Base generation. + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Start(TIM_HandleTypeDef *htim) +{ + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + /* Check the TIM state */ + if (htim->State != HAL_TIM_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Base generation. + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Stop(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_READY; + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Base generation in interrupt mode. + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Start_IT(TIM_HandleTypeDef *htim) +{ + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + /* Check the TIM state */ + if (htim->State != HAL_TIM_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Enable the TIM Update interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_UPDATE); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Base generation in interrupt mode. + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Stop_IT(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + /* Disable the TIM Update interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_UPDATE); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_READY; + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Base generation in DMA mode. + * @param htim TIM Base handle + * @param pData The source Buffer address. + * @param Length The length of data to be transferred from memory to peripheral. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Start_DMA(TIM_HandleTypeDef *htim, const uint32_t *pData, uint16_t Length) +{ + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_DMA_INSTANCE(htim->Instance)); + + /* Set the TIM state */ + if (htim->State == HAL_TIM_STATE_BUSY) + { + return HAL_BUSY; + } + else if (htim->State == HAL_TIM_STATE_READY) + { + if ((pData == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + htim->State = HAL_TIM_STATE_BUSY; + } + } + else + { + return HAL_ERROR; + } + + /* Set the DMA Period elapsed callbacks */ + htim->hdma[TIM_DMA_ID_UPDATE]->XferCpltCallback = TIM_DMAPeriodElapsedCplt; + htim->hdma[TIM_DMA_ID_UPDATE]->XferHalfCpltCallback = TIM_DMAPeriodElapsedHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_UPDATE], (uint32_t)pData, (uint32_t)&htim->Instance->ARR, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + + /* Enable the TIM Update DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_UPDATE); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Base generation in DMA mode. + * @param htim TIM Base handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Base_Stop_DMA(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_DMA_INSTANCE(htim->Instance)); + + /* Disable the TIM Update DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_UPDATE); + + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_UPDATE]); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_READY; + + /* Return function status */ + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group2 TIM Output Compare functions + * @brief TIM Output Compare functions + * +@verbatim + ============================================================================== + ##### TIM Output Compare functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Initialize and configure the TIM Output Compare. + (+) De-initialize the TIM Output Compare. + (+) Start the TIM Output Compare. + (+) Stop the TIM Output Compare. + (+) Start the TIM Output Compare and enable interrupt. + (+) Stop the TIM Output Compare and disable interrupt. + (+) Start the TIM Output Compare and enable DMA transfer. + (+) Stop the TIM Output Compare and disable DMA transfer. + +@endverbatim + * @{ + */ +/** + * @brief Initializes the TIM Output Compare according to the specified + * parameters in the TIM_HandleTypeDef and initializes the associated handle. + * @note Switching from Center Aligned counter mode to Edge counter mode (or reverse) + * requires a timer reset to avoid unexpected direction + * due to DIR bit readonly in center aligned mode. + * Ex: call @ref HAL_TIM_OC_DeInit() before HAL_TIM_OC_Init() + * @param htim TIM Output Compare handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_Init(TIM_HandleTypeDef *htim) +{ + /* Check the TIM handle allocation */ + if (htim == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode)); + assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); + assert_param(IS_TIM_PERIOD(htim, htim->Init.Period)); + assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload)); + + if (htim->State == HAL_TIM_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + /* Reset interrupt callbacks to legacy weak callbacks */ + TIM_ResetCallback(htim); + + if (htim->OC_MspInitCallback == NULL) + { + htim->OC_MspInitCallback = HAL_TIM_OC_MspInit; + } + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + htim->OC_MspInitCallback(htim); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ + HAL_TIM_OC_MspInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Init the base time for the Output Compare */ + TIM_Base_SetConfig(htim->Instance, &htim->Init); + + /* Initialize the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + + /* Initialize the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + + /* Initialize the TIM state*/ + htim->State = HAL_TIM_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the TIM peripheral + * @param htim TIM Output Compare handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_DeInit(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Disable the TIM Peripheral Clock */ + __HAL_TIM_DISABLE(htim); + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + if (htim->OC_MspDeInitCallback == NULL) + { + htim->OC_MspDeInitCallback = HAL_TIM_OC_MspDeInit; + } + /* DeInit the low level hardware */ + htim->OC_MspDeInitCallback(htim); +#else + /* DeInit the low level hardware: GPIO, CLOCK, NVIC and DMA */ + HAL_TIM_OC_MspDeInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_RESET; + + /* Change the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_RESET); + + /* Change TIM state */ + htim->State = HAL_TIM_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Initializes the TIM Output Compare MSP. + * @param htim TIM Output Compare handle + * @retval None + */ +__weak void HAL_TIM_OC_MspInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_OC_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes TIM Output Compare MSP. + * @param htim TIM Output Compare handle + * @retval None + */ +__weak void HAL_TIM_OC_MspDeInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_OC_MspDeInit could be implemented in the user file + */ +} + +/** + * @brief Starts the TIM Output Compare signal generation. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_Start(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM channel state */ + if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the Output compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Enable the main output */ + __HAL_TIM_MOE_ENABLE(htim); + } + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Output Compare signal generation. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Disable the Output compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Output Compare signal generation in interrupt mode. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM channel state */ + if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Enable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Enable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Enable the TIM Capture/Compare 3 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Enable the TIM Capture/Compare 4 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the Output compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Enable the main output */ + __HAL_TIM_MOE_ENABLE(htim); + } + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM Output Compare signal generation in interrupt mode. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Capture/Compare 3 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Disable the TIM Capture/Compare 4 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the Output compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @brief Starts the TIM Output Compare signal generation in DMA mode. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @param pData The source Buffer address. + * @param Length The length of data to be transferred from memory to TIM peripheral + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData, + uint16_t Length) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Set the TIM channel state */ + if (TIM_CHANNEL_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_BUSY) + { + return HAL_BUSY; + } + else if (TIM_CHANNEL_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_READY) + { + if ((pData == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + + /* Enable the TIM Capture/Compare 1 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + + /* Enable the TIM Capture/Compare 2 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 3 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)pData, (uint32_t)&htim->Instance->CCR4, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 4 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the Output compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Enable the main output */ + __HAL_TIM_MOE_ENABLE(htim); + } + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM Output Compare signal generation in DMA mode. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Capture/Compare 1 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Capture/Compare 2 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Capture/Compare 3 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC3); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]); + break; + } + + case TIM_CHANNEL_4: + { + /* Disable the TIM Capture/Compare 4 interrupt */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC4); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC4]); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the Output compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group3 TIM PWM functions + * @brief TIM PWM functions + * +@verbatim + ============================================================================== + ##### TIM PWM functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Initialize and configure the TIM PWM. + (+) De-initialize the TIM PWM. + (+) Start the TIM PWM. + (+) Stop the TIM PWM. + (+) Start the TIM PWM and enable interrupt. + (+) Stop the TIM PWM and disable interrupt. + (+) Start the TIM PWM and enable DMA transfer. + (+) Stop the TIM PWM and disable DMA transfer. + +@endverbatim + * @{ + */ +/** + * @brief Initializes the TIM PWM Time Base according to the specified + * parameters in the TIM_HandleTypeDef and initializes the associated handle. + * @note Switching from Center Aligned counter mode to Edge counter mode (or reverse) + * requires a timer reset to avoid unexpected direction + * due to DIR bit readonly in center aligned mode. + * Ex: call @ref HAL_TIM_PWM_DeInit() before HAL_TIM_PWM_Init() + * @param htim TIM PWM handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_Init(TIM_HandleTypeDef *htim) +{ + /* Check the TIM handle allocation */ + if (htim == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode)); + assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); + assert_param(IS_TIM_PERIOD(htim, htim->Init.Period)); + assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload)); + + if (htim->State == HAL_TIM_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + /* Reset interrupt callbacks to legacy weak callbacks */ + TIM_ResetCallback(htim); + + if (htim->PWM_MspInitCallback == NULL) + { + htim->PWM_MspInitCallback = HAL_TIM_PWM_MspInit; + } + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + htim->PWM_MspInitCallback(htim); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ + HAL_TIM_PWM_MspInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Init the base time for the PWM */ + TIM_Base_SetConfig(htim->Instance, &htim->Init); + + /* Initialize the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + + /* Initialize the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + + /* Initialize the TIM state*/ + htim->State = HAL_TIM_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the TIM peripheral + * @param htim TIM PWM handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_DeInit(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Disable the TIM Peripheral Clock */ + __HAL_TIM_DISABLE(htim); + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + if (htim->PWM_MspDeInitCallback == NULL) + { + htim->PWM_MspDeInitCallback = HAL_TIM_PWM_MspDeInit; + } + /* DeInit the low level hardware */ + htim->PWM_MspDeInitCallback(htim); +#else + /* DeInit the low level hardware: GPIO, CLOCK, NVIC and DMA */ + HAL_TIM_PWM_MspDeInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_RESET; + + /* Change the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_RESET); + + /* Change TIM state */ + htim->State = HAL_TIM_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Initializes the TIM PWM MSP. + * @param htim TIM PWM handle + * @retval None + */ +__weak void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_PWM_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes TIM PWM MSP. + * @param htim TIM PWM handle + * @retval None + */ +__weak void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_PWM_MspDeInit could be implemented in the user file + */ +} + +/** + * @brief Starts the PWM signal generation. + * @param htim TIM handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_Start(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM channel state */ + if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Enable the main output */ + __HAL_TIM_MOE_ENABLE(htim); + } + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the PWM signal generation. + * @param htim TIM PWM handle + * @param Channel TIM Channels to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Disable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the PWM signal generation in interrupt mode. + * @param htim TIM PWM handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM channel state */ + if (TIM_CHANNEL_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Enable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Enable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Enable the TIM Capture/Compare 3 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Enable the TIM Capture/Compare 4 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Enable the main output */ + __HAL_TIM_MOE_ENABLE(htim); + } + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the PWM signal generation in interrupt mode. + * @param htim TIM PWM handle + * @param Channel TIM Channels to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Capture/Compare 3 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Disable the TIM Capture/Compare 4 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @brief Starts the TIM PWM signal generation in DMA mode. + * @param htim TIM PWM handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @param pData The source Buffer address. + * @param Length The length of data to be transferred from memory to TIM peripheral + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData, + uint16_t Length) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Set the TIM channel state */ + if (TIM_CHANNEL_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_BUSY) + { + return HAL_BUSY; + } + else if (TIM_CHANNEL_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_READY) + { + if ((pData == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + + /* Enable the TIM Capture/Compare 1 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 2 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Output Capture/Compare 3 request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)pData, (uint32_t)&htim->Instance->CCR4, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 4 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Enable the main output */ + __HAL_TIM_MOE_ENABLE(htim); + } + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM PWM signal generation in DMA mode. + * @param htim TIM PWM handle + * @param Channel TIM Channels to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Capture/Compare 1 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Capture/Compare 2 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Capture/Compare 3 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC3); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]); + break; + } + + case TIM_CHANNEL_4: + { + /* Disable the TIM Capture/Compare 4 interrupt */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC4); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC4]); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group4 TIM Input Capture functions + * @brief TIM Input Capture functions + * +@verbatim + ============================================================================== + ##### TIM Input Capture functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Initialize and configure the TIM Input Capture. + (+) De-initialize the TIM Input Capture. + (+) Start the TIM Input Capture. + (+) Stop the TIM Input Capture. + (+) Start the TIM Input Capture and enable interrupt. + (+) Stop the TIM Input Capture and disable interrupt. + (+) Start the TIM Input Capture and enable DMA transfer. + (+) Stop the TIM Input Capture and disable DMA transfer. + +@endverbatim + * @{ + */ +/** + * @brief Initializes the TIM Input Capture Time base according to the specified + * parameters in the TIM_HandleTypeDef and initializes the associated handle. + * @note Switching from Center Aligned counter mode to Edge counter mode (or reverse) + * requires a timer reset to avoid unexpected direction + * due to DIR bit readonly in center aligned mode. + * Ex: call @ref HAL_TIM_IC_DeInit() before HAL_TIM_IC_Init() + * @param htim TIM Input Capture handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_Init(TIM_HandleTypeDef *htim) +{ + /* Check the TIM handle allocation */ + if (htim == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode)); + assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); + assert_param(IS_TIM_PERIOD(htim, htim->Init.Period)); + assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload)); + + if (htim->State == HAL_TIM_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + /* Reset interrupt callbacks to legacy weak callbacks */ + TIM_ResetCallback(htim); + + if (htim->IC_MspInitCallback == NULL) + { + htim->IC_MspInitCallback = HAL_TIM_IC_MspInit; + } + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + htim->IC_MspInitCallback(htim); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ + HAL_TIM_IC_MspInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Init the base time for the input capture */ + TIM_Base_SetConfig(htim->Instance, &htim->Init); + + /* Initialize the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + + /* Initialize the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_READY); + + /* Initialize the TIM state*/ + htim->State = HAL_TIM_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the TIM peripheral + * @param htim TIM Input Capture handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_DeInit(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Disable the TIM Peripheral Clock */ + __HAL_TIM_DISABLE(htim); + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + if (htim->IC_MspDeInitCallback == NULL) + { + htim->IC_MspDeInitCallback = HAL_TIM_IC_MspDeInit; + } + /* DeInit the low level hardware */ + htim->IC_MspDeInitCallback(htim); +#else + /* DeInit the low level hardware: GPIO, CLOCK, NVIC and DMA */ + HAL_TIM_IC_MspDeInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_RESET; + + /* Change the TIM channels state */ + TIM_CHANNEL_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET_ALL(htim, HAL_TIM_CHANNEL_STATE_RESET); + + /* Change TIM state */ + htim->State = HAL_TIM_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Initializes the TIM Input Capture MSP. + * @param htim TIM Input Capture handle + * @retval None + */ +__weak void HAL_TIM_IC_MspInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_IC_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes TIM Input Capture MSP. + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_IC_MspDeInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_IC_MspDeInit could be implemented in the user file + */ +} + +/** + * @brief Starts the TIM Input Capture measurement. + * @param htim TIM Input Capture handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_Start(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + uint32_t tmpsmcr; + HAL_TIM_ChannelStateTypeDef channel_state = TIM_CHANNEL_STATE_GET(htim, Channel); + HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel); + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM channel state */ + if ((channel_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the Input Capture channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Input Capture measurement. + * @param htim TIM Input Capture handle + * @param Channel TIM Channels to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Disable the Input Capture channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Input Capture measurement in interrupt mode. + * @param htim TIM Input Capture handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + HAL_TIM_ChannelStateTypeDef channel_state = TIM_CHANNEL_STATE_GET(htim, Channel); + HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel); + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM channel state */ + if ((channel_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Enable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Enable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Enable the TIM Capture/Compare 3 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Enable the TIM Capture/Compare 4 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the Input Capture channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM Input Capture measurement in interrupt mode. + * @param htim TIM Input Capture handle + * @param Channel TIM Channels to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Capture/Compare 3 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Disable the TIM Capture/Compare 4 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the Input Capture channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @brief Starts the TIM Input Capture measurement in DMA mode. + * @param htim TIM Input Capture handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @param pData The destination Buffer address. + * @param Length The length of data to be transferred from TIM peripheral to memory. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + HAL_TIM_ChannelStateTypeDef channel_state = TIM_CHANNEL_STATE_GET(htim, Channel); + HAL_TIM_ChannelStateTypeDef complementary_channel_state = TIM_CHANNEL_N_STATE_GET(htim, Channel); + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance)); + + /* Set the TIM channel state */ + if ((channel_state == HAL_TIM_CHANNEL_STATE_BUSY) + || (complementary_channel_state == HAL_TIM_CHANNEL_STATE_BUSY)) + { + return HAL_BUSY; + } + else if ((channel_state == HAL_TIM_CHANNEL_STATE_READY) + && (complementary_channel_state == HAL_TIM_CHANNEL_STATE_READY)) + { + if ((pData == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + + /* Enable the Input Capture channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_ENABLE); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 1 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->CCR2, (uint32_t)pData, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 2 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)&htim->Instance->CCR3, (uint32_t)pData, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 3 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC3); + break; + } + + case TIM_CHANNEL_4: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)&htim->Instance->CCR4, (uint32_t)pData, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 4 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC4); + break; + } + + default: + status = HAL_ERROR; + break; + } + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM Input Capture measurement in DMA mode. + * @param htim TIM Input Capture handle + * @param Channel TIM Channels to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + assert_param(IS_TIM_DMA_CC_INSTANCE(htim->Instance)); + + /* Disable the Input Capture channel */ + TIM_CCxChannelCmd(htim->Instance, Channel, TIM_CCx_DISABLE); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Capture/Compare 1 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Capture/Compare 2 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Capture/Compare 3 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC3); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]); + break; + } + + case TIM_CHANNEL_4: + { + /* Disable the TIM Capture/Compare 4 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC4); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC4]); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group5 TIM One Pulse functions + * @brief TIM One Pulse functions + * +@verbatim + ============================================================================== + ##### TIM One Pulse functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Initialize and configure the TIM One Pulse. + (+) De-initialize the TIM One Pulse. + (+) Start the TIM One Pulse. + (+) Stop the TIM One Pulse. + (+) Start the TIM One Pulse and enable interrupt. + (+) Stop the TIM One Pulse and disable interrupt. + (+) Start the TIM One Pulse and enable DMA transfer. + (+) Stop the TIM One Pulse and disable DMA transfer. + +@endverbatim + * @{ + */ +/** + * @brief Initializes the TIM One Pulse Time Base according to the specified + * parameters in the TIM_HandleTypeDef and initializes the associated handle. + * @note Switching from Center Aligned counter mode to Edge counter mode (or reverse) + * requires a timer reset to avoid unexpected direction + * due to DIR bit readonly in center aligned mode. + * Ex: call @ref HAL_TIM_OnePulse_DeInit() before HAL_TIM_OnePulse_Init() + * @note When the timer instance is initialized in One Pulse mode, timer + * channels 1 and channel 2 are reserved and cannot be used for other + * purpose. + * @param htim TIM One Pulse handle + * @param OnePulseMode Select the One pulse mode. + * This parameter can be one of the following values: + * @arg TIM_OPMODE_SINGLE: Only one pulse will be generated. + * @arg TIM_OPMODE_REPETITIVE: Repetitive pulses will be generated. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OnePulse_Init(TIM_HandleTypeDef *htim, uint32_t OnePulseMode) +{ + /* Check the TIM handle allocation */ + if (htim == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode)); + assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); + assert_param(IS_TIM_OPM_MODE(OnePulseMode)); + assert_param(IS_TIM_PERIOD(htim, htim->Init.Period)); + assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload)); + + if (htim->State == HAL_TIM_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + /* Reset interrupt callbacks to legacy weak callbacks */ + TIM_ResetCallback(htim); + + if (htim->OnePulse_MspInitCallback == NULL) + { + htim->OnePulse_MspInitCallback = HAL_TIM_OnePulse_MspInit; + } + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + htim->OnePulse_MspInitCallback(htim); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ + HAL_TIM_OnePulse_MspInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Configure the Time base in the One Pulse Mode */ + TIM_Base_SetConfig(htim->Instance, &htim->Init); + + /* Reset the OPM Bit */ + htim->Instance->CR1 &= ~TIM_CR1_OPM; + + /* Configure the OPM Mode */ + htim->Instance->CR1 |= OnePulseMode; + + /* Initialize the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + + /* Initialize the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Initialize the TIM state*/ + htim->State = HAL_TIM_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the TIM One Pulse + * @param htim TIM One Pulse handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OnePulse_DeInit(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Disable the TIM Peripheral Clock */ + __HAL_TIM_DISABLE(htim); + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + if (htim->OnePulse_MspDeInitCallback == NULL) + { + htim->OnePulse_MspDeInitCallback = HAL_TIM_OnePulse_MspDeInit; + } + /* DeInit the low level hardware */ + htim->OnePulse_MspDeInitCallback(htim); +#else + /* DeInit the low level hardware: GPIO, CLOCK, NVIC */ + HAL_TIM_OnePulse_MspDeInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_RESET; + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_RESET); + + /* Change TIM state */ + htim->State = HAL_TIM_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Initializes the TIM One Pulse MSP. + * @param htim TIM One Pulse handle + * @retval None + */ +__weak void HAL_TIM_OnePulse_MspInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_OnePulse_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes TIM One Pulse MSP. + * @param htim TIM One Pulse handle + * @retval None + */ +__weak void HAL_TIM_OnePulse_MspDeInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_OnePulse_MspDeInit could be implemented in the user file + */ +} + +/** + * @brief Starts the TIM One Pulse signal generation. + * @note Though OutputChannel parameter is deprecated and ignored by the function + * it has been kept to avoid HAL_TIM API compatibility break. + * @note The pulse output channel is determined when calling + * @ref HAL_TIM_OnePulse_ConfigChannel(). + * @param htim TIM One Pulse handle + * @param OutputChannel See note above + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OnePulse_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel) +{ + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Prevent unused argument(s) compilation warning */ + UNUSED(OutputChannel); + + /* Check the TIM channels state */ + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the Capture compare and the Input Capture channels + (in the OPM Mode the two possible channels that can be used are TIM_CHANNEL_1 and TIM_CHANNEL_2) + if TIM_CHANNEL_1 is used as output, the TIM_CHANNEL_2 will be used as input and + if TIM_CHANNEL_1 is used as input, the TIM_CHANNEL_2 will be used as output + whatever the combination, the TIM_CHANNEL_1 and TIM_CHANNEL_2 should be enabled together + + No need to enable the counter, it's enabled automatically by hardware + (the counter starts in response to a stimulus and generate a pulse */ + + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_ENABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Enable the main output */ + __HAL_TIM_MOE_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM One Pulse signal generation. + * @note Though OutputChannel parameter is deprecated and ignored by the function + * it has been kept to avoid HAL_TIM API compatibility break. + * @note The pulse output channel is determined when calling + * @ref HAL_TIM_OnePulse_ConfigChannel(). + * @param htim TIM One Pulse handle + * @param OutputChannel See note above + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OnePulse_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(OutputChannel); + + /* Disable the Capture compare and the Input Capture channels + (in the OPM Mode the two possible channels that can be used are TIM_CHANNEL_1 and TIM_CHANNEL_2) + if TIM_CHANNEL_1 is used as output, the TIM_CHANNEL_2 will be used as input and + if TIM_CHANNEL_1 is used as input, the TIM_CHANNEL_2 will be used as output + whatever the combination, the TIM_CHANNEL_1 and TIM_CHANNEL_2 should be disabled together */ + + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_DISABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM One Pulse signal generation in interrupt mode. + * @note Though OutputChannel parameter is deprecated and ignored by the function + * it has been kept to avoid HAL_TIM API compatibility break. + * @note The pulse output channel is determined when calling + * @ref HAL_TIM_OnePulse_ConfigChannel(). + * @param htim TIM One Pulse handle + * @param OutputChannel See note above + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OnePulse_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel) +{ + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Prevent unused argument(s) compilation warning */ + UNUSED(OutputChannel); + + /* Check the TIM channels state */ + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the Capture compare and the Input Capture channels + (in the OPM Mode the two possible channels that can be used are TIM_CHANNEL_1 and TIM_CHANNEL_2) + if TIM_CHANNEL_1 is used as output, the TIM_CHANNEL_2 will be used as input and + if TIM_CHANNEL_1 is used as input, the TIM_CHANNEL_2 will be used as output + whatever the combination, the TIM_CHANNEL_1 and TIM_CHANNEL_2 should be enabled together + + No need to enable the counter, it's enabled automatically by hardware + (the counter starts in response to a stimulus and generate a pulse */ + + /* Enable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + + /* Enable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_ENABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Enable the main output */ + __HAL_TIM_MOE_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM One Pulse signal generation in interrupt mode. + * @note Though OutputChannel parameter is deprecated and ignored by the function + * it has been kept to avoid HAL_TIM API compatibility break. + * @note The pulse output channel is determined when calling + * @ref HAL_TIM_OnePulse_ConfigChannel(). + * @param htim TIM One Pulse handle + * @param OutputChannel See note above + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OnePulse_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(OutputChannel); + + /* Disable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + + /* Disable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + + /* Disable the Capture compare and the Input Capture channels + (in the OPM Mode the two possible channels that can be used are TIM_CHANNEL_1 and TIM_CHANNEL_2) + if TIM_CHANNEL_1 is used as output, the TIM_CHANNEL_2 will be used as input and + if TIM_CHANNEL_1 is used as input, the TIM_CHANNEL_2 will be used as output + whatever the combination, the TIM_CHANNEL_1 and TIM_CHANNEL_2 should be disabled together */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_DISABLE); + + if (IS_TIM_BREAK_INSTANCE(htim->Instance) != RESET) + { + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group6 TIM Encoder functions + * @brief TIM Encoder functions + * +@verbatim + ============================================================================== + ##### TIM Encoder functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Initialize and configure the TIM Encoder. + (+) De-initialize the TIM Encoder. + (+) Start the TIM Encoder. + (+) Stop the TIM Encoder. + (+) Start the TIM Encoder and enable interrupt. + (+) Stop the TIM Encoder and disable interrupt. + (+) Start the TIM Encoder and enable DMA transfer. + (+) Stop the TIM Encoder and disable DMA transfer. + +@endverbatim + * @{ + */ +/** + * @brief Initializes the TIM Encoder Interface and initialize the associated handle. + * @note Switching from Center Aligned counter mode to Edge counter mode (or reverse) + * requires a timer reset to avoid unexpected direction + * due to DIR bit readonly in center aligned mode. + * Ex: call @ref HAL_TIM_Encoder_DeInit() before HAL_TIM_Encoder_Init() + * @note Encoder mode and External clock mode 2 are not compatible and must not be selected together + * Ex: A call for @ref HAL_TIM_Encoder_Init will erase the settings of @ref HAL_TIM_ConfigClockSource + * using TIM_CLOCKSOURCE_ETRMODE2 and vice versa + * @note When the timer instance is initialized in Encoder mode, timer + * channels 1 and channel 2 are reserved and cannot be used for other + * purpose. + * @param htim TIM Encoder Interface handle + * @param sConfig TIM Encoder Interface configuration structure + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Encoder_Init(TIM_HandleTypeDef *htim, const TIM_Encoder_InitTypeDef *sConfig) +{ + uint32_t tmpsmcr; + uint32_t tmpccmr1; + uint32_t tmpccer; + + /* Check the TIM handle allocation */ + if (htim == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_TIM_ENCODER_INTERFACE_INSTANCE(htim->Instance)); + assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode)); + assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); + assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload)); + assert_param(IS_TIM_ENCODER_MODE(sConfig->EncoderMode)); + assert_param(IS_TIM_IC_SELECTION(sConfig->IC1Selection)); + assert_param(IS_TIM_IC_SELECTION(sConfig->IC2Selection)); + assert_param(IS_TIM_ENCODERINPUT_POLARITY(sConfig->IC1Polarity)); + assert_param(IS_TIM_ENCODERINPUT_POLARITY(sConfig->IC2Polarity)); + assert_param(IS_TIM_IC_PRESCALER(sConfig->IC1Prescaler)); + assert_param(IS_TIM_IC_PRESCALER(sConfig->IC2Prescaler)); + assert_param(IS_TIM_IC_FILTER(sConfig->IC1Filter)); + assert_param(IS_TIM_IC_FILTER(sConfig->IC2Filter)); + assert_param(IS_TIM_PERIOD(htim, htim->Init.Period)); + + if (htim->State == HAL_TIM_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + /* Reset interrupt callbacks to legacy weak callbacks */ + TIM_ResetCallback(htim); + + if (htim->Encoder_MspInitCallback == NULL) + { + htim->Encoder_MspInitCallback = HAL_TIM_Encoder_MspInit; + } + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + htim->Encoder_MspInitCallback(htim); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ + HAL_TIM_Encoder_MspInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Reset the SMS and ECE bits */ + htim->Instance->SMCR &= ~(TIM_SMCR_SMS | TIM_SMCR_ECE); + + /* Configure the Time base in the Encoder Mode */ + TIM_Base_SetConfig(htim->Instance, &htim->Init); + + /* Get the TIMx SMCR register value */ + tmpsmcr = htim->Instance->SMCR; + + /* Get the TIMx CCMR1 register value */ + tmpccmr1 = htim->Instance->CCMR1; + + /* Get the TIMx CCER register value */ + tmpccer = htim->Instance->CCER; + + /* Set the encoder Mode */ + tmpsmcr |= sConfig->EncoderMode; + + /* Select the Capture Compare 1 and the Capture Compare 2 as input */ + tmpccmr1 &= ~(TIM_CCMR1_CC1S | TIM_CCMR1_CC2S); + tmpccmr1 |= (sConfig->IC1Selection | (sConfig->IC2Selection << 8U)); + + /* Set the Capture Compare 1 and the Capture Compare 2 prescalers and filters */ + tmpccmr1 &= ~(TIM_CCMR1_IC1PSC | TIM_CCMR1_IC2PSC); + tmpccmr1 &= ~(TIM_CCMR1_IC1F | TIM_CCMR1_IC2F); + tmpccmr1 |= sConfig->IC1Prescaler | (sConfig->IC2Prescaler << 8U); + tmpccmr1 |= (sConfig->IC1Filter << 4U) | (sConfig->IC2Filter << 12U); + + /* Set the TI1 and the TI2 Polarities */ + tmpccer &= ~(TIM_CCER_CC1P | TIM_CCER_CC2P); + tmpccer &= ~(TIM_CCER_CC1NP | TIM_CCER_CC2NP); + tmpccer |= sConfig->IC1Polarity | (sConfig->IC2Polarity << 4U); + + /* Write to TIMx SMCR */ + htim->Instance->SMCR = tmpsmcr; + + /* Write to TIMx CCMR1 */ + htim->Instance->CCMR1 = tmpccmr1; + + /* Write to TIMx CCER */ + htim->Instance->CCER = tmpccer; + + /* Initialize the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Initialize the TIM state*/ + htim->State = HAL_TIM_STATE_READY; + + return HAL_OK; +} + + +/** + * @brief DeInitializes the TIM Encoder interface + * @param htim TIM Encoder Interface handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Encoder_DeInit(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Disable the TIM Peripheral Clock */ + __HAL_TIM_DISABLE(htim); + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + if (htim->Encoder_MspDeInitCallback == NULL) + { + htim->Encoder_MspDeInitCallback = HAL_TIM_Encoder_MspDeInit; + } + /* DeInit the low level hardware */ + htim->Encoder_MspDeInitCallback(htim); +#else + /* DeInit the low level hardware: GPIO, CLOCK, NVIC */ + HAL_TIM_Encoder_MspDeInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_RESET; + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_RESET); + + /* Change TIM state */ + htim->State = HAL_TIM_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Initializes the TIM Encoder Interface MSP. + * @param htim TIM Encoder Interface handle + * @retval None + */ +__weak void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_Encoder_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes TIM Encoder Interface MSP. + * @param htim TIM Encoder Interface handle + * @retval None + */ +__weak void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_Encoder_MspDeInit could be implemented in the user file + */ +} + +/** + * @brief Starts the TIM Encoder Interface. + * @param htim TIM Encoder Interface handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Encoder_Start(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Check the parameters */ + assert_param(IS_TIM_ENCODER_INTERFACE_INSTANCE(htim->Instance)); + + /* Set the TIM channel(s) state */ + if (Channel == TIM_CHANNEL_1) + { + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else if (Channel == TIM_CHANNEL_2) + { + if ((channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + + /* Enable the encoder interface channels */ + switch (Channel) + { + case TIM_CHANNEL_1: + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + break; + } + + case TIM_CHANNEL_2: + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_ENABLE); + break; + } + + default : + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_ENABLE); + break; + } + } + /* Enable the Peripheral */ + __HAL_TIM_ENABLE(htim); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Encoder Interface. + * @param htim TIM Encoder Interface handle + * @param Channel TIM Channels to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Encoder_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + /* Check the parameters */ + assert_param(IS_TIM_ENCODER_INTERFACE_INSTANCE(htim->Instance)); + + /* Disable the Input Capture channels 1 and 2 + (in the EncoderInterface the two possible channels that can be used are TIM_CHANNEL_1 and TIM_CHANNEL_2) */ + switch (Channel) + { + case TIM_CHANNEL_1: + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + break; + } + + case TIM_CHANNEL_2: + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_DISABLE); + break; + } + + default : + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_DISABLE); + break; + } + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel(s) state */ + if ((Channel == TIM_CHANNEL_1) || (Channel == TIM_CHANNEL_2)) + { + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Encoder Interface in interrupt mode. + * @param htim TIM Encoder Interface handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Encoder_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Check the parameters */ + assert_param(IS_TIM_ENCODER_INTERFACE_INSTANCE(htim->Instance)); + + /* Set the TIM channel(s) state */ + if (Channel == TIM_CHANNEL_1) + { + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else if (Channel == TIM_CHANNEL_2) + { + if ((channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + + /* Enable the encoder interface channels */ + /* Enable the capture compare Interrupts 1 and/or 2 */ + switch (Channel) + { + case TIM_CHANNEL_1: + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_ENABLE); + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + break; + } + + default : + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_ENABLE); + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + break; + } + } + + /* Enable the Peripheral */ + __HAL_TIM_ENABLE(htim); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Encoder Interface in interrupt mode. + * @param htim TIM Encoder Interface handle + * @param Channel TIM Channels to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Encoder_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + /* Check the parameters */ + assert_param(IS_TIM_ENCODER_INTERFACE_INSTANCE(htim->Instance)); + + /* Disable the Input Capture channels 1 and 2 + (in the EncoderInterface the two possible channels that can be used are TIM_CHANNEL_1 and TIM_CHANNEL_2) */ + if (Channel == TIM_CHANNEL_1) + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + + /* Disable the capture compare Interrupts 1 */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + } + else if (Channel == TIM_CHANNEL_2) + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_DISABLE); + + /* Disable the capture compare Interrupts 2 */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + } + else + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_DISABLE); + + /* Disable the capture compare Interrupts 1 and 2 */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel(s) state */ + if ((Channel == TIM_CHANNEL_1) || (Channel == TIM_CHANNEL_2)) + { + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Encoder Interface in DMA mode. + * @param htim TIM Encoder Interface handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected + * @param pData1 The destination Buffer address for IC1. + * @param pData2 The destination Buffer address for IC2. + * @param Length The length of data to be transferred from TIM peripheral to memory. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Encoder_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData1, + uint32_t *pData2, uint16_t Length) +{ + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Check the parameters */ + assert_param(IS_TIM_ENCODER_INTERFACE_INSTANCE(htim->Instance)); + + /* Set the TIM channel(s) state */ + if (Channel == TIM_CHANNEL_1) + { + if ((channel_1_state == HAL_TIM_CHANNEL_STATE_BUSY) + || (complementary_channel_1_state == HAL_TIM_CHANNEL_STATE_BUSY)) + { + return HAL_BUSY; + } + else if ((channel_1_state == HAL_TIM_CHANNEL_STATE_READY) + && (complementary_channel_1_state == HAL_TIM_CHANNEL_STATE_READY)) + { + if ((pData1 == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + } + else if (Channel == TIM_CHANNEL_2) + { + if ((channel_2_state == HAL_TIM_CHANNEL_STATE_BUSY) + || (complementary_channel_2_state == HAL_TIM_CHANNEL_STATE_BUSY)) + { + return HAL_BUSY; + } + else if ((channel_2_state == HAL_TIM_CHANNEL_STATE_READY) + && (complementary_channel_2_state == HAL_TIM_CHANNEL_STATE_READY)) + { + if ((pData2 == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + } + else + { + if ((channel_1_state == HAL_TIM_CHANNEL_STATE_BUSY) + || (channel_2_state == HAL_TIM_CHANNEL_STATE_BUSY) + || (complementary_channel_1_state == HAL_TIM_CHANNEL_STATE_BUSY) + || (complementary_channel_2_state == HAL_TIM_CHANNEL_STATE_BUSY)) + { + return HAL_BUSY; + } + else if ((channel_1_state == HAL_TIM_CHANNEL_STATE_READY) + && (channel_2_state == HAL_TIM_CHANNEL_STATE_READY) + && (complementary_channel_1_state == HAL_TIM_CHANNEL_STATE_READY) + && (complementary_channel_2_state == HAL_TIM_CHANNEL_STATE_READY)) + { + if ((((pData1 == NULL) || (pData2 == NULL))) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + } + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData1, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Input Capture DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1); + + /* Enable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + + /* Enable the Peripheral */ + __HAL_TIM_ENABLE(htim); + + break; + } + + case TIM_CHANNEL_2: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError; + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->CCR2, (uint32_t)pData2, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Input Capture DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC2); + + /* Enable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_ENABLE); + + /* Enable the Peripheral */ + __HAL_TIM_ENABLE(htim); + + break; + } + + default: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData1, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->CCR2, (uint32_t)pData2, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + + /* Enable the TIM Input Capture DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1); + /* Enable the TIM Input Capture DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC2); + + /* Enable the Capture compare channel */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_ENABLE); + + /* Enable the Peripheral */ + __HAL_TIM_ENABLE(htim); + + break; + } + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Encoder Interface in DMA mode. + * @param htim TIM Encoder Interface handle + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_ALL: TIM Channel 1 and TIM Channel 2 are selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_Encoder_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + /* Check the parameters */ + assert_param(IS_TIM_ENCODER_INTERFACE_INSTANCE(htim->Instance)); + + /* Disable the Input Capture channels 1 and 2 + (in the EncoderInterface the two possible channels that can be used are TIM_CHANNEL_1 and TIM_CHANNEL_2) */ + if (Channel == TIM_CHANNEL_1) + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + + /* Disable the capture compare DMA Request 1 */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + } + else if (Channel == TIM_CHANNEL_2) + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_DISABLE); + + /* Disable the capture compare DMA Request 2 */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + } + else + { + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_2, TIM_CCx_DISABLE); + + /* Disable the capture compare DMA Request 1 and 2 */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1); + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + } + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel(s) state */ + if ((Channel == TIM_CHANNEL_1) || (Channel == TIM_CHANNEL_2)) + { + TIM_CHANNEL_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @} + */ +/** @defgroup TIM_Exported_Functions_Group7 TIM IRQ handler management + * @brief TIM IRQ handler management + * +@verbatim + ============================================================================== + ##### IRQ handler management ##### + ============================================================================== + [..] + This section provides Timer IRQ handler function. + +@endverbatim + * @{ + */ +/** + * @brief This function handles TIM interrupts requests. + * @param htim TIM handle + * @retval None + */ +void HAL_TIM_IRQHandler(TIM_HandleTypeDef *htim) +{ + /* Capture compare 1 event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC1) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC1) != RESET) + { + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC1); + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + + /* Input capture event */ + if ((htim->Instance->CCMR1 & TIM_CCMR1_CC1S) != 0x00U) + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + /* Output compare event */ + else + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->OC_DelayElapsedCallback(htim); + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_OC_DelayElapsedCallback(htim); + HAL_TIM_PWM_PulseFinishedCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; + } + } + } + /* Capture compare 2 event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC2) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC2) != RESET) + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC2); + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + /* Input capture event */ + if ((htim->Instance->CCMR1 & TIM_CCMR1_CC2S) != 0x00U) + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + /* Output compare event */ + else + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->OC_DelayElapsedCallback(htim); + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_OC_DelayElapsedCallback(htim); + HAL_TIM_PWM_PulseFinishedCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; + } + } + /* Capture compare 3 event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC3) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC3) != RESET) + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC3); + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + /* Input capture event */ + if ((htim->Instance->CCMR2 & TIM_CCMR2_CC3S) != 0x00U) + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + /* Output compare event */ + else + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->OC_DelayElapsedCallback(htim); + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_OC_DelayElapsedCallback(htim); + HAL_TIM_PWM_PulseFinishedCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; + } + } + /* Capture compare 4 event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC4) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_CC4) != RESET) + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_CC4); + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + /* Input capture event */ + if ((htim->Instance->CCMR2 & TIM_CCMR2_CC4S) != 0x00U) + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + /* Output compare event */ + else + { +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->OC_DelayElapsedCallback(htim); + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_OC_DelayElapsedCallback(htim); + HAL_TIM_PWM_PulseFinishedCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; + } + } + /* TIM Update event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_UPDATE) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_UPDATE) != RESET) + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_UPDATE); +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->PeriodElapsedCallback(htim); +#else + HAL_TIM_PeriodElapsedCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } + /* TIM Break input event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_BREAK) != RESET) + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_BREAK); +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->BreakCallback(htim); +#else + HAL_TIMEx_BreakCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } +#if defined(TIM_BDTR_BK2E) + /* TIM Break2 input event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_BREAK2) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_BREAK) != RESET) + { + __HAL_TIM_CLEAR_FLAG(htim, TIM_FLAG_BREAK2); +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->Break2Callback(htim); +#else + HAL_TIMEx_Break2Callback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } +#endif /* TIM_BDTR_BK2E */ + /* TIM Trigger detection event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_TRIGGER) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_TRIGGER) != RESET) + { + __HAL_TIM_CLEAR_IT(htim, TIM_IT_TRIGGER); +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->TriggerCallback(htim); +#else + HAL_TIM_TriggerCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } + /* TIM commutation event */ + if (__HAL_TIM_GET_FLAG(htim, TIM_FLAG_COM) != RESET) + { + if (__HAL_TIM_GET_IT_SOURCE(htim, TIM_IT_COM) != RESET) + { + __HAL_TIM_CLEAR_IT(htim, TIM_FLAG_COM); +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->CommutationCallback(htim); +#else + HAL_TIMEx_CommutCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + } +} + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group8 TIM Peripheral Control functions + * @brief TIM Peripheral Control functions + * +@verbatim + ============================================================================== + ##### Peripheral Control functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Configure The Input Output channels for OC, PWM, IC or One Pulse mode. + (+) Configure External Clock source. + (+) Configure Complementary channels, break features and dead time. + (+) Configure Master and the Slave synchronization. + (+) Configure the DMA Burst Mode. + +@endverbatim + * @{ + */ + +/** + * @brief Initializes the TIM Output Compare Channels according to the specified + * parameters in the TIM_OC_InitTypeDef. + * @param htim TIM Output Compare handle + * @param sConfig TIM Output Compare configuration structure + * @param Channel TIM Channels to configure + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OC_ConfigChannel(TIM_HandleTypeDef *htim, + const TIM_OC_InitTypeDef *sConfig, + uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CHANNELS(Channel)); + assert_param(IS_TIM_OC_MODE(sConfig->OCMode)); + assert_param(IS_TIM_OC_POLARITY(sConfig->OCPolarity)); + + /* Process Locked */ + __HAL_LOCK(htim); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + + /* Configure the TIM Channel 1 in Output Compare */ + TIM_OC1_SetConfig(htim->Instance, sConfig); + break; + } + + case TIM_CHANNEL_2: + { + /* Check the parameters */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + + /* Configure the TIM Channel 2 in Output Compare */ + TIM_OC2_SetConfig(htim->Instance, sConfig); + break; + } + + case TIM_CHANNEL_3: + { + /* Check the parameters */ + assert_param(IS_TIM_CC3_INSTANCE(htim->Instance)); + + /* Configure the TIM Channel 3 in Output Compare */ + TIM_OC3_SetConfig(htim->Instance, sConfig); + break; + } + + case TIM_CHANNEL_4: + { + /* Check the parameters */ + assert_param(IS_TIM_CC4_INSTANCE(htim->Instance)); + + /* Configure the TIM Channel 4 in Output Compare */ + TIM_OC4_SetConfig(htim->Instance, sConfig); + break; + } + +#if defined(TIM_CCER_CC5E) + case TIM_CHANNEL_5: + { + /* Check the parameters */ + assert_param(IS_TIM_CC5_INSTANCE(htim->Instance)); + + /* Configure the TIM Channel 5 in Output Compare */ + TIM_OC5_SetConfig(htim->Instance, sConfig); + break; + } +#endif /* TIM_CCER_CC5E */ + +#if defined(TIM_CCER_CC6E) + case TIM_CHANNEL_6: + { + /* Check the parameters */ + assert_param(IS_TIM_CC6_INSTANCE(htim->Instance)); + + /* Configure the TIM Channel 6 in Output Compare */ + TIM_OC6_SetConfig(htim->Instance, sConfig); + break; + } +#endif /* TIM_CCER_CC6E */ + + default: + status = HAL_ERROR; + break; + } + + __HAL_UNLOCK(htim); + + return status; +} + +/** + * @brief Initializes the TIM Input Capture Channels according to the specified + * parameters in the TIM_IC_InitTypeDef. + * @param htim TIM IC handle + * @param sConfig TIM Input Capture configuration structure + * @param Channel TIM Channel to configure + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_IC_ConfigChannel(TIM_HandleTypeDef *htim, const TIM_IC_InitTypeDef *sConfig, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + assert_param(IS_TIM_IC_POLARITY(sConfig->ICPolarity)); + assert_param(IS_TIM_IC_SELECTION(sConfig->ICSelection)); + assert_param(IS_TIM_IC_PRESCALER(sConfig->ICPrescaler)); + assert_param(IS_TIM_IC_FILTER(sConfig->ICFilter)); + + /* Process Locked */ + __HAL_LOCK(htim); + + if (Channel == TIM_CHANNEL_1) + { + /* TI1 Configuration */ + TIM_TI1_SetConfig(htim->Instance, + sConfig->ICPolarity, + sConfig->ICSelection, + sConfig->ICFilter); + + /* Reset the IC1PSC Bits */ + htim->Instance->CCMR1 &= ~TIM_CCMR1_IC1PSC; + + /* Set the IC1PSC value */ + htim->Instance->CCMR1 |= sConfig->ICPrescaler; + } + else if (Channel == TIM_CHANNEL_2) + { + /* TI2 Configuration */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + + TIM_TI2_SetConfig(htim->Instance, + sConfig->ICPolarity, + sConfig->ICSelection, + sConfig->ICFilter); + + /* Reset the IC2PSC Bits */ + htim->Instance->CCMR1 &= ~TIM_CCMR1_IC2PSC; + + /* Set the IC2PSC value */ + htim->Instance->CCMR1 |= (sConfig->ICPrescaler << 8U); + } + else if (Channel == TIM_CHANNEL_3) + { + /* TI3 Configuration */ + assert_param(IS_TIM_CC3_INSTANCE(htim->Instance)); + + TIM_TI3_SetConfig(htim->Instance, + sConfig->ICPolarity, + sConfig->ICSelection, + sConfig->ICFilter); + + /* Reset the IC3PSC Bits */ + htim->Instance->CCMR2 &= ~TIM_CCMR2_IC3PSC; + + /* Set the IC3PSC value */ + htim->Instance->CCMR2 |= sConfig->ICPrescaler; + } + else if (Channel == TIM_CHANNEL_4) + { + /* TI4 Configuration */ + assert_param(IS_TIM_CC4_INSTANCE(htim->Instance)); + + TIM_TI4_SetConfig(htim->Instance, + sConfig->ICPolarity, + sConfig->ICSelection, + sConfig->ICFilter); + + /* Reset the IC4PSC Bits */ + htim->Instance->CCMR2 &= ~TIM_CCMR2_IC4PSC; + + /* Set the IC4PSC value */ + htim->Instance->CCMR2 |= (sConfig->ICPrescaler << 8U); + } + else + { + status = HAL_ERROR; + } + + __HAL_UNLOCK(htim); + + return status; +} + +/** + * @brief Initializes the TIM PWM channels according to the specified + * parameters in the TIM_OC_InitTypeDef. + * @param htim TIM PWM handle + * @param sConfig TIM PWM configuration structure + * @param Channel TIM Channels to be configured + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @arg TIM_CHANNEL_5: TIM Channel 5 selected (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 selected (*) + * (*) Value not defined for all devices + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_PWM_ConfigChannel(TIM_HandleTypeDef *htim, + const TIM_OC_InitTypeDef *sConfig, + uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CHANNELS(Channel)); + assert_param(IS_TIM_PWM_MODE(sConfig->OCMode)); + assert_param(IS_TIM_OC_POLARITY(sConfig->OCPolarity)); + assert_param(IS_TIM_FAST_STATE(sConfig->OCFastMode)); + + /* Process Locked */ + __HAL_LOCK(htim); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + + /* Configure the Channel 1 in PWM mode */ + TIM_OC1_SetConfig(htim->Instance, sConfig); + + /* Set the Preload enable bit for channel1 */ + htim->Instance->CCMR1 |= TIM_CCMR1_OC1PE; + + /* Configure the Output Fast mode */ + htim->Instance->CCMR1 &= ~TIM_CCMR1_OC1FE; + htim->Instance->CCMR1 |= sConfig->OCFastMode; + break; + } + + case TIM_CHANNEL_2: + { + /* Check the parameters */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + + /* Configure the Channel 2 in PWM mode */ + TIM_OC2_SetConfig(htim->Instance, sConfig); + + /* Set the Preload enable bit for channel2 */ + htim->Instance->CCMR1 |= TIM_CCMR1_OC2PE; + + /* Configure the Output Fast mode */ + htim->Instance->CCMR1 &= ~TIM_CCMR1_OC2FE; + htim->Instance->CCMR1 |= sConfig->OCFastMode << 8U; + break; + } + + case TIM_CHANNEL_3: + { + /* Check the parameters */ + assert_param(IS_TIM_CC3_INSTANCE(htim->Instance)); + + /* Configure the Channel 3 in PWM mode */ + TIM_OC3_SetConfig(htim->Instance, sConfig); + + /* Set the Preload enable bit for channel3 */ + htim->Instance->CCMR2 |= TIM_CCMR2_OC3PE; + + /* Configure the Output Fast mode */ + htim->Instance->CCMR2 &= ~TIM_CCMR2_OC3FE; + htim->Instance->CCMR2 |= sConfig->OCFastMode; + break; + } + + case TIM_CHANNEL_4: + { + /* Check the parameters */ + assert_param(IS_TIM_CC4_INSTANCE(htim->Instance)); + + /* Configure the Channel 4 in PWM mode */ + TIM_OC4_SetConfig(htim->Instance, sConfig); + + /* Set the Preload enable bit for channel4 */ + htim->Instance->CCMR2 |= TIM_CCMR2_OC4PE; + + /* Configure the Output Fast mode */ + htim->Instance->CCMR2 &= ~TIM_CCMR2_OC4FE; + htim->Instance->CCMR2 |= sConfig->OCFastMode << 8U; + break; + } + +#if defined(TIM_CCER_CC5E) + case TIM_CHANNEL_5: + { + /* Check the parameters */ + assert_param(IS_TIM_CC5_INSTANCE(htim->Instance)); + + /* Configure the Channel 5 in PWM mode */ + TIM_OC5_SetConfig(htim->Instance, sConfig); + + /* Set the Preload enable bit for channel5*/ + htim->Instance->CCMR3 |= TIM_CCMR3_OC5PE; + + /* Configure the Output Fast mode */ + htim->Instance->CCMR3 &= ~TIM_CCMR3_OC5FE; + htim->Instance->CCMR3 |= sConfig->OCFastMode; + break; + } +#endif /* TIM_CCER_CC5E */ + +#if defined(TIM_CCER_CC6E) + case TIM_CHANNEL_6: + { + /* Check the parameters */ + assert_param(IS_TIM_CC6_INSTANCE(htim->Instance)); + + /* Configure the Channel 6 in PWM mode */ + TIM_OC6_SetConfig(htim->Instance, sConfig); + + /* Set the Preload enable bit for channel6 */ + htim->Instance->CCMR3 |= TIM_CCMR3_OC6PE; + + /* Configure the Output Fast mode */ + htim->Instance->CCMR3 &= ~TIM_CCMR3_OC6FE; + htim->Instance->CCMR3 |= sConfig->OCFastMode << 8U; + break; + } +#endif /* TIM_CCER_CC6E */ + + default: + status = HAL_ERROR; + break; + } + + __HAL_UNLOCK(htim); + + return status; +} + +/** + * @brief Initializes the TIM One Pulse Channels according to the specified + * parameters in the TIM_OnePulse_InitTypeDef. + * @param htim TIM One Pulse handle + * @param sConfig TIM One Pulse configuration structure + * @param OutputChannel TIM output channel to configure + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @param InputChannel TIM input Channel to configure + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @note To output a waveform with a minimum delay user can enable the fast + * mode by calling the @ref __HAL_TIM_ENABLE_OCxFAST macro. Then CCx + * output is forced in response to the edge detection on TIx input, + * without taking in account the comparison. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_OnePulse_ConfigChannel(TIM_HandleTypeDef *htim, TIM_OnePulse_InitTypeDef *sConfig, + uint32_t OutputChannel, uint32_t InputChannel) +{ + HAL_StatusTypeDef status = HAL_OK; + TIM_OC_InitTypeDef temp1; + + /* Check the parameters */ + assert_param(IS_TIM_OPM_CHANNELS(OutputChannel)); + assert_param(IS_TIM_OPM_CHANNELS(InputChannel)); + + if (OutputChannel != InputChannel) + { + /* Process Locked */ + __HAL_LOCK(htim); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Extract the Output compare configuration from sConfig structure */ + temp1.OCMode = sConfig->OCMode; + temp1.Pulse = sConfig->Pulse; + temp1.OCPolarity = sConfig->OCPolarity; + temp1.OCNPolarity = sConfig->OCNPolarity; + temp1.OCIdleState = sConfig->OCIdleState; + temp1.OCNIdleState = sConfig->OCNIdleState; + + switch (OutputChannel) + { + case TIM_CHANNEL_1: + { + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + + TIM_OC1_SetConfig(htim->Instance, &temp1); + break; + } + + case TIM_CHANNEL_2: + { + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + + TIM_OC2_SetConfig(htim->Instance, &temp1); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + switch (InputChannel) + { + case TIM_CHANNEL_1: + { + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + + TIM_TI1_SetConfig(htim->Instance, sConfig->ICPolarity, + sConfig->ICSelection, sConfig->ICFilter); + + /* Reset the IC1PSC Bits */ + htim->Instance->CCMR1 &= ~TIM_CCMR1_IC1PSC; + + /* Select the Trigger source */ + htim->Instance->SMCR &= ~TIM_SMCR_TS; + htim->Instance->SMCR |= TIM_TS_TI1FP1; + + /* Select the Slave Mode */ + htim->Instance->SMCR &= ~TIM_SMCR_SMS; + htim->Instance->SMCR |= TIM_SLAVEMODE_TRIGGER; + break; + } + + case TIM_CHANNEL_2: + { + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + + TIM_TI2_SetConfig(htim->Instance, sConfig->ICPolarity, + sConfig->ICSelection, sConfig->ICFilter); + + /* Reset the IC2PSC Bits */ + htim->Instance->CCMR1 &= ~TIM_CCMR1_IC2PSC; + + /* Select the Trigger source */ + htim->Instance->SMCR &= ~TIM_SMCR_TS; + htim->Instance->SMCR |= TIM_TS_TI2FP2; + + /* Select the Slave Mode */ + htim->Instance->SMCR &= ~TIM_SMCR_SMS; + htim->Instance->SMCR |= TIM_SLAVEMODE_TRIGGER; + break; + } + + default: + status = HAL_ERROR; + break; + } + } + + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + return status; + } + else + { + return HAL_ERROR; + } +} + +/** + * @brief Configure the DMA Burst to transfer Data from the memory to the TIM peripheral + * @param htim TIM handle + * @param BurstBaseAddress TIM Base address from where the DMA will start the Data write + * This parameter can be one of the following values: + * @arg TIM_DMABASE_CR1 + * @arg TIM_DMABASE_CR2 + * @arg TIM_DMABASE_SMCR + * @arg TIM_DMABASE_DIER + * @arg TIM_DMABASE_SR + * @arg TIM_DMABASE_EGR + * @arg TIM_DMABASE_CCMR1 + * @arg TIM_DMABASE_CCMR2 + * @arg TIM_DMABASE_CCER + * @arg TIM_DMABASE_CNT + * @arg TIM_DMABASE_PSC + * @arg TIM_DMABASE_ARR + * @arg TIM_DMABASE_RCR + * @arg TIM_DMABASE_CCR1 + * @arg TIM_DMABASE_CCR2 + * @arg TIM_DMABASE_CCR3 + * @arg TIM_DMABASE_CCR4 + * @arg TIM_DMABASE_BDTR + * @arg TIM_DMABASE_OR + * @arg TIM_DMABASE_CCMR3 (*) + * @arg TIM_DMABASE_CCR5 (*) + * @arg TIM_DMABASE_CCR6 (*) + * (*) value not defined in all devices + * @param BurstRequestSrc TIM DMA Request sources + * This parameter can be one of the following values: + * @arg TIM_DMA_UPDATE: TIM update Interrupt source + * @arg TIM_DMA_CC1: TIM Capture Compare 1 DMA source + * @arg TIM_DMA_CC2: TIM Capture Compare 2 DMA source + * @arg TIM_DMA_CC3: TIM Capture Compare 3 DMA source + * @arg TIM_DMA_CC4: TIM Capture Compare 4 DMA source + * @arg TIM_DMA_COM: TIM Commutation DMA source + * @arg TIM_DMA_TRIGGER: TIM Trigger DMA source + * @param BurstBuffer The Buffer address. + * @param BurstLength DMA Burst length. This parameter can be one value + * between: TIM_DMABURSTLENGTH_1TRANSFER and TIM_DMABURSTLENGTH_18TRANSFERS. + * @note This function should be used only when BurstLength is equal to DMA data transfer length. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, + uint32_t BurstRequestSrc, const uint32_t *BurstBuffer, uint32_t BurstLength) +{ + HAL_StatusTypeDef status; + + status = HAL_TIM_DMABurst_MultiWriteStart(htim, BurstBaseAddress, BurstRequestSrc, BurstBuffer, BurstLength, + ((BurstLength) >> 8U) + 1U); + + + + return status; +} + +/** + * @brief Configure the DMA Burst to transfer multiple Data from the memory to the TIM peripheral + * @param htim TIM handle + * @param BurstBaseAddress TIM Base address from where the DMA will start the Data write + * This parameter can be one of the following values: + * @arg TIM_DMABASE_CR1 + * @arg TIM_DMABASE_CR2 + * @arg TIM_DMABASE_SMCR + * @arg TIM_DMABASE_DIER + * @arg TIM_DMABASE_SR + * @arg TIM_DMABASE_EGR + * @arg TIM_DMABASE_CCMR1 + * @arg TIM_DMABASE_CCMR2 + * @arg TIM_DMABASE_CCER + * @arg TIM_DMABASE_CNT + * @arg TIM_DMABASE_PSC + * @arg TIM_DMABASE_ARR + * @arg TIM_DMABASE_RCR + * @arg TIM_DMABASE_CCR1 + * @arg TIM_DMABASE_CCR2 + * @arg TIM_DMABASE_CCR3 + * @arg TIM_DMABASE_CCR4 + * @arg TIM_DMABASE_BDTR + * @arg TIM_DMABASE_OR + * @arg TIM_DMABASE_CCMR3 (*) + * @arg TIM_DMABASE_CCR5 (*) + * @arg TIM_DMABASE_CCR6 (*) + * (*) value not defined in all devices + * @param BurstRequestSrc TIM DMA Request sources + * This parameter can be one of the following values: + * @arg TIM_DMA_UPDATE: TIM update Interrupt source + * @arg TIM_DMA_CC1: TIM Capture Compare 1 DMA source + * @arg TIM_DMA_CC2: TIM Capture Compare 2 DMA source + * @arg TIM_DMA_CC3: TIM Capture Compare 3 DMA source + * @arg TIM_DMA_CC4: TIM Capture Compare 4 DMA source + * @arg TIM_DMA_COM: TIM Commutation DMA source + * @arg TIM_DMA_TRIGGER: TIM Trigger DMA source + * @param BurstBuffer The Buffer address. + * @param BurstLength DMA Burst length. This parameter can be one value + * between: TIM_DMABURSTLENGTH_1TRANSFER and TIM_DMABURSTLENGTH_18TRANSFERS. + * @param DataLength Data length. This parameter can be one value + * between 1 and 0xFFFF. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_DMABurst_MultiWriteStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, + uint32_t BurstRequestSrc, const uint32_t *BurstBuffer, + uint32_t BurstLength, uint32_t DataLength) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_DMABURST_INSTANCE(htim->Instance)); + assert_param(IS_TIM_DMA_BASE(BurstBaseAddress)); + assert_param(IS_TIM_DMA_SOURCE(BurstRequestSrc)); + assert_param(IS_TIM_DMA_LENGTH(BurstLength)); + assert_param(IS_TIM_DMA_DATA_LENGTH(DataLength)); + + if (htim->DMABurstState == HAL_DMA_BURST_STATE_BUSY) + { + return HAL_BUSY; + } + else if (htim->DMABurstState == HAL_DMA_BURST_STATE_READY) + { + if ((BurstBuffer == NULL) && (BurstLength > 0U)) + { + return HAL_ERROR; + } + else + { + htim->DMABurstState = HAL_DMA_BURST_STATE_BUSY; + } + } + else + { + /* nothing to do */ + } + + switch (BurstRequestSrc) + { + case TIM_DMA_UPDATE: + { + /* Set the DMA Period elapsed callbacks */ + htim->hdma[TIM_DMA_ID_UPDATE]->XferCpltCallback = TIM_DMAPeriodElapsedCplt; + htim->hdma[TIM_DMA_ID_UPDATE]->XferHalfCpltCallback = TIM_DMAPeriodElapsedHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_UPDATE], (uint32_t)BurstBuffer, + (uint32_t)&htim->Instance->DMAR, DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_CC1: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)BurstBuffer, + (uint32_t)&htim->Instance->DMAR, DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_CC2: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)BurstBuffer, + (uint32_t)&htim->Instance->DMAR, DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_CC3: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)BurstBuffer, + (uint32_t)&htim->Instance->DMAR, DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_CC4: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMADelayPulseCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)BurstBuffer, + (uint32_t)&htim->Instance->DMAR, DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_COM: + { + /* Set the DMA commutation callbacks */ + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = TIMEx_DMACommutationCplt; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferHalfCpltCallback = TIMEx_DMACommutationHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_COMMUTATION], (uint32_t)BurstBuffer, + (uint32_t)&htim->Instance->DMAR, DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_TRIGGER: + { + /* Set the DMA trigger callbacks */ + htim->hdma[TIM_DMA_ID_TRIGGER]->XferCpltCallback = TIM_DMATriggerCplt; + htim->hdma[TIM_DMA_ID_TRIGGER]->XferHalfCpltCallback = TIM_DMATriggerHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_TRIGGER]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_TRIGGER], (uint32_t)BurstBuffer, + (uint32_t)&htim->Instance->DMAR, DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Configure the DMA Burst Mode */ + htim->Instance->DCR = (BurstBaseAddress | BurstLength); + /* Enable the TIM DMA Request */ + __HAL_TIM_ENABLE_DMA(htim, BurstRequestSrc); + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM DMA Burst mode + * @param htim TIM handle + * @param BurstRequestSrc TIM DMA Request sources to disable + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_DMABurst_WriteStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_DMA_SOURCE(BurstRequestSrc)); + + /* Abort the DMA transfer (at least disable the DMA channel) */ + switch (BurstRequestSrc) + { + case TIM_DMA_UPDATE: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_UPDATE]); + break; + } + case TIM_DMA_CC1: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + break; + } + case TIM_DMA_CC2: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + break; + } + case TIM_DMA_CC3: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]); + break; + } + case TIM_DMA_CC4: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC4]); + break; + } + case TIM_DMA_COM: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_COMMUTATION]); + break; + } + case TIM_DMA_TRIGGER: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_TRIGGER]); + break; + } + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the TIM Update DMA request */ + __HAL_TIM_DISABLE_DMA(htim, BurstRequestSrc); + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + } + + /* Return function status */ + return status; +} + +/** + * @brief Configure the DMA Burst to transfer Data from the TIM peripheral to the memory + * @param htim TIM handle + * @param BurstBaseAddress TIM Base address from where the DMA will start the Data read + * This parameter can be one of the following values: + * @arg TIM_DMABASE_CR1 + * @arg TIM_DMABASE_CR2 + * @arg TIM_DMABASE_SMCR + * @arg TIM_DMABASE_DIER + * @arg TIM_DMABASE_SR + * @arg TIM_DMABASE_EGR + * @arg TIM_DMABASE_CCMR1 + * @arg TIM_DMABASE_CCMR2 + * @arg TIM_DMABASE_CCER + * @arg TIM_DMABASE_CNT + * @arg TIM_DMABASE_PSC + * @arg TIM_DMABASE_ARR + * @arg TIM_DMABASE_RCR + * @arg TIM_DMABASE_CCR1 + * @arg TIM_DMABASE_CCR2 + * @arg TIM_DMABASE_CCR3 + * @arg TIM_DMABASE_CCR4 + * @arg TIM_DMABASE_BDTR + * @arg TIM_DMABASE_OR + * @arg TIM_DMABASE_CCMR3 (*) + * @arg TIM_DMABASE_CCR5 (*) + * @arg TIM_DMABASE_CCR6 (*) + * (*) value not defined in all devices + * @param BurstRequestSrc TIM DMA Request sources + * This parameter can be one of the following values: + * @arg TIM_DMA_UPDATE: TIM update Interrupt source + * @arg TIM_DMA_CC1: TIM Capture Compare 1 DMA source + * @arg TIM_DMA_CC2: TIM Capture Compare 2 DMA source + * @arg TIM_DMA_CC3: TIM Capture Compare 3 DMA source + * @arg TIM_DMA_CC4: TIM Capture Compare 4 DMA source + * @arg TIM_DMA_COM: TIM Commutation DMA source + * @arg TIM_DMA_TRIGGER: TIM Trigger DMA source + * @param BurstBuffer The Buffer address. + * @param BurstLength DMA Burst length. This parameter can be one value + * between: TIM_DMABURSTLENGTH_1TRANSFER and TIM_DMABURSTLENGTH_18TRANSFERS. + * @note This function should be used only when BurstLength is equal to DMA data transfer length. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, + uint32_t BurstRequestSrc, uint32_t *BurstBuffer, uint32_t BurstLength) +{ + HAL_StatusTypeDef status; + + status = HAL_TIM_DMABurst_MultiReadStart(htim, BurstBaseAddress, BurstRequestSrc, BurstBuffer, BurstLength, + ((BurstLength) >> 8U) + 1U); + + + return status; +} + +/** + * @brief Configure the DMA Burst to transfer Data from the TIM peripheral to the memory + * @param htim TIM handle + * @param BurstBaseAddress TIM Base address from where the DMA will start the Data read + * This parameter can be one of the following values: + * @arg TIM_DMABASE_CR1 + * @arg TIM_DMABASE_CR2 + * @arg TIM_DMABASE_SMCR + * @arg TIM_DMABASE_DIER + * @arg TIM_DMABASE_SR + * @arg TIM_DMABASE_EGR + * @arg TIM_DMABASE_CCMR1 + * @arg TIM_DMABASE_CCMR2 + * @arg TIM_DMABASE_CCER + * @arg TIM_DMABASE_CNT + * @arg TIM_DMABASE_PSC + * @arg TIM_DMABASE_ARR + * @arg TIM_DMABASE_RCR + * @arg TIM_DMABASE_CCR1 + * @arg TIM_DMABASE_CCR2 + * @arg TIM_DMABASE_CCR3 + * @arg TIM_DMABASE_CCR4 + * @arg TIM_DMABASE_BDTR + * @arg TIM_DMABASE_OR + * @arg TIM_DMABASE_CCMR3 (*) + * @arg TIM_DMABASE_CCR5 (*) + * @arg TIM_DMABASE_CCR6 (*) + * (*) value not defined in all devices + * @param BurstRequestSrc TIM DMA Request sources + * This parameter can be one of the following values: + * @arg TIM_DMA_UPDATE: TIM update Interrupt source + * @arg TIM_DMA_CC1: TIM Capture Compare 1 DMA source + * @arg TIM_DMA_CC2: TIM Capture Compare 2 DMA source + * @arg TIM_DMA_CC3: TIM Capture Compare 3 DMA source + * @arg TIM_DMA_CC4: TIM Capture Compare 4 DMA source + * @arg TIM_DMA_COM: TIM Commutation DMA source + * @arg TIM_DMA_TRIGGER: TIM Trigger DMA source + * @param BurstBuffer The Buffer address. + * @param BurstLength DMA Burst length. This parameter can be one value + * between: TIM_DMABURSTLENGTH_1TRANSFER and TIM_DMABURSTLENGTH_18TRANSFERS. + * @param DataLength Data length. This parameter can be one value + * between 1 and 0xFFFF. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_DMABurst_MultiReadStart(TIM_HandleTypeDef *htim, uint32_t BurstBaseAddress, + uint32_t BurstRequestSrc, uint32_t *BurstBuffer, + uint32_t BurstLength, uint32_t DataLength) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_DMABURST_INSTANCE(htim->Instance)); + assert_param(IS_TIM_DMA_BASE(BurstBaseAddress)); + assert_param(IS_TIM_DMA_SOURCE(BurstRequestSrc)); + assert_param(IS_TIM_DMA_LENGTH(BurstLength)); + assert_param(IS_TIM_DMA_DATA_LENGTH(DataLength)); + + if (htim->DMABurstState == HAL_DMA_BURST_STATE_BUSY) + { + return HAL_BUSY; + } + else if (htim->DMABurstState == HAL_DMA_BURST_STATE_READY) + { + if ((BurstBuffer == NULL) && (BurstLength > 0U)) + { + return HAL_ERROR; + } + else + { + htim->DMABurstState = HAL_DMA_BURST_STATE_BUSY; + } + } + else + { + /* nothing to do */ + } + switch (BurstRequestSrc) + { + case TIM_DMA_UPDATE: + { + /* Set the DMA Period elapsed callbacks */ + htim->hdma[TIM_DMA_ID_UPDATE]->XferCpltCallback = TIM_DMAPeriodElapsedCplt; + htim->hdma[TIM_DMA_ID_UPDATE]->XferHalfCpltCallback = TIM_DMAPeriodElapsedHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_UPDATE]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_UPDATE], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, + DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_CC1: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, + DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_CC2: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, + DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_CC3: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, + DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_CC4: + { + /* Set the DMA capture callbacks */ + htim->hdma[TIM_DMA_ID_CC4]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC4]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC4]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC4], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, + DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_COM: + { + /* Set the DMA commutation callbacks */ + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = TIMEx_DMACommutationCplt; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferHalfCpltCallback = TIMEx_DMACommutationHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_COMMUTATION], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, + DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + case TIM_DMA_TRIGGER: + { + /* Set the DMA trigger callbacks */ + htim->hdma[TIM_DMA_ID_TRIGGER]->XferCpltCallback = TIM_DMATriggerCplt; + htim->hdma[TIM_DMA_ID_TRIGGER]->XferHalfCpltCallback = TIM_DMATriggerHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_TRIGGER]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_TRIGGER], (uint32_t)&htim->Instance->DMAR, (uint32_t)BurstBuffer, + DataLength) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + break; + } + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Configure the DMA Burst Mode */ + htim->Instance->DCR = (BurstBaseAddress | BurstLength); + + /* Enable the TIM DMA Request */ + __HAL_TIM_ENABLE_DMA(htim, BurstRequestSrc); + } + + /* Return function status */ + return status; +} + +/** + * @brief Stop the DMA burst reading + * @param htim TIM handle + * @param BurstRequestSrc TIM DMA Request sources to disable. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_DMABurst_ReadStop(TIM_HandleTypeDef *htim, uint32_t BurstRequestSrc) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_DMA_SOURCE(BurstRequestSrc)); + + /* Abort the DMA transfer (at least disable the DMA channel) */ + switch (BurstRequestSrc) + { + case TIM_DMA_UPDATE: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_UPDATE]); + break; + } + case TIM_DMA_CC1: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + break; + } + case TIM_DMA_CC2: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + break; + } + case TIM_DMA_CC3: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]); + break; + } + case TIM_DMA_CC4: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC4]); + break; + } + case TIM_DMA_COM: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_COMMUTATION]); + break; + } + case TIM_DMA_TRIGGER: + { + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_TRIGGER]); + break; + } + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the TIM Update DMA request */ + __HAL_TIM_DISABLE_DMA(htim, BurstRequestSrc); + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + } + + /* Return function status */ + return status; +} + +/** + * @brief Generate a software event + * @param htim TIM handle + * @param EventSource specifies the event source. + * This parameter can be one of the following values: + * @arg TIM_EVENTSOURCE_UPDATE: Timer update Event source + * @arg TIM_EVENTSOURCE_CC1: Timer Capture Compare 1 Event source + * @arg TIM_EVENTSOURCE_CC2: Timer Capture Compare 2 Event source + * @arg TIM_EVENTSOURCE_CC3: Timer Capture Compare 3 Event source + * @arg TIM_EVENTSOURCE_CC4: Timer Capture Compare 4 Event source + * @arg TIM_EVENTSOURCE_COM: Timer COM event source + * @arg TIM_EVENTSOURCE_TRIGGER: Timer Trigger Event source + * @arg TIM_EVENTSOURCE_BREAK: Timer Break event source + * @arg TIM_EVENTSOURCE_BREAK2: Timer Break2 event source + * @note Basic timers can only generate an update event. + * @note TIM_EVENTSOURCE_COM is relevant only with advanced timer instances. + * @note TIM_EVENTSOURCE_BREAK are relevant only for timer instances + * supporting a break input. + * @retval HAL status + */ + +HAL_StatusTypeDef HAL_TIM_GenerateEvent(TIM_HandleTypeDef *htim, uint32_t EventSource) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + assert_param(IS_TIM_EVENT_SOURCE(EventSource)); + + /* Process Locked */ + __HAL_LOCK(htim); + + /* Change the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Set the event sources */ + htim->Instance->EGR = EventSource; + + /* Change the TIM state */ + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Configures the OCRef clear feature + * @param htim TIM handle + * @param sClearInputConfig pointer to a TIM_ClearInputConfigTypeDef structure that + * contains the OCREF clear feature and parameters for the TIM peripheral. + * @param Channel specifies the TIM Channel + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 + * @arg TIM_CHANNEL_2: TIM Channel 2 + * @arg TIM_CHANNEL_3: TIM Channel 3 + * @arg TIM_CHANNEL_4: TIM Channel 4 + * @arg TIM_CHANNEL_5: TIM Channel 5 (*) + * @arg TIM_CHANNEL_6: TIM Channel 6 (*) + * (*) Value not defined for all devices + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_ConfigOCrefClear(TIM_HandleTypeDef *htim, + const TIM_ClearInputConfigTypeDef *sClearInputConfig, + uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_OCXREF_CLEAR_INSTANCE(htim->Instance)); + assert_param(IS_TIM_CLEARINPUT_SOURCE(sClearInputConfig->ClearInputSource)); + + /* Process Locked */ + __HAL_LOCK(htim); + + htim->State = HAL_TIM_STATE_BUSY; + + switch (sClearInputConfig->ClearInputSource) + { + case TIM_CLEARINPUTSOURCE_NONE: + { + /* Clear the OCREF clear selection bit and the the ETR Bits */ +#if defined(TIM_SMCR_OCCS) + CLEAR_BIT(htim->Instance->SMCR, (TIM_SMCR_OCCS | TIM_SMCR_ETF | TIM_SMCR_ETPS | TIM_SMCR_ECE | TIM_SMCR_ETP)); +#else + CLEAR_BIT(htim->Instance->SMCR, (TIM_SMCR_ETF | TIM_SMCR_ETPS | TIM_SMCR_ECE | TIM_SMCR_ETP)); +#endif /* TIM_SMCR_OCCS */ + break; + } +#if defined(TIM_SMCR_OCCS) + case TIM_CLEARINPUTSOURCE_OCREFCLR: + { + /* Clear the OCREF clear selection bit */ + CLEAR_BIT(htim->Instance->SMCR, TIM_SMCR_OCCS); + break; + } +#endif /* TIM_SMCR_OCCS */ + + case TIM_CLEARINPUTSOURCE_ETR: + { + /* Check the parameters */ + assert_param(IS_TIM_CLEARINPUT_POLARITY(sClearInputConfig->ClearInputPolarity)); + assert_param(IS_TIM_CLEARINPUT_PRESCALER(sClearInputConfig->ClearInputPrescaler)); + assert_param(IS_TIM_CLEARINPUT_FILTER(sClearInputConfig->ClearInputFilter)); + + /* When OCRef clear feature is used with ETR source, ETR prescaler must be off */ + if (sClearInputConfig->ClearInputPrescaler != TIM_CLEARINPUTPRESCALER_DIV1) + { + htim->State = HAL_TIM_STATE_READY; + __HAL_UNLOCK(htim); + return HAL_ERROR; + } + + TIM_ETR_SetConfig(htim->Instance, + sClearInputConfig->ClearInputPrescaler, + sClearInputConfig->ClearInputPolarity, + sClearInputConfig->ClearInputFilter); +#if defined(TIM_SMCR_OCCS) + + /* Set the OCREF clear selection bit */ + SET_BIT(htim->Instance->SMCR, TIM_SMCR_OCCS); +#endif /* TIM_SMCR_OCCS */ + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + switch (Channel) + { + case TIM_CHANNEL_1: + { + if (sClearInputConfig->ClearInputState != (uint32_t)DISABLE) + { + /* Enable the OCREF clear feature for Channel 1 */ + SET_BIT(htim->Instance->CCMR1, TIM_CCMR1_OC1CE); + } + else + { + /* Disable the OCREF clear feature for Channel 1 */ + CLEAR_BIT(htim->Instance->CCMR1, TIM_CCMR1_OC1CE); + } + break; + } + case TIM_CHANNEL_2: + { + if (sClearInputConfig->ClearInputState != (uint32_t)DISABLE) + { + /* Enable the OCREF clear feature for Channel 2 */ + SET_BIT(htim->Instance->CCMR1, TIM_CCMR1_OC2CE); + } + else + { + /* Disable the OCREF clear feature for Channel 2 */ + CLEAR_BIT(htim->Instance->CCMR1, TIM_CCMR1_OC2CE); + } + break; + } + case TIM_CHANNEL_3: + { + if (sClearInputConfig->ClearInputState != (uint32_t)DISABLE) + { + /* Enable the OCREF clear feature for Channel 3 */ + SET_BIT(htim->Instance->CCMR2, TIM_CCMR2_OC3CE); + } + else + { + /* Disable the OCREF clear feature for Channel 3 */ + CLEAR_BIT(htim->Instance->CCMR2, TIM_CCMR2_OC3CE); + } + break; + } + case TIM_CHANNEL_4: + { + if (sClearInputConfig->ClearInputState != (uint32_t)DISABLE) + { + /* Enable the OCREF clear feature for Channel 4 */ + SET_BIT(htim->Instance->CCMR2, TIM_CCMR2_OC4CE); + } + else + { + /* Disable the OCREF clear feature for Channel 4 */ + CLEAR_BIT(htim->Instance->CCMR2, TIM_CCMR2_OC4CE); + } + break; + } +#if defined(TIM_CCER_CC5E) + case TIM_CHANNEL_5: + { + if (sClearInputConfig->ClearInputState != (uint32_t)DISABLE) + { + /* Enable the OCREF clear feature for Channel 5 */ + SET_BIT(htim->Instance->CCMR3, TIM_CCMR3_OC5CE); + } + else + { + /* Disable the OCREF clear feature for Channel 5 */ + CLEAR_BIT(htim->Instance->CCMR3, TIM_CCMR3_OC5CE); + } + break; + } +#endif /* TIM_CCER_CC5E */ +#if defined(TIM_CCER_CC6E) + case TIM_CHANNEL_6: + { + if (sClearInputConfig->ClearInputState != (uint32_t)DISABLE) + { + /* Enable the OCREF clear feature for Channel 6 */ + SET_BIT(htim->Instance->CCMR3, TIM_CCMR3_OC6CE); + } + else + { + /* Disable the OCREF clear feature for Channel 6 */ + CLEAR_BIT(htim->Instance->CCMR3, TIM_CCMR3_OC6CE); + } + break; + } +#endif /* TIM_CCER_CC6E */ + default: + break; + } + } + + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + return status; +} + +/** + * @brief Configures the clock source to be used + * @param htim TIM handle + * @param sClockSourceConfig pointer to a TIM_ClockConfigTypeDef structure that + * contains the clock source information for the TIM peripheral. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_ConfigClockSource(TIM_HandleTypeDef *htim, const TIM_ClockConfigTypeDef *sClockSourceConfig) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Process Locked */ + __HAL_LOCK(htim); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Check the parameters */ + assert_param(IS_TIM_CLOCKSOURCE(sClockSourceConfig->ClockSource)); + + /* Reset the SMS, TS, ECE, ETPS and ETRF bits */ + tmpsmcr = htim->Instance->SMCR; + tmpsmcr &= ~(TIM_SMCR_SMS | TIM_SMCR_TS); + tmpsmcr &= ~(TIM_SMCR_ETF | TIM_SMCR_ETPS | TIM_SMCR_ECE | TIM_SMCR_ETP); + htim->Instance->SMCR = tmpsmcr; + + switch (sClockSourceConfig->ClockSource) + { + case TIM_CLOCKSOURCE_INTERNAL: + { + assert_param(IS_TIM_INSTANCE(htim->Instance)); + break; + } + + case TIM_CLOCKSOURCE_ETRMODE1: + { + /* Check whether or not the timer instance supports external trigger input mode 1 (ETRF)*/ + assert_param(IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(htim->Instance)); + + /* Check ETR input conditioning related parameters */ + assert_param(IS_TIM_CLOCKPRESCALER(sClockSourceConfig->ClockPrescaler)); + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + /* Configure the ETR Clock source */ + TIM_ETR_SetConfig(htim->Instance, + sClockSourceConfig->ClockPrescaler, + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + + /* Select the External clock mode1 and the ETRF trigger */ + tmpsmcr = htim->Instance->SMCR; + tmpsmcr |= (TIM_SLAVEMODE_EXTERNAL1 | TIM_CLOCKSOURCE_ETRMODE1); + /* Write to TIMx SMCR */ + htim->Instance->SMCR = tmpsmcr; + break; + } + + case TIM_CLOCKSOURCE_ETRMODE2: + { + /* Check whether or not the timer instance supports external trigger input mode 2 (ETRF)*/ + assert_param(IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(htim->Instance)); + + /* Check ETR input conditioning related parameters */ + assert_param(IS_TIM_CLOCKPRESCALER(sClockSourceConfig->ClockPrescaler)); + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + /* Configure the ETR Clock source */ + TIM_ETR_SetConfig(htim->Instance, + sClockSourceConfig->ClockPrescaler, + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + /* Enable the External clock mode2 */ + htim->Instance->SMCR |= TIM_SMCR_ECE; + break; + } + + case TIM_CLOCKSOURCE_TI1: + { + /* Check whether or not the timer instance supports external clock mode 1 */ + assert_param(IS_TIM_CLOCKSOURCE_TIX_INSTANCE(htim->Instance)); + + /* Check TI1 input conditioning related parameters */ + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + TIM_TI1_ConfigInputStage(htim->Instance, + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + TIM_ITRx_SetConfig(htim->Instance, TIM_CLOCKSOURCE_TI1); + break; + } + + case TIM_CLOCKSOURCE_TI2: + { + /* Check whether or not the timer instance supports external clock mode 1 (ETRF)*/ + assert_param(IS_TIM_CLOCKSOURCE_TIX_INSTANCE(htim->Instance)); + + /* Check TI2 input conditioning related parameters */ + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + TIM_TI2_ConfigInputStage(htim->Instance, + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + TIM_ITRx_SetConfig(htim->Instance, TIM_CLOCKSOURCE_TI2); + break; + } + + case TIM_CLOCKSOURCE_TI1ED: + { + /* Check whether or not the timer instance supports external clock mode 1 */ + assert_param(IS_TIM_CLOCKSOURCE_TIX_INSTANCE(htim->Instance)); + + /* Check TI1 input conditioning related parameters */ + assert_param(IS_TIM_CLOCKPOLARITY(sClockSourceConfig->ClockPolarity)); + assert_param(IS_TIM_CLOCKFILTER(sClockSourceConfig->ClockFilter)); + + TIM_TI1_ConfigInputStage(htim->Instance, + sClockSourceConfig->ClockPolarity, + sClockSourceConfig->ClockFilter); + TIM_ITRx_SetConfig(htim->Instance, TIM_CLOCKSOURCE_TI1ED); + break; + } + + case TIM_CLOCKSOURCE_ITR0: + case TIM_CLOCKSOURCE_ITR1: + case TIM_CLOCKSOURCE_ITR2: + case TIM_CLOCKSOURCE_ITR3: + { + /* Check whether or not the timer instance supports internal trigger input */ + assert_param(IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(htim->Instance)); + + TIM_ITRx_SetConfig(htim->Instance, sClockSourceConfig->ClockSource); + break; + } + + default: + status = HAL_ERROR; + break; + } + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + return status; +} + +/** + * @brief Selects the signal connected to the TI1 input: direct from CH1_input + * or a XOR combination between CH1_input, CH2_input & CH3_input + * @param htim TIM handle. + * @param TI1_Selection Indicate whether or not channel 1 is connected to the + * output of a XOR gate. + * This parameter can be one of the following values: + * @arg TIM_TI1SELECTION_CH1: The TIMx_CH1 pin is connected to TI1 input + * @arg TIM_TI1SELECTION_XORCOMBINATION: The TIMx_CH1, CH2 and CH3 + * pins are connected to the TI1 input (XOR combination) + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_ConfigTI1Input(TIM_HandleTypeDef *htim, uint32_t TI1_Selection) +{ + uint32_t tmpcr2; + + /* Check the parameters */ + assert_param(IS_TIM_XOR_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TI1SELECTION(TI1_Selection)); + + /* Get the TIMx CR2 register value */ + tmpcr2 = htim->Instance->CR2; + + /* Reset the TI1 selection */ + tmpcr2 &= ~TIM_CR2_TI1S; + + /* Set the TI1 selection */ + tmpcr2 |= TI1_Selection; + + /* Write to TIMxCR2 */ + htim->Instance->CR2 = tmpcr2; + + return HAL_OK; +} + +/** + * @brief Configures the TIM in Slave mode + * @param htim TIM handle. + * @param sSlaveConfig pointer to a TIM_SlaveConfigTypeDef structure that + * contains the selected trigger (internal trigger input, filtered + * timer input or external trigger input) and the Slave mode + * (Disable, Reset, Gated, Trigger, External clock mode 1). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchro(TIM_HandleTypeDef *htim, const TIM_SlaveConfigTypeDef *sSlaveConfig) +{ + /* Check the parameters */ + assert_param(IS_TIM_SLAVE_INSTANCE(htim->Instance)); + assert_param(IS_TIM_SLAVE_MODE(sSlaveConfig->SlaveMode)); + assert_param(IS_TIM_TRIGGER_SELECTION(sSlaveConfig->InputTrigger)); + + __HAL_LOCK(htim); + + htim->State = HAL_TIM_STATE_BUSY; + + if (TIM_SlaveTimer_SetConfig(htim, sSlaveConfig) != HAL_OK) + { + htim->State = HAL_TIM_STATE_READY; + __HAL_UNLOCK(htim); + return HAL_ERROR; + } + + /* Disable Trigger Interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_TRIGGER); + + /* Disable Trigger DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_TRIGGER); + + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Configures the TIM in Slave mode in interrupt mode + * @param htim TIM handle. + * @param sSlaveConfig pointer to a TIM_SlaveConfigTypeDef structure that + * contains the selected trigger (internal trigger input, filtered + * timer input or external trigger input) and the Slave mode + * (Disable, Reset, Gated, Trigger, External clock mode 1). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIM_SlaveConfigSynchro_IT(TIM_HandleTypeDef *htim, + const TIM_SlaveConfigTypeDef *sSlaveConfig) +{ + /* Check the parameters */ + assert_param(IS_TIM_SLAVE_INSTANCE(htim->Instance)); + assert_param(IS_TIM_SLAVE_MODE(sSlaveConfig->SlaveMode)); + assert_param(IS_TIM_TRIGGER_SELECTION(sSlaveConfig->InputTrigger)); + + __HAL_LOCK(htim); + + htim->State = HAL_TIM_STATE_BUSY; + + if (TIM_SlaveTimer_SetConfig(htim, sSlaveConfig) != HAL_OK) + { + htim->State = HAL_TIM_STATE_READY; + __HAL_UNLOCK(htim); + return HAL_ERROR; + } + + /* Enable Trigger Interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_TRIGGER); + + /* Disable Trigger DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_TRIGGER); + + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Read the captured value from Capture Compare unit + * @param htim TIM handle. + * @param Channel TIM Channels to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @arg TIM_CHANNEL_4: TIM Channel 4 selected + * @retval Captured value + */ +uint32_t HAL_TIM_ReadCapturedValue(const TIM_HandleTypeDef *htim, uint32_t Channel) +{ + uint32_t tmpreg = 0U; + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + + /* Return the capture 1 value */ + tmpreg = htim->Instance->CCR1; + + break; + } + case TIM_CHANNEL_2: + { + /* Check the parameters */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + + /* Return the capture 2 value */ + tmpreg = htim->Instance->CCR2; + + break; + } + + case TIM_CHANNEL_3: + { + /* Check the parameters */ + assert_param(IS_TIM_CC3_INSTANCE(htim->Instance)); + + /* Return the capture 3 value */ + tmpreg = htim->Instance->CCR3; + + break; + } + + case TIM_CHANNEL_4: + { + /* Check the parameters */ + assert_param(IS_TIM_CC4_INSTANCE(htim->Instance)); + + /* Return the capture 4 value */ + tmpreg = htim->Instance->CCR4; + + break; + } + + default: + break; + } + + return tmpreg; +} + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group9 TIM Callbacks functions + * @brief TIM Callbacks functions + * +@verbatim + ============================================================================== + ##### TIM Callbacks functions ##### + ============================================================================== + [..] + This section provides TIM callback functions: + (+) TIM Period elapsed callback + (+) TIM Output Compare callback + (+) TIM Input capture callback + (+) TIM Trigger callback + (+) TIM Error callback + +@endverbatim + * @{ + */ + +/** + * @brief Period elapsed callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_PeriodElapsedCallback could be implemented in the user file + */ +} + +/** + * @brief Period elapsed half complete callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_PeriodElapsedHalfCpltCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_PeriodElapsedHalfCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Output Compare callback in non-blocking mode + * @param htim TIM OC handle + * @retval None + */ +__weak void HAL_TIM_OC_DelayElapsedCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_OC_DelayElapsedCallback could be implemented in the user file + */ +} + +/** + * @brief Input Capture callback in non-blocking mode + * @param htim TIM IC handle + * @retval None + */ +__weak void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_IC_CaptureCallback could be implemented in the user file + */ +} + +/** + * @brief Input Capture half complete callback in non-blocking mode + * @param htim TIM IC handle + * @retval None + */ +__weak void HAL_TIM_IC_CaptureHalfCpltCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_IC_CaptureHalfCpltCallback could be implemented in the user file + */ +} + +/** + * @brief PWM Pulse finished callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_PWM_PulseFinishedCallback could be implemented in the user file + */ +} + +/** + * @brief PWM Pulse finished half complete callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_PWM_PulseFinishedHalfCpltCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_PWM_PulseFinishedHalfCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Hall Trigger detection callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_TriggerCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_TriggerCallback could be implemented in the user file + */ +} + +/** + * @brief Hall Trigger detection half complete callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_TriggerHalfCpltCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_TriggerHalfCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Timer error callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIM_ErrorCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIM_ErrorCallback could be implemented in the user file + */ +} + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) +/** + * @brief Register a User TIM callback to be used instead of the weak predefined callback + * @param htim tim handle + * @param CallbackID ID of the callback to be registered + * This parameter can be one of the following values: + * @arg @ref HAL_TIM_BASE_MSPINIT_CB_ID Base MspInit Callback ID + * @arg @ref HAL_TIM_BASE_MSPDEINIT_CB_ID Base MspDeInit Callback ID + * @arg @ref HAL_TIM_IC_MSPINIT_CB_ID IC MspInit Callback ID + * @arg @ref HAL_TIM_IC_MSPDEINIT_CB_ID IC MspDeInit Callback ID + * @arg @ref HAL_TIM_OC_MSPINIT_CB_ID OC MspInit Callback ID + * @arg @ref HAL_TIM_OC_MSPDEINIT_CB_ID OC MspDeInit Callback ID + * @arg @ref HAL_TIM_PWM_MSPINIT_CB_ID PWM MspInit Callback ID + * @arg @ref HAL_TIM_PWM_MSPDEINIT_CB_ID PWM MspDeInit Callback ID + * @arg @ref HAL_TIM_ONE_PULSE_MSPINIT_CB_ID One Pulse MspInit Callback ID + * @arg @ref HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID One Pulse MspDeInit Callback ID + * @arg @ref HAL_TIM_ENCODER_MSPINIT_CB_ID Encoder MspInit Callback ID + * @arg @ref HAL_TIM_ENCODER_MSPDEINIT_CB_ID Encoder MspDeInit Callback ID + * @arg @ref HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID Hall Sensor MspInit Callback ID + * @arg @ref HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID Hall Sensor MspDeInit Callback ID + * @arg @ref HAL_TIM_PERIOD_ELAPSED_CB_ID Period Elapsed Callback ID + * @arg @ref HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID Period Elapsed half complete Callback ID + * @arg @ref HAL_TIM_TRIGGER_CB_ID Trigger Callback ID + * @arg @ref HAL_TIM_TRIGGER_HALF_CB_ID Trigger half complete Callback ID + * @arg @ref HAL_TIM_IC_CAPTURE_CB_ID Input Capture Callback ID + * @arg @ref HAL_TIM_IC_CAPTURE_HALF_CB_ID Input Capture half complete Callback ID + * @arg @ref HAL_TIM_OC_DELAY_ELAPSED_CB_ID Output Compare Delay Elapsed Callback ID + * @arg @ref HAL_TIM_PWM_PULSE_FINISHED_CB_ID PWM Pulse Finished Callback ID + * @arg @ref HAL_TIM_PWM_PULSE_FINISHED_HALF_CB_ID PWM Pulse Finished half complete Callback ID + * @arg @ref HAL_TIM_ERROR_CB_ID Error Callback ID + * @arg @ref HAL_TIM_COMMUTATION_CB_ID Commutation Callback ID + * @arg @ref HAL_TIM_COMMUTATION_HALF_CB_ID Commutation half complete Callback ID + * @arg @ref HAL_TIM_BREAK_CB_ID Break Callback ID +#if defined(TIM_BDTR_BK2E) + * @arg @ref HAL_TIM_BREAK2_CB_ID Break2 Callback ID +#endif + * @param pCallback pointer to the callback function + * @retval status + */ +HAL_StatusTypeDef HAL_TIM_RegisterCallback(TIM_HandleTypeDef *htim, HAL_TIM_CallbackIDTypeDef CallbackID, + pTIM_CallbackTypeDef pCallback) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (pCallback == NULL) + { + return HAL_ERROR; + } + + if (htim->State == HAL_TIM_STATE_READY) + { + switch (CallbackID) + { + case HAL_TIM_BASE_MSPINIT_CB_ID : + htim->Base_MspInitCallback = pCallback; + break; + + case HAL_TIM_BASE_MSPDEINIT_CB_ID : + htim->Base_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_IC_MSPINIT_CB_ID : + htim->IC_MspInitCallback = pCallback; + break; + + case HAL_TIM_IC_MSPDEINIT_CB_ID : + htim->IC_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_OC_MSPINIT_CB_ID : + htim->OC_MspInitCallback = pCallback; + break; + + case HAL_TIM_OC_MSPDEINIT_CB_ID : + htim->OC_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_PWM_MSPINIT_CB_ID : + htim->PWM_MspInitCallback = pCallback; + break; + + case HAL_TIM_PWM_MSPDEINIT_CB_ID : + htim->PWM_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_ONE_PULSE_MSPINIT_CB_ID : + htim->OnePulse_MspInitCallback = pCallback; + break; + + case HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID : + htim->OnePulse_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_ENCODER_MSPINIT_CB_ID : + htim->Encoder_MspInitCallback = pCallback; + break; + + case HAL_TIM_ENCODER_MSPDEINIT_CB_ID : + htim->Encoder_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID : + htim->HallSensor_MspInitCallback = pCallback; + break; + + case HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID : + htim->HallSensor_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_PERIOD_ELAPSED_CB_ID : + htim->PeriodElapsedCallback = pCallback; + break; + + case HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID : + htim->PeriodElapsedHalfCpltCallback = pCallback; + break; + + case HAL_TIM_TRIGGER_CB_ID : + htim->TriggerCallback = pCallback; + break; + + case HAL_TIM_TRIGGER_HALF_CB_ID : + htim->TriggerHalfCpltCallback = pCallback; + break; + + case HAL_TIM_IC_CAPTURE_CB_ID : + htim->IC_CaptureCallback = pCallback; + break; + + case HAL_TIM_IC_CAPTURE_HALF_CB_ID : + htim->IC_CaptureHalfCpltCallback = pCallback; + break; + + case HAL_TIM_OC_DELAY_ELAPSED_CB_ID : + htim->OC_DelayElapsedCallback = pCallback; + break; + + case HAL_TIM_PWM_PULSE_FINISHED_CB_ID : + htim->PWM_PulseFinishedCallback = pCallback; + break; + + case HAL_TIM_PWM_PULSE_FINISHED_HALF_CB_ID : + htim->PWM_PulseFinishedHalfCpltCallback = pCallback; + break; + + case HAL_TIM_ERROR_CB_ID : + htim->ErrorCallback = pCallback; + break; + + case HAL_TIM_COMMUTATION_CB_ID : + htim->CommutationCallback = pCallback; + break; + + case HAL_TIM_COMMUTATION_HALF_CB_ID : + htim->CommutationHalfCpltCallback = pCallback; + break; + + case HAL_TIM_BREAK_CB_ID : + htim->BreakCallback = pCallback; + break; +#if defined(TIM_BDTR_BK2E) + + case HAL_TIM_BREAK2_CB_ID : + htim->Break2Callback = pCallback; + break; +#endif /* TIM_BDTR_BK2E */ + + default : + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else if (htim->State == HAL_TIM_STATE_RESET) + { + switch (CallbackID) + { + case HAL_TIM_BASE_MSPINIT_CB_ID : + htim->Base_MspInitCallback = pCallback; + break; + + case HAL_TIM_BASE_MSPDEINIT_CB_ID : + htim->Base_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_IC_MSPINIT_CB_ID : + htim->IC_MspInitCallback = pCallback; + break; + + case HAL_TIM_IC_MSPDEINIT_CB_ID : + htim->IC_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_OC_MSPINIT_CB_ID : + htim->OC_MspInitCallback = pCallback; + break; + + case HAL_TIM_OC_MSPDEINIT_CB_ID : + htim->OC_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_PWM_MSPINIT_CB_ID : + htim->PWM_MspInitCallback = pCallback; + break; + + case HAL_TIM_PWM_MSPDEINIT_CB_ID : + htim->PWM_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_ONE_PULSE_MSPINIT_CB_ID : + htim->OnePulse_MspInitCallback = pCallback; + break; + + case HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID : + htim->OnePulse_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_ENCODER_MSPINIT_CB_ID : + htim->Encoder_MspInitCallback = pCallback; + break; + + case HAL_TIM_ENCODER_MSPDEINIT_CB_ID : + htim->Encoder_MspDeInitCallback = pCallback; + break; + + case HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID : + htim->HallSensor_MspInitCallback = pCallback; + break; + + case HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID : + htim->HallSensor_MspDeInitCallback = pCallback; + break; + + default : + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else + { + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} + +/** + * @brief Unregister a TIM callback + * TIM callback is redirected to the weak predefined callback + * @param htim tim handle + * @param CallbackID ID of the callback to be unregistered + * This parameter can be one of the following values: + * @arg @ref HAL_TIM_BASE_MSPINIT_CB_ID Base MspInit Callback ID + * @arg @ref HAL_TIM_BASE_MSPDEINIT_CB_ID Base MspDeInit Callback ID + * @arg @ref HAL_TIM_IC_MSPINIT_CB_ID IC MspInit Callback ID + * @arg @ref HAL_TIM_IC_MSPDEINIT_CB_ID IC MspDeInit Callback ID + * @arg @ref HAL_TIM_OC_MSPINIT_CB_ID OC MspInit Callback ID + * @arg @ref HAL_TIM_OC_MSPDEINIT_CB_ID OC MspDeInit Callback ID + * @arg @ref HAL_TIM_PWM_MSPINIT_CB_ID PWM MspInit Callback ID + * @arg @ref HAL_TIM_PWM_MSPDEINIT_CB_ID PWM MspDeInit Callback ID + * @arg @ref HAL_TIM_ONE_PULSE_MSPINIT_CB_ID One Pulse MspInit Callback ID + * @arg @ref HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID One Pulse MspDeInit Callback ID + * @arg @ref HAL_TIM_ENCODER_MSPINIT_CB_ID Encoder MspInit Callback ID + * @arg @ref HAL_TIM_ENCODER_MSPDEINIT_CB_ID Encoder MspDeInit Callback ID + * @arg @ref HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID Hall Sensor MspInit Callback ID + * @arg @ref HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID Hall Sensor MspDeInit Callback ID + * @arg @ref HAL_TIM_PERIOD_ELAPSED_CB_ID Period Elapsed Callback ID + * @arg @ref HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID Period Elapsed half complete Callback ID + * @arg @ref HAL_TIM_TRIGGER_CB_ID Trigger Callback ID + * @arg @ref HAL_TIM_TRIGGER_HALF_CB_ID Trigger half complete Callback ID + * @arg @ref HAL_TIM_IC_CAPTURE_CB_ID Input Capture Callback ID + * @arg @ref HAL_TIM_IC_CAPTURE_HALF_CB_ID Input Capture half complete Callback ID + * @arg @ref HAL_TIM_OC_DELAY_ELAPSED_CB_ID Output Compare Delay Elapsed Callback ID + * @arg @ref HAL_TIM_PWM_PULSE_FINISHED_CB_ID PWM Pulse Finished Callback ID + * @arg @ref HAL_TIM_PWM_PULSE_FINISHED_HALF_CB_ID PWM Pulse Finished half complete Callback ID + * @arg @ref HAL_TIM_ERROR_CB_ID Error Callback ID + * @arg @ref HAL_TIM_COMMUTATION_CB_ID Commutation Callback ID + * @arg @ref HAL_TIM_COMMUTATION_HALF_CB_ID Commutation half complete Callback ID + * @arg @ref HAL_TIM_BREAK_CB_ID Break Callback ID +#if defined(TIM_BDTR_BK2E) + * @arg @ref HAL_TIM_BREAK2_CB_ID Break2 Callback ID +#endif + * @retval status + */ +HAL_StatusTypeDef HAL_TIM_UnRegisterCallback(TIM_HandleTypeDef *htim, HAL_TIM_CallbackIDTypeDef CallbackID) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (htim->State == HAL_TIM_STATE_READY) + { + switch (CallbackID) + { + case HAL_TIM_BASE_MSPINIT_CB_ID : + /* Legacy weak Base MspInit Callback */ + htim->Base_MspInitCallback = HAL_TIM_Base_MspInit; + break; + + case HAL_TIM_BASE_MSPDEINIT_CB_ID : + /* Legacy weak Base Msp DeInit Callback */ + htim->Base_MspDeInitCallback = HAL_TIM_Base_MspDeInit; + break; + + case HAL_TIM_IC_MSPINIT_CB_ID : + /* Legacy weak IC Msp Init Callback */ + htim->IC_MspInitCallback = HAL_TIM_IC_MspInit; + break; + + case HAL_TIM_IC_MSPDEINIT_CB_ID : + /* Legacy weak IC Msp DeInit Callback */ + htim->IC_MspDeInitCallback = HAL_TIM_IC_MspDeInit; + break; + + case HAL_TIM_OC_MSPINIT_CB_ID : + /* Legacy weak OC Msp Init Callback */ + htim->OC_MspInitCallback = HAL_TIM_OC_MspInit; + break; + + case HAL_TIM_OC_MSPDEINIT_CB_ID : + /* Legacy weak OC Msp DeInit Callback */ + htim->OC_MspDeInitCallback = HAL_TIM_OC_MspDeInit; + break; + + case HAL_TIM_PWM_MSPINIT_CB_ID : + /* Legacy weak PWM Msp Init Callback */ + htim->PWM_MspInitCallback = HAL_TIM_PWM_MspInit; + break; + + case HAL_TIM_PWM_MSPDEINIT_CB_ID : + /* Legacy weak PWM Msp DeInit Callback */ + htim->PWM_MspDeInitCallback = HAL_TIM_PWM_MspDeInit; + break; + + case HAL_TIM_ONE_PULSE_MSPINIT_CB_ID : + /* Legacy weak One Pulse Msp Init Callback */ + htim->OnePulse_MspInitCallback = HAL_TIM_OnePulse_MspInit; + break; + + case HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID : + /* Legacy weak One Pulse Msp DeInit Callback */ + htim->OnePulse_MspDeInitCallback = HAL_TIM_OnePulse_MspDeInit; + break; + + case HAL_TIM_ENCODER_MSPINIT_CB_ID : + /* Legacy weak Encoder Msp Init Callback */ + htim->Encoder_MspInitCallback = HAL_TIM_Encoder_MspInit; + break; + + case HAL_TIM_ENCODER_MSPDEINIT_CB_ID : + /* Legacy weak Encoder Msp DeInit Callback */ + htim->Encoder_MspDeInitCallback = HAL_TIM_Encoder_MspDeInit; + break; + + case HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID : + /* Legacy weak Hall Sensor Msp Init Callback */ + htim->HallSensor_MspInitCallback = HAL_TIMEx_HallSensor_MspInit; + break; + + case HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID : + /* Legacy weak Hall Sensor Msp DeInit Callback */ + htim->HallSensor_MspDeInitCallback = HAL_TIMEx_HallSensor_MspDeInit; + break; + + case HAL_TIM_PERIOD_ELAPSED_CB_ID : + /* Legacy weak Period Elapsed Callback */ + htim->PeriodElapsedCallback = HAL_TIM_PeriodElapsedCallback; + break; + + case HAL_TIM_PERIOD_ELAPSED_HALF_CB_ID : + /* Legacy weak Period Elapsed half complete Callback */ + htim->PeriodElapsedHalfCpltCallback = HAL_TIM_PeriodElapsedHalfCpltCallback; + break; + + case HAL_TIM_TRIGGER_CB_ID : + /* Legacy weak Trigger Callback */ + htim->TriggerCallback = HAL_TIM_TriggerCallback; + break; + + case HAL_TIM_TRIGGER_HALF_CB_ID : + /* Legacy weak Trigger half complete Callback */ + htim->TriggerHalfCpltCallback = HAL_TIM_TriggerHalfCpltCallback; + break; + + case HAL_TIM_IC_CAPTURE_CB_ID : + /* Legacy weak IC Capture Callback */ + htim->IC_CaptureCallback = HAL_TIM_IC_CaptureCallback; + break; + + case HAL_TIM_IC_CAPTURE_HALF_CB_ID : + /* Legacy weak IC Capture half complete Callback */ + htim->IC_CaptureHalfCpltCallback = HAL_TIM_IC_CaptureHalfCpltCallback; + break; + + case HAL_TIM_OC_DELAY_ELAPSED_CB_ID : + /* Legacy weak OC Delay Elapsed Callback */ + htim->OC_DelayElapsedCallback = HAL_TIM_OC_DelayElapsedCallback; + break; + + case HAL_TIM_PWM_PULSE_FINISHED_CB_ID : + /* Legacy weak PWM Pulse Finished Callback */ + htim->PWM_PulseFinishedCallback = HAL_TIM_PWM_PulseFinishedCallback; + break; + + case HAL_TIM_PWM_PULSE_FINISHED_HALF_CB_ID : + /* Legacy weak PWM Pulse Finished half complete Callback */ + htim->PWM_PulseFinishedHalfCpltCallback = HAL_TIM_PWM_PulseFinishedHalfCpltCallback; + break; + + case HAL_TIM_ERROR_CB_ID : + /* Legacy weak Error Callback */ + htim->ErrorCallback = HAL_TIM_ErrorCallback; + break; + + case HAL_TIM_COMMUTATION_CB_ID : + /* Legacy weak Commutation Callback */ + htim->CommutationCallback = HAL_TIMEx_CommutCallback; + break; + + case HAL_TIM_COMMUTATION_HALF_CB_ID : + /* Legacy weak Commutation half complete Callback */ + htim->CommutationHalfCpltCallback = HAL_TIMEx_CommutHalfCpltCallback; + break; + + case HAL_TIM_BREAK_CB_ID : + /* Legacy weak Break Callback */ + htim->BreakCallback = HAL_TIMEx_BreakCallback; + break; +#if defined(TIM_BDTR_BK2E) + + case HAL_TIM_BREAK2_CB_ID : + /* Legacy weak Break2 Callback */ + htim->Break2Callback = HAL_TIMEx_Break2Callback; + break; +#endif /* TIM_BDTR_BK2E */ + + default : + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else if (htim->State == HAL_TIM_STATE_RESET) + { + switch (CallbackID) + { + case HAL_TIM_BASE_MSPINIT_CB_ID : + /* Legacy weak Base MspInit Callback */ + htim->Base_MspInitCallback = HAL_TIM_Base_MspInit; + break; + + case HAL_TIM_BASE_MSPDEINIT_CB_ID : + /* Legacy weak Base Msp DeInit Callback */ + htim->Base_MspDeInitCallback = HAL_TIM_Base_MspDeInit; + break; + + case HAL_TIM_IC_MSPINIT_CB_ID : + /* Legacy weak IC Msp Init Callback */ + htim->IC_MspInitCallback = HAL_TIM_IC_MspInit; + break; + + case HAL_TIM_IC_MSPDEINIT_CB_ID : + /* Legacy weak IC Msp DeInit Callback */ + htim->IC_MspDeInitCallback = HAL_TIM_IC_MspDeInit; + break; + + case HAL_TIM_OC_MSPINIT_CB_ID : + /* Legacy weak OC Msp Init Callback */ + htim->OC_MspInitCallback = HAL_TIM_OC_MspInit; + break; + + case HAL_TIM_OC_MSPDEINIT_CB_ID : + /* Legacy weak OC Msp DeInit Callback */ + htim->OC_MspDeInitCallback = HAL_TIM_OC_MspDeInit; + break; + + case HAL_TIM_PWM_MSPINIT_CB_ID : + /* Legacy weak PWM Msp Init Callback */ + htim->PWM_MspInitCallback = HAL_TIM_PWM_MspInit; + break; + + case HAL_TIM_PWM_MSPDEINIT_CB_ID : + /* Legacy weak PWM Msp DeInit Callback */ + htim->PWM_MspDeInitCallback = HAL_TIM_PWM_MspDeInit; + break; + + case HAL_TIM_ONE_PULSE_MSPINIT_CB_ID : + /* Legacy weak One Pulse Msp Init Callback */ + htim->OnePulse_MspInitCallback = HAL_TIM_OnePulse_MspInit; + break; + + case HAL_TIM_ONE_PULSE_MSPDEINIT_CB_ID : + /* Legacy weak One Pulse Msp DeInit Callback */ + htim->OnePulse_MspDeInitCallback = HAL_TIM_OnePulse_MspDeInit; + break; + + case HAL_TIM_ENCODER_MSPINIT_CB_ID : + /* Legacy weak Encoder Msp Init Callback */ + htim->Encoder_MspInitCallback = HAL_TIM_Encoder_MspInit; + break; + + case HAL_TIM_ENCODER_MSPDEINIT_CB_ID : + /* Legacy weak Encoder Msp DeInit Callback */ + htim->Encoder_MspDeInitCallback = HAL_TIM_Encoder_MspDeInit; + break; + + case HAL_TIM_HALL_SENSOR_MSPINIT_CB_ID : + /* Legacy weak Hall Sensor Msp Init Callback */ + htim->HallSensor_MspInitCallback = HAL_TIMEx_HallSensor_MspInit; + break; + + case HAL_TIM_HALL_SENSOR_MSPDEINIT_CB_ID : + /* Legacy weak Hall Sensor Msp DeInit Callback */ + htim->HallSensor_MspDeInitCallback = HAL_TIMEx_HallSensor_MspDeInit; + break; + + default : + /* Return error status */ + status = HAL_ERROR; + break; + } + } + else + { + /* Return error status */ + status = HAL_ERROR; + } + + return status; +} +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/** @defgroup TIM_Exported_Functions_Group10 TIM Peripheral State functions + * @brief TIM Peripheral State functions + * +@verbatim + ============================================================================== + ##### Peripheral State functions ##### + ============================================================================== + [..] + This subsection permits to get in run-time the status of the peripheral + and the data flow. + +@endverbatim + * @{ + */ + +/** + * @brief Return the TIM Base handle state. + * @param htim TIM Base handle + * @retval HAL state + */ +HAL_TIM_StateTypeDef HAL_TIM_Base_GetState(const TIM_HandleTypeDef *htim) +{ + return htim->State; +} + +/** + * @brief Return the TIM OC handle state. + * @param htim TIM Output Compare handle + * @retval HAL state + */ +HAL_TIM_StateTypeDef HAL_TIM_OC_GetState(const TIM_HandleTypeDef *htim) +{ + return htim->State; +} + +/** + * @brief Return the TIM PWM handle state. + * @param htim TIM handle + * @retval HAL state + */ +HAL_TIM_StateTypeDef HAL_TIM_PWM_GetState(const TIM_HandleTypeDef *htim) +{ + return htim->State; +} + +/** + * @brief Return the TIM Input Capture handle state. + * @param htim TIM IC handle + * @retval HAL state + */ +HAL_TIM_StateTypeDef HAL_TIM_IC_GetState(const TIM_HandleTypeDef *htim) +{ + return htim->State; +} + +/** + * @brief Return the TIM One Pulse Mode handle state. + * @param htim TIM OPM handle + * @retval HAL state + */ +HAL_TIM_StateTypeDef HAL_TIM_OnePulse_GetState(const TIM_HandleTypeDef *htim) +{ + return htim->State; +} + +/** + * @brief Return the TIM Encoder Mode handle state. + * @param htim TIM Encoder Interface handle + * @retval HAL state + */ +HAL_TIM_StateTypeDef HAL_TIM_Encoder_GetState(const TIM_HandleTypeDef *htim) +{ + return htim->State; +} + +/** + * @brief Return the TIM Encoder Mode handle state. + * @param htim TIM handle + * @retval Active channel + */ +HAL_TIM_ActiveChannel HAL_TIM_GetActiveChannel(const TIM_HandleTypeDef *htim) +{ + return htim->Channel; +} + +/** + * @brief Return actual state of the TIM channel. + * @param htim TIM handle + * @param Channel TIM Channel + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 + * @arg TIM_CHANNEL_2: TIM Channel 2 + * @arg TIM_CHANNEL_3: TIM Channel 3 + * @arg TIM_CHANNEL_4: TIM Channel 4 + * @arg TIM_CHANNEL_5: TIM Channel 5 + * @arg TIM_CHANNEL_6: TIM Channel 6 + * @retval TIM Channel state + */ +HAL_TIM_ChannelStateTypeDef HAL_TIM_GetChannelState(const TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_TIM_ChannelStateTypeDef channel_state; + + /* Check the parameters */ + assert_param(IS_TIM_CCX_INSTANCE(htim->Instance, Channel)); + + channel_state = TIM_CHANNEL_STATE_GET(htim, Channel); + + return channel_state; +} + +/** + * @brief Return actual state of a DMA burst operation. + * @param htim TIM handle + * @retval DMA burst state + */ +HAL_TIM_DMABurstStateTypeDef HAL_TIM_DMABurstState(const TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_DMABURST_INSTANCE(htim->Instance)); + + return htim->DMABurstState; +} + +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup TIM_Private_Functions TIM Private Functions + * @{ + */ + +/** + * @brief TIM DMA error callback + * @param hdma pointer to DMA handle. + * @retval None + */ +void TIM_DMAError(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY); + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC4]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_4, HAL_TIM_CHANNEL_STATE_READY); + } + else + { + htim->State = HAL_TIM_STATE_READY; + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->ErrorCallback(htim); +#else + HAL_TIM_ErrorCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief TIM DMA Delay Pulse complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +static void TIM_DMADelayPulseCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC4]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_4, HAL_TIM_CHANNEL_STATE_READY); + } + } + else + { + /* nothing to do */ + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_PWM_PulseFinishedCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief TIM DMA Delay Pulse half complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +void TIM_DMADelayPulseHalfCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC4]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + } + else + { + /* nothing to do */ + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->PWM_PulseFinishedHalfCpltCallback(htim); +#else + HAL_TIM_PWM_PulseFinishedHalfCpltCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief TIM DMA Capture complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +void TIM_DMACaptureCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC4]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_4, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_4, HAL_TIM_CHANNEL_STATE_READY); + } + } + else + { + /* nothing to do */ + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureCallback(htim); +#else + HAL_TIM_IC_CaptureCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief TIM DMA Capture half complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +void TIM_DMACaptureHalfCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC4]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + } + else + { + /* nothing to do */ + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->IC_CaptureHalfCpltCallback(htim); +#else + HAL_TIM_IC_CaptureHalfCpltCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief TIM DMA Period Elapse complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +static void TIM_DMAPeriodElapsedCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (htim->hdma[TIM_DMA_ID_UPDATE]->Init.Mode == DMA_NORMAL) + { + htim->State = HAL_TIM_STATE_READY; + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->PeriodElapsedCallback(htim); +#else + HAL_TIM_PeriodElapsedCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +} + +/** + * @brief TIM DMA Period Elapse half complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +static void TIM_DMAPeriodElapsedHalfCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->PeriodElapsedHalfCpltCallback(htim); +#else + HAL_TIM_PeriodElapsedHalfCpltCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +} + +/** + * @brief TIM DMA Trigger callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +static void TIM_DMATriggerCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (htim->hdma[TIM_DMA_ID_TRIGGER]->Init.Mode == DMA_NORMAL) + { + htim->State = HAL_TIM_STATE_READY; + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->TriggerCallback(htim); +#else + HAL_TIM_TriggerCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +} + +/** + * @brief TIM DMA Trigger half complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +static void TIM_DMATriggerHalfCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->TriggerHalfCpltCallback(htim); +#else + HAL_TIM_TriggerHalfCpltCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +} + +/** + * @brief Time Base configuration + * @param TIMx TIM peripheral + * @param Structure TIM Base configuration structure + * @retval None + */ +void TIM_Base_SetConfig(TIM_TypeDef *TIMx, const TIM_Base_InitTypeDef *Structure) +{ + uint32_t tmpcr1; + tmpcr1 = TIMx->CR1; + + /* Set TIM Time Base Unit parameters ---------------------------------------*/ + if (IS_TIM_COUNTER_MODE_SELECT_INSTANCE(TIMx)) + { + /* Select the Counter Mode */ + tmpcr1 &= ~(TIM_CR1_DIR | TIM_CR1_CMS); + tmpcr1 |= Structure->CounterMode; + } + + if (IS_TIM_CLOCK_DIVISION_INSTANCE(TIMx)) + { + /* Set the clock division */ + tmpcr1 &= ~TIM_CR1_CKD; + tmpcr1 |= (uint32_t)Structure->ClockDivision; + } + + /* Set the auto-reload preload */ + MODIFY_REG(tmpcr1, TIM_CR1_ARPE, Structure->AutoReloadPreload); + + TIMx->CR1 = tmpcr1; + + /* Set the Autoreload value */ + TIMx->ARR = (uint32_t)Structure->Period ; + + /* Set the Prescaler value */ + TIMx->PSC = Structure->Prescaler; + + if (IS_TIM_REPETITION_COUNTER_INSTANCE(TIMx)) + { + /* Set the Repetition Counter value */ + TIMx->RCR = Structure->RepetitionCounter; + } + + /* Generate an update event to reload the Prescaler + and the repetition counter (only for advanced timer) value immediately */ + TIMx->EGR = TIM_EGR_UG; +} + +/** + * @brief Timer Output Compare 1 configuration + * @param TIMx to select the TIM peripheral + * @param OC_Config The output configuration structure + * @retval None + */ +static void TIM_OC1_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config) +{ + uint32_t tmpccmrx; + uint32_t tmpccer; + uint32_t tmpcr2; + + /* Disable the Channel 1: Reset the CC1E Bit */ + TIMx->CCER &= ~TIM_CCER_CC1E; + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + + /* Get the TIMx CCMR1 register value */ + tmpccmrx = TIMx->CCMR1; + + /* Reset the Output Compare Mode Bits */ + tmpccmrx &= ~TIM_CCMR1_OC1M; + tmpccmrx &= ~TIM_CCMR1_CC1S; + /* Select the Output Compare Mode */ + tmpccmrx |= OC_Config->OCMode; + + /* Reset the Output Polarity level */ + tmpccer &= ~TIM_CCER_CC1P; + /* Set the Output Compare Polarity */ + tmpccer |= OC_Config->OCPolarity; + + if (IS_TIM_CCXN_INSTANCE(TIMx, TIM_CHANNEL_1)) + { + /* Check parameters */ + assert_param(IS_TIM_OCN_POLARITY(OC_Config->OCNPolarity)); + + /* Reset the Output N Polarity level */ + tmpccer &= ~TIM_CCER_CC1NP; + /* Set the Output N Polarity */ + tmpccer |= OC_Config->OCNPolarity; + /* Reset the Output N State */ + tmpccer &= ~TIM_CCER_CC1NE; + } + + if (IS_TIM_BREAK_INSTANCE(TIMx)) + { + /* Check parameters */ + assert_param(IS_TIM_OCNIDLE_STATE(OC_Config->OCNIdleState)); + assert_param(IS_TIM_OCIDLE_STATE(OC_Config->OCIdleState)); + + /* Reset the Output Compare and Output Compare N IDLE State */ + tmpcr2 &= ~TIM_CR2_OIS1; + tmpcr2 &= ~TIM_CR2_OIS1N; + /* Set the Output Idle state */ + tmpcr2 |= OC_Config->OCIdleState; + /* Set the Output N Idle state */ + tmpcr2 |= OC_Config->OCNIdleState; + } + + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR1 */ + TIMx->CCMR1 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR1 = OC_Config->Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Timer Output Compare 2 configuration + * @param TIMx to select the TIM peripheral + * @param OC_Config The output configuration structure + * @retval None + */ +void TIM_OC2_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config) +{ + uint32_t tmpccmrx; + uint32_t tmpccer; + uint32_t tmpcr2; + + /* Disable the Channel 2: Reset the CC2E Bit */ + TIMx->CCER &= ~TIM_CCER_CC2E; + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + + /* Get the TIMx CCMR1 register value */ + tmpccmrx = TIMx->CCMR1; + + /* Reset the Output Compare mode and Capture/Compare selection Bits */ + tmpccmrx &= ~TIM_CCMR1_OC2M; + tmpccmrx &= ~TIM_CCMR1_CC2S; + + /* Select the Output Compare Mode */ + tmpccmrx |= (OC_Config->OCMode << 8U); + + /* Reset the Output Polarity level */ + tmpccer &= ~TIM_CCER_CC2P; + /* Set the Output Compare Polarity */ + tmpccer |= (OC_Config->OCPolarity << 4U); + + if (IS_TIM_CCXN_INSTANCE(TIMx, TIM_CHANNEL_2)) + { + assert_param(IS_TIM_OCN_POLARITY(OC_Config->OCNPolarity)); + + /* Reset the Output N Polarity level */ + tmpccer &= ~TIM_CCER_CC2NP; + /* Set the Output N Polarity */ + tmpccer |= (OC_Config->OCNPolarity << 4U); + /* Reset the Output N State */ + tmpccer &= ~TIM_CCER_CC2NE; + + } + + if (IS_TIM_BREAK_INSTANCE(TIMx)) + { + /* Check parameters */ + assert_param(IS_TIM_OCNIDLE_STATE(OC_Config->OCNIdleState)); + assert_param(IS_TIM_OCIDLE_STATE(OC_Config->OCIdleState)); + + /* Reset the Output Compare and Output Compare N IDLE State */ + tmpcr2 &= ~TIM_CR2_OIS2; +#if defined(TIM_CR2_OIS2N) + tmpcr2 &= ~TIM_CR2_OIS2N; +#endif /* TIM_CR2_OIS2N */ + /* Set the Output Idle state */ + tmpcr2 |= (OC_Config->OCIdleState << 2U); + /* Set the Output N Idle state */ + tmpcr2 |= (OC_Config->OCNIdleState << 2U); + } + + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR1 */ + TIMx->CCMR1 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR2 = OC_Config->Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Timer Output Compare 3 configuration + * @param TIMx to select the TIM peripheral + * @param OC_Config The output configuration structure + * @retval None + */ +static void TIM_OC3_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config) +{ + uint32_t tmpccmrx; + uint32_t tmpccer; + uint32_t tmpcr2; + + /* Disable the Channel 3: Reset the CC2E Bit */ + TIMx->CCER &= ~TIM_CCER_CC3E; + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + + /* Get the TIMx CCMR2 register value */ + tmpccmrx = TIMx->CCMR2; + + /* Reset the Output Compare mode and Capture/Compare selection Bits */ + tmpccmrx &= ~TIM_CCMR2_OC3M; + tmpccmrx &= ~TIM_CCMR2_CC3S; + /* Select the Output Compare Mode */ + tmpccmrx |= OC_Config->OCMode; + + /* Reset the Output Polarity level */ + tmpccer &= ~TIM_CCER_CC3P; + /* Set the Output Compare Polarity */ + tmpccer |= (OC_Config->OCPolarity << 8U); + + if (IS_TIM_CCXN_INSTANCE(TIMx, TIM_CHANNEL_3)) + { + assert_param(IS_TIM_OCN_POLARITY(OC_Config->OCNPolarity)); + + /* Reset the Output N Polarity level */ + tmpccer &= ~TIM_CCER_CC3NP; + /* Set the Output N Polarity */ + tmpccer |= (OC_Config->OCNPolarity << 8U); + /* Reset the Output N State */ + tmpccer &= ~TIM_CCER_CC3NE; + } + +#if defined(TIM_CR2_OIS3) + if (IS_TIM_BREAK_INSTANCE(TIMx)) + { + /* Check parameters */ + assert_param(IS_TIM_OCNIDLE_STATE(OC_Config->OCNIdleState)); + assert_param(IS_TIM_OCIDLE_STATE(OC_Config->OCIdleState)); + + /* Reset the Output Compare and Output Compare N IDLE State */ + tmpcr2 &= ~TIM_CR2_OIS3; + tmpcr2 &= ~TIM_CR2_OIS3N; + /* Set the Output Idle state */ + tmpcr2 |= (OC_Config->OCIdleState << 4U); + /* Set the Output N Idle state */ + tmpcr2 |= (OC_Config->OCNIdleState << 4U); + } +#endif /* TIM_CR2_OIS3 */ + + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR2 */ + TIMx->CCMR2 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR3 = OC_Config->Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +/** + * @brief Timer Output Compare 4 configuration + * @param TIMx to select the TIM peripheral + * @param OC_Config The output configuration structure + * @retval None + */ +static void TIM_OC4_SetConfig(TIM_TypeDef *TIMx, const TIM_OC_InitTypeDef *OC_Config) +{ + uint32_t tmpccmrx; + uint32_t tmpccer; + uint32_t tmpcr2; + + /* Disable the Channel 4: Reset the CC4E Bit */ + TIMx->CCER &= ~TIM_CCER_CC4E; + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + + /* Get the TIMx CCMR2 register value */ + tmpccmrx = TIMx->CCMR2; + + /* Reset the Output Compare mode and Capture/Compare selection Bits */ + tmpccmrx &= ~TIM_CCMR2_OC4M; + tmpccmrx &= ~TIM_CCMR2_CC4S; + + /* Select the Output Compare Mode */ + tmpccmrx |= (OC_Config->OCMode << 8U); + + /* Reset the Output Polarity level */ + tmpccer &= ~TIM_CCER_CC4P; + /* Set the Output Compare Polarity */ + tmpccer |= (OC_Config->OCPolarity << 12U); + +#if defined(TIM_CR2_OIS4) + if (IS_TIM_BREAK_INSTANCE(TIMx)) + { + /* Check parameters */ + assert_param(IS_TIM_OCIDLE_STATE(OC_Config->OCIdleState)); + + /* Reset the Output Compare IDLE State */ + tmpcr2 &= ~TIM_CR2_OIS4; + + /* Set the Output Idle state */ + tmpcr2 |= (OC_Config->OCIdleState << 6U); + } +#endif /* TIM_CR2_OIS4 */ + + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR2 */ + TIMx->CCMR2 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR4 = OC_Config->Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} + +#if defined(TIM_CCER_CC5E) +/** + * @brief Timer Output Compare 5 configuration + * @param TIMx to select the TIM peripheral + * @param OC_Config The output configuration structure + * @retval None + */ +static void TIM_OC5_SetConfig(TIM_TypeDef *TIMx, + const TIM_OC_InitTypeDef *OC_Config) +{ + uint32_t tmpccmrx; + uint32_t tmpccer; + uint32_t tmpcr2; + + /* Disable the output: Reset the CCxE Bit */ + TIMx->CCER &= ~TIM_CCER_CC5E; + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + /* Get the TIMx CCMR1 register value */ + tmpccmrx = TIMx->CCMR3; + + /* Reset the Output Compare Mode Bits */ + tmpccmrx &= ~(TIM_CCMR3_OC5M); + /* Select the Output Compare Mode */ + tmpccmrx |= OC_Config->OCMode; + + /* Reset the Output Polarity level */ + tmpccer &= ~TIM_CCER_CC5P; + /* Set the Output Compare Polarity */ + tmpccer |= (OC_Config->OCPolarity << 16U); + + if (IS_TIM_BREAK_INSTANCE(TIMx)) + { + /* Reset the Output Compare IDLE State */ + tmpcr2 &= ~TIM_CR2_OIS5; + /* Set the Output Idle state */ + tmpcr2 |= (OC_Config->OCIdleState << 8U); + } + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR3 */ + TIMx->CCMR3 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR5 = OC_Config->Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} +#endif /* TIM_CCER_CC5E */ + +#if defined(TIM_CCER_CC6E) +/** + * @brief Timer Output Compare 6 configuration + * @param TIMx to select the TIM peripheral + * @param OC_Config The output configuration structure + * @retval None + */ +static void TIM_OC6_SetConfig(TIM_TypeDef *TIMx, + const TIM_OC_InitTypeDef *OC_Config) +{ + uint32_t tmpccmrx; + uint32_t tmpccer; + uint32_t tmpcr2; + + /* Disable the output: Reset the CCxE Bit */ + TIMx->CCER &= ~TIM_CCER_CC6E; + + /* Get the TIMx CCER register value */ + tmpccer = TIMx->CCER; + /* Get the TIMx CR2 register value */ + tmpcr2 = TIMx->CR2; + /* Get the TIMx CCMR1 register value */ + tmpccmrx = TIMx->CCMR3; + + /* Reset the Output Compare Mode Bits */ + tmpccmrx &= ~(TIM_CCMR3_OC6M); + /* Select the Output Compare Mode */ + tmpccmrx |= (OC_Config->OCMode << 8U); + + /* Reset the Output Polarity level */ + tmpccer &= (uint32_t)~TIM_CCER_CC6P; + /* Set the Output Compare Polarity */ + tmpccer |= (OC_Config->OCPolarity << 20U); + + if (IS_TIM_BREAK_INSTANCE(TIMx)) + { + /* Reset the Output Compare IDLE State */ + tmpcr2 &= ~TIM_CR2_OIS6; + /* Set the Output Idle state */ + tmpcr2 |= (OC_Config->OCIdleState << 10U); + } + + /* Write to TIMx CR2 */ + TIMx->CR2 = tmpcr2; + + /* Write to TIMx CCMR3 */ + TIMx->CCMR3 = tmpccmrx; + + /* Set the Capture Compare Register value */ + TIMx->CCR6 = OC_Config->Pulse; + + /* Write to TIMx CCER */ + TIMx->CCER = tmpccer; +} +#endif /* TIM_CCER_CC6E */ + +/** + * @brief Slave Timer configuration function + * @param htim TIM handle + * @param sSlaveConfig Slave timer configuration + * @retval None + */ +static HAL_StatusTypeDef TIM_SlaveTimer_SetConfig(TIM_HandleTypeDef *htim, + const TIM_SlaveConfigTypeDef *sSlaveConfig) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + uint32_t tmpccmr1; + uint32_t tmpccer; + + /* Get the TIMx SMCR register value */ + tmpsmcr = htim->Instance->SMCR; + + /* Reset the Trigger Selection Bits */ + tmpsmcr &= ~TIM_SMCR_TS; + /* Set the Input Trigger source */ + tmpsmcr |= sSlaveConfig->InputTrigger; + + /* Reset the slave mode Bits */ + tmpsmcr &= ~TIM_SMCR_SMS; + /* Set the slave mode */ + tmpsmcr |= sSlaveConfig->SlaveMode; + + /* Write to TIMx SMCR */ + htim->Instance->SMCR = tmpsmcr; + + /* Configure the trigger prescaler, filter, and polarity */ + switch (sSlaveConfig->InputTrigger) + { + case TIM_TS_ETRF: + { + /* Check the parameters */ + assert_param(IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRIGGERPRESCALER(sSlaveConfig->TriggerPrescaler)); + assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); + assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + /* Configure the ETR Trigger source */ + TIM_ETR_SetConfig(htim->Instance, + sSlaveConfig->TriggerPrescaler, + sSlaveConfig->TriggerPolarity, + sSlaveConfig->TriggerFilter); + break; + } + + case TIM_TS_TI1F_ED: + { + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + + if (sSlaveConfig->SlaveMode == TIM_SLAVEMODE_GATED) + { + return HAL_ERROR; + } + + /* Disable the Channel 1: Reset the CC1E Bit */ + tmpccer = htim->Instance->CCER; + htim->Instance->CCER &= ~TIM_CCER_CC1E; + tmpccmr1 = htim->Instance->CCMR1; + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC1F; + tmpccmr1 |= ((sSlaveConfig->TriggerFilter) << 4U); + + /* Write to TIMx CCMR1 and CCER registers */ + htim->Instance->CCMR1 = tmpccmr1; + htim->Instance->CCER = tmpccer; + break; + } + + case TIM_TS_TI1FP1: + { + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); + assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + + /* Configure TI1 Filter and Polarity */ + TIM_TI1_ConfigInputStage(htim->Instance, + sSlaveConfig->TriggerPolarity, + sSlaveConfig->TriggerFilter); + break; + } + + case TIM_TS_TI2FP2: + { + /* Check the parameters */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRIGGERPOLARITY(sSlaveConfig->TriggerPolarity)); + assert_param(IS_TIM_TRIGGERFILTER(sSlaveConfig->TriggerFilter)); + + /* Configure TI2 Filter and Polarity */ + TIM_TI2_ConfigInputStage(htim->Instance, + sSlaveConfig->TriggerPolarity, + sSlaveConfig->TriggerFilter); + break; + } + + case TIM_TS_ITR0: + case TIM_TS_ITR1: + case TIM_TS_ITR2: + case TIM_TS_ITR3: + { + /* Check the parameter */ + assert_param(IS_TIM_CC2_INSTANCE(htim->Instance)); + break; + } + + default: + status = HAL_ERROR; + break; + } + + return status; +} + +/** + * @brief Configure the TI1 as Input. + * @param TIMx to select the TIM peripheral. + * @param TIM_ICPolarity The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPOLARITY_RISING + * @arg TIM_ICPOLARITY_FALLING + * @arg TIM_ICPOLARITY_BOTHEDGE + * @param TIM_ICSelection specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSELECTION_DIRECTTI: TIM Input 1 is selected to be connected to IC1. + * @arg TIM_ICSELECTION_INDIRECTTI: TIM Input 1 is selected to be connected to IC2. + * @arg TIM_ICSELECTION_TRC: TIM Input 1 is selected to be connected to TRC. + * @param TIM_ICFilter Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + * @note TIM_ICFilter and TIM_ICPolarity are not used in INDIRECT mode as TI2FP1 + * (on channel2 path) is used as the input signal. Therefore CCMR1 must be + * protected against un-initialized filter and polarity values. + */ +void TIM_TI1_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, + uint32_t TIM_ICFilter) +{ + uint32_t tmpccmr1; + uint32_t tmpccer; + + /* Disable the Channel 1: Reset the CC1E Bit */ + TIMx->CCER &= ~TIM_CCER_CC1E; + tmpccmr1 = TIMx->CCMR1; + tmpccer = TIMx->CCER; + + /* Select the Input */ + if (IS_TIM_CC2_INSTANCE(TIMx) != RESET) + { + tmpccmr1 &= ~TIM_CCMR1_CC1S; + tmpccmr1 |= TIM_ICSelection; + } + else + { + tmpccmr1 |= TIM_CCMR1_CC1S_0; + } + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC1F; + tmpccmr1 |= ((TIM_ICFilter << 4U) & TIM_CCMR1_IC1F); + + /* Select the Polarity and set the CC1E Bit */ + tmpccer &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP); + tmpccer |= (TIM_ICPolarity & (TIM_CCER_CC1P | TIM_CCER_CC1NP)); + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1; + TIMx->CCER = tmpccer; +} + +/** + * @brief Configure the Polarity and Filter for TI1. + * @param TIMx to select the TIM peripheral. + * @param TIM_ICPolarity The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPOLARITY_RISING + * @arg TIM_ICPOLARITY_FALLING + * @arg TIM_ICPOLARITY_BOTHEDGE + * @param TIM_ICFilter Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + */ +static void TIM_TI1_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter) +{ + uint32_t tmpccmr1; + uint32_t tmpccer; + + /* Disable the Channel 1: Reset the CC1E Bit */ + tmpccer = TIMx->CCER; + TIMx->CCER &= ~TIM_CCER_CC1E; + tmpccmr1 = TIMx->CCMR1; + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC1F; + tmpccmr1 |= (TIM_ICFilter << 4U); + + /* Select the Polarity and set the CC1E Bit */ + tmpccer &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP); + tmpccer |= TIM_ICPolarity; + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1; + TIMx->CCER = tmpccer; +} + +/** + * @brief Configure the TI2 as Input. + * @param TIMx to select the TIM peripheral + * @param TIM_ICPolarity The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPOLARITY_RISING + * @arg TIM_ICPOLARITY_FALLING + * @arg TIM_ICPOLARITY_BOTHEDGE + * @param TIM_ICSelection specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSELECTION_DIRECTTI: TIM Input 2 is selected to be connected to IC2. + * @arg TIM_ICSELECTION_INDIRECTTI: TIM Input 2 is selected to be connected to IC1. + * @arg TIM_ICSELECTION_TRC: TIM Input 2 is selected to be connected to TRC. + * @param TIM_ICFilter Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + * @note TIM_ICFilter and TIM_ICPolarity are not used in INDIRECT mode as TI1FP2 + * (on channel1 path) is used as the input signal. Therefore CCMR1 must be + * protected against un-initialized filter and polarity values. + */ +static void TIM_TI2_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, + uint32_t TIM_ICFilter) +{ + uint32_t tmpccmr1; + uint32_t tmpccer; + + /* Disable the Channel 2: Reset the CC2E Bit */ + TIMx->CCER &= ~TIM_CCER_CC2E; + tmpccmr1 = TIMx->CCMR1; + tmpccer = TIMx->CCER; + + /* Select the Input */ + tmpccmr1 &= ~TIM_CCMR1_CC2S; + tmpccmr1 |= (TIM_ICSelection << 8U); + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC2F; + tmpccmr1 |= ((TIM_ICFilter << 12U) & TIM_CCMR1_IC2F); + + /* Select the Polarity and set the CC2E Bit */ + tmpccer &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP); + tmpccer |= ((TIM_ICPolarity << 4U) & (TIM_CCER_CC2P | TIM_CCER_CC2NP)); + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1 ; + TIMx->CCER = tmpccer; +} + +/** + * @brief Configure the Polarity and Filter for TI2. + * @param TIMx to select the TIM peripheral. + * @param TIM_ICPolarity The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPOLARITY_RISING + * @arg TIM_ICPOLARITY_FALLING + * @arg TIM_ICPOLARITY_BOTHEDGE + * @param TIM_ICFilter Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + */ +static void TIM_TI2_ConfigInputStage(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICFilter) +{ + uint32_t tmpccmr1; + uint32_t tmpccer; + + /* Disable the Channel 2: Reset the CC2E Bit */ + TIMx->CCER &= ~TIM_CCER_CC2E; + tmpccmr1 = TIMx->CCMR1; + tmpccer = TIMx->CCER; + + /* Set the filter */ + tmpccmr1 &= ~TIM_CCMR1_IC2F; + tmpccmr1 |= (TIM_ICFilter << 12U); + + /* Select the Polarity and set the CC2E Bit */ + tmpccer &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP); + tmpccer |= (TIM_ICPolarity << 4U); + + /* Write to TIMx CCMR1 and CCER registers */ + TIMx->CCMR1 = tmpccmr1 ; + TIMx->CCER = tmpccer; +} + +/** + * @brief Configure the TI3 as Input. + * @param TIMx to select the TIM peripheral + * @param TIM_ICPolarity The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPOLARITY_RISING + * @arg TIM_ICPOLARITY_FALLING + * @arg TIM_ICPOLARITY_BOTHEDGE + * @param TIM_ICSelection specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSELECTION_DIRECTTI: TIM Input 3 is selected to be connected to IC3. + * @arg TIM_ICSELECTION_INDIRECTTI: TIM Input 3 is selected to be connected to IC4. + * @arg TIM_ICSELECTION_TRC: TIM Input 3 is selected to be connected to TRC. + * @param TIM_ICFilter Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @retval None + * @note TIM_ICFilter and TIM_ICPolarity are not used in INDIRECT mode as TI3FP4 + * (on channel1 path) is used as the input signal. Therefore CCMR2 must be + * protected against un-initialized filter and polarity values. + */ +static void TIM_TI3_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, + uint32_t TIM_ICFilter) +{ + uint32_t tmpccmr2; + uint32_t tmpccer; + + /* Disable the Channel 3: Reset the CC3E Bit */ + TIMx->CCER &= ~TIM_CCER_CC3E; + tmpccmr2 = TIMx->CCMR2; + tmpccer = TIMx->CCER; + + /* Select the Input */ + tmpccmr2 &= ~TIM_CCMR2_CC3S; + tmpccmr2 |= TIM_ICSelection; + + /* Set the filter */ + tmpccmr2 &= ~TIM_CCMR2_IC3F; + tmpccmr2 |= ((TIM_ICFilter << 4U) & TIM_CCMR2_IC3F); + + /* Select the Polarity and set the CC3E Bit */ + tmpccer &= ~(TIM_CCER_CC3P | TIM_CCER_CC3NP); + tmpccer |= ((TIM_ICPolarity << 8U) & (TIM_CCER_CC3P | TIM_CCER_CC3NP)); + + /* Write to TIMx CCMR2 and CCER registers */ + TIMx->CCMR2 = tmpccmr2; + TIMx->CCER = tmpccer; +} + +/** + * @brief Configure the TI4 as Input. + * @param TIMx to select the TIM peripheral + * @param TIM_ICPolarity The Input Polarity. + * This parameter can be one of the following values: + * @arg TIM_ICPOLARITY_RISING + * @arg TIM_ICPOLARITY_FALLING + * @arg TIM_ICPOLARITY_BOTHEDGE + * @param TIM_ICSelection specifies the input to be used. + * This parameter can be one of the following values: + * @arg TIM_ICSELECTION_DIRECTTI: TIM Input 4 is selected to be connected to IC4. + * @arg TIM_ICSELECTION_INDIRECTTI: TIM Input 4 is selected to be connected to IC3. + * @arg TIM_ICSELECTION_TRC: TIM Input 4 is selected to be connected to TRC. + * @param TIM_ICFilter Specifies the Input Capture Filter. + * This parameter must be a value between 0x00 and 0x0F. + * @note TIM_ICFilter and TIM_ICPolarity are not used in INDIRECT mode as TI4FP3 + * (on channel1 path) is used as the input signal. Therefore CCMR2 must be + * protected against un-initialized filter and polarity values. + * @retval None + */ +static void TIM_TI4_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ICPolarity, uint32_t TIM_ICSelection, + uint32_t TIM_ICFilter) +{ + uint32_t tmpccmr2; + uint32_t tmpccer; + + /* Disable the Channel 4: Reset the CC4E Bit */ + TIMx->CCER &= ~TIM_CCER_CC4E; + tmpccmr2 = TIMx->CCMR2; + tmpccer = TIMx->CCER; + + /* Select the Input */ + tmpccmr2 &= ~TIM_CCMR2_CC4S; + tmpccmr2 |= (TIM_ICSelection << 8U); + + /* Set the filter */ + tmpccmr2 &= ~TIM_CCMR2_IC4F; + tmpccmr2 |= ((TIM_ICFilter << 12U) & TIM_CCMR2_IC4F); + + /* Select the Polarity and set the CC4E Bit */ + tmpccer &= ~(TIM_CCER_CC4P | TIM_CCER_CC4NP); + tmpccer |= ((TIM_ICPolarity << 12U) & (TIM_CCER_CC4P | TIM_CCER_CC4NP)); + + /* Write to TIMx CCMR2 and CCER registers */ + TIMx->CCMR2 = tmpccmr2; + TIMx->CCER = tmpccer ; +} + +/** + * @brief Selects the Input Trigger source + * @param TIMx to select the TIM peripheral + * @param InputTriggerSource The Input Trigger source. + * This parameter can be one of the following values: + * @arg TIM_TS_ITR0: Internal Trigger 0 + * @arg TIM_TS_ITR1: Internal Trigger 1 + * @arg TIM_TS_ITR2: Internal Trigger 2 + * @arg TIM_TS_ITR3: Internal Trigger 3 + * @arg TIM_TS_TI1F_ED: TI1 Edge Detector + * @arg TIM_TS_TI1FP1: Filtered Timer Input 1 + * @arg TIM_TS_TI2FP2: Filtered Timer Input 2 + * @arg TIM_TS_ETRF: External Trigger input + * @retval None + */ +static void TIM_ITRx_SetConfig(TIM_TypeDef *TIMx, uint32_t InputTriggerSource) +{ + uint32_t tmpsmcr; + + /* Get the TIMx SMCR register value */ + tmpsmcr = TIMx->SMCR; + /* Reset the TS Bits */ + tmpsmcr &= ~TIM_SMCR_TS; + /* Set the Input Trigger source and the slave mode*/ + tmpsmcr |= (InputTriggerSource | TIM_SLAVEMODE_EXTERNAL1); + /* Write to TIMx SMCR */ + TIMx->SMCR = tmpsmcr; +} +/** + * @brief Configures the TIMx External Trigger (ETR). + * @param TIMx to select the TIM peripheral + * @param TIM_ExtTRGPrescaler The external Trigger Prescaler. + * This parameter can be one of the following values: + * @arg TIM_ETRPRESCALER_DIV1: ETRP Prescaler OFF. + * @arg TIM_ETRPRESCALER_DIV2: ETRP frequency divided by 2. + * @arg TIM_ETRPRESCALER_DIV4: ETRP frequency divided by 4. + * @arg TIM_ETRPRESCALER_DIV8: ETRP frequency divided by 8. + * @param TIM_ExtTRGPolarity The external Trigger Polarity. + * This parameter can be one of the following values: + * @arg TIM_ETRPOLARITY_INVERTED: active low or falling edge active. + * @arg TIM_ETRPOLARITY_NONINVERTED: active high or rising edge active. + * @param ExtTRGFilter External Trigger Filter. + * This parameter must be a value between 0x00 and 0x0F + * @retval None + */ +void TIM_ETR_SetConfig(TIM_TypeDef *TIMx, uint32_t TIM_ExtTRGPrescaler, + uint32_t TIM_ExtTRGPolarity, uint32_t ExtTRGFilter) +{ + uint32_t tmpsmcr; + + tmpsmcr = TIMx->SMCR; + + /* Reset the ETR Bits */ + tmpsmcr &= ~(TIM_SMCR_ETF | TIM_SMCR_ETPS | TIM_SMCR_ECE | TIM_SMCR_ETP); + + /* Set the Prescaler, the Filter value and the Polarity */ + tmpsmcr |= (uint32_t)(TIM_ExtTRGPrescaler | (TIM_ExtTRGPolarity | (ExtTRGFilter << 8U))); + + /* Write to TIMx SMCR */ + TIMx->SMCR = tmpsmcr; +} + +/** + * @brief Enables or disables the TIM Capture Compare Channel x. + * @param TIMx to select the TIM peripheral + * @param Channel specifies the TIM Channel + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 + * @arg TIM_CHANNEL_2: TIM Channel 2 + * @arg TIM_CHANNEL_3: TIM Channel 3 + * @arg TIM_CHANNEL_4: TIM Channel 4 + * @arg TIM_CHANNEL_5: TIM Channel 5 selected + * @arg TIM_CHANNEL_6: TIM Channel 6 selected + * @param ChannelState specifies the TIM Channel CCxE bit new state. + * This parameter can be: TIM_CCx_ENABLE or TIM_CCx_DISABLE. + * @retval None + */ +void TIM_CCxChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelState) +{ + uint32_t tmp; + + /* Check the parameters */ + assert_param(IS_TIM_CC1_INSTANCE(TIMx)); + assert_param(IS_TIM_CHANNELS(Channel)); + + tmp = TIM_CCER_CC1E << (Channel & 0x1FU); /* 0x1FU = 31 bits max shift */ + + /* Reset the CCxE Bit */ + TIMx->CCER &= ~tmp; + + /* Set or reset the CCxE Bit */ + TIMx->CCER |= (uint32_t)(ChannelState << (Channel & 0x1FU)); /* 0x1FU = 31 bits max shift */ +} + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) +/** + * @brief Reset interrupt callbacks to the legacy weak callbacks. + * @param htim pointer to a TIM_HandleTypeDef structure that contains + * the configuration information for TIM module. + * @retval None + */ +void TIM_ResetCallback(TIM_HandleTypeDef *htim) +{ + /* Reset the TIM callback to the legacy weak callbacks */ + htim->PeriodElapsedCallback = HAL_TIM_PeriodElapsedCallback; + htim->PeriodElapsedHalfCpltCallback = HAL_TIM_PeriodElapsedHalfCpltCallback; + htim->TriggerCallback = HAL_TIM_TriggerCallback; + htim->TriggerHalfCpltCallback = HAL_TIM_TriggerHalfCpltCallback; + htim->IC_CaptureCallback = HAL_TIM_IC_CaptureCallback; + htim->IC_CaptureHalfCpltCallback = HAL_TIM_IC_CaptureHalfCpltCallback; + htim->OC_DelayElapsedCallback = HAL_TIM_OC_DelayElapsedCallback; + htim->PWM_PulseFinishedCallback = HAL_TIM_PWM_PulseFinishedCallback; + htim->PWM_PulseFinishedHalfCpltCallback = HAL_TIM_PWM_PulseFinishedHalfCpltCallback; + htim->ErrorCallback = HAL_TIM_ErrorCallback; + htim->CommutationCallback = HAL_TIMEx_CommutCallback; + htim->CommutationHalfCpltCallback = HAL_TIMEx_CommutHalfCpltCallback; + htim->BreakCallback = HAL_TIMEx_BreakCallback; +#if defined(TIM_BDTR_BK2E) + htim->Break2Callback = HAL_TIMEx_Break2Callback; +#endif /* TIM_BDTR_BK2E */ +} +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + +/** + * @} + */ + +#endif /* HAL_TIM_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c new file mode 100644 index 0000000..8394b57 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c @@ -0,0 +1,2556 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_tim_ex.c + * @author MCD Application Team + * @brief TIM HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Timer Extended peripheral: + * + Time Hall Sensor Interface Initialization + * + Time Hall Sensor Interface Start + * + Time Complementary signal break and dead time configuration + * + Time Master and Slave synchronization configuration + * + Time Output Compare/PWM Channel Configuration (for channels 5 and 6) + * + Time OCRef clear configuration + * + Timer remapping capabilities configuration + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### TIMER Extended features ##### + ============================================================================== + [..] + The Timer Extended features include: + (#) Complementary outputs with programmable dead-time for : + (++) Output Compare + (++) PWM generation (Edge and Center-aligned Mode) + (++) One-pulse mode output + (#) Synchronization circuit to control the timer with external signals and to + interconnect several timers together. + (#) Break input to put the timer output signals in reset state or in a known state. + (#) Supports incremental (quadrature) encoder and hall-sensor circuitry for + positioning purposes + + ##### How to use this driver ##### + ============================================================================== + [..] + (#) Initialize the TIM low level resources by implementing the following functions + depending on the selected feature: + (++) Hall Sensor output : HAL_TIMEx_HallSensor_MspInit() + + (#) Initialize the TIM low level resources : + (##) Enable the TIM interface clock using __HAL_RCC_TIMx_CLK_ENABLE(); + (##) TIM pins configuration + (+++) Enable the clock for the TIM GPIOs using the following function: + __HAL_RCC_GPIOx_CLK_ENABLE(); + (+++) Configure these TIM pins in Alternate function mode using HAL_GPIO_Init(); + + (#) The external Clock can be configured, if needed (the default clock is the + internal clock from the APBx), using the following function: + HAL_TIM_ConfigClockSource, the clock configuration should be done before + any start function. + + (#) Configure the TIM in the desired functioning mode using one of the + initialization function of this driver: + (++) HAL_TIMEx_HallSensor_Init() and HAL_TIMEx_ConfigCommutEvent(): to use the + Timer Hall Sensor Interface and the commutation event with the corresponding + Interrupt and DMA request if needed (Note that One Timer is used to interface + with the Hall sensor Interface and another Timer should be used to use + the commutation event). + + (#) Activate the TIM peripheral using one of the start functions: + (++) Complementary Output Compare : HAL_TIMEx_OCN_Start(), HAL_TIMEx_OCN_Start_DMA(), + HAL_TIMEx_OCN_Start_IT() + (++) Complementary PWM generation : HAL_TIMEx_PWMN_Start(), HAL_TIMEx_PWMN_Start_DMA(), + HAL_TIMEx_PWMN_Start_IT() + (++) Complementary One-pulse mode output : HAL_TIMEx_OnePulseN_Start(), HAL_TIMEx_OnePulseN_Start_IT() + (++) Hall Sensor output : HAL_TIMEx_HallSensor_Start(), HAL_TIMEx_HallSensor_Start_DMA(), + HAL_TIMEx_HallSensor_Start_IT(). + + @endverbatim + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup TIMEx TIMEx + * @brief TIM Extended HAL module driver + * @{ + */ + +#ifdef HAL_TIM_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +static void TIM_DMADelayPulseNCplt(DMA_HandleTypeDef *hdma); +static void TIM_DMAErrorCCxN(DMA_HandleTypeDef *hdma); +static void TIM_CCxNChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelNState); + +/* Exported functions --------------------------------------------------------*/ +/** @defgroup TIMEx_Exported_Functions TIM Extended Exported Functions + * @{ + */ + +/** @defgroup TIMEx_Exported_Functions_Group1 Extended Timer Hall Sensor functions + * @brief Timer Hall Sensor functions + * +@verbatim + ============================================================================== + ##### Timer Hall Sensor functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Initialize and configure TIM HAL Sensor. + (+) De-initialize TIM HAL Sensor. + (+) Start the Hall Sensor Interface. + (+) Stop the Hall Sensor Interface. + (+) Start the Hall Sensor Interface and enable interrupts. + (+) Stop the Hall Sensor Interface and disable interrupts. + (+) Start the Hall Sensor Interface and enable DMA transfers. + (+) Stop the Hall Sensor Interface and disable DMA transfers. + +@endverbatim + * @{ + */ +/** + * @brief Initializes the TIM Hall Sensor Interface and initialize the associated handle. + * @note When the timer instance is initialized in Hall Sensor Interface mode, + * timer channels 1 and channel 2 are reserved and cannot be used for + * other purpose. + * @param htim TIM Hall Sensor Interface handle + * @param sConfig TIM Hall Sensor configuration structure + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, const TIM_HallSensor_InitTypeDef *sConfig) +{ + TIM_OC_InitTypeDef OC_Config; + + /* Check the TIM handle allocation */ + if (htim == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(htim->Instance)); + assert_param(IS_TIM_COUNTER_MODE(htim->Init.CounterMode)); + assert_param(IS_TIM_CLOCKDIVISION_DIV(htim->Init.ClockDivision)); + assert_param(IS_TIM_AUTORELOAD_PRELOAD(htim->Init.AutoReloadPreload)); + assert_param(IS_TIM_IC_POLARITY(sConfig->IC1Polarity)); + assert_param(IS_TIM_PERIOD(htim, htim->Init.Period)); + assert_param(IS_TIM_IC_PRESCALER(sConfig->IC1Prescaler)); + assert_param(IS_TIM_IC_FILTER(sConfig->IC1Filter)); + + if (htim->State == HAL_TIM_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + htim->Lock = HAL_UNLOCKED; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + /* Reset interrupt callbacks to legacy week callbacks */ + TIM_ResetCallback(htim); + + if (htim->HallSensor_MspInitCallback == NULL) + { + htim->HallSensor_MspInitCallback = HAL_TIMEx_HallSensor_MspInit; + } + /* Init the low level hardware : GPIO, CLOCK, NVIC */ + htim->HallSensor_MspInitCallback(htim); +#else + /* Init the low level hardware : GPIO, CLOCK, NVIC and DMA */ + HAL_TIMEx_HallSensor_MspInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + } + + /* Set the TIM state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Configure the Time base in the Encoder Mode */ + TIM_Base_SetConfig(htim->Instance, &htim->Init); + + /* Configure the Channel 1 as Input Channel to interface with the three Outputs of the Hall sensor */ + TIM_TI1_SetConfig(htim->Instance, sConfig->IC1Polarity, TIM_ICSELECTION_TRC, sConfig->IC1Filter); + + /* Reset the IC1PSC Bits */ + htim->Instance->CCMR1 &= ~TIM_CCMR1_IC1PSC; + /* Set the IC1PSC value */ + htim->Instance->CCMR1 |= sConfig->IC1Prescaler; + + /* Enable the Hall sensor interface (XOR function of the three inputs) */ + htim->Instance->CR2 |= TIM_CR2_TI1S; + + /* Select the TIM_TS_TI1F_ED signal as Input trigger for the TIM */ + htim->Instance->SMCR &= ~TIM_SMCR_TS; + htim->Instance->SMCR |= TIM_TS_TI1F_ED; + + /* Use the TIM_TS_TI1F_ED signal to reset the TIM counter each edge detection */ + htim->Instance->SMCR &= ~TIM_SMCR_SMS; + htim->Instance->SMCR |= TIM_SLAVEMODE_RESET; + + /* Program channel 2 in PWM 2 mode with the desired Commutation_Delay*/ + OC_Config.OCFastMode = TIM_OCFAST_DISABLE; + OC_Config.OCIdleState = TIM_OCIDLESTATE_RESET; + OC_Config.OCMode = TIM_OCMODE_PWM2; + OC_Config.OCNIdleState = TIM_OCNIDLESTATE_RESET; + OC_Config.OCNPolarity = TIM_OCNPOLARITY_HIGH; + OC_Config.OCPolarity = TIM_OCPOLARITY_HIGH; + OC_Config.Pulse = sConfig->Commutation_Delay; + + TIM_OC2_SetConfig(htim->Instance, &OC_Config); + + /* Select OC2REF as trigger output on TRGO: write the MMS bits in the TIMx_CR2 + register to 101 */ + htim->Instance->CR2 &= ~TIM_CR2_MMS; + htim->Instance->CR2 |= TIM_TRGO_OC2REF; + + /* Initialize the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_READY; + + /* Initialize the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Initialize the TIM state*/ + htim->State = HAL_TIM_STATE_READY; + + return HAL_OK; +} + +/** + * @brief DeInitializes the TIM Hall Sensor interface + * @param htim TIM Hall Sensor Interface handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_INSTANCE(htim->Instance)); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Disable the TIM Peripheral Clock */ + __HAL_TIM_DISABLE(htim); + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + if (htim->HallSensor_MspDeInitCallback == NULL) + { + htim->HallSensor_MspDeInitCallback = HAL_TIMEx_HallSensor_MspDeInit; + } + /* DeInit the low level hardware */ + htim->HallSensor_MspDeInitCallback(htim); +#else + /* DeInit the low level hardware: GPIO, CLOCK, NVIC */ + HAL_TIMEx_HallSensor_MspDeInit(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + /* Change the DMA burst operation state */ + htim->DMABurstState = HAL_DMA_BURST_STATE_RESET; + + /* Change the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_RESET); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_RESET); + + /* Change TIM state */ + htim->State = HAL_TIM_STATE_RESET; + + /* Release Lock */ + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Initializes the TIM Hall Sensor MSP. + * @param htim TIM Hall Sensor Interface handle + * @retval None + */ +__weak void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIMEx_HallSensor_MspInit could be implemented in the user file + */ +} + +/** + * @brief DeInitializes TIM Hall Sensor MSP. + * @param htim TIM Hall Sensor Interface handle + * @retval None + */ +__weak void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIMEx_HallSensor_MspDeInit could be implemented in the user file + */ +} + +/** + * @brief Starts the TIM Hall Sensor Interface. + * @param htim TIM Hall Sensor Interface handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim) +{ + uint32_t tmpsmcr; + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Check the parameters */ + assert_param(IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(htim->Instance)); + + /* Check the TIM channels state */ + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the Input Capture channel 1 + (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, + TIM_CHANNEL_2 and TIM_CHANNEL_3) */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Hall sensor Interface. + * @param htim TIM Hall Sensor Interface handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(htim->Instance)); + + /* Disable the Input Capture channels 1, 2 and 3 + (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, + TIM_CHANNEL_2 and TIM_CHANNEL_3) */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Hall Sensor Interface in interrupt mode. + * @param htim TIM Hall Sensor Interface handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim) +{ + uint32_t tmpsmcr; + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Check the parameters */ + assert_param(IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(htim->Instance)); + + /* Check the TIM channels state */ + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the capture compare Interrupts 1 event */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + + /* Enable the Input Capture channel 1 + (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, + TIM_CHANNEL_2 and TIM_CHANNEL_3) */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Hall Sensor Interface in interrupt mode. + * @param htim TIM Hall Sensor Interface handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(htim->Instance)); + + /* Disable the Input Capture channel 1 + (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, + TIM_CHANNEL_2 and TIM_CHANNEL_3) */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + + /* Disable the capture compare Interrupts event */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Hall Sensor Interface in DMA mode. + * @param htim TIM Hall Sensor Interface handle + * @param pData The destination Buffer address. + * @param Length The length of data to be transferred from TIM peripheral to memory. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length) +{ + uint32_t tmpsmcr; + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + + /* Check the parameters */ + assert_param(IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(htim->Instance)); + + /* Set the TIM channel state */ + if ((channel_1_state == HAL_TIM_CHANNEL_STATE_BUSY) + || (complementary_channel_1_state == HAL_TIM_CHANNEL_STATE_BUSY)) + { + return HAL_BUSY; + } + else if ((channel_1_state == HAL_TIM_CHANNEL_STATE_READY) + && (complementary_channel_1_state == HAL_TIM_CHANNEL_STATE_READY)) + { + if ((pData == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + + /* Enable the Input Capture channel 1 + (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, + TIM_CHANNEL_2 and TIM_CHANNEL_3) */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_ENABLE); + + /* Set the DMA Input Capture 1 Callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMACaptureCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMACaptureHalfCplt; + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAError ; + + /* Enable the DMA channel for Capture 1*/ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)&htim->Instance->CCR1, (uint32_t)pData, Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the capture compare 1 Interrupt */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Hall Sensor Interface in DMA mode. + * @param htim TIM Hall Sensor Interface handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim) +{ + /* Check the parameters */ + assert_param(IS_TIM_HALL_SENSOR_INTERFACE_INSTANCE(htim->Instance)); + + /* Disable the Input Capture channel 1 + (in the Hall Sensor Interface the three possible channels that can be used are TIM_CHANNEL_1, + TIM_CHANNEL_2 and TIM_CHANNEL_3) */ + TIM_CCxChannelCmd(htim->Instance, TIM_CHANNEL_1, TIM_CCx_DISABLE); + + + /* Disable the capture compare Interrupts 1 event */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1); + + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channel state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup TIMEx_Exported_Functions_Group2 Extended Timer Complementary Output Compare functions + * @brief Timer Complementary Output Compare functions + * +@verbatim + ============================================================================== + ##### Timer Complementary Output Compare functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Start the Complementary Output Compare/PWM. + (+) Stop the Complementary Output Compare/PWM. + (+) Start the Complementary Output Compare/PWM and enable interrupts. + (+) Stop the Complementary Output Compare/PWM and disable interrupts. + (+) Start the Complementary Output Compare/PWM and enable DMA transfers. + (+) Stop the Complementary Output Compare/PWM and disable DMA transfers. + +@endverbatim + * @{ + */ + +/** + * @brief Starts the TIM Output Compare signal generation on the complementary + * output. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM complementary channel state */ + if (TIM_CHANNEL_N_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the Capture compare channel N */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM Output Compare signal generation on the complementary + * output. + * @param htim TIM handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + /* Disable the Capture compare channel N */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM Output Compare signal generation in interrupt mode + * on the complementary output. + * @param htim TIM OC handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM complementary channel state */ + if (TIM_CHANNEL_N_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Enable the TIM Output Compare interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Enable the TIM Output Compare interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Enable the TIM Output Compare interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC3); + break; + } + + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the TIM Break interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_BREAK); + + /* Enable the Capture compare channel N */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM Output Compare signal generation in interrupt mode + * on the complementary output. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpccer; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Output Compare interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Output Compare interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Output Compare interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC3); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the Capture compare channel N */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); + + /* Disable the TIM Break interrupt (only if no more channel is active) */ + tmpccer = htim->Instance->CCER; + if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == (uint32_t)RESET) + { + __HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK); + } + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @brief Starts the TIM Output Compare signal generation in DMA mode + * on the complementary output. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @param pData The source Buffer address. + * @param Length The length of data to be transferred from memory to TIM peripheral + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData, + uint16_t Length) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + /* Set the TIM complementary channel state */ + if (TIM_CHANNEL_N_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_BUSY) + { + return HAL_BUSY; + } + else if (TIM_CHANNEL_N_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_READY) + { + if ((pData == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseNCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAErrorCCxN ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Output Compare DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseNCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAErrorCCxN ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Output Compare DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseNCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAErrorCCxN ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Output Compare DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC3); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the Capture compare channel N */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM Output Compare signal generation in DMA mode + * on the complementary output. + * @param htim TIM Output Compare handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Output Compare DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Output Compare DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Output Compare DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC3); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the Capture compare channel N */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @} + */ + +/** @defgroup TIMEx_Exported_Functions_Group3 Extended Timer Complementary PWM functions + * @brief Timer Complementary PWM functions + * +@verbatim + ============================================================================== + ##### Timer Complementary PWM functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Start the Complementary PWM. + (+) Stop the Complementary PWM. + (+) Start the Complementary PWM and enable interrupts. + (+) Stop the Complementary PWM and disable interrupts. + (+) Start the Complementary PWM and enable DMA transfers. + (+) Stop the Complementary PWM and disable DMA transfers. + (+) Start the Complementary Input Capture measurement. + (+) Stop the Complementary Input Capture. + (+) Start the Complementary Input Capture and enable interrupts. + (+) Stop the Complementary Input Capture and disable interrupts. + (+) Start the Complementary Input Capture and enable DMA transfers. + (+) Stop the Complementary Input Capture and disable DMA transfers. + (+) Start the Complementary One Pulse generation. + (+) Stop the Complementary One Pulse. + (+) Start the Complementary One Pulse and enable interrupts. + (+) Stop the Complementary One Pulse and disable interrupts. + +@endverbatim + * @{ + */ + +/** + * @brief Starts the PWM signal generation on the complementary output. + * @param htim TIM handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM complementary channel state */ + if (TIM_CHANNEL_N_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the complementary PWM output */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the PWM signal generation on the complementary output. + * @param htim TIM handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + /* Disable the complementary PWM output */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the PWM signal generation in interrupt mode on the + * complementary output. + * @param htim TIM handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + /* Check the TIM complementary channel state */ + if (TIM_CHANNEL_N_STATE_GET(htim, Channel) != HAL_TIM_CHANNEL_STATE_READY) + { + return HAL_ERROR; + } + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Enable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Enable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Enable the TIM Capture/Compare 3 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC3); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the TIM Break interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_BREAK); + + /* Enable the complementary PWM output */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the PWM signal generation in interrupt mode on the + * complementary output. + * @param htim TIM handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpccer; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Capture/Compare 3 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC3); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the complementary PWM output */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); + + /* Disable the TIM Break interrupt (only if no more channel is active) */ + tmpccer = htim->Instance->CCER; + if ((tmpccer & (TIM_CCER_CC1NE | TIM_CCER_CC2NE | TIM_CCER_CC3NE)) == (uint32_t)RESET) + { + __HAL_TIM_DISABLE_IT(htim, TIM_IT_BREAK); + } + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @brief Starts the TIM PWM signal generation in DMA mode on the + * complementary output + * @param htim TIM handle + * @param Channel TIM Channel to be enabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @param pData The source Buffer address. + * @param Length The length of data to be transferred from memory to TIM peripheral + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, const uint32_t *pData, + uint16_t Length) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + /* Set the TIM complementary channel state */ + if (TIM_CHANNEL_N_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_BUSY) + { + return HAL_BUSY; + } + else if (TIM_CHANNEL_N_STATE_GET(htim, Channel) == HAL_TIM_CHANNEL_STATE_READY) + { + if ((pData == NULL) || (Length == 0U)) + { + return HAL_ERROR; + } + else + { + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_BUSY); + } + } + else + { + return HAL_ERROR; + } + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC1]->XferCpltCallback = TIM_DMADelayPulseNCplt; + htim->hdma[TIM_DMA_ID_CC1]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC1]->XferErrorCallback = TIM_DMAErrorCCxN ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC1], (uint32_t)pData, (uint32_t)&htim->Instance->CCR1, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 1 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1); + break; + } + + case TIM_CHANNEL_2: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC2]->XferCpltCallback = TIM_DMADelayPulseNCplt; + htim->hdma[TIM_DMA_ID_CC2]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC2]->XferErrorCallback = TIM_DMAErrorCCxN ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC2], (uint32_t)pData, (uint32_t)&htim->Instance->CCR2, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 2 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC2); + break; + } + + case TIM_CHANNEL_3: + { + /* Set the DMA compare callbacks */ + htim->hdma[TIM_DMA_ID_CC3]->XferCpltCallback = TIM_DMADelayPulseNCplt; + htim->hdma[TIM_DMA_ID_CC3]->XferHalfCpltCallback = TIM_DMADelayPulseHalfCplt; + + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_CC3]->XferErrorCallback = TIM_DMAErrorCCxN ; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(htim->hdma[TIM_DMA_ID_CC3], (uint32_t)pData, (uint32_t)&htim->Instance->CCR3, + Length) != HAL_OK) + { + /* Return error status */ + return HAL_ERROR; + } + /* Enable the TIM Capture/Compare 3 DMA request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC3); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Enable the complementary PWM output */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + + /* Enable the Peripheral, except in trigger mode where enable is automatically done with trigger */ + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + tmpsmcr = htim->Instance->SMCR & TIM_SMCR_SMS; + if (!IS_TIM_SLAVEMODE_TRIGGER_ENABLED(tmpsmcr)) + { + __HAL_TIM_ENABLE(htim); + } + } + else + { + __HAL_TIM_ENABLE(htim); + } + } + + /* Return function status */ + return status; +} + +/** + * @brief Stops the TIM PWM signal generation in DMA mode on the complementary + * output + * @param htim TIM handle + * @param Channel TIM Channel to be disabled + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @arg TIM_CHANNEL_3: TIM Channel 3 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, Channel)); + + switch (Channel) + { + case TIM_CHANNEL_1: + { + /* Disable the TIM Capture/Compare 1 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC1]); + break; + } + + case TIM_CHANNEL_2: + { + /* Disable the TIM Capture/Compare 2 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC2); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC2]); + break; + } + + case TIM_CHANNEL_3: + { + /* Disable the TIM Capture/Compare 3 DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC3); + (void)HAL_DMA_Abort_IT(htim->hdma[TIM_DMA_ID_CC3]); + break; + } + + default: + status = HAL_ERROR; + break; + } + + if (status == HAL_OK) + { + /* Disable the complementary PWM output */ + TIM_CCxNChannelCmd(htim->Instance, Channel, TIM_CCxN_DISABLE); + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM complementary channel state */ + TIM_CHANNEL_N_STATE_SET(htim, Channel, HAL_TIM_CHANNEL_STATE_READY); + } + + /* Return function status */ + return status; +} + +/** + * @} + */ + +/** @defgroup TIMEx_Exported_Functions_Group4 Extended Timer Complementary One Pulse functions + * @brief Timer Complementary One Pulse functions + * +@verbatim + ============================================================================== + ##### Timer Complementary One Pulse functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Start the Complementary One Pulse generation. + (+) Stop the Complementary One Pulse. + (+) Start the Complementary One Pulse and enable interrupts. + (+) Stop the Complementary One Pulse and disable interrupts. + +@endverbatim + * @{ + */ + +/** + * @brief Starts the TIM One Pulse signal generation on the complementary + * output. + * @note OutputChannel must match the pulse output channel chosen when calling + * @ref HAL_TIM_OnePulse_ConfigChannel(). + * @param htim TIM One Pulse handle + * @param OutputChannel pulse output channel to enable + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel) +{ + uint32_t input_channel = (OutputChannel == TIM_CHANNEL_1) ? TIM_CHANNEL_2 : TIM_CHANNEL_1; + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel)); + + /* Check the TIM channels state */ + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the complementary One Pulse output channel and the Input Capture channel */ + TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_ENABLE); + TIM_CCxChannelCmd(htim->Instance, input_channel, TIM_CCx_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM One Pulse signal generation on the complementary + * output. + * @note OutputChannel must match the pulse output channel chosen when calling + * @ref HAL_TIM_OnePulse_ConfigChannel(). + * @param htim TIM One Pulse handle + * @param OutputChannel pulse output channel to disable + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel) +{ + uint32_t input_channel = (OutputChannel == TIM_CHANNEL_1) ? TIM_CHANNEL_2 : TIM_CHANNEL_1; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel)); + + /* Disable the complementary One Pulse output channel and the Input Capture channel */ + TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_DISABLE); + TIM_CCxChannelCmd(htim->Instance, input_channel, TIM_CCx_DISABLE); + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Starts the TIM One Pulse signal generation in interrupt mode on the + * complementary channel. + * @note OutputChannel must match the pulse output channel chosen when calling + * @ref HAL_TIM_OnePulse_ConfigChannel(). + * @param htim TIM One Pulse handle + * @param OutputChannel pulse output channel to enable + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel) +{ + uint32_t input_channel = (OutputChannel == TIM_CHANNEL_1) ? TIM_CHANNEL_2 : TIM_CHANNEL_1; + HAL_TIM_ChannelStateTypeDef channel_1_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef channel_2_state = TIM_CHANNEL_STATE_GET(htim, TIM_CHANNEL_2); + HAL_TIM_ChannelStateTypeDef complementary_channel_1_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_1); + HAL_TIM_ChannelStateTypeDef complementary_channel_2_state = TIM_CHANNEL_N_STATE_GET(htim, TIM_CHANNEL_2); + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel)); + + /* Check the TIM channels state */ + if ((channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (channel_2_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_1_state != HAL_TIM_CHANNEL_STATE_READY) + || (complementary_channel_2_state != HAL_TIM_CHANNEL_STATE_READY)) + { + return HAL_ERROR; + } + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_BUSY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_BUSY); + + /* Enable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC1); + + /* Enable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_CC2); + + /* Enable the complementary One Pulse output channel and the Input Capture channel */ + TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_ENABLE); + TIM_CCxChannelCmd(htim->Instance, input_channel, TIM_CCx_ENABLE); + + /* Enable the Main Output */ + __HAL_TIM_MOE_ENABLE(htim); + + /* Return function status */ + return HAL_OK; +} + +/** + * @brief Stops the TIM One Pulse signal generation in interrupt mode on the + * complementary channel. + * @note OutputChannel must match the pulse output channel chosen when calling + * @ref HAL_TIM_OnePulse_ConfigChannel(). + * @param htim TIM One Pulse handle + * @param OutputChannel pulse output channel to disable + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 selected + * @arg TIM_CHANNEL_2: TIM Channel 2 selected + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel) +{ + uint32_t input_channel = (OutputChannel == TIM_CHANNEL_1) ? TIM_CHANNEL_2 : TIM_CHANNEL_1; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, OutputChannel)); + + /* Disable the TIM Capture/Compare 1 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC1); + + /* Disable the TIM Capture/Compare 2 interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_CC2); + + /* Disable the complementary One Pulse output channel and the Input Capture channel */ + TIM_CCxNChannelCmd(htim->Instance, OutputChannel, TIM_CCxN_DISABLE); + TIM_CCxChannelCmd(htim->Instance, input_channel, TIM_CCx_DISABLE); + + /* Disable the Main Output */ + __HAL_TIM_MOE_DISABLE(htim); + + /* Disable the Peripheral */ + __HAL_TIM_DISABLE(htim); + + /* Set the TIM channels state */ + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + + /* Return function status */ + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup TIMEx_Exported_Functions_Group5 Extended Peripheral Control functions + * @brief Peripheral Control functions + * +@verbatim + ============================================================================== + ##### Peripheral Control functions ##### + ============================================================================== + [..] + This section provides functions allowing to: + (+) Configure the commutation event in case of use of the Hall sensor interface. + (+) Configure Output channels for OC and PWM mode. + + (+) Configure Complementary channels, break features and dead time. + (+) Configure Master synchronization. + (+) Configure timer remapping capabilities. + (+) Enable or disable channel grouping. + +@endverbatim + * @{ + */ + +/** + * @brief Configure the TIM commutation event sequence. + * @note This function is mandatory to use the commutation event in order to + * update the configuration at each commutation detection on the TRGI input of the Timer, + * the typical use of this feature is with the use of another Timer(interface Timer) + * configured in Hall sensor interface, this interface Timer will generate the + * commutation at its TRGO output (connected to Timer used in this function) each time + * the TI1 of the Interface Timer detect a commutation at its input TI1. + * @param htim TIM handle + * @param InputTrigger the Internal trigger corresponding to the Timer Interfacing with the Hall sensor + * This parameter can be one of the following values: + * @arg TIM_TS_ITR0: Internal trigger 0 selected + * @arg TIM_TS_ITR1: Internal trigger 1 selected + * @arg TIM_TS_ITR2: Internal trigger 2 selected + * @arg TIM_TS_ITR3: Internal trigger 3 selected + * @arg TIM_TS_NONE: No trigger is needed + * @param CommutationSource the Commutation Event source + * This parameter can be one of the following values: + * @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer + * @arg TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger, + uint32_t CommutationSource) +{ + /* Check the parameters */ + assert_param(IS_TIM_COMMUTATION_EVENT_INSTANCE(htim->Instance)); + assert_param(IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(InputTrigger)); + + __HAL_LOCK(htim); + + if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) || + (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3)) + { + /* Select the Input trigger */ + htim->Instance->SMCR &= ~TIM_SMCR_TS; + htim->Instance->SMCR |= InputTrigger; + } + + /* Select the Capture Compare preload feature */ + htim->Instance->CR2 |= TIM_CR2_CCPC; + /* Select the Commutation event source */ + htim->Instance->CR2 &= ~TIM_CR2_CCUS; + htim->Instance->CR2 |= CommutationSource; + + /* Disable Commutation Interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_COM); + + /* Disable Commutation DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_COM); + + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Configure the TIM commutation event sequence with interrupt. + * @note This function is mandatory to use the commutation event in order to + * update the configuration at each commutation detection on the TRGI input of the Timer, + * the typical use of this feature is with the use of another Timer(interface Timer) + * configured in Hall sensor interface, this interface Timer will generate the + * commutation at its TRGO output (connected to Timer used in this function) each time + * the TI1 of the Interface Timer detect a commutation at its input TI1. + * @param htim TIM handle + * @param InputTrigger the Internal trigger corresponding to the Timer Interfacing with the Hall sensor + * This parameter can be one of the following values: + * @arg TIM_TS_ITR0: Internal trigger 0 selected + * @arg TIM_TS_ITR1: Internal trigger 1 selected + * @arg TIM_TS_ITR2: Internal trigger 2 selected + * @arg TIM_TS_ITR3: Internal trigger 3 selected + * @arg TIM_TS_NONE: No trigger is needed + * @param CommutationSource the Commutation Event source + * This parameter can be one of the following values: + * @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer + * @arg TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger, + uint32_t CommutationSource) +{ + /* Check the parameters */ + assert_param(IS_TIM_COMMUTATION_EVENT_INSTANCE(htim->Instance)); + assert_param(IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(InputTrigger)); + + __HAL_LOCK(htim); + + if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) || + (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3)) + { + /* Select the Input trigger */ + htim->Instance->SMCR &= ~TIM_SMCR_TS; + htim->Instance->SMCR |= InputTrigger; + } + + /* Select the Capture Compare preload feature */ + htim->Instance->CR2 |= TIM_CR2_CCPC; + /* Select the Commutation event source */ + htim->Instance->CR2 &= ~TIM_CR2_CCUS; + htim->Instance->CR2 |= CommutationSource; + + /* Disable Commutation DMA request */ + __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_COM); + + /* Enable the Commutation Interrupt */ + __HAL_TIM_ENABLE_IT(htim, TIM_IT_COM); + + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Configure the TIM commutation event sequence with DMA. + * @note This function is mandatory to use the commutation event in order to + * update the configuration at each commutation detection on the TRGI input of the Timer, + * the typical use of this feature is with the use of another Timer(interface Timer) + * configured in Hall sensor interface, this interface Timer will generate the + * commutation at its TRGO output (connected to Timer used in this function) each time + * the TI1 of the Interface Timer detect a commutation at its input TI1. + * @note The user should configure the DMA in his own software, in This function only the COMDE bit is set + * @param htim TIM handle + * @param InputTrigger the Internal trigger corresponding to the Timer Interfacing with the Hall sensor + * This parameter can be one of the following values: + * @arg TIM_TS_ITR0: Internal trigger 0 selected + * @arg TIM_TS_ITR1: Internal trigger 1 selected + * @arg TIM_TS_ITR2: Internal trigger 2 selected + * @arg TIM_TS_ITR3: Internal trigger 3 selected + * @arg TIM_TS_NONE: No trigger is needed + * @param CommutationSource the Commutation Event source + * This parameter can be one of the following values: + * @arg TIM_COMMUTATION_TRGI: Commutation source is the TRGI of the Interface Timer + * @arg TIM_COMMUTATION_SOFTWARE: Commutation source is set by software using the COMG bit + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger, + uint32_t CommutationSource) +{ + /* Check the parameters */ + assert_param(IS_TIM_COMMUTATION_EVENT_INSTANCE(htim->Instance)); + assert_param(IS_TIM_INTERNAL_TRIGGEREVENT_SELECTION(InputTrigger)); + + __HAL_LOCK(htim); + + if ((InputTrigger == TIM_TS_ITR0) || (InputTrigger == TIM_TS_ITR1) || + (InputTrigger == TIM_TS_ITR2) || (InputTrigger == TIM_TS_ITR3)) + { + /* Select the Input trigger */ + htim->Instance->SMCR &= ~TIM_SMCR_TS; + htim->Instance->SMCR |= InputTrigger; + } + + /* Select the Capture Compare preload feature */ + htim->Instance->CR2 |= TIM_CR2_CCPC; + /* Select the Commutation event source */ + htim->Instance->CR2 &= ~TIM_CR2_CCUS; + htim->Instance->CR2 |= CommutationSource; + + /* Enable the Commutation DMA Request */ + /* Set the DMA Commutation Callback */ + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferCpltCallback = TIMEx_DMACommutationCplt; + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferHalfCpltCallback = TIMEx_DMACommutationHalfCplt; + /* Set the DMA error callback */ + htim->hdma[TIM_DMA_ID_COMMUTATION]->XferErrorCallback = TIM_DMAError; + + /* Disable Commutation Interrupt */ + __HAL_TIM_DISABLE_IT(htim, TIM_IT_COM); + + /* Enable the Commutation DMA Request */ + __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_COM); + + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Configures the TIM in master mode. + * @param htim TIM handle. + * @param sMasterConfig pointer to a TIM_MasterConfigTypeDef structure that + * contains the selected trigger output (TRGO) and the Master/Slave + * mode. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, + const TIM_MasterConfigTypeDef *sMasterConfig) +{ + uint32_t tmpcr2; + uint32_t tmpsmcr; + + /* Check the parameters */ + assert_param(IS_TIM_MASTER_INSTANCE(htim->Instance)); + assert_param(IS_TIM_TRGO_SOURCE(sMasterConfig->MasterOutputTrigger)); + assert_param(IS_TIM_MSM_STATE(sMasterConfig->MasterSlaveMode)); + + /* Check input state */ + __HAL_LOCK(htim); + + /* Change the handler state */ + htim->State = HAL_TIM_STATE_BUSY; + + /* Get the TIMx CR2 register value */ + tmpcr2 = htim->Instance->CR2; + + /* Get the TIMx SMCR register value */ + tmpsmcr = htim->Instance->SMCR; + +#if defined(TIM_CR2_MMS2) + /* If the timer supports ADC synchronization through TRGO2, set the master mode selection 2 */ + if (IS_TIM_TRGO2_INSTANCE(htim->Instance)) + { + /* Check the parameters */ + assert_param(IS_TIM_TRGO2_SOURCE(sMasterConfig->MasterOutputTrigger2)); + + /* Clear the MMS2 bits */ + tmpcr2 &= ~TIM_CR2_MMS2; + /* Select the TRGO2 source*/ + tmpcr2 |= sMasterConfig->MasterOutputTrigger2; + } +#endif /* TIM_CR2_MMS2 */ + + /* Reset the MMS Bits */ + tmpcr2 &= ~TIM_CR2_MMS; + /* Select the TRGO source */ + tmpcr2 |= sMasterConfig->MasterOutputTrigger; + + /* Update TIMx CR2 */ + htim->Instance->CR2 = tmpcr2; + + if (IS_TIM_SLAVE_INSTANCE(htim->Instance)) + { + /* Reset the MSM Bit */ + tmpsmcr &= ~TIM_SMCR_MSM; + /* Set master mode */ + tmpsmcr |= sMasterConfig->MasterSlaveMode; + + /* Update TIMx SMCR */ + htim->Instance->SMCR = tmpsmcr; + } + + /* Change the htim state */ + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Configures the Break feature, dead time, Lock level, OSSI/OSSR State + * and the AOE(automatic output enable). + * @param htim TIM handle + * @param sBreakDeadTimeConfig pointer to a TIM_ConfigBreakDeadConfigTypeDef structure that + * contains the BDTR Register configuration information for the TIM peripheral. + * @note Interrupts can be generated when an active level is detected on the + * break input, the break 2 input or the system break input. Break + * interrupt can be enabled by calling the @ref __HAL_TIM_ENABLE_IT macro. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, + const TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig) +{ + /* Keep this variable initialized to 0 as it is used to configure BDTR register */ + uint32_t tmpbdtr = 0U; + + /* Check the parameters */ + assert_param(IS_TIM_BREAK_INSTANCE(htim->Instance)); + assert_param(IS_TIM_OSSR_STATE(sBreakDeadTimeConfig->OffStateRunMode)); + assert_param(IS_TIM_OSSI_STATE(sBreakDeadTimeConfig->OffStateIDLEMode)); + assert_param(IS_TIM_LOCK_LEVEL(sBreakDeadTimeConfig->LockLevel)); + assert_param(IS_TIM_DEADTIME(sBreakDeadTimeConfig->DeadTime)); + assert_param(IS_TIM_BREAK_STATE(sBreakDeadTimeConfig->BreakState)); + assert_param(IS_TIM_BREAK_POLARITY(sBreakDeadTimeConfig->BreakPolarity)); +#if defined(TIM_BDTR_BKF) + assert_param(IS_TIM_BREAK_FILTER(sBreakDeadTimeConfig->BreakFilter)); +#endif /* TIM_BDTR_BKF */ + assert_param(IS_TIM_AUTOMATIC_OUTPUT_STATE(sBreakDeadTimeConfig->AutomaticOutput)); + + /* Check input state */ + __HAL_LOCK(htim); + + /* Set the Lock level, the Break enable Bit and the Polarity, the OSSR State, + the OSSI State, the dead time value and the Automatic Output Enable Bit */ + + /* Set the BDTR bits */ + MODIFY_REG(tmpbdtr, TIM_BDTR_DTG, sBreakDeadTimeConfig->DeadTime); + MODIFY_REG(tmpbdtr, TIM_BDTR_LOCK, sBreakDeadTimeConfig->LockLevel); + MODIFY_REG(tmpbdtr, TIM_BDTR_OSSI, sBreakDeadTimeConfig->OffStateIDLEMode); + MODIFY_REG(tmpbdtr, TIM_BDTR_OSSR, sBreakDeadTimeConfig->OffStateRunMode); + MODIFY_REG(tmpbdtr, TIM_BDTR_BKE, sBreakDeadTimeConfig->BreakState); + MODIFY_REG(tmpbdtr, TIM_BDTR_BKP, sBreakDeadTimeConfig->BreakPolarity); + MODIFY_REG(tmpbdtr, TIM_BDTR_AOE, sBreakDeadTimeConfig->AutomaticOutput); +#if defined(TIM_BDTR_BKF) + MODIFY_REG(tmpbdtr, TIM_BDTR_BKF, (sBreakDeadTimeConfig->BreakFilter << TIM_BDTR_BKF_Pos)); +#endif /* TIM_BDTR_BKF */ + +#if defined(TIM_BDTR_BK2E) + if (IS_TIM_BKIN2_INSTANCE(htim->Instance)) + { + /* Check the parameters */ + assert_param(IS_TIM_BREAK2_STATE(sBreakDeadTimeConfig->Break2State)); + assert_param(IS_TIM_BREAK2_POLARITY(sBreakDeadTimeConfig->Break2Polarity)); + assert_param(IS_TIM_BREAK_FILTER(sBreakDeadTimeConfig->Break2Filter)); + + /* Set the BREAK2 input related BDTR bits */ + MODIFY_REG(tmpbdtr, TIM_BDTR_BK2F, (sBreakDeadTimeConfig->Break2Filter << TIM_BDTR_BK2F_Pos)); + MODIFY_REG(tmpbdtr, TIM_BDTR_BK2E, sBreakDeadTimeConfig->Break2State); + MODIFY_REG(tmpbdtr, TIM_BDTR_BK2P, sBreakDeadTimeConfig->Break2Polarity); + } +#endif /* TIM_BDTR_BK2E */ + + /* Set TIMx_BDTR */ + htim->Instance->BDTR = tmpbdtr; + + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +/** + * @brief Configures the TIMx Remapping input capabilities. + * @param htim TIM handle. + * @param Remap specifies the TIM remapping source. + @if STM32F301x8 + * For TIM1, the parameter can have the following values: + * @arg TIM_TIM1_ADC1_NONE: TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM1_ADC1_AWD1: TIM1_ETR is connected to ADC1 AWD1 + * @arg TIM_TIM1_ADC1_AWD2: TIM1_ETR is connected to ADC1 AWD2 + * @arg TIM_TIM1_ADC1_AWD3: TIM1_ETR is connected to ADC1 AWD2 + @elseif STM32F303xE + * For TIM1, the parameter is a combination of 2 fields (field1 | field2): + * + * field1 can have the following values: + * @arg TIM_TIM1_ADC1_NONE: TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM1_ADC1_AWD1: TIM1_ETR is connected to ADC1 AWD1 + * @arg TIM_TIM1_ADC1_AWD2: TIM1_ETR is connected to ADC1 AWD2 + * @arg TIM_TIM1_ADC1_AWD3: TIM1_ETR is connected to ADC1 AWD2 + * + * field2 can have the following values: + * @arg TIM_TIM1_ADC4_NONE : TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM1_ADC4_AWD1: TIM1_ETR is connected to ADC4 AWD1 + * @arg TIM_TIM1_ADC4_AWD2: TIM1_ETR is connected to ADC4 AWD2 + * @arg TIM_TIM1_ADC4_AWD3: TIM1_ETR is connected to ADC4 AWD3 + @elseif STM32F334x8 + * For TIM1, the parameter is a combination of 2 fields (field1 | field2): + * + * field1 can have the following values: + * @arg TIM_TIM1_ADC1_NONE: TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM1_ADC1_AWD1: TIM1_ETR is connected to ADC1 AWD1 + * @arg TIM_TIM1_ADC1_AWD2: TIM1_ETR is connected to ADC1 AWD2 + * @arg TIM_TIM1_ADC1_AWD3: TIM1_ETR is connected to ADC1 AWD2 + * + * field2 can have the following values: + * @arg TIM_TIM1_ADC2_NONE : TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM1_ADC2_AWD1: TIM1_ETR is connected to ADC2 AWD1 + * @arg TIM_TIM1_ADC2_AWD2: TIM1_ETR is connected to ADC2 AWD2 + * @arg TIM_TIM1_ADC2_AWD3: TIM1_ETR is connected to ADC2 AWD3 + @endif + @if STM32F303xE + * For TIM8, the parameter is a combination of 2 fields (field1 | field2): + * + * field1 can have the following values: + * @arg TIM_TIM8_ADC2_NONE: TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM8_ADC2_AWD1: TIM1_ETR is connected to ADC2 AWD1 + * @arg TIM_TIM8_ADC2_AWD2: TIM1_ETR is connected to ADC2 AWD2 + * @arg TIM_TIM8_ADC2_AWD3: TIM1_ETR is connected to ADC2 AWD2 + * + * field2 can have the following values: + * @arg TIM_TIM8_ADC3_NONE : TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM8_ADC3_AWD1: TIM1_ETR is connected to ADC3 AWD1 + * @arg TIM_TIM8_ADC3_AWD2: TIM1_ETR is connected to ADC3 AWD2 + * @arg TIM_TIM8_ADC3_AWD3: TIM1_ETR is connected to ADC3 AWD3 + @endif + @if STM32F373xC + * For TIM14, the parameter can have the following values: + * @arg TIM_TIM14_GPIO: TIM14 TI1 is connected to GPIO + * @arg TIM_TIM14_RTC: TIM14 TI1 is connected to RTC_clock + * @arg TIM_TIM14_HSE: TIM14 TI1 is connected to HSE/32 + * @arg TIM_TIM14_MCO: TIM14 TI1 is connected to MCO + @else + * For TIM16, the parameter can have the following values: + * @arg TIM_TIM16_GPIO: TIM16 TI1 is connected to GPIO + * @arg TIM_TIM16_RTC: TIM16 TI1 is connected to RTC_clock + * @arg TIM_TIM16_HSE: TIM16 TI1 is connected to HSE/32 + * @arg TIM_TIM16_MCO: TIM16 TI1 is connected to MCO + @endif + @if STM32F303xE + * For TIM20, the parameter is a combination of 2 fields (field1 | field2): + * + * field1 can have the following values: + * @arg TIM_TIM20_ADC3_NONE: TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM20_ADC3_AWD1: TIM1_ETR is connected to ADC3 AWD1 + * @arg TIM_TIM20_ADC3_AWD2: TIM1_ETR is connected to ADC3 AWD2 + * @arg TIM_TIM20_ADC3_AWD3: TIM1_ETR is connected to ADC3 AWD2 + * + * field2 can have the following values: + * @arg TIM_TIM20_ADC4_NONE : TIM1_ETR is not connected to any AWD (analog watchdog) + * @arg TIM_TIM20_ADC4_AWD1: TIM1_ETR is connected to ADC4 AWD1 + * @arg TIM_TIM20_ADC4_AWD2: TIM1_ETR is connected to ADC4 AWD2 + * @arg TIM_TIM20_ADC4_AWD3: TIM1_ETR is connected to ADC4 AWD3 + @endif + * + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap) +{ + + /* Check parameters */ + assert_param(IS_TIM_REMAP(htim->Instance, Remap)); + + __HAL_LOCK(htim); + + /* Set the Timer remapping configuration */ + WRITE_REG(htim->Instance->OR, Remap); + + __HAL_UNLOCK(htim); + + return HAL_OK; +} + +#if defined(TIM_CCR5_CCR5) +/** + * @brief Group channel 5 and channel 1, 2 or 3 + * @param htim TIM handle. + * @param Channels specifies the reference signal(s) the OC5REF is combined with. + * This parameter can be any combination of the following values: + * TIM_GROUPCH5_NONE: No effect of OC5REF on OC1REFC, OC2REFC and OC3REFC + * TIM_GROUPCH5_OC1REFC: OC1REFC is the logical AND of OC1REFC and OC5REF + * TIM_GROUPCH5_OC2REFC: OC2REFC is the logical AND of OC2REFC and OC5REF + * TIM_GROUPCH5_OC3REFC: OC3REFC is the logical AND of OC3REFC and OC5REF + * @retval HAL status + */ +HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Channels) +{ + /* Check parameters */ + assert_param(IS_TIM_COMBINED3PHASEPWM_INSTANCE(htim->Instance)); + assert_param(IS_TIM_GROUPCH5(Channels)); + + /* Process Locked */ + __HAL_LOCK(htim); + + htim->State = HAL_TIM_STATE_BUSY; + + /* Clear GC5Cx bit fields */ + htim->Instance->CCR5 &= ~(TIM_CCR5_GC5C3 | TIM_CCR5_GC5C2 | TIM_CCR5_GC5C1); + + /* Set GC5Cx bit fields */ + htim->Instance->CCR5 |= Channels; + + /* Change the htim state */ + htim->State = HAL_TIM_STATE_READY; + + __HAL_UNLOCK(htim); + + return HAL_OK; +} +#endif /* TIM_CCR5_CCR5 */ + +/** + * @} + */ + +/** @defgroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions + * @brief Extended Callbacks functions + * +@verbatim + ============================================================================== + ##### Extended Callbacks functions ##### + ============================================================================== + [..] + This section provides Extended TIM callback functions: + (+) Timer Commutation callback + (+) Timer Break callback + +@endverbatim + * @{ + */ + +/** + * @brief Hall commutation changed callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIMEx_CommutCallback could be implemented in the user file + */ +} +/** + * @brief Hall commutation changed half complete callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIMEx_CommutHalfCpltCallback could be implemented in the user file + */ +} + +/** + * @brief Hall Break detection callback in non-blocking mode + * @param htim TIM handle + * @retval None + */ +__weak void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_TIMEx_BreakCallback could be implemented in the user file + */ +} + +#if defined(TIM_BDTR_BK2E) +/** + * @brief Hall Break2 detection callback in non blocking mode + * @param htim: TIM handle + * @retval None + */ +__weak void HAL_TIMEx_Break2Callback(TIM_HandleTypeDef *htim) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(htim); + + /* NOTE : This function Should not be modified, when the callback is needed, + the HAL_TIMEx_Break2Callback could be implemented in the user file + */ +} +#endif /* TIM_BDTR_BK2E */ +/** + * @} + */ + +/** @defgroup TIMEx_Exported_Functions_Group7 Extended Peripheral State functions + * @brief Extended Peripheral State functions + * +@verbatim + ============================================================================== + ##### Extended Peripheral State functions ##### + ============================================================================== + [..] + This subsection permits to get in run-time the status of the peripheral + and the data flow. + +@endverbatim + * @{ + */ + +/** + * @brief Return the TIM Hall Sensor interface handle state. + * @param htim TIM Hall Sensor handle + * @retval HAL state + */ +HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(const TIM_HandleTypeDef *htim) +{ + return htim->State; +} + +/** + * @brief Return actual state of the TIM complementary channel. + * @param htim TIM handle + * @param ChannelN TIM Complementary channel + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 + * @arg TIM_CHANNEL_2: TIM Channel 2 + * @arg TIM_CHANNEL_3: TIM Channel 3 + * @retval TIM Complementary channel state + */ +HAL_TIM_ChannelStateTypeDef HAL_TIMEx_GetChannelNState(const TIM_HandleTypeDef *htim, uint32_t ChannelN) +{ + HAL_TIM_ChannelStateTypeDef channel_state; + + /* Check the parameters */ + assert_param(IS_TIM_CCXN_INSTANCE(htim->Instance, ChannelN)); + + channel_state = TIM_CHANNEL_N_STATE_GET(htim, ChannelN); + + return channel_state; +} +/** + * @} + */ + +/** + * @} + */ + +/* Private functions ---------------------------------------------------------*/ +/** @defgroup TIMEx_Private_Functions TIM Extended Private Functions + * @{ + */ + +/** + * @brief TIM DMA Commutation callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + /* Change the htim state */ + htim->State = HAL_TIM_STATE_READY; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->CommutationCallback(htim); +#else + HAL_TIMEx_CommutCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +} + +/** + * @brief TIM DMA Commutation half complete callback. + * @param hdma pointer to DMA handle. + * @retval None + */ +void TIMEx_DMACommutationHalfCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + /* Change the htim state */ + htim->State = HAL_TIM_STATE_READY; + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->CommutationHalfCpltCallback(htim); +#else + HAL_TIMEx_CommutHalfCpltCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ +} + + +/** + * @brief TIM DMA Delay Pulse complete callback (complementary channel). + * @param hdma pointer to DMA handle. + * @retval None + */ +static void TIM_DMADelayPulseNCplt(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY); + } + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC4]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_4; + + if (hdma->Init.Mode == DMA_NORMAL) + { + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_4, HAL_TIM_CHANNEL_STATE_READY); + } + } + else + { + /* nothing to do */ + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->PWM_PulseFinishedCallback(htim); +#else + HAL_TIM_PWM_PulseFinishedCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief TIM DMA error callback (complementary channel) + * @param hdma pointer to DMA handle. + * @retval None + */ +static void TIM_DMAErrorCCxN(DMA_HandleTypeDef *hdma) +{ + TIM_HandleTypeDef *htim = (TIM_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + if (hdma == htim->hdma[TIM_DMA_ID_CC1]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_1; + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_1, HAL_TIM_CHANNEL_STATE_READY); + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC2]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_2; + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_2, HAL_TIM_CHANNEL_STATE_READY); + } + else if (hdma == htim->hdma[TIM_DMA_ID_CC3]) + { + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_3; + TIM_CHANNEL_N_STATE_SET(htim, TIM_CHANNEL_3, HAL_TIM_CHANNEL_STATE_READY); + } + else + { + /* nothing to do */ + } + +#if (USE_HAL_TIM_REGISTER_CALLBACKS == 1) + htim->ErrorCallback(htim); +#else + HAL_TIM_ErrorCallback(htim); +#endif /* USE_HAL_TIM_REGISTER_CALLBACKS */ + + htim->Channel = HAL_TIM_ACTIVE_CHANNEL_CLEARED; +} + +/** + * @brief Enables or disables the TIM Capture Compare Channel xN. + * @param TIMx to select the TIM peripheral + * @param Channel specifies the TIM Channel + * This parameter can be one of the following values: + * @arg TIM_CHANNEL_1: TIM Channel 1 + * @arg TIM_CHANNEL_2: TIM Channel 2 + * @arg TIM_CHANNEL_3: TIM Channel 3 + * @param ChannelNState specifies the TIM Channel CCxNE bit new state. + * This parameter can be: TIM_CCxN_ENABLE or TIM_CCxN_Disable. + * @retval None + */ +static void TIM_CCxNChannelCmd(TIM_TypeDef *TIMx, uint32_t Channel, uint32_t ChannelNState) +{ + uint32_t tmp; + + tmp = TIM_CCER_CC1NE << (Channel & 0x1FU); /* 0x1FU = 31 bits max shift */ + + /* Reset the CCxNE Bit */ + TIMx->CCER &= ~tmp; + + /* Set or reset the CCxNE Bit */ + TIMx->CCER |= (uint32_t)(ChannelNState << (Channel & 0x1FU)); /* 0x1FU = 31 bits max shift */ +} +/** + * @} + */ + +#endif /* HAL_TIM_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c new file mode 100644 index 0000000..253bae8 --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart.c @@ -0,0 +1,4015 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_uart.c + * @author MCD Application Team + * @brief UART HAL module driver. + * This file provides firmware functions to manage the following + * functionalities of the Universal Asynchronous Receiver Transmitter Peripheral (UART). + * + Initialization and de-initialization functions + * + IO operation functions + * + Peripheral Control functions + * + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + =============================================================================== + ##### How to use this driver ##### + =============================================================================== + [..] + The UART HAL driver can be used as follows: + + (#) Declare a UART_HandleTypeDef handle structure (eg. UART_HandleTypeDef huart). + (#) Initialize the UART low level resources by implementing the HAL_UART_MspInit() API: + (++) Enable the USARTx interface clock. + (++) UART pins configuration: + (+++) Enable the clock for the UART GPIOs. + (+++) Configure these UART pins as alternate function pull-up. + (++) NVIC configuration if you need to use interrupt process (HAL_UART_Transmit_IT() + and HAL_UART_Receive_IT() APIs): + (+++) Configure the USARTx interrupt priority. + (+++) Enable the NVIC USART IRQ handle. + (++) UART interrupts handling: + -@@- The specific UART interrupts (Transmission complete interrupt, + RXNE interrupt, RX/TX FIFOs related interrupts and Error Interrupts) + are managed using the macros __HAL_UART_ENABLE_IT() and __HAL_UART_DISABLE_IT() + inside the transmit and receive processes. + (++) DMA Configuration if you need to use DMA process (HAL_UART_Transmit_DMA() + and HAL_UART_Receive_DMA() APIs): + (+++) Declare a DMA handle structure for the Tx/Rx channel. + (+++) Enable the DMAx interface clock. + (+++) Configure the declared DMA handle structure with the required Tx/Rx parameters. + (+++) Configure the DMA Tx/Rx channel. + (+++) Associate the initialized DMA handle to the UART DMA Tx/Rx handle. + (+++) Configure the priority and enable the NVIC for the transfer complete + interrupt on the DMA Tx/Rx channel. + + (#) Program the Baud Rate, Word Length, Stop Bit, Parity, Hardware + flow control and Mode (Receiver/Transmitter) in the huart handle Init structure. + + (#) If required, program UART advanced features (TX/RX pins swap, auto Baud rate detection,...) + in the huart handle AdvancedInit structure. + + (#) For the UART asynchronous mode, initialize the UART registers by calling + the HAL_UART_Init() API. + + (#) For the UART Half duplex mode, initialize the UART registers by calling + the HAL_HalfDuplex_Init() API. + + (#) For the UART LIN (Local Interconnection Network) mode, initialize the UART registers + by calling the HAL_LIN_Init() API. + + (#) For the UART Multiprocessor mode, initialize the UART registers + by calling the HAL_MultiProcessor_Init() API. + + (#) For the UART RS485 Driver Enabled mode, initialize the UART registers + by calling the HAL_RS485Ex_Init() API. + + [..] + (@) These API's (HAL_UART_Init(), HAL_HalfDuplex_Init(), HAL_LIN_Init(), HAL_MultiProcessor_Init(), + also configure the low level Hardware GPIO, CLOCK, CORTEX...etc) by + calling the customized HAL_UART_MspInit() API. + + ##### Callback registration ##### + ================================== + + [..] + The compilation define USE_HAL_UART_REGISTER_CALLBACKS when set to 1 + allows the user to configure dynamically the driver callbacks. + + [..] + Use Function HAL_UART_RegisterCallback() to register a user callback. + Function HAL_UART_RegisterCallback() allows to register following callbacks: + (+) TxHalfCpltCallback : Tx Half Complete Callback. + (+) TxCpltCallback : Tx Complete Callback. + (+) RxHalfCpltCallback : Rx Half Complete Callback. + (+) RxCpltCallback : Rx Complete Callback. + (+) ErrorCallback : Error Callback. + (+) AbortCpltCallback : Abort Complete Callback. + (+) AbortTransmitCpltCallback : Abort Transmit Complete Callback. + (+) AbortReceiveCpltCallback : Abort Receive Complete Callback. + (+) WakeupCallback : Wakeup Callback. + (+) MspInitCallback : UART MspInit. + (+) MspDeInitCallback : UART MspDeInit. + This function takes as parameters the HAL peripheral handle, the Callback ID + and a pointer to the user callback function. + + [..] + Use function HAL_UART_UnRegisterCallback() to reset a callback to the default + weak (surcharged) function. + HAL_UART_UnRegisterCallback() takes as parameters the HAL peripheral handle, + and the Callback ID. + This function allows to reset following callbacks: + (+) TxHalfCpltCallback : Tx Half Complete Callback. + (+) TxCpltCallback : Tx Complete Callback. + (+) RxHalfCpltCallback : Rx Half Complete Callback. + (+) RxCpltCallback : Rx Complete Callback. + (+) ErrorCallback : Error Callback. + (+) AbortCpltCallback : Abort Complete Callback. + (+) AbortTransmitCpltCallback : Abort Transmit Complete Callback. + (+) AbortReceiveCpltCallback : Abort Receive Complete Callback. + (+) WakeupCallback : Wakeup Callback. + (+) MspInitCallback : UART MspInit. + (+) MspDeInitCallback : UART MspDeInit. + + [..] + For specific callback RxEventCallback, use dedicated registration/reset functions: + respectively HAL_UART_RegisterRxEventCallback() , HAL_UART_UnRegisterRxEventCallback(). + + [..] + By default, after the HAL_UART_Init() and when the state is HAL_UART_STATE_RESET + all callbacks are set to the corresponding weak (surcharged) functions: + examples HAL_UART_TxCpltCallback(), HAL_UART_RxHalfCpltCallback(). + Exception done for MspInit and MspDeInit functions that are respectively + reset to the legacy weak (surcharged) functions in the HAL_UART_Init() + and HAL_UART_DeInit() only when these callbacks are null (not registered beforehand). + If not, MspInit or MspDeInit are not null, the HAL_UART_Init() and HAL_UART_DeInit() + keep and use the user MspInit/MspDeInit callbacks (registered beforehand). + + [..] + Callbacks can be registered/unregistered in HAL_UART_STATE_READY state only. + Exception done MspInit/MspDeInit that can be registered/unregistered + in HAL_UART_STATE_READY or HAL_UART_STATE_RESET state, thus registered (user) + MspInit/DeInit callbacks can be used during the Init/DeInit. + In that case first register the MspInit/MspDeInit user callbacks + using HAL_UART_RegisterCallback() before calling HAL_UART_DeInit() + or HAL_UART_Init() function. + + [..] + When The compilation define USE_HAL_UART_REGISTER_CALLBACKS is set to 0 or + not defined, the callback registration feature is not available + and weak (surcharged) callbacks are used. + + + @endverbatim + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup UART UART + * @brief HAL UART module driver + * @{ + */ + +#ifdef HAL_UART_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/** @defgroup UART_Private_Constants UART Private Constants + * @{ + */ +#define USART_CR1_FIELDS ((uint32_t)(USART_CR1_M | USART_CR1_PCE | USART_CR1_PS | USART_CR1_TE | USART_CR1_RE | \ + USART_CR1_OVER8)) /*!< UART or USART CR1 fields of parameters set by UART_SetConfig API */ + +#define USART_CR3_FIELDS ((uint32_t)(USART_CR3_RTSE | USART_CR3_CTSE |\ + USART_CR3_ONEBIT)) /*!< UART or USART CR3 fields of parameters set by UART_SetConfig API */ + + +#define UART_BRR_MIN 0x10U /* UART BRR minimum authorized value */ +#define UART_BRR_MAX 0x0000FFFFU /* UART BRR maximum authorized value */ +/** + * @} + */ + +/* Private macros ------------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/** @addtogroup UART_Private_Functions + * @{ + */ +static void UART_EndTxTransfer(UART_HandleTypeDef *huart); +static void UART_EndRxTransfer(UART_HandleTypeDef *huart); +static void UART_DMATransmitCplt(DMA_HandleTypeDef *hdma); +static void UART_DMAReceiveCplt(DMA_HandleTypeDef *hdma); +static void UART_DMARxHalfCplt(DMA_HandleTypeDef *hdma); +static void UART_DMATxHalfCplt(DMA_HandleTypeDef *hdma); +static void UART_DMAError(DMA_HandleTypeDef *hdma); +static void UART_DMAAbortOnError(DMA_HandleTypeDef *hdma); +static void UART_DMATxAbortCallback(DMA_HandleTypeDef *hdma); +static void UART_DMARxAbortCallback(DMA_HandleTypeDef *hdma); +static void UART_DMATxOnlyAbortCallback(DMA_HandleTypeDef *hdma); +static void UART_DMARxOnlyAbortCallback(DMA_HandleTypeDef *hdma); +static void UART_TxISR_8BIT(UART_HandleTypeDef *huart); +static void UART_TxISR_16BIT(UART_HandleTypeDef *huart); +static void UART_EndTransmit_IT(UART_HandleTypeDef *huart); +static void UART_RxISR_8BIT(UART_HandleTypeDef *huart); +static void UART_RxISR_16BIT(UART_HandleTypeDef *huart); +/** + * @} + */ + +/* Private variables ---------------------------------------------------------*/ +/* Exported Constants --------------------------------------------------------*/ +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup UART_Exported_Functions UART Exported Functions + * @{ + */ + +/** @defgroup UART_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Initialization and Configuration functions + * +@verbatim +=============================================================================== + ##### Initialization and Configuration functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to initialize the USARTx or the UARTy + in asynchronous mode. + (+) For the asynchronous mode the parameters below can be configured: + (++) Baud Rate + (++) Word Length + (++) Stop Bit + (++) Parity: If the parity is enabled, then the MSB bit of the data written + in the data register is transmitted but is changed by the parity bit. + (++) Hardware flow control + (++) Receiver/transmitter modes + (++) Over Sampling Method + (++) One-Bit Sampling Method + (+) For the asynchronous mode, the following advanced features can be configured as well: + (++) TX and/or RX pin level inversion + (++) data logical level inversion + (++) RX and TX pins swap + (++) RX overrun detection disabling + (++) DMA disabling on RX error + (++) MSB first on communication line + (++) auto Baud rate detection + [..] + The HAL_UART_Init(), HAL_HalfDuplex_Init(), HAL_LIN_Init()and HAL_MultiProcessor_Init()API + follow respectively the UART asynchronous, UART Half duplex, UART LIN mode + and UART multiprocessor mode configuration procedures (details for the procedures + are available in reference manual). + +@endverbatim + + Depending on the frame length defined by the M1 and M0 bits (7-bit, + 8-bit or 9-bit), the possible UART formats are listed in the + following table. + + Table 1. UART frame format. + +-----------------------------------------------------------------------+ + | M1 bit | M0 bit | PCE bit | UART frame | + |---------|---------|-----------|---------------------------------------| + | 0 | 0 | 0 | | SB | 8 bit data | STB | | + |---------|---------|-----------|---------------------------------------| + | 0 | 0 | 1 | | SB | 7 bit data | PB | STB | | + |---------|---------|-----------|---------------------------------------| + | 0 | 1 | 0 | | SB | 9 bit data | STB | | + |---------|---------|-----------|---------------------------------------| + | 0 | 1 | 1 | | SB | 8 bit data | PB | STB | | + |---------|---------|-----------|---------------------------------------| + | 1 | 0 | 0 | | SB | 7 bit data | STB | | + |---------|---------|-----------|---------------------------------------| + | 1 | 0 | 1 | | SB | 6 bit data | PB | STB | | + +-----------------------------------------------------------------------+ + + * @{ + */ + +/** + * @brief Initialize the UART mode according to the specified + * parameters in the UART_InitTypeDef and initialize the associated handle. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart) +{ + /* Check the UART handle allocation */ + if (huart == NULL) + { + return HAL_ERROR; + } + + if (huart->Init.HwFlowCtl != UART_HWCONTROL_NONE) + { + /* Check the parameters */ + assert_param(IS_UART_HWFLOW_INSTANCE(huart->Instance)); + } + else + { + /* Check the parameters */ + assert_param(IS_UART_INSTANCE(huart->Instance)); + } + + if (huart->gState == HAL_UART_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + UART_InitCallbacksToDefault(huart); + + if (huart->MspInitCallback == NULL) + { + huart->MspInitCallback = HAL_UART_MspInit; + } + + /* Init the low level hardware */ + huart->MspInitCallback(huart); +#else + /* Init the low level hardware : GPIO, CLOCK */ + HAL_UART_MspInit(huart); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + + huart->gState = HAL_UART_STATE_BUSY; + + __HAL_UART_DISABLE(huart); + + /* Set the UART Communication parameters */ + if (UART_SetConfig(huart) == HAL_ERROR) + { + return HAL_ERROR; + } + + if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT) + { + UART_AdvFeatureConfig(huart); + } + + /* In asynchronous mode, the following bits must be kept cleared: + - LINEN and CLKEN bits in the USART_CR2 register, + - SCEN, HDSEL and IREN bits in the USART_CR3 register.*/ + CLEAR_BIT(huart->Instance->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN)); + CLEAR_BIT(huart->Instance->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN)); + + __HAL_UART_ENABLE(huart); + + /* TEACK and/or REACK to check before moving huart->gState and huart->RxState to Ready */ + return (UART_CheckIdleState(huart)); +} + +/** + * @brief Initialize the half-duplex mode according to the specified + * parameters in the UART_InitTypeDef and creates the associated handle. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_HalfDuplex_Init(UART_HandleTypeDef *huart) +{ + /* Check the UART handle allocation */ + if (huart == NULL) + { + return HAL_ERROR; + } + + /* Check UART instance */ + assert_param(IS_UART_HALFDUPLEX_INSTANCE(huart->Instance)); + + if (huart->gState == HAL_UART_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + UART_InitCallbacksToDefault(huart); + + if (huart->MspInitCallback == NULL) + { + huart->MspInitCallback = HAL_UART_MspInit; + } + + /* Init the low level hardware */ + huart->MspInitCallback(huart); +#else + /* Init the low level hardware : GPIO, CLOCK */ + HAL_UART_MspInit(huart); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + + huart->gState = HAL_UART_STATE_BUSY; + + __HAL_UART_DISABLE(huart); + + /* Set the UART Communication parameters */ + if (UART_SetConfig(huart) == HAL_ERROR) + { + return HAL_ERROR; + } + + if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT) + { + UART_AdvFeatureConfig(huart); + } + + /* In half-duplex mode, the following bits must be kept cleared: + - LINEN and CLKEN bits in the USART_CR2 register, + - SCEN and IREN bits in the USART_CR3 register.*/ + CLEAR_BIT(huart->Instance->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN)); + CLEAR_BIT(huart->Instance->CR3, (USART_CR3_IREN | USART_CR3_SCEN)); + + /* Enable the Half-Duplex mode by setting the HDSEL bit in the CR3 register */ + SET_BIT(huart->Instance->CR3, USART_CR3_HDSEL); + + __HAL_UART_ENABLE(huart); + + /* TEACK and/or REACK to check before moving huart->gState and huart->RxState to Ready */ + return (UART_CheckIdleState(huart)); +} + + +/** + * @brief Initialize the LIN mode according to the specified + * parameters in the UART_InitTypeDef and creates the associated handle. + * @param huart UART handle. + * @param BreakDetectLength Specifies the LIN break detection length. + * This parameter can be one of the following values: + * @arg @ref UART_LINBREAKDETECTLENGTH_10B 10-bit break detection + * @arg @ref UART_LINBREAKDETECTLENGTH_11B 11-bit break detection + * @retval HAL status + */ +HAL_StatusTypeDef HAL_LIN_Init(UART_HandleTypeDef *huart, uint32_t BreakDetectLength) +{ + /* Check the UART handle allocation */ + if (huart == NULL) + { + return HAL_ERROR; + } + + /* Check the LIN UART instance */ + assert_param(IS_UART_LIN_INSTANCE(huart->Instance)); + /* Check the Break detection length parameter */ + assert_param(IS_UART_LIN_BREAK_DETECT_LENGTH(BreakDetectLength)); + + /* LIN mode limited to 16-bit oversampling only */ + if (huart->Init.OverSampling == UART_OVERSAMPLING_8) + { + return HAL_ERROR; + } + /* LIN mode limited to 8-bit data length */ + if (huart->Init.WordLength != UART_WORDLENGTH_8B) + { + return HAL_ERROR; + } + + if (huart->gState == HAL_UART_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + UART_InitCallbacksToDefault(huart); + + if (huart->MspInitCallback == NULL) + { + huart->MspInitCallback = HAL_UART_MspInit; + } + + /* Init the low level hardware */ + huart->MspInitCallback(huart); +#else + /* Init the low level hardware : GPIO, CLOCK */ + HAL_UART_MspInit(huart); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + + huart->gState = HAL_UART_STATE_BUSY; + + __HAL_UART_DISABLE(huart); + + /* Set the UART Communication parameters */ + if (UART_SetConfig(huart) == HAL_ERROR) + { + return HAL_ERROR; + } + + if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT) + { + UART_AdvFeatureConfig(huart); + } + + /* In LIN mode, the following bits must be kept cleared: + - LINEN and CLKEN bits in the USART_CR2 register, + - SCEN and IREN bits in the USART_CR3 register.*/ + CLEAR_BIT(huart->Instance->CR2, USART_CR2_CLKEN); + CLEAR_BIT(huart->Instance->CR3, (USART_CR3_HDSEL | USART_CR3_IREN | USART_CR3_SCEN)); + + /* Enable the LIN mode by setting the LINEN bit in the CR2 register */ + SET_BIT(huart->Instance->CR2, USART_CR2_LINEN); + + /* Set the USART LIN Break detection length. */ + MODIFY_REG(huart->Instance->CR2, USART_CR2_LBDL, BreakDetectLength); + + __HAL_UART_ENABLE(huart); + + /* TEACK and/or REACK to check before moving huart->gState and huart->RxState to Ready */ + return (UART_CheckIdleState(huart)); +} + + +/** + * @brief Initialize the multiprocessor mode according to the specified + * parameters in the UART_InitTypeDef and initialize the associated handle. + * @param huart UART handle. + * @param Address UART node address (4-, 6-, 7- or 8-bit long). + * @param WakeUpMethod Specifies the UART wakeup method. + * This parameter can be one of the following values: + * @arg @ref UART_WAKEUPMETHOD_IDLELINE WakeUp by an idle line detection + * @arg @ref UART_WAKEUPMETHOD_ADDRESSMARK WakeUp by an address mark + * @note If the user resorts to idle line detection wake up, the Address parameter + * is useless and ignored by the initialization function. + * @note If the user resorts to address mark wake up, the address length detection + * is configured by default to 4 bits only. For the UART to be able to + * manage 6-, 7- or 8-bit long addresses detection, the API + * HAL_MultiProcessorEx_AddressLength_Set() must be called after + * HAL_MultiProcessor_Init(). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_MultiProcessor_Init(UART_HandleTypeDef *huart, uint8_t Address, uint32_t WakeUpMethod) +{ + /* Check the UART handle allocation */ + if (huart == NULL) + { + return HAL_ERROR; + } + + /* Check the wake up method parameter */ + assert_param(IS_UART_WAKEUPMETHOD(WakeUpMethod)); + + if (huart->gState == HAL_UART_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + UART_InitCallbacksToDefault(huart); + + if (huart->MspInitCallback == NULL) + { + huart->MspInitCallback = HAL_UART_MspInit; + } + + /* Init the low level hardware */ + huart->MspInitCallback(huart); +#else + /* Init the low level hardware : GPIO, CLOCK */ + HAL_UART_MspInit(huart); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + + huart->gState = HAL_UART_STATE_BUSY; + + __HAL_UART_DISABLE(huart); + + /* Set the UART Communication parameters */ + if (UART_SetConfig(huart) == HAL_ERROR) + { + return HAL_ERROR; + } + + if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT) + { + UART_AdvFeatureConfig(huart); + } + + /* In multiprocessor mode, the following bits must be kept cleared: + - LINEN and CLKEN bits in the USART_CR2 register, + - SCEN, HDSEL and IREN bits in the USART_CR3 register. */ + CLEAR_BIT(huart->Instance->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN)); + CLEAR_BIT(huart->Instance->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN)); + + if (WakeUpMethod == UART_WAKEUPMETHOD_ADDRESSMARK) + { + /* If address mark wake up method is chosen, set the USART address node */ + MODIFY_REG(huart->Instance->CR2, USART_CR2_ADD, ((uint32_t)Address << UART_CR2_ADDRESS_LSB_POS)); + } + + /* Set the wake up method by setting the WAKE bit in the CR1 register */ + MODIFY_REG(huart->Instance->CR1, USART_CR1_WAKE, WakeUpMethod); + + __HAL_UART_ENABLE(huart); + + /* TEACK and/or REACK to check before moving huart->gState and huart->RxState to Ready */ + return (UART_CheckIdleState(huart)); +} + + +/** + * @brief DeInitialize the UART peripheral. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_DeInit(UART_HandleTypeDef *huart) +{ + /* Check the UART handle allocation */ + if (huart == NULL) + { + return HAL_ERROR; + } + + /* Check the parameters */ + assert_param(IS_UART_INSTANCE(huart->Instance)); + + huart->gState = HAL_UART_STATE_BUSY; + + __HAL_UART_DISABLE(huart); + + huart->Instance->CR1 = 0x0U; + huart->Instance->CR2 = 0x0U; + huart->Instance->CR3 = 0x0U; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + if (huart->MspDeInitCallback == NULL) + { + huart->MspDeInitCallback = HAL_UART_MspDeInit; + } + /* DeInit the low level hardware */ + huart->MspDeInitCallback(huart); +#else + /* DeInit the low level hardware */ + HAL_UART_MspDeInit(huart); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + + huart->ErrorCode = HAL_UART_ERROR_NONE; + huart->gState = HAL_UART_STATE_RESET; + huart->RxState = HAL_UART_STATE_RESET; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + huart->RxEventType = HAL_UART_RXEVENT_TC; + + __HAL_UNLOCK(huart); + + return HAL_OK; +} + +/** + * @brief Initialize the UART MSP. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_MspInit(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UART_MspInit can be implemented in the user file + */ +} + +/** + * @brief DeInitialize the UART MSP. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_MspDeInit(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UART_MspDeInit can be implemented in the user file + */ +} + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) +/** + * @brief Register a User UART Callback + * To be used instead of the weak predefined callback + * @note The HAL_UART_RegisterCallback() may be called before HAL_UART_Init(), HAL_HalfDuplex_Init(), + * HAL_LIN_Init(), HAL_MultiProcessor_Init() or HAL_RS485Ex_Init() in HAL_UART_STATE_RESET to register + * callbacks for HAL_UART_MSPINIT_CB_ID and HAL_UART_MSPDEINIT_CB_ID + * @param huart uart handle + * @param CallbackID ID of the callback to be registered + * This parameter can be one of the following values: + * @arg @ref HAL_UART_TX_HALFCOMPLETE_CB_ID Tx Half Complete Callback ID + * @arg @ref HAL_UART_TX_COMPLETE_CB_ID Tx Complete Callback ID + * @arg @ref HAL_UART_RX_HALFCOMPLETE_CB_ID Rx Half Complete Callback ID + * @arg @ref HAL_UART_RX_COMPLETE_CB_ID Rx Complete Callback ID + * @arg @ref HAL_UART_ERROR_CB_ID Error Callback ID + * @arg @ref HAL_UART_ABORT_COMPLETE_CB_ID Abort Complete Callback ID + * @arg @ref HAL_UART_ABORT_TRANSMIT_COMPLETE_CB_ID Abort Transmit Complete Callback ID + * @arg @ref HAL_UART_ABORT_RECEIVE_COMPLETE_CB_ID Abort Receive Complete Callback ID + * @arg @ref HAL_UART_WAKEUP_CB_ID Wakeup Callback ID + * @arg @ref HAL_UART_MSPINIT_CB_ID MspInit Callback ID + * @arg @ref HAL_UART_MSPDEINIT_CB_ID MspDeInit Callback ID + * @param pCallback pointer to the Callback function + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_RegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID, + pUART_CallbackTypeDef pCallback) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (pCallback == NULL) + { + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + return HAL_ERROR; + } + + if (huart->gState == HAL_UART_STATE_READY) + { + switch (CallbackID) + { + case HAL_UART_TX_HALFCOMPLETE_CB_ID : + huart->TxHalfCpltCallback = pCallback; + break; + + case HAL_UART_TX_COMPLETE_CB_ID : + huart->TxCpltCallback = pCallback; + break; + + case HAL_UART_RX_HALFCOMPLETE_CB_ID : + huart->RxHalfCpltCallback = pCallback; + break; + + case HAL_UART_RX_COMPLETE_CB_ID : + huart->RxCpltCallback = pCallback; + break; + + case HAL_UART_ERROR_CB_ID : + huart->ErrorCallback = pCallback; + break; + + case HAL_UART_ABORT_COMPLETE_CB_ID : + huart->AbortCpltCallback = pCallback; + break; + + case HAL_UART_ABORT_TRANSMIT_COMPLETE_CB_ID : + huart->AbortTransmitCpltCallback = pCallback; + break; + + case HAL_UART_ABORT_RECEIVE_COMPLETE_CB_ID : + huart->AbortReceiveCpltCallback = pCallback; + break; + + case HAL_UART_WAKEUP_CB_ID : + huart->WakeupCallback = pCallback; + break; + + + case HAL_UART_MSPINIT_CB_ID : + huart->MspInitCallback = pCallback; + break; + + case HAL_UART_MSPDEINIT_CB_ID : + huart->MspDeInitCallback = pCallback; + break; + + default : + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + status = HAL_ERROR; + break; + } + } + else if (huart->gState == HAL_UART_STATE_RESET) + { + switch (CallbackID) + { + case HAL_UART_MSPINIT_CB_ID : + huart->MspInitCallback = pCallback; + break; + + case HAL_UART_MSPDEINIT_CB_ID : + huart->MspDeInitCallback = pCallback; + break; + + default : + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + status = HAL_ERROR; + break; + } + } + else + { + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + status = HAL_ERROR; + } + + return status; +} + +/** + * @brief Unregister an UART Callback + * UART callaback is redirected to the weak predefined callback + * @note The HAL_UART_UnRegisterCallback() may be called before HAL_UART_Init(), HAL_HalfDuplex_Init(), + * HAL_LIN_Init(), HAL_MultiProcessor_Init() or HAL_RS485Ex_Init() in HAL_UART_STATE_RESET to un-register + * callbacks for HAL_UART_MSPINIT_CB_ID and HAL_UART_MSPDEINIT_CB_ID + * @param huart uart handle + * @param CallbackID ID of the callback to be unregistered + * This parameter can be one of the following values: + * @arg @ref HAL_UART_TX_HALFCOMPLETE_CB_ID Tx Half Complete Callback ID + * @arg @ref HAL_UART_TX_COMPLETE_CB_ID Tx Complete Callback ID + * @arg @ref HAL_UART_RX_HALFCOMPLETE_CB_ID Rx Half Complete Callback ID + * @arg @ref HAL_UART_RX_COMPLETE_CB_ID Rx Complete Callback ID + * @arg @ref HAL_UART_ERROR_CB_ID Error Callback ID + * @arg @ref HAL_UART_ABORT_COMPLETE_CB_ID Abort Complete Callback ID + * @arg @ref HAL_UART_ABORT_TRANSMIT_COMPLETE_CB_ID Abort Transmit Complete Callback ID + * @arg @ref HAL_UART_ABORT_RECEIVE_COMPLETE_CB_ID Abort Receive Complete Callback ID + * @arg @ref HAL_UART_WAKEUP_CB_ID Wakeup Callback ID + * @arg @ref HAL_UART_MSPINIT_CB_ID MspInit Callback ID + * @arg @ref HAL_UART_MSPDEINIT_CB_ID MspDeInit Callback ID + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_UnRegisterCallback(UART_HandleTypeDef *huart, HAL_UART_CallbackIDTypeDef CallbackID) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (HAL_UART_STATE_READY == huart->gState) + { + switch (CallbackID) + { + case HAL_UART_TX_HALFCOMPLETE_CB_ID : + huart->TxHalfCpltCallback = HAL_UART_TxHalfCpltCallback; /* Legacy weak TxHalfCpltCallback */ + break; + + case HAL_UART_TX_COMPLETE_CB_ID : + huart->TxCpltCallback = HAL_UART_TxCpltCallback; /* Legacy weak TxCpltCallback */ + break; + + case HAL_UART_RX_HALFCOMPLETE_CB_ID : + huart->RxHalfCpltCallback = HAL_UART_RxHalfCpltCallback; /* Legacy weak RxHalfCpltCallback */ + break; + + case HAL_UART_RX_COMPLETE_CB_ID : + huart->RxCpltCallback = HAL_UART_RxCpltCallback; /* Legacy weak RxCpltCallback */ + break; + + case HAL_UART_ERROR_CB_ID : + huart->ErrorCallback = HAL_UART_ErrorCallback; /* Legacy weak ErrorCallback */ + break; + + case HAL_UART_ABORT_COMPLETE_CB_ID : + huart->AbortCpltCallback = HAL_UART_AbortCpltCallback; /* Legacy weak AbortCpltCallback */ + break; + + case HAL_UART_ABORT_TRANSMIT_COMPLETE_CB_ID : + huart->AbortTransmitCpltCallback = HAL_UART_AbortTransmitCpltCallback; /* Legacy weak + AbortTransmitCpltCallback */ + break; + + case HAL_UART_ABORT_RECEIVE_COMPLETE_CB_ID : + huart->AbortReceiveCpltCallback = HAL_UART_AbortReceiveCpltCallback; /* Legacy weak + AbortReceiveCpltCallback */ + break; + + case HAL_UART_WAKEUP_CB_ID : + huart->WakeupCallback = HAL_UARTEx_WakeupCallback; /* Legacy weak WakeupCallback */ + break; + + case HAL_UART_MSPINIT_CB_ID : + huart->MspInitCallback = HAL_UART_MspInit; /* Legacy weak MspInitCallback */ + break; + + case HAL_UART_MSPDEINIT_CB_ID : + huart->MspDeInitCallback = HAL_UART_MspDeInit; /* Legacy weak MspDeInitCallback */ + break; + + default : + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + status = HAL_ERROR; + break; + } + } + else if (HAL_UART_STATE_RESET == huart->gState) + { + switch (CallbackID) + { + case HAL_UART_MSPINIT_CB_ID : + huart->MspInitCallback = HAL_UART_MspInit; + break; + + case HAL_UART_MSPDEINIT_CB_ID : + huart->MspDeInitCallback = HAL_UART_MspDeInit; + break; + + default : + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + status = HAL_ERROR; + break; + } + } + else + { + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + status = HAL_ERROR; + } + + return status; +} + +/** + * @brief Register a User UART Rx Event Callback + * To be used instead of the weak predefined callback + * @param huart Uart handle + * @param pCallback Pointer to the Rx Event Callback function + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_RegisterRxEventCallback(UART_HandleTypeDef *huart, pUART_RxEventCallbackTypeDef pCallback) +{ + HAL_StatusTypeDef status = HAL_OK; + + if (pCallback == NULL) + { + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + return HAL_ERROR; + } + + /* Process locked */ + __HAL_LOCK(huart); + + if (huart->gState == HAL_UART_STATE_READY) + { + huart->RxEventCallback = pCallback; + } + else + { + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + status = HAL_ERROR; + } + + /* Release Lock */ + __HAL_UNLOCK(huart); + + return status; +} + +/** + * @brief UnRegister the UART Rx Event Callback + * UART Rx Event Callback is redirected to the weak HAL_UARTEx_RxEventCallback() predefined callback + * @param huart Uart handle + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_UnRegisterRxEventCallback(UART_HandleTypeDef *huart) +{ + HAL_StatusTypeDef status = HAL_OK; + + /* Process locked */ + __HAL_LOCK(huart); + + if (huart->gState == HAL_UART_STATE_READY) + { + huart->RxEventCallback = HAL_UARTEx_RxEventCallback; /* Legacy weak UART Rx Event Callback */ + } + else + { + huart->ErrorCode |= HAL_UART_ERROR_INVALID_CALLBACK; + + status = HAL_ERROR; + } + + /* Release Lock */ + __HAL_UNLOCK(huart); + return status; +} + +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + +/** + * @} + */ + +/** @defgroup UART_Exported_Functions_Group2 IO operation functions + * @brief UART Transmit/Receive functions + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + This subsection provides a set of functions allowing to manage the UART asynchronous + and Half duplex data transfers. + + (#) There are two mode of transfer: + (+) Blocking mode: The communication is performed in polling mode. + The HAL status of all data processing is returned by the same function + after finishing transfer. + (+) Non-Blocking mode: The communication is performed using Interrupts + or DMA, These API's return the HAL status. + The end of the data processing will be indicated through the + dedicated UART IRQ when using Interrupt mode or the DMA IRQ when + using DMA mode. + The HAL_UART_TxCpltCallback(), HAL_UART_RxCpltCallback() user callbacks + will be executed respectively at the end of the transmit or Receive process + The HAL_UART_ErrorCallback()user callback will be executed when a communication error is detected + + (#) Blocking mode API's are : + (+) HAL_UART_Transmit() + (+) HAL_UART_Receive() + + (#) Non-Blocking mode API's with Interrupt are : + (+) HAL_UART_Transmit_IT() + (+) HAL_UART_Receive_IT() + (+) HAL_UART_IRQHandler() + + (#) Non-Blocking mode API's with DMA are : + (+) HAL_UART_Transmit_DMA() + (+) HAL_UART_Receive_DMA() + (+) HAL_UART_DMAPause() + (+) HAL_UART_DMAResume() + (+) HAL_UART_DMAStop() + + (#) A set of Transfer Complete Callbacks are provided in Non_Blocking mode: + (+) HAL_UART_TxHalfCpltCallback() + (+) HAL_UART_TxCpltCallback() + (+) HAL_UART_RxHalfCpltCallback() + (+) HAL_UART_RxCpltCallback() + (+) HAL_UART_ErrorCallback() + + (#) Non-Blocking mode transfers could be aborted using Abort API's : + (+) HAL_UART_Abort() + (+) HAL_UART_AbortTransmit() + (+) HAL_UART_AbortReceive() + (+) HAL_UART_Abort_IT() + (+) HAL_UART_AbortTransmit_IT() + (+) HAL_UART_AbortReceive_IT() + + (#) For Abort services based on interrupts (HAL_UART_Abortxxx_IT), a set of Abort Complete Callbacks are provided: + (+) HAL_UART_AbortCpltCallback() + (+) HAL_UART_AbortTransmitCpltCallback() + (+) HAL_UART_AbortReceiveCpltCallback() + + (#) A Rx Event Reception Callback (Rx event notification) is available for Non_Blocking modes of enhanced + reception services: + (+) HAL_UARTEx_RxEventCallback() + + (#) In Non-Blocking mode transfers, possible errors are split into 2 categories. + Errors are handled as follows : + (+) Error is considered as Recoverable and non blocking : Transfer could go till end, but error severity is + to be evaluated by user : this concerns Frame Error, Parity Error or Noise Error + in Interrupt mode reception . + Received character is then retrieved and stored in Rx buffer, Error code is set to allow user + to identify error type, and HAL_UART_ErrorCallback() user callback is executed. + Transfer is kept ongoing on UART side. + If user wants to abort it, Abort services should be called by user. + (+) Error is considered as Blocking : Transfer could not be completed properly and is aborted. + This concerns Overrun Error In Interrupt mode reception and all errors in DMA mode. + Error code is set to allow user to identify error type, and HAL_UART_ErrorCallback() + user callback is executed. + + -@- In the Half duplex communication, it is forbidden to run the transmit + and receive process in parallel, the UART state HAL_UART_STATE_BUSY_TX_RX can't be useful. + +@endverbatim + * @{ + */ + +/** + * @brief Send an amount of data in blocking mode. + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the sent data is handled as a set of u16. In this case, Size must indicate the number + * of u16 provided through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (u8 or u16 data elements). + * @param Size Amount of data elements (u8 or u16) to be sent. + * @param Timeout Timeout duration. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + const uint8_t *pdata8bits; + const uint16_t *pdata16bits; + uint32_t tickstart; + + /* Check that a Tx process is not already ongoing */ + if (huart->gState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + huart->ErrorCode = HAL_UART_ERROR_NONE; + huart->gState = HAL_UART_STATE_BUSY_TX; + + /* Init tickstart for timeout management */ + tickstart = HAL_GetTick(); + + huart->TxXferSize = Size; + huart->TxXferCount = Size; + + /* In case of 9bits/No Parity transfer, pData needs to be handled as a uint16_t pointer */ + if ((huart->Init.WordLength == UART_WORDLENGTH_9B) && (huart->Init.Parity == UART_PARITY_NONE)) + { + pdata8bits = NULL; + pdata16bits = (const uint16_t *) pData; + } + else + { + pdata8bits = pData; + pdata16bits = NULL; + } + + while (huart->TxXferCount > 0U) + { + if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TXE, RESET, tickstart, Timeout) != HAL_OK) + { + + huart->gState = HAL_UART_STATE_READY; + + return HAL_TIMEOUT; + } + if (pdata8bits == NULL) + { + huart->Instance->TDR = (uint16_t)(*pdata16bits & 0x01FFU); + pdata16bits++; + } + else + { + huart->Instance->TDR = (uint8_t)(*pdata8bits & 0xFFU); + pdata8bits++; + } + huart->TxXferCount--; + } + + if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_TC, RESET, tickstart, Timeout) != HAL_OK) + { + huart->gState = HAL_UART_STATE_READY; + + return HAL_TIMEOUT; + } + + /* At end of Tx process, restore huart->gState to Ready */ + huart->gState = HAL_UART_STATE_READY; + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive an amount of data in blocking mode. + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the received data is handled as a set of u16. In this case, Size must indicate the number + * of u16 available through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (u8 or u16 data elements). + * @param Size Amount of data elements (u8 or u16) to be received. + * @param Timeout Timeout duration. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout) +{ + uint8_t *pdata8bits; + uint16_t *pdata16bits; + uint16_t uhMask; + uint32_t tickstart; + + /* Check that a Rx process is not already ongoing */ + if (huart->RxState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + huart->ErrorCode = HAL_UART_ERROR_NONE; + huart->RxState = HAL_UART_STATE_BUSY_RX; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Init tickstart for timeout management */ + tickstart = HAL_GetTick(); + + huart->RxXferSize = Size; + huart->RxXferCount = Size; + + /* Computation of UART mask to apply to RDR register */ + UART_MASK_COMPUTATION(huart); + uhMask = huart->Mask; + + /* In case of 9bits/No Parity transfer, pRxData needs to be handled as a uint16_t pointer */ + if ((huart->Init.WordLength == UART_WORDLENGTH_9B) && (huart->Init.Parity == UART_PARITY_NONE)) + { + pdata8bits = NULL; + pdata16bits = (uint16_t *) pData; + } + else + { + pdata8bits = pData; + pdata16bits = NULL; + } + + /* as long as data have to be received */ + while (huart->RxXferCount > 0U) + { + if (UART_WaitOnFlagUntilTimeout(huart, UART_FLAG_RXNE, RESET, tickstart, Timeout) != HAL_OK) + { + huart->RxState = HAL_UART_STATE_READY; + + return HAL_TIMEOUT; + } + if (pdata8bits == NULL) + { + *pdata16bits = (uint16_t)(huart->Instance->RDR & uhMask); + pdata16bits++; + } + else + { + *pdata8bits = (uint8_t)(huart->Instance->RDR & (uint8_t)uhMask); + pdata8bits++; + } + huart->RxXferCount--; + } + + /* At end of Rx process, restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Send an amount of data in interrupt mode. + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the sent data is handled as a set of u16. In this case, Size must indicate the number + * of u16 provided through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (u8 or u16 data elements). + * @param Size Amount of data elements (u8 or u16) to be sent. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size) +{ + /* Check that a Tx process is not already ongoing */ + if (huart->gState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + huart->pTxBuffPtr = pData; + huart->TxXferSize = Size; + huart->TxXferCount = Size; + huart->TxISR = NULL; + + huart->ErrorCode = HAL_UART_ERROR_NONE; + huart->gState = HAL_UART_STATE_BUSY_TX; + + /* Set the Tx ISR function pointer according to the data word length */ + if ((huart->Init.WordLength == UART_WORDLENGTH_9B) && (huart->Init.Parity == UART_PARITY_NONE)) + { + huart->TxISR = UART_TxISR_16BIT; + } + else + { + huart->TxISR = UART_TxISR_8BIT; + } + + /* Enable the Transmit Data Register Empty interrupt */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_TXEIE); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive an amount of data in interrupt mode. + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the received data is handled as a set of u16. In this case, Size must indicate the number + * of u16 available through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (u8 or u16 data elements). + * @param Size Amount of data elements (u8 or u16) to be received. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) +{ + /* Check that a Rx process is not already ongoing */ + if (huart->RxState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + /* Set Reception type to Standard reception */ + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Check that USART RTOEN bit is set */ + if (READ_BIT(huart->Instance->CR2, USART_CR2_RTOEN) != 0U) + { + /* Enable the UART Receiver Timeout Interrupt */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_RTOIE); + } + + return (UART_Start_Receive_IT(huart, pData, Size)); + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Send an amount of data in DMA mode. + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the sent data is handled as a set of u16. In this case, Size must indicate the number + * of u16 provided through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (u8 or u16 data elements). + * @param Size Amount of data elements (u8 or u16) to be sent. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Transmit_DMA(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size) +{ + /* Check that a Tx process is not already ongoing */ + if (huart->gState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + huart->pTxBuffPtr = pData; + huart->TxXferSize = Size; + huart->TxXferCount = Size; + + huart->ErrorCode = HAL_UART_ERROR_NONE; + huart->gState = HAL_UART_STATE_BUSY_TX; + + if (huart->hdmatx != NULL) + { + /* Set the UART DMA transfer complete callback */ + huart->hdmatx->XferCpltCallback = UART_DMATransmitCplt; + + /* Set the UART DMA Half transfer complete callback */ + huart->hdmatx->XferHalfCpltCallback = UART_DMATxHalfCplt; + + /* Set the DMA error callback */ + huart->hdmatx->XferErrorCallback = UART_DMAError; + + /* Set the DMA abort callback */ + huart->hdmatx->XferAbortCallback = NULL; + + /* Enable the UART transmit DMA channel */ + if (HAL_DMA_Start_IT(huart->hdmatx, (uint32_t)huart->pTxBuffPtr, (uint32_t)&huart->Instance->TDR, Size) != HAL_OK) + { + /* Set error code to DMA */ + huart->ErrorCode = HAL_UART_ERROR_DMA; + + /* Restore huart->gState to ready */ + huart->gState = HAL_UART_STATE_READY; + + return HAL_ERROR; + } + } + /* Clear the TC flag in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_TCF); + + /* Enable the DMA transfer for transmit request by setting the DMAT bit + in the UART CR3 register */ + ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_DMAT); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive an amount of data in DMA mode. + * @note When the UART parity is enabled (PCE = 1), the received data contain + * the parity bit (MSB position). + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the received data is handled as a set of u16. In this case, Size must indicate the number + * of u16 available through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (u8 or u16 data elements). + * @param Size Amount of data elements (u8 or u16) to be received. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) +{ + /* Check that a Rx process is not already ongoing */ + if (huart->RxState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + /* Set Reception type to Standard reception */ + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Check that USART RTOEN bit is set */ + if (READ_BIT(huart->Instance->CR2, USART_CR2_RTOEN) != 0U) + { + /* Enable the UART Receiver Timeout Interrupt */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_RTOIE); + } + + return (UART_Start_Receive_DMA(huart, pData, Size)); + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Pause the DMA Transfer. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_DMAPause(UART_HandleTypeDef *huart) +{ + const HAL_UART_StateTypeDef gstate = huart->gState; + const HAL_UART_StateTypeDef rxstate = huart->RxState; + + if ((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAT)) && + (gstate == HAL_UART_STATE_BUSY_TX)) + { + /* Disable the UART DMA Tx request */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAT); + } + if ((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) && + (rxstate == HAL_UART_STATE_BUSY_RX)) + { + /* Disable PE and ERR (Frame error, noise error, overrun error) interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_PEIE); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Disable the UART DMA Rx request */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + } + + return HAL_OK; +} + +/** + * @brief Resume the DMA Transfer. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_DMAResume(UART_HandleTypeDef *huart) +{ + if (huart->gState == HAL_UART_STATE_BUSY_TX) + { + /* Enable the UART DMA Tx request */ + ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_DMAT); + } + if (huart->RxState == HAL_UART_STATE_BUSY_RX) + { + /* Clear the Overrun flag before resuming the Rx transfer */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF); + + /* Re-enable PE and ERR (Frame error, noise error, overrun error) interrupts */ + if (huart->Init.Parity != UART_PARITY_NONE) + { + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_PEIE); + } + ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Enable the UART DMA Rx request */ + ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_DMAR); + } + + return HAL_OK; +} + +/** + * @brief Stop the DMA Transfer. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_DMAStop(UART_HandleTypeDef *huart) +{ + /* The Lock is not implemented on this API to allow the user application + to call the HAL UART API under callbacks HAL_UART_TxCpltCallback() / HAL_UART_RxCpltCallback() / + HAL_UART_TxHalfCpltCallback / HAL_UART_RxHalfCpltCallback: + indeed, when HAL_DMA_Abort() API is called, the DMA TX/RX Transfer or Half Transfer complete + interrupt is generated if the DMA transfer interruption occurs at the middle or at the end of + the stream and the corresponding call back is executed. */ + + const HAL_UART_StateTypeDef gstate = huart->gState; + const HAL_UART_StateTypeDef rxstate = huart->RxState; + + /* Stop UART DMA Tx request if ongoing */ + if ((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAT)) && + (gstate == HAL_UART_STATE_BUSY_TX)) + { + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAT); + + /* Abort the UART DMA Tx channel */ + if (huart->hdmatx != NULL) + { + if (HAL_DMA_Abort(huart->hdmatx) != HAL_OK) + { + if (HAL_DMA_GetError(huart->hdmatx) == HAL_DMA_ERROR_TIMEOUT) + { + /* Set error code to DMA */ + huart->ErrorCode = HAL_UART_ERROR_DMA; + + return HAL_TIMEOUT; + } + } + } + + UART_EndTxTransfer(huart); + } + + /* Stop UART DMA Rx request if ongoing */ + if ((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) && + (rxstate == HAL_UART_STATE_BUSY_RX)) + { + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + /* Abort the UART DMA Rx channel */ + if (huart->hdmarx != NULL) + { + if (HAL_DMA_Abort(huart->hdmarx) != HAL_OK) + { + if (HAL_DMA_GetError(huart->hdmarx) == HAL_DMA_ERROR_TIMEOUT) + { + /* Set error code to DMA */ + huart->ErrorCode = HAL_UART_ERROR_DMA; + + return HAL_TIMEOUT; + } + } + } + + UART_EndRxTransfer(huart); + } + + return HAL_OK; +} + +/** + * @brief Abort ongoing transfers (blocking mode). + * @param huart UART handle. + * @note This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. + * This procedure performs following operations : + * - Disable UART Interrupts (Tx and Rx) + * - Disable the DMA transfer in the peripheral register (if enabled) + * - Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode) + * - Set handle State to READY + * @note This procedure is executed in blocking mode : when exiting function, Abort is considered as completed. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Abort(UART_HandleTypeDef *huart) +{ + /* Disable TXEIE, TCIE, RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE | USART_CR1_TCIE)); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* If Reception till IDLE event was ongoing, disable IDLEIE interrupt */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_IDLEIE)); + } + + /* Abort the UART DMA Tx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAT)) + { + /* Disable the UART DMA Tx request if enabled */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAT); + + /* Abort the UART DMA Tx channel : use blocking DMA Abort API (no callback) */ + if (huart->hdmatx != NULL) + { + /* Set the UART DMA Abort callback to Null. + No call back execution at end of DMA abort procedure */ + huart->hdmatx->XferAbortCallback = NULL; + + if (HAL_DMA_Abort(huart->hdmatx) != HAL_OK) + { + if (HAL_DMA_GetError(huart->hdmatx) == HAL_DMA_ERROR_TIMEOUT) + { + /* Set error code to DMA */ + huart->ErrorCode = HAL_UART_ERROR_DMA; + + return HAL_TIMEOUT; + } + } + } + } + + /* Abort the UART DMA Rx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) + { + /* Disable the UART DMA Rx request if enabled */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + /* Abort the UART DMA Rx channel : use blocking DMA Abort API (no callback) */ + if (huart->hdmarx != NULL) + { + /* Set the UART DMA Abort callback to Null. + No call back execution at end of DMA abort procedure */ + huart->hdmarx->XferAbortCallback = NULL; + + if (HAL_DMA_Abort(huart->hdmarx) != HAL_OK) + { + if (HAL_DMA_GetError(huart->hdmarx) == HAL_DMA_ERROR_TIMEOUT) + { + /* Set error code to DMA */ + huart->ErrorCode = HAL_UART_ERROR_DMA; + + return HAL_TIMEOUT; + } + } + } + } + + /* Reset Tx and Rx transfer counters */ + huart->TxXferCount = 0U; + huart->RxXferCount = 0U; + + /* Clear the Error flags in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF | UART_CLEAR_NEF | UART_CLEAR_PEF | UART_CLEAR_FEF); + + + /* Discard the received data */ + __HAL_UART_SEND_REQ(huart, UART_RXDATA_FLUSH_REQUEST); + + /* Restore huart->gState and huart->RxState to Ready */ + huart->gState = HAL_UART_STATE_READY; + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + huart->ErrorCode = HAL_UART_ERROR_NONE; + + return HAL_OK; +} + +/** + * @brief Abort ongoing Transmit transfer (blocking mode). + * @param huart UART handle. + * @note This procedure could be used for aborting any ongoing Tx transfer started in Interrupt or DMA mode. + * This procedure performs following operations : + * - Disable UART Interrupts (Tx) + * - Disable the DMA transfer in the peripheral register (if enabled) + * - Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode) + * - Set handle State to READY + * @note This procedure is executed in blocking mode : when exiting function, Abort is considered as completed. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_AbortTransmit(UART_HandleTypeDef *huart) +{ + /* Disable TXEIE and TCIE interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_TXEIE | USART_CR1_TCIE)); + + /* Abort the UART DMA Tx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAT)) + { + /* Disable the UART DMA Tx request if enabled */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAT); + + /* Abort the UART DMA Tx channel : use blocking DMA Abort API (no callback) */ + if (huart->hdmatx != NULL) + { + /* Set the UART DMA Abort callback to Null. + No call back execution at end of DMA abort procedure */ + huart->hdmatx->XferAbortCallback = NULL; + + if (HAL_DMA_Abort(huart->hdmatx) != HAL_OK) + { + if (HAL_DMA_GetError(huart->hdmatx) == HAL_DMA_ERROR_TIMEOUT) + { + /* Set error code to DMA */ + huart->ErrorCode = HAL_UART_ERROR_DMA; + + return HAL_TIMEOUT; + } + } + } + } + + /* Reset Tx transfer counter */ + huart->TxXferCount = 0U; + + + /* Restore huart->gState to Ready */ + huart->gState = HAL_UART_STATE_READY; + + return HAL_OK; +} + +/** + * @brief Abort ongoing Receive transfer (blocking mode). + * @param huart UART handle. + * @note This procedure could be used for aborting any ongoing Rx transfer started in Interrupt or DMA mode. + * This procedure performs following operations : + * - Disable UART Interrupts (Rx) + * - Disable the DMA transfer in the peripheral register (if enabled) + * - Abort DMA transfer by calling HAL_DMA_Abort (in case of transfer in DMA mode) + * - Set handle State to READY + * @note This procedure is executed in blocking mode : when exiting function, Abort is considered as completed. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_AbortReceive(UART_HandleTypeDef *huart) +{ + /* Disable RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE)); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* If Reception till IDLE event was ongoing, disable IDLEIE interrupt */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_IDLEIE)); + } + + /* Abort the UART DMA Rx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) + { + /* Disable the UART DMA Rx request if enabled */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + /* Abort the UART DMA Rx channel : use blocking DMA Abort API (no callback) */ + if (huart->hdmarx != NULL) + { + /* Set the UART DMA Abort callback to Null. + No call back execution at end of DMA abort procedure */ + huart->hdmarx->XferAbortCallback = NULL; + + if (HAL_DMA_Abort(huart->hdmarx) != HAL_OK) + { + if (HAL_DMA_GetError(huart->hdmarx) == HAL_DMA_ERROR_TIMEOUT) + { + /* Set error code to DMA */ + huart->ErrorCode = HAL_UART_ERROR_DMA; + + return HAL_TIMEOUT; + } + } + } + } + + /* Reset Rx transfer counter */ + huart->RxXferCount = 0U; + + /* Clear the Error flags in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF | UART_CLEAR_NEF | UART_CLEAR_PEF | UART_CLEAR_FEF); + + /* Discard the received data */ + __HAL_UART_SEND_REQ(huart, UART_RXDATA_FLUSH_REQUEST); + + /* Restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + return HAL_OK; +} + +/** + * @brief Abort ongoing transfers (Interrupt mode). + * @param huart UART handle. + * @note This procedure could be used for aborting any ongoing transfer started in Interrupt or DMA mode. + * This procedure performs following operations : + * - Disable UART Interrupts (Tx and Rx) + * - Disable the DMA transfer in the peripheral register (if enabled) + * - Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode) + * - Set handle State to READY + * - At abort completion, call user abort complete callback + * @note This procedure is executed in Interrupt mode, meaning that abort procedure could be + * considered as completed only when user abort complete callback is executed (not when exiting function). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_Abort_IT(UART_HandleTypeDef *huart) +{ + uint32_t abortcplt = 1U; + + /* Disable interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_TXEIE | USART_CR1_TCIE)); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* If Reception till IDLE event was ongoing, disable IDLEIE interrupt */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_IDLEIE)); + } + + /* If DMA Tx and/or DMA Rx Handles are associated to UART Handle, DMA Abort complete callbacks should be initialised + before any call to DMA Abort functions */ + /* DMA Tx Handle is valid */ + if (huart->hdmatx != NULL) + { + /* Set DMA Abort Complete callback if UART DMA Tx request if enabled. + Otherwise, set it to NULL */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAT)) + { + huart->hdmatx->XferAbortCallback = UART_DMATxAbortCallback; + } + else + { + huart->hdmatx->XferAbortCallback = NULL; + } + } + /* DMA Rx Handle is valid */ + if (huart->hdmarx != NULL) + { + /* Set DMA Abort Complete callback if UART DMA Rx request if enabled. + Otherwise, set it to NULL */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) + { + huart->hdmarx->XferAbortCallback = UART_DMARxAbortCallback; + } + else + { + huart->hdmarx->XferAbortCallback = NULL; + } + } + + /* Abort the UART DMA Tx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAT)) + { + /* Disable DMA Tx at UART level */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAT); + + /* Abort the UART DMA Tx channel : use non blocking DMA Abort API (callback) */ + if (huart->hdmatx != NULL) + { + /* UART Tx DMA Abort callback has already been initialised : + will lead to call HAL_UART_AbortCpltCallback() at end of DMA abort procedure */ + + /* Abort DMA TX */ + if (HAL_DMA_Abort_IT(huart->hdmatx) != HAL_OK) + { + huart->hdmatx->XferAbortCallback = NULL; + } + else + { + abortcplt = 0U; + } + } + } + + /* Abort the UART DMA Rx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) + { + /* Disable the UART DMA Rx request if enabled */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + /* Abort the UART DMA Rx channel : use non blocking DMA Abort API (callback) */ + if (huart->hdmarx != NULL) + { + /* UART Rx DMA Abort callback has already been initialised : + will lead to call HAL_UART_AbortCpltCallback() at end of DMA abort procedure */ + + /* Abort DMA RX */ + if (HAL_DMA_Abort_IT(huart->hdmarx) != HAL_OK) + { + huart->hdmarx->XferAbortCallback = NULL; + abortcplt = 1U; + } + else + { + abortcplt = 0U; + } + } + } + + /* if no DMA abort complete callback execution is required => call user Abort Complete callback */ + if (abortcplt == 1U) + { + /* Reset Tx and Rx transfer counters */ + huart->TxXferCount = 0U; + huart->RxXferCount = 0U; + + /* Clear ISR function pointers */ + huart->RxISR = NULL; + huart->TxISR = NULL; + + /* Reset errorCode */ + huart->ErrorCode = HAL_UART_ERROR_NONE; + + /* Clear the Error flags in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF | UART_CLEAR_NEF | UART_CLEAR_PEF | UART_CLEAR_FEF); + + + /* Discard the received data */ + __HAL_UART_SEND_REQ(huart, UART_RXDATA_FLUSH_REQUEST); + + /* Restore huart->gState and huart->RxState to Ready */ + huart->gState = HAL_UART_STATE_READY; + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* As no DMA to be aborted, call directly user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort complete callback */ + huart->AbortCpltCallback(huart); +#else + /* Call legacy weak Abort complete callback */ + HAL_UART_AbortCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + + return HAL_OK; +} + +/** + * @brief Abort ongoing Transmit transfer (Interrupt mode). + * @param huart UART handle. + * @note This procedure could be used for aborting any ongoing Tx transfer started in Interrupt or DMA mode. + * This procedure performs following operations : + * - Disable UART Interrupts (Tx) + * - Disable the DMA transfer in the peripheral register (if enabled) + * - Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode) + * - Set handle State to READY + * - At abort completion, call user abort complete callback + * @note This procedure is executed in Interrupt mode, meaning that abort procedure could be + * considered as completed only when user abort complete callback is executed (not when exiting function). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_AbortTransmit_IT(UART_HandleTypeDef *huart) +{ + /* Disable interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_TXEIE | USART_CR1_TCIE)); + + /* Abort the UART DMA Tx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAT)) + { + /* Disable the UART DMA Tx request if enabled */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAT); + + /* Abort the UART DMA Tx channel : use non blocking DMA Abort API (callback) */ + if (huart->hdmatx != NULL) + { + /* Set the UART DMA Abort callback : + will lead to call HAL_UART_AbortCpltCallback() at end of DMA abort procedure */ + huart->hdmatx->XferAbortCallback = UART_DMATxOnlyAbortCallback; + + /* Abort DMA TX */ + if (HAL_DMA_Abort_IT(huart->hdmatx) != HAL_OK) + { + /* Call Directly huart->hdmatx->XferAbortCallback function in case of error */ + huart->hdmatx->XferAbortCallback(huart->hdmatx); + } + } + else + { + /* Reset Tx transfer counter */ + huart->TxXferCount = 0U; + + /* Clear TxISR function pointers */ + huart->TxISR = NULL; + + /* Restore huart->gState to Ready */ + huart->gState = HAL_UART_STATE_READY; + + /* As no DMA to be aborted, call directly user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort Transmit Complete Callback */ + huart->AbortTransmitCpltCallback(huart); +#else + /* Call legacy weak Abort Transmit Complete Callback */ + HAL_UART_AbortTransmitCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + } + else + { + /* Reset Tx transfer counter */ + huart->TxXferCount = 0U; + + /* Clear TxISR function pointers */ + huart->TxISR = NULL; + + + /* Restore huart->gState to Ready */ + huart->gState = HAL_UART_STATE_READY; + + /* As no DMA to be aborted, call directly user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort Transmit Complete Callback */ + huart->AbortTransmitCpltCallback(huart); +#else + /* Call legacy weak Abort Transmit Complete Callback */ + HAL_UART_AbortTransmitCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + + return HAL_OK; +} + +/** + * @brief Abort ongoing Receive transfer (Interrupt mode). + * @param huart UART handle. + * @note This procedure could be used for aborting any ongoing Rx transfer started in Interrupt or DMA mode. + * This procedure performs following operations : + * - Disable UART Interrupts (Rx) + * - Disable the DMA transfer in the peripheral register (if enabled) + * - Abort DMA transfer by calling HAL_DMA_Abort_IT (in case of transfer in DMA mode) + * - Set handle State to READY + * - At abort completion, call user abort complete callback + * @note This procedure is executed in Interrupt mode, meaning that abort procedure could be + * considered as completed only when user abort complete callback is executed (not when exiting function). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_AbortReceive_IT(UART_HandleTypeDef *huart) +{ + /* Disable RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE)); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* If Reception till IDLE event was ongoing, disable IDLEIE interrupt */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_IDLEIE)); + } + + /* Abort the UART DMA Rx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) + { + /* Disable the UART DMA Rx request if enabled */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + /* Abort the UART DMA Rx channel : use non blocking DMA Abort API (callback) */ + if (huart->hdmarx != NULL) + { + /* Set the UART DMA Abort callback : + will lead to call HAL_UART_AbortCpltCallback() at end of DMA abort procedure */ + huart->hdmarx->XferAbortCallback = UART_DMARxOnlyAbortCallback; + + /* Abort DMA RX */ + if (HAL_DMA_Abort_IT(huart->hdmarx) != HAL_OK) + { + /* Call Directly huart->hdmarx->XferAbortCallback function in case of error */ + huart->hdmarx->XferAbortCallback(huart->hdmarx); + } + } + else + { + /* Reset Rx transfer counter */ + huart->RxXferCount = 0U; + + /* Clear RxISR function pointer */ + huart->pRxBuffPtr = NULL; + + /* Clear the Error flags in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF | UART_CLEAR_NEF | UART_CLEAR_PEF | UART_CLEAR_FEF); + + /* Discard the received data */ + __HAL_UART_SEND_REQ(huart, UART_RXDATA_FLUSH_REQUEST); + + /* Restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* As no DMA to be aborted, call directly user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort Receive Complete Callback */ + huart->AbortReceiveCpltCallback(huart); +#else + /* Call legacy weak Abort Receive Complete Callback */ + HAL_UART_AbortReceiveCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + } + else + { + /* Reset Rx transfer counter */ + huart->RxXferCount = 0U; + + /* Clear RxISR function pointer */ + huart->pRxBuffPtr = NULL; + + /* Clear the Error flags in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF | UART_CLEAR_NEF | UART_CLEAR_PEF | UART_CLEAR_FEF); + + /* Restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* As no DMA to be aborted, call directly user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort Receive Complete Callback */ + huart->AbortReceiveCpltCallback(huart); +#else + /* Call legacy weak Abort Receive Complete Callback */ + HAL_UART_AbortReceiveCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + + return HAL_OK; +} + +/** + * @brief Handle UART interrupt request. + * @param huart UART handle. + * @retval None + */ +void HAL_UART_IRQHandler(UART_HandleTypeDef *huart) +{ + uint32_t isrflags = READ_REG(huart->Instance->ISR); + uint32_t cr1its = READ_REG(huart->Instance->CR1); + uint32_t cr3its = READ_REG(huart->Instance->CR3); + + uint32_t errorflags; + uint32_t errorcode; + + /* If no error occurs */ + errorflags = (isrflags & (uint32_t)(USART_ISR_PE | USART_ISR_FE | USART_ISR_ORE | USART_ISR_NE | USART_ISR_RTOF)); + if (errorflags == 0U) + { + /* UART in mode Receiver ---------------------------------------------------*/ + if (((isrflags & USART_ISR_RXNE) != 0U) + && ((cr1its & USART_CR1_RXNEIE) != 0U)) + { + if (huart->RxISR != NULL) + { + huart->RxISR(huart); + } + return; + } + } + + /* If some errors occur */ + if ((errorflags != 0U) + && (((cr3its & USART_CR3_EIE) != 0U) + || ((cr1its & (USART_CR1_RXNEIE | USART_CR1_PEIE | USART_CR1_RTOIE)) != 0U))) + { + /* UART parity error interrupt occurred -------------------------------------*/ + if (((isrflags & USART_ISR_PE) != 0U) && ((cr1its & USART_CR1_PEIE) != 0U)) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_PEF); + + huart->ErrorCode |= HAL_UART_ERROR_PE; + } + + /* UART frame error interrupt occurred --------------------------------------*/ + if (((isrflags & USART_ISR_FE) != 0U) && ((cr3its & USART_CR3_EIE) != 0U)) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_FEF); + + huart->ErrorCode |= HAL_UART_ERROR_FE; + } + + /* UART noise error interrupt occurred --------------------------------------*/ + if (((isrflags & USART_ISR_NE) != 0U) && ((cr3its & USART_CR3_EIE) != 0U)) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_NEF); + + huart->ErrorCode |= HAL_UART_ERROR_NE; + } + + /* UART Over-Run interrupt occurred -----------------------------------------*/ + if (((isrflags & USART_ISR_ORE) != 0U) + && (((cr1its & USART_CR1_RXNEIE) != 0U) || + ((cr3its & USART_CR3_EIE) != 0U))) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF); + + huart->ErrorCode |= HAL_UART_ERROR_ORE; + } + + /* UART Receiver Timeout interrupt occurred ---------------------------------*/ + if (((isrflags & USART_ISR_RTOF) != 0U) && ((cr1its & USART_CR1_RTOIE) != 0U)) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_RTOF); + + huart->ErrorCode |= HAL_UART_ERROR_RTO; + } + + /* Call UART Error Call back function if need be ----------------------------*/ + if (huart->ErrorCode != HAL_UART_ERROR_NONE) + { + /* UART in mode Receiver --------------------------------------------------*/ + if (((isrflags & USART_ISR_RXNE) != 0U) + && ((cr1its & USART_CR1_RXNEIE) != 0U)) + { + if (huart->RxISR != NULL) + { + huart->RxISR(huart); + } + } + + /* If Error is to be considered as blocking : + - Receiver Timeout error in Reception + - Overrun error in Reception + - any error occurs in DMA mode reception + */ + errorcode = huart->ErrorCode; + if ((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) || + ((errorcode & (HAL_UART_ERROR_RTO | HAL_UART_ERROR_ORE)) != 0U)) + { + /* Blocking error : transfer is aborted + Set the UART state ready to be able to start again the process, + Disable Rx Interrupts, and disable Rx DMA request, if ongoing */ + UART_EndRxTransfer(huart); + + /* Abort the UART DMA Rx channel if enabled */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) + { + /* Disable the UART DMA Rx request if enabled */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + /* Abort the UART DMA Rx channel */ + if (huart->hdmarx != NULL) + { + /* Set the UART DMA Abort callback : + will lead to call HAL_UART_ErrorCallback() at end of DMA abort procedure */ + huart->hdmarx->XferAbortCallback = UART_DMAAbortOnError; + + /* Abort DMA RX */ + if (HAL_DMA_Abort_IT(huart->hdmarx) != HAL_OK) + { + /* Call Directly huart->hdmarx->XferAbortCallback function in case of error */ + huart->hdmarx->XferAbortCallback(huart->hdmarx); + } + } + else + { + /* Call user error callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered error callback*/ + huart->ErrorCallback(huart); +#else + /*Call legacy weak error callback*/ + HAL_UART_ErrorCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + + } + } + else + { + /* Call user error callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered error callback*/ + huart->ErrorCallback(huart); +#else + /*Call legacy weak error callback*/ + HAL_UART_ErrorCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + } + else + { + /* Non Blocking error : transfer could go on. + Error is notified to user through user error callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered error callback*/ + huart->ErrorCallback(huart); +#else + /*Call legacy weak error callback*/ + HAL_UART_ErrorCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + huart->ErrorCode = HAL_UART_ERROR_NONE; + } + } + return; + + } /* End if some error occurs */ + + /* Check current reception Mode : + If Reception till IDLE event has been selected : */ + if ((huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + && ((isrflags & USART_ISR_IDLE) != 0U) + && ((cr1its & USART_ISR_IDLE) != 0U)) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF); + + /* Check if DMA mode is enabled in UART */ + if (HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) + { + /* DMA mode enabled */ + /* Check received length : If all expected data are received, do nothing, + (DMA cplt callback will be called). + Otherwise, if at least one data has already been received, IDLE event is to be notified to user */ + uint16_t nb_remaining_rx_data = (uint16_t) __HAL_DMA_GET_COUNTER(huart->hdmarx); + if ((nb_remaining_rx_data > 0U) + && (nb_remaining_rx_data < huart->RxXferSize)) + { + /* Reception is not complete */ + huart->RxXferCount = nb_remaining_rx_data; + + /* In Normal mode, end DMA xfer and HAL UART Rx process*/ + if (huart->hdmarx->Init.Mode != DMA_CIRCULAR) + { + /* Disable PE and ERR (Frame error, noise error, overrun error) interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_PEIE); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Disable the DMA transfer for the receiver request by resetting the DMAR bit + in the UART CR3 register */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + /* At end of Rx process, restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_IDLEIE); + + /* Last bytes received, so no need as the abort is immediate */ + (void)HAL_DMA_Abort(huart->hdmarx); + } + + /* Initialize type of RxEvent that correspond to RxEvent callback execution; + In this case, Rx Event type is Idle Event */ + huart->RxEventType = HAL_UART_RXEVENT_IDLE; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx Event callback*/ + huart->RxEventCallback(huart, (huart->RxXferSize - huart->RxXferCount)); +#else + /*Call legacy weak Rx Event callback*/ + HAL_UARTEx_RxEventCallback(huart, (huart->RxXferSize - huart->RxXferCount)); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + return; + } + else + { + /* DMA mode not enabled */ + /* Check received length : If all expected data are received, do nothing. + Otherwise, if at least one data has already been received, IDLE event is to be notified to user */ + uint16_t nb_rx_data = huart->RxXferSize - huart->RxXferCount; + if ((huart->RxXferCount > 0U) + && (nb_rx_data > 0U)) + { + /* Disable the UART Parity Error Interrupt and RXNE interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE)); + + /* Disable the UART Error Interrupt: (Frame error, noise error, overrun error) */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Rx process is completed, restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Clear RxISR function pointer */ + huart->RxISR = NULL; + + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_IDLEIE); + + /* Initialize type of RxEvent that correspond to RxEvent callback execution; + In this case, Rx Event type is Idle Event */ + huart->RxEventType = HAL_UART_RXEVENT_IDLE; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx complete callback*/ + huart->RxEventCallback(huart, nb_rx_data); +#else + /*Call legacy weak Rx Event callback*/ + HAL_UARTEx_RxEventCallback(huart, nb_rx_data); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + return; + } + } + + /* UART wakeup from Stop mode interrupt occurred ---------------------------*/ + if (((isrflags & USART_ISR_WUF) != 0U) && ((cr3its & USART_CR3_WUFIE) != 0U)) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_WUF); + + /* UART Rx state is not reset as a reception process might be ongoing. + If UART handle state fields need to be reset to READY, this could be done in Wakeup callback */ + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Wakeup Callback */ + huart->WakeupCallback(huart); +#else + /* Call legacy weak Wakeup Callback */ + HAL_UARTEx_WakeupCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + return; + } + + /* UART in mode Transmitter ------------------------------------------------*/ + if (((isrflags & USART_ISR_TXE) != 0U) + && ((cr1its & USART_CR1_TXEIE) != 0U)) + { + if (huart->TxISR != NULL) + { + huart->TxISR(huart); + } + return; + } + + /* UART in mode Transmitter (transmission end) -----------------------------*/ + if (((isrflags & USART_ISR_TC) != 0U) && ((cr1its & USART_CR1_TCIE) != 0U)) + { + UART_EndTransmit_IT(huart); + return; + } + +} + +/** + * @brief Tx Transfer completed callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UART_TxCpltCallback can be implemented in the user file. + */ +} + +/** + * @brief Tx Half Transfer completed callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_TxHalfCpltCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE: This function should not be modified, when the callback is needed, + the HAL_UART_TxHalfCpltCallback can be implemented in the user file. + */ +} + +/** + * @brief Rx Transfer completed callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UART_RxCpltCallback can be implemented in the user file. + */ +} + +/** + * @brief Rx Half Transfer completed callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_RxHalfCpltCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE: This function should not be modified, when the callback is needed, + the HAL_UART_RxHalfCpltCallback can be implemented in the user file. + */ +} + +/** + * @brief UART error callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UART_ErrorCallback can be implemented in the user file. + */ +} + +/** + * @brief UART Abort Complete callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_AbortCpltCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UART_AbortCpltCallback can be implemented in the user file. + */ +} + +/** + * @brief UART Abort Complete callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_AbortTransmitCpltCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UART_AbortTransmitCpltCallback can be implemented in the user file. + */ +} + +/** + * @brief UART Abort Receive Complete callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UART_AbortReceiveCpltCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UART_AbortReceiveCpltCallback can be implemented in the user file. + */ +} + +/** + * @brief Reception Event Callback (Rx event notification called after use of advanced reception service). + * @param huart UART handle + * @param Size Number of data available in application reception buffer (indicates a position in + * reception buffer until which, data are available) + * @retval None + */ +__weak void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + UNUSED(Size); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UARTEx_RxEventCallback can be implemented in the user file. + */ +} + +/** + * @} + */ + +/** @defgroup UART_Exported_Functions_Group3 Peripheral Control functions + * @brief UART control functions + * +@verbatim + =============================================================================== + ##### Peripheral Control functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to control the UART. + (+) HAL_UART_ReceiverTimeout_Config() API allows to configure the receiver timeout value on the fly + (+) HAL_UART_EnableReceiverTimeout() API enables the receiver timeout feature + (+) HAL_UART_DisableReceiverTimeout() API disables the receiver timeout feature + (+) HAL_MultiProcessor_EnableMuteMode() API enables mute mode + (+) HAL_MultiProcessor_DisableMuteMode() API disables mute mode + (+) HAL_MultiProcessor_EnterMuteMode() API enters mute mode + (+) UART_SetConfig() API configures the UART peripheral + (+) UART_AdvFeatureConfig() API optionally configures the UART advanced features + (+) UART_CheckIdleState() API ensures that TEACK and/or REACK are set after initialization + (+) HAL_HalfDuplex_EnableTransmitter() API disables receiver and enables transmitter + (+) HAL_HalfDuplex_EnableReceiver() API disables transmitter and enables receiver + (+) HAL_LIN_SendBreak() API transmits the break characters +@endverbatim + * @{ + */ + +/** + * @brief Update on the fly the receiver timeout value in RTOR register. + * @param huart Pointer to a UART_HandleTypeDef structure that contains + * the configuration information for the specified UART module. + * @param TimeoutValue receiver timeout value in number of baud blocks. The timeout + * value must be less or equal to 0x0FFFFFFFF. + * @retval None + */ +void HAL_UART_ReceiverTimeout_Config(UART_HandleTypeDef *huart, uint32_t TimeoutValue) +{ + assert_param(IS_UART_RECEIVER_TIMEOUT_VALUE(TimeoutValue)); + MODIFY_REG(huart->Instance->RTOR, USART_RTOR_RTO, TimeoutValue); +} + +/** + * @brief Enable the UART receiver timeout feature. + * @param huart Pointer to a UART_HandleTypeDef structure that contains + * the configuration information for the specified UART module. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_EnableReceiverTimeout(UART_HandleTypeDef *huart) +{ + if (huart->gState == HAL_UART_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(huart); + + huart->gState = HAL_UART_STATE_BUSY; + + /* Set the USART RTOEN bit */ + SET_BIT(huart->Instance->CR2, USART_CR2_RTOEN); + + huart->gState = HAL_UART_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(huart); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Disable the UART receiver timeout feature. + * @param huart Pointer to a UART_HandleTypeDef structure that contains + * the configuration information for the specified UART module. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UART_DisableReceiverTimeout(UART_HandleTypeDef *huart) +{ + if (huart->gState == HAL_UART_STATE_READY) + { + /* Process Locked */ + __HAL_LOCK(huart); + + huart->gState = HAL_UART_STATE_BUSY; + + /* Clear the USART RTOEN bit */ + CLEAR_BIT(huart->Instance->CR2, USART_CR2_RTOEN); + + huart->gState = HAL_UART_STATE_READY; + + /* Process Unlocked */ + __HAL_UNLOCK(huart); + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Enable UART in mute mode (does not mean UART enters mute mode; + * to enter mute mode, HAL_MultiProcessor_EnterMuteMode() API must be called). + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_MultiProcessor_EnableMuteMode(UART_HandleTypeDef *huart) +{ + __HAL_LOCK(huart); + + huart->gState = HAL_UART_STATE_BUSY; + + /* Enable USART mute mode by setting the MME bit in the CR1 register */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_MME); + + huart->gState = HAL_UART_STATE_READY; + + return (UART_CheckIdleState(huart)); +} + +/** + * @brief Disable UART mute mode (does not mean the UART actually exits mute mode + * as it may not have been in mute mode at this very moment). + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_MultiProcessor_DisableMuteMode(UART_HandleTypeDef *huart) +{ + __HAL_LOCK(huart); + + huart->gState = HAL_UART_STATE_BUSY; + + /* Disable USART mute mode by clearing the MME bit in the CR1 register */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_MME); + + huart->gState = HAL_UART_STATE_READY; + + return (UART_CheckIdleState(huart)); +} + +/** + * @brief Enter UART mute mode (means UART actually enters mute mode). + * @note To exit from mute mode, HAL_MultiProcessor_DisableMuteMode() API must be called. + * @param huart UART handle. + * @retval None + */ +void HAL_MultiProcessor_EnterMuteMode(UART_HandleTypeDef *huart) +{ + __HAL_UART_SEND_REQ(huart, UART_MUTE_MODE_REQUEST); +} + +/** + * @brief Enable the UART transmitter and disable the UART receiver. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_HalfDuplex_EnableTransmitter(UART_HandleTypeDef *huart) +{ + __HAL_LOCK(huart); + huart->gState = HAL_UART_STATE_BUSY; + + /* Clear TE and RE bits */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_TE | USART_CR1_RE)); + + /* Enable the USART's transmit interface by setting the TE bit in the USART CR1 register */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_TE); + + huart->gState = HAL_UART_STATE_READY; + + __HAL_UNLOCK(huart); + + return HAL_OK; +} + +/** + * @brief Enable the UART receiver and disable the UART transmitter. + * @param huart UART handle. + * @retval HAL status. + */ +HAL_StatusTypeDef HAL_HalfDuplex_EnableReceiver(UART_HandleTypeDef *huart) +{ + __HAL_LOCK(huart); + huart->gState = HAL_UART_STATE_BUSY; + + /* Clear TE and RE bits */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_TE | USART_CR1_RE)); + + /* Enable the USART's receive interface by setting the RE bit in the USART CR1 register */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_RE); + + huart->gState = HAL_UART_STATE_READY; + + __HAL_UNLOCK(huart); + + return HAL_OK; +} + + +/** + * @brief Transmit break characters. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_LIN_SendBreak(UART_HandleTypeDef *huart) +{ + /* Check the parameters */ + assert_param(IS_UART_LIN_INSTANCE(huart->Instance)); + + __HAL_LOCK(huart); + + huart->gState = HAL_UART_STATE_BUSY; + + /* Send break characters */ + __HAL_UART_SEND_REQ(huart, UART_SENDBREAK_REQUEST); + + huart->gState = HAL_UART_STATE_READY; + + __HAL_UNLOCK(huart); + + return HAL_OK; +} + +/** + * @} + */ + +/** @defgroup UART_Exported_Functions_Group4 Peripheral State and Error functions + * @brief UART Peripheral State functions + * +@verbatim + ============================================================================== + ##### Peripheral State and Error functions ##### + ============================================================================== + [..] + This subsection provides functions allowing to : + (+) Return the UART handle state. + (+) Return the UART handle error code + +@endverbatim + * @{ + */ + +/** + * @brief Return the UART handle state. + * @param huart Pointer to a UART_HandleTypeDef structure that contains + * the configuration information for the specified UART. + * @retval HAL state + */ +HAL_UART_StateTypeDef HAL_UART_GetState(const UART_HandleTypeDef *huart) +{ + uint32_t temp1; + uint32_t temp2; + temp1 = huart->gState; + temp2 = huart->RxState; + + return (HAL_UART_StateTypeDef)(temp1 | temp2); +} + +/** + * @brief Return the UART handle error code. + * @param huart Pointer to a UART_HandleTypeDef structure that contains + * the configuration information for the specified UART. + * @retval UART Error Code + */ +uint32_t HAL_UART_GetError(const UART_HandleTypeDef *huart) +{ + return huart->ErrorCode; +} +/** + * @} + */ + +/** + * @} + */ + +/** @defgroup UART_Private_Functions UART Private Functions + * @{ + */ + +/** + * @brief Initialize the callbacks to their default values. + * @param huart UART handle. + * @retval none + */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) +void UART_InitCallbacksToDefault(UART_HandleTypeDef *huart) +{ + /* Init the UART Callback settings */ + huart->TxHalfCpltCallback = HAL_UART_TxHalfCpltCallback; /* Legacy weak TxHalfCpltCallback */ + huart->TxCpltCallback = HAL_UART_TxCpltCallback; /* Legacy weak TxCpltCallback */ + huart->RxHalfCpltCallback = HAL_UART_RxHalfCpltCallback; /* Legacy weak RxHalfCpltCallback */ + huart->RxCpltCallback = HAL_UART_RxCpltCallback; /* Legacy weak RxCpltCallback */ + huart->ErrorCallback = HAL_UART_ErrorCallback; /* Legacy weak ErrorCallback */ + huart->AbortCpltCallback = HAL_UART_AbortCpltCallback; /* Legacy weak AbortCpltCallback */ + huart->AbortTransmitCpltCallback = HAL_UART_AbortTransmitCpltCallback; /* Legacy weak AbortTransmitCpltCallback */ + huart->AbortReceiveCpltCallback = HAL_UART_AbortReceiveCpltCallback; /* Legacy weak AbortReceiveCpltCallback */ + huart->WakeupCallback = HAL_UARTEx_WakeupCallback; /* Legacy weak WakeupCallback */ + huart->RxEventCallback = HAL_UARTEx_RxEventCallback; /* Legacy weak RxEventCallback */ + +} +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + +/** + * @brief Configure the UART peripheral. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef UART_SetConfig(UART_HandleTypeDef *huart) +{ + uint32_t tmpreg; + uint16_t brrtemp; + UART_ClockSourceTypeDef clocksource; + uint32_t usartdiv; + HAL_StatusTypeDef ret = HAL_OK; + uint32_t pclk; + + /* Check the parameters */ + assert_param(IS_UART_BAUDRATE(huart->Init.BaudRate)); + assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength)); + assert_param(IS_UART_STOPBITS(huart->Init.StopBits)); + assert_param(IS_UART_ONE_BIT_SAMPLE(huart->Init.OneBitSampling)); + + assert_param(IS_UART_PARITY(huart->Init.Parity)); + assert_param(IS_UART_MODE(huart->Init.Mode)); + assert_param(IS_UART_HARDWARE_FLOW_CONTROL(huart->Init.HwFlowCtl)); + assert_param(IS_UART_OVERSAMPLING(huart->Init.OverSampling)); + + /*-------------------------- USART CR1 Configuration -----------------------*/ + /* Clear M, PCE, PS, TE, RE and OVER8 bits and configure + * the UART Word Length, Parity, Mode and oversampling: + * set the M bits according to huart->Init.WordLength value + * set PCE and PS bits according to huart->Init.Parity value + * set TE and RE bits according to huart->Init.Mode value + * set OVER8 bit according to huart->Init.OverSampling value */ + tmpreg = (uint32_t)huart->Init.WordLength | huart->Init.Parity | huart->Init.Mode | huart->Init.OverSampling ; + MODIFY_REG(huart->Instance->CR1, USART_CR1_FIELDS, tmpreg); + + /*-------------------------- USART CR2 Configuration -----------------------*/ + /* Configure the UART Stop Bits: Set STOP[13:12] bits according + * to huart->Init.StopBits value */ + MODIFY_REG(huart->Instance->CR2, USART_CR2_STOP, huart->Init.StopBits); + + /*-------------------------- USART CR3 Configuration -----------------------*/ + /* Configure + * - UART HardWare Flow Control: set CTSE and RTSE bits according + * to huart->Init.HwFlowCtl value + * - one-bit sampling method versus three samples' majority rule according + * to huart->Init.OneBitSampling (not applicable to LPUART) */ + tmpreg = (uint32_t)huart->Init.HwFlowCtl; + + tmpreg |= huart->Init.OneBitSampling; + MODIFY_REG(huart->Instance->CR3, USART_CR3_FIELDS, tmpreg); + + + /*-------------------------- USART BRR Configuration -----------------------*/ + UART_GETCLOCKSOURCE(huart, clocksource); + + if (huart->Init.OverSampling == UART_OVERSAMPLING_8) + { + switch (clocksource) + { + case UART_CLOCKSOURCE_PCLK1: + pclk = HAL_RCC_GetPCLK1Freq(); + break; + case UART_CLOCKSOURCE_PCLK2: + pclk = HAL_RCC_GetPCLK2Freq(); + break; + case UART_CLOCKSOURCE_HSI: + pclk = (uint32_t) HSI_VALUE; + break; + case UART_CLOCKSOURCE_SYSCLK: + pclk = HAL_RCC_GetSysClockFreq(); + break; + case UART_CLOCKSOURCE_LSE: + pclk = (uint32_t) LSE_VALUE; + break; + default: + pclk = 0U; + ret = HAL_ERROR; + break; + } + + /* USARTDIV must be greater than or equal to 0d16 */ + if (pclk != 0U) + { + usartdiv = (uint32_t)(UART_DIV_SAMPLING8(pclk, huart->Init.BaudRate)); + if ((usartdiv >= UART_BRR_MIN) && (usartdiv <= UART_BRR_MAX)) + { + brrtemp = (uint16_t)(usartdiv & 0xFFF0U); + brrtemp |= (uint16_t)((usartdiv & (uint16_t)0x000FU) >> 1U); + huart->Instance->BRR = brrtemp; + } + else + { + ret = HAL_ERROR; + } + } + } + else + { + switch (clocksource) + { + case UART_CLOCKSOURCE_PCLK1: + pclk = HAL_RCC_GetPCLK1Freq(); + break; + case UART_CLOCKSOURCE_PCLK2: + pclk = HAL_RCC_GetPCLK2Freq(); + break; + case UART_CLOCKSOURCE_HSI: + pclk = (uint32_t) HSI_VALUE; + break; + case UART_CLOCKSOURCE_SYSCLK: + pclk = HAL_RCC_GetSysClockFreq(); + break; + case UART_CLOCKSOURCE_LSE: + pclk = (uint32_t) LSE_VALUE; + break; + default: + pclk = 0U; + ret = HAL_ERROR; + break; + } + + if (pclk != 0U) + { + /* USARTDIV must be greater than or equal to 0d16 */ + usartdiv = (uint32_t)(UART_DIV_SAMPLING16(pclk, huart->Init.BaudRate)); + if ((usartdiv >= UART_BRR_MIN) && (usartdiv <= UART_BRR_MAX)) + { + huart->Instance->BRR = (uint16_t)usartdiv; + } + else + { + ret = HAL_ERROR; + } + } + } + + + /* Clear ISR function pointers */ + huart->RxISR = NULL; + huart->TxISR = NULL; + + return ret; +} + +/** + * @brief Configure the UART peripheral advanced features. + * @param huart UART handle. + * @retval None + */ +void UART_AdvFeatureConfig(UART_HandleTypeDef *huart) +{ + /* Check whether the set of advanced features to configure is properly set */ + assert_param(IS_UART_ADVFEATURE_INIT(huart->AdvancedInit.AdvFeatureInit)); + + /* if required, configure TX pin active level inversion */ + if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_TXINVERT_INIT)) + { + assert_param(IS_UART_ADVFEATURE_TXINV(huart->AdvancedInit.TxPinLevelInvert)); + MODIFY_REG(huart->Instance->CR2, USART_CR2_TXINV, huart->AdvancedInit.TxPinLevelInvert); + } + + /* if required, configure RX pin active level inversion */ + if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_RXINVERT_INIT)) + { + assert_param(IS_UART_ADVFEATURE_RXINV(huart->AdvancedInit.RxPinLevelInvert)); + MODIFY_REG(huart->Instance->CR2, USART_CR2_RXINV, huart->AdvancedInit.RxPinLevelInvert); + } + + /* if required, configure data inversion */ + if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_DATAINVERT_INIT)) + { + assert_param(IS_UART_ADVFEATURE_DATAINV(huart->AdvancedInit.DataInvert)); + MODIFY_REG(huart->Instance->CR2, USART_CR2_DATAINV, huart->AdvancedInit.DataInvert); + } + + /* if required, configure RX/TX pins swap */ + if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_SWAP_INIT)) + { + assert_param(IS_UART_ADVFEATURE_SWAP(huart->AdvancedInit.Swap)); + MODIFY_REG(huart->Instance->CR2, USART_CR2_SWAP, huart->AdvancedInit.Swap); + } + + /* if required, configure RX overrun detection disabling */ + if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_RXOVERRUNDISABLE_INIT)) + { + assert_param(IS_UART_OVERRUN(huart->AdvancedInit.OverrunDisable)); + MODIFY_REG(huart->Instance->CR3, USART_CR3_OVRDIS, huart->AdvancedInit.OverrunDisable); + } + + /* if required, configure DMA disabling on reception error */ + if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_DMADISABLEONERROR_INIT)) + { + assert_param(IS_UART_ADVFEATURE_DMAONRXERROR(huart->AdvancedInit.DMADisableonRxError)); + MODIFY_REG(huart->Instance->CR3, USART_CR3_DDRE, huart->AdvancedInit.DMADisableonRxError); + } + + /* if required, configure auto Baud rate detection scheme */ + if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_AUTOBAUDRATE_INIT)) + { + assert_param(IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(huart->Instance)); + assert_param(IS_UART_ADVFEATURE_AUTOBAUDRATE(huart->AdvancedInit.AutoBaudRateEnable)); + MODIFY_REG(huart->Instance->CR2, USART_CR2_ABREN, huart->AdvancedInit.AutoBaudRateEnable); + /* set auto Baudrate detection parameters if detection is enabled */ + if (huart->AdvancedInit.AutoBaudRateEnable == UART_ADVFEATURE_AUTOBAUDRATE_ENABLE) + { + assert_param(IS_UART_ADVFEATURE_AUTOBAUDRATEMODE(huart->AdvancedInit.AutoBaudRateMode)); + MODIFY_REG(huart->Instance->CR2, USART_CR2_ABRMODE, huart->AdvancedInit.AutoBaudRateMode); + } + } + + /* if required, configure MSB first on communication line */ + if (HAL_IS_BIT_SET(huart->AdvancedInit.AdvFeatureInit, UART_ADVFEATURE_MSBFIRST_INIT)) + { + assert_param(IS_UART_ADVFEATURE_MSBFIRST(huart->AdvancedInit.MSBFirst)); + MODIFY_REG(huart->Instance->CR2, USART_CR2_MSBFIRST, huart->AdvancedInit.MSBFirst); + } +} + +/** + * @brief Check the UART Idle State. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef UART_CheckIdleState(UART_HandleTypeDef *huart) +{ + uint32_t tickstart; + + /* Initialize the UART ErrorCode */ + huart->ErrorCode = HAL_UART_ERROR_NONE; + + /* Init tickstart for timeout management */ + tickstart = HAL_GetTick(); + + /* Check if the Transmitter is enabled */ + if ((huart->Instance->CR1 & USART_CR1_TE) == USART_CR1_TE) + { + /* Wait until TEACK flag is set */ + if (UART_WaitOnFlagUntilTimeout(huart, USART_ISR_TEACK, RESET, tickstart, HAL_UART_TIMEOUT_VALUE) != HAL_OK) + { + /* Disable TXE interrupt for the interrupt process */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_TXEIE)); + + huart->gState = HAL_UART_STATE_READY; + + __HAL_UNLOCK(huart); + + /* Timeout occurred */ + return HAL_TIMEOUT; + } + } + + /* Check if the Receiver is enabled */ + if ((huart->Instance->CR1 & USART_CR1_RE) == USART_CR1_RE) + { + /* Wait until REACK flag is set */ + if (UART_WaitOnFlagUntilTimeout(huart, USART_ISR_REACK, RESET, tickstart, HAL_UART_TIMEOUT_VALUE) != HAL_OK) + { + /* Disable RXNE, PE and ERR (Frame error, noise error, overrun error) + interrupts for the interrupt process */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE)); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + huart->RxState = HAL_UART_STATE_READY; + + __HAL_UNLOCK(huart); + + /* Timeout occurred */ + return HAL_TIMEOUT; + } + } + + /* Initialize the UART State */ + huart->gState = HAL_UART_STATE_READY; + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + huart->RxEventType = HAL_UART_RXEVENT_TC; + + __HAL_UNLOCK(huart); + + return HAL_OK; +} + +/** + * @brief This function handles UART Communication Timeout. It waits + * until a flag is no longer in the specified status. + * @param huart UART handle. + * @param Flag Specifies the UART flag to check + * @param Status The actual Flag status (SET or RESET) + * @param Tickstart Tick start value + * @param Timeout Timeout duration + * @retval HAL status + */ +HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout(UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, + uint32_t Tickstart, uint32_t Timeout) +{ + /* Wait until flag is set */ + while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status) + { + /* Check for the Timeout */ + if (Timeout != HAL_MAX_DELAY) + { + if (((HAL_GetTick() - Tickstart) > Timeout) || (Timeout == 0U)) + { + + return HAL_TIMEOUT; + } + + if (READ_BIT(huart->Instance->CR1, USART_CR1_RE) != 0U) + { + if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) == SET) + { + /* Clear Overrun Error flag*/ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF); + + /* Blocking error : transfer is aborted + Set the UART state ready to be able to start again the process, + Disable Rx Interrupts if ongoing */ + UART_EndRxTransfer(huart); + + huart->ErrorCode = HAL_UART_ERROR_ORE; + + /* Process Unlocked */ + __HAL_UNLOCK(huart); + + return HAL_ERROR; + } + if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RTOF) == SET) + { + /* Clear Receiver Timeout flag*/ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_RTOF); + + /* Blocking error : transfer is aborted + Set the UART state ready to be able to start again the process, + Disable Rx Interrupts if ongoing */ + UART_EndRxTransfer(huart); + + huart->ErrorCode = HAL_UART_ERROR_RTO; + + /* Process Unlocked */ + __HAL_UNLOCK(huart); + + return HAL_TIMEOUT; + } + } + } + } + return HAL_OK; +} + +/** + * @brief Start Receive operation in interrupt mode. + * @note This function could be called by all HAL UART API providing reception in Interrupt mode. + * @note When calling this function, parameters validity is considered as already checked, + * i.e. Rx State, buffer address, ... + * UART Handle is assumed as Locked. + * @param huart UART handle. + * @param pData Pointer to data buffer (u8 or u16 data elements). + * @param Size Amount of data elements (u8 or u16) to be received. + * @retval HAL status + */ +HAL_StatusTypeDef UART_Start_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) +{ + huart->pRxBuffPtr = pData; + huart->RxXferSize = Size; + huart->RxXferCount = Size; + huart->RxISR = NULL; + + /* Computation of UART mask to apply to RDR register */ + UART_MASK_COMPUTATION(huart); + + huart->ErrorCode = HAL_UART_ERROR_NONE; + huart->RxState = HAL_UART_STATE_BUSY_RX; + + /* Enable the UART Error Interrupt: (Frame error, noise error, overrun error) */ + ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Set the Rx ISR function pointer according to the data word length */ + if ((huart->Init.WordLength == UART_WORDLENGTH_9B) && (huart->Init.Parity == UART_PARITY_NONE)) + { + huart->RxISR = UART_RxISR_16BIT; + } + else + { + huart->RxISR = UART_RxISR_8BIT; + } + + /* Enable the UART Parity Error interrupt and Data Register Not Empty interrupt */ + if (huart->Init.Parity != UART_PARITY_NONE) + { + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_PEIE | USART_CR1_RXNEIE); + } + else + { + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_RXNEIE); + } + return HAL_OK; +} + +/** + * @brief Start Receive operation in DMA mode. + * @note This function could be called by all HAL UART API providing reception in DMA mode. + * @note When calling this function, parameters validity is considered as already checked, + * i.e. Rx State, buffer address, ... + * UART Handle is assumed as Locked. + * @param huart UART handle. + * @param pData Pointer to data buffer (u8 or u16 data elements). + * @param Size Amount of data elements (u8 or u16) to be received. + * @retval HAL status + */ +HAL_StatusTypeDef UART_Start_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) +{ + huart->pRxBuffPtr = pData; + huart->RxXferSize = Size; + + huart->ErrorCode = HAL_UART_ERROR_NONE; + huart->RxState = HAL_UART_STATE_BUSY_RX; + + if (huart->hdmarx != NULL) + { + /* Set the UART DMA transfer complete callback */ + huart->hdmarx->XferCpltCallback = UART_DMAReceiveCplt; + + /* Set the UART DMA Half transfer complete callback */ + huart->hdmarx->XferHalfCpltCallback = UART_DMARxHalfCplt; + + /* Set the DMA error callback */ + huart->hdmarx->XferErrorCallback = UART_DMAError; + + /* Set the DMA abort callback */ + huart->hdmarx->XferAbortCallback = NULL; + + /* Enable the DMA channel */ + if (HAL_DMA_Start_IT(huart->hdmarx, (uint32_t)&huart->Instance->RDR, (uint32_t)huart->pRxBuffPtr, Size) != HAL_OK) + { + /* Set error code to DMA */ + huart->ErrorCode = HAL_UART_ERROR_DMA; + + /* Restore huart->RxState to ready */ + huart->RxState = HAL_UART_STATE_READY; + + return HAL_ERROR; + } + } + + /* Enable the UART Parity Error Interrupt */ + if (huart->Init.Parity != UART_PARITY_NONE) + { + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_PEIE); + } + + /* Enable the UART Error Interrupt: (Frame error, noise error, overrun error) */ + ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Enable the DMA transfer for the receiver request by setting the DMAR bit + in the UART CR3 register */ + ATOMIC_SET_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + return HAL_OK; +} + + +/** + * @brief End ongoing Tx transfer on UART peripheral (following error detection or Transmit completion). + * @param huart UART handle. + * @retval None + */ +static void UART_EndTxTransfer(UART_HandleTypeDef *huart) +{ + /* Disable TXEIE and TCIE interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_TXEIE | USART_CR1_TCIE)); + + /* At end of Tx process, restore huart->gState to Ready */ + huart->gState = HAL_UART_STATE_READY; +} + + +/** + * @brief End ongoing Rx transfer on UART peripheral (following error detection or Reception completion). + * @param huart UART handle. + * @retval None + */ +static void UART_EndRxTransfer(UART_HandleTypeDef *huart) +{ + /* Disable RXNE, PE and ERR (Frame error, noise error, overrun error) interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE)); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* In case of reception waiting for IDLE event, disable also the IDLE IE interrupt source */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_IDLEIE); + } + + /* At end of Rx process, restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Reset RxIsr function pointer */ + huart->RxISR = NULL; +} + + +/** + * @brief DMA UART transmit process complete callback. + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMATransmitCplt(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + + /* DMA Normal mode */ + if (hdma->Init.Mode != DMA_CIRCULAR) + { + huart->TxXferCount = 0U; + + /* Disable the DMA transfer for transmit request by resetting the DMAT bit + in the UART CR3 register */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAT); + + /* Enable the UART Transmit Complete Interrupt */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_TCIE); + } + /* DMA Circular mode */ + else + { +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Tx complete callback*/ + huart->TxCpltCallback(huart); +#else + /*Call legacy weak Tx complete callback*/ + HAL_UART_TxCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } +} + +/** + * @brief DMA UART transmit process half complete callback. + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMATxHalfCplt(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Tx Half complete callback*/ + huart->TxHalfCpltCallback(huart); +#else + /*Call legacy weak Tx Half complete callback*/ + HAL_UART_TxHalfCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +} + +/** + * @brief DMA UART receive process complete callback. + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMAReceiveCplt(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + + /* DMA Normal mode */ + if (hdma->Init.Mode != DMA_CIRCULAR) + { + huart->RxXferCount = 0U; + + /* Disable PE and ERR (Frame error, noise error, overrun error) interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_PEIE); + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Disable the DMA transfer for the receiver request by resetting the DMAR bit + in the UART CR3 register */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_DMAR); + + /* At end of Rx process, restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + + /* If Reception till IDLE event has been selected, Disable IDLE Interrupt */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_IDLEIE); + } + } + + /* Initialize type of RxEvent that correspond to RxEvent callback execution; + In this case, Rx Event type is Transfer Complete */ + huart->RxEventType = HAL_UART_RXEVENT_TC; + + /* Check current reception Mode : + If Reception till IDLE event has been selected : use Rx Event callback */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx Event callback*/ + huart->RxEventCallback(huart, huart->RxXferSize); +#else + /*Call legacy weak Rx Event callback*/ + HAL_UARTEx_RxEventCallback(huart, huart->RxXferSize); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + else + { + /* In other cases : use Rx Complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx complete callback*/ + huart->RxCpltCallback(huart); +#else + /*Call legacy weak Rx complete callback*/ + HAL_UART_RxCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } +} + +/** + * @brief DMA UART receive process half complete callback. + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMARxHalfCplt(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + + /* Initialize type of RxEvent that correspond to RxEvent callback execution; + In this case, Rx Event type is Half Transfer */ + huart->RxEventType = HAL_UART_RXEVENT_HT; + + /* Check current reception Mode : + If Reception till IDLE event has been selected : use Rx Event callback */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx Event callback*/ + huart->RxEventCallback(huart, huart->RxXferSize / 2U); +#else + /*Call legacy weak Rx Event callback*/ + HAL_UARTEx_RxEventCallback(huart, huart->RxXferSize / 2U); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + else + { + /* In other cases : use Rx Half Complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx Half complete callback*/ + huart->RxHalfCpltCallback(huart); +#else + /*Call legacy weak Rx Half complete callback*/ + HAL_UART_RxHalfCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } +} + +/** + * @brief DMA UART communication error callback. + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMAError(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + + const HAL_UART_StateTypeDef gstate = huart->gState; + const HAL_UART_StateTypeDef rxstate = huart->RxState; + + /* Stop UART DMA Tx request if ongoing */ + if ((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAT)) && + (gstate == HAL_UART_STATE_BUSY_TX)) + { + huart->TxXferCount = 0U; + UART_EndTxTransfer(huart); + } + + /* Stop UART DMA Rx request if ongoing */ + if ((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) && + (rxstate == HAL_UART_STATE_BUSY_RX)) + { + huart->RxXferCount = 0U; + UART_EndRxTransfer(huart); + } + + huart->ErrorCode |= HAL_UART_ERROR_DMA; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered error callback*/ + huart->ErrorCallback(huart); +#else + /*Call legacy weak error callback*/ + HAL_UART_ErrorCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +} + +/** + * @brief DMA UART communication abort callback, when initiated by HAL services on Error + * (To be called at end of DMA Abort procedure following error occurrence). + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMAAbortOnError(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + huart->RxXferCount = 0U; + huart->TxXferCount = 0U; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered error callback*/ + huart->ErrorCallback(huart); +#else + /*Call legacy weak error callback*/ + HAL_UART_ErrorCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +} + +/** + * @brief DMA UART Tx communication abort callback, when initiated by user + * (To be called at end of DMA Tx Abort procedure following user abort request). + * @note When this callback is executed, User Abort complete call back is called only if no + * Abort still ongoing for Rx DMA Handle. + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMATxAbortCallback(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + + huart->hdmatx->XferAbortCallback = NULL; + + /* Check if an Abort process is still ongoing */ + if (huart->hdmarx != NULL) + { + if (huart->hdmarx->XferAbortCallback != NULL) + { + return; + } + } + + /* No Abort process still ongoing : All DMA channels are aborted, call user Abort Complete callback */ + huart->TxXferCount = 0U; + huart->RxXferCount = 0U; + + /* Reset errorCode */ + huart->ErrorCode = HAL_UART_ERROR_NONE; + + /* Clear the Error flags in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF | UART_CLEAR_NEF | UART_CLEAR_PEF | UART_CLEAR_FEF); + + + /* Restore huart->gState and huart->RxState to Ready */ + huart->gState = HAL_UART_STATE_READY; + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Call user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort complete callback */ + huart->AbortCpltCallback(huart); +#else + /* Call legacy weak Abort complete callback */ + HAL_UART_AbortCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +} + + +/** + * @brief DMA UART Rx communication abort callback, when initiated by user + * (To be called at end of DMA Rx Abort procedure following user abort request). + * @note When this callback is executed, User Abort complete call back is called only if no + * Abort still ongoing for Tx DMA Handle. + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMARxAbortCallback(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + + huart->hdmarx->XferAbortCallback = NULL; + + /* Check if an Abort process is still ongoing */ + if (huart->hdmatx != NULL) + { + if (huart->hdmatx->XferAbortCallback != NULL) + { + return; + } + } + + /* No Abort process still ongoing : All DMA channels are aborted, call user Abort Complete callback */ + huart->TxXferCount = 0U; + huart->RxXferCount = 0U; + + /* Reset errorCode */ + huart->ErrorCode = HAL_UART_ERROR_NONE; + + /* Clear the Error flags in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF | UART_CLEAR_NEF | UART_CLEAR_PEF | UART_CLEAR_FEF); + + /* Discard the received data */ + __HAL_UART_SEND_REQ(huart, UART_RXDATA_FLUSH_REQUEST); + + /* Restore huart->gState and huart->RxState to Ready */ + huart->gState = HAL_UART_STATE_READY; + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Call user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort complete callback */ + huart->AbortCpltCallback(huart); +#else + /* Call legacy weak Abort complete callback */ + HAL_UART_AbortCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +} + + +/** + * @brief DMA UART Tx communication abort callback, when initiated by user by a call to + * HAL_UART_AbortTransmit_IT API (Abort only Tx transfer) + * (This callback is executed at end of DMA Tx Abort procedure following user abort request, + * and leads to user Tx Abort Complete callback execution). + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMATxOnlyAbortCallback(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)(hdma->Parent); + + huart->TxXferCount = 0U; + + + /* Restore huart->gState to Ready */ + huart->gState = HAL_UART_STATE_READY; + + /* Call user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort Transmit Complete Callback */ + huart->AbortTransmitCpltCallback(huart); +#else + /* Call legacy weak Abort Transmit Complete Callback */ + HAL_UART_AbortTransmitCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +} + +/** + * @brief DMA UART Rx communication abort callback, when initiated by user by a call to + * HAL_UART_AbortReceive_IT API (Abort only Rx transfer) + * (This callback is executed at end of DMA Rx Abort procedure following user abort request, + * and leads to user Rx Abort Complete callback execution). + * @param hdma DMA handle. + * @retval None + */ +static void UART_DMARxOnlyAbortCallback(DMA_HandleTypeDef *hdma) +{ + UART_HandleTypeDef *huart = (UART_HandleTypeDef *)((DMA_HandleTypeDef *)hdma)->Parent; + + huart->RxXferCount = 0U; + + /* Clear the Error flags in the ICR register */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_OREF | UART_CLEAR_NEF | UART_CLEAR_PEF | UART_CLEAR_FEF); + + /* Discard the received data */ + __HAL_UART_SEND_REQ(huart, UART_RXDATA_FLUSH_REQUEST); + + /* Restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Call user Abort complete callback */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /* Call registered Abort Receive Complete Callback */ + huart->AbortReceiveCpltCallback(huart); +#else + /* Call legacy weak Abort Receive Complete Callback */ + HAL_UART_AbortReceiveCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +} + +/** + * @brief TX interrupt handler for 7 or 8 bits data word length . + * @note Function is called under interruption only, once + * interruptions have been enabled by HAL_UART_Transmit_IT(). + * @param huart UART handle. + * @retval None + */ +static void UART_TxISR_8BIT(UART_HandleTypeDef *huart) +{ + /* Check that a Tx process is ongoing */ + if (huart->gState == HAL_UART_STATE_BUSY_TX) + { + if (huart->TxXferCount == 0U) + { + /* Disable the UART Transmit Data Register Empty Interrupt */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_TXEIE); + + /* Enable the UART Transmit Complete Interrupt */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_TCIE); + } + else + { + huart->Instance->TDR = (uint8_t)(*huart->pTxBuffPtr & (uint8_t)0xFF); + huart->pTxBuffPtr++; + huart->TxXferCount--; + } + } +} + +/** + * @brief TX interrupt handler for 9 bits data word length. + * @note Function is called under interruption only, once + * interruptions have been enabled by HAL_UART_Transmit_IT(). + * @param huart UART handle. + * @retval None + */ +static void UART_TxISR_16BIT(UART_HandleTypeDef *huart) +{ + const uint16_t *tmp; + + /* Check that a Tx process is ongoing */ + if (huart->gState == HAL_UART_STATE_BUSY_TX) + { + if (huart->TxXferCount == 0U) + { + /* Disable the UART Transmit Data Register Empty Interrupt */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_TXEIE); + + /* Enable the UART Transmit Complete Interrupt */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_TCIE); + } + else + { + tmp = (const uint16_t *) huart->pTxBuffPtr; + huart->Instance->TDR = (((uint32_t)(*tmp)) & 0x01FFUL); + huart->pTxBuffPtr += 2U; + huart->TxXferCount--; + } + } +} + + +/** + * @brief Wrap up transmission in non-blocking mode. + * @param huart pointer to a UART_HandleTypeDef structure that contains + * the configuration information for the specified UART module. + * @retval None + */ +static void UART_EndTransmit_IT(UART_HandleTypeDef *huart) +{ + /* Disable the UART Transmit Complete Interrupt */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_TCIE); + + /* Tx process is ended, restore huart->gState to Ready */ + huart->gState = HAL_UART_STATE_READY; + + /* Cleat TxISR function pointer */ + huart->TxISR = NULL; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Tx complete callback*/ + huart->TxCpltCallback(huart); +#else + /*Call legacy weak Tx complete callback*/ + HAL_UART_TxCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ +} + +/** + * @brief RX interrupt handler for 7 or 8 bits data word length . + * @param huart UART handle. + * @retval None + */ +static void UART_RxISR_8BIT(UART_HandleTypeDef *huart) +{ + uint16_t uhMask = huart->Mask; + uint16_t uhdata; + + /* Check that a Rx process is ongoing */ + if (huart->RxState == HAL_UART_STATE_BUSY_RX) + { + uhdata = (uint16_t) READ_REG(huart->Instance->RDR); + *huart->pRxBuffPtr = (uint8_t)(uhdata & (uint8_t)uhMask); + huart->pRxBuffPtr++; + huart->RxXferCount--; + + if (huart->RxXferCount == 0U) + { + /* Disable the UART Parity Error Interrupt and RXNE interrupts */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE)); + + /* Disable the UART Error Interrupt: (Frame error, noise error, overrun error) */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Rx process is completed, restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + + /* Clear RxISR function pointer */ + huart->RxISR = NULL; + + /* Initialize type of RxEvent to Transfer Complete */ + huart->RxEventType = HAL_UART_RXEVENT_TC; + + /* Check that USART RTOEN bit is set */ + if (READ_BIT(huart->Instance->CR2, USART_CR2_RTOEN) != 0U) + { + /* Enable the UART Receiver Timeout Interrupt */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_RTOIE); + } + + /* Check current reception Mode : + If Reception till IDLE event has been selected : */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + /* Set reception type to Standard */ + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Disable IDLE interrupt */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_IDLEIE); + + if (__HAL_UART_GET_FLAG(huart, UART_FLAG_IDLE) == SET) + { + /* Clear IDLE Flag */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF); + } + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx Event callback*/ + huart->RxEventCallback(huart, huart->RxXferSize); +#else + /*Call legacy weak Rx Event callback*/ + HAL_UARTEx_RxEventCallback(huart, huart->RxXferSize); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + else + { + /* Standard reception API called */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx complete callback*/ + huart->RxCpltCallback(huart); +#else + /*Call legacy weak Rx complete callback*/ + HAL_UART_RxCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + } + } + else + { + /* Clear RXNE interrupt flag */ + __HAL_UART_SEND_REQ(huart, UART_RXDATA_FLUSH_REQUEST); + } +} + +/** + * @brief RX interrupt handler for 9 bits data word length . + * @note Function is called under interruption only, once + * interruptions have been enabled by HAL_UART_Receive_IT() + * @param huart UART handle. + * @retval None + */ +static void UART_RxISR_16BIT(UART_HandleTypeDef *huart) +{ + uint16_t *tmp; + uint16_t uhMask = huart->Mask; + uint16_t uhdata; + + /* Check that a Rx process is ongoing */ + if (huart->RxState == HAL_UART_STATE_BUSY_RX) + { + uhdata = (uint16_t) READ_REG(huart->Instance->RDR); + tmp = (uint16_t *) huart->pRxBuffPtr ; + *tmp = (uint16_t)(uhdata & uhMask); + huart->pRxBuffPtr += 2U; + huart->RxXferCount--; + + if (huart->RxXferCount == 0U) + { + /* Disable the UART Parity Error Interrupt and RXNE interrupt*/ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, (USART_CR1_RXNEIE | USART_CR1_PEIE)); + + /* Disable the UART Error Interrupt: (Frame error, noise error, overrun error) */ + ATOMIC_CLEAR_BIT(huart->Instance->CR3, USART_CR3_EIE); + + /* Rx process is completed, restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + + /* Clear RxISR function pointer */ + huart->RxISR = NULL; + + /* Initialize type of RxEvent to Transfer Complete */ + huart->RxEventType = HAL_UART_RXEVENT_TC; + + /* Check that USART RTOEN bit is set */ + if (READ_BIT(huart->Instance->CR2, USART_CR2_RTOEN) != 0U) + { + /* Enable the UART Receiver Timeout Interrupt */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_RTOIE); + } + + /* Check current reception Mode : + If Reception till IDLE event has been selected : */ + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + /* Set reception type to Standard */ + huart->ReceptionType = HAL_UART_RECEPTION_STANDARD; + + /* Disable IDLE interrupt */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_IDLEIE); + + if (__HAL_UART_GET_FLAG(huart, UART_FLAG_IDLE) == SET) + { + /* Clear IDLE Flag */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF); + } + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx Event callback*/ + huart->RxEventCallback(huart, huart->RxXferSize); +#else + /*Call legacy weak Rx Event callback*/ + HAL_UARTEx_RxEventCallback(huart, huart->RxXferSize); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + else + { + /* Standard reception API called */ +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + /*Call registered Rx complete callback*/ + huart->RxCpltCallback(huart); +#else + /*Call legacy weak Rx complete callback*/ + HAL_UART_RxCpltCallback(huart); +#endif /* USE_HAL_UART_REGISTER_CALLBACKS */ + } + } + } + else + { + /* Clear RXNE interrupt flag */ + __HAL_UART_SEND_REQ(huart, UART_RXDATA_FLUSH_REQUEST); + } +} + + +/** + * @} + */ + +#endif /* HAL_UART_MODULE_ENABLED */ +/** + * @} + */ + +/** + * @} + */ + diff --git a/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c new file mode 100644 index 0000000..0aa30fe --- /dev/null +++ b/Software/Code/Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_uart_ex.c @@ -0,0 +1,775 @@ +/** + ****************************************************************************** + * @file stm32f3xx_hal_uart_ex.c + * @author MCD Application Team + * @brief Extended UART HAL module driver. + * This file provides firmware functions to manage the following extended + * functionalities of the Universal Asynchronous Receiver Transmitter Peripheral (UART). + * + Initialization and de-initialization functions + * + Peripheral Control functions + * + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2016 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### UART peripheral extended features ##### + ============================================================================== + + (#) Declare a UART_HandleTypeDef handle structure. + + (#) For the UART RS485 Driver Enable mode, initialize the UART registers + by calling the HAL_RS485Ex_Init() API. + + @endverbatim + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f3xx_hal.h" + +/** @addtogroup STM32F3xx_HAL_Driver + * @{ + */ + +/** @defgroup UARTEx UARTEx + * @brief UART Extended HAL module driver + * @{ + */ + +#ifdef HAL_UART_MODULE_ENABLED + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ + +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/** @defgroup UARTEx_Private_Functions UARTEx Private Functions + * @{ + */ +static void UARTEx_Wakeup_AddressConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection); +/** + * @} + */ + +/* Exported functions --------------------------------------------------------*/ + +/** @defgroup UARTEx_Exported_Functions UARTEx Exported Functions + * @{ + */ + +/** @defgroup UARTEx_Exported_Functions_Group1 Initialization and de-initialization functions + * @brief Extended Initialization and Configuration Functions + * +@verbatim +=============================================================================== + ##### Initialization and Configuration functions ##### + =============================================================================== + [..] + This subsection provides a set of functions allowing to initialize the USARTx or the UARTy + in asynchronous mode. + (+) For the asynchronous mode the parameters below can be configured: + (++) Baud Rate + (++) Word Length + (++) Stop Bit + (++) Parity: If the parity is enabled, then the MSB bit of the data written + in the data register is transmitted but is changed by the parity bit. + (++) Hardware flow control + (++) Receiver/transmitter modes + (++) Over Sampling Method + (++) One-Bit Sampling Method + (+) For the asynchronous mode, the following advanced features can be configured as well: + (++) TX and/or RX pin level inversion + (++) data logical level inversion + (++) RX and TX pins swap + (++) RX overrun detection disabling + (++) DMA disabling on RX error + (++) MSB first on communication line + (++) auto Baud rate detection + [..] + The HAL_RS485Ex_Init() API follows the UART RS485 mode configuration + procedures (details for the procedures are available in reference manual). + +@endverbatim + + Depending on the frame length defined by the M1 and M0 bits (7-bit, + 8-bit or 9-bit), the possible UART formats are listed in the + following table. + + Table 1. UART frame format. + +-----------------------------------------------------------------------+ + | M1 bit | M0 bit | PCE bit | UART frame | + |---------|---------|-----------|---------------------------------------| + | 0 | 0 | 0 | | SB | 8 bit data | STB | | + |---------|---------|-----------|---------------------------------------| + | 0 | 0 | 1 | | SB | 7 bit data | PB | STB | | + |---------|---------|-----------|---------------------------------------| + | 0 | 1 | 0 | | SB | 9 bit data | STB | | + |---------|---------|-----------|---------------------------------------| + | 0 | 1 | 1 | | SB | 8 bit data | PB | STB | | + |---------|---------|-----------|---------------------------------------| + | 1 | 0 | 0 | | SB | 7 bit data | STB | | + |---------|---------|-----------|---------------------------------------| + | 1 | 0 | 1 | | SB | 6 bit data | PB | STB | | + +-----------------------------------------------------------------------+ + + * @{ + */ + +/** + * @brief Initialize the RS485 Driver enable feature according to the specified + * parameters in the UART_InitTypeDef and creates the associated handle. + * @param huart UART handle. + * @param Polarity Select the driver enable polarity. + * This parameter can be one of the following values: + * @arg @ref UART_DE_POLARITY_HIGH DE signal is active high + * @arg @ref UART_DE_POLARITY_LOW DE signal is active low + * @param AssertionTime Driver Enable assertion time: + * 5-bit value defining the time between the activation of the DE (Driver Enable) + * signal and the beginning of the start bit. It is expressed in sample time + * units (1/8 or 1/16 bit time, depending on the oversampling rate) + * @param DeassertionTime Driver Enable deassertion time: + * 5-bit value defining the time between the end of the last stop bit, in a + * transmitted message, and the de-activation of the DE (Driver Enable) signal. + * It is expressed in sample time units (1/8 or 1/16 bit time, depending on the + * oversampling rate). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity, uint32_t AssertionTime, + uint32_t DeassertionTime) +{ + uint32_t temp; + + /* Check the UART handle allocation */ + if (huart == NULL) + { + return HAL_ERROR; + } + /* Check the Driver Enable UART instance */ + assert_param(IS_UART_DRIVER_ENABLE_INSTANCE(huart->Instance)); + + /* Check the Driver Enable polarity */ + assert_param(IS_UART_DE_POLARITY(Polarity)); + + /* Check the Driver Enable assertion time */ + assert_param(IS_UART_ASSERTIONTIME(AssertionTime)); + + /* Check the Driver Enable deassertion time */ + assert_param(IS_UART_DEASSERTIONTIME(DeassertionTime)); + + if (huart->gState == HAL_UART_STATE_RESET) + { + /* Allocate lock resource and initialize it */ + huart->Lock = HAL_UNLOCKED; + +#if (USE_HAL_UART_REGISTER_CALLBACKS == 1) + UART_InitCallbacksToDefault(huart); + + if (huart->MspInitCallback == NULL) + { + huart->MspInitCallback = HAL_UART_MspInit; + } + + /* Init the low level hardware */ + huart->MspInitCallback(huart); +#else + /* Init the low level hardware : GPIO, CLOCK, CORTEX */ + HAL_UART_MspInit(huart); +#endif /* (USE_HAL_UART_REGISTER_CALLBACKS) */ + } + + huart->gState = HAL_UART_STATE_BUSY; + + /* Disable the Peripheral */ + __HAL_UART_DISABLE(huart); + + /* Set the UART Communication parameters */ + if (UART_SetConfig(huart) == HAL_ERROR) + { + return HAL_ERROR; + } + + if (huart->AdvancedInit.AdvFeatureInit != UART_ADVFEATURE_NO_INIT) + { + UART_AdvFeatureConfig(huart); + } + + /* Enable the Driver Enable mode by setting the DEM bit in the CR3 register */ + SET_BIT(huart->Instance->CR3, USART_CR3_DEM); + + /* Set the Driver Enable polarity */ + MODIFY_REG(huart->Instance->CR3, USART_CR3_DEP, Polarity); + + /* Set the Driver Enable assertion and deassertion times */ + temp = (AssertionTime << UART_CR1_DEAT_ADDRESS_LSB_POS); + temp |= (DeassertionTime << UART_CR1_DEDT_ADDRESS_LSB_POS); + MODIFY_REG(huart->Instance->CR1, (USART_CR1_DEDT | USART_CR1_DEAT), temp); + + /* Enable the Peripheral */ + __HAL_UART_ENABLE(huart); + + /* TEACK and/or REACK to check before moving huart->gState and huart->RxState to Ready */ + return (UART_CheckIdleState(huart)); +} + +/** + * @} + */ + +/** @defgroup UARTEx_Exported_Functions_Group2 IO operation functions + * @brief Extended functions + * +@verbatim + =============================================================================== + ##### IO operation functions ##### + =============================================================================== + This subsection provides a set of Wakeup and FIFO mode related callback functions. + + (#) Wakeup from Stop mode Callback: + (+) HAL_UARTEx_WakeupCallback() + +@endverbatim + * @{ + */ + +/** + * @brief UART wakeup from Stop mode callback. + * @param huart UART handle. + * @retval None + */ +__weak void HAL_UARTEx_WakeupCallback(UART_HandleTypeDef *huart) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(huart); + + /* NOTE : This function should not be modified, when the callback is needed, + the HAL_UARTEx_WakeupCallback can be implemented in the user file. + */ +} + + +/** + * @} + */ + +/** @defgroup UARTEx_Exported_Functions_Group3 Peripheral Control functions + * @brief Extended Peripheral Control functions + * +@verbatim + =============================================================================== + ##### Peripheral Control functions ##### + =============================================================================== + [..] This section provides the following functions: + (+) HAL_MultiProcessorEx_AddressLength_Set() API optionally sets the UART node address + detection length to more than 4 bits for multiprocessor address mark wake up. + (+) HAL_UARTEx_StopModeWakeUpSourceConfig() API defines the wake-up from stop mode + trigger: address match, Start Bit detection or RXNE bit status. + (+) HAL_UARTEx_EnableStopMode() API enables the UART to wake up the MCU from stop mode + (+) HAL_UARTEx_DisableStopMode() API disables the above functionality + + [..] This subsection also provides a set of additional functions providing enhanced reception + services to user. (For example, these functions allow application to handle use cases + where number of data to be received is unknown). + + (#) Compared to standard reception services which only consider number of received + data elements as reception completion criteria, these functions also consider additional events + as triggers for updating reception status to caller : + (+) Detection of inactivity period (RX line has not been active for a given period). + (++) RX inactivity detected by IDLE event, i.e. RX line has been in idle state (normally high state) + for 1 frame time, after last received byte. + (++) RX inactivity detected by RTO, i.e. line has been in idle state + for a programmable time, after last received byte. + (+) Detection that a specific character has been received. + + (#) There are two mode of transfer: + (+) Blocking mode: The reception is performed in polling mode, until either expected number of data is received, + or till IDLE event occurs. Reception is handled only during function execution. + When function exits, no data reception could occur. HAL status and number of actually received data elements, + are returned by function after finishing transfer. + (+) Non-Blocking mode: The reception is performed using Interrupts or DMA. + These API's return the HAL status. + The end of the data processing will be indicated through the + dedicated UART IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. + The HAL_UARTEx_RxEventCallback() user callback will be executed during Receive process + The HAL_UART_ErrorCallback()user callback will be executed when a reception error is detected. + + (#) Blocking mode API: + (+) HAL_UARTEx_ReceiveToIdle() + + (#) Non-Blocking mode API with Interrupt: + (+) HAL_UARTEx_ReceiveToIdle_IT() + + (#) Non-Blocking mode API with DMA: + (+) HAL_UARTEx_ReceiveToIdle_DMA() + +@endverbatim + * @{ + */ + +/** + * @brief By default in multiprocessor mode, when the wake up method is set + * to address mark, the UART handles only 4-bit long addresses detection; + * this API allows to enable longer addresses detection (6-, 7- or 8-bit + * long). + * @note Addresses detection lengths are: 6-bit address detection in 7-bit data mode, + * 7-bit address detection in 8-bit data mode, 8-bit address detection in 9-bit data mode. + * @param huart UART handle. + * @param AddressLength This parameter can be one of the following values: + * @arg @ref UART_ADDRESS_DETECT_4B 4-bit long address + * @arg @ref UART_ADDRESS_DETECT_7B 6-, 7- or 8-bit long address + * @retval HAL status + */ +HAL_StatusTypeDef HAL_MultiProcessorEx_AddressLength_Set(UART_HandleTypeDef *huart, uint32_t AddressLength) +{ + /* Check the UART handle allocation */ + if (huart == NULL) + { + return HAL_ERROR; + } + + /* Check the address length parameter */ + assert_param(IS_UART_ADDRESSLENGTH_DETECT(AddressLength)); + + huart->gState = HAL_UART_STATE_BUSY; + + /* Disable the Peripheral */ + __HAL_UART_DISABLE(huart); + + /* Set the address length */ + MODIFY_REG(huart->Instance->CR2, USART_CR2_ADDM7, AddressLength); + + /* Enable the Peripheral */ + __HAL_UART_ENABLE(huart); + + /* TEACK and/or REACK to check before moving huart->gState to Ready */ + return (UART_CheckIdleState(huart)); +} + +/** + * @brief Set Wakeup from Stop mode interrupt flag selection. + * @note It is the application responsibility to enable the interrupt used as + * usart_wkup interrupt source before entering low-power mode. + * @param huart UART handle. + * @param WakeUpSelection Address match, Start Bit detection or RXNE/RXFNE bit status. + * This parameter can be one of the following values: + * @arg @ref UART_WAKEUP_ON_ADDRESS + * @arg @ref UART_WAKEUP_ON_STARTBIT + * @arg @ref UART_WAKEUP_ON_READDATA_NONEMPTY + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UARTEx_StopModeWakeUpSourceConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t tickstart; + + /* check the wake-up from stop mode UART instance */ + assert_param(IS_UART_WAKEUP_FROMSTOP_INSTANCE(huart->Instance)); + /* check the wake-up selection parameter */ + assert_param(IS_UART_WAKEUP_SELECTION(WakeUpSelection.WakeUpEvent)); + + /* Process Locked */ + __HAL_LOCK(huart); + + huart->gState = HAL_UART_STATE_BUSY; + + /* Disable the Peripheral */ + __HAL_UART_DISABLE(huart); + + /* Set the wake-up selection scheme */ + MODIFY_REG(huart->Instance->CR3, USART_CR3_WUS, WakeUpSelection.WakeUpEvent); + + if (WakeUpSelection.WakeUpEvent == UART_WAKEUP_ON_ADDRESS) + { + UARTEx_Wakeup_AddressConfig(huart, WakeUpSelection); + } + + /* Enable the Peripheral */ + __HAL_UART_ENABLE(huart); + + /* Init tickstart for timeout management */ + tickstart = HAL_GetTick(); + + /* Wait until REACK flag is set */ + if (UART_WaitOnFlagUntilTimeout(huart, USART_ISR_REACK, RESET, tickstart, HAL_UART_TIMEOUT_VALUE) != HAL_OK) + { + status = HAL_TIMEOUT; + } + else + { + /* Initialize the UART State */ + huart->gState = HAL_UART_STATE_READY; + } + + /* Process Unlocked */ + __HAL_UNLOCK(huart); + + return status; +} + +/** + * @brief Enable UART Stop Mode. + * @note The UART is able to wake up the MCU from Stop 1 mode as long as UART clock is HSI or LSE. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UARTEx_EnableStopMode(UART_HandleTypeDef *huart) +{ + /* Process Locked */ + __HAL_LOCK(huart); + + /* Set UESM bit */ + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_UESM); + + /* Process Unlocked */ + __HAL_UNLOCK(huart); + + return HAL_OK; +} + +/** + * @brief Disable UART Stop Mode. + * @param huart UART handle. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UARTEx_DisableStopMode(UART_HandleTypeDef *huart) +{ + /* Process Locked */ + __HAL_LOCK(huart); + + /* Clear UESM bit */ + ATOMIC_CLEAR_BIT(huart->Instance->CR1, USART_CR1_UESM); + + /* Process Unlocked */ + __HAL_UNLOCK(huart); + + return HAL_OK; +} + +/** + * @brief Receive an amount of data in blocking mode till either the expected number of data + * is received or an IDLE event occurs. + * @note HAL_OK is returned if reception is completed (expected number of data has been received) + * or if reception is stopped after IDLE event (less than the expected number of data has been received) + * In this case, RxLen output parameter indicates number of data available in reception buffer. + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the received data is handled as a set of uint16_t. In this case, Size must indicate the number + * of uint16_t available through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (uint8_t or uint16_t data elements). + * @param Size Amount of data elements (uint8_t or uint16_t) to be received. + * @param RxLen Number of data elements finally received + * (could be lower than Size, in case reception ends on IDLE event) + * @param Timeout Timeout duration expressed in ms (covers the whole reception sequence). + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint16_t *RxLen, + uint32_t Timeout) +{ + uint8_t *pdata8bits; + uint16_t *pdata16bits; + uint16_t uhMask; + uint32_t tickstart; + + /* Check that a Rx process is not already ongoing */ + if (huart->RxState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + huart->ErrorCode = HAL_UART_ERROR_NONE; + huart->RxState = HAL_UART_STATE_BUSY_RX; + huart->ReceptionType = HAL_UART_RECEPTION_TOIDLE; + huart->RxEventType = HAL_UART_RXEVENT_TC; + + /* Init tickstart for timeout management */ + tickstart = HAL_GetTick(); + + huart->RxXferSize = Size; + huart->RxXferCount = Size; + + /* Computation of UART mask to apply to RDR register */ + UART_MASK_COMPUTATION(huart); + uhMask = huart->Mask; + + /* In case of 9bits/No Parity transfer, pRxData needs to be handled as a uint16_t pointer */ + if ((huart->Init.WordLength == UART_WORDLENGTH_9B) && (huart->Init.Parity == UART_PARITY_NONE)) + { + pdata8bits = NULL; + pdata16bits = (uint16_t *) pData; + } + else + { + pdata8bits = pData; + pdata16bits = NULL; + } + + /* Initialize output number of received elements */ + *RxLen = 0U; + + /* as long as data have to be received */ + while (huart->RxXferCount > 0U) + { + /* Check if IDLE flag is set */ + if (__HAL_UART_GET_FLAG(huart, UART_FLAG_IDLE)) + { + /* Clear IDLE flag in ISR */ + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF); + + /* If Set, but no data ever received, clear flag without exiting loop */ + /* If Set, and data has already been received, this means Idle Event is valid : End reception */ + if (*RxLen > 0U) + { + huart->RxEventType = HAL_UART_RXEVENT_IDLE; + huart->RxState = HAL_UART_STATE_READY; + + return HAL_OK; + } + } + + /* Check if RXNE flag is set */ + if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RXNE)) + { + if (pdata8bits == NULL) + { + *pdata16bits = (uint16_t)(huart->Instance->RDR & uhMask); + pdata16bits++; + } + else + { + *pdata8bits = (uint8_t)(huart->Instance->RDR & (uint8_t)uhMask); + pdata8bits++; + } + /* Increment number of received elements */ + *RxLen += 1U; + huart->RxXferCount--; + } + + /* Check for the Timeout */ + if (Timeout != HAL_MAX_DELAY) + { + if (((HAL_GetTick() - tickstart) > Timeout) || (Timeout == 0U)) + { + huart->RxState = HAL_UART_STATE_READY; + + return HAL_TIMEOUT; + } + } + } + + /* Set number of received elements in output parameter : RxLen */ + *RxLen = huart->RxXferSize - huart->RxXferCount; + /* At end of Rx process, restore huart->RxState to Ready */ + huart->RxState = HAL_UART_STATE_READY; + + return HAL_OK; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive an amount of data in interrupt mode till either the expected number of data + * is received or an IDLE event occurs. + * @note Reception is initiated by this function call. Further progress of reception is achieved thanks + * to UART interrupts raised by RXNE and IDLE events. Callback is called at end of reception indicating + * number of received data elements. + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the received data is handled as a set of uint16_t. In this case, Size must indicate the number + * of uint16_t available through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (uint8_t or uint16_t data elements). + * @param Size Amount of data elements (uint8_t or uint16_t) to be received. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) +{ + HAL_StatusTypeDef status; + + /* Check that a Rx process is not already ongoing */ + if (huart->RxState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + /* Set Reception type to reception till IDLE Event*/ + huart->ReceptionType = HAL_UART_RECEPTION_TOIDLE; + huart->RxEventType = HAL_UART_RXEVENT_TC; + + status = UART_Start_Receive_IT(huart, pData, Size); + + /* Check Rx process has been successfully started */ + if (status == HAL_OK) + { + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF); + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_IDLEIE); + } + else + { + /* In case of errors already pending when reception is started, + Interrupts may have already been raised and lead to reception abortion. + (Overrun error for instance). + In such case Reception Type has been reset to HAL_UART_RECEPTION_STANDARD. */ + status = HAL_ERROR; + } + } + + return status; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Receive an amount of data in DMA mode till either the expected number + * of data is received or an IDLE event occurs. + * @note Reception is initiated by this function call. Further progress of reception is achieved thanks + * to DMA services, transferring automatically received data elements in user reception buffer and + * calling registered callbacks at half/end of reception. UART IDLE events are also used to consider + * reception phase as ended. In all cases, callback execution will indicate number of received data elements. + * @note When the UART parity is enabled (PCE = 1), the received data contain + * the parity bit (MSB position). + * @note When UART parity is not enabled (PCE = 0), and Word Length is configured to 9 bits (M1-M0 = 01), + * the received data is handled as a set of uint16_t. In this case, Size must indicate the number + * of uint16_t available through pData. + * @param huart UART handle. + * @param pData Pointer to data buffer (uint8_t or uint16_t data elements). + * @param Size Amount of data elements (uint8_t or uint16_t) to be received. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) +{ + HAL_StatusTypeDef status; + + /* Check that a Rx process is not already ongoing */ + if (huart->RxState == HAL_UART_STATE_READY) + { + if ((pData == NULL) || (Size == 0U)) + { + return HAL_ERROR; + } + + /* Set Reception type to reception till IDLE Event*/ + huart->ReceptionType = HAL_UART_RECEPTION_TOIDLE; + huart->RxEventType = HAL_UART_RXEVENT_TC; + + status = UART_Start_Receive_DMA(huart, pData, Size); + + /* Check Rx process has been successfully started */ + if (status == HAL_OK) + { + if (huart->ReceptionType == HAL_UART_RECEPTION_TOIDLE) + { + __HAL_UART_CLEAR_FLAG(huart, UART_CLEAR_IDLEF); + ATOMIC_SET_BIT(huart->Instance->CR1, USART_CR1_IDLEIE); + } + else + { + /* In case of errors already pending when reception is started, + Interrupts may have already been raised and lead to reception abortion. + (Overrun error for instance). + In such case Reception Type has been reset to HAL_UART_RECEPTION_STANDARD. */ + status = HAL_ERROR; + } + } + + return status; + } + else + { + return HAL_BUSY; + } +} + +/** + * @brief Provide Rx Event type that has lead to RxEvent callback execution. + * @note When HAL_UARTEx_ReceiveToIdle_IT() or HAL_UARTEx_ReceiveToIdle_DMA() API are called, progress + * of reception process is provided to application through calls of Rx Event callback (either default one + * HAL_UARTEx_RxEventCallback() or user registered one). As several types of events could occur (IDLE event, + * Half Transfer, or Transfer Complete), this function allows to retrieve the Rx Event type that has lead + * to Rx Event callback execution. + * @note This function is expected to be called within the user implementation of Rx Event Callback, + * in order to provide the accurate value : + * In Interrupt Mode : + * - HAL_UART_RXEVENT_TC : when Reception has been completed (expected nb of data has been received) + * - HAL_UART_RXEVENT_IDLE : when Idle event occurred prior reception has been completed (nb of + * received data is lower than expected one) + * In DMA Mode : + * - HAL_UART_RXEVENT_TC : when Reception has been completed (expected nb of data has been received) + * - HAL_UART_RXEVENT_HT : when half of expected nb of data has been received + * - HAL_UART_RXEVENT_IDLE : when Idle event occurred prior reception has been completed (nb of + * received data is lower than expected one). + * In DMA mode, RxEvent callback could be called several times; + * When DMA is configured in Normal Mode, HT event does not stop Reception process; + * When DMA is configured in Circular Mode, HT, TC or IDLE events don't stop Reception process; + * @param huart UART handle. + * @retval Rx Event Type (return vale will be a value of @ref UART_RxEvent_Type_Values) + */ +HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(UART_HandleTypeDef *huart) +{ + /* Return Rx Event type value, as stored in UART handle */ + return (huart->RxEventType); +} + +/** + * @} + */ + +/** + * @} + */ + +/** @addtogroup UARTEx_Private_Functions + * @{ + */ + +/** + * @brief Initialize the UART wake-up from stop mode parameters when triggered by address detection. + * @param huart UART handle. + * @param WakeUpSelection UART wake up from stop mode parameters. + * @retval None + */ +static void UARTEx_Wakeup_AddressConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection) +{ + assert_param(IS_UART_ADDRESSLENGTH_DETECT(WakeUpSelection.AddressLength)); + + /* Set the USART address length */ + MODIFY_REG(huart->Instance->CR2, USART_CR2_ADDM7, WakeUpSelection.AddressLength); + + /* Set the USART address node */ + MODIFY_REG(huart->Instance->CR2, USART_CR2_ADD, ((uint32_t)WakeUpSelection.Address << UART_CR2_ADDRESS_LSB_POS)); +} + +/** + * @} + */ + +#endif /* HAL_UART_MODULE_ENABLED */ + +/** + * @} + */ + +/** + * @} + */ + diff --git a/Software/Code/PDU_FT25.ioc b/Software/Code/PDU_FT25.ioc new file mode 100644 index 0000000..2922a6b --- /dev/null +++ b/Software/Code/PDU_FT25.ioc @@ -0,0 +1,467 @@ +#MicroXplorer Configuration settings - do not modify +ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_2 +ADC1.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC1.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC1.Channel-3\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC1.Channel-4\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC1.Channel-5\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC1.Channel-6\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC1.Channel-7\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC1.DMAContinuousRequests=ENABLE +ADC1.EOCSelection=ADC_EOC_SEQ_CONV +ADC1.ExternalTrigConv=ADC_EXTERNALTRIGCONV_T6_TRGO +ADC1.ExternalTrigConvEdge=ADC_EXTERNALTRIGCONVEDGE_RISING +ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,Offset-0\#ChannelRegularConversion,NbrOfConversionFlag,master,EOCSelection,DMAContinuousRequests,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,SamplingTimeOPAMP-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,Offset-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,SamplingTimeOPAMP-2\#ChannelRegularConversion,OffsetNumber-2\#ChannelRegularConversion,Offset-2\#ChannelRegularConversion,Rank-3\#ChannelRegularConversion,Channel-3\#ChannelRegularConversion,SamplingTime-3\#ChannelRegularConversion,SamplingTimeOPAMP-3\#ChannelRegularConversion,OffsetNumber-3\#ChannelRegularConversion,Offset-3\#ChannelRegularConversion,Rank-4\#ChannelRegularConversion,Channel-4\#ChannelRegularConversion,SamplingTime-4\#ChannelRegularConversion,SamplingTimeOPAMP-4\#ChannelRegularConversion,OffsetNumber-4\#ChannelRegularConversion,Offset-4\#ChannelRegularConversion,Rank-5\#ChannelRegularConversion,Channel-5\#ChannelRegularConversion,SamplingTime-5\#ChannelRegularConversion,SamplingTimeOPAMP-5\#ChannelRegularConversion,OffsetNumber-5\#ChannelRegularConversion,Offset-5\#ChannelRegularConversion,Rank-6\#ChannelRegularConversion,Channel-6\#ChannelRegularConversion,SamplingTime-6\#ChannelRegularConversion,SamplingTimeOPAMP-6\#ChannelRegularConversion,OffsetNumber-6\#ChannelRegularConversion,Offset-6\#ChannelRegularConversion,Rank-7\#ChannelRegularConversion,Channel-7\#ChannelRegularConversion,SamplingTime-7\#ChannelRegularConversion,SamplingTimeOPAMP-7\#ChannelRegularConversion,OffsetNumber-7\#ChannelRegularConversion,Offset-7\#ChannelRegularConversion,NbrOfConversion,ExternalTrigConv,ExternalTrigConvEdge +ADC1.NbrOfConversion=8 +ADC1.NbrOfConversionFlag=1 +ADC1.Offset-0\#ChannelRegularConversion=0 +ADC1.Offset-1\#ChannelRegularConversion=0 +ADC1.Offset-2\#ChannelRegularConversion=0 +ADC1.Offset-3\#ChannelRegularConversion=0 +ADC1.Offset-4\#ChannelRegularConversion=0 +ADC1.Offset-5\#ChannelRegularConversion=0 +ADC1.Offset-6\#ChannelRegularConversion=0 +ADC1.Offset-7\#ChannelRegularConversion=0 +ADC1.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-1\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-2\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-3\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-4\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-5\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-6\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.OffsetNumber-7\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC1.Rank-0\#ChannelRegularConversion=1 +ADC1.Rank-1\#ChannelRegularConversion=2 +ADC1.Rank-2\#ChannelRegularConversion=3 +ADC1.Rank-3\#ChannelRegularConversion=4 +ADC1.Rank-4\#ChannelRegularConversion=5 +ADC1.Rank-5\#ChannelRegularConversion=6 +ADC1.Rank-6\#ChannelRegularConversion=7 +ADC1.Rank-7\#ChannelRegularConversion=8 +ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC1.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC1.SamplingTime-2\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC1.SamplingTime-3\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC1.SamplingTime-4\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC1.SamplingTime-5\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC1.SamplingTime-6\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC1.SamplingTime-7\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC1.SamplingTimeOPAMP-1\#ChannelRegularConversion=ADC_SAMPLETIME_61CYCLES_5 +ADC1.SamplingTimeOPAMP-2\#ChannelRegularConversion=ADC_SAMPLETIME_61CYCLES_5 +ADC1.SamplingTimeOPAMP-3\#ChannelRegularConversion=ADC_SAMPLETIME_61CYCLES_5 +ADC1.SamplingTimeOPAMP-4\#ChannelRegularConversion=ADC_SAMPLETIME_61CYCLES_5 +ADC1.SamplingTimeOPAMP-5\#ChannelRegularConversion=ADC_SAMPLETIME_61CYCLES_5 +ADC1.SamplingTimeOPAMP-6\#ChannelRegularConversion=ADC_SAMPLETIME_61CYCLES_5 +ADC1.SamplingTimeOPAMP-7\#ChannelRegularConversion=ADC_SAMPLETIME_61CYCLES_5 +ADC1.master=1 +ADC2.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC2.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC2.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC2.Channel-3\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC2.Channel-4\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC2.Channel-5\#ChannelRegularConversion=ADC_CHANNEL_1 +ADC2.DMAContinuousRequests=ENABLE +ADC2.EOCSelection=ADC_EOC_SEQ_CONV +ADC2.ExternalTrigConv=ADC_EXTERNALTRIGCONV_T6_TRGO +ADC2.ExternalTrigConvEdge=ADC_EXTERNALTRIGCONVEDGE_RISING +ADC2.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,Offset-0\#ChannelRegularConversion,NbrOfConversionFlag,DMAContinuousRequests,EOCSelection,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,Offset-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,OffsetNumber-2\#ChannelRegularConversion,Offset-2\#ChannelRegularConversion,Rank-3\#ChannelRegularConversion,Channel-3\#ChannelRegularConversion,SamplingTime-3\#ChannelRegularConversion,OffsetNumber-3\#ChannelRegularConversion,Offset-3\#ChannelRegularConversion,Rank-4\#ChannelRegularConversion,Channel-4\#ChannelRegularConversion,SamplingTime-4\#ChannelRegularConversion,OffsetNumber-4\#ChannelRegularConversion,Offset-4\#ChannelRegularConversion,Rank-5\#ChannelRegularConversion,Channel-5\#ChannelRegularConversion,SamplingTime-5\#ChannelRegularConversion,OffsetNumber-5\#ChannelRegularConversion,Offset-5\#ChannelRegularConversion,NbrOfConversion,ExternalTrigConv,ExternalTrigConvEdge +ADC2.NbrOfConversion=6 +ADC2.NbrOfConversionFlag=1 +ADC2.Offset-0\#ChannelRegularConversion=0 +ADC2.Offset-1\#ChannelRegularConversion=0 +ADC2.Offset-2\#ChannelRegularConversion=0 +ADC2.Offset-3\#ChannelRegularConversion=0 +ADC2.Offset-4\#ChannelRegularConversion=0 +ADC2.Offset-5\#ChannelRegularConversion=0 +ADC2.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC2.OffsetNumber-1\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC2.OffsetNumber-2\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC2.OffsetNumber-3\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC2.OffsetNumber-4\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC2.OffsetNumber-5\#ChannelRegularConversion=ADC_OFFSET_NONE +ADC2.Rank-0\#ChannelRegularConversion=1 +ADC2.Rank-1\#ChannelRegularConversion=2 +ADC2.Rank-2\#ChannelRegularConversion=3 +ADC2.Rank-3\#ChannelRegularConversion=4 +ADC2.Rank-4\#ChannelRegularConversion=5 +ADC2.Rank-5\#ChannelRegularConversion=6 +ADC2.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC2.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC2.SamplingTime-2\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC2.SamplingTime-3\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC2.SamplingTime-4\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +ADC2.SamplingTime-5\#ChannelRegularConversion=ADC_SAMPLETIME_1CYCLE_5 +CAD.formats= +CAD.pinconfig= +CAD.provider= +CAN.BS1=CAN_BS1_13TQ +CAN.BS2=CAN_BS2_2TQ +CAN.CalculateBaudRate=1000000 +CAN.CalculateTimeBit=1000 +CAN.CalculateTimeQuantum=62.5 +CAN.IPParameters=CalculateTimeQuantum,CalculateTimeBit,CalculateBaudRate,Prescaler,BS1,BS2 +CAN.Prescaler=1 +Dma.ADC1.0.Direction=DMA_PERIPH_TO_MEMORY +Dma.ADC1.0.Instance=DMA1_Channel1 +Dma.ADC1.0.MemDataAlignment=DMA_MDATAALIGN_HALFWORD +Dma.ADC1.0.MemInc=DMA_MINC_ENABLE +Dma.ADC1.0.Mode=DMA_CIRCULAR +Dma.ADC1.0.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD +Dma.ADC1.0.PeriphInc=DMA_PINC_DISABLE +Dma.ADC1.0.Priority=DMA_PRIORITY_LOW +Dma.ADC1.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority +Dma.ADC2.1.Direction=DMA_PERIPH_TO_MEMORY +Dma.ADC2.1.Instance=DMA2_Channel1 +Dma.ADC2.1.MemDataAlignment=DMA_MDATAALIGN_HALFWORD +Dma.ADC2.1.MemInc=DMA_MINC_ENABLE +Dma.ADC2.1.Mode=DMA_CIRCULAR +Dma.ADC2.1.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD +Dma.ADC2.1.PeriphInc=DMA_PINC_DISABLE +Dma.ADC2.1.Priority=DMA_PRIORITY_LOW +Dma.ADC2.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority +Dma.Request0=ADC1 +Dma.Request1=ADC2 +Dma.RequestsNb=2 +File.Version=6 +GPIO.groupedBy=Group By Peripherals +KeepUserPlacement=false +Mcu.CPN=STM32F302RBT6 +Mcu.Family=STM32F3 +Mcu.IP0=ADC1 +Mcu.IP1=ADC2 +Mcu.IP2=CAN +Mcu.IP3=DMA +Mcu.IP4=NVIC +Mcu.IP5=RCC +Mcu.IP6=SYS +Mcu.IP7=TIM6 +Mcu.IP8=UART4 +Mcu.IPNb=9 +Mcu.Name=STM32F302R(B-C)Tx +Mcu.Package=LQFP64 +Mcu.Pin0=PF0-OSC_IN +Mcu.Pin1=PF1-OSC_OUT +Mcu.Pin10=PF4 +Mcu.Pin11=PA4 +Mcu.Pin12=PA5 +Mcu.Pin13=PA6 +Mcu.Pin14=PA7 +Mcu.Pin15=PC4 +Mcu.Pin16=PB0 +Mcu.Pin17=PB1 +Mcu.Pin18=PB10 +Mcu.Pin19=PB11 +Mcu.Pin2=PC0 +Mcu.Pin20=PB12 +Mcu.Pin21=PB13 +Mcu.Pin22=PB14 +Mcu.Pin23=PB15 +Mcu.Pin24=PC6 +Mcu.Pin25=PC7 +Mcu.Pin26=PC8 +Mcu.Pin27=PC9 +Mcu.Pin28=PA8 +Mcu.Pin29=PA9 +Mcu.Pin3=PC1 +Mcu.Pin30=PA10 +Mcu.Pin31=PA11 +Mcu.Pin32=PA12 +Mcu.Pin33=PA13 +Mcu.Pin34=PA14 +Mcu.Pin35=PC10 +Mcu.Pin36=PC11 +Mcu.Pin37=PB3 +Mcu.Pin38=PB4 +Mcu.Pin39=PB5 +Mcu.Pin4=PC2 +Mcu.Pin40=PB6 +Mcu.Pin41=PB8 +Mcu.Pin42=PB9 +Mcu.Pin43=VP_SYS_VS_Systick +Mcu.Pin44=VP_TIM6_VS_ClockSourceINT +Mcu.Pin5=PC3 +Mcu.Pin6=PA0 +Mcu.Pin7=PA1 +Mcu.Pin8=PA2 +Mcu.Pin9=PA3 +Mcu.PinsNb=45 +Mcu.ThirdPartyNb=0 +Mcu.UserConstants= +Mcu.UserName=STM32F302RBTx +MxCube.Version=6.11.1 +MxDb.Version=DB.6.0.111 +NVIC.ADC1_2_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true +NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true +NVIC.DMA2_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true +NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.ForceEnableDMAVector=true +NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 +NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false +NVIC.TIM6_DAC_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true +NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false +PA0.GPIOParameters=GPIO_Label +PA0.GPIO_Label=ASMS_Vsense +PA0.Locked=true +PA0.Mode=IN1-Single-Ended +PA0.Signal=ADC1_IN1 +PA1.GPIOParameters=GPIO_Label +PA1.GPIO_Label=IS1 +PA1.Locked=true +PA1.Mode=IN2-Single-Ended +PA1.Signal=ADC1_IN2 +PA10.GPIOParameters=GPIO_Label +PA10.GPIO_Label=IN6 +PA10.Locked=true +PA10.Signal=GPIO_Output +PA11.Locked=true +PA11.Mode=CAN_Activate +PA11.Signal=CAN_RX +PA12.Locked=true +PA12.Mode=CAN_Activate +PA12.Signal=CAN_TX +PA13.Locked=true +PA13.Mode=Trace_Asynchronous_SW +PA13.Signal=SYS_JTMS-SWDIO +PA14.Locked=true +PA14.Mode=Trace_Asynchronous_SW +PA14.Signal=SYS_JTCK-SWCLK +PA2.GPIOParameters=GPIO_Label +PA2.GPIO_Label=IS2 +PA2.Locked=true +PA2.Mode=IN3-Single-Ended +PA2.Signal=ADC1_IN3 +PA3.GPIOParameters=GPIO_Label +PA3.GPIO_Label=IS9 +PA3.Locked=true +PA3.Mode=IN4-Single-Ended +PA3.Signal=ADC1_IN4 +PA4.GPIOParameters=GPIO_Label +PA4.GPIO_Label=IS3 +PA4.Locked=true +PA4.Mode=IN1-Single-Ended +PA4.Signal=ADC2_IN1 +PA5.GPIOParameters=GPIO_Label +PA5.GPIO_Label=IS8 +PA5.Locked=true +PA5.Mode=IN2-Single-Ended +PA5.Signal=ADC2_IN2 +PA6.GPIOParameters=GPIO_Label +PA6.GPIO_Label=IS4 +PA6.Locked=true +PA6.Mode=IN3-Single-Ended +PA6.Signal=ADC2_IN3 +PA7.GPIOParameters=GPIO_Label +PA7.GPIO_Label=IS5 +PA7.Locked=true +PA7.Mode=IN4-Single-Ended +PA7.Signal=ADC2_IN4 +PA8.GPIOParameters=GPIO_Label +PA8.GPIO_Label=IN2 +PA8.Locked=true +PA8.Signal=GPIO_Output +PA9.GPIOParameters=GPIO_Label +PA9.GPIO_Label=IN1 +PA9.Locked=true +PA9.Signal=GPIO_Output +PB0.GPIOParameters=GPIO_Label +PB0.GPIO_Label=IN11 +PB0.Locked=true +PB0.Signal=GPIO_Output +PB1.GPIOParameters=GPIO_Label +PB1.GPIO_Label=IN12 +PB1.Locked=true +PB1.Signal=GPIO_Output +PB10.GPIOParameters=GPIO_Label +PB10.GPIO_Label=IN13 +PB10.Locked=true +PB10.Signal=GPIO_Output +PB11.GPIOParameters=GPIO_Label +PB11.GPIO_Label=IN9 +PB11.Locked=true +PB11.Signal=GPIO_Output +PB12.GPIOParameters=GPIO_Label +PB12.GPIO_Label=IN3 +PB12.Locked=true +PB12.Signal=GPIO_Output +PB13.GPIOParameters=GPIO_Label +PB13.GPIO_Label=IN8 +PB13.Locked=true +PB13.Signal=GPIO_Output +PB14.GPIOParameters=GPIO_Label +PB14.GPIO_Label=IN5 +PB14.Locked=true +PB14.Signal=GPIO_Output +PB15.GPIOParameters=GPIO_Label +PB15.GPIO_Label=IN4 +PB15.Locked=true +PB15.Signal=GPIO_Output +PB3.Mode=Trace_Asynchronous_SW +PB3.Signal=SYS_JTDO-TRACESWO +PB4.GPIOParameters=GPIO_Label +PB4.GPIO_Label=DSEL0 +PB4.Locked=true +PB4.Signal=GPIO_Output +PB5.GPIOParameters=GPIO_Label +PB5.GPIO_Label=DSEL1 +PB5.Locked=true +PB5.Signal=GPIO_Output +PB6.GPIOParameters=GPIO_Label +PB6.GPIO_Label=PC_EN +PB6.Locked=true +PB6.Signal=GPIO_Output +PB8.GPIOParameters=GPIO_Label +PB8.GPIO_Label=IN7 +PB8.Locked=true +PB8.Signal=GPIO_Output +PB9.GPIOParameters=GPIO_Label +PB9.GPIO_Label=IN10 +PB9.Locked=true +PB9.Signal=GPIO_Output +PC0.GPIOParameters=GPIO_Label +PC0.GPIO_Label=LVMS_Vsense +PC0.Locked=true +PC0.Signal=ADCx_IN6 +PC1.GPIOParameters=GPIO_Label +PC1.GPIO_Label=IS10 +PC1.Locked=true +PC1.Signal=ADCx_IN7 +PC10.Locked=true +PC10.Mode=Asynchronous +PC10.Signal=UART4_TX +PC11.Locked=true +PC11.Mode=Asynchronous +PC11.Signal=UART4_RX +PC2.GPIOParameters=GPIO_Label +PC2.GPIO_Label=IS6 +PC2.Locked=true +PC2.Signal=ADCx_IN8 +PC3.GPIOParameters=GPIO_Label +PC3.GPIO_Label=IS7 +PC3.Locked=true +PC3.Signal=ADCx_IN9 +PC4.GPIOParameters=GPIO_Label +PC4.GPIO_Label=PC_Read +PC4.Locked=true +PC4.Mode=IN5-Single-Ended +PC4.Signal=ADC2_IN5 +PC6.GPIOParameters=GPIO_Label +PC6.GPIO_Label=LED4 +PC6.Locked=true +PC6.Signal=GPIO_Output +PC7.GPIOParameters=GPIO_Label +PC7.GPIO_Label=LED3 +PC7.Locked=true +PC7.Signal=GPIO_Output +PC8.GPIOParameters=GPIO_Label +PC8.GPIO_Label=LED2 +PC8.Locked=true +PC8.Signal=GPIO_Output +PC9.GPIOParameters=GPIO_Label +PC9.GPIO_Label=LED1 +PC9.Locked=true +PC9.Signal=GPIO_Output +PF0-OSC_IN.Locked=true +PF0-OSC_IN.Mode=HSE-External-Oscillator +PF0-OSC_IN.Signal=RCC_OSC_IN +PF1-OSC_OUT.Locked=true +PF1-OSC_OUT.Mode=HSE-External-Oscillator +PF1-OSC_OUT.Signal=RCC_OSC_OUT +PF4.GPIOParameters=GPIO_Label +PF4.GPIO_Label=IS11 +PF4.Locked=true +PF4.Mode=IN5-Single-Ended +PF4.Signal=ADC1_IN5 +PinOutPanel.RotationAngle=0 +ProjectManager.AskForMigrate=true +ProjectManager.BackupPrevious=false +ProjectManager.CompilerOptimize=6 +ProjectManager.ComputerToolchain=false +ProjectManager.CoupleFile=false +ProjectManager.CustomerFirmwarePackage= +ProjectManager.DefaultFWLocation=true +ProjectManager.DeletePrevious=true +ProjectManager.DeviceId=STM32F302RBTx +ProjectManager.FirmwarePackage=STM32Cube FW_F3 V1.11.4 +ProjectManager.FreePins=false +ProjectManager.HalAssertFull=false +ProjectManager.HeapSize=0x200 +ProjectManager.KeepUserCode=true +ProjectManager.LastFirmware=true +ProjectManager.LibraryCopy=1 +ProjectManager.MainLocation=Core/Src +ProjectManager.NoMain=false +ProjectManager.PreviousToolchain=STM32CubeIDE +ProjectManager.ProjectBuild=false +ProjectManager.ProjectFileName=PDU_FT25.ioc +ProjectManager.ProjectName=PDU_FT25 +ProjectManager.ProjectStructure= +ProjectManager.RegisterCallBack= +ProjectManager.StackSize=0x400 +ProjectManager.TargetToolchain=STM32CubeIDE +ProjectManager.ToolChainLocation= +ProjectManager.UAScriptAfterPath= +ProjectManager.UAScriptBeforePath= +ProjectManager.UnderRoot=true +ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_ADC1_Init-ADC1-false-HAL-true,5-MX_ADC2_Init-ADC2-false-HAL-true,6-MX_CAN_Init-CAN-false-HAL-true,7-MX_UART4_Init-UART4-false-HAL-true,8-MX_TIM6_Init-TIM6-false-HAL-true +RCC.ADC12outputFreq_Value=64000000 +RCC.AHBFreq_Value=16000000 +RCC.APB1Freq_Value=16000000 +RCC.APB1TimFreq_Value=16000000 +RCC.APB2Freq_Value=16000000 +RCC.APB2TimFreq_Value=16000000 +RCC.CortexFreq_Value=16000000 +RCC.FCLKCortexFreq_Value=16000000 +RCC.FamilyName=M +RCC.HCLKFreq_Value=16000000 +RCC.HSEPLLFreq_Value=16000000 +RCC.HSE_VALUE=16000000 +RCC.HSIPLLFreq_Value=4000000 +RCC.HSI_VALUE=8000000 +RCC.I2C1Freq_Value=8000000 +RCC.I2C2Freq_Value=8000000 +RCC.I2SClocksFreq_Value=16000000 +RCC.IPParameters=ADC12outputFreq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSEPLLFreq_Value,HSE_VALUE,HSIPLLFreq_Value,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSourceVirtual,TIM1Freq_Value,TIM2Freq_Value,UART4Freq_Value,UART5Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOOutput2Freq_Value +RCC.LSE_VALUE=32768 +RCC.LSI_VALUE=40000 +RCC.MCOFreq_Value=16000000 +RCC.PLLCLKFreq_Value=64000000 +RCC.PLLMCOFreq_Value=32000000 +RCC.PLLMUL=RCC_PLL_MUL4 +RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE +RCC.RTCFreq_Value=40000 +RCC.RTCHSEDivFreq_Value=500000 +RCC.SYSCLKFreq_VALUE=16000000 +RCC.SYSCLKSourceVirtual=RCC_SYSCLKSOURCE_HSE +RCC.TIM1Freq_Value=16000000 +RCC.TIM2Freq_Value=16000000 +RCC.UART4Freq_Value=16000000 +RCC.UART5Freq_Value=16000000 +RCC.USART1Freq_Value=16000000 +RCC.USART2Freq_Value=16000000 +RCC.USART3Freq_Value=16000000 +RCC.USBFreq_Value=64000000 +RCC.VCOOutput2Freq_Value=16000000 +SH.ADCx_IN6.0=ADC1_IN6,IN6-Single-Ended +SH.ADCx_IN6.ConfNb=1 +SH.ADCx_IN7.0=ADC1_IN7,IN7-Single-Ended +SH.ADCx_IN7.ConfNb=1 +SH.ADCx_IN8.0=ADC1_IN8,IN8-Single-Ended +SH.ADCx_IN8.ConfNb=1 +SH.ADCx_IN9.0=ADC2_IN9,IN9-Single-Ended +SH.ADCx_IN9.ConfNb=1 +TIM6.IPParameters=Prescaler,Period,TIM_MasterOutputTrigger +TIM6.Period=8000-1 +TIM6.Prescaler=400 +TIM6.TIM_MasterOutputTrigger=TIM_TRGO_UPDATE +VP_SYS_VS_Systick.Mode=SysTick +VP_SYS_VS_Systick.Signal=SYS_VS_Systick +VP_TIM6_VS_ClockSourceINT.Mode=Enable_Timer +VP_TIM6_VS_ClockSourceINT.Signal=TIM6_VS_ClockSourceINT +board=custom +isbadioc=false diff --git a/Software/Code/STM32F302RBTX_FLASH.ld b/Software/Code/STM32F302RBTX_FLASH.ld new file mode 100644 index 0000000..0b90042 --- /dev/null +++ b/Software/Code/STM32F302RBTX_FLASH.ld @@ -0,0 +1,187 @@ +/* +****************************************************************************** +** +** @file : LinkerScript.ld +** +** @author : Auto-generated by STM32CubeIDE +** +** @brief : Linker script for STM32F302RBTx Device from STM32F3 series +** 128KBytes FLASH +** 32KBytes RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +****************************************************************************** +** @attention +** +** Copyright (c) 2025 STMicroelectronics. +** All rights reserved. +** +** This software is licensed under terms that can be found in the LICENSE file +** in the root directory of this software component. +** If no LICENSE file comes with this software, it is provided AS-IS. +** +****************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ + +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Memories definition */ +MEMORY +{ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K + FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K +} + +/* Sections */ +SECTIONS +{ + /* The startup code into "FLASH" Rom type memory */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data into "FLASH" Rom type memory */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data into "FLASH" Rom type memory */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ + { + . = ALIGN(4); + *(.ARM.extab* .gnu.linkonce.armextab.*) + . = ALIGN(4); + } >FLASH + + .ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ + { + . = ALIGN(4); + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + . = ALIGN(4); + } >FLASH + + .preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ + { + . = ALIGN(4); + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + . = ALIGN(4); + } >FLASH + + .init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ + { + . = ALIGN(4); + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + . = ALIGN(4); + } >FLASH + + .fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ + { + . = ALIGN(4); + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + . = ALIGN(4); + } >FLASH + + /* Used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections into "RAM" Ram type memory */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + *(.RamFunc) /* .RamFunc sections */ + *(.RamFunc*) /* .RamFunc* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + + } >RAM AT> FLASH + + /* Uninitialized data section into "RAM" Ram type memory */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + /* Remove information from the compiler libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/Software/STM.ioc b/Software/PDU_FT25.ioc similarity index 100% rename from Software/STM.ioc rename to Software/PDU_FT25.ioc